ardour
|
#include <midi_source.h>
Public Types | |
typedef Evoral::Beats | TimeType |
Public Types inherited from ARDOUR::Source | |
enum | Flag { Writable = 0x1, CanRename = 0x2, Broadcast = 0x4, Removable = 0x8, RemovableIfEmpty = 0x10, RemoveAtDestroy = 0x20, NoPeakFile = 0x40, Destructive = 0x80, Empty = 0x100 } |
typedef Glib::Threads::Mutex::Lock | Lock |
Public Attributes | |
PBD::Signal0< void > | ModelChanged |
PBD::Signal2< void, Evoral::Parameter, Evoral::ControlList::InterpolationStyle > | InterpolationChanged |
PBD::Signal2< void, Evoral::Parameter, AutoState > | AutomationStateChanged |
Public Attributes inherited from ARDOUR::Source | |
PBD::Signal0< void > | AnalysisChanged |
AnalysisFeatureList | transients |
Public Attributes inherited from PBD::Stateful | |
PBD::Signal1< void, const PropertyChange & > | PropertyChanged |
Public Attributes inherited from PBD::Destructible | |
PBD::Signal0< void > | Destroyed |
PBD::Signal0< void > | DropReferences |
Static Public Attributes | |
static PBD::Signal1< void, MidiSource * > | MidiSourceCreated |
Static Public Attributes inherited from ARDOUR::Source | |
static PBD::Signal1< void, Source * > | SourceCreated |
Static Public Attributes inherited from PBD::Stateful | |
static int | current_state_version = 0 |
static int | loading_state_version = 0 |
Protected Types | |
typedef std::map < Evoral::Parameter, Evoral::ControlList::InterpolationStyle > | InterpolationStyleMap |
typedef std::map < Evoral::Parameter, AutoState > | AutomationStateMap |
Protected Member Functions | |
virtual void | flush_midi (const Lock &lock)=0 |
virtual framecnt_t | read_unlocked (const Lock &lock, Evoral::EventSink< framepos_t > &dst, framepos_t position, framepos_t start, framecnt_t cnt, MidiStateTracker *tracker, MidiChannelFilter *filter) const =0 |
virtual framecnt_t | write_unlocked (const Lock &lock, MidiRingBuffer< framepos_t > &source, framepos_t position, framecnt_t cnt)=0 |
Protected Member Functions inherited from ARDOUR::SessionHandleRef | |
virtual void | session_going_away () |
virtual void | insanity_check () |
Protected Member Functions inherited from PBD::Stateful | |
void | add_instant_xml (XMLNode &, const std::string &directory_path) |
XMLNode * | instant_xml (const std::string &str, const std::string &directory_path) |
void | add_properties (XMLNode &) |
PropertyChange | set_values (XMLNode const &) |
virtual void | post_set (const PropertyChange &) |
virtual void | send_change (const PropertyChange &) |
virtual void | mid_thaw (const PropertyChange &) |
Additional Inherited Members | |
Static Public Member Functions inherited from ARDOUR::SessionObject | |
static void | make_property_quarks () |
Definition at line 44 of file midi_source.h.
|
protected |
Map of automation states to use for Parameters; if they are not in this map, the correct automation state is Off.
Definition at line 236 of file midi_source.h.
|
protected |
Map of interpolation styles to use for Parameters; if they are not in this map, the correct interpolation style can be obtained from EventTypeMap::interpolation_of ()
Definition at line 230 of file midi_source.h.
Definition at line 47 of file midi_source.h.
ARDOUR::MidiSource::MidiSource | ( | Session & | session, |
std::string | name, | ||
Source::Flag | flags = Source::Flag(0) |
||
) |
Definition at line 71 of file midi_source.cc.
|
virtual |
Definition at line 85 of file midi_source.cc.
|
pure virtual |
Append a single event with a timestamp in beats.
Caller must ensure that the event is later than the last written event.
Implemented in ARDOUR::SMFSource, and ARDOUR::MidiPlaylistSource.
|
pure virtual |
Append a single event with a timestamp in frames.
Caller must ensure that the event is later than the last written event.
Implemented in ARDOUR::SMFSource, and ARDOUR::MidiPlaylistSource.
AutoState MidiSource::automation_state_of | ( | Evoral::Parameter | p | ) | const |
Definition at line 442 of file midi_source.cc.
|
inline |
Definition at line 143 of file midi_source.h.
void MidiSource::copy_automation_state_from | ( | boost::shared_ptr< MidiSource > | s | ) |
Definition at line 500 of file midi_source.cc.
void MidiSource::copy_automation_state_from | ( | MidiSource * | s | ) |
Definition at line 514 of file midi_source.cc.
void MidiSource::copy_interpolation_from | ( | boost::shared_ptr< MidiSource > | s | ) |
Definition at line 494 of file midi_source.cc.
void MidiSource::copy_interpolation_from | ( | MidiSource * | s | ) |
Definition at line 506 of file midi_source.cc.
|
pure virtual |
Implemented in ARDOUR::SMFSource, and ARDOUR::MidiPlaylistSource.
void MidiSource::drop_model | ( | const Glib::Threads::Mutex::Lock & | lock | ) |
Definition at line 415 of file midi_source.cc.
|
virtual |
Implements ARDOUR::Source.
Reimplemented in ARDOUR::MidiPlaylistSource.
Definition at line 158 of file midi_source.cc.
|
protectedpure virtual |
Implemented in ARDOUR::SMFSource, and ARDOUR::MidiPlaylistSource.
|
virtual |
Implements PBD::Stateful.
Reimplemented in ARDOUR::SMFSource.
Definition at line 90 of file midi_source.cc.
Evoral::ControlList::InterpolationStyle MidiSource::interpolation_of | ( | Evoral::Parameter | p | ) | const |
Definition at line 431 of file midi_source.cc.
void MidiSource::invalidate | ( | const Glib::Threads::Mutex::Lock & | lock, |
std::set< Evoral::Sequence< Evoral::Beats >::WeakNotePtr > * | notes = NULL |
||
) |
Reset cached information (like iterators) when things have changed.
lock | Source lock, which must be held by caller. |
notes | If non-NULL, currently active notes are added to this set. |
Definition at line 181 of file midi_source.cc.
|
virtual |
Implements ARDOUR::Source.
Reimplemented in ARDOUR::MidiPlaylistSource.
Definition at line 164 of file midi_source.cc.
|
inline |
Definition at line 154 of file midi_source.h.
|
inlinevirtual |
Reimplemented from ARDOUR::Source.
Definition at line 151 of file midi_source.h.
|
pure virtual |
Implemented in ARDOUR::SMFSource, and ARDOUR::MidiPlaylistSource.
|
virtual |
Reimplemented in ARDOUR::SMFSource.
Definition at line 314 of file midi_source.cc.
Reimplemented in ARDOUR::SMFSource.
Definition at line 272 of file midi_source.cc.
|
virtual |
Implements ARDOUR::Source.
Reimplemented in ARDOUR::SMFSource.
Definition at line 335 of file midi_source.cc.
|
virtual |
Reimplemented from ARDOUR::Source.
Definition at line 307 of file midi_source.cc.
void MidiSource::mark_write_starting_now | ( | framecnt_t | position, |
framecnt_t | capture_length, | ||
framecnt_t | loop_length | ||
) |
Mark write starting with the given time parameters.
This is called by MidiDiskStream::process before writing to the capture buffer which will be later read by midi_read().
position | The timeline position the source now starts at. |
capture_length | The current length of the capture, which may not be zero if record is armed while rolling. |
loop_length | The loop length if looping, otherwise zero. |
Definition at line 283 of file midi_source.cc.
|
virtual |
Read the data in a given time range from the MIDI source. All time stamps in parameters are in audio frames (even if the source has tempo time).
dst | Ring buffer where read events are written. |
source_start | Start position of the SOURCE in this read context. |
start | Start of range to be read. |
cnt | Length of range to be read (in audio frames). |
tracker | an optional pointer to MidiStateTracker object, for note on/off tracking. |
filtered | Parameters whose MIDI messages will not be returned. |
Definition at line 188 of file midi_source.cc.
|
virtual |
Write data from a MidiRingBuffer to this source.
source | Source to read from. |
source_start | This source's start position in session frames. |
cnt | The length of time to write. |
Definition at line 254 of file midi_source.cc.
|
inline |
Definition at line 168 of file midi_source.h.
|
protectedpure virtual |
Implemented in ARDOUR::SMFSource, and ARDOUR::MidiPlaylistSource.
|
virtual |
Reimplemented from ARDOUR::Source.
Definition at line 378 of file midi_source.cc.
void MidiSource::set_automation_state_of | ( | Evoral::Parameter | p, |
AutoState | s | ||
) |
Definition at line 477 of file midi_source.cc.
|
inline |
Definition at line 144 of file midi_source.h.
void MidiSource::set_interpolation_of | ( | Evoral::Parameter | p, |
Evoral::ControlList::InterpolationStyle | s | ||
) |
Set interpolation style to be used for a given parameter. This change will be propagated to anyone who needs to know.
Definition at line 460 of file midi_source.cc.
|
inline |
Definition at line 153 of file midi_source.h.
void MidiSource::set_model | ( | const Glib::Threads::Mutex::Lock & | lock, |
boost::shared_ptr< MidiModel > | m | ||
) |
Definition at line 423 of file midi_source.cc.
void MidiSource::set_note_mode | ( | const Glib::Threads::Mutex::Lock & | lock, |
NoteMode | mode | ||
) |
Definition at line 407 of file midi_source.cc.
|
virtual |
Implements PBD::Stateful.
Reimplemented in ARDOUR::SMFSource.
Definition at line 114 of file midi_source.cc.
|
virtual |
Implements ARDOUR::Source.
Definition at line 175 of file midi_source.cc.
int MidiSource::write_to | ( | const Lock & | lock, |
boost::shared_ptr< MidiSource > | newsrc, | ||
Evoral::Beats | begin = Evoral::MinBeats , |
||
Evoral::Beats | end = Evoral::MaxBeats |
||
) |
Write the data in the given time range to another MidiSource
newsrc | MidiSource to which data will be written. Should be a new, empty source. If it already has contents, the results are undefined. Source must be writable. |
begin | time of earliest event that can be written. |
end | time of latest event that can be written. |
Definition at line 341 of file midi_source.cc.
|
protectedpure virtual |
Write data to this source from a MidiRingBuffer.
source | Buffer to read from. |
position | This source's start position in session frames. |
cnt | The duration of this block to write for. |
Implemented in ARDOUR::SMFSource, and ARDOUR::MidiPlaylistSource.
|
protected |
Definition at line 237 of file midi_source.h.
|
protected |
The total duration of the current capture.
Definition at line 222 of file midi_source.h.
|
protected |
Length of transport loop during current capture, or zero.
Definition at line 225 of file midi_source.h.
|
protected |
Definition at line 210 of file midi_source.h.
|
protected |
Definition at line 231 of file midi_source.h.
|
mutableprotected |
Definition at line 219 of file midi_source.h.
|
mutableprotected |
Definition at line 218 of file midi_source.h.
|
protected |
Definition at line 212 of file midi_source.h.
|
mutableprotected |
Definition at line 215 of file midi_source.h.
|
mutableprotected |
Definition at line 216 of file midi_source.h.
|
protected |
Definition at line 213 of file midi_source.h.
PBD::Signal2<void, Evoral::Parameter, AutoState> ARDOUR::MidiSource::AutomationStateChanged |
Emitted when a parameter's automation state is changed
Definition at line 187 of file midi_source.h.
PBD::Signal2<void, Evoral::Parameter, Evoral::ControlList::InterpolationStyle> ARDOUR::MidiSource::InterpolationChanged |
Emitted when a parameter's interpolation style is changed
Definition at line 185 of file midi_source.h.
|
static |
Definition at line 146 of file midi_source.h.
PBD::Signal0<void> ARDOUR::MidiSource::ModelChanged |
Emitted when a different MidiModel is set
Definition at line 183 of file midi_source.h.