Skip to content

Commit

Permalink
Make m::rendering::sendMidiToOut() function public
Browse files Browse the repository at this point in the history
  • Loading branch information
gvnnz committed Feb 22, 2024
1 parent a24bfd2 commit a374016
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/core/rendering/midiOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@ std::function<void(ID)> onSend_ = nullptr;

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

void sendMidiToOut_(ID channelId, MidiEvent e, int outputFilter, KernelMidi& kernelMidi)
{
assert(onSend_ != nullptr);

e.setChannel(outputFilter);
kernelMidi.send(e);
onSend_(channelId);
}

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

template <typename KernelMidiI>
void sendMidiLightning_(ID channelId, uint32_t learnt, const MidiMap::Message& msg, MidiMapper<KernelMidiI>& midiMapper)
{
Expand Down Expand Up @@ -86,7 +75,7 @@ void sendMidiFromActions(const Channel& ch, const std::vector<Action>& actions,
continue;
sendMidiToPlugins_(ch.shared->midiQueue, action.event, delta);
if (ch.canSendMidi())
sendMidiToOut_(ch.id, action.event, ch.midiChannel->outputFilter, kernelMidi);
sendMidiToOut(ch.id, action.event, ch.midiChannel->outputFilter, kernelMidi);
}
}

Expand All @@ -98,7 +87,7 @@ void sendMidiAllNotesOff(const Channel& ch, KernelMidi& kernelMidi)

sendMidiToPlugins_(ch.shared->midiQueue, e, 0);
if (ch.canSendMidi())
sendMidiToOut_(ch.id, e, ch.midiChannel->outputFilter, kernelMidi);
sendMidiToOut(ch.id, e, ch.midiChannel->outputFilter, kernelMidi);
}

/* -------------------------------------------------------------------------- */
Expand All @@ -116,6 +105,17 @@ void sendMidiEventToPlugins(ChannelShared::MidiQueue& midiQueue, const MidiEvent

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

void sendMidiToOut(ID channelId, MidiEvent e, int outputFilter, KernelMidi& kernelMidi)
{
assert(onSend_ != nullptr);

e.setChannel(outputFilter);
kernelMidi.send(e);
onSend_(channelId);
}

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

template <typename KernelMidiI>
void sendMidiLightningStatus(ID channelId, const MidiLightning& m, ChannelStatus status, bool audible, MidiMapper<KernelMidiI>& midiMapper)
{
Expand Down
5 changes: 5 additions & 0 deletions src/core/rendering/midiOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ on by the PluginHost. */

void sendMidiEventToPlugins(ChannelShared::MidiQueue&, const MidiEvent&);

/* sendMidiToOut
Sends a MIDI event to the outside world. */

void sendMidiToOut(ID channelId, MidiEvent, int outputFilter, KernelMidi&);

/* sendMidiLightning[...]
Sends MIDI lightning messages to the outside world. */

Expand Down

0 comments on commit a374016

Please sign in to comment.