mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-11 09:31:13 +02:00
Remove wxArrays of pointers
This commit is contained in:
parent
8be1e8fdad
commit
3b32d39b54
129
src/Menus.cpp
129
src/Menus.cpp
@ -168,22 +168,21 @@ enum {
|
||||
//
|
||||
// Effects menu arrays
|
||||
//
|
||||
WX_DEFINE_ARRAY_PTR(const PluginDescriptor *, EffectPlugs);
|
||||
static int SortEffectsByName(const PluginDescriptor **a, const PluginDescriptor **b)
|
||||
static bool SortEffectsByName(const PluginDescriptor *a, const PluginDescriptor *b)
|
||||
{
|
||||
wxString akey = (*a)->GetTranslatedName();
|
||||
wxString bkey = (*b)->GetTranslatedName();
|
||||
wxString akey = a->GetTranslatedName();
|
||||
wxString bkey = b->GetTranslatedName();
|
||||
|
||||
akey += (*a)->GetPath();
|
||||
bkey += (*b)->GetPath();
|
||||
akey += a->GetPath();
|
||||
bkey += b->GetPath();
|
||||
|
||||
return akey.CmpNoCase(bkey);
|
||||
return akey.CmpNoCase(bkey) < 0;
|
||||
}
|
||||
|
||||
static int SortEffectsByPublisher(const PluginDescriptor **a, const PluginDescriptor **b)
|
||||
static bool SortEffectsByPublisher(const PluginDescriptor *a, const PluginDescriptor *b)
|
||||
{
|
||||
wxString akey = (*a)->GetTranslatedVendor();
|
||||
wxString bkey = (*b)->GetTranslatedVendor();
|
||||
wxString akey = a->GetTranslatedVendor();
|
||||
wxString bkey = b->GetTranslatedVendor();
|
||||
|
||||
if (akey.IsEmpty())
|
||||
{
|
||||
@ -194,42 +193,42 @@ static int SortEffectsByPublisher(const PluginDescriptor **a, const PluginDescri
|
||||
bkey = _("Uncategorized");
|
||||
}
|
||||
|
||||
akey += (*a)->GetTranslatedName();
|
||||
bkey += (*b)->GetTranslatedName();
|
||||
akey += a->GetTranslatedName();
|
||||
bkey += b->GetTranslatedName();
|
||||
|
||||
akey += (*a)->GetPath();
|
||||
bkey += (*b)->GetPath();
|
||||
akey += a->GetPath();
|
||||
bkey += b->GetPath();
|
||||
|
||||
return akey.CmpNoCase(bkey);
|
||||
return akey.CmpNoCase(bkey) < 0;
|
||||
}
|
||||
|
||||
static int SortEffectsByPublisherAndName(const PluginDescriptor **a, const PluginDescriptor **b)
|
||||
static bool SortEffectsByPublisherAndName(const PluginDescriptor *a, const PluginDescriptor *b)
|
||||
{
|
||||
wxString akey = (*a)->GetTranslatedVendor();
|
||||
wxString bkey = (*b)->GetTranslatedVendor();
|
||||
wxString akey = a->GetTranslatedVendor();
|
||||
wxString bkey = b->GetTranslatedVendor();
|
||||
|
||||
if ((*a)->IsEffectDefault())
|
||||
if (a->IsEffectDefault())
|
||||
{
|
||||
akey = wxEmptyString;
|
||||
}
|
||||
if ((*b)->IsEffectDefault())
|
||||
if (b->IsEffectDefault())
|
||||
{
|
||||
bkey = wxEmptyString;
|
||||
}
|
||||
|
||||
akey += (*a)->GetTranslatedName();
|
||||
bkey += (*b)->GetTranslatedName();
|
||||
akey += a->GetTranslatedName();
|
||||
bkey += b->GetTranslatedName();
|
||||
|
||||
akey += (*a)->GetPath();
|
||||
bkey += (*b)->GetPath();
|
||||
akey += a->GetPath();
|
||||
bkey += b->GetPath();
|
||||
|
||||
return akey.CmpNoCase(bkey);
|
||||
return akey.CmpNoCase(bkey) < 0;
|
||||
}
|
||||
|
||||
static int SortEffectsByTypeAndName(const PluginDescriptor **a, const PluginDescriptor **b)
|
||||
static bool SortEffectsByTypeAndName(const PluginDescriptor *a, const PluginDescriptor *b)
|
||||
{
|
||||
wxString akey = (*a)->GetTranslatedEffectFamily();
|
||||
wxString bkey = (*b)->GetTranslatedEffectFamily();
|
||||
wxString akey = a->GetTranslatedEffectFamily();
|
||||
wxString bkey = b->GetTranslatedEffectFamily();
|
||||
|
||||
if (akey.IsEmpty())
|
||||
{
|
||||
@ -240,28 +239,28 @@ static int SortEffectsByTypeAndName(const PluginDescriptor **a, const PluginDesc
|
||||
bkey = _("Uncategorized");
|
||||
}
|
||||
|
||||
if ((*a)->IsEffectDefault())
|
||||
if (a->IsEffectDefault())
|
||||
{
|
||||
akey = wxEmptyString;
|
||||
}
|
||||
if ((*b)->IsEffectDefault())
|
||||
if (b->IsEffectDefault())
|
||||
{
|
||||
bkey = wxEmptyString;
|
||||
}
|
||||
|
||||
akey += (*a)->GetTranslatedName();
|
||||
bkey += (*b)->GetTranslatedName();
|
||||
akey += a->GetTranslatedName();
|
||||
bkey += b->GetTranslatedName();
|
||||
|
||||
akey += (*a)->GetPath();
|
||||
bkey += (*b)->GetPath();
|
||||
akey += a->GetPath();
|
||||
bkey += b->GetPath();
|
||||
|
||||
return akey.CmpNoCase(bkey);
|
||||
return akey.CmpNoCase(bkey) < 0;
|
||||
}
|
||||
|
||||
static int SortEffectsByType(const PluginDescriptor **a, const PluginDescriptor **b)
|
||||
static bool SortEffectsByType(const PluginDescriptor *a, const PluginDescriptor *b)
|
||||
{
|
||||
wxString akey = (*a)->GetTranslatedEffectFamily();
|
||||
wxString bkey = (*b)->GetTranslatedEffectFamily();
|
||||
wxString akey = a->GetTranslatedEffectFamily();
|
||||
wxString bkey = b->GetTranslatedEffectFamily();
|
||||
|
||||
if (akey.IsEmpty())
|
||||
{
|
||||
@ -272,13 +271,13 @@ static int SortEffectsByType(const PluginDescriptor **a, const PluginDescriptor
|
||||
bkey = _("Uncategorized");
|
||||
}
|
||||
|
||||
akey += (*a)->GetTranslatedName();
|
||||
bkey += (*b)->GetTranslatedName();
|
||||
akey += a->GetTranslatedName();
|
||||
bkey += b->GetTranslatedName();
|
||||
|
||||
akey += (*a)->GetPath();
|
||||
bkey += (*b)->GetPath();
|
||||
akey += a->GetPath();
|
||||
bkey += b->GetPath();
|
||||
|
||||
return akey.CmpNoCase(bkey);
|
||||
return akey.CmpNoCase(bkey) < 0;
|
||||
}
|
||||
|
||||
/// CreateMenusAndCommands builds the menus, and also rebuilds them after
|
||||
@ -1633,8 +1632,8 @@ void AudacityProject::PopulateEffectsMenu(CommandManager* c,
|
||||
{
|
||||
PluginManager & pm = PluginManager::Get();
|
||||
|
||||
EffectPlugs defplugs;
|
||||
EffectPlugs optplugs;
|
||||
std::vector<const PluginDescriptor*> defplugs;
|
||||
std::vector<const PluginDescriptor*> optplugs;
|
||||
|
||||
const PluginDescriptor *plug = pm.GetFirstPluginForEffectType(type);
|
||||
while (plug)
|
||||
@ -1649,11 +1648,11 @@ void AudacityProject::PopulateEffectsMenu(CommandManager* c,
|
||||
#endif
|
||||
)
|
||||
{
|
||||
defplugs.Add(plug);
|
||||
defplugs.push_back(plug);
|
||||
}
|
||||
else
|
||||
{
|
||||
optplugs.Add(plug);
|
||||
optplugs.push_back(plug);
|
||||
}
|
||||
plug = pm.GetNextPluginForEffectType(type);
|
||||
}
|
||||
@ -1662,38 +1661,38 @@ void AudacityProject::PopulateEffectsMenu(CommandManager* c,
|
||||
|
||||
if (groupby == wxT("sortby:name"))
|
||||
{
|
||||
defplugs.Sort(SortEffectsByName);
|
||||
optplugs.Sort(SortEffectsByName);
|
||||
std::sort(defplugs.begin(), defplugs.end(), SortEffectsByName);
|
||||
std::sort(optplugs.begin(), optplugs.end(), SortEffectsByName);
|
||||
}
|
||||
else if (groupby == wxT("sortby:publisher:name"))
|
||||
{
|
||||
defplugs.Sort(SortEffectsByName);
|
||||
optplugs.Sort(SortEffectsByPublisherAndName);
|
||||
std::sort(defplugs.begin(), defplugs.end(), SortEffectsByName);
|
||||
std::sort(optplugs.begin(), optplugs.end(), SortEffectsByPublisherAndName);
|
||||
}
|
||||
else if (groupby == wxT("sortby:type:name"))
|
||||
{
|
||||
defplugs.Sort(SortEffectsByName);
|
||||
optplugs.Sort(SortEffectsByTypeAndName);
|
||||
std::sort(defplugs.begin(), defplugs.end(), SortEffectsByName);
|
||||
std::sort(optplugs.begin(), optplugs.end(), SortEffectsByTypeAndName);
|
||||
}
|
||||
else if (groupby == wxT("groupby:publisher"))
|
||||
{
|
||||
defplugs.Sort(SortEffectsByPublisher);
|
||||
optplugs.Sort(SortEffectsByPublisher);
|
||||
std::sort(defplugs.begin(), defplugs.end(), SortEffectsByPublisher);
|
||||
std::sort(optplugs.begin(), optplugs.end(), SortEffectsByPublisher);
|
||||
}
|
||||
else if (groupby == wxT("groupby:type"))
|
||||
{
|
||||
defplugs.Sort(SortEffectsByType);
|
||||
optplugs.Sort(SortEffectsByType);
|
||||
std::sort(defplugs.begin(), defplugs.end(), SortEffectsByType);
|
||||
std::sort(optplugs.begin(), optplugs.end(), SortEffectsByType);
|
||||
}
|
||||
else // name
|
||||
{
|
||||
defplugs.Sort(SortEffectsByName);
|
||||
optplugs.Sort(SortEffectsByName);
|
||||
std::sort(defplugs.begin(), defplugs.end(), SortEffectsByName);
|
||||
std::sort(optplugs.begin(), optplugs.end(), SortEffectsByName);
|
||||
}
|
||||
|
||||
AddEffectMenuItems(c, defplugs, batchflags, realflags, true);
|
||||
|
||||
if (defplugs.GetCount() && optplugs.GetCount())
|
||||
if (defplugs.size() && optplugs.size())
|
||||
{
|
||||
c->AddSeparator();
|
||||
}
|
||||
@ -1704,12 +1703,12 @@ void AudacityProject::PopulateEffectsMenu(CommandManager* c,
|
||||
}
|
||||
|
||||
void AudacityProject::AddEffectMenuItems(CommandManager *c,
|
||||
EffectPlugs & plugs,
|
||||
CommandFlag batchflags,
|
||||
CommandFlag realflags,
|
||||
bool isDefault)
|
||||
std::vector<const PluginDescriptor*> & plugs,
|
||||
CommandFlag batchflags,
|
||||
CommandFlag realflags,
|
||||
bool isDefault)
|
||||
{
|
||||
size_t pluginCnt = plugs.GetCount();
|
||||
size_t pluginCnt = plugs.size();
|
||||
|
||||
wxString groupBy = gPrefs->Read(wxT("/Effects/GroupBy"), wxT("name"));
|
||||
|
||||
|
@ -26,7 +26,8 @@ void CreateMenusAndCommands();
|
||||
|
||||
void PopulateEffectsMenu(CommandManager *c, EffectType type,
|
||||
CommandFlag batchflags, CommandFlag realflags);
|
||||
void AddEffectMenuItems(CommandManager *c, EffectPlugs & plugs,
|
||||
void AddEffectMenuItems(CommandManager *c,
|
||||
std::vector<const PluginDescriptor*> & plugs,
|
||||
CommandFlag batchflags, CommandFlag realflags, bool isDefault);
|
||||
void AddEffectMenuItemGroup(CommandManager *c, const wxArrayString & names,
|
||||
const PluginIDList & plugs,
|
||||
|
@ -974,7 +974,7 @@ void MixerBoard::UpdateTrackClusters()
|
||||
this->CreateMuteSoloImages();
|
||||
|
||||
const int nClusterHeight = mScrolledWindow->GetClientSize().GetHeight() - kDoubleInset;
|
||||
size_t nClusterCount = mMixerTrackClusters.GetCount();
|
||||
size_t nClusterCount = mMixerTrackClusters.size();
|
||||
unsigned int nClusterIndex = 0;
|
||||
TrackListIterator iterTracks(mTracks);
|
||||
MixerTrackCluster* pMixerTrackCluster = NULL;
|
||||
@ -1010,7 +1010,7 @@ void MixerBoard::UpdateTrackClusters()
|
||||
spTrack,
|
||||
clusterPos, clusterSize);
|
||||
if (pMixerTrackCluster)
|
||||
mMixerTrackClusters.Add(pMixerTrackCluster);
|
||||
mMixerTrackClusters.push_back(pMixerTrackCluster);
|
||||
}
|
||||
nClusterIndex++;
|
||||
}
|
||||
@ -1038,7 +1038,7 @@ int MixerBoard::GetTrackClustersWidth()
|
||||
{
|
||||
return
|
||||
kInset + // extra margin at left for first one
|
||||
(mMixerTrackClusters.GetCount() * // number of tracks times
|
||||
(mMixerTrackClusters.size() * // number of tracks times
|
||||
(kInset + kMixerTrackClusterWidth)) + // left margin and width for each
|
||||
kDoubleInset; // plus final right margin
|
||||
}
|
||||
@ -1066,7 +1066,7 @@ void MixerBoard::MoveTrackCluster(const PlayableTrack* pTrack,
|
||||
}
|
||||
else
|
||||
{ // Move it down (right).
|
||||
if (((unsigned int)nIndex + 1) >= mMixerTrackClusters.GetCount())
|
||||
if (((unsigned int)nIndex + 1) >= mMixerTrackClusters.size())
|
||||
return; // It's already last.
|
||||
|
||||
pos = pMixerTrackCluster->GetPosition();
|
||||
@ -1093,13 +1093,13 @@ void MixerBoard::RemoveTrackCluster(const PlayableTrack* pTrack)
|
||||
void MixerBoard::RemoveTrackCluster(size_t nIndex)
|
||||
{
|
||||
auto pMixerTrackCluster = mMixerTrackClusters[nIndex];
|
||||
mMixerTrackClusters.RemoveAt(nIndex);
|
||||
mMixerTrackClusters.erase(mMixerTrackClusters.begin() + nIndex);
|
||||
pMixerTrackCluster->Destroy(); // DELETE is unsafe on wxWindow.
|
||||
|
||||
// Close the gap, if any.
|
||||
wxPoint pos;
|
||||
int targetX;
|
||||
for (unsigned int i = nIndex; i < mMixerTrackClusters.GetCount(); i++)
|
||||
for (unsigned int i = nIndex; i < mMixerTrackClusters.size(); i++)
|
||||
{
|
||||
pos = mMixerTrackClusters[i]->GetPosition();
|
||||
targetX =
|
||||
@ -1180,13 +1180,13 @@ void MixerBoard::RefreshTrackCluster(const PlayableTrack* pTrack, bool bEraseBac
|
||||
|
||||
void MixerBoard::RefreshTrackClusters(bool bEraseBackground /*= true*/)
|
||||
{
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.size(); i++)
|
||||
mMixerTrackClusters[i]->Refresh(bEraseBackground);
|
||||
}
|
||||
|
||||
void MixerBoard::ResizeTrackClusters()
|
||||
{
|
||||
for (unsigned int nClusterIndex = 0; nClusterIndex < mMixerTrackClusters.GetCount(); nClusterIndex++)
|
||||
for (unsigned int nClusterIndex = 0; nClusterIndex < mMixerTrackClusters.size(); nClusterIndex++)
|
||||
mMixerTrackClusters[nClusterIndex]->HandleResize();
|
||||
}
|
||||
|
||||
@ -1197,7 +1197,7 @@ void MixerBoard::ResetMeters(const bool bResetClipping)
|
||||
if (!this->IsShown())
|
||||
return;
|
||||
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.size(); i++)
|
||||
mMixerTrackClusters[i]->ResetMeter(bResetClipping);
|
||||
}
|
||||
|
||||
@ -1213,7 +1213,7 @@ void MixerBoard::UpdateMute(const PlayableTrack* pTrack /*= NULL*/) // NULL mean
|
||||
{
|
||||
if (pTrack == NULL)
|
||||
{
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.size(); i++)
|
||||
mMixerTrackClusters[i]->UpdateMute();
|
||||
}
|
||||
else
|
||||
@ -1229,7 +1229,7 @@ void MixerBoard::UpdateSolo(const PlayableTrack* pTrack /*= NULL*/) // NULL mean
|
||||
{
|
||||
if (pTrack == NULL)
|
||||
{
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.size(); i++)
|
||||
mMixerTrackClusters[i]->UpdateSolo();
|
||||
}
|
||||
else
|
||||
@ -1245,7 +1245,7 @@ void MixerBoard::UpdatePan(const PlayableTrack* pTrack)
|
||||
{
|
||||
if (pTrack == NULL)
|
||||
{
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.size(); i++)
|
||||
mMixerTrackClusters[i]->UpdatePan();
|
||||
}
|
||||
else
|
||||
@ -1296,7 +1296,7 @@ void MixerBoard::UpdateMeters(const double t1, const bool bLoopedPlay)
|
||||
return;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.size(); i++)
|
||||
mMixerTrackClusters[i]->UpdateMeter(mPrevT1, t1);
|
||||
|
||||
mPrevT1 = t1;
|
||||
@ -1391,7 +1391,7 @@ int MixerBoard::FindMixerTrackCluster(const PlayableTrack* pTrack,
|
||||
MixerTrackCluster** hMixerTrackCluster) const
|
||||
{
|
||||
*hMixerTrackCluster = NULL;
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
|
||||
for (unsigned int i = 0; i < mMixerTrackClusters.size(); i++)
|
||||
{
|
||||
if (mMixerTrackClusters[i]->mTrack.get() == pTrack)
|
||||
{
|
||||
|
@ -152,8 +152,6 @@ public:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
WX_DEFINE_ARRAY(MixerTrackCluster*, MixerTrackClusterArray);
|
||||
|
||||
|
||||
class MusicalInstrument
|
||||
{
|
||||
@ -265,7 +263,7 @@ public:
|
||||
|
||||
private:
|
||||
// Track clusters are maintained in the same order as the WaveTracks.
|
||||
MixerTrackClusterArray mMixerTrackClusters;
|
||||
std::vector<MixerTrackCluster*> mMixerTrackClusters;
|
||||
|
||||
MusicalInstrumentArray mMusicalInstruments;
|
||||
AudacityProject* mProject;
|
||||
|
@ -377,11 +377,9 @@ enum
|
||||
STATE_COUNT
|
||||
};
|
||||
|
||||
WX_DEFINE_ARRAY(PluginDescriptor *, DescriptorArray);
|
||||
|
||||
struct ItemData
|
||||
{
|
||||
DescriptorArray plugs;
|
||||
std::vector<PluginDescriptor*> plugs;
|
||||
wxString name;
|
||||
wxString path;
|
||||
int state;
|
||||
@ -612,7 +610,7 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S)
|
||||
|
||||
const wxString &path = plug.GetPath();
|
||||
ItemData & item = mItems[path]; // will create NEW entry
|
||||
item.plugs.Add(&plug);
|
||||
item.plugs.push_back(&plug);
|
||||
item.path = path;
|
||||
item.state = plug.IsEnabled() ? STATE_Enabled : STATE_Disabled;
|
||||
item.valid = plug.IsValid();
|
||||
@ -981,13 +979,13 @@ void PluginRegistrationDialog::OnOK(wxCommandEvent & WXUNUSED(evt))
|
||||
wxString errMsgs;
|
||||
|
||||
// Try to register the plugin via each provider until one succeeds
|
||||
for (size_t j = 0, cnt = item.plugs.GetCount(); j < cnt; j++)
|
||||
for (size_t j = 0, cnt = item.plugs.size(); j < cnt; j++)
|
||||
{
|
||||
wxString errMsg;
|
||||
if (mm.RegisterPlugin(item.plugs[j]->GetProviderID(), path,
|
||||
errMsg))
|
||||
{
|
||||
for (size_t j = 0, cnt = item.plugs.GetCount(); j < cnt; j++)
|
||||
for (size_t j = 0, cnt = item.plugs.size(); j < cnt; j++)
|
||||
{
|
||||
pm.mPlugins.erase(item.plugs[j]->GetProviderID() + wxT("_") + path);
|
||||
}
|
||||
@ -1008,14 +1006,14 @@ void PluginRegistrationDialog::OnOK(wxCommandEvent & WXUNUSED(evt))
|
||||
}
|
||||
else if (item.state == STATE_New)
|
||||
{
|
||||
for (size_t j = 0, cnt = item.plugs.GetCount(); j < cnt; j++)
|
||||
for (size_t j = 0, cnt = item.plugs.size(); j < cnt; j++)
|
||||
{
|
||||
item.plugs[j]->SetValid(false);
|
||||
}
|
||||
}
|
||||
else if (item.state != STATE_New)
|
||||
{
|
||||
for (size_t j = 0, cnt = item.plugs.GetCount(); j < cnt; j++)
|
||||
for (size_t j = 0, cnt = item.plugs.size(); j < cnt; j++)
|
||||
{
|
||||
item.plugs[j]->SetEnabled(item.state == STATE_Enabled);
|
||||
item.plugs[j]->SetValid(item.valid);
|
||||
|
@ -63,7 +63,6 @@ class ODLock;
|
||||
class RecordingRecoveryHandler;
|
||||
class TrackList;
|
||||
class Tags;
|
||||
class EffectPlugs;
|
||||
|
||||
class TrackPanel;
|
||||
class FreqWindow;
|
||||
@ -121,8 +120,6 @@ using AProjectArray = std::vector< AProjectHolder >;
|
||||
extern AProjectArray gAudacityProjects;
|
||||
|
||||
|
||||
WX_DEFINE_ARRAY(wxMenu *, MenuArray);
|
||||
|
||||
enum class PlayMode : int {
|
||||
normalPlay,
|
||||
oneSecondPlay, // Disables auto-scrolling
|
||||
|
@ -980,18 +980,18 @@ bool LadspaEffect::RealtimeAddProcessor(unsigned WXUNUSED(numChannels), float sa
|
||||
return false;
|
||||
}
|
||||
|
||||
mSlaves.Add(slave);
|
||||
mSlaves.push_back(slave);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LadspaEffect::RealtimeFinalize()
|
||||
{
|
||||
for (size_t i = 0, cnt = mSlaves.GetCount(); i < cnt; i++)
|
||||
for (size_t i = 0, cnt = mSlaves.size(); i < cnt; i++)
|
||||
{
|
||||
FreeInstance(mSlaves[i]);
|
||||
}
|
||||
mSlaves.Clear();
|
||||
mSlaves.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -34,8 +34,6 @@ class wxCheckBox;
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
WX_DEFINE_ARRAY_PTR(LADSPA_Handle, LadspaSlaveArray);
|
||||
|
||||
class LadspaEffectMeter;
|
||||
|
||||
class LadspaEffect final : public wxEvtHandler,
|
||||
@ -179,7 +177,7 @@ private:
|
||||
bool mLatencyDone;
|
||||
|
||||
// Realtime processing
|
||||
LadspaSlaveArray mSlaves;
|
||||
std::vector<LADSPA_Handle> mSlaves;
|
||||
|
||||
EffectUIHostInterface *mUIHost;
|
||||
|
||||
|
@ -700,7 +700,7 @@ void LV2Effect::SetSampleRate(double rate)
|
||||
mOptionsInterface->set(lilv_instance_get_handle(mMaster), options);
|
||||
}
|
||||
|
||||
for (size_t i = 0, cnt = mSlaves.GetCount(); i < cnt; i++)
|
||||
for (size_t i = 0, cnt = mSlaves.size(); i < cnt; i++)
|
||||
{
|
||||
mOptionsInterface->set(lilv_instance_get_handle(mSlaves[i]), options);
|
||||
}
|
||||
@ -722,7 +722,7 @@ size_t LV2Effect::SetBlockSize(size_t maxBlockSize)
|
||||
mOptionsInterface->set(lilv_instance_get_handle(mMaster), options);
|
||||
}
|
||||
|
||||
for (size_t i = 0, cnt = mSlaves.GetCount(); i < cnt; i++)
|
||||
for (size_t i = 0, cnt = mSlaves.size(); i < cnt; i++)
|
||||
{
|
||||
mOptionsInterface->set(lilv_instance_get_handle(mSlaves[i]), options);
|
||||
}
|
||||
@ -814,13 +814,13 @@ bool LV2Effect::RealtimeInitialize()
|
||||
|
||||
bool LV2Effect::RealtimeFinalize()
|
||||
{
|
||||
for (size_t i = 0, cnt = mSlaves.GetCount(); i < cnt; i++)
|
||||
for (size_t i = 0, cnt = mSlaves.size(); i < cnt; i++)
|
||||
{
|
||||
lilv_instance_deactivate(mSlaves[i]);
|
||||
|
||||
FreeInstance(mSlaves[i]);
|
||||
}
|
||||
mSlaves.Clear();
|
||||
mSlaves.clear();
|
||||
|
||||
lilv_instance_deactivate(mMaster);
|
||||
|
||||
@ -856,10 +856,10 @@ size_t LV2Effect::RealtimeProcess(int group,
|
||||
float **outbuf,
|
||||
size_t numSamples)
|
||||
{
|
||||
wxASSERT(group >= 0 && group < (int) mSlaves.GetCount());
|
||||
wxASSERT(group >= 0 && group < (int) mSlaves.size());
|
||||
wxASSERT(numSamples <= mBlockSize);
|
||||
|
||||
if (group < 0 || group >= (int) mSlaves.GetCount())
|
||||
if (group < 0 || group >= (int) mSlaves.size())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -900,7 +900,7 @@ bool LV2Effect::RealtimeAddProcessor(unsigned WXUNUSED(numChannels), float sampl
|
||||
|
||||
lilv_instance_activate(slave);
|
||||
|
||||
mSlaves.Add(slave);
|
||||
mSlaves.push_back(slave);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -96,7 +96,6 @@ public:
|
||||
};
|
||||
|
||||
using LV2GroupMap = std::unordered_map<wxString, std::vector<int>>;
|
||||
WX_DEFINE_ARRAY_PTR(LilvInstance *, LV2SlaveArray);
|
||||
|
||||
class LV2EffectSettingsDialog;
|
||||
|
||||
@ -281,7 +280,7 @@ private:
|
||||
|
||||
LilvInstance *mMaster;
|
||||
LilvInstance *mProcess;
|
||||
LV2SlaveArray mSlaves;
|
||||
std::vector<LilvInstance*> mSlaves;
|
||||
|
||||
FloatBuffers mMasterIn, mMasterOut;
|
||||
size_t mNumSamples;
|
||||
|
@ -213,20 +213,20 @@ void Importer::ReadImportItems()
|
||||
{
|
||||
if (importPlugin->GetPluginStringID().Cmp(new_item->filters[i]) == 0)
|
||||
{
|
||||
new_item->filter_objects.Add (importPlugin.get());
|
||||
new_item->filter_objects.push_back(importPlugin.get());
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* IDs that do not have corresponding filters, will be shown as-is */
|
||||
if (!found)
|
||||
new_item->filter_objects.Add (NULL);
|
||||
new_item->filter_objects.push_back(nullptr);
|
||||
}
|
||||
/* Find all filter objects that are not present in the filter list */
|
||||
for (const auto &importPlugin : mImportPluginList)
|
||||
{
|
||||
bool found = false;
|
||||
for (size_t i = 0; i < new_item->filter_objects.Count(); i++)
|
||||
for (size_t i = 0; i < new_item->filter_objects.size(); i++)
|
||||
{
|
||||
if (importPlugin.get() == new_item->filter_objects[i])
|
||||
{
|
||||
@ -241,7 +241,8 @@ void Importer::ReadImportItems()
|
||||
if (new_item->divider < 0)
|
||||
index = new_item->filters.Count();
|
||||
new_item->filters.Insert(importPlugin->GetPluginStringID(),index);
|
||||
new_item->filter_objects.Insert (importPlugin.get(), index);
|
||||
new_item->filter_objects.insert(
|
||||
new_item->filter_objects.begin() + index, importPlugin.get());
|
||||
if (new_item->divider >= 0)
|
||||
new_item->divider++;
|
||||
}
|
||||
@ -320,7 +321,7 @@ movable_ptr<ExtImportItem> Importer::CreateDefaultImportItem()
|
||||
for (const auto &importPlugin : mImportPluginList)
|
||||
{
|
||||
new_item->filters.Add (importPlugin->GetPluginStringID());
|
||||
new_item->filter_objects.Add (importPlugin.get());
|
||||
new_item->filter_objects.push_back(importPlugin.get());
|
||||
}
|
||||
new_item->divider = -1;
|
||||
return new_item;
|
||||
@ -435,7 +436,7 @@ bool Importer::Import(const wxString &fName,
|
||||
if (matches_ext && matches_mime)
|
||||
{
|
||||
wxLogDebug(wxT("Complete match!"));
|
||||
for (size_t j = 0; j < item->filter_objects.Count() && (item->divider < 0 || (int) j < item->divider); j++)
|
||||
for (size_t j = 0; j < item->filter_objects.size() && (item->divider < 0 || (int) j < item->divider); j++)
|
||||
{
|
||||
// the filter_object can be NULL if a suitable importer was not found
|
||||
// this happens when we recompile with --without-ffmpeg and there
|
||||
|
@ -44,7 +44,6 @@ public:
|
||||
class ExtImportItem;
|
||||
|
||||
using FormatList = std::vector<Format> ;
|
||||
WX_DEFINE_ARRAY_PTR(ImportPlugin *, ImportPluginPtrArray);
|
||||
using ExtImportItems = std::vector< movable_ptr<ExtImportItem> >;
|
||||
|
||||
class ExtImportItem
|
||||
@ -71,7 +70,7 @@ class ExtImportItem
|
||||
/**
|
||||
* Array of pointers to import plugins (members of FormatList)
|
||||
*/
|
||||
ImportPluginPtrArray filter_objects;
|
||||
std::vector<ImportPlugin*> filter_objects;
|
||||
|
||||
/**
|
||||
* File extensions. Each one is a string with simple wildcards,
|
||||
|
@ -298,13 +298,13 @@ bool ExtImportPrefs::DoOnPluginKeyDown (int code)
|
||||
PluginList->SetItemState (itemIndex, 0, wxLIST_STATE_SELECTED);
|
||||
PluginList->SetItemState (itemIndex2, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
|
||||
}
|
||||
int fcount = item->filter_objects.Count();
|
||||
int fcount = item->filter_objects.size();
|
||||
if (item->divider >= fcount)
|
||||
{
|
||||
item->divider = -1;
|
||||
}
|
||||
if (item->divider < -1)
|
||||
item->divider = item->filter_objects.Count() - 1;
|
||||
item->divider = item->filter_objects.size() - 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ enum {
|
||||
class ToolBarArrangement
|
||||
{
|
||||
public:
|
||||
ExpandingToolBarArray childArray;
|
||||
std::vector<ExpandingToolBar*> childArray;
|
||||
std::vector<wxRect> rectArray;
|
||||
std::vector<int> rowArray;
|
||||
};
|
||||
@ -864,7 +864,7 @@ void ToolBarArea::ContractRow(int rowIndex)
|
||||
int i;
|
||||
int x = 0;
|
||||
|
||||
for(i=0; i<(int)mChildArray.GetCount(); i++)
|
||||
for(i = 0; i < (int)mChildArray.size(); i++)
|
||||
if (mRowArray[i] == rowIndex) {
|
||||
wxPoint childPos = mChildArray[i]->GetPosition();
|
||||
wxSize childMin = mChildArray[i]->GetMinSize();
|
||||
@ -890,7 +890,7 @@ bool ToolBarArea::ExpandRow(int rowIndex)
|
||||
int expandableCount = 0;
|
||||
int toolbarCount = 0;
|
||||
|
||||
for(i=0; i<(int)mChildArray.GetCount(); i++)
|
||||
for(i = 0; i < (int)mChildArray.size(); i++)
|
||||
if (mRowArray[i] == rowIndex) {
|
||||
ExpandingToolBar *child = mChildArray[i];
|
||||
wxSize childMin = child->GetMinSize();
|
||||
@ -914,7 +914,7 @@ bool ToolBarArea::ExpandRow(int rowIndex)
|
||||
|
||||
j = 0;
|
||||
x = 0;
|
||||
for(i=0; i<(int)mChildArray.GetCount(); i++)
|
||||
for(i = 0; i < (int)mChildArray.size(); i++)
|
||||
if (mRowArray[i] == rowIndex) {
|
||||
ExpandingToolBar *child = mChildArray[i];
|
||||
wxPoint childPos = child->GetPosition();
|
||||
@ -1017,10 +1017,10 @@ bool ToolBarArea::Layout()
|
||||
|
||||
int i;
|
||||
|
||||
for(i=0; i<(int)mChildArray.GetCount(); i++)
|
||||
for(i = 0; i < (int)mChildArray.size(); i++)
|
||||
mRowArray[i] = -1;
|
||||
|
||||
for(i=0; i<(int)mChildArray.GetCount(); i++)
|
||||
for(i = 0; i < (int)mChildArray.size(); i++)
|
||||
LayoutOne(i);
|
||||
|
||||
Refresh(true);
|
||||
@ -1036,13 +1036,13 @@ void ToolBarArea::AdjustLayout()
|
||||
int row = -1;
|
||||
int i, j;
|
||||
|
||||
for(i=0; i<(int)mChildArray.GetCount(); i++) {
|
||||
for(i = 0; i < (int)mChildArray.size(); i++) {
|
||||
if (mRowArray[i] > row) {
|
||||
row = mRowArray[i];
|
||||
bool success = ExpandRow(row);
|
||||
if (!success) {
|
||||
// Re-layout all toolbars from this row on
|
||||
for(j=i; j<(int)mChildArray.GetCount(); j++)
|
||||
for(j = i; j < (int)mChildArray.size(); j++)
|
||||
LayoutOne(j);
|
||||
return;
|
||||
}
|
||||
@ -1067,7 +1067,7 @@ void ToolBarArea::Fit(bool horizontal, bool vertical)
|
||||
minSize.y = 0;
|
||||
maxSize.x = 9999;
|
||||
maxSize.y = 0;
|
||||
for(i=0; i<(int)mChildArray.GetCount(); i++) {
|
||||
for(i = 0; i < (int)mChildArray.size(); i++) {
|
||||
wxPoint childPos = mChildArray[i]->GetPosition();
|
||||
wxSize childSize = mChildArray[i]->GetSize();
|
||||
|
||||
@ -1147,15 +1147,15 @@ void ToolBarArea::CollapseAll(bool now)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i=0; i<(int)mChildArray.GetCount(); i++)
|
||||
for(i = 0; i < (int)mChildArray.size(); i++)
|
||||
mChildArray[i]->Collapse(now);
|
||||
}
|
||||
|
||||
void ToolBarArea::AddChild(ExpandingToolBar *child)
|
||||
{
|
||||
mChildArray.Add(child);
|
||||
mChildArray.push_back(child);
|
||||
mRowArray.push_back(-1); // unknown row
|
||||
LayoutOne(mChildArray.GetCount()-1);
|
||||
LayoutOne(mChildArray.size() - 1);
|
||||
Fit(false, true);
|
||||
}
|
||||
|
||||
@ -1163,17 +1163,17 @@ void ToolBarArea::RemoveChild(ExpandingToolBar *child)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for(i=0; i<(int)mChildArray.GetCount(); i++) {
|
||||
for(i = 0; i < (int)mChildArray.size(); i++) {
|
||||
if (mChildArray[i] == child) {
|
||||
child->Hide();
|
||||
|
||||
mChildArray.RemoveAt(i);
|
||||
mChildArray.erase(mChildArray.begin() + i);
|
||||
mRowArray.erase(mRowArray.begin() + i);
|
||||
|
||||
for(j=i; j<(int)mChildArray.GetCount(); j++)
|
||||
for(j = i; j < (int)mChildArray.size(); j++)
|
||||
mRowArray[j] = -1;
|
||||
|
||||
for(j=i; j<(int)mChildArray.GetCount(); j++)
|
||||
for(j = i; j < (int)mChildArray.size(); j++)
|
||||
LayoutOne(j);
|
||||
|
||||
Fit(false, true);
|
||||
@ -1189,7 +1189,7 @@ std::unique_ptr<ToolBarArrangement> ToolBarArea::SaveArrangement()
|
||||
arrangement->childArray = mChildArray;
|
||||
arrangement->rowArray = mRowArray;
|
||||
|
||||
for(i=0; i<(int)mChildArray.GetCount(); i++)
|
||||
for(i = 0; i < (int)mChildArray.size(); i++)
|
||||
arrangement->rectArray.push_back(mChildArray[i]->GetRect());
|
||||
|
||||
return arrangement;
|
||||
@ -1202,7 +1202,7 @@ void ToolBarArea::RestoreArrangement(std::unique_ptr<ToolBarArrangement>&& arran
|
||||
mChildArray = arrangement->childArray;
|
||||
mRowArray = arrangement->rowArray;
|
||||
|
||||
for(i=0; i<(int)mChildArray.GetCount(); i++) {
|
||||
for(i = 0; i < (int)mChildArray.size(); i++) {
|
||||
mChildArray[i]->SetSize(arrangement->rectArray[i]);
|
||||
mChildArray[i]->Show();
|
||||
}
|
||||
@ -1218,7 +1218,7 @@ std::vector<wxRect> ToolBarArea::GetDropTargets()
|
||||
mDropTargetIndices.clear();
|
||||
mDropTargetRows.clear();
|
||||
|
||||
int numChildren = (int)mChildArray.GetCount();
|
||||
int numChildren = (int)mChildArray.size();
|
||||
int i;
|
||||
int row = -1;
|
||||
|
||||
@ -1257,17 +1257,17 @@ void ToolBarArea::MoveChild(ExpandingToolBar *toolBar, wxRect dropTarget)
|
||||
int newIndex = mDropTargetIndices[i];
|
||||
int newRow = mDropTargetRows[i];
|
||||
|
||||
mChildArray.Insert(toolBar, newIndex);
|
||||
mChildArray.insert(mChildArray.begin() + newIndex, toolBar);
|
||||
mRowArray.insert(mRowArray.begin() + newIndex, newRow);
|
||||
|
||||
for(j=newIndex+1; j<(int)mChildArray.GetCount(); j++)
|
||||
for(j = newIndex+1; j < (int)mChildArray.size(); j++)
|
||||
mRowArray[j] = -1;
|
||||
|
||||
ContractRow(newRow);
|
||||
|
||||
mChildArray[newIndex]->Show();
|
||||
|
||||
for(j=newIndex; j<(int)mChildArray.GetCount(); j++)
|
||||
for(j = newIndex; j < (int)mChildArray.size(); j++)
|
||||
LayoutOne(j);
|
||||
|
||||
Fit(false, true);
|
||||
|
@ -40,7 +40,6 @@ class ToolBarGrabber;
|
||||
class ToolBarArrangement;
|
||||
|
||||
using WindowHash = std::unordered_map<void*, int>;
|
||||
WX_DEFINE_ARRAY(ExpandingToolBar *, ExpandingToolBarArray);
|
||||
|
||||
class ExpandingToolBarEvtHandler;
|
||||
|
||||
@ -239,7 +238,7 @@ class ToolBarArea final : public wxPanelWrapper
|
||||
void AdjustLayout();
|
||||
void Fit(bool horizontal, bool vertical);
|
||||
|
||||
ExpandingToolBarArray mChildArray;
|
||||
std::vector<ExpandingToolBar*> mChildArray;
|
||||
std::vector<int> mRowArray;
|
||||
wxSize mLastLayoutSize;
|
||||
bool mInOnSize;
|
||||
|
Loading…
x
Reference in New Issue
Block a user