1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-04 03:40:07 +00:00

Minor clean-ups

This commit is contained in:
jules 2014-04-29 14:14:21 +01:00
parent 4e6e2a396e
commit 91d9c96338
23 changed files with 34 additions and 34 deletions

View file

@ -161,7 +161,7 @@ String GeneratedCode::getCallbackDefinitions() const
String GeneratedCode::getClassDeclaration() const
{
StringArray parentClassLines;
parentClassLines.addTokens (parentClasses, ",", String::empty);
parentClassLines.addTokens (parentClasses, ",", StringRef());
parentClassLines.addArray (getExtraParentClasses());
parentClassLines.trim();

View file

@ -159,7 +159,7 @@ void JucerDocument::setParentClasses (const String& classes)
if (classes != parentClasses)
{
StringArray parentClassLines;
parentClassLines.addTokens (classes, ",", String::empty);
parentClassLines.addTokens (classes, ",", StringRef());
parentClassLines.trim();
parentClassLines.removeEmptyStrings();
parentClassLines.removeDuplicates (false);

View file

@ -212,7 +212,7 @@ public:
if (s.isNotEmpty())
{
StringArray toks;
toks.addTokens (s, ",:", String::empty);
toks.addTokens (s, ",:", StringRef());
toks.trim();
if (toks[0] == "solid")

View file

@ -109,7 +109,7 @@ namespace
int countMaxPluginChannels (const String& configString, bool isInput)
{
StringArray configs;
configs.addTokens (configString, ", {}", String::empty);
configs.addTokens (configString, ", {}", StringRef());
configs.trim();
configs.removeEmptyStrings();
jassert ((configs.size() & 1) == 0); // looks like a syntax error in the configs?

View file

@ -358,12 +358,12 @@ void LibraryModule::prepareExporter (ProjectExporter& exporter, ProjectSaver& pr
exporter.xcodeFrameworks.addTokens ("AudioUnit CoreAudioKit", false);
const String frameworks (moduleInfo.moduleInfo [exporter.isOSX() ? "OSXFrameworks" : "iOSFrameworks"].toString());
exporter.xcodeFrameworks.addTokens (frameworks, ", ", String::empty);
exporter.xcodeFrameworks.addTokens (frameworks, ", ", StringRef());
}
else if (exporter.isLinux())
{
const String libs (moduleInfo.moduleInfo ["LinuxLibs"].toString());
exporter.linuxLibs.addTokens (libs, ", ", String::empty);
exporter.linuxLibs.addTokens (libs, ", ", StringRef());
exporter.linuxLibs.trim();
exporter.linuxLibs.sort (false);
exporter.linuxLibs.removeDuplicates (false);
@ -371,7 +371,7 @@ void LibraryModule::prepareExporter (ProjectExporter& exporter, ProjectSaver& pr
else if (exporter.isCodeBlocks())
{
const String libs (moduleInfo.moduleInfo ["mingwLibs"].toString());
exporter.mingwLibs.addTokens (libs, ", ", String::empty);
exporter.mingwLibs.addTokens (libs, ", ", StringRef());
exporter.mingwLibs.trim();
exporter.mingwLibs.sort (false);
exporter.mingwLibs.removeDuplicates (false);

View file

@ -184,10 +184,10 @@ void Project::updateOldModulePaths()
}
//==============================================================================
static int getVersionElement (const String& v, int index)
static int getVersionElement (StringRef v, int index)
{
StringArray parts;
parts.addTokens (v, "., ", String::empty);
parts.addTokens (v, "., ", StringRef());
return parts [parts.size() - index - 1].getIntValue();
}

View file

@ -178,9 +178,9 @@ namespace FileHelpers
StringArray toks;
#if JUCE_WINDOWS
toks.addTokens (p, "\\/", String::empty);
toks.addTokens (p, "\\/", StringRef());
#else
toks.addTokens (p, "/", String::empty);
toks.addTokens (p, "/", StringRef());
#endif
while (toks[0] == ".")

View file

@ -164,7 +164,7 @@ String replacePreprocessorDefs (const StringPairArray& definitions, String sourc
StringArray getSearchPathsFromString (const String& searchPath)
{
StringArray s;
s.addTokens (searchPath, ";\r\n", String::empty);
s.addTokens (searchPath, ";\r\n", StringRef());
s.trim();
s.removeEmptyStrings();
s.removeDuplicates (false);

View file

@ -34,7 +34,7 @@
method. Each of the objects returned can then be used to list the available
devices of that type. E.g.
@code
OwnedArray <AudioIODeviceType> types;
OwnedArray<AudioIODeviceType> types;
myAudioDeviceManager.createAudioDeviceTypes (types);
for (int i = 0; i < types.size(); ++i)

View file

@ -888,13 +888,13 @@ AiffAudioFormat::~AiffAudioFormat()
Array<int> AiffAudioFormat::getPossibleSampleRates()
{
const int rates[] = { 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000, 0 };
return Array <int> (rates);
return Array<int> (rates);
}
Array<int> AiffAudioFormat::getPossibleBitDepths()
{
const int depths[] = { 8, 16, 24, 0 };
return Array <int> (depths);
return Array<int> (depths);
}
bool AiffAudioFormat::canDoStereo() { return true; }

View file

@ -54,7 +54,7 @@ public:
(e.g. VST shells) can use a single DLL to create a set of different plugin
subtypes, so in that case, each subtype is returned as a separate object.
*/
virtual void findAllTypesForFile (OwnedArray <PluginDescription>& results,
virtual void findAllTypesForFile (OwnedArray<PluginDescription>& results,
const String& fileOrIdentifier) = 0;
/** Tries to recreate a type from a previously generated PluginDescription.

View file

@ -89,7 +89,7 @@ public:
private:
//==============================================================================
OwnedArray <AudioPluginFormat> formats;
OwnedArray<AudioPluginFormat> formats;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginFormatManager)
};

View file

@ -37,7 +37,7 @@ public:
//==============================================================================
String getName() const override { return "AudioUnit"; }
void findAllTypesForFile (OwnedArray <PluginDescription>&, const String& fileOrIdentifier) override;
void findAllTypesForFile (OwnedArray<PluginDescription>&, const String& fileOrIdentifier) override;
AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc, double, int) override;
bool fileMightContainThisPluginType (const String& fileOrIdentifier) override;
String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) override;

View file

@ -138,7 +138,7 @@ namespace AudioUnitFormatHelpers
fileOrIdentifier.lastIndexOfChar ('/')) + 1));
StringArray tokens;
tokens.addTokens (s, ",", String());
tokens.addTokens (s, ",", StringRef());
tokens.removeEmptyStrings();
if (tokens.size() == 3)
@ -915,7 +915,7 @@ private:
bool automatable;
};
OwnedArray <ParamInfo> parameters;
OwnedArray<ParamInfo> parameters;
MidiDataConcatenator midiConcatenator;
CriticalSection midiInLock;
@ -1600,7 +1600,7 @@ AudioUnitPluginFormat::~AudioUnitPluginFormat()
{
}
void AudioUnitPluginFormat::findAllTypesForFile (OwnedArray <PluginDescription>& results,
void AudioUnitPluginFormat::findAllTypesForFile (OwnedArray<PluginDescription>& results,
const String& fileOrIdentifier)
{
if (! fileMightContainThisPluginType (fileOrIdentifier))

View file

@ -388,11 +388,11 @@ public:
private:
//==============================================================================
ReferenceCountedArray <Node> nodes;
OwnedArray <Connection> connections;
ReferenceCountedArray<Node> nodes;
OwnedArray<Connection> connections;
uint32 lastNodeId;
AudioSampleBuffer renderingBuffers;
OwnedArray <MidiBuffer> midiBuffers;
OwnedArray<MidiBuffer> midiBuffers;
Array<void*> renderingOps;
friend class AudioGraphIOProcessor;

View file

@ -342,7 +342,7 @@ public:
}
private:
Array <MinMaxValue> data;
Array<MinMaxValue> data;
int peakLevel;
void ensureSize (const int thumbSamples)
@ -414,7 +414,7 @@ public:
}
private:
Array <MinMaxValue> data;
Array<MinMaxValue> data;
double cachedStart, cachedTimePerPixel;
int numChannelsCached, numSamplesCached;
bool cacheNeedsRefilling;

View file

@ -42,7 +42,7 @@
- it must be able to be relocated in memory by a memcpy without this causing any problems - so
objects whose functionality relies on external pointers or references to themselves can not be used.
You can of course have an array of pointers to any kind of object, e.g. Array <MyClass*>, but if
You can of course have an array of pointers to any kind of object, e.g. Array<MyClass*>, but if
you do this, the array doesn't take any ownership of the objects - see the OwnedArray class or the
ReferenceCountedArray class for more powerful ways of holding lists of objects.

View file

@ -124,7 +124,7 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType()
return iOS;
#else
StringArray parts;
parts.addTokens (getOSXVersion(), ".", String());
parts.addTokens (getOSXVersion(), ".", StringRef());
jassert (parts[0].getIntValue() == 10);
const int major = parts[1].getIntValue();

View file

@ -91,7 +91,7 @@ ApplicationCommandTarget* ApplicationCommandTarget::getTargetForCommand (const C
while (target != nullptr)
{
Array <CommandID> commandIDs;
Array<CommandID> commandIDs;
target->getAllCommands (commandIDs);
if (commandIDs.contains (commandID))
@ -113,7 +113,7 @@ ApplicationCommandTarget* ApplicationCommandTarget::getTargetForCommand (const C
if (target != nullptr)
{
Array <CommandID> commandIDs;
Array<CommandID> commandIDs;
target->getAllCommands (commandIDs);
if (commandIDs.contains (commandID))

View file

@ -134,7 +134,7 @@ public:
Your target should add all the command IDs that it handles to the array that is
passed-in.
*/
virtual void getAllCommands (Array <CommandID>& commands) = 0;
virtual void getAllCommands (Array<CommandID>& commands) = 0;
/** This must provide details about one of the commands that this target can perform.

View file

@ -74,7 +74,7 @@ ChoicePropertyComponent::ChoicePropertyComponent (const String& name)
ChoicePropertyComponent::ChoicePropertyComponent (const Value& valueToControl,
const String& name,
const StringArray& choiceList,
const Array <var>& correspondingValues)
const Array<var>& correspondingValues)
: PropertyComponent (name),
choices (choiceList),
isCustomClass (false)

View file

@ -70,7 +70,7 @@ public:
ChoicePropertyComponent (const Value& valueToControl,
const String& propertyName,
const StringArray& choices,
const Array <var>& correspondingValues);
const Array<var>& correspondingValues);
/** Destructor. */
~ChoicePropertyComponent();

View file

@ -1645,7 +1645,7 @@ void CodeEditorComponent::State::restoreState (CodeEditorComponent& editor) cons
CodeEditorComponent::State::State (const String& s)
{
StringArray tokens;
tokens.addTokens (s, ":", String::empty);
tokens.addTokens (s, ":", StringRef());
lastTopLine = tokens[0].getIntValue();
lastCaretPos = tokens[1].getIntValue();