11namespace tracktion {
inline namespace engine
14FreezePointPlugin::ScopedTrackUnsoloer::ScopedTrackUnsoloer (Edit& e) : edit (e)
20 if (t->isSolo (
false))
26 if (t->isSoloIsolate (
false))
28 soloIsolated.setBit (i);
29 t->setSoloIsolate (
false);
36FreezePointPlugin::ScopedTrackUnsoloer::~ScopedTrackUnsoloer()
46 t->setSoloIsolate (
true);
53FreezePointPlugin::ScopedTrackSoloIsolator::ScopedTrackSoloIsolator (Edit& e, Track::Array& trks)
54 : edit (e), tracks (trks)
60 if (! t->isSoloIsolate (
false))
62 notSoloIsolated.setBit (i);
63 t->setSoloIsolate (
true);
66 if (t->isMuted (
false))
76FreezePointPlugin::ScopedTrackSoloIsolator::~ScopedTrackSoloIsolator()
82 if (notSoloIsolated[i])
83 t->setSoloIsolate (
false);
93FreezePointPlugin::ScopedPluginDisabler::ScopedPluginDisabler (Track& t,
juce::Range<int> pluginsToDisable)
100 for (
auto p : track.pluginList)
101 enabled.setBit (i++, p->isEnabled());
103 enablePlugins (
false);
106FreezePointPlugin::ScopedPluginDisabler::~ScopedPluginDisabler()
108 enablePlugins (
true);
111void FreezePointPlugin::ScopedPluginDisabler::enablePlugins (
bool enable)
115 for (
auto p : track.pluginList)
117 if (indexes.contains (i))
118 p->setEnabled (enable && enabled[i]);
125FreezePointPlugin::ScopedTrackFreezer::ScopedTrackFreezer (FreezePointPlugin& o)
126 : owner (o), wasFrozen (o.isTrackFrozen())
128 if (
auto at =
dynamic_cast<AudioTrack*
> (owner.getOwnerTrack()))
129 trackID = at->itemID;
132FreezePointPlugin::ScopedTrackFreezer::~ScopedTrackFreezer()
134 if (! wasFrozen && trackID.isValid())
137 if (
auto at =
dynamic_cast<AudioTrack*
> (owner.getOwnerTrack()))
138 if (! at->isFrozen (Track::groupFreeze))
139 if (trackID != at->itemID)
140 if (at->edit.engine.getPropertyStorage().getProperty (SettingID::autoFreeze, 1))
141 at->freezeTrackAsync();
143 owner.updateTrackFreezeStatus();
148 if (
auto fp =
dynamic_cast<FreezePointPlugin*
> (p.get()))
155const char* FreezePointPlugin::xmlTypeName (
"freezePoint");
157FreezePointPlugin::FreezePointPlugin (PluginCreationInfo info) : Plugin (info)
161FreezePointPlugin::~FreezePointPlugin()
163 notifyListenersOfDeletion();
168 return createValueTree (IDs::PLUGIN,
169 IDs::type, xmlTypeName);
172void FreezePointPlugin::initialiseFully()
174 Plugin::initialiseFully();
175 updateTrackFreezeStatus();
179void FreezePointPlugin::deinitialise() {}
183void FreezePointPlugin::updateTrackFreezeStatus()
185 if (
auto at =
dynamic_cast<AudioTrack*
> (getOwnerTrack()))
187 auto newIndex = at->pluginList.indexOf (
this);
189 if (lastFreezeIndex != newIndex)
191 if (lastFreezeIndex != -1
193 && ! at->pluginList.getEdit().isLoading())
196 at->freezeTrackAsync();
199 lastFreezeIndex = newIndex;
204bool FreezePointPlugin::isTrackFrozen()
const
206 if (
auto at =
dynamic_cast<AudioTrack*
> (getOwnerTrack()))
207 return at->isFrozen (Track::individualFreeze);
212void FreezePointPlugin::freezeTrack (
bool shouldBeFrozen)
214 if (
auto at =
dynamic_cast<AudioTrack*
> (getOwnerTrack()))
216 const AudioTrack::FreezePointRemovalInhibitor inhibitor (*at);
217 at->setFrozen (shouldBeFrozen, Track::individualFreeze);
constexpr Range getIntersectionWith(Range other) const noexcept
juce::Array< Track * > getAllTracks(const Edit &edit)
Returns all the tracks in an Edit.
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.