Song, SongEditor, BB-Editor, Piano-Roll: correction of play button problems
Initial implementation of corrected play buttons in individual editor windows.
This commit is contained in:
committed by
Tobias Doerffel
parent
12221d221f
commit
c60e7ba8d1
@@ -72,6 +72,8 @@ public:
|
||||
return( "automationeditor" );
|
||||
}
|
||||
|
||||
void updatePlayPauseIcon();
|
||||
|
||||
|
||||
public slots:
|
||||
void update();
|
||||
|
||||
@@ -48,6 +48,8 @@ public:
|
||||
|
||||
void removeBBView( int _bb );
|
||||
|
||||
void updatePlayPauseIcon();
|
||||
|
||||
|
||||
public slots:
|
||||
void play();
|
||||
|
||||
@@ -147,6 +147,8 @@ public:
|
||||
return s_controllerRackView;
|
||||
}
|
||||
|
||||
static void updatePlayPauseIcons();
|
||||
|
||||
static float framesPerTick()
|
||||
{
|
||||
return s_framesPerTick;
|
||||
|
||||
@@ -90,6 +90,8 @@ public:
|
||||
return "pianoroll";
|
||||
}
|
||||
|
||||
void updatePlayPauseIcon();
|
||||
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
|
||||
@@ -54,6 +54,7 @@ class EXPORT song : public trackContainer
|
||||
public:
|
||||
enum PlayModes
|
||||
{
|
||||
Mode_None,
|
||||
Mode_PlaySong,
|
||||
Mode_PlayTrack,
|
||||
Mode_PlayBB,
|
||||
@@ -104,6 +105,11 @@ public:
|
||||
return m_playing && m_exporting == false;
|
||||
}
|
||||
|
||||
inline bool isStopped() const
|
||||
{
|
||||
return m_playing == false && m_paused == false;
|
||||
}
|
||||
|
||||
bool isFreezingPattern() const;
|
||||
|
||||
inline bool isExporting() const
|
||||
@@ -196,15 +202,14 @@ public:
|
||||
|
||||
|
||||
public slots:
|
||||
void play();
|
||||
void playSong();
|
||||
void record();
|
||||
void playAndRecord();
|
||||
void stop();
|
||||
void playTrack( track * _trackToPlay );
|
||||
void playBB();
|
||||
void playPattern( pattern * _patternToPlay, bool _loop = true );
|
||||
void pause();
|
||||
void resumeFromPause();
|
||||
void togglePause();
|
||||
void stop();
|
||||
|
||||
void importProject();
|
||||
void exportProject();
|
||||
@@ -231,7 +236,7 @@ private slots:
|
||||
|
||||
void masterVolumeChanged();
|
||||
|
||||
void doActions();
|
||||
void savePos();
|
||||
|
||||
void updateFramesPerTick();
|
||||
|
||||
@@ -296,19 +301,6 @@ private:
|
||||
bool m_loopPattern;
|
||||
|
||||
|
||||
enum Actions
|
||||
{
|
||||
ActionStop,
|
||||
ActionPlaySong,
|
||||
ActionPlayTrack,
|
||||
ActionPlayBB,
|
||||
ActionPlayPattern,
|
||||
ActionPause,
|
||||
ActionResumeFromPause
|
||||
} ;
|
||||
QVector<Actions> m_actions;
|
||||
|
||||
|
||||
friend class engine;
|
||||
friend class songEditor;
|
||||
friend class mainWindow;
|
||||
|
||||
@@ -63,6 +63,8 @@ public:
|
||||
public slots:
|
||||
void scrolled( int _new_pos );
|
||||
|
||||
void updatePlayPauseIcon();
|
||||
|
||||
|
||||
private slots:
|
||||
void setHighQuality( bool );
|
||||
|
||||
@@ -183,27 +183,14 @@ void bbTrackContainer::fixIncorrectPositions()
|
||||
|
||||
void bbTrackContainer::play()
|
||||
{
|
||||
if( engine::getSong()->isPlaying() )
|
||||
{
|
||||
if( engine::getSong()->playMode() != song::Mode_PlayBB )
|
||||
{
|
||||
engine::getSong()->stop();
|
||||
engine::getSong()->playBB();
|
||||
}
|
||||
else
|
||||
{
|
||||
engine::getSong()->pause();
|
||||
}
|
||||
}
|
||||
else if( engine::getSong()->isPaused() )
|
||||
{
|
||||
engine::getSong()->resumeFromPause();
|
||||
}
|
||||
else
|
||||
if( engine::getSong()->playMode() != song::Mode_PlayBB )
|
||||
{
|
||||
engine::getSong()->playBB();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
engine::getSong()->togglePause();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -148,6 +148,17 @@ void engine::destroy()
|
||||
|
||||
|
||||
|
||||
void engine::updatePlayPauseIcons()
|
||||
{
|
||||
s_songEditor->updatePlayPauseIcon();
|
||||
s_automationEditor->updatePlayPauseIcon();
|
||||
s_bbEditor->updatePlayPauseIcon();
|
||||
s_pianoRoll->updatePlayPauseIcon();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void engine::updateFramesPerTick()
|
||||
{
|
||||
s_framesPerTick = s_mixer->processingSampleRate() * 60.0f * 4 /
|
||||
|
||||
@@ -84,7 +84,7 @@ song::song() :
|
||||
m_playing( false ),
|
||||
m_paused( false ),
|
||||
m_loadingProject( false ),
|
||||
m_playMode( Mode_PlaySong ),
|
||||
m_playMode( Mode_None ),
|
||||
m_length( 0 ),
|
||||
m_trackToPlay( NULL ),
|
||||
m_patternToPlay( NULL ),
|
||||
@@ -167,115 +167,14 @@ void song::setTimeSignature()
|
||||
|
||||
|
||||
|
||||
void song::doActions()
|
||||
void song::savePos()
|
||||
{
|
||||
while( !m_actions.empty() )
|
||||
timeLine * tl = m_playPos[m_playMode].m_timeLine;
|
||||
|
||||
if( tl != NULL )
|
||||
{
|
||||
switch( m_actions.front() )
|
||||
{
|
||||
case ActionStop:
|
||||
{
|
||||
timeLine * tl =
|
||||
m_playPos[m_playMode].m_timeLine;
|
||||
m_playing = false;
|
||||
m_recording = true;
|
||||
if( tl != NULL )
|
||||
{
|
||||
|
||||
switch( tl->behaviourAtStop() )
|
||||
{
|
||||
case timeLine::BackToZero:
|
||||
m_playPos[m_playMode].setTicks( 0 );
|
||||
break;
|
||||
|
||||
case timeLine::BackToStart:
|
||||
if( tl->savedPos() >= 0 )
|
||||
{
|
||||
m_playPos[m_playMode].setTicks(
|
||||
tl->savedPos().getTicks() );
|
||||
tl->savePos( -1 );
|
||||
}
|
||||
break;
|
||||
|
||||
case timeLine::KeepStopPosition:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playPos[m_playMode].setTicks( 0 );
|
||||
}
|
||||
|
||||
m_playPos[m_playMode].setCurrentFrame( 0 );
|
||||
|
||||
// remove all note-play-handles that are active
|
||||
engine::getMixer()->clear();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case ActionPlaySong:
|
||||
m_playMode = Mode_PlaySong;
|
||||
m_playing = true;
|
||||
Controller::resetFrameCounter();
|
||||
break;
|
||||
|
||||
case ActionPlayTrack:
|
||||
m_playMode = Mode_PlayTrack;
|
||||
m_playing = true;
|
||||
break;
|
||||
|
||||
case ActionPlayBB:
|
||||
m_playMode = Mode_PlayBB;
|
||||
m_playing = true;
|
||||
break;
|
||||
|
||||
case ActionPlayPattern:
|
||||
m_playMode = Mode_PlayPattern;
|
||||
m_playing = true;
|
||||
break;
|
||||
|
||||
case ActionPause:
|
||||
m_playing = false;// just set the play-flag
|
||||
m_paused = true;
|
||||
break;
|
||||
|
||||
case ActionResumeFromPause:
|
||||
m_playing = true;// just set the play-flag
|
||||
m_paused = false;
|
||||
break;
|
||||
}
|
||||
|
||||
// a second switch for saving pos when starting to play
|
||||
// anything (need pos for restoring it later in certain
|
||||
// timeline-modes)
|
||||
switch( m_actions.front() )
|
||||
{
|
||||
case ActionPlaySong:
|
||||
case ActionPlayTrack:
|
||||
case ActionPlayBB:
|
||||
case ActionPlayPattern:
|
||||
{
|
||||
timeLine * tl =
|
||||
m_playPos[m_playMode].m_timeLine;
|
||||
if( tl != NULL )
|
||||
{
|
||||
tl->savePos( m_playPos[m_playMode] );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// keep GCC happy...
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
m_actions.erase( m_actions.begin() );
|
||||
|
||||
tl->savePos( m_playPos[m_playMode] );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -283,8 +182,6 @@ void song::doActions()
|
||||
|
||||
void song::processNextBuffer()
|
||||
{
|
||||
doActions();
|
||||
|
||||
if( m_playing == false )
|
||||
{
|
||||
return;
|
||||
@@ -488,24 +385,22 @@ bool song::realTimeTask() const
|
||||
|
||||
|
||||
|
||||
void song::play()
|
||||
void song::playSong()
|
||||
{
|
||||
m_recording = false;
|
||||
if( m_playing == true )
|
||||
|
||||
if( isStopped() == false )
|
||||
{
|
||||
if( m_playMode != Mode_PlaySong )
|
||||
{
|
||||
// make sure, bb-editor updates/resets it play-button
|
||||
engine::getBBTrackContainer()->stop();
|
||||
//pianoRoll::inst()->stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
pause();
|
||||
return;
|
||||
}
|
||||
stop();
|
||||
}
|
||||
m_actions.push_back( ActionPlaySong );
|
||||
|
||||
m_playMode = Mode_PlaySong;
|
||||
m_playing = true;
|
||||
m_paused = false;
|
||||
|
||||
savePos();
|
||||
|
||||
engine::updatePlayPauseIcons();
|
||||
}
|
||||
|
||||
|
||||
@@ -522,7 +417,7 @@ void song::record()
|
||||
|
||||
void song::playAndRecord()
|
||||
{
|
||||
play();
|
||||
playSong();
|
||||
m_recording = true;
|
||||
}
|
||||
|
||||
@@ -531,13 +426,19 @@ void song::playAndRecord()
|
||||
|
||||
void song::playTrack( track * _trackToPlay )
|
||||
{
|
||||
if( m_playing == true )
|
||||
if( isStopped() == false )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
m_trackToPlay = _trackToPlay;
|
||||
|
||||
m_actions.push_back( ActionPlayTrack );
|
||||
m_playMode = Mode_PlayTrack;
|
||||
m_playing = true;
|
||||
m_paused = false;
|
||||
|
||||
savePos();
|
||||
|
||||
engine::updatePlayPauseIcons();
|
||||
}
|
||||
|
||||
|
||||
@@ -545,11 +446,18 @@ void song::playTrack( track * _trackToPlay )
|
||||
|
||||
void song::playBB()
|
||||
{
|
||||
if( m_playing == true )
|
||||
if( isStopped() == false )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
m_actions.push_back( ActionPlayBB );
|
||||
|
||||
m_playMode = Mode_PlayBB;
|
||||
m_playing = true;
|
||||
m_paused = false;
|
||||
|
||||
savePos();
|
||||
|
||||
engine::updatePlayPauseIcons();
|
||||
}
|
||||
|
||||
|
||||
@@ -557,16 +465,24 @@ void song::playBB()
|
||||
|
||||
void song::playPattern( pattern * _patternToPlay, bool _loop )
|
||||
{
|
||||
if( m_playing == true )
|
||||
if( isStopped() == false )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
m_patternToPlay = _patternToPlay;
|
||||
m_loopPattern = _loop;
|
||||
|
||||
if( m_patternToPlay != NULL )
|
||||
{
|
||||
m_actions.push_back( ActionPlayPattern );
|
||||
m_playMode = Mode_PlayPattern;
|
||||
m_playing = true;
|
||||
m_paused = false;
|
||||
}
|
||||
|
||||
savePos();
|
||||
|
||||
engine::updatePlayPauseIcons();
|
||||
}
|
||||
|
||||
|
||||
@@ -602,27 +518,68 @@ void song::setPlayPos( tick_t _ticks, PlayModes _play_mode )
|
||||
|
||||
|
||||
|
||||
void song::togglePause()
|
||||
{
|
||||
if( m_paused == true )
|
||||
{
|
||||
m_playing = true;
|
||||
m_paused = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playing = false;
|
||||
m_paused = true;
|
||||
}
|
||||
|
||||
engine::updatePlayPauseIcons();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void song::stop()
|
||||
{
|
||||
m_actions.push_back( ActionStop );
|
||||
}
|
||||
timeLine * tl = m_playPos[m_playMode].m_timeLine;
|
||||
m_playing = false;
|
||||
m_paused = false;
|
||||
m_recording = true;
|
||||
|
||||
if( tl != NULL )
|
||||
{
|
||||
|
||||
switch( tl->behaviourAtStop() )
|
||||
{
|
||||
case timeLine::BackToZero:
|
||||
m_playPos[m_playMode].setTicks( 0 );
|
||||
break;
|
||||
|
||||
case timeLine::BackToStart:
|
||||
if( tl->savedPos() >= 0 )
|
||||
{
|
||||
m_playPos[m_playMode].setTicks(
|
||||
tl->savedPos().getTicks() );
|
||||
tl->savePos( -1 );
|
||||
}
|
||||
break;
|
||||
|
||||
case timeLine::KeepStopPosition:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playPos[m_playMode].setTicks( 0 );
|
||||
}
|
||||
|
||||
m_playPos[m_playMode].setCurrentFrame( 0 );
|
||||
|
||||
void song::pause()
|
||||
{
|
||||
m_actions.push_back( ActionPause );
|
||||
}
|
||||
// remove all note-play-handles that are active
|
||||
engine::getMixer()->clear();
|
||||
|
||||
m_playMode = Mode_None;
|
||||
|
||||
|
||||
|
||||
void song::resumeFromPause()
|
||||
{
|
||||
m_actions.push_back( ActionResumeFromPause );
|
||||
engine::updatePlayPauseIcons();
|
||||
}
|
||||
|
||||
|
||||
@@ -631,10 +588,8 @@ void song::resumeFromPause()
|
||||
void song::startExport()
|
||||
{
|
||||
stop();
|
||||
doActions();
|
||||
|
||||
play();
|
||||
doActions();
|
||||
playSong();
|
||||
|
||||
m_exporting = true;
|
||||
}
|
||||
@@ -736,6 +691,12 @@ void song::clearProject()
|
||||
stop();
|
||||
}
|
||||
|
||||
for( int i = 0; i < Mode_Count; i++ )
|
||||
{
|
||||
setPlayPos( 0, ( PlayModes )i );
|
||||
}
|
||||
|
||||
|
||||
engine::getMixer()->lock();
|
||||
if( engine::getBBEditor() )
|
||||
{
|
||||
@@ -800,6 +761,7 @@ void song::createNewProject()
|
||||
{
|
||||
QString default_template = configManager::inst()->userProjectsDir()
|
||||
+ "templates/default.mpt";
|
||||
|
||||
if( QFile::exists( default_template ) )
|
||||
{
|
||||
createNewProjectFromTemplate( default_template );
|
||||
|
||||
@@ -413,6 +413,28 @@ void AutomationEditor::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void AutomationEditor::updatePlayPauseIcon()
|
||||
{
|
||||
if( engine::getSong()->playMode() != song::Mode_PlayPattern )
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( engine::getSong()->isPlaying() )
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AutomationEditor::updateAfterPatternChange()
|
||||
{
|
||||
QMutexLocker m( &m_patternMutex );
|
||||
@@ -1712,59 +1734,30 @@ void AutomationEditor::play()
|
||||
engine::getSong()->stop();
|
||||
engine::getSong()->playPattern( (pattern *)
|
||||
engine::getPianoRoll()->currentPattern() );
|
||||
m_playButton->setIcon( embed::getIconPixmap(
|
||||
"pause" ) );
|
||||
}
|
||||
else if( engine::getSong()->isPlaying() )
|
||||
else if( engine::getSong()->isStopped() == false )
|
||||
{
|
||||
engine::getSong()->pause();
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
else if( engine::getSong()->isPaused() )
|
||||
{
|
||||
engine::getSong()->resumeFromPause();
|
||||
m_playButton->setIcon( embed::getIconPixmap(
|
||||
"pause" ) );
|
||||
engine::getSong()->togglePause();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap(
|
||||
"pause" ) );
|
||||
engine::getSong()->playPattern( (pattern *)
|
||||
engine::getPianoRoll()->currentPattern() );
|
||||
}
|
||||
}
|
||||
else if( inBBEditor() )
|
||||
{
|
||||
if( engine::getSong()->isPlaying() )
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap(
|
||||
"pause" ) );
|
||||
}
|
||||
engine::getBBTrackContainer()->play();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( engine::getSong()->isPlaying() )
|
||||
if( engine::getSong()->isStopped() == true )
|
||||
{
|
||||
engine::getSong()->pause();
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
else if( engine::getSong()->isPaused() )
|
||||
{
|
||||
engine::getSong()->resumeFromPause();
|
||||
m_playButton->setIcon( embed::getIconPixmap(
|
||||
"pause" ) );
|
||||
engine::getSong()->playSong();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap(
|
||||
"pause" ) );
|
||||
engine::getSong()->play();
|
||||
engine::getSong()->togglePause();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1788,8 +1781,6 @@ void AutomationEditor::stop()
|
||||
{
|
||||
engine::getSong()->stop();
|
||||
}
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
m_playButton->update();
|
||||
m_scrollBack = TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -157,35 +157,38 @@ void bbEditor::removeBBView( int _bb )
|
||||
|
||||
|
||||
|
||||
void bbEditor::play()
|
||||
void bbEditor::updatePlayPauseIcon()
|
||||
{
|
||||
if( engine::getSong()->isPlaying() )
|
||||
if( engine::getSong()->playMode() != song::Mode_PlayBB )
|
||||
{
|
||||
if( engine::getSong()->playMode() != song::Mode_PlayBB )
|
||||
{
|
||||
engine::getSong()->stop();
|
||||
engine::getSong()->playBB();
|
||||
m_playButton->setIcon( embed::getIconPixmap(
|
||||
"pause" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
engine::getSong()->pause();
|
||||
m_playButton->setIcon( embed::getIconPixmap(
|
||||
"play" ) );
|
||||
}
|
||||
}
|
||||
else if( engine::getSong()->isPaused() )
|
||||
{
|
||||
engine::getSong()->resumeFromPause();
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
if( engine::getSong()->isPlaying() )
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bbEditor::play()
|
||||
{
|
||||
if( engine::getSong()->playMode() != song::Mode_PlayBB )
|
||||
{
|
||||
engine::getSong()->playBB();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
engine::getSong()->togglePause();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -194,8 +197,6 @@ void bbEditor::play()
|
||||
void bbEditor::stop()
|
||||
{
|
||||
engine::getSong()->stop();
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
m_playButton->update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -776,6 +776,28 @@ void pianoRoll::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::updatePlayPauseIcon()
|
||||
{
|
||||
if( engine::getSong()->playMode() != song::Mode_PlayPattern )
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( engine::getSong()->isPlaying() )
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
inline void pianoRoll::drawNoteRect( QPainter & _p, int _x, int _y,
|
||||
int _width, note * _n )
|
||||
{
|
||||
@@ -3222,30 +3244,13 @@ void pianoRoll::play()
|
||||
return;
|
||||
}
|
||||
|
||||
if( engine::getSong()->isPlaying() )
|
||||
if( engine::getSong()->playMode() != song::Mode_PlayPattern )
|
||||
{
|
||||
if( engine::getSong()->playMode() != song::Mode_PlayPattern )
|
||||
{
|
||||
engine::getSong()->stop();
|
||||
engine::getSong()->playPattern( m_pattern );
|
||||
m_playButton->setIcon( embed::getIconPixmap(
|
||||
"pause" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
engine::getSong()->pause();
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
}
|
||||
else if( engine::getSong()->isPaused() )
|
||||
{
|
||||
engine::getSong()->resumeFromPause();
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
engine::getSong()->playPattern( m_pattern );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
engine::getSong()->playPattern( m_pattern );
|
||||
engine::getSong()->togglePause();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3286,7 +3291,7 @@ void pianoRoll::recordAccompany()
|
||||
|
||||
if( m_pattern->getTrack()->getTrackContainer() == engine::getSong() )
|
||||
{
|
||||
engine::getSong()->play();
|
||||
engine::getSong()->playSong();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3301,8 +3306,6 @@ void pianoRoll::recordAccompany()
|
||||
void pianoRoll::stop()
|
||||
{
|
||||
engine::getSong()->stop();
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
m_playButton->update();
|
||||
m_recording = false;
|
||||
m_scrollBack = true;
|
||||
}
|
||||
|
||||
@@ -423,17 +423,37 @@ void songEditor::scrolled( int _new_pos )
|
||||
|
||||
|
||||
|
||||
void songEditor::play()
|
||||
void songEditor::updatePlayPauseIcon()
|
||||
{
|
||||
m_s->play();
|
||||
engine::getPianoRoll()->stopRecording();
|
||||
if( m_s->playMode() == song::Mode_PlaySong )
|
||||
if( engine::getSong()->playMode() != song::Mode_PlaySong )
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
if( engine::getSong()->isPlaying() )
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void songEditor::play()
|
||||
{
|
||||
if( engine::getSong()->playMode() != song::Mode_PlaySong )
|
||||
{
|
||||
engine::getSong()->playSong();
|
||||
}
|
||||
else
|
||||
{
|
||||
engine::getSong()->togglePause();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,7 +480,6 @@ void songEditor::stop()
|
||||
{
|
||||
m_s->stop();
|
||||
engine::getPianoRoll()->stopRecording();
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user