![]() |
HulaLoop
Simple cross-platform audio loopback and recording.
|
Commands related to any memory management required of library end-users. More...
Functions | |
| HulaRingBuffer * | hula::Controller::createBuffer (float duration) |
| Allocate and initialize a HulaRingBuffer that can be added to the OSAudio ring buffer list via Controller::addBuffer. More... | |
| HulaRingBuffer * | hula::Controller::createAndAddBuffer (float duration) |
| Allocate and initialize a HulaRingBuffer and automatically add it to the OSAudio ring buffer list. | |
| void | hula::Controller::removeBuffer (HulaRingBuffer *rb) |
| Remove a buffer from the list of buffers that receive audio data. More... | |
| std::vector< Device * > | hula::Controller::getDevices (DeviceType type) const |
| Fetch a list of devices for the given DeviceType. More... | |
| bool | hula::Controller::setActiveInputDevice (Device *device) const |
| Set the device from which audio should be captured. More... | |
| bool | hula::Controller::setActiveOutputDevice (Device *device) const |
| Set the device to which audio should be played back. More... | |
| static void | hula::Device::deleteDevices (std::vector< Device *> devices) |
| Delete all the device pointers inside the vector. | |
| hula::Device::~Device () | |
| Free any resources associated with the Device. More... | |
| hula::HulaRingBuffer::~HulaRingBuffer () | |
| Destructor for the ring buffer. More... | |
Commands related to any memory management required of library end-users.
A number of methods in the HulaLoop API return objects that must be deleted by the caller. Each of these is detailed below.
The methods fall into two groups: buffers and devices.
| HulaRingBuffer * Controller::createBuffer | ( | float | duration | ) |
Allocate and initialize a HulaRingBuffer that can be added to the OSAudio ring buffer list via Controller::addBuffer.
| std::vector< Device * > Controller::getDevices | ( | DeviceType | type | ) | const |
Fetch a list of devices for the given DeviceType.
For requests of more than one type, bitwise OR the types together and cast back to a DeviceType.
| type | DeviceType that is combination from the DeviceType enum |
| void Controller::removeBuffer | ( | HulaRingBuffer * | rb | ) |
Remove a buffer from the list of buffers that receive audio data.
The removed buffer is not deleted and must be deleted by the user.
This enables pausing retrieval when audio is not needed and re-adding the same buffer when audio data is again needed.
This is a publicly exposed wrapper for the OSAudio method.
| rb | HulaLoop ring buffer to remove from the list. |
| bool Controller::setActiveInputDevice | ( | Device * | device | ) | const |
Set the device from which audio should be captured.
This method will make a copy of the passed Device so that subsequent (and necessary) calls to Device::deleteDevices() can be used without issue.
| device | Desired input device |
| bool Controller::setActiveOutputDevice | ( | Device * | device | ) | const |
Set the device to which audio should be played back.
This method will make a copy of the passed Device so that subsequent (and necessary) calls to Device::deleteDevices() can be used without issue.
| device | - Device instance that is to be set as the active output device |
| Device::~Device | ( | ) |
Free any resources associated with the Device.
This does not typically need to be called directly. A call to Device::deleteDevices() using the vector received from Controller::getDevices() is usually more appropriate.
| HulaRingBuffer::~HulaRingBuffer | ( | ) |
Destructor for the ring buffer.
A HulaRingBuffer should only be deleted after is has been removed from the OSAudio ring buffer list using a call to Controller::removeBuffer().
1.8.13