Gain Class Reference

Change (jog) the Gain of a Sheet, Track or AudioClip, or set to a pre-defined value. More...

Inheritance diagram for Gain:

Command

List of all members.

Public Slots

void increase_gain (bool autorepeat)
void decrease_gain (bool autorepeat)

Public Member Functions

 Gain (ContextItem *context, SheetView *sv, QVariantList args)
int begin_hold ()
int finish_hold ()
int prepare_actions ()
int do_action ()
int undo_action ()
void cancel_action ()
void set_collected_number (const QString &collected)
int jog ()
void set_cursor_shape (int useX, int useY)


Detailed Description

Change (jog) the Gain of a Sheet, Track or AudioClip, or set to a pre-defined value.

See also:
TraversoCommands

Member Function Documentation

int Gain::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::pos().

int Gain::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 Gain::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 Gain::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 Gain::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 Gain::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().

void Gain::set_collected_number ( const QString &  collected  )  [virtual]

Reimplement this function to receive the so called 'collected number' of the InputEngine

The number collection is active during Hold Actions. A Hold type of command can use it to let the user type in a numerical value, which is then parsed by the (derived) Command class to set the variable it controls, like the position of an AudioClip, or the gain value of a Track

Parameters:
collected The QString of the collected number so far. Note that it can include a . (period) and a , (comma), hence the number is supplied as a string, and not a numerical value.

Reimplemented from Command.

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

int Gain::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 ContextPointer::get_viewport(), ViewPort::set_holdcursor_pos(), ViewPort::set_holdcursor_text(), ContextPointer::x(), and ContextPointer::y().

void Gain::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