X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_ops.cc;h=f2990751708dac5471d7ecd6c7b7429c396fda06;hb=2e27e21d3a09889311e18a8efe11abcaa6d9c8b3;hp=4037f7a83d2d621d6ed435c772e0081b4e893635;hpb=e1b0f1bd0b03c071d2b5987e4ab75ef059e32111;p=ardour.git diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 4037f7a83d..f299075170 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -1331,17 +1331,17 @@ Editor::tav_zoom_smooth (bool coarser, bool force_all) } bool -Editor::clamp_samples_per_pixel (double& fpp) const +Editor::clamp_samples_per_pixel (framecnt_t& fpp) const { bool clamped = false; - if (fpp < 1.0) { - fpp = 1.0; + if (fpp < 1) { + fpp = 1; clamped = true; } if (max_framepos / fpp < 800) { - fpp = max_framepos / 800.0; + fpp = max_framepos / 800; clamped = true; } @@ -1353,19 +1353,19 @@ Editor::temporal_zoom_step (bool coarser) { ENSURE_GUI_THREAD (*this, &Editor::temporal_zoom_step, coarser) - double nfpp = samples_per_pixel; + framecnt_t nspp = samples_per_pixel; if (coarser) { - nfpp = min (9e6, nfpp * 1.61803399); + nspp *= 2; } else { - nfpp = max (1.0, nfpp / 1.61803399); + nspp /= 2; } - temporal_zoom (nfpp); + temporal_zoom (nspp); } void -Editor::temporal_zoom (double fpp) +Editor::temporal_zoom (framecnt_t fpp) { if (!_session) { return; @@ -1380,7 +1380,7 @@ Editor::temporal_zoom (double fpp) framepos_t leftmost_after_zoom = 0; framepos_t where; bool in_track_canvas; - double nfpp; + framecnt_t nfpp; double l; clamp_samples_per_pixel (fpp); @@ -1388,14 +1388,16 @@ Editor::temporal_zoom (double fpp) return; } - nfpp = fpp; - // Imposing an arbitrary limit to zoom out as too much zoom out produces // segfaults for lack of memory. If somebody decides this is not high enough I // believe it can be raisen to higher values but some limit must be in place. - if (nfpp > 8e+08) { - nfpp = 8e+08; - } + // + // This constant represents 1 day @ 48kHz on a 1600 pixel wide display + // all of which is used for the editor track displays. The whole day + // would be 4147200000 samples, so 2592000 samples per pixel. + + nfpp = min (fpp, (framecnt_t) 2592000); + nfpp = max ((framecnt_t) 1, fpp); new_page_size = (framepos_t) floor (_visible_canvas_width * nfpp); half_page_size = new_page_size / 2; @@ -2102,7 +2104,7 @@ Editor::transition_to_rolling (bool fwd) if (_session->config.get_external_sync()) { switch (Config->get_sync_source()) { - case JACK: + case Engine: break; default: /* transport controlled by the master */ @@ -3475,7 +3477,7 @@ Editor::freeze_route () /* wait for just a little while, because the above call is asynchronous */ - ::usleep (250000); + Glib::usleep (250000); if (clicked_routeview == 0 || !clicked_routeview->is_audio_track()) { return; @@ -4706,7 +4708,7 @@ Editor::apply_midi_note_edit_op_to_region (MidiOperator& op, MidiRegionView& mrv vector::Notes> v; v.push_back (selected); - framepos_t pos_frames = mrv.midi_region()->position(); + framepos_t pos_frames = mrv.midi_region()->position() - mrv.midi_region()->start(); double pos_beats = _session->tempo_map().framewalk_to_beats(0, pos_frames); return op (mrv.midi_region()->model(), pos_beats, v); @@ -5522,7 +5524,7 @@ Editor::split_region () struct EditorOrderRouteSorter { bool operator() (boost::shared_ptr a, boost::shared_ptr b) { - return a->order_key (EditorSort) < b->order_key (EditorSort); + return a->order_key () < b->order_key (); } }; @@ -6950,7 +6952,7 @@ Editor::uncombine_regions () void Editor::toggle_midi_input_active (bool flip_others) { - bool onoff; + bool onoff = false; boost::shared_ptr rl (new RouteList); for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {