change frames_per_pixel to samples_per_pixel

This commit is contained in:
Paul Davis 2013-04-12 11:31:50 -04:00
parent e5a3747686
commit b05968fb4e
43 changed files with 172 additions and 174 deletions

View file

@ -202,7 +202,7 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
region_resized (ARDOUR::bounds_change); region_resized (ARDOUR::bounds_change);
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) { 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);
} }
region_locked (); region_locked ();
@ -545,7 +545,7 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, f
Points* points; Points* points;
/* round here to prevent little visual glitches with sub-pixel placement */ /* 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); uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
double h; double h;
@ -632,11 +632,11 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar,
Points* points; Points* points;
/* round here to prevent little visual glitches with sub-pixel placement */ /* 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); uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
double h; 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; /* 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. * it's `one out' for precise pixel accuracy.
@ -715,13 +715,13 @@ AudioRegionView::get_fade_out_shape_width ()
void 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 ()) { if (Config->get_show_waveforms ()) {
for (uint32_t n = 0; n < waves.size(); ++n) { 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. this when waveforms are hidden.
*/ */
// CAIROCANVAS // CAIROCANVAS
//waves[n]->set_frames_per_pixel (_frames_per_pixel); //waves[n]->set_samples_per_pixel (_samples_per_pixel);
waves[n]->show(); waves[n]->show();
} }
} else { } else {
@ -898,7 +898,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
wave->set_x_position (0); wave->set_x_position (0);
wave->set_y_position (yoff); wave->set_y_position (yoff);
wave->set_height (ht); 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; wave->property_amplitude_above_axis() = _amplitude_above_axis;
if (_recregion) { if (_recregion) {
@ -1045,7 +1045,7 @@ AudioRegionView::add_ghost (TimeAxisView& tv)
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(&trackview); RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(&trackview);
assert(rtv); 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); AudioGhostRegion* ghost = new AudioGhostRegion (tv, trackview, unit_position);
uint32_t nchans; uint32_t nchans;
@ -1061,7 +1061,7 @@ AudioRegionView::add_ghost (TimeAxisView& tv)
wave->set_channel (n); wave->set_channel (n);
wave->set_x_position (0); 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->property_amplitude_above_axis() = _amplitude_above_axis;
wave->set_region_start (_region->start()); wave->set_region_start (_region->start());
@ -1069,7 +1069,7 @@ AudioRegionView::add_ghost (TimeAxisView& tv)
} }
ghost->set_height (); ghost->set_height ();
ghost->set_duration (_region->length() / frames_per_pixel); ghost->set_duration (_region->length() / samples_per_pixel);
ghost->set_colors(); ghost->set_colors();
ghosts.push_back (ghost); ghosts.push_back (ghost);

View file

@ -49,13 +49,13 @@ class AudioRegionView : public RegionView
AudioRegionView (ArdourCanvas::Group *, AudioRegionView (ArdourCanvas::Group *,
RouteTimeAxisView&, RouteTimeAxisView&,
boost::shared_ptr<ARDOUR::AudioRegion>, boost::shared_ptr<ARDOUR::AudioRegion>,
double initial_frames_per_pixel, double initial_samples_per_pixel,
Gdk::Color const & basic_color); Gdk::Color const & basic_color);
AudioRegionView (ArdourCanvas::Group *, AudioRegionView (ArdourCanvas::Group *,
RouteTimeAxisView&, RouteTimeAxisView&,
boost::shared_ptr<ARDOUR::AudioRegion>, boost::shared_ptr<ARDOUR::AudioRegion>,
double frames_per_pixel, double samples_per_pixel,
Gdk::Color const & basic_color, Gdk::Color const & basic_color,
bool recording, bool recording,
TimeAxisViewItem::Visibility); TimeAxisViewItem::Visibility);
@ -71,7 +71,7 @@ class AudioRegionView : public RegionView
void create_waves (); void create_waves ();
void set_height (double); void set_height (double);
void set_frames_per_pixel (double); void set_samples_per_pixel (double);
void set_amplitude_above_axis (gdouble spp); void set_amplitude_above_axis (gdouble spp);

View file

@ -98,19 +98,19 @@ AudioStreamView::create_region_view (boost::shared_ptr<Region> r, bool wait_for_
case Normal: case Normal:
if (recording) { if (recording) {
region_view = new AudioRegionView (_canvas_group, _trackview, region, 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::ShowFrame |
TimeAxisViewItem::HideFrameRight | TimeAxisViewItem::HideFrameRight |
TimeAxisViewItem::HideFrameLeft | TimeAxisViewItem::HideFrameLeft |
TimeAxisViewItem::HideFrameTB)); TimeAxisViewItem::HideFrameTB));
} else { } else {
region_view = new AudioRegionView (_canvas_group, _trackview, region, region_view = new AudioRegionView (_canvas_group, _trackview, region,
_frames_per_pixel, region_color); _samples_per_pixel, region_color);
} }
break; break;
case Destructive: case Destructive:
region_view = new TapeAudioRegionView (_canvas_group, _trackview, region, region_view = new TapeAudioRegionView (_canvas_group, _trackview, region,
_frames_per_pixel, region_color); _samples_per_pixel, region_color);
break; break;
default: default:
fatal << string_compose (_("programming error: %1"), "illegal track mode in ::add_region_view_internal") << endmsg; fatal << string_compose (_("programming error: %1"), "illegal track mode in ::add_region_view_internal") << endmsg;

