Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore-CLA-applies
4 : *
5 : * MuseScore Studio
6 : * Music Composition & Notation
7 : *
8 : * Copyright (C) 2025 MuseScore Limited and others
9 : *
10 : * This program is free software: you can redistribute it and/or modify
11 : * it under the terms of the GNU General Public License version 3 as
12 : * published by the Free Software Foundation.
13 : *
14 : * This program is distributed in the hope that it will be useful,
15 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : * GNU General Public License for more details.
18 : *
19 : * You should have received a copy of the GNU General Public License
20 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 : */
22 :
23 : #pragma once
24 :
25 : #include "modularity/imoduleinterface.h"
26 :
27 : #include "global/async/channel.h"
28 : #include "global/async/notification.h"
29 : #include "global/io/path.h"
30 :
31 : #include "audio/common/audiotypes.h"
32 :
33 : namespace muse::audio {
34 : class IAudioConfiguration : MODULE_GLOBAL_INTERFACE
35 : {
36 8 : INTERFACE_ID(IAudioConfiguration)
37 : public:
38 24 : virtual ~IAudioConfiguration() = default;
39 :
40 : virtual AudioEngineConfig engineConfig() const = 0;
41 :
42 : virtual std::string defaultAudioDriverName() const = 0;
43 : virtual std::string currentAudioDriverName() const = 0;
44 : virtual void setCurrentAudioDriverName(const std::string& name) = 0;
45 : virtual async::Notification currentAudioDriverChanged() const = 0;
46 :
47 : virtual std::string audioOutputDeviceId() const = 0;
48 : virtual void setAudioOutputDeviceId(const std::string& deviceId) = 0;
49 : virtual async::Notification audioOutputDeviceIdChanged() const = 0;
50 :
51 : virtual audioch_t audioChannelsCount() const = 0;
52 :
53 : virtual unsigned int driverBufferSize() const = 0; // samples
54 : virtual void setDriverBufferSize(unsigned int size) = 0;
55 : virtual async::Notification driverBufferSizeChanged() const = 0;
56 :
57 : virtual unsigned int sampleRate() const = 0;
58 : virtual void setSampleRate(unsigned int sampleRate) = 0;
59 : virtual async::Notification sampleRateChanged() const = 0;
60 :
61 : virtual OutputSpec defaultOutputSpec() const = 0;
62 : virtual OutputSpec desiredOutputSpec() const = 0;
63 :
64 : // synthesizers
65 : virtual io::paths_t soundFontDirectories() const = 0;
66 : virtual io::paths_t userSoundFontDirectories() const = 0;
67 : virtual void setUserSoundFontDirectories(const io::paths_t& paths) = 0;
68 : virtual async::Channel<io::paths_t> soundFontDirectoriesChanged() const = 0;
69 :
70 : virtual bool autoProcessOnlineSoundsInBackground() const = 0;
71 : virtual void setAutoProcessOnlineSoundsInBackground(bool value) = 0;
72 : virtual async::Channel<bool> autoProcessOnlineSoundsInBackgroundChanged() const = 0;
73 :
74 : virtual bool useSoundFontLowPassFilter() const = 0;
75 : virtual void setUseSoundFontLowPassFilter(bool value) = 0;
76 : virtual async::Channel<bool> useSoundFontLowPassFilterChanged() const = 0;
77 :
78 : virtual bool shouldMeasureInputLag() const = 0;
79 : };
80 : }
|