Planeshift
Public Types | Public Member Functions

pawsMusicWindow Class Reference

A window that shows a musical sheet and allows the player to edit it. More...

#include <pawsmusicwindow.h>

List of all members.

Public Types

enum  { UNALTERED, FLAT, NATURAL, SHARP }
enum  {
  NO_SELECTED, SIXTEENTH_BUTTON = 200, EIGHTH_BUTTON, QUARTER_BUTTON,
  HALF_BUTTON, WHOLE_BUTTON, FLAT_BUTTON = 300, NATURAL_BUTTON,
  SHARP_BUTTON
}

Public Member Functions

virtual double CalcFunction (MathEnvironment *env, const char *functionName, const double *params)
uint GetDivisions ()
 Gets the sheet's number of divisions.
void GetMeter (int &beats, int &beatType)
 Gets beats and beat type of the song.
virtual void HandleMessage (MsgEntry *message)
virtual void Hide ()
 Makes widget invisible and removes focus if widget has current focus.
virtual bool OnButtonPressed (int mouseButton, int keyModifier, pawsWidget *widget)
 Called whenever a button is pressed.
void OnChordSelection (SheetLine *sheetLine, Measure *measure, Chord *chord, int notePosition, bool before)
 Handle a click on a chord.
virtual void OnMainPlayerSongStop ()
 This is called when the main player's song is stopped.
virtual void OnMeterEntered (const char *name, csString beats, csString beatType)
 This function is called when the user input a meter.
virtual bool OnScroll (int scrollDirection, pawsScrollBar *widget)
 Called whenever a window is scrolled.
virtual void OnStringEntered (const char *name, int param, const char *value)
 When the pawsStringPromptWindow is created, a ptr to a class which implements this function is provided, and a "name" string is provided, so that a single window can use 1 callback for many fields.
 pawsMusicWindow (const pawsMusicWindow *origin)
 Copy constructor.
 pawsMusicWindow ()
 Constructor.
virtual bool PostSetup ()
 This is called after the widget and all of it's children have been created.
virtual ~pawsMusicWindow ()
 Destructor.

Detailed Description

A window that shows a musical sheet and allows the player to edit it.

Definition at line 43 of file pawsmusicwindow.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
UNALTERED 
FLAT 
NATURAL 
SHARP 

Definition at line 47 of file pawsmusicwindow.h.

anonymous enum
Enumerator:
NO_SELECTED 
SIXTEENTH_BUTTON 
EIGHTH_BUTTON 
QUARTER_BUTTON 
HALF_BUTTON 
WHOLE_BUTTON 
FLAT_BUTTON 
NATURAL_BUTTON 
SHARP_BUTTON 

Definition at line 55 of file pawsmusicwindow.h.


Constructor & Destructor Documentation

pawsMusicWindow::pawsMusicWindow ( )

Constructor.

pawsMusicWindow::pawsMusicWindow ( const pawsMusicWindow origin)

Copy constructor.

Parameters:
originthe pawsMusicWindow to copy.
virtual pawsMusicWindow::~pawsMusicWindow ( ) [virtual]

Destructor.


Member Function Documentation

virtual double pawsMusicWindow::CalcFunction ( MathEnvironment env,
const char *  functionName,
const double *  params 
) [virtual]

Reimplemented from pawsWidget.

uint pawsMusicWindow::GetDivisions ( )

Gets the sheet's number of divisions.

Returns:
the number of divisions in sixteenths.
void pawsMusicWindow::GetMeter ( int beats,
int beatType 
)

Gets beats and beat type of the song.

Parameters:
beatsa reference to the integer that will contain beats.
beatTypea reference to the integer that will contain the beat type.
virtual void pawsMusicWindow::HandleMessage ( MsgEntry message) [virtual]

Implements psClientNetSubscriber.

virtual void pawsMusicWindow::Hide ( ) [virtual]

Makes widget invisible and removes focus if widget has current focus.

Sets visible FALSE, hides border if present and then if focused when called it calls SetCurrentFocusedWidget(NULL).

Reimplemented from pawsWidget.

virtual bool pawsMusicWindow::OnButtonPressed ( int  button,
int  keyModifier,
pawsWidget widget 
) [virtual]

Called whenever a button is pressed.

Parameters:
buttonThe button pressed.
keyModifierModifier key in effect.
widgetThe widget the button belongs to.
Returns:
bool Parent's result or FALSE if no parent.

Reimplemented from pawsWidget.

void pawsMusicWindow::OnChordSelection ( SheetLine sheetLine,
Measure measure,
Chord chord,
int  notePosition,
bool  before 
)

Handle a click on a chord.

Parameters:
sheetLinethe selected line.
measurethe selected measure.
chordthe selected chord.
notePositionthe clicked note.
beforetrue if the click has happened before the selected chord, false if after.
virtual void pawsMusicWindow::OnMainPlayerSongStop ( ) [virtual]

This is called when the main player's song is stopped.

Implements iSongManagerListener.

virtual void pawsMusicWindow::OnMeterEntered ( const char *  name,
csString  beats,
csString  beatType 
) [virtual]

This function is called when the user input a meter.

Parameters:
namethe action's name.
beatsthe beats.
beatTypethe beat type.

Implements iOnMeterEnteredListener.

virtual bool pawsMusicWindow::OnScroll ( int  scrollDirection,
pawsScrollBar widget 
) [virtual]

Called whenever a window is scrolled.

Parameters:
scrollDirectionThe direction to move.
widgetThe scrollbar widget being manipulated.
Returns:
bool Parent's result or FALSE if no parent.

Reimplemented from pawsWidget.

virtual void pawsMusicWindow::OnStringEntered ( const char *  name,
int  param,
const char *  value 
) [virtual]

When the pawsStringPromptWindow is created, a ptr to a class which implements this function is provided, and a "name" string is provided, so that a single window can use 1 callback for many fields.

Implements iOnStringEnteredAction.

virtual bool pawsMusicWindow::PostSetup ( ) [virtual]

This is called after the widget and all of it's children have been created.

Remarks:
This can be useful for widgets that want to get pointers to some of it's children for quick access.

Reimplemented from pawsWidget.


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