31 #include <glibmm/threads.h>
53 class MidiStateTracker;
74 const std::string&
name ()
const {
return _name; }
76 virtual void operator() () = 0;
82 std::shared_ptr<MidiModel>
model()
const {
return _model; }
115 change(note, prop,
Variant(new_value));
119 change(note, prop,
Variant(new_time));
125 return !_added_notes.empty() || !_removed_notes.empty();
143 typedef std::list< std::shared_ptr< Evoral::Note<TimeType> > >
NoteList;
185 std::shared_ptr<Evoral::Event<TimeType> >
sysex;
308 bool offset_events =
false);
348 , source_lock (slock)
360 friend class DeltaCommand;
DiffCommand(std::shared_ptr< MidiModel > m, const std::string &name)
std::shared_ptr< MidiModel > _model
std::shared_ptr< MidiModel > model() const
const std::string & name() const
virtual XMLNode & get_state() const =0
virtual int set_state(const XMLNode &, int version)=0
std::list< std::shared_ptr< Evoral::Note< TimeType > > > NoteList
static Variant get_value(const NotePtr note, Property prop)
void side_effect_remove(const NotePtr note)
XMLNode & marshal_note(const NotePtr note) const
XMLNode & marshal_change(const NoteChange &) const
void add(const NotePtr note)
XMLNode & get_state() const
int set_state(const XMLNode &, int version)
void change(const NotePtr note, Property prop, const Variant &new_value)
NoteDiffCommand(std::shared_ptr< MidiModel > m, const std::string &name)
void remove(const NotePtr note)
const NoteList & removed_notes() const
std::list< NoteChange > ChangeList
NoteChange unmarshal_change(XMLNode *xml_note)
NoteDiffCommand(std::shared_ptr< MidiModel > m, const XMLNode &node)
const ChangeList & changes() const
std::set< NotePtr > side_effect_removals
bool adds_or_removes() const
NotePtr unmarshal_note(XMLNode *xml_note)
void change(const NotePtr note, Property prop, TimeType new_time)
void change(const NotePtr note, Property prop, uint8_t new_value)
const NoteList & added_notes() const
static Variant::Type value_type(Property prop)
PatchChangeDiffCommand(std::shared_ptr< MidiModel >, const std::string &)
int set_state(const XMLNode &, int version)
std::list< PatchChangePtr > _removed
std::list< PatchChangePtr > _added
void change_channel(PatchChangePtr, uint8_t)
void change_bank(PatchChangePtr, int)
XMLNode & get_state() const
void change_program(PatchChangePtr, uint8_t)
void change_time(PatchChangePtr, TimeType)
XMLNode & marshal_patch_change(constPatchChangePtr) const
Change unmarshal_change(XMLNode *)
XMLNode & marshal_change(const Change &) const
void remove(PatchChangePtr)
std::list< Change > ChangeList
PatchChangePtr unmarshal_patch_change(XMLNode *)
PatchChangeDiffCommand(std::shared_ptr< MidiModel >, const XMLNode &)
std::list< Change > ChangeList
int set_state(const XMLNode &, int version)
XMLNode & get_state() const
Change unmarshal_change(XMLNode *)
std::list< SysExPtr > _removed
SysExDiffCommand(std::shared_ptr< MidiModel > m, const std::string &name)
void change(std::shared_ptr< Evoral::Event< TimeType > >, TimeType)
XMLNode & marshal_change(const Change &) const
SysExDiffCommand(std::shared_ptr< MidiModel > m, const XMLNode &node)
void remove(SysExPtr sysex)
void source_interpolation_changed(Evoral::Parameter const &, AutomationList::InterpolationStyle)
InsertMergePolicy insert_merge_policy() const
std::map< void *, superclock_t > TempoMappingStash
bool write_section_to(std::shared_ptr< MidiSource > source, const Source::WriterLock &source_lock, Temporal::Beats begin=Temporal::Beats(), Temporal::Beats end=std::numeric_limits< Temporal::Beats >::max(), bool offset_events=false)
TempoMappingStash tempo_mapping_stash
PBD::ScopedConnectionList _midi_source_connections
std::shared_ptr< Evoral::Control > control_factory(const Evoral::Parameter &id)
void rebuild_from_mapping_stash(Temporal::Beats const &offset)
MidiSource & midi_source() const
MidiModel::PatchChangeDiffCommand * new_patch_change_diff_command(const std::string &name="midi edit")
void source_automation_state_changed(Evoral::Parameter const &, AutoState)
void control_list_marked_dirty()
void apply_diff_command_only(PBD::Command *cmd)
void set_insert_merge_policy(InsertMergePolicy)
PBD::Signal< void(Temporal::timecnt_t)> ContentsShifted
void apply_diff_command_as_commit(PBD::HistoryOwner &, PBD::Command *cmd)
int resolve_overlaps_unlocked(const NotePtr, void *arg=0)
MidiModel(MidiModel const &other, MidiSource &)
int set_state(const XMLNode &)
void create_mapping_stash(Temporal::Beats const &offset)
InsertMergePolicy _insert_merge_policy
PatchChangePtr find_patch_change(Evoral::event_id_t)
bool write_to(std::shared_ptr< MidiSource > source, const Source::WriterLock &source_lock)
PBD::Signal< void()> ContentsChanged
MidiModel::NoteDiffCommand * new_note_diff_command(const std::string &name="midi edit")
void control_list_interpolation_changed(Evoral::Parameter const &, AutomationList::InterpolationStyle)
std::shared_ptr< Evoral::Event< TimeType > > find_sysex(Evoral::event_id_t)
void insert_silence_at_start(TimeType)
void automation_list_automation_state_changed(Evoral::Parameter const &, AutoState)
void apply_diff_command_as_subcommand(PBD::HistoryOwner &, PBD::Command *cmd)
MidiModel::SysExDiffCommand * new_sysex_diff_command(const std::string &name="midi edit")
void track_state(timepos_t const &when, MidiStateTracker &) const
void render(const ReadLock &lock, Evoral::EventSink< Temporal::Beats > &dst)
bool sync_to_source(const Source::WriterLock &source_lock)
std::shared_ptr< Evoral::Note< TimeType > > find_note(NotePtr)
MidiSource & _midi_source
std::shared_ptr< Evoral::Note< TimeType > > find_note(Evoral::event_id_t)
void apply_diff_command_as_commit(PBD::HistoryOwner *history, PBD::Command *cmd)
void transpose(NoteDiffCommand *, const NotePtr, int)
XMLNode & get_state() const
Glib::Threads::RWLock::WriterLock WriterLock
std::shared_ptr< PatchChange< Temporal::Beats > > PatchChangePtr
std::shared_ptr< const PatchChange< Temporal::Beats > > constPatchChangePtr
std::shared_ptr< Glib::Threads::RWLock::ReaderLock > ReadLock
std::shared_ptr< Event< Temporal::Beats > > SysExPtr
std::shared_ptr< Evoral::Note< Temporal::Beats > > NotePtr
std::shared_ptr< WriteLockImpl > WriteLock
GtkImageIconNameData name
NoteDiffCommand::Property property
SysExDiffCommand::Property property
std::shared_ptr< Evoral::Event< TimeType > > sysex
WriteLockImpl(Source::WriterLock *slock, Glib::Threads::RWLock &s, Glib::Threads::Mutex &c)
Source::WriterLock * source_lock
static Temporal::Beats max()