return _last_pointer_frame;
}
+ boost::shared_ptr<ARDOUR::Region> add_midi_region (MidiTimeAxisView*);
+
void show_verbose_cursor_time (framepos_t);
void show_verbose_cursor_duration (framepos_t, framepos_t, double xoffset = 0);
void show_verbose_cursor_text (std::string const &);
class RegionDrag;
/** Container for details about a region being dragged */
-struct DraggingView
+class DraggingView
{
+public:
DraggingView (RegionView *, RegionDrag *);
RegionView* view; ///< the view
protected:
- double compute_x_delta (GdkEvent const *, ARDOUR::framecnt_t *);
+ double compute_x_delta (GdkEvent const *, ARDOUR::framepos_t *);
bool y_movement_allowed (int, double) const;
bool _brushing;
private:
MidiTimeAxisView* _view;
boost::shared_ptr<ARDOUR::Region> _region;
- void add_region ();
};
/** Drags to resize MIDI notes */
double _cumulative_dx;
};
-/** Drag of region gain */
-class RegionGainDrag : public Drag
-{
-public:
- RegionGainDrag (Editor *, ArdourCanvas::Item *);
-
- void motion (GdkEvent *, bool);
- void finished (GdkEvent *, bool);
- bool active (Editing::MouseMode m) {
- return (m == Editing::MouseGain);
- }
-
- void aborted (bool);
-};
-
/** Drag to trim region(s) */
class TrimDrag : public RegionDrag
{
ContentsTrim,
};
- TrimDrag (Editor *, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &);
+ TrimDrag (Editor *, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, bool preserve_fade_anchor = false);
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
void motion (GdkEvent *, bool);
private:
Operation _operation;
+
+ bool _preserve_fade_anchor;
};
/** Meter marker drag */
private:
MeterMarker* _marker;
bool _copy;
+ XMLNode* before_state;
};
/** Tempo marker drag */
private:
TempoMarker* _marker;
bool _copy;
+ XMLNode* before_state;
};
void update_item (ARDOUR::Location *);
Marker* _marker; ///< marker being dragged
- std::list<ARDOUR::Location*> _copied_locations;
+
+ struct CopiedLocationMarkerInfo {
+ ARDOUR::Location* location;
+ std::vector<Marker*> markers;
+ bool move_both;
+ CopiedLocationMarkerInfo (ARDOUR::Location* l, Marker* m);
+ };
+
+ typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
+ CopiedLocationInfo _copied_locations;
ArdourCanvas::Points _points;
};
double _fixed_grab_y;
double _cumulative_x_drag;
double _cumulative_y_drag;
+ bool _pushing;
+ uint32_t _final_index;
static double _zero_gain_fraction;
};
virtual void select_things (int button_state, framepos_t x1, framepos_t x2, double y1, double y2, bool drag_in_progress) = 0;
virtual void deselect_things () = 0;
+
+ protected:
+ bool _vertical_only;
};
/** A general editor RubberbandSelectDrag (for regions, automation points etc.) */
MidiRegionView* _region_view;
};
+/** A RubberbandSelectDrag for selecting MIDI notes but with no horizonal component */
+class MidiVerticalSelectDrag : public RubberbandSelectDrag
+{
+public:
+ MidiVerticalSelectDrag (Editor *, MidiRegionView *);
+
+ void select_things (int, framepos_t, framepos_t, double, double, bool);
+ void deselect_things ();
+
+private:
+ MidiRegionView* _region_view;
+};
+
/** Region drag in time-FX mode */
class TimeFXDrag : public RegionDrag
{
CreateSelection,
SelectionStartTrim,
SelectionEndTrim,
- SelectionMove
+ SelectionMove,
+ SelectionExtend
};
SelectionDrag (Editor *, ArdourCanvas::Item *, Operation);
private:
Operation _operation;
- bool _copy;
+ bool _add;
+ bool _extend;
int _original_pointer_time_axis;
int _last_pointer_time_axis;
std::list<TimeAxisView*> _added_time_axes;
+ bool _time_selection_at_start;
+ framepos_t start_at_start;
+ framepos_t end_at_start;
};
/** Range marker drag */
bool _zoom_out;
};
-/** Drag of a range of automation data, changing value but not position */
+/** Drag of a range of automation data (either on an automation track or region gain),
+ * changing value but not position.
+ */
class AutomationRangeDrag : public Drag
{
public:
- AutomationRangeDrag (Editor *, ArdourCanvas::Item *, std::list<ARDOUR::AudioRange> const &);
+ AutomationRangeDrag (Editor *, AutomationTimeAxisView *, std::list<ARDOUR::AudioRange> const &);
+ AutomationRangeDrag (Editor *, AudioRegionView *, std::list<ARDOUR::AudioRange> const &);
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
void motion (GdkEvent *, bool);
return false;
}
+ bool active (Editing::MouseMode) {
+ return true;
+ }
+
private:
+ void setup (std::list<boost::shared_ptr<AutomationLine> > const &);
+ double y_fraction (boost::shared_ptr<AutomationLine>, double global_y_position) const;
+
std::list<ARDOUR::AudioRange> _ranges;
- AutomationTimeAxisView* _atav;
/** A line that is part of the drag */
struct Line {
std::list<ControlPoint*> points; ///< points to drag on the line
std::pair<ARDOUR::framepos_t, ARDOUR::framepos_t> range; ///< the range of all points on the line, in session frames
XMLNode* state; ///< the XML state node before the drag
+ double original_fraction; ///< initial y-fraction before the drag
};
std::list<Line> _lines;
-
+ double y_origin;
bool _nothing_to_drag;
};
+/** Drag of one edge of an xfade
+ */
+class CrossfadeEdgeDrag : public Drag
+{
+ public:
+ CrossfadeEdgeDrag (Editor*, AudioRegionView*, ArdourCanvas::Item*, bool start);
+
+ void start_grab (GdkEvent*, Gdk::Cursor* c = 0);
+ void motion (GdkEvent*, bool);
+ void finished (GdkEvent*, bool);
+ void aborted (bool);
+
+ bool y_movement_matters () const {
+ return false;
+ }
+
+ virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
+ return std::make_pair (4, 4);
+ }
+
+ private:
+ AudioRegionView* arv;
+ bool start;
+};
+
#endif /* __gtk2_ardour_editor_drag_h_ */