1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Misc tidying-up.

This commit is contained in:
jules 2013-07-09 20:25:46 +01:00
parent f86739b221
commit 4ce1908f79
28 changed files with 129 additions and 131 deletions

View file

@ -43,7 +43,7 @@ public:
IntrojucerApp() : isRunningCommandLine (false) {}
//==============================================================================
void initialise (const String& commandLine)
void initialise (const String& commandLine) override
{
LookAndFeel::setDefaultLookAndFeel (&lookAndFeel);
settings = new StoredSettings();
@ -109,7 +109,7 @@ public:
(new ModuleFolderChecker())->post();
}
void shutdown()
void shutdown() override
{
appearanceEditorWindow = nullptr;
utf8Window = nullptr;
@ -133,7 +133,7 @@ public:
}
//==============================================================================
void systemRequestedQuit()
void systemRequestedQuit() override
{
closeModalCompsAndQuit();
}
@ -152,15 +152,15 @@ public:
}
//==============================================================================
const String getApplicationName() { return "Introjucer"; }
const String getApplicationVersion() { return ProjectInfo::versionString; }
const String getApplicationName() override { return "Introjucer"; }
const String getApplicationVersion() override { return ProjectInfo::versionString; }
bool moreThanOneInstanceAllowed()
bool moreThanOneInstanceAllowed() override
{
return true; // this is handled manually in initialise()
}
void anotherInstanceStarted (const String& commandLine)
void anotherInstanceStarted (const String& commandLine) override
{
openFile (commandLine.unquoted());
}
@ -347,7 +347,7 @@ public:
}
//==============================================================================
void getAllCommands (Array <CommandID>& commands)
void getAllCommands (Array <CommandID>& commands) override
{
JUCEApplication::getAllCommands (commands);
@ -362,7 +362,7 @@ public:
commands.addArray (ids, numElementsInArray (ids));
}
void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result)
void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result) override
{
switch (commandID)
{
@ -404,7 +404,7 @@ public:
}
}
bool perform (const InvocationInfo& info)
bool perform (const InvocationInfo& info) override
{
switch (info.commandID)
{

View file

@ -43,7 +43,7 @@ public:
~MainWindow();
//==============================================================================
void closeButtonPressed();
void closeButtonPressed() override;
//==============================================================================
bool canOpenFile (const File& file) const;
@ -58,23 +58,23 @@ public:
void showNewProjectWizard();
bool isInterestedInFileDrag (const StringArray& files);
void filesDropped (const StringArray& filenames, int mouseX, int mouseY);
bool isInterestedInFileDrag (const StringArray& files) override;
void filesDropped (const StringArray& filenames, int mouseX, int mouseY) override;
void activeWindowStatusChanged();
void activeWindowStatusChanged() override;
void updateTitle (const String& documentName);
ProjectContentComponent* getProjectContentComponent() const;
//==============================================================================
ApplicationCommandTarget* getNextCommandTarget();
void getAllCommands (Array <CommandID>& commands);
void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result);
bool perform (const InvocationInfo& info);
ApplicationCommandTarget* getNextCommandTarget() override;
void getAllCommands (Array <CommandID>& commands) override;
void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result) override;
bool perform (const InvocationInfo& info) override;
bool shouldDropFilesWhenDraggedExternally (const DragAndDropTarget::SourceDetails& sourceDetails,
StringArray& files, bool& canMoveFiles);
StringArray& files, bool& canMoveFiles) override;
private:
ScopedPointer <Project> currentProject;

View file

@ -67,7 +67,7 @@ public:
/** Implementation of the AudioFormatReader method. */
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples);
int64 startSampleInFile, int numSamples) override;
/** Checks whether the CD has been removed from the drive. */
bool isCDStillPresent() const;

View file

