Line data Source code
1 : /*
2 : * Copyright (C) 2023 Sky UK
3 : *
4 : * This library is free software; you can redistribute it and/or
5 : * modify it under the terms of the GNU Lesser General Public
6 : * License as published by the Free Software Foundation;
7 : * version 2.1 of the License.
8 : *
9 : * This library is distributed in the hope that it will be useful,
10 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 : * Lesser General Public License for more details.
13 : *
14 : * You should have received a copy of the GNU Lesser General Public
15 : * License along with this library; if not, write to the Free Software
16 : * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 : */
18 :
19 : #pragma once
20 : #include <IWebAudioPlayerClient.h>
21 : #include <string>
22 :
23 : namespace firebolt::rialto::client
24 : {
25 : class WebAudioClientBackendInterface
26 : {
27 : public:
28 79 : virtual ~WebAudioClientBackendInterface() = default;
29 : virtual bool createWebAudioBackend(std::weak_ptr<IWebAudioPlayerClient> client, const std::string &audioMimeType,
30 : const uint32_t priority, std::weak_ptr<const WebAudioConfig> config) = 0;
31 : virtual void destroyWebAudioBackend() = 0;
32 :
33 : virtual bool play() = 0;
34 : virtual bool pause() = 0;
35 : virtual bool setEos() = 0;
36 : virtual bool getBufferAvailable(uint32_t &availableFrames) = 0;
37 : virtual bool getBufferDelay(uint32_t &delayFrames) = 0;
38 : virtual bool writeBuffer(const uint32_t numberOfFrames, void *data) = 0;
39 : virtual bool getDeviceInfo(uint32_t &preferredFrames, uint32_t &maximumFrames, bool &supportDeferredPlay) = 0;
40 : virtual bool setVolume(double volume) = 0;
41 : virtual bool getVolume(double &volume) = 0;
42 : };
43 : } // namespace firebolt::rialto::client
|