ZG  "1.00
 All Classes Namespaces Files Functions Variables Enumerator Friends Macros Pages
MusicSheetPlayer.h
Go to the documentation of this file.
1 #ifndef MusicSheetPlayer_h
2 #define MusicSheetPlayer_h
3 
4 #include <QObject>
5 
6 class QTimer;
7 
9 #include "MusicSheet.h"
10 #include "PlaybackState.h"
11 
12 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
13 Q_DECLARE_METATYPE(choir::ConstMusicSheetRef);
14 Q_DECLARE_METATYPE(choir::PlaybackState);
15 #endif
16 
17 namespace choir {
18 
23 class MusicSheetPlayer : public QObject
24 {
25 Q_OBJECT
26 
27 public:
29  MusicSheetPlayer(const INetworkTimeProvider * networkTimeProvider, QObject * parent = NULL);
30 
33 
34 signals:
36  void RequestBells(quint64 chord, bool localNotesOnly);
37 
38 public slots:
40  void SetupTimer();
41 
43  void MusicSheetUpdated(const choir::ConstMusicSheetRef & newMusicSheet);
44 
46  void PlaybackStateUpdated(const choir::PlaybackState & newPlaybackState);
47 
49  void DestroyTimer();
50 
51 private slots:
52  void Wakeup();
53 
54 private:
55  void RecalculateWakeupTime();
56 
57  const INetworkTimeProvider * _networkTimeProvider;
58 
59  ConstMusicSheetRef _musicSheet;
60  PlaybackState _playbackState;
61 
62  uint32 _nextChordIndex; // index of the next chord-position in the music sheet that we haven't played yet
63 
64  uint64 _nextWakeupTimeLocal;
65  QTimer * _wakeupTimer;
66 };
67 
68 }; // end namespace choir
69 
70 #endif
This is an abstract interface for an object that can provide us with network-clock-time values...
void DestroyTimer()
Received on shutdown.
This object holds the state of how the currently-in-memory Music sheet should be performed over time...
Definition: PlaybackState.h:9
void MusicSheetUpdated(const choir::ConstMusicSheetRef &newMusicSheet)
Received when the sheet music has changed.
~MusicSheetPlayer()
Destructor.
MusicSheetPlayer(const INetworkTimeProvider *networkTimeProvider, QObject *parent=NULL)
Constructor.
void PlaybackStateUpdated(const choir::PlaybackState &newPlaybackState)
Received when the playback state has changed.
void SetupTimer()
Received on startup.
The choir namespace contains the code specific to the ZGChoir demonstration application.
Definition: ChoirNameSpace.h:7
This object is in charge of reading the music sheet and telling Quasimodo when to ring the bells...
void RequestBells(quint64 chord, bool localNotesOnly)
Emitted when we want Quasimodo to ring a specified set of bells.