Save/Restore TimeInfoBox clock modes
authorRobin Gareus <robin@gareus.org>
Fri, 10 Mar 2017 19:39:46 +0000 (20:39 +0100)
committerRobin Gareus <robin@gareus.org>
Fri, 10 Mar 2017 19:39:46 +0000 (20:39 +0100)
The clocks are not transient, so ARDOUR_UI::store_clock_modes takes
care of saving the state and the clock restores itself.

gtk2_ardour/ardour_ui_dependents.cc
gtk2_ardour/editor.cc
gtk2_ardour/time_info_box.cc
gtk2_ardour/time_info_box.h

index 0c052924bd5a7dba8940d88c95dd078733e4259e..a4603b4888e236b491ad048d425ff4d263b0113d 100644 (file)
@@ -271,7 +271,7 @@ ARDOUR_UI::setup_windows ()
        mixer->add_to_notebook (_tabs, _("Mixer"));
        editor->add_to_notebook (_tabs, _("Editor"));
 
-       time_info_box = new TimeInfoBox (false);
+       time_info_box = new TimeInfoBox ("ToolbarTimeInfo", false);
        /* all other dialogs are created conditionally */
 
        we_have_dependents ();
index 7aaeb466780db1e8e1b5b671f85a4496796427fc..66c1e8af864215528cee4cb9d59c2d54f82d693a 100644 (file)
@@ -643,7 +643,7 @@ Editor::Editor ()
        _regions = new EditorRegions (this);
        _snapshots = new EditorSnapshots (this);
        _locations = new EditorLocations (this);
-       _time_info_box = new TimeInfoBox (true);
+       _time_info_box = new TimeInfoBox ("EditorTimeInfo", true);
 
        /* these are static location signals */
 
index ceda41e90c16246f325788dcb103c81098e772eb..fd573ad4b764141bca2ce9dbc547d0df06e29b85 100644 (file)
@@ -43,7 +43,7 @@ using namespace ARDOUR;
 using std::min;
 using std::max;
 
-TimeInfoBox::TimeInfoBox (bool with_punch)
+TimeInfoBox::TimeInfoBox (std::string state_node_name, bool with_punch)
        : table (3, 3)
        , punch_start (0)
        , punch_end (0)
@@ -53,9 +53,15 @@ TimeInfoBox::TimeInfoBox (bool with_punch)
 {
        set_name (X_("TimeInfoBox"));
 
-       selection_start = new AudioClock ("selection-start", false, "selection", false, false, false, false);
-       selection_end = new AudioClock ("selection-end", false, "selection", false, false, false, false);
-       selection_length = new AudioClock ("selection-length", false, "selection", false, false, true, false);
+       selection_start = new AudioClock (
+                       string_compose ("%1-selection-start", state_node_name),
+                       false, "selection", false, false, false, false);
+       selection_end = new AudioClock (
+                       string_compose ("%1-selection-end", state_node_name),
+                       false, "selection", false, false, false, false);
+       selection_length = new AudioClock (
+                       string_compose ("%1-selection-length", state_node_name),
+                       false, "selection", false, false, true, false);
 
        selection_title.set_text (_("Selection"));
 
@@ -98,8 +104,12 @@ TimeInfoBox::TimeInfoBox (bool with_punch)
        table.attach (*selection_length, 1, 2, 3, 4);
 
        if (with_punch_clock) {
-               punch_start = new AudioClock ("punch-start", false, "punch", false, false, false, false);
-               punch_end = new AudioClock ("punch-end", false, "punch", false, false, false, false);
+               punch_start = new AudioClock (
+                               string_compose ("%1-punch-start", state_node_name),
+                               false, "punch", false, false, false, false);
+               punch_end = new AudioClock (
+                               string_compose ("%1-punch-end", state_node_name),
+                               false, "punch", false, false, false, false);
                punch_title.set_text (_("Punch"));
 
                punch_title.set_name ("TimeInfoSelectionTitle");
index 83f58e7eb58ab093ef90a917f72c820df7549ed2..625f5345a31b5de73d14fea9c400944410d16bf7 100644 (file)
@@ -43,7 +43,7 @@ class AudioClock;
 class TimeInfoBox : public CairoHPacker, public ARDOUR::SessionHandlePtr
 {
 public:
-       TimeInfoBox (bool with_punch);
+       TimeInfoBox (std::string state_node_name, bool with_punch);
        ~TimeInfoBox ();
 
        void set_session (ARDOUR::Session*);