View file

@ -69,7 +69,7 @@ AutomationRegionView::init (Gdk::Color const & basic_color, bool /*wfd*/)
compute_colors (basic_color); 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()); set_height (trackview.current_height());

View file

@ -42,7 +42,7 @@ public:
boost::shared_ptr<ARDOUR::Region>, boost::shared_ptr<ARDOUR::Region>,
const Evoral::Parameter& parameter, const Evoral::Parameter& parameter,
boost::shared_ptr<ARDOUR::AutomationList>, boost::shared_ptr<ARDOUR::AutomationList>,
double initial_frames_per_pixel, double initial_samples_per_pixel,
Gdk::Color const & basic_color); Gdk::Color const & basic_color);
~AutomationRegionView(); ~AutomationRegionView();

View file

@ -105,7 +105,7 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region
region_view = new AutomationRegionView ( region_view = new AutomationRegionView (
_canvas_group, _automation_view, region, _canvas_group, _automation_view, region,
_automation_view.parameter (), list, _automation_view.parameter (), list,
_frames_per_pixel, region_color _samples_per_pixel, region_color
); );
region_view->init (region_color, false); region_view->init (region_color, false);

View file

@ -437,16 +437,16 @@ AutomationTimeAxisView::set_height (uint32_t h)
} }
void 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) { if (_line) {
_line->reset (); _line->reset ();
} }
if (_view) { if (_view) {
_view->set_frames_per_pixel (fpp); _view->set_samples_per_pixel (fpp);
} }
} }

View file

