-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObserver.h
More file actions
36 lines (32 loc) · 909 Bytes
/
Observer.h
File metadata and controls
36 lines (32 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef FFT_MUSIC_VISUALISER_OBSERVER_H
#define FFT_MUSIC_VISUALISER_OBSERVER_H
#include <string>
#include <memory>
#include "../../audio/AudioPlayer.h"
/*
* Observer
* This class is used for communication between the GUI and Audio threads
*/
class Observer {
public:
Observer(std::unique_ptr<AudioPlayer> audio_player): audio_player(std::move(audio_player)) {}
/*
* Play new audio file
* This method loads a new audio file and starts playing it
* @param filename path to the audio file to be played
*/
void play(const std::string & filename);
/*
* Resume audio playback
* This method resumes the audio playback if it has been paused
*/
void resume();
/*
* Pause audio playback
* This method pauses the audio playback if it has been resumed
*/
void pause();
private:
std::unique_ptr<AudioPlayer> audio_player;
};
#endif