HulaLoop
Simple cross-platform audio loopback and recording.
transport.h
1 #ifndef TRANSPORT_H
2 #define TRANSPORT_H
3 
4 #include <string>
5 
9 enum TransportState {
10  RECORDING,
11  STOPPED,
12  PLAYING,
13  PAUSED
14 };
15 
19 class Transport
20 {
21  private:
22  TransportState state;
23 
24  public:
25  Transport();
26 
27  bool record();
28  bool stop();
29  bool play();
30  bool pause();
31 
32  TransportState getState() const;
33  std::string stateToStr(const TransportState state) const;
34 };
35 
36 #endif // TRANSPORT_H
Utility class for managing state of application and all audio related processes.
Definition: transport.h:19
bool play()
Playback previously recorded audio.
Definition: transport.cpp:36
bool record()
Start and handle the process of recording.
Definition: transport.cpp:16
std::string stateToStr(const TransportState state) const
Convert an enum of type TransportState to a presentable string.
Definition: transport.cpp:68
bool pause()
Enter the paused state for playback or recording.
Definition: transport.cpp:46
TransportState getState() const
Return the current state of the Transport object.
Definition: transport.cpp:58
bool stop()
Enter the stopped state for playback or recording.
Definition: transport.cpp:26
Transport()
Construct a new instance of the Transport class.
Definition: transport.cpp:8