#include "ardour/types.h"
-#include "canvas.h"
#include "editor_items.h"
namespace ARDOUR {
class StatefulDiffCommand;
}
-namespace Gnome {
- namespace Canvas {
- class CanvasNoteEvent;
- class CanvasPatchChange;
- }
-}
-
+class PatchChange;
class Editor;
class EditorCursor;
class TimeAxisView;
class MidiTimeAxisView;
class Drag;
+class NoteBase;
/** Class to manage current drags */
class DragManager
int8_t total_dy () const;
MidiRegionView* _region;
- Gnome::Canvas::CanvasNoteEvent* _primary;
+ NoteBase* _primary;
double _cumulative_dx;
double _cumulative_dy;
bool _was_selected;
framecnt_t grid_frames (framepos_t) const;
MidiRegionView* _region_view;
- ArdourCanvas::SimpleRect* _drag_rect;
+ ArdourCanvas::Rectangle* _drag_rect;
framepos_t _note[2];
};
class PatchChangeDrag : public Drag
{
public:
- PatchChangeDrag (Editor *, ArdourCanvas::CanvasPatchChange *, MidiRegionView *);
+ PatchChangeDrag (Editor *, PatchChange *, MidiRegionView *);
void motion (GdkEvent *, bool);
void finished (GdkEvent *, bool);
private:
MidiRegionView* _region_view;
- ArdourCanvas::CanvasPatchChange* _patch_change;
+ PatchChange* _patch_change;
double _cumulative_dx;
};
+#ifdef WITH_VIDEOTIMELINE
+/** Container for details about audio regions being dragged along with video */
+class AVDraggingView
+{
+public:
+ AVDraggingView (RegionView *);
+
+ RegionView* view; ///< the view
+ framepos_t initial_position; ///< initial position of the region
+};
+
+/** Drag of video offset */
+class VideoTimeLineDrag : public Drag
+ //TODO , public sigc::trackable
+{
+public:
+ VideoTimeLineDrag (Editor *e, ArdourCanvas::Item *i);
+
+ void motion (GdkEvent *, bool);
+ void finished (GdkEvent *, bool);
+ void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
+
+ bool y_movement_matters () const {
+ return false;
+ }
+
+ bool allow_vertical_autoscroll () const {
+ return false;
+ }
+
+ void aborted (bool);
+
+protected:
+ std::list<AVDraggingView> _views; ///< information about all audio that are being dragged along
+
+private:
+ ARDOUR::frameoffset_t _startdrag_video_offset;
+ ARDOUR::frameoffset_t _max_backwards_drag;
+};
+#endif
+
/** Drag to trim region(s) */
class TrimDrag : public RegionDrag
{
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;
};
void update_item (ARDOUR::Location *);
Operation _operation;
- ArdourCanvas::SimpleRect* _drag_rect;
+ ArdourCanvas::Rectangle* _drag_rect;
bool _copy;
};