Skip to content

Commit

Permalink
MIDI Click: Ensured clock messages are sent even if the device is not…
Browse files Browse the repository at this point in the history
… being used in an Edit
  • Loading branch information
drowaudio committed May 11, 2023
1 parent 4b8cb80 commit bea8f8d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class MidiOutputDevice : public OutputDevice
void flipSendingTimecode();

void setSendControllerMidiClock (bool b) noexcept { sendControllerMidiClock = b; }
bool isSendingControllerMidiClock() const noexcept { return sendControllerMidiClock; }

//==============================================================================
void fireMessage (const juce::MidiMessage&);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,24 @@ std::unique_ptr<tracktion::graph::Node> createNodeForEdit (EditPlaybackContext&
}
}

// Add deviceNodes for any devices only being used by the MIDI clock or MTC
for (int i = edit.engine.getDeviceManager().getNumMidiOutDevices(); --i >= 0;)
{
if (auto device = edit.engine.getDeviceManager().getMidiOutDevice (i))
{
const bool isSendingMidi = device->isSendingClock()
|| device->isSendingTimecode()
|| device->isSendingControllerMidiClock();

if (! isSendingMidi)
continue;

auto& trackNodeVector = deviceNodes[device];
juce::ignoreUnused (trackNodeVector);
// We don't need to add anything to the vector, just ensure the device is in the map
}
}


auto outputNode = std::make_unique<tracktion::graph::SummingNode>();

Expand Down

0 comments on commit bea8f8d

Please sign in to comment.