_last_pointer_x = _drags->current_pointer_x ();
_last_pointer_y = current_pointer_y ();
- _last_pointer_frame = adjusted_current_frame (event);
+ _last_pointer_frame = adjusted_current_frame (event, false);
}
return true;
}
boost::shared_ptr<Region>
-Drag::add_midi_region (MidiTimeAxisView* view)
+Drag::add_midi_region (MidiTimeAxisView* view, bool commit)
{
if (_editor->session()) {
const TempoMap& map (_editor->session()->tempo_map());
framecnt_t pos = grab_frame();
- const Meter& m = map.meter_at (pos);
/* not that the frame rate used here can be affected by pull up/down which
might be wrong.
*/
- framecnt_t len = m.frames_per_bar (map.tempo_at (pos), _editor->session()->frame_rate());
- return view->add_region (grab_frame(), len, true);
+ framecnt_t len = map.frame_at_beat (map.beat_at_frame (pos) + 1.0) - pos;
+ return view->add_region (grab_frame(), len, commit);
}
return boost::shared_ptr<Region>();
}
-struct EditorOrderTimeAxisViewSorter {
+struct PresentationInfoTimeAxisViewSorter {
bool operator() (TimeAxisView* a, TimeAxisView* b) {
- RouteTimeAxisView* ra = dynamic_cast<RouteTimeAxisView*> (a);
- RouteTimeAxisView* rb = dynamic_cast<RouteTimeAxisView*> (b);
- assert (ra && rb);
- return ra->route()->order_key () < rb->route()->order_key ();
+ return a->presentation_info().order() < b->presentation_info().order();
}
};
*/
TrackViewList track_views = _editor->track_views;
- track_views.sort (EditorOrderTimeAxisViewSorter ());
+ track_views.sort (PresentationInfoTimeAxisViewSorter ());
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
_time_axis_views.push_back (*i);
/* compute the amount of pointer motion in frames, and where
the region would be if we moved it by that much.
*/
- *pending_region_position = adjusted_frame (_drags->current_pointer_frame () + snap_delta (event->button.state), event, true);
+ *pending_region_position = adjusted_frame (_drags->current_pointer_frame (), event, false);
framepos_t sync_frame;
framecnt_t sync_offset;
*/
if (sync_dir >= 0 || (sync_dir < 0 && *pending_region_position >= sync_offset)) {
- sync_frame = *pending_region_position + (sync_dir * sync_offset);
+ framecnt_t const sd = snap_delta (event->button.state);
+ sync_frame = *pending_region_position + (sync_dir * sync_offset) + sd;
_editor->snap_to_with_modifier (sync_frame, event);
- *pending_region_position = _primary->region()->adjust_to_sync (sync_frame) - snap_delta (event->button.state);
+ *pending_region_position = _primary->region()->adjust_to_sync (sync_frame) - sd;
} else {
*pending_region_position = _last_frame_position;
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv);
if (!rtv || !rtv->is_track()) {
- /* ignore busses early on. we can't move any regions on them */
+ /* ignore non-tracks early on. we can't move any regions on them */
} else if (_last_pointer_time_axis_view < 0) {
/* Was in the drop-zone, now over a track.
* Hence it must be an upward move (from the bottom)
if ((Config->get_output_auto_connect() & AutoConnectMaster) && _editor->session()->master_out()) {
output_chan = _editor->session()->master_out()->n_inputs().n_audio();
}
- audio_tracks = _editor->session()->new_audio_track (region->n_channels(), output_chan, ARDOUR::Normal, 0, 1, region->name());
+ audio_tracks = _editor->session()->new_audio_track (region->n_channels(), output_chan, 0, 1, region->name(), PresentationInfo::max_order);
RouteTimeAxisView* rtav = _editor->axis_view_from_route (audio_tracks.front());
if (rtav) {
rtav->set_height (original->current_height());
} else {
ChanCount one_midi_port (DataType::MIDI, 1);
list<boost::shared_ptr<MidiTrack> > midi_tracks;
- midi_tracks = _editor->session()->new_midi_track (one_midi_port, one_midi_port, boost::shared_ptr<ARDOUR::PluginInfo>(), ARDOUR::Normal, 0, 1, region->name());
+ midi_tracks = _editor->session()->new_midi_track (one_midi_port, one_midi_port, boost::shared_ptr<ARDOUR::PluginInfo>(),
+ (ARDOUR::Plugin::PresetRecord*) 0,
+ (ARDOUR::RouteGroup*) 0, 1, region->name(), PresentationInfo::max_order);
RouteTimeAxisView* rtav = _editor->axis_view_from_route (midi_tracks.front());
if (rtav) {
rtav->set_height (original->current_height());
RegionCreateDrag::motion (GdkEvent* event, bool first_move)
{
if (first_move) {
- _region = add_midi_region (_view);
+ _editor->begin_reversible_command (_("create region"));
+ _region = add_midi_region (_view, false);
_view->playlist()->freeze ();
} else {
if (_region) {
framepos_t const f = adjusted_current_frame (event);
if (f < grab_frame()) {
- _region->set_position (f);
+ _region->set_initial_position (f);
}
/* Don't use a zero-length region, and subtract 1 frame from the snapped length
RegionCreateDrag::finished (GdkEvent*, bool movement_occurred)
{
if (!movement_occurred) {
- add_midi_region (_view);
+ add_midi_region (_view, true);
} else {
_view->playlist()->thaw ();
+ _editor->commit_reversible_command();
}
}
}
MeterMarkerDrag::MeterMarkerDrag (Editor* e, ArdourCanvas::Item* i, bool c)
- : Drag (e, i),
- _copy (c)
+ : Drag (e, i)
+ , _copy (c)
+ , _old_snap_type (e->snap_type())
+ , _old_snap_mode (e->snap_mode())
, before_state (0)
{
DEBUG_TRACE (DEBUG::Drags, "New MeterMarkerDrag\n");
_marker = reinterpret_cast<MeterMarker*> (_item->get_data ("marker"));
assert (_marker);
+ _real_section = &_marker->meter();
+
}
void
void
MeterMarkerDrag::motion (GdkEvent* event, bool first_move)
{
- if (!_marker->meter().movable()) {
- return;
- }
-
if (first_move) {
-
- // create a dummy marker for visual representation of moving the
- // section, because whether its a copy or not, we're going to
- // leave or lose the original marker (leave if its a copy; lose if its
- // not, because we'll remove it from the map).
-
- MeterSection section (_marker->meter());
-
- if (!section.movable()) {
- return;
- }
+ // create a dummy marker to catch events, then hide it.
char name[64];
snprintf (name, sizeof(name), "%g/%g", _marker->meter().divisions_per_bar(), _marker->meter().note_divisor ());
/* use the new marker for the grab */
swap_grab (&_marker->the_item(), 0, GDK_CURRENT_TIME);
+ _marker->hide();
+
+ TempoMap& map (_editor->session()->tempo_map());
+ /* get current state */
+ before_state = &map.get_state();
if (!_copy) {
- TempoMap& map (_editor->session()->tempo_map());
- /* get current state */
- before_state = &map.get_state();
- /* remove the section while we drag it */
- map.remove_meter (section, true);
+ _editor->begin_reversible_command (_("move meter mark"));
+ } else {
+ _editor->begin_reversible_command (_("copy meter mark"));
+
+ Timecode::BBT_Time bbt = _real_section->bbt();
+
+ /* we can't add a meter where one currently exists */
+ if (_real_section->frame() < adjusted_current_frame (event, false)) {
+ ++bbt.bars;
+ } else {
+ --bbt.bars;
+ }
+ const double beat = map.beat_at_bbt (bbt);
+ _real_section = map.add_meter (Meter (_marker->meter().divisions_per_bar(), _marker->meter().note_divisor())
+ , beat, bbt, map.frame_at_bbt (bbt), _real_section->position_lock_style());
+
+ }
+ /* only snap to bars. leave snap mode alone for audio locked meters.*/
+ if (_real_section->position_lock_style() != AudioTime) {
+ _editor->set_snap_to (SnapToBar);
+ _editor->set_snap_mode (SnapNormal);
}
}
- framepos_t const pf = adjusted_current_frame (event);
+ framepos_t pf = adjusted_current_frame (event);
- _marker->set_position (pf);
- show_verbose_cursor_time (pf);
+ if (_real_section->position_lock_style() == AudioTime && _editor->snap_musical()) {
+ /* never snap to music for audio locked */
+ pf = adjusted_current_frame (event, false);
+ }
+
+ _editor->session()->tempo_map().gui_move_meter (_real_section, pf);
+
+ /* fake marker meeds to stay under the mouse, unlike the real one. */
+ _marker->set_position (adjusted_current_frame (event, false));
+
+ show_verbose_cursor_time (_real_section->frame());
}
void
return;
}
- if (!_marker->meter().movable()) {
- return;
- }
-
- motion (event, false);
-
- Timecode::BBT_Time when;
+ /* reinstate old snap setting */
+ _editor->set_snap_to (_old_snap_type);
+ _editor->set_snap_mode (_old_snap_mode);
TempoMap& map (_editor->session()->tempo_map());
- map.bbt_time (last_pointer_frame(), when);
-
- if (_copy == true) {
- _editor->begin_reversible_command (_("copy meter mark"));
- XMLNode &before = map.get_state();
- map.add_meter (_marker->meter(), when);
- XMLNode &after = map.get_state();
- _editor->session()->add_command(new MementoCommand<TempoMap>(map, &before, &after));
- _editor->commit_reversible_command ();
-
- } else {
- _editor->begin_reversible_command (_("move meter mark"));
- /* we removed it before, so add it back now */
-
- map.add_meter (_marker->meter(), when);
- XMLNode &after = map.get_state();
- _editor->session()->add_command(new MementoCommand<TempoMap>(map, before_state, &after));
- _editor->commit_reversible_command ();
- }
+ XMLNode &after = map.get_state();
+ _editor->session()->add_command(new MementoCommand<TempoMap>(map, before_state, &after));
+ _editor->commit_reversible_command ();
// delete the dummy marker we used for visual representation while moving.
// a new visual marker will show up automatically.
MeterMarkerDrag::aborted (bool moved)
{
_marker->set_position (_marker->meter().frame ());
-
if (moved) {
- TempoMap& map (_editor->session()->tempo_map());
- /* we removed it before, so add it back now */
- map.add_meter (_marker->meter(), _marker->meter().frame());
+ /* reinstate old snap setting */
+ _editor->set_snap_to (_old_snap_type);
+ _editor->set_snap_mode (_old_snap_mode);
+
+ _editor->session()->tempo_map().set_state (*before_state, Stateful::current_state_version);
// delete the dummy marker we used for visual representation while moving.
// a new visual marker will show up automatically.
delete _marker;
DEBUG_TRACE (DEBUG::Drags, "New TempoMarkerDrag\n");
_marker = reinterpret_cast<TempoMarker*> (_item->get_data ("marker"));
+ _real_section = &_marker->tempo();
+ _movable = _real_section->movable();
assert (_marker);
}
TempoMarkerDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
{
Drag::start_grab (event, cursor);
- show_verbose_cursor_time (adjusted_current_frame (event));
+ if (!_real_section->active()) {
+ show_verbose_cursor_text (_("inactive"));
+ } else {
+ show_verbose_cursor_time (adjusted_current_frame (event));
+ }
}
void
TempoMarkerDrag::setup_pointer_frame_offset ()
{
- _pointer_frame_offset = raw_grab_frame() - _marker->tempo().frame();
+ _pointer_frame_offset = raw_grab_frame() - _real_section->frame();
}
void
TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
{
- if (!_marker->tempo().movable()) {
+ if (!_real_section->active()) {
return;
}
if (first_move) {
- // create a dummy marker for visual representation of moving the
- // section, because whether its a copy or not, we're going to
- // leave or lose the original marker (leave if its a copy; lose if its
- // not, because we'll remove it from the map).
-
- // create a dummy marker for visual representation of moving the copy.
- // The actual copying is not done before we reach the finish callback.
+ // mvc drag - create a dummy marker to catch events, hide it.
char name[64];
snprintf (name, sizeof (name), "%.2f", _marker->tempo().beats_per_minute());
/* use the new marker for the grab */
swap_grab (&_marker->the_item(), 0, GDK_CURRENT_TIME);
+ _marker->hide();
+
+ TempoMap& map (_editor->session()->tempo_map());
+ /* get current state */
+ before_state = &map.get_state();
if (!_copy) {
- TempoMap& map (_editor->session()->tempo_map());
- /* get current state */
- before_state = &map.get_state();
- /* remove the section while we drag it */
- map.remove_tempo (section, true);
+ _editor->begin_reversible_command (_("move tempo mark"));
+
+ } else {
+ const framepos_t frame = adjusted_current_frame (event) + 1;
+
+ _editor->begin_reversible_command (_("copy tempo mark"));
+
+ if (_real_section->position_lock_style() == MusicTime) {
+ _real_section = map.add_tempo (_marker->tempo(), map.pulse_at_frame (frame), 0, _real_section->type(), MusicTime);
+ } else {
+ _real_section = map.add_tempo (_marker->tempo(), 0.0, frame, _real_section->type(), AudioTime);
+ }
}
+
}
- framepos_t const pf = adjusted_current_frame (event);
- _marker->set_position (pf);
- show_verbose_cursor_time (pf);
+ if (Keyboard::modifier_state_contains (event->button.state, ArdourKeyboard::constraint_modifier ())) {
+ /* use vertical movement to alter tempo .. should be log */
+ double new_bpm = _real_section->beats_per_minute() + ((last_pointer_y() - current_pointer_y()) / 5.0);
+ stringstream strs;
+
+ _editor->session()->tempo_map().gui_change_tempo (_real_section, Tempo (new_bpm, _real_section->note_type()));
+ strs << new_bpm;
+ show_verbose_cursor_text (strs.str());
+
+ } else if (_movable && !_real_section->locked_to_meter()) {
+ const framepos_t pf = adjusted_current_frame (event);
+ TempoMap& map (_editor->session()->tempo_map());
+
+ /* snap to beat is 1, snap to bar is -1 (sorry) */
+ int sub_num = _editor->get_grid_music_divisions (event->button.state);
+
+ map.gui_move_tempo (_real_section, pf, sub_num);
+
+ show_verbose_cursor_time (_real_section->frame());
+ }
+ _marker->set_position (adjusted_current_frame (event, false));
}
void
TempoMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
{
+ if (!_real_section->active()) {
+ return;
+ }
if (!movement_occurred) {
if (was_double_click()) {
_editor->edit_tempo_marker (*_marker);
return;
}
- if (!_marker->tempo().movable()) {
- return;
- }
-
- motion (event, false);
-
TempoMap& map (_editor->session()->tempo_map());
- framepos_t beat_time = map.round_to_beat (last_pointer_frame(), RoundNearest);
- Timecode::BBT_Time when;
-
- map.bbt_time (beat_time, when);
- if (_copy == true) {
- _editor->begin_reversible_command (_("copy tempo mark"));
- XMLNode &before = map.get_state();
- map.add_tempo (_marker->tempo(), when);
- XMLNode &after = map.get_state();
- _editor->session()->add_command (new MementoCommand<TempoMap>(map, &before, &after));
- _editor->commit_reversible_command ();
-
- } else {
- _editor->begin_reversible_command (_("move tempo mark"));
- /* we removed it before, so add it back now */
- map.add_tempo (_marker->tempo(), when);
- XMLNode &after = map.get_state();
- _editor->session()->add_command (new MementoCommand<TempoMap>(map, before_state, &after));
- _editor->commit_reversible_command ();
- }
+ XMLNode &after = map.get_state();
+ _editor->session()->add_command (new MementoCommand<TempoMap>(map, before_state, &after));
+ _editor->commit_reversible_command ();
// delete the dummy marker we used for visual representation while moving.
// a new visual marker will show up automatically.
_marker->set_position (_marker->tempo().frame());
if (moved) {
TempoMap& map (_editor->session()->tempo_map());
- /* we removed it before, so add it back now */
- map.add_tempo (_marker->tempo(), _marker->tempo().start());
+ map.set_state (*before_state, Stateful::current_state_version);
// delete the dummy marker we used for visual representation while moving.
// a new visual marker will show up automatically.
delete _marker;
}
}
+BBTRulerDrag::BBTRulerDrag (Editor* e, ArdourCanvas::Item* i)
+ : Drag (e, i)
+ , _pulse (0.0)
+ , _tempo (0)
+ , before_state (0)
+{
+ DEBUG_TRACE (DEBUG::Drags, "New BBTRulerDrag\n");
+
+}
+
+void
+BBTRulerDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
+{
+ Drag::start_grab (event, cursor);
+ TempoMap& map (_editor->session()->tempo_map());
+ _tempo = const_cast<TempoSection*> (&map.tempo_section_at_frame (raw_grab_frame()));
+ ostringstream sstr;
+
+ sstr << "^" << fixed << setprecision(3) << map.tempo_at_frame (adjusted_current_frame (event)).beats_per_minute() << "\n";
+ sstr << "<" << fixed << setprecision(3) << _tempo->beats_per_minute();
+ show_verbose_cursor_text (sstr.str());
+ finished (event, false);
+}
+
+void
+BBTRulerDrag::setup_pointer_frame_offset ()
+{
+ TempoMap& map (_editor->session()->tempo_map());
+ const double beat_at_frame = map.beat_at_frame (raw_grab_frame());
+ const uint32_t divisions = _editor->get_grid_beat_divisions (0);
+ double beat = 0.0;
+
+ if (divisions > 0) {
+ beat = floor (beat_at_frame) + (floor (((beat_at_frame - floor (beat_at_frame)) * divisions)) / divisions);
+ } else {
+ /* while it makes some sense for the user to determine the division to 'grab',
+ grabbing a bar often leads to confusing results wrt the actual tempo section being altered
+ and the result over steep tempo curves. Use sixteenths.
+ */
+ beat = floor (beat_at_frame) + (floor (((beat_at_frame - floor (beat_at_frame)) * 4)) / 4);
+ }
+
+ _pulse = map.pulse_at_beat (beat);
+
+ _pointer_frame_offset = raw_grab_frame() - map.frame_at_pulse (_pulse);
+
+}
+
+void
+BBTRulerDrag::motion (GdkEvent* event, bool first_move)
+{
+ TempoMap& map (_editor->session()->tempo_map());
+
+ if (first_move) {
+ /* get current state */
+ before_state = &map.get_state();
+ _editor->begin_reversible_command (_("dilate tempo"));
+ }
+
+ framepos_t pf;
+
+ if (_editor->snap_musical()) {
+ pf = adjusted_current_frame (event, false);
+ } else {
+ pf = adjusted_current_frame (event);
+ }
+
+ if (Keyboard::modifier_state_contains (event->button.state, ArdourKeyboard::constraint_modifier())) {
+ /* adjust previous tempo to match pointer frame */
+ _editor->session()->tempo_map().gui_dilate_tempo (_tempo, map.frame_at_pulse (_pulse), pf, _pulse);
+ }
+ ostringstream sstr;
+ sstr << "^" << fixed << setprecision(3) << map.tempo_at_frame (pf).beats_per_minute() << "\n";
+ sstr << "<" << fixed << setprecision(3) << _tempo->beats_per_minute();
+ show_verbose_cursor_text (sstr.str());
+}
+
+void
+BBTRulerDrag::finished (GdkEvent* event, bool movement_occurred)
+{
+ if (!movement_occurred) {
+ return;
+ }
+
+ TempoMap& map (_editor->session()->tempo_map());
+
+ XMLNode &after = map.get_state();
+ _editor->session()->add_command(new MementoCommand<TempoMap>(map, before_state, &after));
+ _editor->commit_reversible_command ();
+}
+
+void
+BBTRulerDrag::aborted (bool moved)
+{
+ if (moved) {
+ _editor->session()->tempo_map().set_state (*before_state, Stateful::current_state_version);
+ }
+}
+
+
CursorDrag::CursorDrag (Editor* e, EditorCursor& c, bool s)
: Drag (e, &c.track_canvas_item(), false)
, _cursor (c)
, _selection_changed (false)
{
DEBUG_TRACE (DEBUG::Drags, "New MarkerDrag\n");
-
+ Gtk::Window* toplevel = _editor->current_toplevel();
_marker = reinterpret_cast<ArdourMarker*> (_item->get_data ("marker"));
+
assert (_marker);
_points.push_back (ArdourCanvas::Duple (0, 0));
- _points.push_back (ArdourCanvas::Duple (0, physical_screen_height (_editor->get_window())));
+
+ _points.push_back (ArdourCanvas::Duple (0, toplevel ? physical_screen_height (toplevel->get_window()) : 900));
}
MarkerDrag::~MarkerDrag ()
if (move_both || (*x).move_both) {
copy_location->set_start (new_start);
copy_location->set_end (new_end);
- } else if (new_start < copy_location->end()) {
+ } else if (new_start < copy_location->end()) {
copy_location->set_start (new_start);
} else if (newframe > 0) {
//_editor->snap_to (next, RoundUpAlways, true);
}
void
-MarkerDrag::aborted (bool movement_occured)
+MarkerDrag::aborted (bool movement_occurred)
{
- if (!movement_occured) {
+ if (!movement_occurred) {
return;
}
}
void
-LineDrag::finished (GdkEvent* event, bool movement_occured)
+LineDrag::finished (GdkEvent* event, bool movement_occurred)
{
- if (movement_occured) {
+ if (movement_occurred) {
motion (event, false);
_line->end_drag (false, 0);
_editor->commit_reversible_command ();
/* MIDI track */
if (_editor->selection->empty() && _editor->mouse_mode == MouseDraw) {
/* nothing selected */
- add_midi_region (mtv);
+ add_midi_region (mtv, true);
do_deselect = false;
}
}
}
void
-TimeFXDrag::finished (GdkEvent* /*event*/, bool movement_occurred)
+TimeFXDrag::finished (GdkEvent* event, bool movement_occurred)
{
- _primary->get_time_axis_view().hide_timestretch ();
+ /* this may have been a single click, no drag. We still want the dialog
+ to show up in that case, so that the user can manually edit the
+ parameters for the timestretch.
+ */
- if (!movement_occurred) {
- return;
- }
+ float fraction = 1.0;
- if (last_pointer_frame() < _primary->region()->position()) {
- /* backwards drag of the left edge - not usable */
- return;
- }
+ if (movement_occurred) {
+
+ motion (event, false);
+
+ _primary->get_time_axis_view().hide_timestretch ();
+
+ framepos_t adjusted_frame_pos = adjusted_current_frame (event);
- framecnt_t newlen = last_pointer_frame() - _primary->region()->position();
+ if (adjusted_frame_pos < _primary->region()->position()) {
+ /* backwards drag of the left edge - not usable */
+ return;
+ }
+
+ framecnt_t newlen = adjusted_frame_pos - _primary->region()->position();
- float percentage = (double) newlen / (double) _primary->region()->length();
+ fraction = (double) newlen / (double) _primary->region()->length();
#ifndef USE_RUBBERBAND
- // Soundtouch uses percentage / 100 instead of normal (/ 1)
- if (_primary->region()->data_type() == DataType::AUDIO) {
- percentage = (float) ((double) newlen - (double) _primary->region()->length()) / ((double) newlen) * 100.0f;
- }
+ // Soundtouch uses fraction / 100 instead of normal (/ 1)
+ if (_primary->region()->data_type() == DataType::AUDIO) {
+ fraction = (float) ((double) newlen - (double) _primary->region()->length()) / ((double) newlen) * 100.0f;
+ }
#endif
+ }
if (!_editor->get_selection().regions.empty()) {
/* primary will already be included in the selection, and edit
selection.
*/
- if (_editor->time_stretch (_editor->get_selection().regions, percentage) == -1) {
+ if (_editor->time_stretch (_editor->get_selection().regions, fraction) == -1) {
error << _("An error occurred while executing time stretch operation") << endmsg;
}
}
TrackViewList grouped_add = new_selection;
for (TrackViewList::const_iterator i = new_selection.begin(); i != new_selection.end(); ++i) {
RouteTimeAxisView *n = dynamic_cast<RouteTimeAxisView *>(*i);
- if ( n && n->route()->route_group() && n->route()->route_group()->is_active() && n->route()->route_group()->enabled_property (ARDOUR::Properties::select.property_id) ) {
+ if ( n && n->route()->route_group() && n->route()->route_group()->is_active() && n->route()->route_group()->enabled_property (ARDOUR::Properties::group_select.property_id) ) {
for (TrackViewList::const_iterator j = all_tracks.begin(); j != all_tracks.end(); ++j) {
RouteTimeAxisView *check = dynamic_cast<RouteTimeAxisView *>(*j);
if ( check && (n != check) && (check->route()->route_group() == n->route()->route_group()) )
_drag_rect = new ArdourCanvas::Rectangle (_editor->time_line_group,
ArdourCanvas::Rect (0.0, 0.0, 0.0,
- physical_screen_height (_editor->get_window())));
+ physical_screen_height (_editor->current_toplevel()->get_window())));
_drag_rect->hide ();
_drag_rect->set_fill_color (UIConfiguration::instance().color ("range drag rect"));
}
void
-RangeMarkerBarDrag::aborted (bool movement_occured)
+RangeMarkerBarDrag::aborted (bool movement_occurred)
{
- if (movement_occured) {
+ if (movement_occurred) {
_drag_rect->hide ();
}
}
* odd with them. so show the note value anyway, always.
*/
- char buf[12];
uint8_t new_note = min (max (_primary->note()->note() + note_delta, 0), 127);
- snprintf (buf, sizeof (buf), "%s (%d)", Evoral::midi_note_name (new_note).c_str(),
- (int) floor ((double)new_note));
-
- show_verbose_cursor_text (buf);
+ _region->show_verbose_cursor_for_new_note_value (_primary->note(), new_note);
}
}
PatchChangeDrag::finished (GdkEvent* ev, bool movement_occurred)
{
if (!movement_occurred) {
+ if (was_double_click()) {
+ _region_view->edit_patch_change (_patch_change);
+ }
return;
}