@ -69,7 +69,7 @@ class AutomationTimeAxisView : public TimeAxisView {
~AutomationTimeAxisView(); ~AutomationTimeAxisView();
virtual void set_height (uint32_t); virtual void set_height (uint32_t);
void set_frames_per_pixel (double); void set_samples_per_pixel (double);
std::string name() const { return _name; } std::string name() const { return _name; }
void add_automation_event (GdkEvent *, framepos_t, double); void add_automation_event (GdkEvent *, framepos_t, double);

View file

@ -624,7 +624,7 @@ CrossfadeEditor::canvas_allocation (Gtk::Allocation& /*alloc*/)
(*i)->set_y_position (yoff); (*i)->set_y_position (yoff);
(*i)->set_height (ht); (*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(); 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_y_position (yoff);
(*i)->set_height (ht); (*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<AudioRegion> region, WhichFade wh
waveview->set_x_position (canvas_border); waveview->set_x_position (canvas_border);
waveview->set_y_position (yoff); waveview->set_y_position (yoff);
waveview->set_height (ht); waveview->set_height (ht);
waveview->set_frames_per_pixel (spu); waveview->set_samples_per_pixel (spu);
waveview->property_amplitude_above_axis() = 2.0; waveview->property_amplitude_above_axis() = 2.0;
waveview->set_outline_color (color); waveview->set_outline_color (color);
waveview->set_fill_color (color); waveview->set_fill_color (color);

View file

@ -39,7 +39,7 @@ public:
CrossfadeView (ArdourCanvas::Group*, CrossfadeView (ArdourCanvas::Group*,
RouteTimeAxisView&, RouteTimeAxisView&,
boost::shared_ptr<ARDOUR::Crossfade>, boost::shared_ptr<ARDOUR::Crossfade>,
double initial_frames_per_pixel, double initial_samples_per_pixel,
Gdk::Color& basic_color, Gdk::Color& basic_color,
AudioRegionView& leftview, AudioRegionView& leftview,
AudioRegionView& rightview); AudioRegionView& rightview);

View file

@ -377,7 +377,7 @@ Editor::Editor ()
_internal_editing = false; _internal_editing = false;
current_canvas_cursor = 0; 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; _scroll_callbacks = 0;
@ -929,7 +929,7 @@ Editor::zoom_adjustment_changed ()
} }
double fpu = zoom_range_clock->current_duration() / _visible_canvas_width; 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) { if (clamped) {
zoom_range_clock->set ((framepos_t) floor (fpu * _visible_canvas_width)); zoom_range_clock->set ((framepos_t) floor (fpu * _visible_canvas_width));
@ -1139,7 +1139,7 @@ Editor::map_position_change (framepos_t frame)
void void
Editor::center_screen (framepos_t frame) 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. /* 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); _session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks);
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
(static_cast<TimeAxisView*>(*i))->set_frames_per_pixel (frames_per_pixel); (static_cast<TimeAxisView*>(*i))->set_samples_per_pixel (samples_per_pixel);
} }
super_rapid_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect ( 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"))) { if ((prop = node.property ("zoom"))) {
reset_zoom (PBD::atof (prop->value())); reset_zoom (PBD::atof (prop->value()));
} else { } else {
reset_zoom (frames_per_pixel); reset_zoom (samples_per_pixel);
} }
if ((prop = node.property ("snap-to"))) { if ((prop = node.property ("snap-to"))) {
@ -2501,7 +2501,7 @@ Editor::get_state ()
maybe_add_mixer_strip_width (*node); maybe_add_mixer_strip_width (*node);
node->add_property ("zoom-focus", enum_2_string (zoom_focus)); 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 ("zoom", buf);
node->add_property ("snap-to", enum_2_string (_snap_type)); node->add_property ("snap-to", enum_2_string (_snap_type));
node->add_property ("snap-mode", enum_2_string (_snap_mode)); node->add_property ("snap-mode", enum_2_string (_snap_mode));
@ -4129,14 +4129,14 @@ Editor::reset_y_origin (double y)
void void
Editor::reset_zoom (double fpp) 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; return;
} }
pending_visual_change.add (VisualChange::ZoomLevel); 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 (); ensure_visual_change_idle_handler ();
} }
@ -4166,7 +4166,7 @@ Editor::current_visual_state (bool with_tracks)
{ {
VisualState* vs = new VisualState (with_tracks); VisualState* vs = new VisualState (with_tracks);
vs->y_position = vertical_adjustment.get_value(); 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->leftmost_frame = leftmost_frame;
vs->zoom_focus = zoom_focus; vs->zoom_focus = zoom_focus;
@ -4228,7 +4228,7 @@ Editor::use_visual_state (VisualState& vs)
vertical_adjustment.set_value (vs.y_position); vertical_adjustment.set_value (vs.y_position);
set_zoom_focus (vs.zoom_focus); 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) { if (vs.gui_state) {
*ARDOUR_UI::instance()->gui_object_state = *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. * @param fpu New frames per unit; should already have been clamped so that it is sensible.
*/ */
void void
Editor::set_frames_per_pixel (double fpp) Editor::set_samples_per_pixel (double fpp)
{ {
if (tempo_lines) { if (tempo_lines) {
tempo_lines->tempo_map_changed(); tempo_lines->tempo_map_changed();
} }
frames_per_pixel = fpp; samples_per_pixel = fpp;
/* convert fpu to frame count */ /* 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); zoom_range_clock->set (frames);
} }
@ -4337,7 +4337,7 @@ Editor::idle_visual_changer ()
double const last_time_origin = horizontal_position (); double const last_time_origin = horizontal_position ();
if (p & VisualChange::ZoomLevel) { 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 (); compute_fixed_ruler_scale ();
@ -4356,7 +4356,7 @@ Editor::idle_visual_changer ()
} }
if (p & VisualChange::TimeOrigin) { 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) { if (p & VisualChange::YOrigin) {
@ -5281,11 +5281,11 @@ Editor::super_rapid_screen_update ()
*/ */
#if 0 #if 0
// FIXME DO SOMETHING THAT WORKS HERE - this is 2.X code // 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) { if (target <= 0.0) {
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); target = (target * 0.15) + (current * 0.85);
} else { } else {
/* relax */ /* relax */

View file

@ -150,7 +150,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
framepos_t leftmost_sample() const { return leftmost_frame; } framepos_t leftmost_sample() const { return leftmost_frame; }
framecnt_t current_page_samples() const { 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 { double visible_canvas_height () const {
@ -221,10 +221,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void transition_to_rolling (bool forward); void transition_to_rolling (bool forward);
/* NOTE: these functions assume that the "pixel" coordinate is /* NOTE: these functions assume that the "pixel" coordinate is
the result of using the world->canvas affine transform on a in canvas coordinates. These coordinates already take into
world coordinate. These coordinates already take into account any scrolling offsets.
account any scrolling carried out by adjusting the
xscroll_adjustment.
*/ */
framepos_t pixel_to_sample (double pixel) const { framepos_t pixel_to_sample (double pixel) const {
@ -236,18 +234,18 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
*/ */
if (pixel >= 0) { if (pixel >= 0) {
return (framepos_t) rint (pixel * frames_per_pixel); return (framepos_t) rint (pixel * samples_per_pixel);
} else { } else {
return 0; return 0;
} }
} }
double sample_to_pixel (framepos_t frame) const { double sample_to_pixel (framepos_t sample) const {
return rint (frame / frames_per_pixel); return rint (sample / samples_per_pixel);
} }
double sample_to_pixel_unrounded (framepos_t frame) const { double sample_to_pixel_unrounded (framepos_t sample) const {
return frame / frames_per_pixel; return sample / samples_per_pixel;
} }
void flush_canvas (); void flush_canvas ();
@ -296,7 +294,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void set_zoom_focus (Editing::ZoomFocus); void set_zoom_focus (Editing::ZoomFocus);
Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; } 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 cycle_zoom_focus ();
void temporal_zoom_step (bool coarser); void temporal_zoom_step (bool coarser);
void tav_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 (bool with_tracks);
~VisualState (); ~VisualState ();
double y_position; double y_position;
double frames_per_pixel; double samples_per_pixel;
framepos_t leftmost_frame; framepos_t leftmost_frame;
Editing::ZoomFocus zoom_focus; Editing::ZoomFocus zoom_focus;
GUIObjectState* gui_state; GUIObjectState* gui_state;
@ -503,11 +501,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void cancel_visual_state_op (uint32_t n); void cancel_visual_state_op (uint32_t n);
framepos_t leftmost_frame; framepos_t leftmost_frame;
double frames_per_pixel; double samples_per_pixel;
Editing::ZoomFocus zoom_focus; Editing::ZoomFocus zoom_focus;
void set_frames_per_pixel (double); void set_samples_per_pixel (double);
bool clamp_frames_per_pixel (double &) const; bool clamp_samples_per_pixel (double &) const;
Editing::MouseMode mouse_mode; Editing::MouseMode mouse_mode;
Editing::MouseMode pre_internal_mouse_mode; Editing::MouseMode pre_internal_mouse_mode;
@ -1039,14 +1037,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
Type pending; Type pending;
framepos_t time_origin; framepos_t time_origin;
double frames_per_pixel; double samples_per_pixel;
double y_origin; double y_origin;
int idle_handler_id; int idle_handler_id;
/** true if we are currently in the idle handler */ /** true if we are currently in the idle handler */
bool being_handled; 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) { void add (Type t) {
pending = Type (pending | t); pending = Type (pending | t);
} }

View file

@ -770,7 +770,7 @@ Editor::set_horizontal_position (double p)
_track_canvas_hadj->set_value (p); _track_canvas_hadj->set_value (p);
_time_bars_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 (); update_fixed_rulers ();
redisplay_tempo (true); redisplay_tempo (true);

View file

@ -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) { if ((*pending_region_position != _last_frame_position) && x_move_allowed) {
/* x movement since last time (in pixels) */ /* x movement since last time (in pixels) */
dx = (static_cast<double> (*pending_region_position) - _last_frame_position) / _editor->frames_per_pixel; dx = (static_cast<double> (*pending_region_position) - _last_frame_position) / _editor->samples_per_pixel;
/* total x movement */ /* total x movement */
framecnt_t total_dx = *pending_region_position; framecnt_t total_dx = *pending_region_position;
@ -2385,7 +2385,7 @@ CursorDrag::start_grab (GdkEvent* event, Gdk::Cursor* c)
{ {
Drag::start_grab (event, 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); framepos_t where = _editor->canvas_event_frame (event, 0, 0);
_editor->snap_to_with_modifier (where, event); _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); _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 before;
uint32_t after; uint32_t after;

View file

@ -1211,7 +1211,7 @@ Editor::cursor_align (bool playhead_to_edit)
void void
Editor::scroll_backward (float pages) 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 const cnt = (framepos_t) floor (pages * one_page);
framepos_t frame; framepos_t frame;
@ -1227,7 +1227,7 @@ Editor::scroll_backward (float pages)
void void
Editor::scroll_forward (float pages) 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 const cnt = (framepos_t) floor (pages * one_page);
framepos_t frame; framepos_t frame;
@ -1331,7 +1331,7 @@ Editor::tav_zoom_smooth (bool coarser, bool force_all)
} }
bool bool
Editor::clamp_frames_per_pixel (double& fpp) const Editor::clamp_samples_per_pixel (double& fpp) const
{ {
bool clamped = false; bool clamped = false;
@ -1353,7 +1353,7 @@ Editor::temporal_zoom_step (bool coarser)
{ {
ENSURE_GUI_THREAD (*this, &Editor::temporal_zoom_step, coarser) ENSURE_GUI_THREAD (*this, &Editor::temporal_zoom_step, coarser)
double nfpp = frames_per_pixel; double nfpp = samples_per_pixel;
if (coarser) { if (coarser) {
nfpp = min (9e6, nfpp * 1.61803399); nfpp = min (9e6, nfpp * 1.61803399);
@ -1383,8 +1383,8 @@ Editor::temporal_zoom (double fpp)
double nfpp; double nfpp;
double l; double l;
clamp_frames_per_pixel (fpp); clamp_samples_per_pixel (fpp);
if (fpp == frames_per_pixel) { if (fpp == samples_per_pixel) {
return; return;
} }
@ -1660,7 +1660,7 @@ Editor::temporal_zoom_to_frame (bool coarser, framepos_t frame)
double range_before = frame - leftmost_frame; double range_before = frame - leftmost_frame;
double new_fpp; double new_fpp;
new_fpp = frames_per_pixel; new_fpp = samples_per_pixel;
if (coarser) { if (coarser) {
new_fpp *= 1.61803399; new_fpp *= 1.61803399;
@ -1670,7 +1670,7 @@ Editor::temporal_zoom_to_frame (bool coarser, framepos_t frame)
range_before /= 1.61803399; range_before /= 1.61803399;
} }
if (new_fpp == frames_per_pixel) { if (new_fpp == samples_per_pixel) {
return; return;
} }
@ -4419,14 +4419,14 @@ Editor::reset_point_selection ()
void void
Editor::center_playhead () 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); center_screen_internal (playhead_cursor->current_frame (), page);
} }
void void
Editor::center_edit_point () 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); center_screen_internal (get_preferred_edit_position(), page);
} }

View file

@ -860,9 +860,9 @@ Editor::update_fixed_rulers ()
compute_fixed_ruler_scale (); compute_fixed_ruler_scale ();
ruler_metrics[ruler_metric_timecode].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 = frames_per_pixel; ruler_metrics[ruler_metric_samples].units_per_pixel = samples_per_pixel;
ruler_metrics[ruler_metric_minsec].units_per_pixel = frames_per_pixel; ruler_metrics[ruler_metric_minsec].units_per_pixel = samples_per_pixel;
rightmost_frame = leftmost_frame + current_page_samples(); 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(), compute_bbt_ruler_scale (leftmost_frame, leftmost_frame+current_page_samples(),
begin, end); 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()) { if (ruler_bbt_action->get_active()) {
gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_bbt_ruler), leftmost_frame, leftmost_frame+current_page_samples(), gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_bbt_ruler), leftmost_frame, leftmost_frame+current_page_samples(),

View file

@ -108,10 +108,10 @@ AudioGhostRegion::AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, do
} }
void void
AudioGhostRegion::set_frames_per_pixel (double fpp) AudioGhostRegion::set_samples_per_pixel (double fpp)
{ {
for (vector<WaveView*>::iterator i = waves.begin(); i != waves.end(); ++i) { for (vector<WaveView*>::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 void
MidiGhostRegion::set_frames_per_pixel (double /*spu*/) MidiGhostRegion::set_samples_per_pixel (double /*spu*/)
{ {
} }

View file

@ -39,7 +39,7 @@ public:
GhostRegion(ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos); GhostRegion(ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
virtual ~GhostRegion(); 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_height();
virtual void set_colors(); virtual void set_colors();
@ -62,7 +62,7 @@ class AudioGhostRegion : public GhostRegion {
public: public:
AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos); 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_height();
void set_colors(); void set_colors();
@ -87,7 +87,7 @@ public:
MidiStreamView* midi_view(); MidiStreamView* midi_view();
void set_height(); void set_height();
void set_frames_per_pixel (double spu); void set_samples_per_pixel (double spu);
void set_colors(); void set_colors();
void update_range(); void update_range();

View file

@ -146,12 +146,12 @@ ImageFrameTimeAxis::set_height (uint32_t h)
* @param fpp the number of frames per pixel * @param fpp the number of frames per pixel
*/ */
void 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) { if (view) {
view->set_frames_per_pixel (fpp); view->set_samples_per_pixel (fpp);
} }
} }

View file

@ -78,7 +78,7 @@ class ImageFrameTimeAxis : public VisualTimeAxis
*/ */
virtual void set_height(uint32_t h) ; 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 * Returns the available height for images to be drawn onto

View file

@ -147,14 +147,14 @@ ImageFrameTimeAxisGroup::set_item_heights(gdouble h)
* @param spu the new samples per canvas unit value * @param spu the new samples per canvas unit value
*/ */
int int
ImageFrameTimeAxisGroup::set_item_frames_per_pixel (double fpp) ImageFrameTimeAxisGroup::set_item_samples_per_pixel (double fpp)
{ {
if (fpp < 1.0) { if (fpp < 1.0) {
return -1; return -1;
} }
for (ImageFrameViewList::const_iterator citer = imageframe_views.begin(); citer != imageframe_views.end(); ++citer) { 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; return 0;

View file

@ -104,7 +104,7 @@ class ImageFrameTimeAxisGroup : public sigc::trackable
*/ */
int set_item_heights(gdouble) ; 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 * 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 * 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 * Callback used to remove this group during the gtk idle loop

View file

@ -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)); 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_group = 0 ;
selected_imageframe_view = 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 * @param spu the new samples per canvas unit value
*/ */
int int
ImageFrameTimeAxisView::set_frames_per_pixel (double fpp) ImageFrameTimeAxisView::set_samples_per_pixel (double fpp)
{ {
if (fpp < 1.0) { if (fpp < 1.0) {
return -1; return -1;
} }
_frames_per_pixel = fpp; _samples_per_pixel = fpp;
for (ImageFrameGroupList::const_iterator citer = imageframe_groups.begin(); citer != imageframe_groups.end(); ++citer) { 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; return 0;
@ -182,9 +182,9 @@ ImageFrameTimeAxisView::apply_color(Gdk::Color& color)
* *
*/ */
void 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());
} }

View file

@ -93,8 +93,8 @@ class ImageFrameTimeAxisView : public sigc::trackable
*/ */
int set_position(gdouble x, gdouble y) ; int set_position(gdouble x, gdouble y) ;
int set_frames_per_pixel (double); int set_samples_per_pixel (double);
double get_frames_per_pixel () { return _frames_per_pixel; } double get_samples_per_pixel () { return _samples_per_pixel; }
/** /**
* Sets the color of the items contained uopn this view helper * 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 * 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 */ * 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 */ ArdourCanvas::Rectangle canvas_rect; /* frame around the whole thing */
/** the current frames per pixel */ /** the current frames per pixel */
double _frames_per_pixel; double _samples_per_pixel;
/* XXX why are these different? */ /* XXX why are these different? */
Gdk::Color region_color ; Gdk::Color region_color ;

View file

@ -126,12 +126,12 @@ MarkerTimeAxis::set_height (uint32_t h)
* @param spu the number of frames per pixel * @param spu the number of frames per pixel
*/ */
void 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) { if (view) {
view->set_frames_per_pixel (fpp); view->set_samples_per_pixel (fpp);
} }
} }

View file

@ -79,7 +79,7 @@ class MarkerTimeAxis : public VisualTimeAxis
*/ */
virtual void set_height(uint32_t h) ; virtual void set_height(uint32_t h) ;
virtual void set_frames_per_pixel (double); virtual void set_samples_per_pixel (double);
/** /**

View file

@ -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)); 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()); 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 * @param fpp the new frames per pixel value
*/ */
int int
MarkerTimeAxisView::set_frames_per_pixel (double fpp) MarkerTimeAxisView::set_samples_per_pixel (double fpp)
{ {
if (spp < 1.0) { if (spp < 1.0) {
return -1; return -1;
} }
_frames_per_pixel = fpp; _samples_per_pixel = fpp;
for (MarkerViewList::iterator i = marker_view_list.begin(); i != marker_view_list.end(); ++i) { 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; return 0;
@ -382,7 +382,7 @@ MarkerTimeAxisView::get_selected_time_axis_item()
* *
*/ */
void 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());
} }

View file

@ -91,14 +91,14 @@ class MarkerTimeAxisView : public sigc::trackable
*/ */
int set_position(gdouble x, gdouble y) ; 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 * Returns the current samples per unit of this time axis view helper
* *
* @return 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 * 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 * 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 */ /** The list of items held by this time axis view helper */
typedef std::list<MarkerView *> MarkerViewList ; typedef std::list<MarkerView *> MarkerViewList ;
@ -219,7 +219,7 @@ class MarkerTimeAxisView : public sigc::trackable
ArdourCanvas::Rectangle *canvas_rect; /* frame around the whole thing */ ArdourCanvas::Rectangle *canvas_rect; /* frame around the whole thing */
/** the current frames per pixel */ /** the current frames per pixel */
double _frames_per_pixel; double _samples_per_pixel;
/* XXX why are these different? */ /* XXX why are these different? */
Gdk::Color region_color; Gdk::Color region_color;

View file

@ -1451,7 +1451,7 @@ MidiRegionView::add_ghost (TimeAxisView& tv)
{ {
Note* note; Note* note;
double unit_position = _region->position () / frames_per_pixel; double unit_position = _region->position () / samples_per_pixel;
MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*>(&tv); MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*>(&tv);
MidiGhostRegion* ghost; MidiGhostRegion* ghost;
@ -1471,7 +1471,7 @@ MidiRegionView::add_ghost (TimeAxisView& tv)
} }
ghost->set_height (); ghost->set_height ();
ghost->set_duration (_region->length() / frames_per_pixel); ghost->set_duration (_region->length() / samples_per_pixel);
ghosts.push_back (ghost); ghosts.push_back (ghost);
GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RegionView::remove_ghost, this, _1), gui_context()); GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RegionView::remove_ghost, this, _1), gui_context());

