11namespace tracktion {
inline namespace engine
25 notifyListenersOfDeletion();
35 return decibelsToVolumeFaderPosition (dbStringToDb (str));
44 volumeValue.referTo (state, IDs::volume, getUndoManager(), decibelsToVolumeFaderPosition (0.0f));
45 volParam->attachToCurrentValue (volumeValue);
48VCAPlugin::~VCAPlugin()
50 notifyListenersOfDeletion();
52 volParam->detachFromCurrentValue();
58 v.setProperty (IDs::type, xmlTypeName,
nullptr);
62const char* VCAPlugin::xmlTypeName =
"vca";
68float VCAPlugin::getSliderPos()
const
70 return volParam->getCurrentValue();
73void VCAPlugin::setVolumeDb (
float dB)
75 setSliderPos (decibelsToVolumeFaderPosition (dB));
78float VCAPlugin::getVolumeDb()
const
80 return volumeFaderPositionToDB (volParam->getCurrentValue());
83void VCAPlugin::setSliderPos (
float newV)
88void VCAPlugin::muteOrUnmute()
90 if (getVolumeDb() > -90.0f)
92 lastVolumeBeforeMute = getVolumeDb();
93 setVolumeDb (lastVolumeBeforeMute - 0.01f);
94 setVolumeDb (-100.0f);
98 if (lastVolumeBeforeMute < -100.0f)
99 lastVolumeBeforeMute = 0.0f;
101 setVolumeDb (getVolumeDb() + 0.01f);
102 setVolumeDb (lastVolumeBeforeMute);
106float VCAPlugin::updateAutomationStreamAndGetVolumeDb (TimePosition time)
108 if (isAutomationNeeded())
111 updateLastPlaybackTime();
114 return getVolumeDb();
117bool VCAPlugin::canBeMoved()
120 return ft->isSubmixFolder();
125void VCAPlugin::restorePluginStateFromValueTree (
const juce::ValueTree& v)
127 copyPropertiesToCachedValues (v, volumeValue);
129 for (
auto p : getAutomatableParameters())
130 p->updateFromAttachedValue();
static String toString(Type decibels, int decimalPlaces=2, Type minusInfinityDb=Type(defaultMinusInfinitydB), bool shouldIncludeSuffix=true, StringRef customMinusInfinityString={})
void updateParameterStreams(TimePosition)
Updates all the parameter streams to their positions at this time.
Track * getOwnerTrack() const
Returns the track if it's a track or clip plugin.
void deinitialise() override
Called after play stops to release resources.
void applyToBuffer(const PluginRenderContext &) override
Process the next block of data.
#define TRANS(stringLiteral)
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Passed into Plugins when they are being initialised, to give them useful contextual information that ...
The context passed to plugin render methods to provide it with buffers to fill.