|
Zrythm v2.0.0-alpha.1+31.4967fd053471
a highly automated and intuitive digital audio workstation
|
Tracks note activity and general MIDI activity on an observed port. More...
#include <src/dsp/midi_activity_provider.h>


Public Member Functions | |
| MidiActivityProvider (QObject *parent=nullptr) | |
| dsp::Port * | port () const |
| void | setPort (dsp::Port *port) |
| Q_SIGNAL void | portChanged () |
| dsp::PortObservationManager * | portObservationManager () const |
| void | setPortObservationManager (dsp::PortObservationManager *manager) |
| Q_SIGNAL void | portObservationManagerChanged () |
| bool | hasActivity () const |
| True when any MIDI events were received in the last update cycle. | |
| Q_SIGNAL void | activityChanged () |
| Q_INVOKABLE bool | isNoteActive (int note) const |
Returns true if note (0-127) is currently held. | |
| Q_SIGNAL void | activeNotesChanged () |
| Emitted when the set of active notes changes. | |
| void | update () |
| Drains pending events from the observation cache and updates state. | |
Properties | |
| QML_ELEMENT zrythm::dsp::Port * | port |
| zrythm::dsp::PortObservationManager * | portObservationManager |
| bool | hasActivity |
Tracks note activity and general MIDI activity on an observed port.
Observes a MidiPort via the PortObservationManager infrastructure. A 60fps timer drains MIDI events from the observation cache and updates two kinds of state exposed to QML:
Typical QML usage:
Definition at line 46 of file midi_activity_provider.h.
| Q_INVOKABLE bool zrythm::dsp::MidiActivityProvider::isNoteActive | ( | int | note | ) | const |
Returns true if note (0-127) is currently held.
Channels are aggregated — a note is active if any channel has it held. Overlapping note-ons are reference-counted; the note only becomes inactive when all note-offs have been received.
| void zrythm::dsp::MidiActivityProvider::update | ( | ) |
Drains pending events from the observation cache and updates state.
Called automatically by the internal 60fps timer. Can also be called manually (e.g., in tests).
|
read |
Definition at line 52 of file midi_activity_provider.h.
|
readwrite |
Definition at line 50 of file midi_activity_provider.h.
|
readwrite |
Definition at line 51 of file midi_activity_provider.h.