fix some unused argument warnings
[ardour.git] / gtk2_ardour / region_view.cc
index 8451497289a0525c21bb3242d20ffa50b80505da..2edad1cd1612b21a00e6086273c50a1a2de1cb11 100644 (file)
@@ -32,6 +32,7 @@
 #include "canvas/debug.h"
 #include "canvas/pixbuf.h"
 #include "canvas/text.h"
+#include "canvas/line.h"
 
 #include "ardour_ui.h"
 #include "global_signals.h"
@@ -182,9 +183,9 @@ RegionView::init (Gdk::Color const & basic_color, bool wfd)
                }
        }
 
-       if (name_pixbuf) {
-               name_pixbuf->set_data ("regionview", this);
-               name_pixbuf->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_name_event), name_pixbuf, this));
+       if (name_text) {
+               name_text->set_data ("regionview", this);
+               name_text->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_name_event), name_text, this));
        }
 
        if (wfd) {
@@ -243,8 +244,8 @@ RegionView::set_silent_frames (const AudioIntervalResult& silences, double /*thr
 
                /* coordinates for the rect are relative to the regionview origin */
 
-               cr->set_x0 (trackview.editor().frame_to_pixel (i->first - _region->start()));
-               cr->set_x1 (trackview.editor().frame_to_pixel (i->second - _region->start()));
+               cr->set_x0 (trackview.editor().sample_to_pixel (i->first - _region->start()));
+               cr->set_x1 (trackview.editor().sample_to_pixel (i->second - _region->start()));
                cr->set_y0 (1);
                cr->set_y1 (_height - 2);
                cr->set_outline (false);
@@ -278,7 +279,7 @@ RegionView::set_silent_frames (const AudioIntervalResult& silences, double /*thr
 
         /* both positions are relative to the region start offset in source */
 
-        _silence_text->set_x_position (trackview.editor().frame_to_pixel (silences.front().first - _region->start()) + 10.0);
+        _silence_text->set_x_position (trackview.editor().sample_to_pixel (silences.front().first - _region->start()) + 10.0);
         _silence_text->set_y_position (20.0);
 
         double ms = (float) shortest/_region->session().frame_rate();
@@ -387,12 +388,10 @@ RegionView::region_changed (const PropertyChange& what_changed)
        if (what_changed.contains (ARDOUR::Properties::locked)) {
                region_locked ();
        }
-#ifdef WITH_VIDEOTIMELINE
        if (what_changed.contains (ARDOUR::Properties::locked)) {
                /* name will show locked status */
                region_renamed ();
        }
-#endif
 }
 
 void
@@ -424,7 +423,7 @@ RegionView::region_resized (const PropertyChange& what_changed)
 
                set_duration (_region->length(), 0);
 
-               unit_length = _region->length() / frames_per_pixel;
+               unit_length = _region->length() / samples_per_pixel;
 
                for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
 
@@ -490,12 +489,12 @@ RegionView::set_position (framepos_t pos, void* /*src*/, double* ignored)
 }
 
 void
-RegionView::set_frames_per_pixel (double fpp)
+RegionView::set_samples_per_pixel (double fpp)
 {
-       TimeAxisViewItem::set_frames_per_pixel (fpp);
+       TimeAxisViewItem::set_samples_per_pixel (fpp);
 
        for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
-               (*i)->set_frames_per_pixel (fpp);
+               (*i)->set_samples_per_pixel (fpp);
                (*i)->set_duration (_region->length() / fpp);
        }
 
@@ -510,7 +509,7 @@ RegionView::set_duration (framecnt_t frames, void *src)
        }
 
        for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
-               (*i)->set_duration (_region->length() / frames_per_pixel);
+               (*i)->set_duration (_region->length() / samples_per_pixel);
        }
 
        return true;
@@ -586,12 +585,10 @@ RegionView::make_name () const
                str += '{';
                str += _region->name();
                str += '}';
-#ifdef WITH_VIDEOTIMELINE
        } else if (_region->video_locked()) {
                str += '[';
                str += _region->name();
                str += ']';
-#endif
        } else {
                str = _region->name();
        }
@@ -642,7 +639,7 @@ RegionView::region_sync_changed ()
                sync_line->set_outline_width  (1);
        }
 
-       /* this has to handle both a genuine change of position, a change of frames_per_pixel
+       /* this has to handle both a genuine change of position, a change of samples_per_pixel
           and a change in the bounds of the _region->
         */
 
@@ -670,7 +667,7 @@ RegionView::region_sync_changed ()
 
                        //points = sync_mark->property_points().get_value();
 
-                       double offset = sync_offset / frames_per_pixel;
+                       double offset = sync_offset / samples_per_pixel;
                        points.push_back (ArdourCanvas::Duple (offset - ((sync_mark_width-1)/2), 1));
                        points.push_back (ArdourCanvas::Duple (offset + ((sync_mark_width-1)/2), 1));
                        points.push_back (ArdourCanvas::Duple (offset, sync_mark_width - 1));
@@ -742,7 +739,7 @@ RegionView::set_height (double h)
                int sync_dir;
                framecnt_t sync_offset;
                sync_offset = _region->sync_offset (sync_dir);
-               double offset = sync_offset / frames_per_pixel;
+               double offset = sync_offset / samples_per_pixel;
 
                sync_line->set (
                        ArdourCanvas::Duple (offset, 0),
@@ -801,14 +798,14 @@ RegionView::update_coverage_frames (LayerDisplay d)
 
                /* finish off any old rect, if required */
                if (cr && me != new_me) {
-                       cr->set_x1 (trackview.editor().frame_to_pixel (t - position));
+                       cr->set_x1 (trackview.editor().sample_to_pixel (t - position));
                }
 
                /* start off any new rect, if required */
                if (cr == 0 || me != new_me) {
                        cr = new ArdourCanvas::Rectangle (group);
                        _coverage_frames.push_back (cr);
-                       cr->set_x0 (trackview.editor().frame_to_pixel (t - position));
+                       cr->set_x0 (trackview.editor().sample_to_pixel (t - position));
                        cr->set_y0 (1);
                        cr->set_y1 (_height + 1);
                        cr->set_outline (false);
@@ -826,7 +823,7 @@ RegionView::update_coverage_frames (LayerDisplay d)
 
        if (cr) {
                /* finish off the last rectangle */
-               cr->set_x1 (trackview.editor().frame_to_pixel (end - position));
+               cr->set_x1 (trackview.editor().sample_to_pixel (end - position));
        }
 
        if (frame_handle_start) {
@@ -841,8 +838,8 @@ RegionView::update_coverage_frames (LayerDisplay d)
                name_highlight->raise_to_top ();
        }
 
-       if (name_pixbuf) {
-               name_pixbuf->raise_to_top ();
+       if (name_text) {
+               name_text->raise_to_top ();
        }
 }