58 bool bIsChannelValid =
true;
63 bIsChannelValid =
false;
75 bIsChannelValid =
true;
78 if ( !bIsChannelValid) {
85 ERRORLOG(
"No song loaded, skipping note" );
117 auto pAction = std::make_shared<Action>(
"PLAY");
123 auto pAction = std::make_shared<Action>(
"PLAY");
129 auto pAction = std::make_shared<Action>(
"PAUSE");
143 ERRORLOG( QString(
"MIDI message of type [%1] is not supported by Hydrogen" )
152 ERRORLOG( QString(
"unhandled midi message type: %1 (%2)" )
153 .arg(
static_cast<int>( msg.
m_type ) )
169 if ( ppAction !=
nullptr && ! ppAction->isNull() ) {
170 auto pNewAction = std::make_shared<Action>( ppAction );
171 pNewAction->setValue( QString::number( msg.
m_nData2 ) );
190 for (
const auto& ppAction : pMidiMap->
getPCActions() ) {
191 if ( ppAction !=
nullptr && ! ppAction->isNull() ) {
192 auto pNewAction = std::make_shared<Action>( ppAction );
193 pNewAction->setValue( QString::number( msg.
m_nData1 ) );
207 float fVelocity = msg.
m_nData2 / 127.0;
209 if ( fVelocity == 0 ) {
222 bool bActionSuccess =
false;
224 if ( ppAction !=
nullptr && ! ppAction->isNull() ) {
225 auto pNewAction = std::make_shared<Action>( ppAction );
226 pNewAction->setValue( QString::number( msg.
m_nData2 ) );
228 bActionSuccess =
true;
233 if ( bActionSuccess && pPref->m_bMidiDiscardNoteAfterAction ) {
260 handleNote( msg.
m_nData1, 0.0,
true );
340 INFOLOG( QString(
"MIDI Machine Control command: [%1]" )
349 WARNINGLOG(
"Unknown MIDI Machine Control (MMC) Command" );
354 WARNINGLOG(
"MMC GOTO Message not implemented yet" );
365 WARNINGLOG( QString(
"Unsupported SysEx message: [%1]" )
@ Playing
Transport is rolling.
bool locateToColumn(int nPatternGroup)
Relocates transport to the beginning of a particular column/Pattern group.
bool handleNote(int nNote, float fVelocity, bool bNoteOff=false)
Handle an incoming note event, e.g.
static EventQueue * get_instance()
Returns a pointer to the current EventQueue singleton stored in __instance.
void push_event(const EventType type, const int nValue)
Queues the next event into the EventQueue.
void setLastMidiEventParameter(int nParam)
std::shared_ptr< Song > getSong() const
Get the current song.
static Hydrogen * get_instance()
Returns the current Hydrogen instance __instance.
AudioEngine * getAudioEngine() const
void setLastMidiEvent(MidiMessage::Event event)
CoreActionController * getCoreActionController() const
void setHihatOpenness(int nValue)
QString toQString(const QString &sPrefix="", bool bShort=true) const
Formatted string version for debugging purposes.
Event
Subset of incoming MIDI events that will be handled by Hydrogen.
static QString TypeToQString(MidiMessageType type)
@ POLYPHONIC_KEY_PRESSURE
std::vector< unsigned char > m_sysexData
static QString EventToQString(Event event)
Manager for User Preferences File (singleton)
static Preferences * get_instance()
Returns a pointer to the current Preferences singleton stored in __instance.
The MidiActionManager cares for the execution of MidiActions.
bool handleAction(std::shared_ptr< Action > action)
The handleAction method is the heart of the MidiActionManager class.
static MidiActionManager * get_instance()
Returns a pointer to the current MidiActionManager singleton stored in __instance.
bool handleActions(std::vector< std::shared_ptr< Action > > actions)
Handles multiple actions at once and calls handleAction() on them.
The MidiMap maps MidiActions to MidiEvents.
std::vector< std::shared_ptr< Action > > getCCActions(int nParameter)
Returns the cc action which was linked to the given event.
std::vector< std::shared_ptr< Action > > getPCActions() const
Returns the pc action which was linked to the given event.
static MidiMap * get_instance()
Returns a pointer to the current MidiMap singleton stored in __instance.
std::vector< std::shared_ptr< Action > > getNoteActions(int nNote)
Returns all note actions which are linked to the given event.
std::vector< std::shared_ptr< Action > > getMMCActions(QString sEventString)
Returns all MMC actions which are linked to the given event.