diff --git a/src/core/src/IO/midi_input.cpp b/src/core/src/IO/midi_input.cpp index 39dfb25ea..c47f4173b 100644 --- a/src/core/src/IO/midi_input.cpp +++ b/src/core/src/IO/midi_input.cpp @@ -306,7 +306,8 @@ void MidiInput::handleSysexMessage( const MidiMessage& msg ) 4 Fast Forward 5 Rewind 6 Record strobe (punch in) - 7 Record exit (punch out) + 7 Record exit (punch out) + 8 Record ready 9 Pause @@ -375,6 +376,11 @@ if ( msg.m_sysexData.size() == 6 ) { aH->handleAction(mM->getMMCAction("MMC_RECORD_EXIT")); break; + case 8: // RECORD READY + pEngine->lastMidiEvent = "MMC_RECORD_READY"; + aH->handleAction(mM->getMMCAction("MMC_RECORD_READY")); + break; + case 9: //PAUSE pEngine->lastMidiEvent = "MMC_PAUSE"; aH->handleAction(mM->getMMCAction("MMC_PAUSE")); diff --git a/src/core/src/midi_action.cpp b/src/core/src/midi_action.cpp index 70334decc..ca5b09ba4 100644 --- a/src/core/src/midi_action.cpp +++ b/src/core/src/midi_action.cpp @@ -128,6 +128,10 @@ MidiActionManager::MidiActionManager() : Object( __class_name ) << "PLAY/PAUSE_TOGGLE" << "STOP" << "PAUSE" + << "RECORD_READY" + << "RECORD/STROBE_TOGGLE" + << "RECORD_STROBE" + << "RECORD_EXIT" << "MUTE" << "UNMUTE" << "MUTE_TOGGLE" @@ -149,8 +153,8 @@ MidiActionManager::MidiActionManager() : Object( __class_name ) << "EFFECT3_LEVEL_ABSOLUTE" << "EFFECT4_LEVEL_ABSOLUTE" << "SELECT_NEXT_PATTERN" - << "SELECT_NEXT_PATTERN_PROMPTLY" - << "SELECT_AND_PLAY_PATTERN" + << "SELECT_NEXT_PATTERN_PROMPTLY" + << "SELECT_AND_PLAY_PATTERN" << "PAN_RELATIVE" << "PAN_ABSOLUTE" << "BEATCOUNTER" @@ -167,6 +171,7 @@ MidiActionManager::MidiActionManager() : Object( __class_name ) << "MMC_REWIND" << "MMC_RECORD_STROBE" << "MMC_RECORD_EXIT" + << "MMC_RECORD_READY" << "MMC_PAUSE" << "NOTE" << "CC"; @@ -688,6 +693,43 @@ bool MidiActionManager::handleAction( MidiAction * pAction ){ } return true; } + + if( sActionString == "RECORD_READY"){ + if ( pEngine->getState() != STATE_PLAYING ) { + if (!Preferences::get_instance()->getRecordEvents()) { + Preferences::get_instance()->setRecordEvents(true); + } + else { + Preferences::get_instance()->setRecordEvents(false); + } + } + return true; + } + if( sActionString == "RECORD/STROBE_TOGGLE"){ + if (!Preferences::get_instance()->getRecordEvents()) { + Preferences::get_instance()->setRecordEvents(true); + } + else { + Preferences::get_instance()->setRecordEvents(false); + } + return true; + } + + if( sActionString == "RECORD_STROBE"){ + + if (!Preferences::get_instance()->getRecordEvents()) { + Preferences::get_instance()->setRecordEvents(true); + } + return true; + } + + if( sActionString == "RECORD_EXIT"){ + + if (Preferences::get_instance()->getRecordEvents()) { + Preferences::get_instance()->setRecordEvents(false); + } + return true; + } return false; } diff --git a/src/gui/src/PlayerControl.cpp b/src/gui/src/PlayerControl.cpp index 3d9101bd1..9eb6fea95 100644 --- a/src/gui/src/PlayerControl.cpp +++ b/src/gui/src/PlayerControl.cpp @@ -114,6 +114,8 @@ PlayerControl::PlayerControl(QWidget *parent) m_pRecBtn->setToolTip( trUtf8("Record") ); connect(m_pRecBtn, SIGNAL(clicked(Button*)), this, SLOT(recBtnClicked(Button*))); connect(m_pRecBtn, SIGNAL(rightClicked(Button*)), this, SLOT(recBtnRightClicked(Button*))); + MidiAction* pAction = new MidiAction("RECORD_READY"); + m_pRecBtn->setAction( pAction ); // Record+delete button @@ -145,7 +147,7 @@ PlayerControl::PlayerControl(QWidget *parent) m_pPlayBtn->setPressed(false); m_pPlayBtn->setToolTip( trUtf8("Play/ Pause") ); connect(m_pPlayBtn, SIGNAL(clicked(Button*)), this, SLOT(playBtnClicked(Button*))); - MidiAction* pAction = new MidiAction("PLAY"); + pAction = new MidiAction("PLAY"); m_pPlayBtn->setAction( pAction );