HulaLoop
Simple cross-platform audio loopback and recording.
Controller.h
1 #ifndef CONTROL
2 #define CONTROL
3 
4 #include "OSAudio.h"
5 #include "ICallback.h"
6 
7 #if _WIN32
8  #include "WindowsAudio.h"
9 #elif __unix__
10  // #include "LinuxAudio.h" // TODO: Remove comment once LinuxAudio is complete
11 #elif __APPLE__
12  #include "OSXAudio.h"
13 #endif
14 
15 #include <iostream>
16 
17 using byte = uint8_t;
18 
19 // TODO: Add public description of class
23 class Controller : public ICallback
24 {
25  private:
26  OSAudio* audio;
27 
28  vector<ICallback*> callbackList;
29 
30  public:
31  Controller();
32  ~Controller();
33 
36 
37  void handleData(byte* data, uint32_t size);
38 };
39 
40 #endif
A class that structures the receival of audio from the OS framework.
Definition: Controller.h:23
~Controller()
Deconstructs the current instance of the Controller class.
Definition: Controller.cpp:81
void addBufferReadyCallback(ICallback *func)
Add upper layer functions to the callback list.
Definition: Controller.cpp:50
Callback "Interface" used to add and remove to callback list.
Definition: ICallback.h:10
Controller()
Construct an instance of Controller class.
Definition: Controller.cpp:7
void removeBufferReadyCallback(ICallback *func)
Remove upper layer functions to the callback list.
Definition: Controller.cpp:66
void handleData(byte *data, uint32_t size)
Callback function that is triggered when audio is captured by OSAudio.
Definition: Controller.cpp:36
An abstract class that defines the components of the particular OS specfic classes.
Definition: OSAudio.h:21