NO-OP: whitespace, indent

This commit is contained in:
Robin Gareus 2019-04-08 19:53:33 +02:00
parent 8a7e452265
commit 50303d90bd
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
8 changed files with 264 additions and 267 deletions

View file

@ -276,7 +276,7 @@ AutomationController::set_freq_beats(double beats)
{ {
const ARDOUR::ParameterDescriptor& desc = _controllable->desc(); const ARDOUR::ParameterDescriptor& desc = _controllable->desc();
const ARDOUR::Session& session = _controllable->session(); const ARDOUR::Session& session = _controllable->session();
const samplepos_t pos = session.transport_sample(); const samplepos_t pos = session.transport_sample();
const ARDOUR::Tempo& tempo = session.tempo_map().tempo_at_sample (pos); const ARDOUR::Tempo& tempo = session.tempo_map().tempo_at_sample (pos);
const double bpm = tempo.note_types_per_minute(); const double bpm = tempo.note_types_per_minute();
const double bps = bpm / 60.0; const double bps = bpm / 60.0;

View file

@ -49,7 +49,7 @@ public:
void init (bool wfd); void init (bool wfd);
bool paste (samplepos_t pos, bool paste (samplepos_t pos,
unsigned paste_count, unsigned paste_count,
float times, float times,
boost::shared_ptr<const ARDOUR::AutomationList> slist); boost::shared_ptr<const ARDOUR::AutomationList> slist);
@ -88,9 +88,9 @@ protected:
private: private:
ARDOUR::DoubleBeatsSamplesConverter _region_relative_time_converter; ARDOUR::DoubleBeatsSamplesConverter _region_relative_time_converter;
ARDOUR::DoubleBeatsSamplesConverter _source_relative_time_converter; ARDOUR::DoubleBeatsSamplesConverter _source_relative_time_converter;
Evoral::Parameter _parameter; Evoral::Parameter _parameter;
boost::shared_ptr<AutomationLine> _line; boost::shared_ptr<AutomationLine> _line;
PBD::ScopedConnection _mouse_mode_connection; PBD::ScopedConnection _mouse_mode_connection;
}; };
#endif /* __gtk_ardour_automation_region_view_h__ */ #endif /* __gtk_ardour_automation_region_view_h__ */

View file

@ -65,7 +65,7 @@ public:
std::list<boost::shared_ptr<AutomationLine> > get_lines () const; std::list<boost::shared_ptr<AutomationLine> > get_lines () const;
bool paste (samplepos_t pos, bool paste (samplepos_t pos,
unsigned paste_count, unsigned paste_count,
float times, float times,
boost::shared_ptr<ARDOUR::AutomationList> list); boost::shared_ptr<ARDOUR::AutomationList> list);

View file

