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) 2021 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 <memory>
26 :
27 : #include "modularity/imoduleinterface.h"
28 :
29 : #include "audio/common/audiotypes.h"
30 : #include "ifxprocessor.h"
31 :
32 : namespace muse::audio::fx {
33 : class IFxResolver : MODULE_GLOBAL_INTERFACE
34 : {
35 0 : INTERFACE_ID(IFxResolver)
36 :
37 : public:
38 0 : virtual ~IFxResolver() = default;
39 :
40 : class IResolver
41 : {
42 : public:
43 0 : virtual ~IResolver() = default;
44 :
45 : virtual std::vector<IFxProcessorPtr> resolveFxList(const audio::TrackId trackId, const AudioFxChain& fxChain,
46 : const OutputSpec& outputSpec) = 0;
47 : virtual std::vector<IFxProcessorPtr> resolveMasterFxList(const AudioFxChain& fxChain, const OutputSpec& outputSpec) = 0;
48 : virtual AudioResourceMetaList resolveResources() const = 0;
49 :
50 : virtual void refresh() = 0;
51 : virtual void clearAllFx() = 0;
52 : };
53 : using IResolverPtr = std::shared_ptr<IResolver>;
54 :
55 : virtual std::vector<IFxProcessorPtr> resolveMasterFxList(const AudioFxChain& fxChain, const OutputSpec& outputSpec) = 0;
56 : virtual std::vector<IFxProcessorPtr> resolveFxList(const TrackId trackId, const AudioFxChain& fxChain,
57 : const OutputSpec& outputSpec) = 0;
58 : virtual AudioResourceMetaList resolveAvailableResources() const = 0;
59 :
60 : virtual void registerResolver(const AudioFxType type, IResolverPtr resolver) = 0;
61 : virtual void clearAllFx() = 0;
62 : };
63 :
64 : using IFxResolverPtr = std::shared_ptr<IFxResolver>;
65 : }
|