diff options
author | Max Kellermann <max@musicpd.org> | 2018-07-16 11:46:33 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-07-16 11:46:33 +0200 |
commit | ba41690063d1ccdf5b39844e1bba3bca468ff954 (patch) | |
tree | 80e09cb21b3b0076a84698f41ccc9f4bc5f3311d /src/output | |
parent | 86a37d0ed6762a113c3a43af27e8f98bdc8443ec (diff) |
output/Interface: add method ChangeAudioFormat()
This is just the API design; there is no implementation yet, and no
caller.
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/Interface.hxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/output/Interface.hxx b/src/output/Interface.hxx index 711c04b6c..ac0a5f3f0 100644 --- a/src/output/Interface.hxx +++ b/src/output/Interface.hxx @@ -106,6 +106,28 @@ public: virtual void Close() noexcept = 0; /** + * Attempt to change the #AudioFormat. After successful + * return, the caller may invoke Play() with the new format. + * If necessary, the method should drain old data from its + * buffers. + * + * If this method fails, the caller may then attempt to + * Close() and Open() the object instead. + * + * Throws on error. After such a failure, this object is in + * an undefined state, and it must be closed. + * + * @param audio_format the audio format in which data is going + * to be delivered; may be modified by the plugin + * @return true on success, false if the operation is not + * supported/implemented (no-op and the old format may still + * be used) + */ + virtual bool ChangeAudioFormat(AudioFormat &) { + return false; + } + + /** * Returns a positive number if the output thread shall further * delay the next call to Play() or Pause(), which will happen * until this function returns 0. This should be implemented |