add GUI support to create tape/destructive tracks
[ardour.git] / gtk2_ardour / automation_time_axis.cc
index 9e3fb09a4a795060f59e8a5bdf4bbca0c0f5e5ce..9fbb9d92329699e648c491cadecdfe2a9bb6f41f 100644 (file)
@@ -35,8 +35,8 @@ static const gchar * small_x_xpm[] = {
 "           "};
 
 AutomationTimeAxisView::AutomationTimeAxisView (Session& s, Route& r, PublicEditor& e, TimeAxisView& rent, 
-                                               ArdourCanvas::Canvas& canvas, std::string nom, 
-                                               std::string state_name, std::string nomparent)
+                                               ArdourCanvas::Canvas& canvas, const string & nom, 
+                                               const string & state_name, const string & nomparent)
 
        : AxisView (s), 
          TimeAxisView (s, e, &rent, canvas),
@@ -66,13 +66,13 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, Route& r, PublicEdit
        //                       "fill_color_rgba", color_map[cAutomationTrackFill],
        //                       NULL);
        base_rect = new SimpleRect(*canvas_display);
-       base_rect->set_property ("x1", 0.0);
-       base_rect->set_property ("y1", 0.0);
-       base_rect->set_property ("x2", 1000000.0);
-       base_rect->set_property ("outline_color_rgba", color_map[cAutomationTrackOutline]);
+       base_rect->property_x1() = 0.0;
+       base_rect->property_y1() = 0.0;
+       base_rect->property_x2() = 1000000.0;
+       base_rect->property_outline_color_rgba() = color_map[cAutomationTrackOutline];
        /* outline ends and bottom */
-       base_rect->set_property ("outline_what", (guint32) (0x1|0x2|0x8));
-       base_rect->set_property ("fill_color_rgba", color_map[cAutomationTrackFill]);
+       base_rect->property_outline_what() = (guint32) (0x1|0x2|0x8);
+       base_rect->property_fill_color_rgba() = color_map[cAutomationTrackFill];
        
        base_rect->set_data ("trackview", this);
 
@@ -97,7 +97,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, Route& r, PublicEdit
           life easier and remove them.
        */
 
-       name_hbox.remove (name_entry);
+       hide_name_entry();
 
        /* move the name label over a bit */
 
@@ -300,7 +300,7 @@ AutomationTimeAxisView::set_height (TrackHeight h)
        controls_table.show_all ();
 
        TimeAxisView::set_height (h);
-       gtk_object_set (GTK_OBJECT(base_rect), "y2", (double) h, NULL);
+       base_rect->property_y2() = h;
 
        for (vector<AutomationLine*>::iterator i = lines.begin(); i != lines.end(); ++i) {
                (*i)->set_height (h);
@@ -326,7 +326,8 @@ AutomationTimeAxisView::set_height (TrackHeight h)
                        controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
                }
                controls_table.show_all ();
-               name_label.show ();
+               hide_name_entry ();
+               show_name_label ();
                break;
 
        case Large:
@@ -343,7 +344,8 @@ AutomationTimeAxisView::set_height (TrackHeight h)
                        controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
                }
                controls_table.show_all ();
-               name_label.show ();
+               hide_name_entry ();
+               show_name_label ();
                break;
 
        case Larger:
@@ -360,7 +362,8 @@ AutomationTimeAxisView::set_height (TrackHeight h)
                        controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
                }
                controls_table.show_all ();
-               name_label.show ();
+               hide_name_entry ();
+               show_name_label ();
                break;
 
        case Normal:
@@ -378,7 +381,8 @@ AutomationTimeAxisView::set_height (TrackHeight h)
                        controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
                }
                controls_table.show_all ();
-               name_label.show ();
+               hide_name_entry ();
+               show_name_label ();
                break;
 
        case Smaller:
@@ -392,6 +396,8 @@ AutomationTimeAxisView::set_height (TrackHeight h)
                }
                controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
                controls_table.hide_all ();
+               hide_name_entry ();
+               show_name_label ();
                name_hbox.show_all ();
                controls_table.show ();
                break;
@@ -407,6 +413,8 @@ AutomationTimeAxisView::set_height (TrackHeight h)
                } 
                controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
                controls_table.hide_all ();
+               hide_name_entry ();
+               show_name_label ();
                name_hbox.show_all ();
                controls_table.show ();
                break;
@@ -435,7 +443,6 @@ AutomationTimeAxisView::hide_clicked ()
        hide ();
 }
 
-
 void
 AutomationTimeAxisView::build_display_menu ()
 {