summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-04-08 19:53:33 +0200
committerRobin Gareus <robin@gareus.org>2019-04-08 20:58:18 +0200
commit50303d90bdcc329efe2e6d09b48c480a9bc2ba3b (patch)
tree154876b06aa4bef1e79cc9004dd2dcb25d9d7ac4
parent8a7e452265ca079aafe8fa6dce58ed54ca7fe824 (diff)
NO-OP: whitespace, indent
-rw-r--r--gtk2_ardour/automation_controller.cc2
-rw-r--r--gtk2_ardour/automation_region_view.h8
-rw-r--r--gtk2_ardour/automation_streamview.h2
-rw-r--r--gtk2_ardour/editor.h52
-rw-r--r--gtk2_ardour/editor_audio_import.cc20
-rw-r--r--gtk2_ardour/editor_drag.h4
-rw-r--r--gtk2_ardour/editor_mouse.cc399
-rw-r--r--gtk2_ardour/time_fx_dialog.h26
8 files changed, 255 insertions, 258 deletions
diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc
index 3d9fc18675..eff76435ad 100644
--- a/gtk2_ardour/automation_controller.cc
+++ b/gtk2_ardour/automation_controller.cc
@@ -276,7 +276,7 @@ AutomationController::set_freq_beats(double beats)
{
const ARDOUR::ParameterDescriptor& desc = _controllable->desc();
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 double bpm = tempo.note_types_per_minute();
const double bps = bpm / 60.0;
diff --git a/gtk2_ardour/automation_region_view.h b/gtk2_ardour/automation_region_view.h
index ce34e763d3..0ab508ca41 100644
--- a/gtk2_ardour/automation_region_view.h
+++ b/gtk2_ardour/automation_region_view.h
@@ -49,7 +49,7 @@ public:
void init (bool wfd);
- bool paste (samplepos_t pos,
+ bool paste (samplepos_t pos,
unsigned paste_count,
float times,
boost::shared_ptr<const ARDOUR::AutomationList> slist);
@@ -88,9 +88,9 @@ protected:
private:
ARDOUR::DoubleBeatsSamplesConverter _region_relative_time_converter;
ARDOUR::DoubleBeatsSamplesConverter _source_relative_time_converter;
- Evoral::Parameter _parameter;
- boost::shared_ptr<AutomationLine> _line;
- PBD::ScopedConnection _mouse_mode_connection;
+ Evoral::Parameter _parameter;
+ boost::shared_ptr<AutomationLine> _line;
+ PBD::ScopedConnection _mouse_mode_connection;
};
#endif /* __gtk_ardour_automation_region_view_h__ */
diff --git a/gtk2_ardour/automation_streamview.h b/gtk2_ardour/automation_streamview.h
index 275b0f3b75..8a281d5f0c 100644
--- a/gtk2_ardour/automation_streamview.h
+++ b/gtk2_ardour/automation_streamview.h
@@ -65,7 +65,7 @@ public:
std::list<boost::shared_ptr<AutomationLine> > get_lines () const;
- bool paste (samplepos_t pos,
+ bool paste (samplepos_t pos,
unsigned paste_count,
float times,
boost::shared_ptr<ARDOUR::AutomationList> list);
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 37cc40275d..b6fa932b1d 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -295,7 +295,7 @@ public:
void set_zoom_focus (Editing::ZoomFocus);
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 temporal_zoom_step (bool zoom_out);
void temporal_zoom_step_scale (bool zoom_out, double scale);
@@ -401,8 +401,8 @@ public:
void reposition_and_zoom (samplepos_t, double);
samplepos_t get_preferred_edit_position (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE,
- bool use_context_click = false,
- bool from_outside_canvas = false);
+ bool use_context_click = false,
+ bool from_outside_canvas = false);
bool update_mouse_speed ();
bool decelerate_mouse_speed ();
@@ -432,13 +432,13 @@ public:
ARDOUR::SrcQuality quality,
ARDOUR::MidiTrackNameSource mts,
ARDOUR::MidiTempoMapDisposition mtd,
- samplepos_t& pos,
+ samplepos_t& pos,
boost::shared_ptr<ARDOUR::PluginInfo> instrument = boost::shared_ptr<ARDOUR::PluginInfo>());
void do_embed (std::vector<std::string> paths,
Editing::ImportDisposition disposition,
Editing::ImportMode mode,
- samplepos_t& pos,
+ samplepos_t& pos,
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);
@@ -451,14 +451,14 @@ public:
TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const;
void snap_to (ARDOUR::MusicSample& first,
- ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
- ARDOUR::SnapPref pref = ARDOUR::SnapToAny_Visual,
- bool ensure_snap = false);
+ ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
+ ARDOUR::SnapPref pref = ARDOUR::SnapToAny_Visual,
+ bool ensure_snap = false);
void snap_to_with_modifier (ARDOUR::MusicSample& first,
- GdkEvent const * ev,
- ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
- ARDOUR::SnapPref pref = ARDOUR::SnapToAny_Visual);
+ GdkEvent const * ev,
+ ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
+ ARDOUR::SnapPref pref = ARDOUR::SnapToAny_Visual);
void set_snapped_cursor_position (samplepos_t pos);
@@ -576,8 +576,8 @@ private:
VisualState (bool with_tracks);
~VisualState ();
double y_position;
- samplecnt_t samples_per_pixel;
- samplepos_t _leftmost_sample;
+ samplecnt_t samples_per_pixel;
+ samplepos_t _leftmost_sample;
Editing::ZoomFocus zoom_focus;
GUIObjectState* gui_state;
};
@@ -1105,10 +1105,10 @@ private:
VideoTimeline = 0x8
};
- Type pending;
+ Type pending;
samplepos_t time_origin;
- samplecnt_t samples_per_pixel;
- double y_origin;
+ samplecnt_t samples_per_pixel;
+ double y_origin;
int idle_handler_id;
/** true if we are currently in the idle handler */
@@ -1188,7 +1188,7 @@ private:
/* CUT/COPY/PASTE */
samplepos_t last_paste_pos;
- unsigned paste_count;
+ unsigned paste_count;
void cut_copy (Editing::CutCopyOp);
bool can_cut_copy () const;
@@ -1340,7 +1340,7 @@ private:
Editing::ImportDisposition disposition,
Editing::ImportMode mode,
ARDOUR::SrcQuality quality,
- samplepos_t& pos,
+ samplepos_t& pos,
int target_regions,
int target_tracks,
boost::shared_ptr<ARDOUR::Track>& track,
@@ -1352,7 +1352,7 @@ private:
bool& check_sample_rate,
Editing::ImportDisposition disposition,
Editing::ImportMode mode,
- samplepos_t& pos,
+ samplepos_t& pos,
int target_regions,
int target_tracks,
boost::shared_ptr<ARDOUR::Track>& track,
@@ -1360,7 +1360,7 @@ private:
int add_sources (std::vector<std::string> paths,
ARDOUR::SourceList& sources,
- samplepos_t& pos,
+ samplepos_t& pos,
Editing::ImportDisposition disposition,
Editing::ImportMode mode,
int target_regions,
@@ -1372,7 +1372,7 @@ private:
int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region,
uint32_t in_chans,
uint32_t out_chans,
- samplepos_t& pos,
+ samplepos_t& pos,
Editing::ImportMode mode,
boost::shared_ptr<ARDOUR::Track>& existing_track,
const std::string& new_track_name,
@@ -2179,12 +2179,12 @@ private:
ARDOUR::SnapPref gpref);
void snap_to_internal (ARDOUR::MusicSample& first,
- ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
- ARDOUR::SnapPref gpref = ARDOUR::SnapToAny_Visual,
- bool ensure_snap = false);
+ ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
+ ARDOUR::SnapPref gpref = ARDOUR::SnapToAny_Visual,
+ bool ensure_snap = false);
- samplepos_t snap_to_marker (samplepos_t presnap,
- ARDOUR::RoundMode direction = ARDOUR::RoundNearest);
+ samplepos_t snap_to_marker (samplepos_t presnap,
+ ARDOUR::RoundMode direction = ARDOUR::RoundNearest);
RhythmFerret* rhythm_ferret;
diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc
index 0ace7263e2..dd92c3c21e 100644
--- a/gtk2_ardour/editor_audio_import.cc
+++ b/gtk2_ardour/editor_audio_import.cc
@@ -316,14 +316,14 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf, samplepos_t pos)
}
void
-Editor::do_import (vector<string> paths,
- ImportDisposition disposition,
- ImportMode mode,
- SrcQuality quality,
- MidiTrackNameSource midi_track_name_source,
+Editor::do_import (vector<string> paths,
+ ImportDisposition disposition,
+ ImportMode mode,
+ SrcQuality quality,
+ MidiTrackNameSource midi_track_name_source,
MidiTempoMapDisposition smf_tempo_disposition,
- samplepos_t& pos,
- ARDOUR::PluginInfoPtr instrument)
+ samplepos_t& pos,
+ ARDOUR::PluginInfoPtr instrument)
{
boost::shared_ptr<Track> track;
vector<string> to_import;
@@ -547,7 +547,7 @@ Editor::import_sndfiles (vector<string> paths,
ImportDisposition disposition,
ImportMode mode,
SrcQuality quality,
- samplepos_t& pos,
+ samplepos_t& pos,
int target_regions,
int target_tracks,
boost::shared_ptr<Track>& track,
@@ -617,7 +617,7 @@ Editor::embed_sndfiles (vector<string> paths,
bool& check_sample_rate,
ImportDisposition disposition,
ImportMode mode,
- samplepos_t& pos,
+ samplepos_t& pos,
int target_regions,
int target_tracks,
boost::shared_ptr<Track>& track,
@@ -739,7 +739,7 @@ Editor::embed_sndfiles (vector<string> paths,
int
Editor::add_sources (vector<string> paths,
SourceList& sources,
- samplepos_t& pos,
+ samplepos_t& pos,
ImportDisposition disposition,
ImportMode mode,
int target_regions,
diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h
index c24ff32dc0..f48d3c4953 100644
--- a/gtk2_ardour/editor_drag.h
+++ b/gtk2_ardour/editor_drag.h
@@ -283,7 +283,7 @@ private:
* samplepos. used for relative snap.
*/
samplepos_t _snap_delta;
- double _snap_delta_music;
+ double _snap_delta_music;
CursorContext::Handle _cursor_ctx; ///< cursor change context
bool _constraint_pressed; ///< if the keyboard indicated constraint modifier was pressed on start_grab()
};
@@ -636,7 +636,7 @@ private:
}
MidiRegionView* _region_view;
- samplepos_t _last_pos;
+ samplepos_t _last_pos;
double _y;
};
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 8f875b88e3..9c50ea99d0 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -87,20 +87,20 @@ using Gtkmm2ext::Keyboard;
bool
Editor::mouse_sample (samplepos_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().
- */
-
- if (!within_track_canvas) {
+ /* 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().
+ */
+
+ if (!within_track_canvas) {
return false;
- }
+ }
int x, y;
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
this must toggle the actions and not call set_snap_*() directly,
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);
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);
snap_mode_action(internal_snap_mode)->set_active(true);
} else if (was_internal && !internal_editing()) {
@@ -420,19 +420,18 @@ Editor::step_mouse_mode (bool next)
void
Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type)
{
-
- /* in object/audition/timefx/gain-automation mode,
- any button press sets the selection if the object
- can be selected. this is a bit of hack, because
- we want to avoid this if the mouse operation is a
- region alignment.
-
- note: not dbl-click or triple-click
-
- 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
- to cut notes or regions.
- */
+ /* in object/audition/timefx/gain-automation mode,
+ * any button press sets the selection if the object
+ * can be selected. this is a bit of hack, because
+ * we want to avoid this if the mouse operation is a
+ * region alignment.
+ *
+ * note: not dbl-click or triple-click
+ *
+ * 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
+ * to cut notes or regions.
+ */
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) {
/* 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;
}
/* special case: allow drag of region fade in/out in object mode with join object/range enabled */
if (get_smart_mode()) {
switch (item_type) {
- case FadeInHandleItem:
- case FadeInTrimHandleItem:
- case FadeOutHandleItem:
- case FadeOutTrimHandleItem:
- eff_mouse_mode = MouseObject;
- break;
- default:
- break;
+ case FadeInHandleItem:
+ case FadeInTrimHandleItem:
+ case FadeOutHandleItem:
+ case FadeOutTrimHandleItem:
+ eff_mouse_mode = MouseObject;
+ break;
+ default:
+ break;
}
}
if (((mouse_mode != MouseObject) &&
- (mouse_mode != MouseAudition || item_type != RegionItem) &&
- (mouse_mode != MouseTimeFX || item_type != RegionItem) &&
- (mouse_mode != MouseDraw) &&
- (mouse_mode != MouseContent || item_type == RegionItem)) ||
- ((event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE) || event->button.button > 3)) {
+ (mouse_mode != MouseAudition || item_type != RegionItem) &&
+ (mouse_mode != MouseTimeFX || item_type != RegionItem) &&
+ (mouse_mode != MouseDraw) &&
+ (mouse_mode != MouseContent || item_type == RegionItem)) ||
+ ((event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE) || event->button.button > 3)) {
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 */
if ((item_type != RegionItem && event->button.button != 2)
- /* for selection of control points prior to delete (shift-right click) */
- && !(item_type == ControlPointItem && event->button.button == 3 && event->type == GDK_BUTTON_PRESS)) {
+ /* for selection of control points prior to delete (shift-right click) */
+ && !(item_type == ControlPointItem && event->button.button == 3 && event->type == GDK_BUTTON_PRESS)) {
return;
}
}
@@ -493,183 +492,183 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
}
switch (item_type) {
- case RegionItem:
- if (eff_mouse_mode == MouseDraw) {
- break;
- }
- if (press) {
- if (eff_mouse_mode != MouseRange) {
- _mouse_changed_selection = set_selected_regionview_from_click (press, op);
+ case RegionItem:
+ 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 {
- /* 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);
+ if (eff_mouse_mode != MouseRange) {
+ _mouse_changed_selection |= set_selected_regionview_from_click (press, op);
}
}
- } else {
- if (eff_mouse_mode != MouseRange) {
+ break;
+
+ case RegionViewNameHighlight:
+ case RegionViewName:
+ 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 RegionViewNameHighlight:
- case RegionViewName:
- 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;
+ break;
- case ControlPointItem:
- /* for object/track exclusivity, we don't call set_selected_track_as_side_effect (op); */
+ case ControlPointItem:
+ /* for object/track exclusivity, we don't call set_selected_track_as_side_effect (op); */
- if (eff_mouse_mode != MouseRange) {
- if (event->button.button != 3) {
- _mouse_changed_selection |= set_selected_control_point_from_click (press, op);
- } else {
- _mouse_changed_selection |= set_selected_control_point_from_click (press, Selection::Set);
+ if (eff_mouse_mode != MouseRange) {
+ if (event->button.button != 3) {
+ _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:
- if (eff_mouse_mode != MouseRange) {
- AutomationLine* argl = reinterpret_cast<AutomationLine*> (item->get_data ("line"));
+ case GainLineItem:
+ if (eff_mouse_mode != MouseRange) {
+ AutomationLine* argl = reinterpret_cast<AutomationLine*> (item->get_data ("line"));
- std::list<Selectable*> selectables;
- uint32_t before, after;
- samplecnt_t const where = (samplecnt_t) floor (event->button.x * samples_per_pixel) - clicked_regionview->region ()->position ();
+ std::list<Selectable*> selectables;
+ uint32_t before, after;
+ 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)) {
- break;
- }
+ if (!argl || !argl->control_points_adjacent (where, before, after)) {
+ break;
+ }
- selectables.push_back (argl->nth (before));
- selectables.push_back (argl->nth (after));
+ 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;
+ 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;
+ case Selection::Extend:
+ /* XXX */
+ break;
+ }
}
- }
- break;
+ break;
- case AutomationLineItem:
- 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;
+ case AutomationLineItem:
+ 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;
- al->grab_item().canvas_to_item (mx, my);
+ al->grab_item().canvas_to_item (mx, my);
- uint32_t before, after;
- samplecnt_t const where = (samplecnt_t) floor (mx * samples_per_pixel);
+ 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;
- }
+ if (!al || !al->control_points_adjacent (where, before, after)) {
+ break;
+ }
- selectables.push_back (al->nth (before));
- selectables.push_back (al->nth (after));
+ 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;
+ 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;
+ case Selection::Extend:
+ /* XXX */
+ break;
+ }
}
- }
- break;
+ break;
- case StreamItem:
- /* for context click, select track */
- if (event->button.button == 3) {
- selection->clear_tracks ();
- set_selected_track_as_side_effect (op);
+ 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;
+ /* 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 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 ();
+ 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;
+ break;
- default:
- break;
+ default:
+ break;
}
if ((!press) && _mouse_changed_selection) {
@@ -1399,21 +1398,19 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
bool
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);
- return button_bindings->activate (b, Gtkmm2ext::Bindings::Press);
+ Gtkmm2ext::MouseButton b (ev->state, ev->button);
+ return button_bindings->activate (b, Gtkmm2ext::Bindings::Press);
}
bool
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);
- return button_bindings->activate (b, Gtkmm2ext::Bindings::Release);
+ Gtkmm2ext::MouseButton b (ev->state, ev->button);
+ return button_bindings->activate (b, Gtkmm2ext::Bindings::Release);
}
bool
diff --git a/gtk2_ardour/time_fx_dialog.h b/gtk2_ardour/time_fx_dialog.h
index a069124547..015ebff580 100644
--- a/gtk2_ardour/time_fx_dialog.h
+++ b/gtk2_ardour/time_fx_dialog.h
@@ -84,19 +84,19 @@ public:
}
private:
- ARDOUR::samplecnt_t original_length;
- Gtk::Adjustment pitch_octave_adjustment;
- Gtk::Adjustment pitch_semitone_adjustment;
- Gtk::Adjustment pitch_cent_adjustment;
- Gtk::SpinButton pitch_octave_spinner;
- Gtk::SpinButton pitch_semitone_spinner;
- Gtk::SpinButton pitch_cent_spinner;
- Gtk::Adjustment duration_adjustment;
- AudioClock* duration_clock;
- bool ignore_adjustment_change;
- bool ignore_clock_change;
- sigc::connection update_connection;
- float progress;
+ ARDOUR::samplecnt_t original_length;
+ Gtk::Adjustment pitch_octave_adjustment;
+ Gtk::Adjustment pitch_semitone_adjustment;
+ Gtk::Adjustment pitch_cent_adjustment;
+ Gtk::SpinButton pitch_octave_spinner;
+ Gtk::SpinButton pitch_semitone_spinner;
+ Gtk::SpinButton pitch_cent_spinner;
+ Gtk::Adjustment duration_adjustment;
+ AudioClock* duration_clock;
+ bool ignore_adjustment_change;
+ bool ignore_clock_change;
+ sigc::connection update_connection;
+ float progress;
void update_progress_gui (float);
void duration_clock_changed ();