7 #include "qtsupport/QMessageTransceiverThread.h"
27 class MusicSheetWidget;
57 void RequestBells(quint64 bellChord,
bool localNotesOnly);
84 void MessageReceivedFromServer(
const MessageRef & msg,
const String & sessionID);
86 void NotePositionClicked(uint32 chordIdx,
int noteIdx);
87 void SeekRequested(uint32 chordIdx);
90 void StopButtonClicked() {
const uint32 topIdx = 0; SendTransportCommand(
CHOIR_COMMAND_PAUSE, &topIdx);}
91 void LoopButtonClicked();
92 void LoopMenuItemSelected();
93 void SendUpdatedMusicSheetToPlayer();
94 void SendUpdatedPlaybackStateToPlayer();
99 void UpdateHorizontalScrollBarSettings();
100 void UpdateVerticalScrollBarSettings();
101 void UserBeganDraggingTempoSlider();
102 void TempoChangeRequested(
int sliderVal);
103 void UserStoppedDraggingTempoSlider();
104 void UpdateTempoValueLabel();
105 void UpdateTempoSliderFromPlaybackState();
106 void RosterBellPositionClicked(
const zg::ZGPeerID & peerID, uint32 noteIdx);
107 void RosterWheelTurned(
int deltaY);
108 void UserRequestedStrategyChange(
int newStrategy);
109 void AutoScrollMusicSheetWidget(
int pixelsToTheRight);
117 QToolButton * CreateButton(
const QString & resourcePath,
const char * slotName,
bool isToggleButton, QBoxLayout * layout);
118 status_t UploadMusicSheet(
const MusicSheet & musicSheet);
119 void SendTransportCommand(uint32 what,
const uint32 * optSeekToChordIdx);
120 void MusicSheetUpdated();
121 void NoteAssignmentsUpdated();
122 QString GetLocalPeerNickname()
const;
123 const ZGPeerID & GetLocalPeerID()
const;
124 QString GetStrategyName(uint32 whichStrategy)
const;
125 QAction * CreateMenuItem(QMenu * menu,
const QString & label, QObject * target,
const char * slotName,
const QString & optShortcut = QString::null,
bool isCheckable =
false);
127 void ScheduleSendUpdatedMusicSheetToPlayer();
128 void ScheduleSendUpdatedPlaybackStateToPlayer();
134 QScrollBar * _horizontalScrollBar;
138 QScrollBar * _verticalScrollBar;
139 QWidget * _padRightWidget;
141 QToolButton * _clearButton;
143 QToolButton * _openButton;
144 QToolButton * _saveButton;
146 QToolButton * _deleteButton;
147 QToolButton * _insertButton;
149 QToolButton * _playButton;
150 QToolButton * _pauseButton;
151 QToolButton * _stopButton;
153 QToolButton * _loopButton;
155 QAction * _openMenuItem;
156 QAction * _saveMenuItem;
157 QAction * _clearMenuItem;
158 QAction * _deleteMenuItem;
159 QAction * _insertMenuItem;
160 QAction * _playMenuItem;
161 QAction * _pauseMenuItem;
162 QAction * _stopMenuItem;
163 QAction * _loopMenuItem;
164 QAction * _automaticMenuItem;
165 QAction * _assistedMenuItem;
166 QAction * _manualMenuItem;
167 QAction * _cloneMenuItem;
169 QComboBox * _strategyComboBox;
171 QSlider * _tempoSlider;
172 bool _userIsDraggingTempoSlider;
173 QLabel * _tempoValueLabel;
175 QToolButton * _cloneWindowButton;
179 QThread _quasimodoThread;
182 QThread _musicPlayerThread;
185 bool _sendPlaybackStateToPlayerPending;
186 bool _sendMusicSheetToPlayerPending;
This object is in charge of actually ringing the local bells (using QAudioOutput and a mixer algorith...
virtual void resizeEvent(QResizeEvent *)
Called when the ZGChoir window is resized.
This object holds the state of how the currently-in-memory Music sheet should be performed over time...
void SendPlaybackStateToPlayer(const choir::PlaybackState &newPlaybackState)
This signal is emitted when our PlaybackState changes, in order to send the new PlaybackState to the ...
void SetupTheBells()
This signal is emitted at startup to tell the Quasimodo thread to do his setup (start timers...
void LocalNoteAssignmentsChanged(quint64 localNotesChord)
This signal is emitted when the set of bells assigned to us changed, to let Quasimodo know which bell...
void DestroyTheBells()
This signal is emitted at shutdown to tell the Quasimodo thread to free his resources in preparation ...
This class contains the MUSCLE network I/O thread that has our ChoirSession inside it...
virtual void keyPressEvent(QKeyEvent *)
Called when the user presses a key while the ZGChoir has the focus.
A ZGPeerID is a 128-bit integer that uniquely represents a particular peer in a ZG system...
void RequestBells(quint64 bellChord, bool localNotesOnly)
This signal is emitted at startup to tell the Quasimodo thread to ring some bells now...
virtual ~ChoirWindow()
Destructor.
ChoirWindow()
Default constructor.
The choir namespace contains the code specific to the ZGChoir demonstration application.
void DestroyTimer()
This signal is emitted at shutdown to tell the music-player thread to free his resources in preparati...
void SendMusicSheetToPlayer(const choir::ConstMusicSheetRef &newMusicSheet)
This signal is emitted when our MusicSheet changes, in order to send the new MusicSheet to the music-...
void SetupTimer()
This signal is emitted at startup to tell the music-sheet-player thread to do his setup...
This object is in charge of reading the music sheet and telling Quasimodo when to ring the bells...
This object is the in-memory representation of a song, as a collection of notes over time...
This object specifies which peers should be playing which notes.
This is the main window of the ZGChoir application.