Save location UI clock mode in Session instant.xml (#4507).
git-svn-id: svn://localhost/ardour2/branches/3.0@10813 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8b07828f0b
commit
d9c9d0e8a8
|
@ -53,6 +53,7 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "window_proxy.h"
|
#include "window_proxy.h"
|
||||||
#include "global_port_matrix.h"
|
#include "global_port_matrix.h"
|
||||||
|
#include "location_ui.h"
|
||||||
|
|
||||||
#include <gtkmm2ext/application.h>
|
#include <gtkmm2ext/application.h>
|
||||||
|
|
||||||
|
@ -825,9 +826,11 @@ ARDOUR_UI::save_ardour_state ()
|
||||||
if (_session) {
|
if (_session) {
|
||||||
_session->add_instant_xml (enode);
|
_session->add_instant_xml (enode);
|
||||||
_session->add_instant_xml (mnode);
|
_session->add_instant_xml (mnode);
|
||||||
|
_session->add_instant_xml (location_ui->get()->ui().get_state ());
|
||||||
} else {
|
} else {
|
||||||
Config->add_instant_xml (enode);
|
Config->add_instant_xml (enode);
|
||||||
Config->add_instant_xml (mnode);
|
Config->add_instant_xml (mnode);
|
||||||
|
Config->add_instant_xml (location_ui->get()->ui().get_state ());
|
||||||
}
|
}
|
||||||
|
|
||||||
Keyboard::save_keybindings ();
|
Keyboard::save_keybindings ();
|
||||||
|
|
|
@ -201,7 +201,6 @@ LocationEditRow::set_session (Session *sess)
|
||||||
start_clock.set_session (_session);
|
start_clock.set_session (_session);
|
||||||
end_clock.set_session (_session);
|
end_clock.set_session (_session);
|
||||||
length_clock.set_session (_session);
|
length_clock.set_session (_session);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -717,7 +716,6 @@ LocationUI::LocationUI ()
|
||||||
i_am_the_modifier = 0;
|
i_am_the_modifier = 0;
|
||||||
|
|
||||||
_clock_group = new ClockGroup;
|
_clock_group = new ClockGroup;
|
||||||
_clock_group->set_clock_mode (AudioClock::Frames);
|
|
||||||
|
|
||||||
VBox* vbox = manage (new VBox);
|
VBox* vbox = manage (new VBox);
|
||||||
|
|
||||||
|
@ -1066,6 +1064,7 @@ LocationUI::set_session(ARDOUR::Session* s)
|
||||||
_session->locations()->StateChanged.connect (_session_connections, invalidator (*this), boost::bind (&LocationUI::refresh_location_list, this), gui_context());
|
_session->locations()->StateChanged.connect (_session_connections, invalidator (*this), boost::bind (&LocationUI::refresh_location_list, this), gui_context());
|
||||||
_session->locations()->added.connect (_session_connections, invalidator (*this), ui_bind (&LocationUI::location_added, this, _1), gui_context());
|
_session->locations()->added.connect (_session_connections, invalidator (*this), ui_bind (&LocationUI::location_added, this, _1), gui_context());
|
||||||
_session->locations()->removed.connect (_session_connections, invalidator (*this), ui_bind (&LocationUI::location_removed, this, _1), gui_context());
|
_session->locations()->removed.connect (_session_connections, invalidator (*this), ui_bind (&LocationUI::location_removed, this, _1), gui_context());
|
||||||
|
_clock_group->set_clock_mode (clock_mode_from_session_instant_xml ());
|
||||||
}
|
}
|
||||||
|
|
||||||
loop_edit_row.set_session (s);
|
loop_edit_row.set_session (s);
|
||||||
|
@ -1106,6 +1105,30 @@ LocationUI::session_going_away()
|
||||||
SessionHandlePtr::session_going_away ();
|
SessionHandlePtr::session_going_away ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XMLNode &
|
||||||
|
LocationUI::get_state () const
|
||||||
|
{
|
||||||
|
XMLNode* node = new XMLNode (X_("LocationUI"));
|
||||||
|
node->add_property (X_("clock-mode"), enum_2_string (_clock_group->clock_mode ()));
|
||||||
|
return *node;
|
||||||
|
}
|
||||||
|
|
||||||
|
AudioClock::Mode
|
||||||
|
LocationUI::clock_mode_from_session_instant_xml () const
|
||||||
|
{
|
||||||
|
XMLNode* node = _session->instant_xml (X_("LocationUI"));
|
||||||
|
if (!node) {
|
||||||
|
return AudioClock::Frames;
|
||||||
|
}
|
||||||
|
|
||||||
|
XMLProperty* p = node->property (X_("clock-mode"));
|
||||||
|
if (!p) {
|
||||||
|
return AudioClock::Frames;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (AudioClock::Mode) string_2_enum (p->value (), AudioClock::Mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*------------------------*/
|
/*------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -156,6 +156,8 @@ class LocationUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
||||||
|
|
||||||
void refresh_location_list ();
|
void refresh_location_list ();
|
||||||
|
|
||||||
|
XMLNode & get_state () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ARDOUR::LocationStack* locations;
|
ARDOUR::LocationStack* locations;
|
||||||
ARDOUR::Location *newest_location;
|
ARDOUR::Location *newest_location;
|
||||||
|
@ -197,6 +199,7 @@ class LocationUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
||||||
void map_locations (ARDOUR::Locations::LocationList&);
|
void map_locations (ARDOUR::Locations::LocationList&);
|
||||||
|
|
||||||
ClockGroup* _clock_group;
|
ClockGroup* _clock_group;
|
||||||
|
AudioClock::Mode clock_mode_from_session_instant_xml () const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LocationUIWindow : public ArdourWindow
|
class LocationUIWindow : public ArdourWindow
|
||||||
|
|
Loading…
Reference in New Issue
Block a user