ArdourCanvas::Item* item;
ItemType item_type;
void* data;
- nframes_t last_frame_position;
- int64_t pointer_frame_offset;
- nframes_t grab_frame;
- nframes_t last_pointer_frame;
- nframes_t current_pointer_frame;
+ nframes64_t last_frame_position;
+ nframes64_t pointer_frame_offset;
+ nframes64_t grab_frame;
+ nframes64_t last_pointer_frame;
+ nframes64_t current_pointer_frame;
double grab_x, grab_y;
double cumulative_x_drag;
double cumulative_y_drag;
}
void
-Editor::snap_to (nframes_t& start, int32_t direction, bool for_mark)
+Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark)
{
Location* before = 0;
Location* after = 0;
return;
}
- const nframes_t one_second = session->frame_rate();
- const nframes_t one_minute = session->frame_rate() * 60;
- const nframes_t one_smpte_second = (nframes_t)(rint(session->smpte_frames_per_second()) * session->frames_per_smpte_frame());
- nframes_t one_smpte_minute = (nframes_t)(rint(session->smpte_frames_per_second()) * session->frames_per_smpte_frame() * 60);
- nframes_t presnap = start;
+ const nframes64_t one_second = session->frame_rate();
+ const nframes64_t one_minute = session->frame_rate() * 60;
+ const nframes64_t one_smpte_second = (nframes64_t)(rint(session->smpte_frames_per_second()) * session->frames_per_smpte_frame());
+ nframes64_t one_smpte_minute = (nframes64_t)(rint(session->smpte_frames_per_second()) * session->frames_per_smpte_frame() * 60);
+ nframes64_t presnap = start;
switch (snap_type) {
case SnapToFrame:
void tempo_map_changed (ARDOUR::Change);
void redisplay_tempo (bool immediate_redraw);
- void snap_to (nframes_t& first, int32_t direction = 0, bool for_mark = false);
+ void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
+ void snap_to (nframes_t& first, int32_t direction = 0, bool for_mark = false) {
+ /* XXX remove this function when everything moves to 64 bit frame counts */
+ nframes64_t first64 = first;
+ snap_to (first64, direction, for_mark);
+ first = (nframes_t) first64;
+ }
+
uint32_t bbt_beat_subdivision;
/* toolbar */
*/
if (!drag_info.move_threshold_passed) {
- bool x_threshold_passed = (abs ((int64_t) (drag_info.current_pointer_x - drag_info.grab_x)) > 4LL);
- bool y_threshold_passed = (abs ((int64_t) (drag_info.current_pointer_y - drag_info.grab_y)) > 4LL);
-
+ bool x_threshold_passed = (abs ((nframes64_t) (drag_info.current_pointer_x - drag_info.grab_x)) > 4LL);
+ bool y_threshold_passed = (abs ((nframes64_t) (drag_info.current_pointer_y - drag_info.grab_y)) > 4LL);
+
drag_info.move_threshold_passed = (x_threshold_passed || y_threshold_passed);
// and change the initial grab loc/frame if this drag info wants us to
drag_info.y_constrained = false;
}
- drag_info.grab_frame = event_frame(event, &drag_info.grab_x, &drag_info.grab_y);
+ drag_info.grab_frame = event_frame (event, &drag_info.grab_x, &drag_info.grab_y);
drag_info.last_pointer_frame = drag_info.grab_frame;
drag_info.current_pointer_frame = drag_info.grab_frame;
drag_info.current_pointer_x = drag_info.grab_x;
nframes_t pos;
nframes_t fade_length;
- if ((long)drag_info.current_pointer_frame > drag_info.pointer_frame_offset) {
+ if (drag_info.current_pointer_frame > drag_info.pointer_frame_offset) {
pos = drag_info.current_pointer_frame - drag_info.pointer_frame_offset;
- }
- else {
+ } else {
pos = 0;
}
nframes_t newframe;
if (drag_info.pointer_frame_offset <= drag_info.current_pointer_frame) {
newframe = drag_info.current_pointer_frame - drag_info.pointer_frame_offset;
- }
- else {
+ } else {
newframe = 0;
}
int32_t sync_dir;
pending_region_position = drag_info.current_pointer_frame - drag_info.pointer_frame_offset;
-
+
sync_offset = rv->region()->sync_offset (sync_dir);
sync_frame = rv->region()->adjust_to_sync (pending_region_position);
} else {
x_delta = -((double) (drag_info.last_frame_position - pending_region_position) / frames_per_unit);
}
-
+
drag_info.last_frame_position = pending_region_position;
} else {
return;
}
+
if (x_delta < 0) {
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ++i) {
x_delta = max_frames - rv->region()->last_frame();
}
+
if (drag_info.first_move) {
/* hide any dependent views */
nframes_t where = leftmost_frame + pixel_to_frame (x);
/// ripped from maybe_autoscroll, and adapted to work here
- nframes_t one_page = (nframes_t) rint (canvas_width * frames_per_unit);
- nframes_t rightmost_frame = leftmost_frame + one_page;
+ nframes_t rightmost_frame = leftmost_frame + current_page_frames ();
if (autoscroll_timeout_tag < 0) {
if (where > rightmost_frame) {
return;
}
- /* XXX Note the potential loss of accuracy here as we convert from
- an uint32_t (or larger) to a float ... what to do ?
- */
-
- nframes_t page = (nframes_t) floor (canvas_width * frames_per_unit);
- nframes_t rightmost_frame = leftmost_frame + page;
+ nframes_t rightmost_frame = leftmost_frame + current_page_frames();
if (ruler_shown[ruler_metric_smpte]) {
gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_smpte_ruler), leftmost_frame, rightmost_frame,
return;
}
- /* XXX Note the potential loss of accuracy here as we convert from
- an uint32_t (or larger) to a float ... what to do ?
- */
-
- nframes_t page = (nframes_t) floor (canvas_width * frames_per_unit);
-
ruler_metrics[ruler_metric_smpte].units_per_pixel = frames_per_unit;
ruler_metrics[ruler_metric_frames].units_per_pixel = frames_per_unit;
ruler_metrics[ruler_metric_minsec].units_per_pixel = frames_per_unit;
- rightmost_frame = leftmost_frame + page;
+ rightmost_frame = leftmost_frame + current_page_frames ();
/* these force a redraw, which in turn will force execution of the metric callbacks
to compute the relevant ticks to display.
return;
}
- /* XXX Note the potential loss of accuracy here as we convert from
- an uint32_t (or larger) to a float ... what to do ?
- */
-
- nframes_t page = (nframes_t) floor (canvas_width * frames_per_unit);
ruler_metrics[ruler_metric_bbt].units_per_pixel = frames_per_unit;
if (ruler_shown[ruler_metric_bbt]) {
- gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_bbt_ruler), leftmost_frame, leftmost_frame+page,
+ gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_bbt_ruler), leftmost_frame, leftmost_frame+current_page_frames(),
leftmost_frame, session->current_end_frame());
}
}
typedef uint32_t nframes_t;
+/* eventually, we'd like everything (including JACK) to
+ move to this. for now, its a dedicated type.
+*/
+
+typedef int64_t nframes64_t;
+
namespace ARDOUR {
class Source;