added some implementation for record buttons

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1526 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Csaba Hruska
2008-09-01 23:29:40 +00:00
parent c0c241c9b5
commit da6eef0ec1
5 changed files with 47 additions and 2 deletions

View File

@@ -1,3 +1,12 @@
2008-09-02 Csaba Hruska <csaba.hruska/at/gmail.com>
* include/song.h:
* src/core/song.cpp:
* src/gui/song_editor.cpp:
* src/tracks/sample_track.cpp:
added implementation for recordAndPlay button
record button is disabled because it is not handled yet
2008-08-31 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* include/remote_plugin.h:

View File

@@ -110,6 +110,11 @@ public:
return( m_exporting );
}
inline bool isRecording( void ) const
{
return( m_recording );
}
bool realTimeTask( void ) const;
inline bool isExportDone( void ) const
@@ -190,6 +195,8 @@ public:
public slots:
void play( void );
void record( void );
void playAndRecord( void );
void stop( void );
void playTrack( track * _trackToPlay );
void playBB( void );
@@ -270,6 +277,7 @@ private:
QString m_oldFileName;
bool m_modified;
volatile bool m_recording;
volatile bool m_exporting;
volatile bool m_playing;
volatile bool m_paused;

View File

@@ -81,6 +81,7 @@ song::song( void ) :
m_fileName(),
m_oldFileName(),
m_modified( FALSE ),
m_recording( FALSE ),
m_exporting( FALSE ),
m_playing( FALSE ),
m_paused( FALSE ),
@@ -177,6 +178,7 @@ void song::doActions( void )
timeLine * tl =
m_playPos[m_playMode].m_timeLine;
m_playing = FALSE;
m_recording = TRUE;
if( tl != NULL )
{
@@ -477,6 +479,7 @@ bool song::realTimeTask( void ) const
void song::play( void )
{
m_recording = FALSE;
if( m_playing == TRUE )
{
if( m_playMode != Mode_PlaySong )
@@ -497,6 +500,24 @@ void song::play( void )
void song::record( void )
{
m_recording = TRUE;
// TODO: Implement
}
void song::playAndRecord( void )
{
play();
m_recording = TRUE;
}
void song::playTrack( track * _trackToPlay )
{
if( m_playing == TRUE )

View File

@@ -231,6 +231,9 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
tr( "Record samples from Audio-device while playing song or BB track" ),
this, SLOT( recordAccompany() ), m_toolBar );
// FIXME: disable record button while it is not implemented
m_recordButton->setDisabled( true );
// disable record buttons if capturing is not supported
if( !engine::getMixer()->audioDev()->supportsCapture() )
{
@@ -406,7 +409,7 @@ void songEditor::play( void )
void songEditor::record( void )
{
play();
m_s->record();
}
@@ -414,7 +417,7 @@ void songEditor::record( void )
void songEditor::recordAccompany( void )
{
play();
m_s->playAndRecord();
}

View File

@@ -423,6 +423,10 @@ bool sampleTrack::play( const midiTime & _start, const fpp_t _frames,
playHandle * handle;
if( st->isRecord() )
{
if( !engine::getSong()->isRecording() )
{
return( played_a_note );
}
sampleRecordHandle * smpHandle = new sampleRecordHandle( st );
handle = smpHandle;
}