MoveClip Class Reference

A Command class for Dragging or Copy-dragging an AudioClip. More...

Inheritance diagram for MoveClip:

Command

List of all members.

Public Slots

void next_snap_pos (bool autorepeat)
void prev_snap_pos (bool autorepeat)
void move_to_start (bool autorepeat)
void move_to_end (bool autorepeat)
void move_up (bool autorepeat)
void move_down (bool autorepeat)
void move_left (bool autorepeat)
void move_right (bool autorepeat)
void start_zoom (bool autorepeat)
void toggle_vertical_only (bool autorepeat)

Public Member Functions

 MoveClip (ViewItem *view, QVariantList args)
int begin_hold ()
int finish_hold ()
int prepare_actions ()
int do_action ()
int undo_action ()
void cancel_action ()
int jog ()
void set_cursor_shape (int useX, int useY)

Classes

struct  Data


Detailed Description

A Command class for Dragging or Copy-dragging an AudioClip.

See also:
TraversoCommands

Constructor & Destructor Documentation

MoveClip::MoveClip ( ViewItem *  view,
QVariantList  args 
)


Member Function Documentation

int MoveClip::begin_hold (  )  [virtual]

Virtual function, only needs to be reimplemented when making a hold type of Command

In case of a 'Hold fact' type of Command, you should also retrieve
the 'old' state here to be able to restore it in undo_action()

Returns:
Return value must != -1 on success, -1 on failure

Reimplemented from Command.

References ContextPointer::on_first_input_event_scene_x().

int MoveClip::finish_hold (  )  [virtual]

Virtual function, only needs to be reimplemented when making a hold type of Command

Returns:
Return value not used right now

Reimplemented from Command.

Referenced by cancel_action().

int MoveClip::prepare_actions (  )  [virtual]

Virtual function, needs to be reimplemented for all type of Commands

Use this function to do any kind of calculation or information gathering to be able to perform the actual action in do_action()

Returns:
Return value must != -1 on success, -1 on failure

Reimplemented from Command.

int MoveClip::do_action (  )  [virtual]

Virtual function, needs to be reimplemented for all type of Commands

This function is called after the action is finished and each time the historystack 'redoes' an action.
Normally the data created in prepare_actions() will be used here to do the actuall action, which most of the case will be one or a few functions calls.

In case of a Single fact type of Command, you should also retrieve
the 'old' state here to be able to restore it in undo_action()

Reimplemented from Command.

int MoveClip::undo_action (  )  [virtual]

Virtual function, needs to be reimplemented for all type of Commands

This function is called each time the historystack 'undoes' an action,
use prepare_actions(), or in case of a hold type command begin_hold() to
store the old value(s), your command will change in do_action(), and use
those here to restore the old state.

Reimplemented from Command.

Referenced by cancel_action().

void MoveClip::cancel_action (  )  [virtual]

Cancels the action (makes only sense for hold type of actions). Reimplement to undo any changes allready made, either be it data from the core that has changed, or e.g. gui items who moved in the jog() function.

Reimplemented from Command.

References finish_hold(), and undo_action().

int MoveClip::jog (  )  [virtual]

Virtual function, only needs to be reimplemented when making a hold type of Command

This function makes it possible to create 'analog' type of actions possible.
Use the convenience functions of ContextPointer to get scene x and y coordinates
to move or adjust canvas items positions/parameters.

Returns:
Return value not used right now

Reimplemented from Command.

References Sheet::get_snap_list(), ContextPointer::get_viewport(), Sheet::is_snap_on(), ContextPointer::scene_x(), ViewPort::set_holdcursor_pos(), and ViewPort::set_holdcursor_text().

void MoveClip::set_cursor_shape ( int  useX,
int  useY 
) [virtual]

Uses the mouse hints specified in the keymap.xml file to set a cursor to hint the user which movement has to be made on hold type of commands

Reimplement if you want a different type of cursor, or want to use the more advanced HoldCursor supplied by ViewPort

Parameters:
useX If 1, suggests horizontal mouse movement
useY If 1, suggests vertical mouse movement

Reimplemented from Command.

References ContextPointer::get_viewport(), and ViewPort::set_holdcursor().


The documentation for this class was generated from the following files:

Generated on Sun Mar 8 12:44:05 2009 for traverso by  doxygen 1.5.5