diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h index 2102a8e742..ca971d63a6 100644 --- a/libs/ardour/ardour/location.h +++ b/libs/ardour/ardour/location.h @@ -99,6 +99,7 @@ public: void set_auto_loop (bool yn, void *src); void set_hidden (bool yn, void *src); void set_cd (bool yn, void *src); + void set_cue (bool yn, void *src); void set_is_range_marker (bool yn, void* src); void set_is_clock_origin (bool yn, void* src); void set_skip (bool yn); @@ -132,6 +133,7 @@ public: static PBD::Signal1 start_changed; static PBD::Signal1 flags_changed; static PBD::Signal1 lock_changed; + static PBD::Signal1 cue_change; /* this is sent only when both start and end change at the same time */ static PBD::Signal1 changed; diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc index 69e262a04e..729c880f7a 100644 --- a/libs/ardour/location.cc +++ b/libs/ardour/location.cc @@ -62,6 +62,7 @@ PBD::Signal1 Location::start_changed; PBD::Signal1 Location::flags_changed; PBD::Signal1 Location::lock_changed; PBD::Signal1 Location::changed; +PBD::Signal1 Location::cue_change; Location::Location (Session& s) : SessionHandleRef (s) @@ -240,6 +241,10 @@ Location::set_start (Temporal::timepos_t const & s, bool force) } } + if (is_cue_marker()) { + cue_change (this); + } + assert (_start.is_positive() || _start.is_zero()); return 0; @@ -369,6 +374,10 @@ Location::set (Temporal::timepos_t const & s, Temporal::timepos_t const & e) EndChanged(); /* EMIT SIGNAL */ } + if (is_cue_marker()) { + cue_change (this); + } + return 0; } @@ -386,6 +395,10 @@ Location::move_to (Temporal::timepos_t const & pos) changed (this); /* EMIT SIGNAL */ Changed (); /* EMIT SIGNAL */ + + if (is_cue_marker()) { + cue_change (this); + } } assert (_start >= 0); @@ -417,6 +430,15 @@ Location::set_cd (bool yn, void*) } } +void +Location::set_cue (bool yn, void*) +{ + if (set_flag_internal (yn, IsCueMarker)) { + flags_changed (this); /* EMIT SIGNAL */ + FlagsChanged (); + } +} + void Location::set_is_range_marker (bool yn, void*) { @@ -981,6 +1003,10 @@ Locations::add (Location *loc, bool make_current) Session::StartTimeChanged (0); Session::EndTimeChanged (1); } + + if (loc->is_cue_marker()) { + Location::cue_change (loc); + } } Location*