View file

@ -70,7 +70,7 @@ public:
MidiRegionView (ArdourCanvas::Group *, MidiRegionView (ArdourCanvas::Group *,
RouteTimeAxisView&, RouteTimeAxisView&,
boost::shared_ptr<ARDOUR::MidiRegion>, boost::shared_ptr<ARDOUR::MidiRegion>,
double initial_frames_per_pixel, double initial_samples_per_pixel,
Gdk::Color const & basic_color); Gdk::Color const & basic_color);
MidiRegionView (const MidiRegionView& other); MidiRegionView (const MidiRegionView& other);
@ -312,7 +312,7 @@ protected:
MidiRegionView (ArdourCanvas::Group *, MidiRegionView (ArdourCanvas::Group *,
RouteTimeAxisView&, RouteTimeAxisView&,
boost::shared_ptr<ARDOUR::MidiRegion>, boost::shared_ptr<ARDOUR::MidiRegion>,
double frames_per_pixel, double samples_per_pixel,
Gdk::Color& basic_color, Gdk::Color& basic_color,
TimeAxisViewItem::Visibility); TimeAxisViewItem::Visibility);

View file

@ -108,7 +108,7 @@ MidiStreamView::create_region_view (boost::shared_ptr<Region> r, bool /*wfd*/, b
} }
RegionView* region_view = new MidiRegionView (_canvas_group, _trackview, region, 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); region_view->init (region_color, false);

