Skip to content

Commit

Permalink
Add MidiDispatcher::processTrack() method with other adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
gvnnz committed Aug 13, 2024
1 parent 7b41894 commit 28f6dbd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
19 changes: 12 additions & 7 deletions src/core/midiDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void MidiDispatcher::process(const MidiEvent& e)
return;

processMaster(e);
processChannels(e);
processTracks(e);
onEventReceived();
}

Expand Down Expand Up @@ -181,13 +181,18 @@ void MidiDispatcher::processPlugins(ID channelId, const std::vector<Plugin*>& pl

/* -------------------------------------------------------------------------- */

void MidiDispatcher::processChannels(const MidiEvent& midiEvent)
void MidiDispatcher::processTracks(const MidiEvent& midiEvent)
{
m_model.get().tracks.forEachChannel([this, &midiEvent](const Channel& c)
{
processChannel(c, midiEvent);
return true;
});
for (const model::Track& track : m_model.get().tracks.getAll())
processChannels(track.getChannels().getAll(), midiEvent);
}

/* -------------------------------------------------------------------------- */

void MidiDispatcher::processChannels(const std::vector<Channel>& channels, const MidiEvent& midiEvent)
{
for (const Channel& ch : channels)
processChannel(ch, midiEvent);
}

/* -------------------------------------------------------------------------- */
Expand Down
3 changes: 2 additions & 1 deletion src/core/midiDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ class MidiDispatcher
bool isMasterMidiInAllowed(int c);
bool isChannelMidiInAllowed(ID channelId, int c);

void processChannels(const MidiEvent&);
void processTracks(const MidiEvent&);
void processChannels(const std::vector<Channel>&, const MidiEvent&);
void processChannel(const Channel&, const MidiEvent&);
void processMaster(const MidiEvent&);

Expand Down

0 comments on commit 28f6dbd

Please sign in to comment.