@ -540,7 +540,7 @@ public:
//==============================================================================
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
int64 startSampleInFile, int numSamples) override
{
clearSamplesBeyondAvailableLength (destSamples, numDestChannels, startOffsetInDestBuffer,
startSampleInFile, numSamples, lengthInSamples);
@ -643,7 +643,7 @@ public:
}
//==============================================================================
bool write (const int** data, int numSamples)
bool write (const int** data, int numSamples) override
{
jassert (data != nullptr && *data != nullptr); // the input must contain at least one channel!
@ -800,7 +800,7 @@ public:
}
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
int64 startSampleInFile, int numSamples) override
{
clearSamplesBeyondAvailableLength (destSamples, numDestChannels, startOffsetInDestBuffer,
startSampleInFile, numSamples, lengthInSamples);

View file

@ -57,28 +57,27 @@ public:
static const char* const appleKey;
//==============================================================================
Array<int> getPossibleSampleRates();
Array<int> getPossibleBitDepths();
bool canDoStereo();
bool canDoMono();
Array<int> getPossibleSampleRates() override;
Array<int> getPossibleBitDepths() override;
bool canDoStereo() override;
bool canDoMono() override;
#if JUCE_MAC
bool canHandleFile (const File& fileToTest);
bool canHandleFile (const File& fileToTest) override;
#endif
//==============================================================================
AudioFormatReader* createReaderFor (InputStream* sourceStream,
bool deleteStreamIfOpeningFails);
bool deleteStreamIfOpeningFails) override;
MemoryMappedAudioFormatReader* createMemoryMappedReader (const File&);
MemoryMappedAudioFormatReader* createMemoryMappedReader (const File&) override;
AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
double sampleRateToUse,
unsigned int numberOfChannels,
int bitsPerSample,
const StringPairArray& metadataValues,
int qualityOptionIndex);
int qualityOptionIndex) override;
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AiffAudioFormat)

View file

@ -360,7 +360,7 @@ public:
//==============================================================================
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
int64 startSampleInFile, int numSamples) override
{
clearSamplesBeyondAvailableLength (destSamples, numDestChannels, startOffsetInDestBuffer,
startSampleInFile, numSamples, lengthInSamples);

View file

@ -52,21 +52,21 @@ public:
static const char* const timeSig;
//==============================================================================
Array<int> getPossibleSampleRates();
Array<int> getPossibleBitDepths();
bool canDoStereo();
bool canDoMono();
Array<int> getPossibleSampleRates() override;
Array<int> getPossibleBitDepths() override;
bool canDoStereo() override;
bool canDoMono() override;
//==============================================================================
AudioFormatReader* createReaderFor (InputStream*,
bool deleteStreamIfOpeningFails);
bool deleteStreamIfOpeningFails) override;
AudioFormatWriter* createWriterFor (OutputStream*,
double sampleRateToUse,
unsigned int numberOfChannels,
int bitsPerSample,
const StringPairArray& metadataValues,
int qualityOptionIndex);
int qualityOptionIndex) override;
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CoreAudioFormat)

View file

@ -145,7 +145,7 @@ public:
// returns the number of samples read
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
int64 startSampleInFile, int numSamples) override
{
using namespace FlacNamespace;
@ -355,7 +355,7 @@ public:
}
//==============================================================================
bool write (const int** samplesToWrite, int numSamples)
bool write (const int** samplesToWrite, int numSamples) override
{
using namespace FlacNamespace;
if (! ok)

View file

@ -40,23 +40,23 @@ public:
~FlacAudioFormat();
//==============================================================================
Array<int> getPossibleSampleRates();
Array<int> getPossibleBitDepths();
bool canDoStereo();
bool canDoMono();
bool isCompressed();
StringArray getQualityOptions();
Array<int> getPossibleSampleRates() override;
Array<int> getPossibleBitDepths() override;
bool canDoStereo() override;
bool canDoMono() override;
bool isCompressed() override;
StringArray getQualityOptions() override;
//==============================================================================
AudioFormatReader* createReaderFor (InputStream* sourceStream,
bool deleteStreamIfOpeningFails);
bool deleteStreamIfOpeningFails) override;
AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
double sampleRateToUse,
unsigned int numberOfChannels,
int bitsPerSample,
const StringPairArray& metadataValues,
int qualityOptionIndex);
int qualityOptionIndex) override;
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FlacAudioFormat)
};

View file

@ -2954,7 +2954,7 @@ public:
//==============================================================================
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
int64 startSampleInFile, int numSamples) override
{
jassert (destSamples != nullptr);

View file

@ -46,19 +46,19 @@ public:
~MP3AudioFormat();
//==============================================================================
Array<int> getPossibleSampleRates();
Array<int> getPossibleBitDepths();
bool canDoStereo();
bool canDoMono();
bool isCompressed();
StringArray getQualityOptions();
Array<int> getPossibleSampleRates() override;
Array<int> getPossibleBitDepths() override;
bool canDoStereo() override;
bool canDoMono() override;
bool isCompressed() override;
StringArray getQualityOptions() override;
//==============================================================================
AudioFormatReader* createReaderFor (InputStream*, bool deleteStreamIfOpeningFails);
AudioFormatReader* createReaderFor (InputStream*, bool deleteStreamIfOpeningFails) override;
AudioFormatWriter* createWriterFor (OutputStream*, double sampleRateToUse,
unsigned int numberOfChannels, int bitsPerSample,
const StringPairArray& metadataValues, int qualityOptionIndex);
const StringPairArray& metadataValues, int qualityOptionIndex) override;
};
#endif

