diff options
author | Luo Jinghua <sunmoon1997@gmail.com> | 2012-04-05 15:34:15 +0800 |
---|---|---|
committer | Luo Jinghua <sunmoon1997@gmail.com> | 2012-04-05 15:34:15 +0800 |
commit | 468632ed2ad032c7c2113fa234d9cde9d0f1b748 (patch) | |
tree | e005e05be40dd6279f5d73e0dbba0cf7ac060b1a /src | |
parent | ca221fffc33e00bdc22d6909cfd4d1d67ad3c1b5 (diff) |
Added method to pause and resume the audio device
Diffstat (limited to 'src')
-rw-r--r-- | src/audiere.h | 10 | ||||
-rw-r--r-- | src/device.cpp | 8 | ||||
-rw-r--r-- | src/device.h | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/audiere.h b/src/audiere.h index 68ea96d..f53c122 100644 --- a/src/audiere.h +++ b/src/audiere.h @@ -768,6 +768,16 @@ namespace audiere { /// Clears all of the callbacks from the device. ADR_METHOD(void) clearCallbacks() = 0; + + /** + * Pause the audio device. + */ + ADR_METHOD(void) pause() = 0; + + /** + * Resume the audio device. + */ + ADR_METHOD(void) resume() = 0; }; typedef RefPtr<AudioDevice> AudioDevicePtr; diff --git a/src/device.cpp b/src/device.cpp index ec0a0d6..22c6756 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -413,6 +413,14 @@ namespace audiere { m_device->clearCallbacks(); } + void ADR_CALL pause() { + m_device->pause(); + } + + void ADR_CALL resume() { + m_device->resume(); + } + private: void run() { ADR_GUARD("ThreadedDevice::run"); diff --git a/src/device.h b/src/device.h index 71a88ac..63187e5 100644 --- a/src/device.h +++ b/src/device.h @@ -41,6 +41,8 @@ namespace audiere { void ADR_CALL registerCallback(Callback* callback); void ADR_CALL unregisterCallback(Callback* callback); void ADR_CALL clearCallbacks(); + void ADR_CALL pause() {} + void ADR_CALL resume() {} protected: void fireStopEvent(OutputStream* stream, StopEvent::Reason reason); |