manually fix up various cases where Gtk:Frame foo_frame had been changed to foo_sample
[ardour.git] / gtk2_ardour / time_axis_view.cc
index bd41c8467d3f18d39f10fb701ca338dde8e72f5c..f61ee9560886dd91fe8494d6c282666272eb6379 100644 (file)
 #include <string>
 #include <list>
 
+#include <gtkmm/separator.h>
 
 #include "pbd/error.h"
 #include "pbd/convert.h"
 #include "pbd/stacktrace.h"
 #include "pbd/unwind.h"
 
-#include <gtkmm2ext/doi.h>
-#include <gtkmm2ext/utils.h>
+#include "ardour/profile.h"
+
+#include "gtkmm2ext/colors.h"
+#include "gtkmm2ext/doi.h"
+#include "gtkmm2ext/utils.h"
 
 #include "canvas/canvas.h"
 #include "canvas/rectangle.h"
 #include "canvas/debug.h"
 #include "canvas/utils.h"
-#include "canvas/colors.h"
 
 #include "widgets/tooltips.h"
 
-#include "ardour/profile.h"
-
 #include "ardour_dialog.h"
 #include "floating_text_entry.h"
 #include "gui_thread.h"
@@ -128,7 +129,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
        _canvas_separator = new ArdourCanvas::Line(_canvas_display);
        CANVAS_DEBUG_NAME (_canvas_separator, "separator for TAV");
        _canvas_separator->set (ArdourCanvas::Duple(0.0, 0.0), ArdourCanvas::Duple(ArdourCanvas::COORD_MAX, 0.0));
-       _canvas_separator->set_outline_color(ArdourCanvas::rgba_to_color (0, 0, 0, 1.0));
+       _canvas_separator->set_outline_color(Gtkmm2ext::rgba_to_color (0, 0, 0, 1.0));
        _canvas_separator->set_outline_width(1.0);
        _canvas_separator->hide();
 
@@ -618,7 +619,7 @@ TimeAxisView::begin_name_edit ()
        }
 
        Gtk::Window* toplevel = (Gtk::Window*) control_parent->get_toplevel();
-       FloatingTextEntry* fte = new FloatingTextEntry (toplevel, name_label.get_text ());
+       FloatingTextEntry* fte = new FloatingTextEntry (toplevel, name ());
 
        fte->set_name ("TrackNameEditor");
        fte->use_text.connect (sigc::mem_fun (*this, &TimeAxisView::end_name_edit));
@@ -796,7 +797,7 @@ TimeAxisView::set_samples_per_pixel (double fpp)
 }
 
 void
-TimeAxisView::show_timestretch (framepos_t start, framepos_t end, int layers, int layer)
+TimeAxisView::show_timestretch (samplepos_t start, samplepos_t end, int layers, int layer)
 {
        for (Children::iterator i = children.begin(); i != children.end(); ++i) {
                (*i)->show_timestretch (start, end, layers, layer);
@@ -817,10 +818,14 @@ TimeAxisView::show_selection (TimeSelection& ts)
        double x1;
        double x2;
        double y2;
-       SelectionRect *rect;    time_axis_frame.show();
+       SelectionRect *rect;
 
+       time_axis_frame.show();
 
        for (Children::iterator i = children.begin(); i != children.end(); ++i) {
+               if (!(*i)->selected () && !(*i)->propagate_time_selection ()) {
+                       continue;
+               }
                (*i)->show_selection (ts);
        }
 
@@ -839,8 +844,8 @@ TimeAxisView::show_selection (TimeSelection& ts)
        selection_group->raise_to_top();
 
        for (list<AudioRange>::iterator i = ts.begin(); i != ts.end(); ++i) {
-               framepos_t start, end;
-               framecnt_t cnt;
+               samplepos_t start, end;
+               samplecnt_t cnt;
 
                start = (*i).start;
                end = (*i).end;
@@ -878,6 +883,9 @@ TimeAxisView::reshow_selection (TimeSelection& ts)
        show_selection (ts);
 
        for (Children::iterator i = children.begin(); i != children.end(); ++i) {
+               if (!(*i)->selected () && !(*i)->propagate_time_selection ()) {
+                       continue;
+               }
                (*i)->show_selection (ts);
        }
 }
@@ -1010,14 +1018,14 @@ TimeAxisView::remove_child (boost::shared_ptr<TimeAxisView> child)
 }
 
 /** Get selectable things within a given range.
- *  @param start Start time in session frames.
- *  @param end End time in session frames.
+ *  @param start Start time in session samples.
+ *  @param end End time in session samples.
  *  @param top Top y range, in trackview coordinates (ie 0 is the top of the track view)
  *  @param bot Bottom y range, in trackview coordinates (ie 0 is the top of the track view)
  *  @param result Filled in with selectable things.
  */
 void
-TimeAxisView::get_selectables (framepos_t start, framepos_t end, double top, double bot, list<Selectable*>& results, bool within)
+TimeAxisView::get_selectables (samplepos_t start, samplepos_t end, double top, double bot, list<Selectable*>& results, bool within)
 {
        for (Children::iterator i = children.begin(); i != children.end(); ++i) {
                if (!(*i)->hidden()) {
@@ -1113,8 +1121,8 @@ TimeAxisView::compute_heights ()
        Gtk::Table one_row_table (1, 1);
        ArdourButton* test_button = manage (new ArdourButton);
        const int border_width = 2;
-       const int frame_height = 2;
-       extra_height = (2 * border_width) + frame_height;
+       const int sample_height = 2;
+       extra_height = (2 * border_width) + sample_height;
 
        window.add (one_row_table);
        test_button->set_name ("mute button");
@@ -1271,11 +1279,11 @@ TimeAxisView::preset_height (Height h)
 
 /** @return Child time axis views that are not hidden */
 TimeAxisView::Children
-TimeAxisView::get_child_list ()
+TimeAxisView::get_child_list () const
 {
        Children c;
 
-       for (Children::iterator i = children.begin(); i != children.end(); ++i) {
+       for (Children::const_iterator i = children.begin(); i != children.end(); ++i) {
                if (!(*i)->hidden()) {
                        c.push_back(*i);
                }