HulaLoop
Simple cross-platform audio loopback and recording.
Device.h
1 #ifndef HL_DEVICE_H
2 #define HL_DEVICE_H
3 
4 #include <cstdint>
5 #include <string>
6 #include <vector>
7 
8 #ifdef _WIN32
9  #include <windows.h>
10 #endif
11 
12 namespace hula
13 {
19  {
20  RECORD = 1,
21  PLAYBACK = 2,
22  LOOPBACK = 4
23  };
24 
32  struct DeviceID
33  {
37  std::string linuxID = "";
38 
42  int portAudioID = -1;
43 
44  #ifdef _WIN32
45 
48  LPWSTR windowsID = nullptr;
49  #endif
50  };
51 
55  class Device {
56  private:
57  DeviceID deviceID;
58  std::string deviceName;
59 
60  DeviceType type;
61 
62  public:
63  Device(DeviceID id, std::string name, DeviceType t);
64  ~Device();
65 
66  DeviceID getID();
67 
68  std::string getName();
69 
70  DeviceType getType();
71 
72  static void deleteDevices(std::vector<Device *> devices);
73  };
74 }
75 
76 #endif // END HL_DEVICE_H
std::string linuxID
ID used by ALSA devices.
Definition: Device.h:37
Struct for the three types of device ID.
Definition: Device.h:32
Wrapper for OS specific device information.
Definition: Device.h:55
int portAudioID
ID used by PortAudio devices.
Definition: Device.h:42
Wrapper around translation functions for Qt.
Definition: Controller.h:10
DeviceType
Denotes type of Device.
Definition: Device.h:18