add QMDSP library to ardev file so that its discoverable as we try to load VAMP stuff
[ardour.git] / gtk2_ardour / option_editor.cc
index 807aee93bdcabafaba687f23e184bbabc4c266cf..040146876b413d5bd37934dc230bdc12e64fdc34 100644 (file)
@@ -109,7 +109,7 @@ EntryOption::EntryOption (string const & i, string const & n, sigc::slot<string>
          _set (s)
 {
        _label = manage (new Label (n + ":"));
-       _label->set_alignment (1, 0.5);
+       _label->set_alignment (0, 0.5);
        _entry = manage (new Entry);
        _entry->signal_activate().connect (sigc::mem_fun (*this, &EntryOption::activated));
 }
@@ -191,6 +191,35 @@ FaderOption::add_to_page (OptionEditorPage* p)
        add_widgets_to_page (p, &_label, &_box);
 }
 
+ClockOption::ClockOption (string const & i, string const & n, sigc::slot<framecnt_t> g, sigc::slot<bool, framecnt_t> s)
+       : Option (i, n)
+       , _clock (X_("timecode-offset"), false, X_("TimecodeOffset"), true, false, true, false)
+       , _get (g)
+       , _set (s)
+{
+       _label.set_text (n + ":");
+       _label.set_alignment (0, 0.5);
+       _label.set_name (X_("OptionsLabel"));
+}
+
+void
+ClockOption::set_state_from_config ()
+{
+       _clock.set (_get ());
+}
+
+void
+ClockOption::add_to_page (OptionEditorPage* p)
+{
+       add_widgets_to_page (p, &_label, &_clock);
+}
+
+void
+ClockOption::set_session (Session* s)
+{
+       _clock.set_session (s);
+}
+          
 OptionEditorPage::OptionEditorPage (Gtk::Notebook& n, std::string const & t)
        : table (1, 3)
 {
@@ -211,7 +240,7 @@ OptionEditor::OptionEditor (Configuration* c, std::string const & t)
        using namespace Notebook_Helpers;
 
        set_default_size (300, 300);
-       set_wmclass (X_("ardour_preferences"), "Ardour");
+       set_wmclass (X_("ardour_preferences"), PROGRAM_NAME);
 
        set_name ("Preferences");
        add_events (Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK);
@@ -267,11 +296,26 @@ OptionEditor::add_option (std::string const & pn, OptionEditorComponent* o)
                _pages[pn] = new OptionEditorPage (_notebook, pn);
        }
 
-       cout << "add thing to " << pn << "\n";
-
        OptionEditorPage* p = _pages[pn];
        p->components.push_back (o);
 
        o->add_to_page (p);
        o->set_state_from_config ();
 }
+
+void
+OptionEditor::set_current_page (string const & p)
+{
+       int i = 0;
+       while (i < _notebook.get_n_pages ()) {
+               if (_notebook.get_tab_label_text (*_notebook.get_nth_page (i)) == p) {
+                       _notebook.set_current_page (i);
+                       return;
+               }
+
+               ++i;
+       }
+}
+
+
+