neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_audio_device.hpp
Go to the documentation of this file.
1// i_audio_device.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2021 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#include <neogfx/neogfx.hpp>
21#include <chrono>
23
24#pragma once
25
26namespace neogfx
27{
28 typedef std::any audio_device_id;
29 typedef std::any audio_device_config;
30 typedef std::any audio_device_handle;
31
32 enum class audio_device_type : std::int32_t
33 {
34 Playback = 1,
35 Capture = 2,
37 Loopback = 4
38 };
39
41 {
42 public:
44 public:
45 virtual ~i_audio_device_info() = default;
46 public:
47 virtual audio_device_id id() const = 0;
48 virtual audio_device_type type() const = 0;
49 virtual i_string const& name() const = 0;
50 virtual bool is_default() const = 0;
51 public:
52 virtual i_vector<audio_data_format> const& data_formats() const = 0;
53 };
54
56
58 {
59 public:
61 public:
62 virtual ~i_audio_device() = default;
63 public:
64 virtual i_audio_device_info const& info() const = 0;
65 virtual audio_data_format const& data_format() const = 0;
66 public:
67 virtual void start() = 0;
68 virtual void stop() = 0;
69 public:
70 virtual void play(i_audio_bitstream& aBitstream, std::chrono::duration<double> const& aDuration) = 0;
71 };
72}
virtual ~i_audio_device_info()=default
virtual audio_device_id id() const =0
virtual i_string const & name() const =0
virtual i_vector< audio_data_format > const & data_formats() const =0
i_audio_device_info abstract_type
virtual audio_device_type type() const =0
virtual bool is_default() const =0
virtual void start()=0
virtual void stop()=0
i_audio_device abstract_type
virtual i_audio_device_info const & info() const =0
virtual void play(i_audio_bitstream &aBitstream, std::chrono::duration< double > const &aDuration)=0
virtual audio_data_format const & data_format() const =0
virtual ~i_audio_device()=default
std::any audio_device_config
std::any audio_device_handle
std::any audio_device_id