View file

@ -142,7 +142,7 @@ public:
//==============================================================================
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
int64 startSampleInFile, int numSamples) override
{
while (numSamples > 0)
{
@ -341,7 +341,7 @@ public:
}
//==============================================================================
bool write (const int** samplesToWrite, int numSamples)
bool write (const int** samplesToWrite, int numSamples) override
{
if (ok)
{

View file

@ -40,12 +40,12 @@ public:
~OggVorbisAudioFormat();
//==============================================================================
Array<int> getPossibleSampleRates();
Array<int> getPossibleBitDepths();
bool canDoStereo();
bool canDoMono();
bool isCompressed();
StringArray getQualityOptions();
Array<int> getPossibleSampleRates() override;
Array<int> getPossibleBitDepths() override;
bool canDoStereo() override;
bool canDoMono() override;
bool isCompressed() override;
StringArray getQualityOptions() override;
//==============================================================================
/** Tries to estimate the quality level of an ogg file based on its size.
@ -76,14 +76,14 @@ public:
//==============================================================================
AudioFormatReader* createReaderFor (InputStream* sourceStream,
bool deleteStreamIfOpeningFails);
bool deleteStreamIfOpeningFails) override;
AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
double sampleRateToUse,
unsigned int numberOfChannels,
int bitsPerSample,
const StringPairArray& metadataValues,
int qualityOptionIndex);
int qualityOptionIndex) override;
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OggVorbisAudioFormat)

View file

@ -767,7 +767,7 @@ public:
//==============================================================================
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
int64 startSampleInFile, int numSamples) override
{
clearSamplesBeyondAvailableLength (destSamples, numDestChannels, startOffsetInDestBuffer,
startSampleInFile, numSamples, lengthInSamples);
@ -870,7 +870,7 @@ public:
}
//==============================================================================
bool write (const int** data, int numSamples)
bool write (const int** data, int numSamples) override
{
jassert (data != nullptr && *data != nullptr); // the input must contain at least one channel!
@ -1066,7 +1066,7 @@ public:
}
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
int64 startSampleInFile, int numSamples) override
{
clearSamplesBeyondAvailableLength (destSamples, numDestChannels, startOffsetInDestBuffer,
startSampleInFile, numSamples, lengthInSamples);
@ -1084,7 +1084,7 @@ public:
}
void readMaxLevels (int64 startSampleInFile, int64 numSamples,
float& min0, float& max0, float& min1, float& max1)
float& min0, float& max0, float& min1, float& max1) override
{
if (numSamples <= 0)
{

View file

@ -132,23 +132,23 @@ public:
static const char* const acidTempo;
//==============================================================================
Array<int> getPossibleSampleRates();
Array<int> getPossibleBitDepths();
bool canDoStereo();
bool canDoMono();
Array<int> getPossibleSampleRates() override;
Array<int> getPossibleBitDepths() override;
bool canDoStereo() override;
bool canDoMono() override;
//==============================================================================
AudioFormatReader* createReaderFor (InputStream* sourceStream,
bool deleteStreamIfOpeningFails);
bool deleteStreamIfOpeningFails) override;
MemoryMappedAudioFormatReader* createMemoryMappedReader (const File& file);
MemoryMappedAudioFormatReader* createMemoryMappedReader (const File& file) override;
AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
double sampleRateToUse,
unsigned int numberOfChannels,
int bitsPerSample,
const StringPairArray& metadataValues,
int qualityOptionIndex);
int qualityOptionIndex) override;
//==============================================================================
/** Utility function to replace the metadata in a wav file with a new set of values.

View file

@ -161,7 +161,7 @@ public:
}
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
int64 startSampleInFile, int numSamples) override
{
if (sampleRate <= 0)
return false;

View file

@ -36,17 +36,17 @@ public:
~WindowsMediaAudioFormat();
//==============================================================================
Array<int> getPossibleSampleRates();
Array<int> getPossibleBitDepths();
bool canDoStereo();
bool canDoMono();
Array<int> getPossibleSampleRates() override;
Array<int> getPossibleBitDepths() override;
bool canDoStereo() override;
bool canDoMono() override;
//==============================================================================
AudioFormatReader* createReaderFor (InputStream*, bool deleteStreamIfOpeningFails);
AudioFormatReader* createReaderFor (InputStream*, bool deleteStreamIfOpeningFails) override;
AudioFormatWriter* createWriterFor (OutputStream*, double sampleRateToUse,
unsigned int numberOfChannels, int bitsPerSample,
const StringPairArray& metadataValues, int qualityOptionIndex);
const StringPairArray& metadataValues, int qualityOptionIndex) override;
};
#endif

View file

@ -67,14 +67,14 @@ public:
//==============================================================================
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples);
int64 startSampleInFile, int numSamples) override;
void readMaxLevels (int64 startSample,
int64 numSamples,
float& lowestLeft,
float& highestLeft,
float& lowestRight,
float& highestRight);
float& highestRight) override;
private:

View file

@ -60,7 +60,7 @@ public:
void setReadTimeout (int timeoutMilliseconds) noexcept;
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples);
int64 startSampleInFile, int numSamples) override;
private:
ScopedPointer<AudioFormatReader> source;

View file

@ -103,7 +103,8 @@ namespace SocketHelpers
#if JUCE_WINDOWS
bytesThisTime = recv (handle, static_cast<char*> (destBuffer) + bytesRead, maxBytesToRead - bytesRead, 0);
#else
while ((bytesThisTime = (int) ::read (handle, addBytesToPointer (destBuffer, bytesRead), (size_t) (maxBytesToRead - bytesRead))) < 0
while ((bytesThisTime = (int) ::read (handle, addBytesToPointer (destBuffer, bytesRead),
(size_t) (maxBytesToRead - bytesRead))) < 0
&& errno == EINTR
&& connected)
{
@ -274,17 +275,15 @@ StreamingSocket::StreamingSocket()
SocketHelpers::initSockets();
}
StreamingSocket::StreamingSocket (const String& hostName_,
const int portNumber_,
const int handle_)
: hostName (hostName_),
portNumber (portNumber_),
handle (handle_),
StreamingSocket::StreamingSocket (const String& host, int portNum, int h)
: hostName (host),
portNumber (portNum),
handle (h),
connected (true),
isListener (false)
{
SocketHelpers::initSockets();
SocketHelpers::resetSocketOptions (handle_, false, false);
SocketHelpers::resetSocketOptions (h, false, false);
}
StreamingSocket::~StreamingSocket()
@ -293,9 +292,11 @@ StreamingSocket::~StreamingSocket()
}
//==============================================================================
int StreamingSocket::read (void* destBuffer, const int maxBytesToRead, const bool blockUntilSpecifiedAmountHasArrived)
int StreamingSocket::read (void* destBuffer, const int maxBytesToRead,
const bool blockUntilSpecifiedAmountHasArrived)
{
return (connected && ! isListener) ? SocketHelpers::readSocket (handle, destBuffer, maxBytesToRead, connected, blockUntilSpecifiedAmountHasArrived)
return (connected && ! isListener) ? SocketHelpers::readSocket (handle, destBuffer, maxBytesToRead,
connected, blockUntilSpecifiedAmountHasArrived)
: -1;
}
@ -433,8 +434,9 @@ bool StreamingSocket::createListener (const int newPortNumber, const String& loc
StreamingSocket* StreamingSocket::waitForNextConnection() const
{
jassert (isListener || ! connected); // to call this method, you first have to use createListener() to
// prepare this socket as a listener.
// To call this method, you first have to use createListener() to
// prepare this socket as a listener.
jassert (isListener || ! connected);
if (connected && isListener)
{
@ -458,11 +460,11 @@ bool StreamingSocket::isLocal() const noexcept
//==============================================================================
//==============================================================================
DatagramSocket::DatagramSocket (const int localPortNumber, const bool allowBroadcast_)
DatagramSocket::DatagramSocket (const int localPortNumber, const bool canBroadcast)
: portNumber (0),
handle (-1),
connected (true),
allowBroadcast (allowBroadcast_),
allowBroadcast (canBroadcast),
serverAddress (nullptr)
{
SocketHelpers::initSockets();
@ -471,18 +473,18 @@ DatagramSocket::DatagramSocket (const int localPortNumber, const bool allowBroad
bindToPort (localPortNumber);
}
DatagramSocket::DatagramSocket (const String& hostName_, const int portNumber_,
const int handle_, const int localPortNumber)
: hostName (hostName_),
portNumber (portNumber_),
handle (handle_),
DatagramSocket::DatagramSocket (const String& host, const int portNum,
const int h, const int localPortNumber)
: hostName (host),
portNumber (portNum),
handle (h),
connected (true),
allowBroadcast (false),
serverAddress (nullptr)
{
SocketHelpers::initSockets();
SocketHelpers::resetSocketOptions (handle_, true, allowBroadcast);
SocketHelpers::resetSocketOptions (h, true, allowBroadcast);
bindToPort (localPortNumber);
}
@ -564,7 +566,8 @@ int DatagramSocket::waitUntilReady (const bool readyForReading,
int DatagramSocket::read (void* destBuffer, const int maxBytesToRead, const bool blockUntilSpecifiedAmountHasArrived)
{
return connected ? SocketHelpers::readSocket (handle, destBuffer, maxBytesToRead, connected, blockUntilSpecifiedAmountHasArrived)
return connected ? SocketHelpers::readSocket (handle, destBuffer, maxBytesToRead,
connected, blockUntilSpecifiedAmountHasArrived)
: -1;
}

View file

@ -53,7 +53,7 @@ public:
return true;
}
void actionListenerCallback (const String& message)
void actionListenerCallback (const String& message) override
{
if (JUCEApplication* const app = JUCEApplication::getInstance())
{

View file

@ -95,13 +95,11 @@ public:
protected:
//==============================================================================
/** @internal */
void clicked();
void clicked() override;
/** @internal */
void colourChanged();
void colourChanged() override;
/** @internal */
void paintButton (Graphics& g,
bool isMouseOverButton,
bool isButtonDown);
void paintButton (Graphics&, bool isMouseOver, bool isButtonDown) override;
private:
//==============================================================================

View file

@ -129,11 +129,9 @@ public:
protected:
//==============================================================================
/** @internal */
bool hitTest (int x, int y);
bool hitTest (int x, int y) override;
/** @internal */
void paintButton (Graphics& g,
bool isMouseOverButton,
bool isButtonDown);
void paintButton (Graphics&, bool isMouseOver, bool isButtonDown) override;
private:
//==============================================================================

View file

@ -211,7 +211,7 @@ protected:
/** @internal */
void transformContextToCorrectOrigin (Graphics&);
/** @internal */
void parentHierarchyChanged();
void parentHierarchyChanged() override;
/** @internal */
void setBoundsToEnclose (const Rectangle<float>&);

View file

@ -107,11 +107,11 @@ public:
/** @internal */
Rectangle<float> getDrawableBounds() const;
/** @internal */
void childBoundsChanged (Component*);
void childBoundsChanged (Component*) override;
/** @internal */
void childrenChanged();
void childrenChanged() override;
/** @internal */
void parentHierarchyChanged();
void parentHierarchyChanged() override;
/** @internal */
MarkerList* getMarkers (bool xAxis);

View file

@ -296,9 +296,9 @@ public:
//==============================================================================
/** @internal */
void resized();
void resized() override;
/** @internal */
void lookAndFeelChanged();
void lookAndFeelChanged() override;
protected:
//==============================================================================

View file

@ -140,15 +140,15 @@ protected:
//==============================================================================
/** @internal */
void focusOfChildComponentChanged (FocusChangeType cause);
void focusOfChildComponentChanged (FocusChangeType) override;
/** @internal */
void parentHierarchyChanged();
void parentHierarchyChanged() override;
/** @internal */
virtual int getDesktopWindowStyleFlags() const;
/** @internal */
void recreateDesktopWindow();
/** @internal */
void visibilityChanged();
void visibilityChanged() override;
private:
friend class TopLevelWindowManager;

View file

@ -205,8 +205,8 @@ private:
bool movieLoaded, controllerVisible, looping;
#if JUCE_WINDOWS
void parentHierarchyChanged();
void visibilityChanged();
void parentHierarchyChanged() override;
void visibilityChanged() override;
void createControlIfNeeded();
bool isControlCreated() const;