2 ==============================================================================
4 This file is part of the Water library.
5 Copyright (c) 2015 ROLI Ltd.
6 Copyright (C) 2017-2018 Filipe Coelho <falktx@falktx.com>
8 Permission is granted to use this software under the terms of the GNU
9 General Public License as published by the Free Software Foundation;
10 either version 2 of the License, or any later version.
12 This program is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 ==============================================================================
21 #include "AudioProcessor.h"
25 AudioProcessor::AudioProcessor()
34 currentSampleRate
= 0;
42 AudioProcessor::~AudioProcessor()
46 //==============================================================================
47 void AudioProcessor::setPlayConfigDetails (const uint newNumIns
,
48 const uint newNumOuts
,
49 const uint newNumCVIns
,
50 const uint newNumCVOuts
,
51 const uint newNumMIDIIns
,
52 const uint newNumMIDIOuts
,
53 const double newSampleRate
,
54 const int newBlockSize
)
56 numAudioIns
= newNumIns
;
57 numAudioOuts
= newNumOuts
;
58 numCVIns
= newNumCVIns
;
59 numCVOuts
= newNumCVOuts
;
60 numMIDIIns
= newNumMIDIIns
;
61 numMIDIOuts
= newNumMIDIOuts
;
62 setRateAndBufferSizeDetails (newSampleRate
, newBlockSize
);
65 void AudioProcessor::setRateAndBufferSizeDetails (double newSampleRate
, int newBlockSize
) noexcept
67 currentSampleRate
= newSampleRate
;
68 blockSize
= newBlockSize
;
71 //==============================================================================
72 void AudioProcessor::setNonRealtime (const bool newNonRealtime
) noexcept
74 nonRealtime
= newNonRealtime
;
77 void AudioProcessor::setLatencySamples (const int newLatency
)
79 if (latencySamples
!= newLatency
)
80 latencySamples
= newLatency
;
83 void AudioProcessor::suspendProcessing (const bool shouldBeSuspended
)
85 const CarlaRecursiveMutexLocker
cml (callbackLock
);
86 suspended
= shouldBeSuspended
;
89 void AudioProcessor::reset() {}
90 void AudioProcessor::reconfigure() {}
92 uint
AudioProcessor::getTotalNumInputChannels(ChannelType t
) const noexcept
96 case ChannelTypeAudio
:
100 case ChannelTypeMIDI
:
107 uint
AudioProcessor::getTotalNumOutputChannels(ChannelType t
) const noexcept
111 case ChannelTypeAudio
:
115 case ChannelTypeMIDI
:
122 const String
AudioProcessor::getInputChannelName(ChannelType t
, uint
) const
124 return t
== ChannelTypeMIDI
? "events-in" : "";
127 const String
AudioProcessor::getOutputChannelName(ChannelType t
, uint
) const
129 return t
== ChannelTypeMIDI
? "events-out" : "";