gramods
OpenALCapture.hh
1 
2 #ifndef GRAMODS_SOUND_OPENALCAPTURE
3 #define GRAMODS_SOUND_OPENALCAPTURE
4 
5 // Required before gmCore/OFactory.hh for some compilers
6 #include <gmCore/io_size.hh>
7 
8 #include <gmSound/Capture.hh>
9 
10 #include <memory>
11 
12 namespace gramods {
13 namespace gmSound {
14 
20 
21 public:
22  OpenALCapture();
23  virtual ~OpenALCapture();
24 
30  void setDeviceName(std::string name);
31 
38  void setSampleRate(size_t f);
39  size_t getSampleRate() override;
40 
47  void setChannelCount(size_t n);
48  size_t getChannelCount() override;
49 
50  bool isOpen() override;
51 
52  static std::vector<std::string> getCaptureDeviceNames();
53 
54  void startCapture() override;
55  void stopCapture() override;
56  std::vector<float> getAvailableSamples() override;
57  size_t getAvailableSamplesCount() override;
58 
59  void initialize() override;
60 
61  GM_OFI_DECLARE;
62 
63 private:
64  struct Impl;
65  std::unique_ptr<Impl> _impl;
66 };
67 }
68 }
69 
70 #endif
The interface for a capture device that allow for extraction of sample data.
Definition: Capture.hh:16
The instantiation of this class will attempt to open a capture device and allow for extraction of sam...
Definition: OpenALCapture.hh:19
void setSampleRate(size_t f)
Sets the sample rate to attempt to open the capture device with.
Definition: OpenALCapture.cpp:69
void setChannelCount(size_t n)
Sets the number of channels to attempt to open for the capture device.
Definition: OpenALCapture.cpp:75
size_t getSampleRate() override
Returns the sample rate.
Definition: OpenALCapture.cpp:73
void initialize() override
Called to initialize the Object.
Definition: OpenALCapture.cpp:38
void setDeviceName(std::string name)
Sets the name of the capture device to open and capture from.
Definition: OpenALCapture.cpp:65
size_t getChannelCount() override
Sets the number of channels to attempt to open for the capture device.
Definition: OpenALCapture.cpp:105
Gramods, short for Graphics Modules, is a collection of weakly inter dependent and useful APIs for Vi...
Definition: config.hh:25
Definition: OpenALCapture.cpp:20