}
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;
}
{
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;
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);
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;
if (_session->config.get_external_sync()) {
switch (Config->get_sync_source()) {
- case JACK:
+ case Engine:
break;
default:
/* transport controlled by the master */
/* 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;
vector<Evoral::Sequence<Evoral::MusicalTime>::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);
struct EditorOrderRouteSorter {
bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
- return a->order_key (EditorSort) < b->order_key (EditorSort);
+ return a->order_key () < b->order_key ();
}
};
void
Editor::toggle_midi_input_active (bool flip_others)
{
- bool onoff;
+ bool onoff = false;
boost::shared_ptr<RouteList> rl (new RouteList);
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {