#include "ardour/session.h"
#include "ardour/types.h"
+#include "widgets/prompter.h"
+
#include "actions.h"
#include "ardour_ui.h"
#include "editor.h"
#include "region_gain_line.h"
#include "automation_time_axis.h"
#include "control_point.h"
-#include "prompter.h"
#include "selection.h"
#include "keyboard.h"
#include "editing.h"
Editor::mouse_frame (framepos_t& where, bool& in_track_canvas) const
{
/* gdk_window_get_pointer() has X11's XQueryPointer semantics in that it only
- pays attentions to subwindows. this means that menu windows are ignored, and
- if the pointer is in a menu, the return window from the call will be the
- the regular subwindow *under* the menu.
-
- this matters quite a lot if the pointer is moving around in a menu that overlaps
- the track canvas because we will believe that we are within the track canvas
- when we are not. therefore, we track enter/leave events for the track canvas
- and allow that to override the result of gdk_window_get_pointer().
+ pays attentions to subwindows. this means that menu windows are ignored, and
+ if the pointer is in a menu, the return window from the call will be the
+ the regular subwindow *under* the menu.
+
+ this matters quite a lot if the pointer is moving around in a menu that overlaps
+ the track canvas because we will believe that we are within the track canvas
+ when we are not. therefore, we track enter/leave events for the track canvas
+ and allow that to override the result of gdk_window_get_pointer().
*/
if (!within_track_canvas) {
- return false;
+ return false;
}
int x, y;
break;
default:
- return button_press_dispatch (&event->button);
+ return button_press_dispatch (&event->button);
break;
}
return true;
}
- bool were_dragging = false;
+ bool were_dragging = false;
if (!Keyboard::is_context_menu_event (&event->button)) {
- /* see if we're finishing a drag */
+ /* see if we're finishing a drag */
- if (_drags->active ()) {
- bool const r = _drags->end_grab (event);
- if (r) {
- /* grab dragged, so do nothing else */
- return true;
- }
+ if (_drags->active ()) {
+ bool const r = _drags->end_grab (event);
+ if (r) {
+ /* grab dragged, so do nothing else */
+ return true;
+ }
- were_dragging = true;
- }
+ were_dragging = true;
+ }
- update_region_layering_order_editor ();
- }
+ update_region_layering_order_editor ();
+ }
/* edit events get handled here */
return true;
case TempoBarItem:
case TempoCurveItem:
- if (!_dragging_playhead) {
+ if (!_dragging_playhead && Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
snap_to_with_modifier (where, event);
mouse_add_new_tempo_event (where.frame);
}
return true;
case MeterBarItem:
- if (!_dragging_playhead) {
+ if (!_dragging_playhead && Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
mouse_add_new_meter_event (pixel_to_sample (event->button.x));
}
return true;
}
- /* do any (de)selection operations that should occur on button release */
+ /* do any (de)selection operations that should occur on button release */
button_selection (item, event, item_type);
return true;
MeterMarker* m_marker = 0;
TempoMarker* t_marker = 0;
double fraction;
- bool ret = true;
+ bool ret = true;
/* by the time we reach here, entered_regionview and entered trackview
* will have already been set as appropriate. Things are done this
void
Editor::note_edit_done (int r, EditNoteDialog* d)
{
- begin_reversible_command (_("edit note(s)"));
-
d->done (r);
delete d;
-
- commit_reversible_command();
}
void
if (Keyboard::modifier_state_contains (event->state, Keyboard::PrimaryModifier)) {
TimeAxisView* tv = &rv.get_time_axis_view();
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(tv);
- double speed = 1.0;
- if (rtv && rtv->is_track()) {
- speed = rtv->track()->speed();
- }
framepos_t where = get_preferred_edit_position();
if (Keyboard::modifier_state_equals (event->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) {
- align_region (rv.region(), SyncPoint, (framepos_t) (where * speed));
+ align_region (rv.region(), SyncPoint, where);
} else if (Keyboard::modifier_state_equals (event->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
- align_region (rv.region(), End, (framepos_t) (where * speed));
+ align_region (rv.region(), End, where);
} else {
- align_region (rv.region(), Start, (framepos_t) (where * speed));
+ align_region (rv.region(), Start, where);
}
}
}
{
using namespace Gtkmm2ext;
- ArdourPrompter prompter (false);
+ ArdourWidgets::Prompter prompter (false);
prompter.set_prompt (_("Name for region:"));
prompter.set_initial_text (clicked_regionview->region()->name());
}
boost::shared_ptr<Playlist> playlist = rtv->playlist();
- double speed = rtv->track()->speed();
playlist->clear_changes ();
boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region(), true));
- playlist->add_region (new_region, (framepos_t) (pos * speed));
+ playlist->add_region (new_region, pos);
_session->add_command (new StatefulDiffCommand (playlist));
// playlist is frozen, so we have to update manually XXX this is disgusting