00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef MOVECLIPACTION_H
00023 #define MOVECLIPACTION_H
00024
00025 #include "Command.h"
00026
00027 #include <QPoint>
00028 #include <defines.h>
00029 #include "AudioClipGroup.h"
00030 #include "Marker.h"
00031
00032 class AudioClip;
00033 class Sheet;
00034 class Track;
00035 class SheetView;
00036 class ViewItem;
00037 class Zoom;
00038
00039 typedef struct {
00040 Marker* marker;
00041 TimeRef origin;
00042 } MarkerAndOrigin;
00043
00044 class MoveClip : public Command
00045 {
00046 Q_OBJECT
00047 Q_CLASSINFO("next_snap_pos", tr("To next snap position"));
00048 Q_CLASSINFO("prev_snap_pos", tr("To previous snap position"));
00049 Q_CLASSINFO("start_zoom", tr("Jog Zoom"));
00050 Q_CLASSINFO("move_up", tr("Move Up"));
00051 Q_CLASSINFO("move_down", tr("Move Down"));
00052 Q_CLASSINFO("move_left", tr("Move Left"));
00053 Q_CLASSINFO("move_right", tr("Move Right"));
00054 Q_CLASSINFO("toggle_vertical_only", tr("Toggle Vertical Only"));
00055
00056 public :
00057 MoveClip(ViewItem* view, QVariantList args);
00058 ~MoveClip();
00059
00060 int begin_hold();
00061 int finish_hold();
00062 int prepare_actions();
00063 int do_action();
00064 int undo_action();
00065 void cancel_action();
00066 int jog();
00067
00068 void set_cursor_shape(int useX, int useY);
00069
00070 private :
00071 enum ActionType {
00072 MOVE,
00073 COPY,
00074 FOLD_TRACK,
00075 FOLD_SHEET,
00076 FOLD_MARKERS,
00077 MOVE_TO_START,
00078 MOVE_TO_END
00079 };
00080
00081 Sheet* m_sheet;
00082 AudioClipGroup m_group;
00083 QList<MarkerAndOrigin> m_markers;
00084 TimeRef m_trackStartLocation;
00085 TimeRef m_posDiff;
00086 ActionType m_actionType;
00087 int m_origTrackIndex;
00088 int m_newTrackIndex;
00089
00090 struct Data {
00091 SheetView* sv;
00092 int sceneXStartPos;
00093 int pointedTrackIndex;
00094 bool verticalOnly;
00095 Zoom* zoom;
00096 };
00097
00098 Data* d;
00099
00100 void do_prev_next_snap(TimeRef trackStartLocation, TimeRef trackEndLocation);
00101 void do_move();
00102
00103 public slots:
00104 void next_snap_pos(bool autorepeat);
00105 void prev_snap_pos(bool autorepeat);
00106 void move_to_start(bool autorepeat);
00107 void move_to_end(bool autorepeat);
00108 void move_up(bool autorepeat);;
00109 void move_down(bool autorepeat);
00110 void move_left(bool autorepeat);
00111 void move_right(bool autorepeat);
00112 void start_zoom(bool autorepeat);
00113 void toggle_vertical_only(bool autorepeat);
00114 };
00115
00116 #endif