GUI limitation: Require engine to add/remove tracks/busses
[ardour.git] / gtk2_ardour / option_editor.cc
index 0aa571fbb8db668c76abee292b005d1e3bb3cd94..b685e789472c35f5e3e0455c7bf67509500dde34 100644 (file)
@@ -59,7 +59,7 @@ OptionEditorComponent::add_widget_to_page (OptionEditorPage* p, Gtk::Widget* w)
 }
 
 void
-OptionEditorComponent::add_widgets_to_page (OptionEditorPage* p, Gtk::Widget* wa, Gtk::Widget* wb)
+OptionEditorComponent::add_widgets_to_page (OptionEditorPage* p, Gtk::Widget* wa, Gtk::Widget* wb, bool expand)
 {
        int const n = p->table.property_n_rows();
        int m = n + 1;
@@ -69,8 +69,13 @@ OptionEditorComponent::add_widgets_to_page (OptionEditorPage* p, Gtk::Widget* wa
 
        p->table.resize (m, 3);
        p->table.attach (*wa, 1, 2, n, n + 1, FILL);
-       p->table.attach (*wb, 2, 3, n, n + 1, FILL | EXPAND);
-
+       if (expand) {
+               p->table.attach (*wb, 2, 3, n, n + 1, FILL | EXPAND);
+       } else {
+               Alignment* a = manage (new Alignment (0, 0.5, 0, 1.0));
+               a->add (*wb);
+               p->table.attach (*a, 2, 3, n, n + 1, FILL | EXPAND);
+       }
        maybe_add_note (p, n + 1);
 }
 
@@ -78,7 +83,7 @@ void
 OptionEditorComponent::maybe_add_note (OptionEditorPage* p, int n)
 {
        if (!_note.empty ()) {
-               Gtk::Label* l = manage (new Gtk::Label (string_compose (X_("<i>%1</i>"), _note)));
+               Gtk::Label* l = manage (left_aligned_label (string_compose (X_("<i>%1</i>"), _note)));
                l->set_use_markup (true);
                l->set_line_wrap (true);
                p->table.attach (*l, 1, 3, n, n + 1, FILL | EXPAND);
@@ -480,7 +485,7 @@ FaderOption::FaderOption (string const & i, string const & n, sigc::slot<gain_t>
        , _get (g)
        , _set (s)
 {
-       _db_slider = manage (new HSliderController (&_db_adjustment, boost::shared_ptr<PBD::Controllable>(), 220, 18));
+       _db_slider = manage (new ArdourWidgets::HSliderController (&_db_adjustment, boost::shared_ptr<PBD::Controllable>(), 220, 18));
 
        _label.set_text (n + ":");
        _label.set_alignment (0, 0.5);
@@ -569,7 +574,7 @@ void
 ClockOption::set_state_from_config ()
 {
        Timecode::Time TC;
-       framepos_t when;
+       samplepos_t when;
        if (!Timecode::parse_timecode_format(_get(), TC)) {
                _clock.set (0, true);
        }
@@ -603,6 +608,20 @@ ClockOption::set_session (Session* s)
 
 /*--------------------------*/
 
+WidgetOption::WidgetOption (string const & i, string const & n, Gtk::Widget& w)
+       : Option (i, n)
+       , _widget (&w)
+{
+}
+
+void
+WidgetOption::add_to_page (OptionEditorPage* p)
+{
+       add_widget_to_page (p, _widget);
+}
+
+/*--------------------------*/
+
 OptionEditorPage::OptionEditorPage ()
        : table (1, 3)
 {
@@ -859,7 +878,11 @@ OptionEditorContainer::OptionEditorContainer (PBD::Configuration* c, string cons
        : OptionEditor (c)
 {
        set_border_width (4);
-       hpacker.pack_start (treeview(), false, false);
+       Frame* f = manage (new Frame ());
+       f->add (treeview());
+       f->set_shadow_type (Gtk::SHADOW_OUT);
+       f->set_border_width (0);
+       hpacker.pack_start (*f, false, false, 4);
        hpacker.pack_start (notebook(), false, false);
        pack_start (hpacker, true, true);
 
@@ -871,8 +894,12 @@ OptionEditorWindow::OptionEditorWindow (PBD::Configuration* c, string const& str
        , ArdourWindow (str)
 {
        container.set_border_width (4);
-       hpacker.pack_start (treeview(), false, false);
-       hpacker.pack_start (notebook(), true, true);
+       Frame* f = manage (new Frame ());
+       f->add (treeview());
+       f->set_shadow_type (Gtk::SHADOW_OUT);
+       f->set_border_width (0);
+       hpacker.pack_start (*f, false, false);
+       hpacker.pack_start (notebook(), true, true, 4);
 
        container.pack_start (hpacker, true, true);