@ -295,7 +295,7 @@ public:
void set_zoom_focus (Editing::ZoomFocus); void set_zoom_focus (Editing::ZoomFocus);
Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; } Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
samplecnt_t get_current_zoom () const { return samples_per_pixel; } samplecnt_t get_current_zoom () const { return samples_per_pixel; }
void cycle_zoom_focus (); void cycle_zoom_focus ();
void temporal_zoom_step (bool zoom_out); void temporal_zoom_step (bool zoom_out);
void temporal_zoom_step_scale (bool zoom_out, double scale); void temporal_zoom_step_scale (bool zoom_out, double scale);
@ -401,8 +401,8 @@ public:
void reposition_and_zoom (samplepos_t, double); void reposition_and_zoom (samplepos_t, double);
samplepos_t get_preferred_edit_position (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE, samplepos_t get_preferred_edit_position (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE,
bool use_context_click = false, bool use_context_click = false,
bool from_outside_canvas = false); bool from_outside_canvas = false);
bool update_mouse_speed (); bool update_mouse_speed ();
bool decelerate_mouse_speed (); bool decelerate_mouse_speed ();
@ -432,13 +432,13 @@ public:
ARDOUR::SrcQuality quality, ARDOUR::SrcQuality quality,
ARDOUR::MidiTrackNameSource mts, ARDOUR::MidiTrackNameSource mts,
ARDOUR::MidiTempoMapDisposition mtd, ARDOUR::MidiTempoMapDisposition mtd,
samplepos_t& pos, samplepos_t& pos,
boost::shared_ptr<ARDOUR::PluginInfo> instrument = boost::shared_ptr<ARDOUR::PluginInfo>()); boost::shared_ptr<ARDOUR::PluginInfo> instrument = boost::shared_ptr<ARDOUR::PluginInfo>());
void do_embed (std::vector<std::string> paths, void do_embed (std::vector<std::string> paths,
Editing::ImportDisposition disposition, Editing::ImportDisposition disposition,
Editing::ImportMode mode, Editing::ImportMode mode,
samplepos_t& pos, samplepos_t& pos,
boost::shared_ptr<ARDOUR::PluginInfo> instrument = boost::shared_ptr<ARDOUR::PluginInfo>()); boost::shared_ptr<ARDOUR::PluginInfo> instrument = boost::shared_ptr<ARDOUR::PluginInfo>());
void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions, bool src_comparison); void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions, bool src_comparison);
@ -451,14 +451,14 @@ public:
TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const; TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const;
void snap_to (ARDOUR::MusicSample& first, void snap_to (ARDOUR::MusicSample& first,
ARDOUR::RoundMode direction = ARDOUR::RoundNearest, ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
ARDOUR::SnapPref pref = ARDOUR::SnapToAny_Visual, ARDOUR::SnapPref pref = ARDOUR::SnapToAny_Visual,
bool ensure_snap = false); bool ensure_snap = false);
void snap_to_with_modifier (ARDOUR::MusicSample& first, void snap_to_with_modifier (ARDOUR::MusicSample& first,
GdkEvent const * ev, GdkEvent const * ev,
ARDOUR::RoundMode direction = ARDOUR::RoundNearest, ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
ARDOUR::SnapPref pref = ARDOUR::SnapToAny_Visual); ARDOUR::SnapPref pref = ARDOUR::SnapToAny_Visual);
void set_snapped_cursor_position (samplepos_t pos); void set_snapped_cursor_position (samplepos_t pos);
@ -576,8 +576,8 @@ private:
VisualState (bool with_tracks); VisualState (bool with_tracks);
~VisualState (); ~VisualState ();
double y_position; double y_position;
samplecnt_t samples_per_pixel; samplecnt_t samples_per_pixel;
samplepos_t _leftmost_sample; samplepos_t _leftmost_sample;
Editing::ZoomFocus zoom_focus; Editing::ZoomFocus zoom_focus;
GUIObjectState* gui_state; GUIObjectState* gui_state;
}; };
@ -1105,10 +1105,10 @@ private:
VideoTimeline = 0x8 VideoTimeline = 0x8
}; };
Type pending; Type pending;
samplepos_t time_origin; samplepos_t time_origin;
samplecnt_t samples_per_pixel; samplecnt_t samples_per_pixel;
double y_origin; double y_origin;
int idle_handler_id; int idle_handler_id;
/** true if we are currently in the idle handler */ /** true if we are currently in the idle handler */
@ -1188,7 +1188,7 @@ private:
/* CUT/COPY/PASTE */ /* CUT/COPY/PASTE */
samplepos_t last_paste_pos; samplepos_t last_paste_pos;
unsigned paste_count; unsigned paste_count;
void cut_copy (Editing::CutCopyOp); void cut_copy (Editing::CutCopyOp);
bool can_cut_copy () const; bool can_cut_copy () const;
@ -1340,7 +1340,7 @@ private:
Editing::ImportDisposition disposition, Editing::ImportDisposition disposition,
Editing::ImportMode mode, Editing::ImportMode mode,
ARDOUR::SrcQuality quality, ARDOUR::SrcQuality quality,
samplepos_t& pos, samplepos_t& pos,
int target_regions, int target_regions,
int target_tracks, int target_tracks,
boost::shared_ptr<ARDOUR::Track>& track, boost::shared_ptr<ARDOUR::Track>& track,
@ -1352,7 +1352,7 @@ private:
bool& check_sample_rate, bool& check_sample_rate,
Editing::ImportDisposition disposition, Editing::ImportDisposition disposition,
Editing::ImportMode mode, Editing::ImportMode mode,
samplepos_t& pos, samplepos_t& pos,
int target_regions, int target_regions,
int target_tracks, int target_tracks,
boost::shared_ptr<ARDOUR::Track>& track, boost::shared_ptr<ARDOUR::Track>& track,
@ -1360,7 +1360,7 @@ private:
int add_sources (std::vector<std::string> paths, int add_sources (std::vector<std::string> paths,
ARDOUR::SourceList& sources, ARDOUR::SourceList& sources,
samplepos_t& pos, samplepos_t& pos,
Editing::ImportDisposition disposition, Editing::ImportDisposition disposition,
Editing::ImportMode mode, Editing::ImportMode mode,
int target_regions, int target_regions,
@ -1372,7 +1372,7 @@ private:
int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region,
uint32_t in_chans, uint32_t in_chans,
uint32_t out_chans, uint32_t out_chans,
samplepos_t& pos, samplepos_t& pos,
Editing::ImportMode mode, Editing::ImportMode mode,
boost::shared_ptr<ARDOUR::Track>& existing_track, boost::shared_ptr<ARDOUR::Track>& existing_track,
const std::string& new_track_name, const std::string& new_track_name,
@ -2179,12 +2179,12 @@ private:
ARDOUR::SnapPref gpref); ARDOUR::SnapPref gpref);
void snap_to_internal (ARDOUR::MusicSample& first, void snap_to_internal (ARDOUR::MusicSample& first,
ARDOUR::RoundMode direction = ARDOUR::RoundNearest, ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
ARDOUR::SnapPref gpref = ARDOUR::SnapToAny_Visual, ARDOUR::SnapPref gpref = ARDOUR::SnapToAny_Visual,
bool ensure_snap = false); bool ensure_snap = false);
samplepos_t snap_to_marker (samplepos_t presnap, samplepos_t snap_to_marker (samplepos_t presnap,
ARDOUR::RoundMode direction = ARDOUR::RoundNearest); ARDOUR::RoundMode direction = ARDOUR::RoundNearest);
RhythmFerret* rhythm_ferret; RhythmFerret* rhythm_ferret;

