ZG  "1.00
 All Classes Namespaces Files Functions Variables Enumerator Friends Macros Pages
Public Slots | Signals | Public Member Functions | List of all members
MusicSheetWidget Class Reference

This widget displays a page of our MusicSheet. More...

#include <MusicSheetWidget.h>

Inheritance diagram for MusicSheetWidget:
Inheritance graph
[legend]

Public Slots

void SetHorizontalScrollOffset (int offsetPixels)
 Sets the horizontal-scroll-offset of this widget. More...
 

Signals

void NotePositionClicked (uint32 chordIdx, int note)
 Emitted when the user clicks on a note-position in the music sheet. More...
 
void SeekRequested (uint32 chordIdx)
 Emitted when the user clicks on the seek-row at the top of the music sheet. More...
 
void SongWidthChanged ()
 Emitted whenever the length of the song (in notes) may have changed. More...
 
void AutoScrollMusicSheetWidget (int pixelsToTheRight)
 Emitted when it's time to scroll them music sheet by a relative amount. More...
 

Public Member Functions

 MusicSheetWidget (const INetworkTimeProvider *networkTimeProvider, QWidget *parent=NULL)
 Constructor. More...
 
 ~MusicSheetWidget ()
 Destructor. More...
 
void SetMusicSheet (const ConstMusicSheetRef &musicSheetRef)
 Sets the MusicSheet object that we should consult to find out where to draw notes at. More...
 
virtual void paintEvent (QPaintEvent *)
 Called whenever it's time to redraw this MusicSheetWidget. More...
 
virtual void mousePressEvent (QMouseEvent *)
 Called whenever the user presses a mouse button down while the mouse is over this MusicSheetWidget. More...
 
virtual void mouseMoveEvent (QMouseEvent *)
 Called whenever the user moves the mouse across this MusicSheetWidget. More...
 
virtual void mouseReleaseEvent (QMouseEvent *)
 Called whenever the user releases a mouse button while the mouse is over this MusicSheetWidget. More...
 
virtual void leaveEvent (QEvent *)
 Called whenever the mouse pointer leaves the region of the screen occupied by this MusicSheetWidget. More...
 
void SetPlaybackState (const PlaybackState &newPlaybackState)
 Sets the PlaybackState that we should use to animate the red bar. More...
 
int GetSongWidthPixels () const
 Returns the total number of pixels our song should take up horizontally on screen (including a bit of extra space on the right side for appending) More...
 
int GetHorizontalScrollOffset () const
 Returns the number of pixels from the left edge of the song that we have scrolled. More...
 
void FullyAttached ()
 Should be called when we've become fully attached to the ZG system. More...
 
void SetNoteAssignments (uint64 localNotes, uint64 allAssignedNotes)
 Sets the bit-chord of notes that we are meant to play, and the bit-chord of all notes in the song. More...
 
void MoveSeekPosition (int delta)
 Called when we want to move the play-position-indicator (vertical red bar) left or right. More...
 
uint32 GetSeekPointChordIndex () const
 Returns the chord-index that the play-position-indicator (i.e. More...
 

Detailed Description

This widget displays a page of our MusicSheet.

Definition at line 15 of file MusicSheetWidget.h.

Constructor & Destructor Documentation

MusicSheetWidget ( const INetworkTimeProvider networkTimeProvider,
QWidget *  parent = NULL 
)

Constructor.

Destructor.

Member Function Documentation

void AutoScrollMusicSheetWidget ( int  pixelsToTheRight)
signal

Emitted when it's time to scroll them music sheet by a relative amount.

Parameters
pixelsToTheRightthe number of pixels to move the view to the right by. If negative, then scroll should be to the left.
void FullyAttached ( )

Should be called when we've become fully attached to the ZG system.

int GetHorizontalScrollOffset ( ) const
inline

Returns the number of pixels from the left edge of the song that we have scrolled.

Definition at line 53 of file MusicSheetWidget.h.

uint32 GetSeekPointChordIndex ( ) const
inline

Returns the chord-index that the play-position-indicator (i.e.

the vertical red line) is currently at

Definition at line 70 of file MusicSheetWidget.h.

int GetSongWidthPixels ( ) const

Returns the total number of pixels our song should take up horizontally on screen (including a bit of extra space on the right side for appending)

virtual void leaveEvent ( QEvent *  )
virtual

Called whenever the mouse pointer leaves the region of the screen occupied by this MusicSheetWidget.

virtual void mouseMoveEvent ( QMouseEvent *  )
virtual

Called whenever the user moves the mouse across this MusicSheetWidget.

virtual void mousePressEvent ( QMouseEvent *  )
virtual

Called whenever the user presses a mouse button down while the mouse is over this MusicSheetWidget.

virtual void mouseReleaseEvent ( QMouseEvent *  )
virtual

Called whenever the user releases a mouse button while the mouse is over this MusicSheetWidget.

void MoveSeekPosition ( int  delta)

Called when we want to move the play-position-indicator (vertical red bar) left or right.

Parameters
deltaThe number of note-spaces to move. Positive numbers move it right, negative numbers move it left.
void NotePositionClicked ( uint32  chordIdx,
int  note 
)
signal

Emitted when the user clicks on a note-position in the music sheet.

Parameters
chordIdxthe chord-index specifying the click's horizontal position within the score
noteThe CHOIR_NOTE_* value specifying the clicks vertical position on the staff
virtual void paintEvent ( QPaintEvent *  )
virtual

Called whenever it's time to redraw this MusicSheetWidget.

void SeekRequested ( uint32  chordIdx)
signal

Emitted when the user clicks on the seek-row at the top of the music sheet.

Parameters
chordIdxthe chord-index specifying the click's horizontal position within the score
void SetHorizontalScrollOffset ( int  offsetPixels)
slot

Sets the horizontal-scroll-offset of this widget.

All graphics will be shifted horizontally by this much.

Parameters
offsetPixelsthe new scroll-offset, in pixels.
void SetMusicSheet ( const ConstMusicSheetRef &  musicSheetRef)

Sets the MusicSheet object that we should consult to find out where to draw notes at.

void SetNoteAssignments ( uint64  localNotes,
uint64  allAssignedNotes 
)

Sets the bit-chord of notes that we are meant to play, and the bit-chord of all notes in the song.

Parameters
localNotesa bit-chord of notes that we are meant to play on this peer (i.e. to be rendered in green)
allAssignedNotesa bit-chord of all the notes that are present in the current song
void SetPlaybackState ( const PlaybackState newPlaybackState)

Sets the PlaybackState that we should use to animate the red bar.

void SongWidthChanged ( )
signal

Emitted whenever the length of the song (in notes) may have changed.


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