[Summary] Marker changes will make session dirty

This commit is contained in:
GZharun 2015-01-20 13:58:23 +02:00
parent a0da0aeab9
commit 3087be2c8a
5 changed files with 61 additions and 25 deletions

View file

@ -482,6 +482,8 @@ Marker::set_selected (bool yn)
reset_color ();
}
}
ARDOUR_UI::instance()->set_session_dirty ();
}
void

View file

@ -115,9 +115,7 @@ MarkerInspectorDialog::_enable_program_change (bool yn)
void
MarkerInspectorDialog::_set_session_dirty ()
{
if (ARDOUR_UI::instance ()->the_editor ().session ()) {
ARDOUR_UI::instance ()->the_editor ().session ()->set_dirty ();
}
ARDOUR_UI::instance()->set_session_dirty ();
}
@ -130,7 +128,6 @@ MarkerInspectorDialog::_lock_button_clicked (WavesButton *button)
} else {
_marker->location()->lock ();
}
_set_session_dirty ();
}
}

View file

@ -1236,9 +1236,14 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
void _locations_changed (const Locations::LocationList&);
void update_skips (Location*, bool consolidate);
void update_marks (Location* loc);
void update_loop (Location* loc);
Locations::LocationList consolidate_skips (Location*);
void sync_locations_to_skips (const Locations::LocationList&);
PBD::ScopedConnectionList skip_connections;
PBD::ScopedConnectionList loop_update_connections;
PBD::ScopedConnectionList mark_update_connections;
PBD::ScopedConnectionList skip_update_connections;
PBD::ScopedConnectionList punch_connections;
void auto_punch_start_changed (Location *);

View file

@ -1397,6 +1397,18 @@ Session::set_auto_loop_location (Location* location)
auto_loop_location_changed (location);
}
void
Session::update_loop (Location* loc)
{
set_dirty ();
}
void
Session::update_marks (Location* loc)
{
set_dirty ();
}
void
Session::update_skips (Location* loc, bool consolidate)
{
@ -1417,6 +1429,8 @@ Session::update_skips (Location* loc, bool consolidate)
}
sync_locations_to_skips (skips);
set_dirty ();
}
Locations::LocationList
@ -1486,31 +1500,47 @@ Session::sync_locations_to_skips (const Locations::LocationList& locations)
void
Session::location_added (Location *location)
{
if (location->is_auto_punch()) {
set_auto_punch_location (location);
}
if (location->is_auto_punch()) {
set_auto_punch_location (location);
}
if (location->is_auto_loop()) {
set_auto_loop_location (location);
}
if (location->is_auto_loop()) {
location->StartChanged.connect_same_thread (loop_update_connections, boost::bind (&Session::update_loop, this, location));
location->EndChanged.connect_same_thread (loop_update_connections, boost::bind (&Session::update_loop, this, location));
location->Changed.connect_same_thread (loop_update_connections, boost::bind (&Session::update_loop, this, location));
location->FlagsChanged.connect_same_thread (loop_update_connections, boost::bind (&Session::update_loop, this, location));
if (location->is_session_range()) {
/* no need for any signal handling or event setting with the session range,
because we keep a direct reference to it and use its start/end directly.
*/
_session_range_location = location;
}
set_auto_loop_location (location);
}
if (location->is_session_range()) {
/* no need for any signal handling or event setting with the session range,
because we keep a direct reference to it and use its start/end directly.
*/
_session_range_location = location;
}
if (location->is_skip()) {
/* listen for per-location signals that require us to update skip-locate events */
if (location->is_mark()) {
/* listen for per-location signals that require us to update skip-locate events */
location->StartChanged.connect_same_thread (mark_update_connections, boost::bind (&Session::update_marks, this, location));
location->Changed.connect_same_thread (mark_update_connections, boost::bind (&Session::update_marks, this, location));
location->FlagsChanged.connect_same_thread (mark_update_connections, boost::bind (&Session::update_marks, this, location));
location->LockChanged.connect_same_thread (mark_update_connections, boost::bind (&Session::update_marks, this, location));
location->NameChanged.connect_same_thread (mark_update_connections, boost::bind (&Session::update_marks, this, location));
}
location->StartChanged.connect_same_thread (skip_connections, boost::bind (&Session::update_skips, this, location, true));
location->EndChanged.connect_same_thread (skip_connections, boost::bind (&Session::update_skips, this, location, true));
location->Changed.connect_same_thread (skip_connections, boost::bind (&Session::update_skips, this, location, true));
location->FlagsChanged.connect_same_thread (skip_connections, boost::bind (&Session::update_skips, this, location, false));
if (location->is_skip()) {
/* listen for per-location signals that require us to update skip-locate events */
update_skips (location, true);
}
location->StartChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_skips, this, location, true));
location->EndChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_skips, this, location, true));
location->Changed.connect_same_thread (skip_update_connections, boost::bind (&Session::update_skips, this, location, true));
location->FlagsChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_skips, this, location, false));
update_skips (location, true);
}
set_dirty ();
}

View file

@ -877,6 +877,8 @@ Session::set_play_loop (bool yn, double speed)
}
DEBUG_TRACE (DEBUG::Transport, string_compose ("send TSC2 with speed = %1\n", _transport_speed));
set_dirty ();
TransportStateChange ();
}
void