View file

@ -316,14 +316,14 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf, samplepos_t pos)
} }
void void
Editor::do_import (vector<string> paths, Editor::do_import (vector<string> paths,
ImportDisposition disposition, ImportDisposition disposition,
ImportMode mode, ImportMode mode,
SrcQuality quality, SrcQuality quality,
MidiTrackNameSource midi_track_name_source, MidiTrackNameSource midi_track_name_source,
MidiTempoMapDisposition smf_tempo_disposition, MidiTempoMapDisposition smf_tempo_disposition,
samplepos_t& pos, samplepos_t& pos,
ARDOUR::PluginInfoPtr instrument) ARDOUR::PluginInfoPtr instrument)
{ {
boost::shared_ptr<Track> track; boost::shared_ptr<Track> track;
vector<string> to_import; vector<string> to_import;
@ -547,7 +547,7 @@ Editor::import_sndfiles (vector<string> paths,
ImportDisposition disposition, ImportDisposition disposition,
ImportMode mode, ImportMode mode,
SrcQuality quality, SrcQuality quality,
samplepos_t& pos, samplepos_t& pos,
int target_regions, int target_regions,
int target_tracks, int target_tracks,
boost::shared_ptr<Track>& track, boost::shared_ptr<Track>& track,
@ -617,7 +617,7 @@ Editor::embed_sndfiles (vector<string> paths,
bool& check_sample_rate, bool& check_sample_rate,
ImportDisposition disposition, ImportDisposition disposition,
ImportMode mode, ImportMode mode,
samplepos_t& pos, samplepos_t& pos,
int target_regions, int target_regions,
int target_tracks, int target_tracks,
boost::shared_ptr<Track>& track, boost::shared_ptr<Track>& track,
@ -739,7 +739,7 @@ Editor::embed_sndfiles (vector<string> paths,
int int
Editor::add_sources (vector<string> paths, Editor::add_sources (vector<string> paths,
SourceList& sources, SourceList& sources,
samplepos_t& pos, samplepos_t& pos,
ImportDisposition disposition, ImportDisposition disposition,
ImportMode mode, ImportMode mode,
int target_regions, int target_regions,

View file

@ -283,7 +283,7 @@ private:
* samplepos. used for relative snap. * samplepos. used for relative snap.
*/ */
samplepos_t _snap_delta; samplepos_t _snap_delta;
double _snap_delta_music; double _snap_delta_music;
CursorContext::Handle _cursor_ctx; ///< cursor change context CursorContext::Handle _cursor_ctx; ///< cursor change context
bool _constraint_pressed; ///< if the keyboard indicated constraint modifier was pressed on start_grab() bool _constraint_pressed; ///< if the keyboard indicated constraint modifier was pressed on start_grab()
}; };
@ -636,7 +636,7 @@ private:
} }
MidiRegionView* _region_view; MidiRegionView* _region_view;
samplepos_t _last_pos; samplepos_t _last_pos;
double _y; double _y;
}; };

View file

@ -87,20 +87,20 @@ using Gtkmm2ext::Keyboard;
bool bool
Editor::mouse_sample (samplepos_t& where, bool& in_track_canvas) const Editor::mouse_sample (samplepos_t& where, bool& in_track_canvas) const
{ {
/* gdk_window_get_pointer() has X11's XQueryPointer semantics in that it only /* 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 * 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 * if the pointer is in a menu, the return window from the call will be the
the regular subwindow *under* the menu. * 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().
*/
this matters quite a lot if the pointer is moving around in a menu that overlaps if (!within_track_canvas) {
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; int x, y;
Glib::RefPtr<Gdk::Window> canvas_window = const_cast<Editor*>(this)->_track_canvas->get_window(); Glib::RefPtr<Gdk::Window> canvas_window = const_cast<Editor*>(this)->_track_canvas->get_window();
@ -311,10 +311,10 @@ Editor::mouse_mode_toggled (MouseMode m)
/* Switch snap type/mode if we're moving to/from an internal tool. Note /* Switch snap type/mode if we're moving to/from an internal tool. Note
this must toggle the actions and not call set_snap_*() directly, this must toggle the actions and not call set_snap_*() directly,
otherwise things get out of sync and the combo box stops working. */ otherwise things get out of sync and the combo box stops working. */
if (!UIConfiguration::instance().get_grid_follows_internal()) { if (!UIConfiguration::instance().get_grid_follows_internal()) {
grid_type_action(pre_internal_grid_type)->set_active(true); grid_type_action(pre_internal_grid_type)->set_active(true);
snap_mode_action(pre_internal_snap_mode)->set_active(true); snap_mode_action(pre_internal_snap_mode)->set_active(true);
} else if (!was_internal && internal_editing()) { } else if (!was_internal && internal_editing()) {
grid_type_action(internal_grid_type)->set_active(true); grid_type_action(internal_grid_type)->set_active(true);
snap_mode_action(internal_snap_mode)->set_active(true); snap_mode_action(internal_snap_mode)->set_active(true);
} else if (was_internal && !internal_editing()) { } else if (was_internal && !internal_editing()) {
@ -420,19 +420,18 @@ Editor::step_mouse_mode (bool next)
void void
Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type) Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type)
{ {
/* in object/audition/timefx/gain-automation mode,
/* in object/audition/timefx/gain-automation mode, * any button press sets the selection if the object
any button press sets the selection if the object * can be selected. this is a bit of hack, because
can be selected. this is a bit of hack, because * we want to avoid this if the mouse operation is a
we want to avoid this if the mouse operation is a * region alignment.
region alignment. *
* note: not dbl-click or triple-click
note: not dbl-click or triple-click *
* Also note that there is no region selection in internal edit mode, otherwise
Also note that there is no region selection in internal edit mode, otherwise * for operations operating on the selection (e.g. cut) it is not obvious whether
for operations operating on the selection (e.g. cut) it is not obvious whether * to cut notes or regions.
to cut notes or regions. */
*/
MouseMode eff_mouse_mode = effective_mouse_mode (); MouseMode eff_mouse_mode = effective_mouse_mode ();
@ -443,31 +442,31 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
if (get_smart_mode() && eff_mouse_mode == MouseRange && event->button.button == 3 && item_type == RegionItem) { if (get_smart_mode() && eff_mouse_mode == MouseRange && event->button.button == 3 && item_type == RegionItem) {
/* context clicks are always about object properties, even if /* context clicks are always about object properties, even if
we're in range mode within smart mode. we're in range mode within smart mode.
*/ */
eff_mouse_mode = MouseObject; eff_mouse_mode = MouseObject;
} }
/* special case: allow drag of region fade in/out in object mode with join object/range enabled */ /* special case: allow drag of region fade in/out in object mode with join object/range enabled */
if (get_smart_mode()) { if (get_smart_mode()) {
switch (item_type) { switch (item_type) {
case FadeInHandleItem: case FadeInHandleItem:
case FadeInTrimHandleItem: case FadeInTrimHandleItem:
case FadeOutHandleItem: case FadeOutHandleItem:
case FadeOutTrimHandleItem: case FadeOutTrimHandleItem:
eff_mouse_mode = MouseObject; eff_mouse_mode = MouseObject;
break; break;
default: default:
break; break;
} }
} }
if (((mouse_mode != MouseObject) && if (((mouse_mode != MouseObject) &&
(mouse_mode != MouseAudition || item_type != RegionItem) && (mouse_mode != MouseAudition || item_type != RegionItem) &&
(mouse_mode != MouseTimeFX || item_type != RegionItem) && (mouse_mode != MouseTimeFX || item_type != RegionItem) &&
(mouse_mode != MouseDraw) && (mouse_mode != MouseDraw) &&
(mouse_mode != MouseContent || item_type == RegionItem)) || (mouse_mode != MouseContent || item_type == RegionItem)) ||
((event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE) || event->button.button > 3)) { ((event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE) || event->button.button > 3)) {
return; return;
} }
@ -478,8 +477,8 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
/* almost no selection action on modified button-2 or button-3 events */ /* almost no selection action on modified button-2 or button-3 events */
if ((item_type != RegionItem && event->button.button != 2) if ((item_type != RegionItem && event->button.button != 2)
/* for selection of control points prior to delete (shift-right click) */ /* for selection of control points prior to delete (shift-right click) */
&& !(item_type == ControlPointItem && event->button.button == 3 && event->type == GDK_BUTTON_PRESS)) { && !(item_type == ControlPointItem && event->button.button == 3 && event->type == GDK_BUTTON_PRESS)) {
return; return;
} }
} }
@ -493,183 +492,183 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
} }
switch (item_type) { switch (item_type) {
case RegionItem: case RegionItem:
if (eff_mouse_mode == MouseDraw) { if (eff_mouse_mode == MouseDraw) {
break;
}
if (press) {
if (eff_mouse_mode != MouseRange) {
_mouse_changed_selection = set_selected_regionview_from_click (press, op);
} else {
/* don't change the selection unless the
clicked track is not currently selected. if
so, "collapse" the selection to just this
track
*/
if (!selection->selected (clicked_axisview)) {
set_selected_track_as_side_effect (Selection::Set);
}
}
} else {
if (eff_mouse_mode != MouseRange) {
_mouse_changed_selection |= set_selected_regionview_from_click (press, op);
}
}
break; break;
}
if (press) { case RegionViewNameHighlight:
if (eff_mouse_mode != MouseRange) { case RegionViewName:
_mouse_changed_selection = set_selected_regionview_from_click (press, op); case LeftFrameHandle:
} else { case RightFrameHandle:
/* don't change the selection unless the case FadeInHandleItem:
clicked track is not currently selected. if case FadeInTrimHandleItem:
so, "collapse" the selection to just this case FadeInItem:
track case FadeOutHandleItem:
*/ case FadeOutTrimHandleItem:
if (!selection->selected (clicked_axisview)) { case FadeOutItem:
set_selected_track_as_side_effect (Selection::Set); case StartCrossFadeItem:
} case EndCrossFadeItem:
} if (get_smart_mode() || eff_mouse_mode != MouseRange) {
} else {
if (eff_mouse_mode != MouseRange) {
_mouse_changed_selection |= set_selected_regionview_from_click (press, op); _mouse_changed_selection |= set_selected_regionview_from_click (press, op);
} else if (event->type == GDK_BUTTON_PRESS) {
set_selected_track_as_side_effect (op);
} }
} break;
break;
case RegionViewNameHighlight: case ControlPointItem:
case RegionViewName: /* for object/track exclusivity, we don't call set_selected_track_as_side_effect (op); */
case LeftFrameHandle:
case RightFrameHandle:
case FadeInHandleItem:
case FadeInTrimHandleItem:
case FadeInItem:
case FadeOutHandleItem:
case FadeOutTrimHandleItem:
case FadeOutItem:
case StartCrossFadeItem:
case EndCrossFadeItem:
if (get_smart_mode() || eff_mouse_mode != MouseRange) {
_mouse_changed_selection |= set_selected_regionview_from_click (press, op);
} else if (event->type == GDK_BUTTON_PRESS) {
set_selected_track_as_side_effect (op);
}
break;
case ControlPointItem: if (eff_mouse_mode != MouseRange) {
/* for object/track exclusivity, we don't call set_selected_track_as_side_effect (op); */ if (event->button.button != 3) {
_mouse_changed_selection |= set_selected_control_point_from_click (press, op);
if (eff_mouse_mode != MouseRange) { } else {
if (event->button.button != 3) { _mouse_changed_selection |= set_selected_control_point_from_click (press, Selection::Set);
_mouse_changed_selection |= set_selected_control_point_from_click (press, op); }
} else {
_mouse_changed_selection |= set_selected_control_point_from_click (press, Selection::Set);
} }
} break;
break;
case GainLineItem: case GainLineItem:
if (eff_mouse_mode != MouseRange) { if (eff_mouse_mode != MouseRange) {
AutomationLine* argl = reinterpret_cast<AutomationLine*> (item->get_data ("line")); AutomationLine* argl = reinterpret_cast<AutomationLine*> (item->get_data ("line"));
std::list<Selectable*> selectables; std::list<Selectable*> selectables;
uint32_t before, after; uint32_t before, after;
samplecnt_t const where = (samplecnt_t) floor (event->button.x * samples_per_pixel) - clicked_regionview->region ()->position (); samplecnt_t const where = (samplecnt_t) floor (event->button.x * samples_per_pixel) - clicked_regionview->region ()->position ();
if (!argl || !argl->control_points_adjacent (where, before, after)) { if (!argl || !argl->control_points_adjacent (where, before, after)) {
break; break;
}
selectables.push_back (argl->nth (before));
selectables.push_back (argl->nth (after));
switch (op) {
case Selection::Set:
if (press) {
selection->set (selectables);
_mouse_changed_selection = true;
}
break;
case Selection::Add:
if (press) {
selection->add (selectables);
_mouse_changed_selection = true;
}
break;
case Selection::Toggle:
if (press) {
selection->toggle (selectables);
_mouse_changed_selection = true;
}
break;
case Selection::Extend:
/* XXX */
break;
}
} }
break;
selectables.push_back (argl->nth (before)); case AutomationLineItem:
selectables.push_back (argl->nth (after)); if (eff_mouse_mode != MouseRange) {
AutomationLine* al = reinterpret_cast<AutomationLine*> (item->get_data ("line"));
std::list<Selectable*> selectables;
double mx = event->button.x;
double my = event->button.y;
switch (op) { al->grab_item().canvas_to_item (mx, my);
case Selection::Set:
if (press) {
selection->set (selectables);
_mouse_changed_selection = true;
}
break;
case Selection::Add:
if (press) {
selection->add (selectables);
_mouse_changed_selection = true;
}
break;
case Selection::Toggle:
if (press) {
selection->toggle (selectables);
_mouse_changed_selection = true;
}
break;
case Selection::Extend: uint32_t before, after;
/* XXX */ samplecnt_t const where = (samplecnt_t) floor (mx * samples_per_pixel);
break;
if (!al || !al->control_points_adjacent (where, before, after)) {
break;
}
selectables.push_back (al->nth (before));
selectables.push_back (al->nth (after));
switch (op) {
case Selection::Set:
if (press) {
selection->set (selectables);
_mouse_changed_selection = true;
}
break;
case Selection::Add:
if (press) {
selection->add (selectables);
_mouse_changed_selection = true;
}
break;
case Selection::Toggle:
if (press) {
selection->toggle (selectables);
_mouse_changed_selection = true;
}
break;
case Selection::Extend:
/* XXX */
break;
}
} }
} break;
break;
case AutomationLineItem: case StreamItem:
if (eff_mouse_mode != MouseRange) { /* for context click, select track */
AutomationLine* al = reinterpret_cast<AutomationLine*> (item->get_data ("line")); if (event->button.button == 3) {
std::list<Selectable*> selectables; selection->clear_tracks ();
double mx = event->button.x; set_selected_track_as_side_effect (op);
double my = event->button.y;
al->grab_item().canvas_to_item (mx, my); /* We won't get a release.*/
begin_reversible_selection_op (X_("Button 3 Menu Select"));
uint32_t before, after;
samplecnt_t const where = (samplecnt_t) floor (mx * samples_per_pixel);
if (!al || !al->control_points_adjacent (where, before, after)) {
break;
}
selectables.push_back (al->nth (before));
selectables.push_back (al->nth (after));
switch (op) {
case Selection::Set:
if (press) {
selection->set (selectables);
_mouse_changed_selection = true;
}
break;
case Selection::Add:
if (press) {
selection->add (selectables);
_mouse_changed_selection = true;
}
break;
case Selection::Toggle:
if (press) {
selection->toggle (selectables);
_mouse_changed_selection = true;
}
break;
case Selection::Extend:
/* XXX */
break;
}
}
break;
case StreamItem:
/* for context click, select track */
if (event->button.button == 3) {
selection->clear_tracks ();
set_selected_track_as_side_effect (op);
/* We won't get a release.*/
begin_reversible_selection_op (X_("Button 3 Menu Select"));
commit_reversible_selection_op ();
}
break;
case AutomationTrackItem:
if (eff_mouse_mode != MouseDraw && op == Selection::Set) {
set_selected_track_as_side_effect (op);
}
break;
case NoteItem:
if (press && event->button.button == 3) {
NoteBase* cnote = reinterpret_cast<NoteBase*> (item->get_data ("notebase"));
assert (cnote);
if (cnote->region_view().selection_size() == 0 || !cnote->selected()) {
selection->clear_points();
cnote->region_view().unique_select (cnote);
/* we won't get the release, so store the selection change now */
begin_reversible_selection_op (X_("Button 3 Note Selection"));
commit_reversible_selection_op (); commit_reversible_selection_op ();
} }
} break;
break;
default: case AutomationTrackItem:
break; if (eff_mouse_mode != MouseDraw && op == Selection::Set) {
set_selected_track_as_side_effect (op);
}
break;
case NoteItem:
if (press && event->button.button == 3) {
NoteBase* cnote = reinterpret_cast<NoteBase*> (item->get_data ("notebase"));
assert (cnote);
if (cnote->region_view().selection_size() == 0 || !cnote->selected()) {
selection->clear_points();
cnote->region_view().unique_select (cnote);
/* we won't get the release, so store the selection change now */
begin_reversible_selection_op (X_("Button 3 Note Selection"));
commit_reversible_selection_op ();
}
}
break;
default:
break;
} }
if ((!press) && _mouse_changed_selection) { if ((!press) && _mouse_changed_selection) {
@ -1399,21 +1398,19 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
bool bool
Editor::button_press_dispatch (GdkEventButton* ev) Editor::button_press_dispatch (GdkEventButton* ev)
{ {
/* this function is intended only for buttons 4 and above. /* this function is intended only for buttons 4 and above. */
*/
Gtkmm2ext::MouseButton b (ev->state, ev->button); Gtkmm2ext::MouseButton b (ev->state, ev->button);
return button_bindings->activate (b, Gtkmm2ext::Bindings::Press); return button_bindings->activate (b, Gtkmm2ext::Bindings::Press);
} }
bool bool
Editor::button_release_dispatch (GdkEventButton* ev) Editor::button_release_dispatch (GdkEventButton* ev)
{ {
/* this function is intended only for buttons 4 and above. /* this function is intended only for buttons 4 and above. */
*/
Gtkmm2ext::MouseButton b (ev->state, ev->button); Gtkmm2ext::MouseButton b (ev->state, ev->button);
return button_bindings->activate (b, Gtkmm2ext::Bindings::Release); return button_bindings->activate (b, Gtkmm2ext::Bindings::Release);
} }
bool bool

View file

@ -84,19 +84,19 @@ public:
} }
private: private:
ARDOUR::samplecnt_t original_length; ARDOUR::samplecnt_t original_length;
Gtk::Adjustment pitch_octave_adjustment; Gtk::Adjustment pitch_octave_adjustment;
Gtk::Adjustment pitch_semitone_adjustment; Gtk::Adjustment pitch_semitone_adjustment;
Gtk::Adjustment pitch_cent_adjustment; Gtk::Adjustment pitch_cent_adjustment;
Gtk::SpinButton pitch_octave_spinner; Gtk::SpinButton pitch_octave_spinner;
Gtk::SpinButton pitch_semitone_spinner; Gtk::SpinButton pitch_semitone_spinner;
Gtk::SpinButton pitch_cent_spinner; Gtk::SpinButton pitch_cent_spinner;
Gtk::Adjustment duration_adjustment; Gtk::Adjustment duration_adjustment;
AudioClock* duration_clock; AudioClock* duration_clock;
bool ignore_adjustment_change; bool ignore_adjustment_change;
bool ignore_clock_change; bool ignore_clock_change;
sigc::connection update_connection; sigc::connection update_connection;
float progress; float progress;
void update_progress_gui (float); void update_progress_gui (float);
void duration_clock_changed (); void duration_clock_changed ();