Jamoma API  0.6.0.a19
TTMuteSolo.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspEffectsLib
4  *
5  * @brief ##TTMutesolo mutes and soloes channels.
6  *
7  * @details If a channel is simultaneously muted and soloed, soloing takes presedence.
8  *
9  * @authors Trond Lossius
10  *
11  * @copyright Copyright © 2014, Trond Lossius @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 
17 #ifndef __TTMUTE_SOLO_H__
18 #define __TTMUTE_SOLO_H__
19 
20 #include "TTDSP.h"
21 
22 
23 /** #TTMutesolo mutes and soloes individual channels of the input audio signal.
24  @details Soloing takes presedence over muting.
25  */
26 class TTMutesolo : public TTAudioObjectBase {
28 
29 protected:
30 
31  TTBoolean mInterpolated; ///< Flag indicating whether interpolation will be applied when gain is changed.
32 
33  TTChannelCount mStoredStateNumChannels; ///< The number of channels that mute and solo states are currently stored for. This might be higher than #mMaxNumChannels.
34 
35  TTSampleVector mChannelSolo; ///< solo status for each channel. Soloing takes presedence over muting.
36 
37  TTSampleVector mChannelMute; ///< mute status for each channel
38 
39  TTSampleVector gain; ///< Gain value for each channel, depends on current settings for mute and solo
40 
41  TTSampleVector oldGain; ///< Previous gain value for each channel, used when interpolating to new settings.
42 
43 
44  /** Clear all current mute and solo settings
45  @return Returns a #TTErr error code.
46  */
47  TTErr clear();
48 
49 
50  /** Set boolean attribute determining whether linear interpolation is applied or not.
51  @param newValue The new value that the interpolate attribute is to have.
52  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
53  */
54  TTErr setInterpolated(const TTValue& newValue);
55 
56 
57  /** Update gain values in response to current mute and solo settings
58  @return Returns a #TTErr error code.
59  */
61 
62 
63  /** Set whether one of the channels is muted or not.
64  @param input Expects a #TTValue containing an array of two values: Channel number and flag indicating if it is to be muted or not.
65  @param outputNotUsed This argument is not used.
66  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
67  */
68  TTErr setChannelMute(const TTValue& aValue, TTValue&);
69 
70 
71  /** Set whether one of the channels is soloed or not.
72  @param input Expects a #TTValue containing an array of two values: Channel number and flag indicating if it is to be soloed or not.
73  @param outputNotUsed This argument is not used.
74  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
75  */
76  TTErr setChannelSolo(const TTValue& aValue, TTValue&);
77 
78 
79  /** Get current mute settings for all channels as an array.
80  @param Not used;
81  @param aMuteValue Returns mute values for all channels as an array.
82  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
83  */
84  TTErr getChannelMute(const TTValue&, TTValue& aMuteValues);
85 
86 
87  /** Get current solo settings for all channels as an array.
88  @param Not used;
89  @param aSoloValue Returns solo values for all channels as an array.
90  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
91  */
92  TTErr getChannelSolo(const TTValue&, TTValue& aSoloValues);
93 
94 
95  /** Receives notifications when there are changes to the inherited maxNumChannels attribute. This allocates memory for mute, solo and gain so that each channel's previous values are remembered.
96  @param oldMaxNumChannels The previous maximum number of channels.
97  @param outputNotUsed This argument is not used.
98  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
99  */
100  TTErr updateMaxNumChannels(const TTValue& oldMaxNumChannels, TTValue&);
101 
102 
103  /** If there is a need to store mute/solo information for a channel that is not yet tracked, the number of channels that information need to be stored for is increased.
104  @details #mStoredStateNumChannels can increase over the run of the application, but once expanded it will never decrease. This is needed in roder to be able to store the states for channels that the audio processing do not yet know of.
105  @param aDesiredChannel The channel that it is desired to store information.
106  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
107  */
109 
110 
111  /** A standard audio processing method as used by TTBlue objects. */
113 
114  /** Alternative audio processing method that might be used temporarily when mute or solo settings has been changed in order to interpolate linearly to the new gain value over one signal vector.
115  @param inputs Pointer to array of input audio signals.
116  @param outputs Pointer to array of processaed audio signals.
117  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
118  */
120 
121 
122  /** Unit testing. */
123  TTErr test(TTValue& returnedTestInfo);
124 };
125 
126 
127 #endif // __TTMUTE_SOLO_H__
TTErr getChannelSolo(const TTValue &, TTValue &aSoloValues)
Get current solo settings for all channels as an array.
Definition: TTMuteSolo.cpp:148
TTSampleVector mChannelMute
mute status for each channel
Definition: TTMuteSolo.h:37
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
TTErr increaseStoredStateNumChannels(TTChannelCount aDesiredChannel)
If there is a need to store mute/solo information for a channel that is not yet tracked, the number of channels that information need to be stored for is increased.
Definition: TTMuteSolo.cpp:167
TTMutesolo mutes and soloes individual channels of the input audio signal.
Definition: TTMuteSolo.h:26
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTErr setChannelMute(const TTValue &aValue, TTValue &)
Set whether one of the channels is muted or not.
Definition: TTMuteSolo.cpp:90
TTErr processAudioInterpolated(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Alternative audio processing method that might be used temporarily when mute or solo settings has bee...
Definition: TTMuteSolo.cpp:208
TTErr updateMaxNumChannels(const TTValue &oldMaxNumChannels, TTValue &)
Receives notifications when there are changes to the inherited maxNumChannels attribute.
Definition: TTMuteSolo.cpp:160
TTErr test(TTValue &returnedTestInfo)
Unit testing.
TTBoolean mInterpolated
Flag indicating whether interpolation will be applied when gain is changed.
Definition: TTMuteSolo.h:31
TTErr setInterpolated(const TTValue &newValue)
Set boolean attribute determining whether linear interpolation is applied or not. ...
Jamoma DSP Library.
TTChannelCount mStoredStateNumChannels
The number of channels that mute and solo states are currently stored for. This might be higher than ...
Definition: TTMuteSolo.h:33
TTErr clear()
Clear all current mute and solo settings.
Definition: TTMuteSolo.cpp:56
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
std::vector< TTSampleValue > TTSampleVector
A TTSampleVector is simply a pointer to the first of an array of TTSampleValues.
Definition: TTBase.h:233
TTErr updateGains()
Update gain values in response to current mute and solo settings.
Definition: TTMuteSolo.cpp:65
TTSampleVector gain
Gain value for each channel, depends on current settings for mute and solo.
Definition: TTMuteSolo.h:39
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
A standard audio processing method as used by TTBlue objects.
Definition: TTMuteSolo.cpp:188
TTErr getChannelMute(const TTValue &, TTValue &aMuteValues)
Get current mute settings for all channels as an array.
Definition: TTMuteSolo.cpp:136
TTUInt16 TTChannelCount
Data type used when counting the number of channels in multi-channel audio signals and processes...
Definition: TTAudioSignal.h:31
TTSampleVector mChannelSolo
solo status for each channel. Soloing takes presedence over muting.
Definition: TTMuteSolo.h:35
A simple container for an array of TTAudioSignal pointers.
TTErr setChannelSolo(const TTValue &aValue, TTValue &)
Set whether one of the channels is soloed or not.
Definition: TTMuteSolo.cpp:113
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TTSampleVector oldGain
Previous gain value for each channel, used when interpolating to new settings.
Definition: TTMuteSolo.h:41
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34