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

@@ -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;
}