13
0

locations: provide Location::cue_change signal to notify about cue marker changes

This commit is contained in:
Paul Davis 2022-01-04 16:39:25 -07:00
parent 73ca08933d
commit 5783664b9e
2 changed files with 28 additions and 0 deletions

View File

@ -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<void,Location*> start_changed;
static PBD::Signal1<void,Location*> flags_changed;
static PBD::Signal1<void,Location*> lock_changed;
static PBD::Signal1<void,Location*> cue_change;
/* this is sent only when both start and end change at the same time */
static PBD::Signal1<void,Location*> changed;

View File

@ -62,6 +62,7 @@ PBD::Signal1<void,Location*> Location::start_changed;
PBD::Signal1<void,Location*> Location::flags_changed;
PBD::Signal1<void,Location*> Location::lock_changed;
PBD::Signal1<void,Location*> Location::changed;
PBD::Signal1<void,Location*> 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*