From b05968fb4e303ce47b6e09cd1bc713f3af28a6f9 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 12 Apr 2013 11:31:50 -0400 Subject: change frames_per_pixel to samples_per_pixel --- gtk2_ardour/audio_region_view.cc | 24 +++++++++---------- gtk2_ardour/audio_region_view.h | 6 ++--- gtk2_ardour/audio_streamview.cc | 6 ++--- gtk2_ardour/automation_region_view.cc | 2 +- gtk2_ardour/automation_region_view.h | 2 +- gtk2_ardour/automation_streamview.cc | 2 +- gtk2_ardour/automation_time_axis.cc | 6 ++--- gtk2_ardour/automation_time_axis.h | 2 +- gtk2_ardour/crossfade_edit.cc | 6 ++--- gtk2_ardour/crossfade_view.h | 2 +- gtk2_ardour/editor.cc | 38 +++++++++++++++---------------- gtk2_ardour/editor.h | 32 ++++++++++++-------------- gtk2_ardour/editor_canvas.cc | 2 +- gtk2_ardour/editor_drag.cc | 6 ++--- gtk2_ardour/editor_ops.cc | 20 ++++++++-------- gtk2_ardour/editor_rulers.cc | 8 +++---- gtk2_ardour/ghostregion.cc | 6 ++--- gtk2_ardour/ghostregion.h | 6 ++--- gtk2_ardour/imageframe_time_axis.cc | 6 ++--- gtk2_ardour/imageframe_time_axis.h | 2 +- gtk2_ardour/imageframe_time_axis_group.cc | 4 ++-- gtk2_ardour/imageframe_time_axis_group.h | 4 ++-- gtk2_ardour/imageframe_time_axis_view.cc | 14 ++++++------ gtk2_ardour/imageframe_time_axis_view.h | 8 +++---- gtk2_ardour/marker_time_axis.cc | 6 ++--- gtk2_ardour/marker_time_axis.h | 2 +- gtk2_ardour/marker_time_axis_view.cc | 14 ++++++------ gtk2_ardour/marker_time_axis_view.h | 8 +++---- gtk2_ardour/midi_region_view.cc | 4 ++-- gtk2_ardour/midi_region_view.h | 4 ++-- gtk2_ardour/midi_streamview.cc | 2 +- gtk2_ardour/region_view.cc | 16 ++++++------- gtk2_ardour/region_view.h | 6 ++--- gtk2_ardour/route_time_axis.cc | 14 ++++++------ gtk2_ardour/route_time_axis.h | 4 ++-- gtk2_ardour/streamview.cc | 8 +++---- gtk2_ardour/streamview.h | 6 ++--- gtk2_ardour/tape_region_view.h | 2 +- gtk2_ardour/tempo_lines.cc | 8 +++---- gtk2_ardour/time_axis_view.cc | 4 ++-- gtk2_ardour/time_axis_view.h | 2 +- gtk2_ardour/time_axis_view_item.cc | 16 ++++++------- gtk2_ardour/time_axis_view_item.h | 6 ++--- 43 files changed, 172 insertions(+), 174 deletions(-) diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 4926d48d13..4f222f3413 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -202,7 +202,7 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd) region_resized (ARDOUR::bounds_change); for (vector::iterator i = ghosts.begin(); i != ghosts.end(); ++i) { - (*i)->set_duration (_region->length() / frames_per_pixel); + (*i)->set_duration (_region->length() / samples_per_pixel); } region_locked (); @@ -545,7 +545,7 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr ar, f Points* points; /* round here to prevent little visual glitches with sub-pixel placement */ - double const pwidth = rint (width / frames_per_pixel); + double const pwidth = rint (width / samples_per_pixel); uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth); double h; @@ -632,11 +632,11 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr ar, Points* points; /* round here to prevent little visual glitches with sub-pixel placement */ - double const pwidth = rint (width / frames_per_pixel); + double const pwidth = rint (width / samples_per_pixel); uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth); double h; - double const handle_center = (_region->length() - width) / frames_per_pixel; + double const handle_center = (_region->length() - width) / samples_per_pixel; /* Put the fade out handle so that its right side is at the end-of-fade line; * it's `one out' for precise pixel accuracy. @@ -715,13 +715,13 @@ AudioRegionView::get_fade_out_shape_width () void -AudioRegionView::set_frames_per_pixel (gdouble fpp) +AudioRegionView::set_samples_per_pixel (gdouble fpp) { - RegionView::set_frames_per_pixel (fpp); + RegionView::set_samples_per_pixel (fpp); if (Config->get_show_waveforms ()) { for (uint32_t n = 0; n < waves.size(); ++n) { - waves[n]->set_frames_per_pixel (fpp); + waves[n]->set_samples_per_pixel (fpp); } } @@ -780,7 +780,7 @@ AudioRegionView::setup_waveform_visibility () this when waveforms are hidden. */ // CAIROCANVAS - //waves[n]->set_frames_per_pixel (_frames_per_pixel); + //waves[n]->set_samples_per_pixel (_samples_per_pixel); waves[n]->show(); } } else { @@ -898,7 +898,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/) wave->set_x_position (0); wave->set_y_position (yoff); wave->set_height (ht); - wave->set_frames_per_pixel (frames_per_pixel); + wave->set_samples_per_pixel (samples_per_pixel); wave->property_amplitude_above_axis() = _amplitude_above_axis; if (_recregion) { @@ -1045,7 +1045,7 @@ AudioRegionView::add_ghost (TimeAxisView& tv) RouteTimeAxisView* rtv = dynamic_cast(&trackview); assert(rtv); - double unit_position = _region->position () / frames_per_pixel; + double unit_position = _region->position () / samples_per_pixel; AudioGhostRegion* ghost = new AudioGhostRegion (tv, trackview, unit_position); uint32_t nchans; @@ -1061,7 +1061,7 @@ AudioRegionView::add_ghost (TimeAxisView& tv) wave->set_channel (n); wave->set_x_position (0); - wave->set_frames_per_pixel (frames_per_pixel); + wave->set_samples_per_pixel (samples_per_pixel); wave->property_amplitude_above_axis() = _amplitude_above_axis; wave->set_region_start (_region->start()); @@ -1069,7 +1069,7 @@ AudioRegionView::add_ghost (TimeAxisView& tv) } ghost->set_height (); - ghost->set_duration (_region->length() / frames_per_pixel); + ghost->set_duration (_region->length() / samples_per_pixel); ghost->set_colors(); ghosts.push_back (ghost); diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h index 827de1a3dc..24643ceb99 100644 --- a/gtk2_ardour/audio_region_view.h +++ b/gtk2_ardour/audio_region_view.h @@ -49,13 +49,13 @@ class AudioRegionView : public RegionView AudioRegionView (ArdourCanvas::Group *, RouteTimeAxisView&, boost::shared_ptr, - double initial_frames_per_pixel, + double initial_samples_per_pixel, Gdk::Color const & basic_color); AudioRegionView (ArdourCanvas::Group *, RouteTimeAxisView&, boost::shared_ptr, - double frames_per_pixel, + double samples_per_pixel, Gdk::Color const & basic_color, bool recording, TimeAxisViewItem::Visibility); @@ -71,7 +71,7 @@ class AudioRegionView : public RegionView void create_waves (); void set_height (double); - void set_frames_per_pixel (double); + void set_samples_per_pixel (double); void set_amplitude_above_axis (gdouble spp); diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index 5946314bda..81c3d862fc 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -98,19 +98,19 @@ AudioStreamView::create_region_view (boost::shared_ptr r, bool wait_for_ case Normal: if (recording) { region_view = new AudioRegionView (_canvas_group, _trackview, region, - _frames_per_pixel, region_color, recording, TimeAxisViewItem::Visibility( + _samples_per_pixel, region_color, recording, TimeAxisViewItem::Visibility( TimeAxisViewItem::ShowFrame | TimeAxisViewItem::HideFrameRight | TimeAxisViewItem::HideFrameLeft | TimeAxisViewItem::HideFrameTB)); } else { region_view = new AudioRegionView (_canvas_group, _trackview, region, - _frames_per_pixel, region_color); + _samples_per_pixel, region_color); } break; case Destructive: region_view = new TapeAudioRegionView (_canvas_group, _trackview, region, - _frames_per_pixel, region_color); + _samples_per_pixel, region_color); break; default: fatal << string_compose (_("programming error: %1"), "illegal track mode in ::add_region_view_internal") << endmsg; diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index ae8c337de6..0f62d3636c 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -69,7 +69,7 @@ AutomationRegionView::init (Gdk::Color const & basic_color, bool /*wfd*/) compute_colors (basic_color); - reset_width_dependent_items ((double) _region->length() / frames_per_pixel); + reset_width_dependent_items ((double) _region->length() / samples_per_pixel); set_height (trackview.current_height()); diff --git a/gtk2_ardour/automation_region_view.h b/gtk2_ardour/automation_region_view.h index 885bf2176c..571a80709a 100644 --- a/gtk2_ardour/automation_region_view.h +++ b/gtk2_ardour/automation_region_view.h @@ -42,7 +42,7 @@ public: boost::shared_ptr, const Evoral::Parameter& parameter, boost::shared_ptr, - double initial_frames_per_pixel, + double initial_samples_per_pixel, Gdk::Color const & basic_color); ~AutomationRegionView(); diff --git a/gtk2_ardour/automation_streamview.cc b/gtk2_ardour/automation_streamview.cc index fa6a824819..3904c2728e 100644 --- a/gtk2_ardour/automation_streamview.cc +++ b/gtk2_ardour/automation_streamview.cc @@ -105,7 +105,7 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr region region_view = new AutomationRegionView ( _canvas_group, _automation_view, region, _automation_view.parameter (), list, - _frames_per_pixel, region_color + _samples_per_pixel, region_color ); region_view->init (region_color, false); diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index 5391e78c63..254d8629c0 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -437,16 +437,16 @@ AutomationTimeAxisView::set_height (uint32_t h) } void -AutomationTimeAxisView::set_frames_per_pixel (double fpp) +AutomationTimeAxisView::set_samples_per_pixel (double fpp) { - TimeAxisView::set_frames_per_pixel (fpp); + TimeAxisView::set_samples_per_pixel (fpp); if (_line) { _line->reset (); } if (_view) { - _view->set_frames_per_pixel (fpp); + _view->set_samples_per_pixel (fpp); } } diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h index 4de120649b..d388419e17 100644 --- a/gtk2_ardour/automation_time_axis.h +++ b/gtk2_ardour/automation_time_axis.h @@ -69,7 +69,7 @@ class AutomationTimeAxisView : public TimeAxisView { ~AutomationTimeAxisView(); virtual void set_height (uint32_t); - void set_frames_per_pixel (double); + void set_samples_per_pixel (double); std::string name() const { return _name; } void add_automation_event (GdkEvent *, framepos_t, double); diff --git a/gtk2_ardour/crossfade_edit.cc b/gtk2_ardour/crossfade_edit.cc index 1db0438729..2382f89688 100644 --- a/gtk2_ardour/crossfade_edit.cc +++ b/gtk2_ardour/crossfade_edit.cc @@ -624,7 +624,7 @@ CrossfadeEditor::canvas_allocation (Gtk::Allocation& /*alloc*/) (*i)->set_y_position (yoff); (*i)->set_height (ht); - (*i)->set_frames_per_pixel (spu); + (*i)->set_samples_per_pixel (spu); } ht = canvas->get_allocation().get_height() / xfade->out()->n_channels(); @@ -636,7 +636,7 @@ CrossfadeEditor::canvas_allocation (Gtk::Allocation& /*alloc*/) (*i)->set_y_position (yoff); (*i)->set_height (ht); - (*i)->set_frames_per_pixel (spu); + (*i)->set_samples_per_pixel (spu); } } @@ -1170,7 +1170,7 @@ CrossfadeEditor::make_waves (boost::shared_ptr region, WhichFade wh waveview->set_x_position (canvas_border); waveview->set_y_position (yoff); waveview->set_height (ht); - waveview->set_frames_per_pixel (spu); + waveview->set_samples_per_pixel (spu); waveview->property_amplitude_above_axis() = 2.0; waveview->set_outline_color (color); waveview->set_fill_color (color); diff --git a/gtk2_ardour/crossfade_view.h b/gtk2_ardour/crossfade_view.h index 33cd04de11..960bcc2d26 100644 --- a/gtk2_ardour/crossfade_view.h +++ b/gtk2_ardour/crossfade_view.h @@ -39,7 +39,7 @@ public: CrossfadeView (ArdourCanvas::Group*, RouteTimeAxisView&, boost::shared_ptr, - double initial_frames_per_pixel, + double initial_samples_per_pixel, Gdk::Color& basic_color, AudioRegionView& leftview, AudioRegionView& rightview); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index c0f5fd8ba9..4e372188ba 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -377,7 +377,7 @@ Editor::Editor () _internal_editing = false; current_canvas_cursor = 0; - frames_per_pixel = 2048; /* too early to use reset_zoom () */ + samples_per_pixel = 2048; /* too early to use reset_zoom () */ _scroll_callbacks = 0; @@ -929,7 +929,7 @@ Editor::zoom_adjustment_changed () } double fpu = zoom_range_clock->current_duration() / _visible_canvas_width; - bool clamped = clamp_frames_per_pixel (fpu); + bool clamped = clamp_samples_per_pixel (fpu); if (clamped) { zoom_range_clock->set ((framepos_t) floor (fpu * _visible_canvas_width)); @@ -1139,7 +1139,7 @@ Editor::map_position_change (framepos_t frame) void Editor::center_screen (framepos_t frame) { - double const page = _visible_canvas_width * frames_per_pixel; + double const page = _visible_canvas_width * samples_per_pixel; /* if we're off the page, then scroll. */ @@ -1305,7 +1305,7 @@ Editor::set_session (Session *t) _session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { - (static_cast(*i))->set_frames_per_pixel (frames_per_pixel); + (static_cast(*i))->set_samples_per_pixel (samples_per_pixel); } super_rapid_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect ( @@ -2281,7 +2281,7 @@ Editor::set_state (const XMLNode& node, int /*version*/) if ((prop = node.property ("zoom"))) { reset_zoom (PBD::atof (prop->value())); } else { - reset_zoom (frames_per_pixel); + reset_zoom (samples_per_pixel); } if ((prop = node.property ("snap-to"))) { @@ -2501,7 +2501,7 @@ Editor::get_state () maybe_add_mixer_strip_width (*node); node->add_property ("zoom-focus", enum_2_string (zoom_focus)); - snprintf (buf, sizeof(buf), "%f", frames_per_pixel); + snprintf (buf, sizeof(buf), "%f", samples_per_pixel); node->add_property ("zoom", buf); node->add_property ("snap-to", enum_2_string (_snap_type)); node->add_property ("snap-mode", enum_2_string (_snap_mode)); @@ -4129,14 +4129,14 @@ Editor::reset_y_origin (double y) void Editor::reset_zoom (double fpp) { - clamp_frames_per_pixel (fpp); + clamp_samples_per_pixel (fpp); - if (fpp == frames_per_pixel) { + if (fpp == samples_per_pixel) { return; } pending_visual_change.add (VisualChange::ZoomLevel); - pending_visual_change.frames_per_pixel = fpp; + pending_visual_change.samples_per_pixel = fpp; ensure_visual_change_idle_handler (); } @@ -4166,7 +4166,7 @@ Editor::current_visual_state (bool with_tracks) { VisualState* vs = new VisualState (with_tracks); vs->y_position = vertical_adjustment.get_value(); - vs->frames_per_pixel = frames_per_pixel; + vs->samples_per_pixel = samples_per_pixel; vs->leftmost_frame = leftmost_frame; vs->zoom_focus = zoom_focus; @@ -4228,7 +4228,7 @@ Editor::use_visual_state (VisualState& vs) vertical_adjustment.set_value (vs.y_position); set_zoom_focus (vs.zoom_focus); - reposition_and_zoom (vs.leftmost_frame, vs.frames_per_pixel); + reposition_and_zoom (vs.leftmost_frame, vs.samples_per_pixel); if (vs.gui_state) { *ARDOUR_UI::instance()->gui_object_state = *vs.gui_state; @@ -4247,19 +4247,19 @@ Editor::use_visual_state (VisualState& vs) * @param fpu New frames per unit; should already have been clamped so that it is sensible. */ void -Editor::set_frames_per_pixel (double fpp) +Editor::set_samples_per_pixel (double fpp) { if (tempo_lines) { tempo_lines->tempo_map_changed(); } - frames_per_pixel = fpp; + samples_per_pixel = fpp; /* convert fpu to frame count */ - framepos_t frames = (framepos_t) floor (frames_per_pixel * _visible_canvas_width); + framepos_t frames = (framepos_t) floor (samples_per_pixel * _visible_canvas_width); - if (frames_per_pixel != zoom_range_clock->current_duration()) { + if (samples_per_pixel != zoom_range_clock->current_duration()) { zoom_range_clock->set (frames); } @@ -4337,7 +4337,7 @@ Editor::idle_visual_changer () double const last_time_origin = horizontal_position (); if (p & VisualChange::ZoomLevel) { - set_frames_per_pixel (pending_visual_change.frames_per_pixel); + set_samples_per_pixel (pending_visual_change.samples_per_pixel); compute_fixed_ruler_scale (); @@ -4356,7 +4356,7 @@ Editor::idle_visual_changer () } if (p & VisualChange::TimeOrigin) { - set_horizontal_position (pending_visual_change.time_origin / frames_per_pixel); + set_horizontal_position (pending_visual_change.time_origin / samples_per_pixel); } if (p & VisualChange::YOrigin) { @@ -5281,11 +5281,11 @@ Editor::super_rapid_screen_update () */ #if 0 // FIXME DO SOMETHING THAT WORKS HERE - this is 2.X code - double target = ((double)frame - (double)current_page_samples()/2.0) / frames_per_pixel; + double target = ((double)frame - (double)current_page_samples()/2.0) / samples_per_pixel; if (target <= 0.0) { target = 0.0; } - if (fabs(target - current) < current_page_samples() / frames_per_pixel) { + if (fabs(target - current) < current_page_samples() / samples_per_pixel) { target = (target * 0.15) + (current * 0.85); } else { /* relax */ diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 8063e79b76..eabfa49984 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -150,7 +150,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD framepos_t leftmost_sample() const { return leftmost_frame; } framecnt_t current_page_samples() const { - return (framecnt_t) floor (_visible_canvas_width * frames_per_pixel); + return (framecnt_t) floor (_visible_canvas_width * samples_per_pixel); } double visible_canvas_height () const { @@ -221,10 +221,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void transition_to_rolling (bool forward); /* NOTE: these functions assume that the "pixel" coordinate is - the result of using the world->canvas affine transform on a - world coordinate. These coordinates already take into - account any scrolling carried out by adjusting the - xscroll_adjustment. + in canvas coordinates. These coordinates already take into + account any scrolling offsets. */ framepos_t pixel_to_sample (double pixel) const { @@ -236,18 +234,18 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD */ if (pixel >= 0) { - return (framepos_t) rint (pixel * frames_per_pixel); + return (framepos_t) rint (pixel * samples_per_pixel); } else { return 0; } } - double sample_to_pixel (framepos_t frame) const { - return rint (frame / frames_per_pixel); + double sample_to_pixel (framepos_t sample) const { + return rint (sample / samples_per_pixel); } - double sample_to_pixel_unrounded (framepos_t frame) const { - return frame / frames_per_pixel; + double sample_to_pixel_unrounded (framepos_t sample) const { + return sample / samples_per_pixel; } void flush_canvas (); @@ -296,7 +294,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_zoom_focus (Editing::ZoomFocus); Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; } - double get_current_zoom () const { return frames_per_pixel; } + double get_current_zoom () const { return samples_per_pixel; } void cycle_zoom_focus (); void temporal_zoom_step (bool coarser); void tav_zoom_step (bool coarser); @@ -483,7 +481,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD VisualState (bool with_tracks); ~VisualState (); double y_position; - double frames_per_pixel; + double samples_per_pixel; framepos_t leftmost_frame; Editing::ZoomFocus zoom_focus; GUIObjectState* gui_state; @@ -503,11 +501,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void cancel_visual_state_op (uint32_t n); framepos_t leftmost_frame; - double frames_per_pixel; + double samples_per_pixel; Editing::ZoomFocus zoom_focus; - void set_frames_per_pixel (double); - bool clamp_frames_per_pixel (double &) const; + void set_samples_per_pixel (double); + bool clamp_samples_per_pixel (double &) const; Editing::MouseMode mouse_mode; Editing::MouseMode pre_internal_mouse_mode; @@ -1039,14 +1037,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Type pending; framepos_t time_origin; - double frames_per_pixel; + double samples_per_pixel; double y_origin; int idle_handler_id; /** true if we are currently in the idle handler */ bool being_handled; - VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_pixel (0), idle_handler_id (-1), being_handled (false) {} + VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), samples_per_pixel (0), idle_handler_id (-1), being_handled (false) {} void add (Type t) { pending = Type (pending | t); } diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 1ff9a2c86c..27d51bb9f7 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -770,7 +770,7 @@ Editor::set_horizontal_position (double p) _track_canvas_hadj->set_value (p); _time_bars_canvas_hadj->set_value (p); - leftmost_frame = (framepos_t) floor (p * frames_per_pixel); + leftmost_frame = (framepos_t) floor (p * samples_per_pixel); update_fixed_rulers (); redisplay_tempo (true); diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 2074e13c50..707a0884f0 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -551,7 +551,7 @@ RegionMotionDrag::compute_x_delta (GdkEvent const * event, framepos_t* pending_r if ((*pending_region_position != _last_frame_position) && x_move_allowed) { /* x movement since last time (in pixels) */ - dx = (static_cast (*pending_region_position) - _last_frame_position) / _editor->frames_per_pixel; + dx = (static_cast (*pending_region_position) - _last_frame_position) / _editor->samples_per_pixel; /* total x movement */ framecnt_t total_dx = *pending_region_position; @@ -2385,7 +2385,7 @@ CursorDrag::start_grab (GdkEvent* event, Gdk::Cursor* c) { Drag::start_grab (event, c); - _grab_zoom = _editor->frames_per_pixel; + _grab_zoom = _editor->samples_per_pixel; framepos_t where = _editor->canvas_event_frame (event, 0, 0); _editor->snap_to_with_modifier (where, event); @@ -3217,7 +3217,7 @@ LineDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*cursor*/) _line->parent_group().canvas_to_item (cx, cy); - framecnt_t const frame_within_region = (framecnt_t) floor (cx * _editor->frames_per_pixel); + framecnt_t const frame_within_region = (framecnt_t) floor (cx * _editor->samples_per_pixel); uint32_t before; uint32_t after; diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index d7603d4ab0..157a034ea5 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -1211,7 +1211,7 @@ Editor::cursor_align (bool playhead_to_edit) void Editor::scroll_backward (float pages) { - framepos_t const one_page = (framepos_t) rint (_visible_canvas_width * frames_per_pixel); + framepos_t const one_page = (framepos_t) rint (_visible_canvas_width * samples_per_pixel); framepos_t const cnt = (framepos_t) floor (pages * one_page); framepos_t frame; @@ -1227,7 +1227,7 @@ Editor::scroll_backward (float pages) void Editor::scroll_forward (float pages) { - framepos_t const one_page = (framepos_t) rint (_visible_canvas_width * frames_per_pixel); + framepos_t const one_page = (framepos_t) rint (_visible_canvas_width * samples_per_pixel); framepos_t const cnt = (framepos_t) floor (pages * one_page); framepos_t frame; @@ -1331,7 +1331,7 @@ Editor::tav_zoom_smooth (bool coarser, bool force_all) } bool -Editor::clamp_frames_per_pixel (double& fpp) const +Editor::clamp_samples_per_pixel (double& fpp) const { bool clamped = false; @@ -1353,7 +1353,7 @@ Editor::temporal_zoom_step (bool coarser) { ENSURE_GUI_THREAD (*this, &Editor::temporal_zoom_step, coarser) - double nfpp = frames_per_pixel; + double nfpp = samples_per_pixel; if (coarser) { nfpp = min (9e6, nfpp * 1.61803399); @@ -1383,8 +1383,8 @@ Editor::temporal_zoom (double fpp) double nfpp; double l; - clamp_frames_per_pixel (fpp); - if (fpp == frames_per_pixel) { + clamp_samples_per_pixel (fpp); + if (fpp == samples_per_pixel) { return; } @@ -1660,7 +1660,7 @@ Editor::temporal_zoom_to_frame (bool coarser, framepos_t frame) double range_before = frame - leftmost_frame; double new_fpp; - new_fpp = frames_per_pixel; + new_fpp = samples_per_pixel; if (coarser) { new_fpp *= 1.61803399; @@ -1670,7 +1670,7 @@ Editor::temporal_zoom_to_frame (bool coarser, framepos_t frame) range_before /= 1.61803399; } - if (new_fpp == frames_per_pixel) { + if (new_fpp == samples_per_pixel) { return; } @@ -4419,14 +4419,14 @@ Editor::reset_point_selection () void Editor::center_playhead () { - float const page = _visible_canvas_width * frames_per_pixel; + float const page = _visible_canvas_width * samples_per_pixel; center_screen_internal (playhead_cursor->current_frame (), page); } void Editor::center_edit_point () { - float const page = _visible_canvas_width * frames_per_pixel; + float const page = _visible_canvas_width * samples_per_pixel; center_screen_internal (get_preferred_edit_position(), page); } diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index 5c06c4e7ed..b1059a1625 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -860,9 +860,9 @@ Editor::update_fixed_rulers () compute_fixed_ruler_scale (); - ruler_metrics[ruler_metric_timecode].units_per_pixel = frames_per_pixel; - ruler_metrics[ruler_metric_samples].units_per_pixel = frames_per_pixel; - ruler_metrics[ruler_metric_minsec].units_per_pixel = frames_per_pixel; + ruler_metrics[ruler_metric_timecode].units_per_pixel = samples_per_pixel; + ruler_metrics[ruler_metric_samples].units_per_pixel = samples_per_pixel; + ruler_metrics[ruler_metric_minsec].units_per_pixel = samples_per_pixel; rightmost_frame = leftmost_frame + current_page_samples(); @@ -897,7 +897,7 @@ Editor::update_tempo_based_rulers (ARDOUR::TempoMap::BBTPointList::const_iterato compute_bbt_ruler_scale (leftmost_frame, leftmost_frame+current_page_samples(), begin, end); - ruler_metrics[ruler_metric_bbt].units_per_pixel = frames_per_pixel; + ruler_metrics[ruler_metric_bbt].units_per_pixel = samples_per_pixel; if (ruler_bbt_action->get_active()) { gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_bbt_ruler), leftmost_frame, leftmost_frame+current_page_samples(), diff --git a/gtk2_ardour/ghostregion.cc b/gtk2_ardour/ghostregion.cc index caab67ef44..f881efa8d2 100644 --- a/gtk2_ardour/ghostregion.cc +++ b/gtk2_ardour/ghostregion.cc @@ -108,10 +108,10 @@ AudioGhostRegion::AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, do } void -AudioGhostRegion::set_frames_per_pixel (double fpp) +AudioGhostRegion::set_samples_per_pixel (double fpp) { for (vector::iterator i = waves.begin(); i != waves.end(); ++i) { - (*i)->set_frames_per_pixel (fpp); + (*i)->set_samples_per_pixel (fpp); } } @@ -200,7 +200,7 @@ MidiGhostRegion::GhostEvent::~GhostEvent () } void -MidiGhostRegion::set_frames_per_pixel (double /*spu*/) +MidiGhostRegion::set_samples_per_pixel (double /*spu*/) { } diff --git a/gtk2_ardour/ghostregion.h b/gtk2_ardour/ghostregion.h index 646de24dfc..e8271a8ad8 100644 --- a/gtk2_ardour/ghostregion.h +++ b/gtk2_ardour/ghostregion.h @@ -39,7 +39,7 @@ public: GhostRegion(ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos); virtual ~GhostRegion(); - virtual void set_frames_per_pixel (double) = 0; + virtual void set_samples_per_pixel (double) = 0; virtual void set_height(); virtual void set_colors(); @@ -62,7 +62,7 @@ class AudioGhostRegion : public GhostRegion { public: AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos); - void set_frames_per_pixel (double); + void set_samples_per_pixel (double); void set_height(); void set_colors(); @@ -87,7 +87,7 @@ public: MidiStreamView* midi_view(); void set_height(); - void set_frames_per_pixel (double spu); + void set_samples_per_pixel (double spu); void set_colors(); void update_range(); diff --git a/gtk2_ardour/imageframe_time_axis.cc b/gtk2_ardour/imageframe_time_axis.cc index 9a870a915a..e4a2efa2b6 100644 --- a/gtk2_ardour/imageframe_time_axis.cc +++ b/gtk2_ardour/imageframe_time_axis.cc @@ -146,12 +146,12 @@ ImageFrameTimeAxis::set_height (uint32_t h) * @param fpp the number of frames per pixel */ void -ImageFrameTimeAxis::set_frames_per_pixel (double fpp) +ImageFrameTimeAxis::set_samples_per_pixel (double fpp) { - TimeAxisView::set_frames_per_pixel (editor.get_current_zoom ()); + TimeAxisView::set_samples_per_pixel (editor.get_current_zoom ()); if (view) { - view->set_frames_per_pixel (fpp); + view->set_samples_per_pixel (fpp); } } diff --git a/gtk2_ardour/imageframe_time_axis.h b/gtk2_ardour/imageframe_time_axis.h index 6866261a80..cb7723bb4f 100644 --- a/gtk2_ardour/imageframe_time_axis.h +++ b/gtk2_ardour/imageframe_time_axis.h @@ -78,7 +78,7 @@ class ImageFrameTimeAxis : public VisualTimeAxis */ virtual void set_height(uint32_t h) ; - virtual void set_frames_per_pixel (double); + virtual void set_samples_per_pixel (double); /** * Returns the available height for images to be drawn onto diff --git a/gtk2_ardour/imageframe_time_axis_group.cc b/gtk2_ardour/imageframe_time_axis_group.cc index 5fb9fc2770..c3efbc9641 100644 --- a/gtk2_ardour/imageframe_time_axis_group.cc +++ b/gtk2_ardour/imageframe_time_axis_group.cc @@ -147,14 +147,14 @@ ImageFrameTimeAxisGroup::set_item_heights(gdouble h) * @param spu the new samples per canvas unit value */ int -ImageFrameTimeAxisGroup::set_item_frames_per_pixel (double fpp) +ImageFrameTimeAxisGroup::set_item_samples_per_pixel (double fpp) { if (fpp < 1.0) { return -1; } for (ImageFrameViewList::const_iterator citer = imageframe_views.begin(); citer != imageframe_views.end(); ++citer) { - (*citer)->set_frames_per_pixel (fpp); + (*citer)->set_samples_per_pixel (fpp); } return 0; diff --git a/gtk2_ardour/imageframe_time_axis_group.h b/gtk2_ardour/imageframe_time_axis_group.h index 9c104b3b74..e59d596571 100644 --- a/gtk2_ardour/imageframe_time_axis_group.h +++ b/gtk2_ardour/imageframe_time_axis_group.h @@ -104,7 +104,7 @@ class ImageFrameTimeAxisGroup : public sigc::trackable */ int set_item_heights(gdouble) ; - int set_item_frames_per_pixel (double); + int set_item_samples_per_pixel (double); /** * Sets the color of the items contained uopn this view helper @@ -256,7 +256,7 @@ class ImageFrameTimeAxisGroup : public sigc::trackable * convenience method to re-get the samples per unit and tell items upon this view * */ - void reset_frames_per_pixel (); + void reset_samples_per_pixel (); /** * Callback used to remove this group during the gtk idle loop diff --git a/gtk2_ardour/imageframe_time_axis_view.cc b/gtk2_ardour/imageframe_time_axis_view.cc index b883ae919d..fa351cd8f0 100644 --- a/gtk2_ardour/imageframe_time_axis_view.cc +++ b/gtk2_ardour/imageframe_time_axis_view.cc @@ -59,9 +59,9 @@ ImageFrameTimeAxisView::ImageFrameTimeAxisView (ImageFrameTimeAxis& tv) canvas_rect.signal_event().connect (sigc::bind (sigc::mem_fun (_trackview.editor, &PublicEditor::canvas_imageframe_view_event), (ArdourCanvas::Item*) &canvas_rect, &tv)); - _frames_per_pixel = _trackview.editor.get_current_zoom() ; + _samples_per_pixel = _trackview.editor.get_current_zoom() ; - _trackview.editor.ZoomChanged.connect (sigc::mem_fun(*this, &ImageFrameTimeAxisView::reset_frames_per_pixel)) ; + _trackview.editor.ZoomChanged.connect (sigc::mem_fun(*this, &ImageFrameTimeAxisView::reset_samples_per_pixel)) ; selected_imageframe_group = 0 ; selected_imageframe_view = 0 ; @@ -146,16 +146,16 @@ ImageFrameTimeAxisView::set_position (gdouble x, gdouble y) * @param spu the new samples per canvas unit value */ int -ImageFrameTimeAxisView::set_frames_per_pixel (double fpp) +ImageFrameTimeAxisView::set_samples_per_pixel (double fpp) { if (fpp < 1.0) { return -1; } - _frames_per_pixel = fpp; + _samples_per_pixel = fpp; for (ImageFrameGroupList::const_iterator citer = imageframe_groups.begin(); citer != imageframe_groups.end(); ++citer) { - (*citer)->set_item_frames_per_pixels (fpp); + (*citer)->set_item_samples_per_pixels (fpp); } return 0; @@ -182,9 +182,9 @@ ImageFrameTimeAxisView::apply_color(Gdk::Color& color) * */ void -ImageFrameTimeAxisView::reset_frames_per_pixel () +ImageFrameTimeAxisView::reset_samples_per_pixel () { - set_frames_per_pixel (_trackview.editor.get_current_zoom()); + set_samples_per_pixel (_trackview.editor.get_current_zoom()); } diff --git a/gtk2_ardour/imageframe_time_axis_view.h b/gtk2_ardour/imageframe_time_axis_view.h index e1d0c6567f..a32f989447 100644 --- a/gtk2_ardour/imageframe_time_axis_view.h +++ b/gtk2_ardour/imageframe_time_axis_view.h @@ -93,8 +93,8 @@ class ImageFrameTimeAxisView : public sigc::trackable */ int set_position(gdouble x, gdouble y) ; - int set_frames_per_pixel (double); - double get_frames_per_pixel () { return _frames_per_pixel; } + int set_samples_per_pixel (double); + double get_samples_per_pixel () { return _samples_per_pixel; } /** * Sets the color of the items contained uopn this view helper @@ -223,7 +223,7 @@ class ImageFrameTimeAxisView : public sigc::trackable /** * convenience method to re-get the samples per unit and tell items upon this view */ - void reset_frames_per_pixel (); + void reset_samples_per_pixel (); /** * The list of ImageFrameViews held by this view helper */ @@ -248,7 +248,7 @@ class ImageFrameTimeAxisView : public sigc::trackable ArdourCanvas::Rectangle canvas_rect; /* frame around the whole thing */ /** the current frames per pixel */ - double _frames_per_pixel; + double _samples_per_pixel; /* XXX why are these different? */ Gdk::Color region_color ; diff --git a/gtk2_ardour/marker_time_axis.cc b/gtk2_ardour/marker_time_axis.cc index 4cc2cec92f..63837644e1 100644 --- a/gtk2_ardour/marker_time_axis.cc +++ b/gtk2_ardour/marker_time_axis.cc @@ -126,12 +126,12 @@ MarkerTimeAxis::set_height (uint32_t h) * @param spu the number of frames per pixel */ void -MarkerTimeAxis::set_frames_per_pixel (double fpp) +MarkerTimeAxis::set_samples_per_pixel (double fpp) { - TimeAxisView::set_frames_per_pixel (editor.get_current_zoom()); + TimeAxisView::set_samples_per_pixel (editor.get_current_zoom()); if (view) { - view->set_frames_per_pixel (fpp); + view->set_samples_per_pixel (fpp); } } diff --git a/gtk2_ardour/marker_time_axis.h b/gtk2_ardour/marker_time_axis.h index fccb5019fe..c50513acf7 100644 --- a/gtk2_ardour/marker_time_axis.h +++ b/gtk2_ardour/marker_time_axis.h @@ -79,7 +79,7 @@ class MarkerTimeAxis : public VisualTimeAxis */ virtual void set_height(uint32_t h) ; - virtual void set_frames_per_pixel (double); + virtual void set_samples_per_pixel (double); /** diff --git a/gtk2_ardour/marker_time_axis_view.cc b/gtk2_ardour/marker_time_axis_view.cc index 89d9acd111..3fc44fa017 100644 --- a/gtk2_ardour/marker_time_axis_view.cc +++ b/gtk2_ardour/marker_time_axis_view.cc @@ -63,9 +63,9 @@ MarkerTimeAxisView::MarkerTimeAxisView(MarkerTimeAxis& tv) canvas_rect->signal_event().connect (sigc::bind (sigc::mem_fun (_trackview.editor, &PublicEditor::canvas_marker_time_axis_view_event), canvas_rect, &_trackview)); - _frames_per_pixel = _trackview.editor.get_current_zoom() ; + _samples_per_pixel = _trackview.editor.get_current_zoom() ; - _trackview.editor.ZoomChanged.connect (sigc::mem_fun(*this, &MarkerTimeAxisView::reset_frames_per_pixel)); + _trackview.editor.ZoomChanged.connect (sigc::mem_fun(*this, &MarkerTimeAxisView::reset_samples_per_pixel)); MarkerView::CatchDeletion.connect (*this, boost::bind (&MarkerTimeAxisView::remove_marker_view, this, _1), gui_context()); } @@ -144,16 +144,16 @@ MarkerTimeAxisView::set_position(gdouble x, gdouble y) * @param fpp the new frames per pixel value */ int -MarkerTimeAxisView::set_frames_per_pixel (double fpp) +MarkerTimeAxisView::set_samples_per_pixel (double fpp) { if (spp < 1.0) { return -1; } - _frames_per_pixel = fpp; + _samples_per_pixel = fpp; for (MarkerViewList::iterator i = marker_view_list.begin(); i != marker_view_list.end(); ++i) { - (*i)->set_frames_per_pixel (spp); + (*i)->set_samples_per_pixel (spp); } return 0; @@ -382,7 +382,7 @@ MarkerTimeAxisView::get_selected_time_axis_item() * */ void -MarkerTimeAxisView::reset_frames_per_pixel () +MarkerTimeAxisView::reset_samples_per_pixel () { - set_frames_per_pixel (_trackview.editor.get_current_zoom()); + set_samples_per_pixel (_trackview.editor.get_current_zoom()); } diff --git a/gtk2_ardour/marker_time_axis_view.h b/gtk2_ardour/marker_time_axis_view.h index d0cd6007ee..8fdf9b788a 100644 --- a/gtk2_ardour/marker_time_axis_view.h +++ b/gtk2_ardour/marker_time_axis_view.h @@ -91,14 +91,14 @@ class MarkerTimeAxisView : public sigc::trackable */ int set_position(gdouble x, gdouble y) ; - int set_frames_per_pixel (double); + int set_samples_per_pixel (double); /** * Returns the current samples per unit of this time axis view helper * * @return the current samples per unit of this time axis view helper */ - gdouble get_frames_per_pixel() { return _frames_per_pixel; } + gdouble get_samples_per_pixel() { return _samples_per_pixel; } /** * Sets the color of the items contained upon this view helper @@ -203,7 +203,7 @@ class MarkerTimeAxisView : public sigc::trackable * convenience method to re-get the samples per unit and tell items upon this view * */ - void reset_frames_per_pixel() ; + void reset_samples_per_pixel() ; /** The list of items held by this time axis view helper */ typedef std::list MarkerViewList ; @@ -219,7 +219,7 @@ class MarkerTimeAxisView : public sigc::trackable ArdourCanvas::Rectangle *canvas_rect; /* frame around the whole thing */ /** the current frames per pixel */ - double _frames_per_pixel; + double _samples_per_pixel; /* XXX why are these different? */ Gdk::Color region_color; diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 8d2067b61f..26ddb2c338 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -1451,7 +1451,7 @@ MidiRegionView::add_ghost (TimeAxisView& tv) { Note* note; - double unit_position = _region->position () / frames_per_pixel; + double unit_position = _region->position () / samples_per_pixel; MidiTimeAxisView* mtv = dynamic_cast(&tv); MidiGhostRegion* ghost; @@ -1471,7 +1471,7 @@ MidiRegionView::add_ghost (TimeAxisView& tv) } ghost->set_height (); - ghost->set_duration (_region->length() / frames_per_pixel); + ghost->set_duration (_region->length() / samples_per_pixel); ghosts.push_back (ghost); GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RegionView::remove_ghost, this, _1), gui_context()); diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index a292bdd10e..3c00147393 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -70,7 +70,7 @@ public: MidiRegionView (ArdourCanvas::Group *, RouteTimeAxisView&, boost::shared_ptr, - double initial_frames_per_pixel, + double initial_samples_per_pixel, Gdk::Color const & basic_color); MidiRegionView (const MidiRegionView& other); @@ -312,7 +312,7 @@ protected: MidiRegionView (ArdourCanvas::Group *, RouteTimeAxisView&, boost::shared_ptr, - double frames_per_pixel, + double samples_per_pixel, Gdk::Color& basic_color, TimeAxisViewItem::Visibility); diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc index ea3c0ffeda..c48a5e77f4 100644 --- a/gtk2_ardour/midi_streamview.cc +++ b/gtk2_ardour/midi_streamview.cc @@ -108,7 +108,7 @@ MidiStreamView::create_region_view (boost::shared_ptr r, bool /*wfd*/, b } RegionView* region_view = new MidiRegionView (_canvas_group, _trackview, region, - _frames_per_pixel, region_color); + _samples_per_pixel, region_color); region_view->init (region_color, false); diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index 88f7cf9387..1b6ed3a6ff 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -423,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::iterator i = ghosts.begin(); i != ghosts.end(); ++i) { @@ -489,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::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); } @@ -509,7 +509,7 @@ RegionView::set_duration (framecnt_t frames, void *src) } for (vector::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; @@ -639,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-> */ @@ -667,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)); @@ -739,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), diff --git a/gtk2_ardour/region_view.h b/gtk2_ardour/region_view.h index f94fc8ed8d..566304fa92 100644 --- a/gtk2_ardour/region_view.h +++ b/gtk2_ardour/region_view.h @@ -48,7 +48,7 @@ class RegionView : public TimeAxisViewItem RegionView (ArdourCanvas::Group* parent, TimeAxisView& time_view, boost::shared_ptr region, - double frames_per_pixel, + double samples_per_pixel, Gdk::Color const & basic_color, bool automation = false); @@ -66,7 +66,7 @@ class RegionView : public TimeAxisViewItem void set_valid (bool yn) { valid = yn; } virtual void set_height (double); - virtual void set_frames_per_pixel (double); + virtual void set_samples_per_pixel (double); virtual bool set_duration (framecnt_t, void*); void move (double xdelta, double ydelta); @@ -130,7 +130,7 @@ class RegionView : public TimeAxisViewItem RegionView (ArdourCanvas::Group *, TimeAxisView&, boost::shared_ptr, - double frames_per_pixel, + double samples_per_pixel, Gdk::Color const & basic_color, bool recording, TimeAxisViewItem::Visibility); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index d9b96066d3..904968b9ab 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -232,7 +232,7 @@ RouteTimeAxisView::set_route (boost::shared_ptr rt) } - _editor.ZoomChanged.connect (sigc::mem_fun(*this, &RouteTimeAxisView::reset_frames_per_pixel)); + _editor.ZoomChanged.connect (sigc::mem_fun(*this, &RouteTimeAxisView::reset_samples_per_pixel)); _editor.HorizontalPositionChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::horizontal_position_changed)); ColorsChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::color_handler)); @@ -890,9 +890,9 @@ RouteTimeAxisView::route_color_changed () } void -RouteTimeAxisView::reset_frames_per_pixel () +RouteTimeAxisView::reset_samples_per_pixel () { - set_frames_per_pixel (_editor.get_current_zoom()); + set_samples_per_pixel (_editor.get_current_zoom()); } void @@ -904,7 +904,7 @@ RouteTimeAxisView::horizontal_position_changed () } void -RouteTimeAxisView::set_frames_per_pixel (double fpp) +RouteTimeAxisView::set_samples_per_pixel (double fpp) { double speed = 1.0; @@ -913,10 +913,10 @@ RouteTimeAxisView::set_frames_per_pixel (double fpp) } if (_view) { - _view->set_frames_per_pixel (fpp * speed); + _view->set_samples_per_pixel (fpp * speed); } - TimeAxisView::set_frames_per_pixel (fpp * speed); + TimeAxisView::set_samples_per_pixel (fpp * speed); } void @@ -1134,7 +1134,7 @@ RouteTimeAxisView::clear_playlist () void RouteTimeAxisView::speed_changed () { - Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&RouteTimeAxisView::reset_frames_per_pixel, this)); + Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&RouteTimeAxisView::reset_samples_per_pixel, this)); } void diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index d6ea6f4124..7a01ece03c 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -82,7 +82,7 @@ public: void show_selection (TimeSelection&); void set_button_names (); - void set_frames_per_pixel (double); + void set_samples_per_pixel (double); void set_height (uint32_t h); void show_timestretch (framepos_t start, framepos_t end, int layers, int layer); void hide_timestretch (); @@ -211,7 +211,7 @@ protected: virtual void label_view (); - void reset_frames_per_pixel (); + void reset_samples_per_pixel (); void horizontal_position_changed (); virtual void build_automation_action_menu (bool); diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc index e2146d62ab..fac4572c92 100644 --- a/gtk2_ardour/streamview.cc +++ b/gtk2_ardour/streamview.cc @@ -56,7 +56,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* background_g , owns_canvas_group (canvas_group == 0) , _background_group (background_group ? background_group : new ArdourCanvas::Group (_trackview.canvas_background())) , _canvas_group (canvas_group ? canvas_group : new ArdourCanvas::Group (_trackview.canvas_display())) - , _frames_per_pixel (_trackview.editor().get_current_zoom ()) + , _samples_per_pixel (_trackview.editor().get_current_zoom ()) , rec_updating(false) , rec_active(false) , stream_base_color(0xFFFFFFFF) @@ -144,7 +144,7 @@ StreamView::set_height (double h) } int -StreamView::set_frames_per_pixel (double fpp) +StreamView::set_samples_per_pixel (double fpp) { RegionViewList::iterator i; @@ -152,10 +152,10 @@ StreamView::set_frames_per_pixel (double fpp) return -1; } - _frames_per_pixel = fpp; + _samples_per_pixel = fpp; for (i = region_views.begin(); i != region_views.end(); ++i) { - (*i)->set_frames_per_pixel (fpp); + (*i)->set_samples_per_pixel (fpp); } for (vector::iterator xi = rec_rects.begin(); xi != rec_rects.end(); ++xi) { diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h index 0fe56dd10c..869772ed20 100644 --- a/gtk2_ardour/streamview.h +++ b/gtk2_ardour/streamview.h @@ -73,8 +73,8 @@ public: int set_position (gdouble x, gdouble y); virtual int set_height (double); - virtual int set_frames_per_pixel (double); - gdouble get_frames_per_pixel () const { return _frames_per_pixel; } + virtual int set_samples_per_pixel (double); + gdouble get_samples_per_pixel () const { return _samples_per_pixel; } virtual void horizontal_position_changed () {} virtual void enter_internal_edit_mode (); @@ -161,7 +161,7 @@ protected: typedef std::list RegionViewList; RegionViewList region_views; - double _frames_per_pixel; + double _samples_per_pixel; sigc::connection screen_update_connection; std::vector rec_rects; diff --git a/gtk2_ardour/tape_region_view.h b/gtk2_ardour/tape_region_view.h index dee5e1c3e4..c0e04cd8da 100644 --- a/gtk2_ardour/tape_region_view.h +++ b/gtk2_ardour/tape_region_view.h @@ -30,7 +30,7 @@ class TapeAudioRegionView : public AudioRegionView TapeAudioRegionView (ArdourCanvas::Group *, RouteTimeAxisView&, boost::shared_ptr, - double initial_frames_per_pixel, + double initial_samples_per_pixel, Gdk::Color const & base_color); ~TapeAudioRegionView (); diff --git a/gtk2_ardour/tempo_lines.cc b/gtk2_ardour/tempo_lines.cc index 9a9619c826..5cb059cbee 100644 --- a/gtk2_ardour/tempo_lines.cc +++ b/gtk2_ardour/tempo_lines.cc @@ -75,7 +75,7 @@ TempoLines::hide () void TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin, const ARDOUR::TempoMap::BBTPointList::const_iterator& end, - double frames_per_pixel) + double samples_per_pixel) { ARDOUR::TempoMap::BBTPointList::const_iterator i; ArdourCanvas::Line *line = 0; @@ -105,12 +105,12 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin, return; } - xpos = rint(((framepos_t)(*i).frame) / (double)frames_per_pixel); + xpos = rint(((framepos_t)(*i).frame) / (double)samples_per_pixel); const double needed_right = xpos; i = begin; - xpos = rint(((framepos_t)(*i).frame) / (double)frames_per_pixel); + xpos = rint(((framepos_t)(*i).frame) / (double)samples_per_pixel); const double needed_left = xpos; Lines::iterator left = _lines.lower_bound(xpos); // first line >= xpos @@ -142,7 +142,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin, color = ARDOUR_UI::config()->canvasvar_MeasureLineBeat.get(); } - xpos = rint(((framepos_t)(*i).frame) / (double)frames_per_pixel); + xpos = rint(((framepos_t)(*i).frame) / (double)samples_per_pixel); li = _lines.lower_bound(xpos); // first line >= xpos diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index cd1f7229d9..f8127b1172 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -794,10 +794,10 @@ TimeAxisView::build_display_menu () } void -TimeAxisView::set_frames_per_pixel (double fpp) +TimeAxisView::set_samples_per_pixel (double fpp) { for (Children::iterator i = children.begin(); i != children.end(); ++i) { - (*i)->set_frames_per_pixel (fpp); + (*i)->set_samples_per_pixel (fpp); } AnalysisFeatureList::const_iterator i; diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index b9cae8cb23..86fd6ae67b 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -154,7 +154,7 @@ class TimeAxisView : public virtual AxisView virtual ARDOUR::RouteGroup* route_group() const { return 0; } virtual boost::shared_ptr playlist() const { return boost::shared_ptr (); } - virtual void set_frames_per_pixel (double); + virtual void set_samples_per_pixel (double); virtual void show_selection (TimeSelection&); virtual void hide_selection (); virtual void reshow_selection (TimeSelection&); diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index 01d77cf78a..bd00f5484d 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -138,7 +138,7 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other) _selected = other._selected; - init (other.item_name, other.frames_per_pixel, c, other.frame_position, + init (other.item_name, other.samples_per_pixel, c, other.frame_position, other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name); } @@ -146,7 +146,7 @@ void TimeAxisViewItem::init (const string& it_name, double fpp, Gdk::Color const & base_color, framepos_t start, framepos_t duration, Visibility vis, bool wide, bool high) { item_name = it_name; - frames_per_pixel = fpp; + samples_per_pixel = fpp; frame_position = start; item_duration = duration; name_connected = false; @@ -301,7 +301,7 @@ TimeAxisViewItem::set_position(framepos_t pos, void* src, double* delta) */ double old_unit_pos; - double new_unit_pos = pos / frames_per_pixel; + double new_unit_pos = pos / samples_per_pixel; old_unit_pos = group->position().x; @@ -799,9 +799,9 @@ TimeAxisViewItem::set_trim_handle_colors() /** @return the frames per pixel */ double -TimeAxisViewItem::get_frames_per_pixel () const +TimeAxisViewItem::get_samples_per_pixel () const { - return frames_per_pixel; + return samples_per_pixel; } /** Set the frames per pixel of this item. @@ -811,11 +811,11 @@ TimeAxisViewItem::get_frames_per_pixel () const * @param fpp the new frames per pixel */ void -TimeAxisViewItem::set_frames_per_pixel (double fpp) +TimeAxisViewItem::set_samples_per_pixel (double fpp) { - frames_per_pixel = fpp; + samples_per_pixel = fpp; set_position (this->get_position(), this); - reset_width_dependent_items ((double) get_duration() / frames_per_pixel); + reset_width_dependent_items ((double) get_duration() / samples_per_pixel); } void diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h index 0b3e019719..2f4e5f465d 100644 --- a/gtk2_ardour/time_axis_view_item.h +++ b/gtk2_ardour/time_axis_view_item.h @@ -77,9 +77,9 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList ArdourCanvas::Item* get_name_highlight(); ArdourCanvas::Pixbuf* get_name_pixbuf(); - virtual void set_frames_per_pixel (double); + virtual void set_samples_per_pixel (double); - double get_frames_per_pixel () const; + double get_samples_per_pixel () const; virtual void drag_start() { _dragging = true; } virtual void drag_end() { _dragging = false; } @@ -194,7 +194,7 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList bool min_duration_active; /** frames per canvas pixel */ - double frames_per_pixel; + double samples_per_pixel; /** should the item respond to events */ bool _sensitive; -- cgit v1.2.3