View file

@ -423,7 +423,7 @@ RegionView::region_resized (const PropertyChange& what_changed)
set_duration (_region->length(), 0); 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) { for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
@ -489,12 +489,12 @@ RegionView::set_position (framepos_t pos, void* /*src*/, double* ignored)
} }
void 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) { 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); (*i)->set_duration (_region->length() / fpp);
} }
@ -509,7 +509,7 @@ RegionView::set_duration (framecnt_t frames, void *src)
} }
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) { 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; return true;
@ -639,7 +639,7 @@ RegionView::region_sync_changed ()
sync_line->set_outline_width (1); 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-> and a change in the bounds of the _region->
*/ */
@ -667,7 +667,7 @@ RegionView::region_sync_changed ()
//points = sync_mark->property_points().get_value(); //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)/2), 1)); points.push_back (ArdourCanvas::Duple (offset + ((sync_mark_width-1)/2), 1));
points.push_back (ArdourCanvas::Duple (offset, sync_mark_width - 1)); points.push_back (ArdourCanvas::Duple (offset, sync_mark_width - 1));
@ -739,7 +739,7 @@ RegionView::set_height (double h)
int sync_dir; int sync_dir;
framecnt_t sync_offset; framecnt_t sync_offset;
sync_offset = _region->sync_offset (sync_dir); sync_offset = _region->sync_offset (sync_dir);
double offset = sync_offset / frames_per_pixel; double offset = sync_offset / samples_per_pixel;
sync_line->set ( sync_line->set (
ArdourCanvas::Duple (offset, 0), ArdourCanvas::Duple (offset, 0),

View file

@ -48,7 +48,7 @@ class RegionView : public TimeAxisViewItem
RegionView (ArdourCanvas::Group* parent, RegionView (ArdourCanvas::Group* parent,
TimeAxisView& time_view, TimeAxisView& time_view,
boost::shared_ptr<ARDOUR::Region> region, boost::shared_ptr<ARDOUR::Region> region,
double frames_per_pixel, double samples_per_pixel,
Gdk::Color const & basic_color, Gdk::Color const & basic_color,
bool automation = false); bool automation = false);
@ -66,7 +66,7 @@ class RegionView : public TimeAxisViewItem
void set_valid (bool yn) { valid = yn; } void set_valid (bool yn) { valid = yn; }
virtual void set_height (double); 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*); virtual bool set_duration (framecnt_t, void*);
void move (double xdelta, double ydelta); void move (double xdelta, double ydelta);
@ -130,7 +130,7 @@ class RegionView : public TimeAxisViewItem
RegionView (ArdourCanvas::Group *, RegionView (ArdourCanvas::Group *,
TimeAxisView&, TimeAxisView&,
boost::shared_ptr<ARDOUR::Region>, boost::shared_ptr<ARDOUR::Region>,
double frames_per_pixel, double samples_per_pixel,
Gdk::Color const & basic_color, Gdk::Color const & basic_color,
bool recording, bool recording,
TimeAxisViewItem::Visibility); TimeAxisViewItem::Visibility);

View file

@ -232,7 +232,7 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> 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)); _editor.HorizontalPositionChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::horizontal_position_changed));
ColorsChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::color_handler)); ColorsChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::color_handler));
@ -890,9 +890,9 @@ RouteTimeAxisView::route_color_changed ()
} }
void 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 void
@ -904,7 +904,7 @@ RouteTimeAxisView::horizontal_position_changed ()
} }
void void
RouteTimeAxisView::set_frames_per_pixel (double fpp) RouteTimeAxisView::set_samples_per_pixel (double fpp)
{ {
double speed = 1.0; double speed = 1.0;
@ -913,10 +913,10 @@ RouteTimeAxisView::set_frames_per_pixel (double fpp)
} }
if (_view) { 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 void
@ -1134,7 +1134,7 @@ RouteTimeAxisView::clear_playlist ()
void void
RouteTimeAxisView::speed_changed () 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 void

View file

@ -82,7 +82,7 @@ public:
void show_selection (TimeSelection&); void show_selection (TimeSelection&);
void set_button_names (); void set_button_names ();
void set_frames_per_pixel (double); void set_samples_per_pixel (double);
void set_height (uint32_t h); void set_height (uint32_t h);
void show_timestretch (framepos_t start, framepos_t end, int layers, int layer); void show_timestretch (framepos_t start, framepos_t end, int layers, int layer);
void hide_timestretch (); void hide_timestretch ();
@ -211,7 +211,7 @@ protected:
virtual void label_view (); virtual void label_view ();
void reset_frames_per_pixel (); void reset_samples_per_pixel ();
void horizontal_position_changed (); void horizontal_position_changed ();
virtual void build_automation_action_menu (bool); virtual void build_automation_action_menu (bool);

View file

@ -56,7 +56,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* background_g
, owns_canvas_group (canvas_group == 0) , owns_canvas_group (canvas_group == 0)
, _background_group (background_group ? background_group : new ArdourCanvas::Group (_trackview.canvas_background())) , _background_group (background_group ? background_group : new ArdourCanvas::Group (_trackview.canvas_background()))
, _canvas_group (canvas_group ? canvas_group : new ArdourCanvas::Group (_trackview.canvas_display())) , _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_updating(false)
, rec_active(false) , rec_active(false)
, stream_base_color(0xFFFFFFFF) , stream_base_color(0xFFFFFFFF)
@ -144,7 +144,7 @@ StreamView::set_height (double h)
} }
int int
StreamView::set_frames_per_pixel (double fpp) StreamView::set_samples_per_pixel (double fpp)
{ {
RegionViewList::iterator i; RegionViewList::iterator i;
@ -152,10 +152,10 @@ StreamView::set_frames_per_pixel (double fpp)
return -1; return -1;
} }
_frames_per_pixel = fpp; _samples_per_pixel = fpp;
for (i = region_views.begin(); i != region_views.end(); ++i) { for (i = region_views.begin(); i != region_views.end(); ++i) {
(*i)->set_frames_per_pixel (fpp); (*i)->set_samples_per_pixel (fpp);
} }
for (vector<RecBoxInfo>::iterator xi = rec_rects.begin(); xi != rec_rects.end(); ++xi) { for (vector<RecBoxInfo>::iterator xi = rec_rects.begin(); xi != rec_rects.end(); ++xi) {

View file

@ -73,8 +73,8 @@ public:
int set_position (gdouble x, gdouble y); int set_position (gdouble x, gdouble y);
virtual int set_height (double); virtual int set_height (double);
virtual int set_frames_per_pixel (double); virtual int set_samples_per_pixel (double);
gdouble get_frames_per_pixel () const { return _frames_per_pixel; } gdouble get_samples_per_pixel () const { return _samples_per_pixel; }
virtual void horizontal_position_changed () {} virtual void horizontal_position_changed () {}
virtual void enter_internal_edit_mode (); virtual void enter_internal_edit_mode ();
@ -161,7 +161,7 @@ protected:
typedef std::list<RegionView* > RegionViewList; typedef std::list<RegionView* > RegionViewList;
RegionViewList region_views; RegionViewList region_views;
double _frames_per_pixel; double _samples_per_pixel;
sigc::connection screen_update_connection; sigc::connection screen_update_connection;
std::vector<RecBoxInfo> rec_rects; std::vector<RecBoxInfo> rec_rects;

View file

@ -30,7 +30,7 @@ class TapeAudioRegionView : public AudioRegionView
TapeAudioRegionView (ArdourCanvas::Group *, TapeAudioRegionView (ArdourCanvas::Group *,
RouteTimeAxisView&, RouteTimeAxisView&,
boost::shared_ptr<ARDOUR::AudioRegion>, boost::shared_ptr<ARDOUR::AudioRegion>,
double initial_frames_per_pixel, double initial_samples_per_pixel,
Gdk::Color const & base_color); Gdk::Color const & base_color);
~TapeAudioRegionView (); ~TapeAudioRegionView ();

View file

@ -75,7 +75,7 @@ TempoLines::hide ()
void void
TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin, TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
const ARDOUR::TempoMap::BBTPointList::const_iterator& end, const ARDOUR::TempoMap::BBTPointList::const_iterator& end,
double frames_per_pixel) double samples_per_pixel)
{ {
ARDOUR::TempoMap::BBTPointList::const_iterator i; ARDOUR::TempoMap::BBTPointList::const_iterator i;
ArdourCanvas::Line *line = 0; ArdourCanvas::Line *line = 0;
@ -105,12 +105,12 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
return; 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; const double needed_right = xpos;
i = begin; 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; const double needed_left = xpos;
Lines::iterator left = _lines.lower_bound(xpos); // first line >= 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(); 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 li = _lines.lower_bound(xpos); // first line >= xpos

View file

@ -794,10 +794,10 @@ TimeAxisView::build_display_menu ()
} }
void 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) { 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; AnalysisFeatureList::const_iterator i;

View file

@ -154,7 +154,7 @@ class TimeAxisView : public virtual AxisView
virtual ARDOUR::RouteGroup* route_group() const { return 0; } virtual ARDOUR::RouteGroup* route_group() const { return 0; }
virtual boost::shared_ptr<ARDOUR::Playlist> playlist() const { return boost::shared_ptr<ARDOUR::Playlist> (); } virtual boost::shared_ptr<ARDOUR::Playlist> playlist() const { return boost::shared_ptr<ARDOUR::Playlist> (); }
virtual void set_frames_per_pixel (double); virtual void set_samples_per_pixel (double);
virtual void show_selection (TimeSelection&); virtual void show_selection (TimeSelection&);
virtual void hide_selection (); virtual void hide_selection ();
virtual void reshow_selection (TimeSelection&); virtual void reshow_selection (TimeSelection&);

View file

@ -138,7 +138,7 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
_selected = other._selected; _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); 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) 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; item_name = it_name;
frames_per_pixel = fpp; samples_per_pixel = fpp;
frame_position = start; frame_position = start;
item_duration = duration; item_duration = duration;
name_connected = false; name_connected = false;
@ -301,7 +301,7 @@ TimeAxisViewItem::set_position(framepos_t pos, void* src, double* delta)
*/ */
double old_unit_pos; 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; old_unit_pos = group->position().x;
@ -799,9 +799,9 @@ TimeAxisViewItem::set_trim_handle_colors()
/** @return the frames per pixel */ /** @return the frames per pixel */
double 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. /** 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 * @param fpp the new frames per pixel
*/ */
void 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); 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 void

View file

@ -77,9 +77,9 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
ArdourCanvas::Item* get_name_highlight(); ArdourCanvas::Item* get_name_highlight();
ArdourCanvas::Pixbuf* get_name_pixbuf(); 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_start() { _dragging = true; }
virtual void drag_end() { _dragging = false; } virtual void drag_end() { _dragging = false; }
@ -194,7 +194,7 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
bool min_duration_active; bool min_duration_active;
/** frames per canvas pixel */ /** frames per canvas pixel */
double frames_per_pixel; double samples_per_pixel;
/** should the item respond to events */ /** should the item respond to events */
bool _sensitive; bool _sensitive;