diff --git a/extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp b/extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp index cda97d1555..0ed0aeb79c 100644 --- a/extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp +++ b/extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp @@ -967,10 +967,10 @@ public: private: static CEffectProcess* createNewProcess() { - // Juce setup -#if JUCE_WINDOWS + #if JUCE_WINDOWS PlatformUtilities::setCurrentModuleInstanceHandle (gThisModule); -#endif + #endif + initialiseJuce_GUI(); return new JucePlugInProcess(); @@ -978,44 +978,25 @@ private: static const String createRTASName() { - return String (JucePlugin_Name) + T("\n") - + String (JucePlugin_Name).substring (0, 4); + return String (JucePlugin_Name) + "\n" + + String (JucePlugin_Name).substring (0, 4); } static EPlugIn_StemFormat getFormatForChans (const int numChans) throw() { switch (numChans) { - case 0: - return ePlugIn_StemFormat_Generic; - - case 1: - return ePlugIn_StemFormat_Mono; - - case 2: - return ePlugIn_StemFormat_Stereo; - - case 3: - return ePlugIn_StemFormat_LCR; - - case 4: - return ePlugIn_StemFormat_Quad; - - case 5: - return ePlugIn_StemFormat_5dot0; - - case 6: - return ePlugIn_StemFormat_5dot1; - - case 7: - return ePlugIn_StemFormat_6dot1; - - case 8: - return ePlugIn_StemFormat_7dot1; - - default: - jassertfalse // hmm - not a valid number of chans for RTAS.. - break; + case 0: return ePlugIn_StemFormat_Generic; + case 1: return ePlugIn_StemFormat_Mono; + case 2: return ePlugIn_StemFormat_Stereo; + case 3: return ePlugIn_StemFormat_LCR; + case 4: return ePlugIn_StemFormat_Quad; + case 5: return ePlugIn_StemFormat_5dot0; + case 6: return ePlugIn_StemFormat_5dot1; + case 7: return ePlugIn_StemFormat_6dot1; + case 8: return ePlugIn_StemFormat_7dot1; + + default: jassertfalse; break; // hmm - not a valid number of chans for RTAS.. } return ePlugIn_StemFormat_Generic; @@ -1026,9 +1007,10 @@ void initialiseMacRTAS(); CProcessGroupInterface* CProcessGroup::CreateProcessGroup() { -#if JUCE_MAC + #if JUCE_MAC initialiseMacRTAS(); -#endif + #endif + initialiseJuce_NonGUI(); return new JucePlugInGroup(); } diff --git a/extras/audio plugins/wrapper/juce_PluginHostType.h b/extras/audio plugins/wrapper/juce_PluginHostType.h index 754a8deccc..68bd50dc2f 100644 --- a/extras/audio plugins/wrapper/juce_PluginHostType.h +++ b/extras/audio plugins/wrapper/juce_PluginHostType.h @@ -98,7 +98,7 @@ public: //============================================================================== private: - static HostType getHostType() throw() + static HostType getHostType() { const String hostPath (File::getSpecialLocation (File::hostApplicationPath).getFullPathName()); const String hostFilename (File (hostPath).getFileName()); diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 61239dadcc..5276be9f3d 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -27500,7 +27500,7 @@ void MidiBuffer::swapWith (MidiBuffer& other) swapVariables (bytesUsed, other.bytesUsed); } -MidiBuffer::~MidiBuffer() throw() +MidiBuffer::~MidiBuffer() { } @@ -27529,8 +27529,7 @@ void MidiBuffer::clear() throw() bytesUsed = 0; } -void MidiBuffer::clear (const int startSample, - const int numSamples) throw() +void MidiBuffer::clear (const int startSample, const int numSamples) { uint8* const start = findEventAfter (getData(), startSample - 1); uint8* const end = findEventAfter (start, startSample + numSamples - 1); @@ -27546,17 +27545,14 @@ void MidiBuffer::clear (const int startSample, } } -void MidiBuffer::addEvent (const MidiMessage& m, - const int sampleNumber) throw() +void MidiBuffer::addEvent (const MidiMessage& m, const int sampleNumber) { addEvent (m.getRawData(), m.getRawDataSize(), sampleNumber); } -static int findActualEventLength (const uint8* const data, - const int maxBytes) throw() +static int findActualEventLength (const uint8* const data, const int maxBytes) throw() { unsigned int byte = (unsigned int) *data; - int size = 0; if (byte == 0xf0 || byte == 0xf7) @@ -27583,11 +27579,9 @@ static int findActualEventLength (const uint8* const data, return size; } -void MidiBuffer::addEvent (const uint8* const newData, - const int maxBytes, - const int sampleNumber) throw() +void MidiBuffer::addEvent (const void* const newData, const int maxBytes, const int sampleNumber) { - const int numBytes = findActualEventLength (newData, maxBytes); + const int numBytes = findActualEventLength (static_cast (newData), maxBytes); if (numBytes > 0) { @@ -27614,7 +27608,7 @@ void MidiBuffer::addEvent (const uint8* const newData, void MidiBuffer::addEvents (const MidiBuffer& otherBuffer, const int startSample, const int numSamples, - const int sampleDeltaToAdd) throw() + const int sampleDeltaToAdd) { Iterator i (otherBuffer); i.setNextSamplePosition (startSample); @@ -27870,6 +27864,31 @@ namespace MidiFileHelpers return time / (((timeFormat & 0x7fff) >> 8) * (timeFormat & 0xff)); } } + + // a comparator that puts all the note-offs before note-ons that have the same time + struct Sorter + { + static int compareElements (const MidiMessageSequence::MidiEventHolder* const first, + const MidiMessageSequence::MidiEventHolder* const second) throw() + { + const double diff = (first->message.getTimeStamp() - second->message.getTimeStamp()); + + if (diff == 0) + { + if (first->message.isNoteOff() && second->message.isNoteOn()) + return -1; + else if (first->message.isNoteOn() && second->message.isNoteOff()) + return 1; + else + return 0; + } + else + { + return (diff > 0) ? 1 : -1; + } + } + }; + } MidiFile::MidiFile() @@ -28010,27 +28029,6 @@ bool MidiFile::readFrom (InputStream& sourceStream) return false; } -// a comparator that puts all the note-offs before note-ons that have the same time -int MidiFile::compareElements (const MidiMessageSequence::MidiEventHolder* const first, - const MidiMessageSequence::MidiEventHolder* const second) -{ - const double diff = (first->message.getTimeStamp() - second->message.getTimeStamp()); - - if (diff == 0) - { - if (first->message.isNoteOff() && second->message.isNoteOn()) - return -1; - else if (first->message.isNoteOn() && second->message.isNoteOff()) - return 1; - else - return 0; - } - else - { - return (diff > 0) ? 1 : -1; - } -} - void MidiFile::readNextTrack (const uint8* data, int size) { double time = 0; @@ -28063,7 +28061,8 @@ void MidiFile::readNextTrack (const uint8* data, int size) } // use a sort that puts all the note-offs before note-ons that have the same time - result.list.sort (*this, true); + MidiFileHelpers::Sorter sorter; + result.list.sort (sorter, true); result.updateMatchedPairs(); @@ -28306,13 +28305,13 @@ void MidiKeyboardState::processNextMidiBuffer (MidiBuffer& buffer, eventsToAdd.clear(); } -void MidiKeyboardState::addListener (MidiKeyboardStateListener* const listener) throw() +void MidiKeyboardState::addListener (MidiKeyboardStateListener* const listener) { const ScopedLock sl (lock); listeners.addIfNotAlreadyThere (listener); } -void MidiKeyboardState::removeListener (MidiKeyboardStateListener* const listener) throw() +void MidiKeyboardState::removeListener (MidiKeyboardStateListener* const listener) { const ScopedLock sl (lock); listeners.removeValue (listener); @@ -28325,8 +28324,7 @@ END_JUCE_NAMESPACE /*** Start of inlined file: juce_MidiMessage.cpp ***/ BEGIN_JUCE_NAMESPACE -int MidiMessage::readVariableLengthVal (const uint8* data, - int& numBytesUsed) throw() +int MidiMessage::readVariableLengthVal (const uint8* data, int& numBytesUsed) throw() { numBytesUsed = 0; int v = 0; @@ -29863,11 +29861,11 @@ END_JUCE_NAMESPACE /*** Start of inlined file: juce_AudioPluginFormatManager.cpp ***/ BEGIN_JUCE_NAMESPACE -AudioPluginFormatManager::AudioPluginFormatManager() throw() +AudioPluginFormatManager::AudioPluginFormatManager() { } -AudioPluginFormatManager::~AudioPluginFormatManager() throw() +AudioPluginFormatManager::~AudioPluginFormatManager() { clearSingletonInstance(); } @@ -29915,17 +29913,17 @@ void AudioPluginFormatManager::addDefaultFormats() #endif } -int AudioPluginFormatManager::getNumFormats() throw() +int AudioPluginFormatManager::getNumFormats() { return formats.size(); } -AudioPluginFormat* AudioPluginFormatManager::getFormat (const int index) throw() +AudioPluginFormat* AudioPluginFormatManager::getFormat (const int index) { return formats [index]; } -void AudioPluginFormatManager::addFormat (AudioPluginFormat* const format) throw() +void AudioPluginFormatManager::addFormat (AudioPluginFormat* const format) { formats.add (format); } @@ -30042,7 +30040,7 @@ bool KnownPluginList::addType (const PluginDescription& type) return true; } -void KnownPluginList::removeType (const int index) throw() +void KnownPluginList::removeType (const int index) { types.remove (index); sendChangeMessage (this); @@ -30050,11 +30048,8 @@ void KnownPluginList::removeType (const int index) throw() static Time getFileModTime (const String& fileOrIdentifier) throw() { - if (fileOrIdentifier.startsWithChar ('/') - || fileOrIdentifier[1] == ':') - { + if (fileOrIdentifier.startsWithChar ('/') || fileOrIdentifier[1] == ':') return File (fileOrIdentifier).getLastModificationTime(); - } return Time (0); } @@ -30411,7 +30406,7 @@ END_JUCE_NAMESPACE /*** Start of inlined file: juce_PluginDescription.cpp ***/ BEGIN_JUCE_NAMESPACE -PluginDescription::PluginDescription() throw() +PluginDescription::PluginDescription() : uid (0), isInstrument (false), numInputChannels (0), @@ -30419,11 +30414,11 @@ PluginDescription::PluginDescription() throw() { } -PluginDescription::~PluginDescription() throw() +PluginDescription::~PluginDescription() { } -PluginDescription::PluginDescription (const PluginDescription& other) throw() +PluginDescription::PluginDescription (const PluginDescription& other) : name (other.name), pluginFormatName (other.pluginFormatName), category (other.category), @@ -30438,7 +30433,7 @@ PluginDescription::PluginDescription (const PluginDescription& other) throw() { } -PluginDescription& PluginDescription::operator= (const PluginDescription& other) throw() +PluginDescription& PluginDescription::operator= (const PluginDescription& other) { name = other.name; pluginFormatName = other.pluginFormatName; @@ -30461,7 +30456,7 @@ bool PluginDescription::isDuplicateOf (const PluginDescription& other) const && uid == other.uid; } -const String PluginDescription::createIdentifierString() const throw() +const String PluginDescription::createIdentifierString() const { return pluginFormatName + "-" + name @@ -30549,7 +30544,7 @@ PluginDirectoryScanner::~PluginDirectoryScanner() { } -const String PluginDirectoryScanner::getNextPluginFileThatWillBeScanned() const throw() +const String PluginDirectoryScanner::getNextPluginFileThatWillBeScanned() const { return format.getNameOfPluginFromIdentifier (filesOrIdentifiersToScan [nextIndex]); } @@ -30590,7 +30585,7 @@ bool PluginDirectoryScanner::scanNextFile (const bool dontRescanIfAlreadyInList) return nextIndex < filesOrIdentifiersToScan.size(); } -const StringArray PluginDirectoryScanner::getDeadMansPedalFile() throw() +const StringArray PluginDirectoryScanner::getDeadMansPedalFile() { StringArray lines; @@ -30603,7 +30598,7 @@ const StringArray PluginDirectoryScanner::getDeadMansPedalFile() throw() return lines; } -void PluginDirectoryScanner::setDeadMansPedalFile (const StringArray& newContents) throw() +void PluginDirectoryScanner::setDeadMansPedalFile (const StringArray& newContents) { if (deadMansPedalFile != File::nonexistent) deadMansPedalFile.replaceWithText (newContents.joinIntoString ("\n"), true, true); @@ -35469,13 +35464,13 @@ void AudioProcessor::setPlayHead (AudioPlayHead* const newPlayHead) throw() playHead = newPlayHead; } -void AudioProcessor::addListener (AudioProcessorListener* const newListener) throw() +void AudioProcessor::addListener (AudioProcessorListener* const newListener) { const ScopedLock sl (listenerLock); listeners.addIfNotAlreadyThere (newListener); } -void AudioProcessor::removeListener (AudioProcessorListener* const listenerToRemove) throw() +void AudioProcessor::removeListener (AudioProcessorListener* const listenerToRemove) { const ScopedLock sl (listenerLock); listeners.removeValue (listenerToRemove); @@ -38828,7 +38823,7 @@ void MessageManager::deliverBroadcastMessage (const String& value) broadcastListeners->sendActionMessage (value); } -void MessageManager::registerBroadcastListener (ActionListener* const listener) throw() +void MessageManager::registerBroadcastListener (ActionListener* const listener) { if (broadcastListeners == 0) broadcastListeners = new ActionListenerList(); @@ -38836,7 +38831,7 @@ void MessageManager::registerBroadcastListener (ActionListener* const listener) broadcastListeners->addActionListener (listener); } -void MessageManager::deregisterBroadcastListener (ActionListener* const listener) throw() +void MessageManager::deregisterBroadcastListener (ActionListener* const listener) { if (broadcastListeners != 0) broadcastListeners->removeActionListener (listener); @@ -38911,21 +38906,21 @@ private: BlockingMessage& operator= (const BlockingMessage&); }; -MessageManagerLock::MessageManagerLock (Thread* const threadToCheck) throw() +MessageManagerLock::MessageManagerLock (Thread* const threadToCheck) : sharedEvents (0), locked (false) { init (threadToCheck, 0); } -MessageManagerLock::MessageManagerLock (ThreadPoolJob* const jobToCheckForExitSignal) throw() +MessageManagerLock::MessageManagerLock (ThreadPoolJob* const jobToCheckForExitSignal) : sharedEvents (0), locked (false) { init (0, jobToCheckForExitSignal); } -void MessageManagerLock::init (Thread* const threadToCheck, ThreadPoolJob* const job) throw() +void MessageManagerLock::init (Thread* const threadToCheck, ThreadPoolJob* const job) { if (MessageManager::instance != 0) { @@ -44808,12 +44803,12 @@ CodeDocument::Position::Position (const Position& other) throw() jassert (*this == other); } -CodeDocument::Position::~Position() throw() +CodeDocument::Position::~Position() { setPositionMaintained (false); } -CodeDocument::Position& CodeDocument::Position::operator= (const Position& other) throw() +CodeDocument::Position& CodeDocument::Position::operator= (const Position& other) { if (this != &other) { @@ -44849,7 +44844,7 @@ bool CodeDocument::Position::operator!= (const Position& other) const throw() return ! operator== (other); } -void CodeDocument::Position::setLineAndIndex (const int newLine, const int newIndexInLine) throw() +void CodeDocument::Position::setLineAndIndex (const int newLine, const int newIndexInLine) { jassert (owner != 0); @@ -44888,7 +44883,7 @@ void CodeDocument::Position::setLineAndIndex (const int newLine, const int newIn } } -void CodeDocument::Position::setPosition (const int newPosition) throw() +void CodeDocument::Position::setPosition (const int newPosition) { jassert (owner != 0); @@ -44935,7 +44930,7 @@ void CodeDocument::Position::setPosition (const int newPosition) throw() } } -void CodeDocument::Position::moveBy (int characterDelta) throw() +void CodeDocument::Position::moveBy (int characterDelta) { jassert (owner != 0); @@ -44956,33 +44951,33 @@ void CodeDocument::Position::moveBy (int characterDelta) throw() setPosition (characterPos + characterDelta); } -const CodeDocument::Position CodeDocument::Position::movedBy (const int characterDelta) const throw() +const CodeDocument::Position CodeDocument::Position::movedBy (const int characterDelta) const { CodeDocument::Position p (*this); p.moveBy (characterDelta); return p; } -const CodeDocument::Position CodeDocument::Position::movedByLines (const int deltaLines) const throw() +const CodeDocument::Position CodeDocument::Position::movedByLines (const int deltaLines) const { CodeDocument::Position p (*this); p.setLineAndIndex (getLineNumber() + deltaLines, getIndexInLine()); return p; } -const juce_wchar CodeDocument::Position::getCharacter() const throw() +const juce_wchar CodeDocument::Position::getCharacter() const { const CodeDocumentLine* const l = owner->lines [line]; return l == 0 ? 0 : l->line [getIndexInLine()]; } -const String CodeDocument::Position::getLineText() const throw() +const String CodeDocument::Position::getLineText() const { const CodeDocumentLine* const l = owner->lines [line]; return l == 0 ? String::empty : l->line; } -void CodeDocument::Position::setPositionMaintained (const bool isMaintained) throw() +void CodeDocument::Position::setPositionMaintained (const bool isMaintained) { if (isMaintained != positionMaintained) { @@ -45018,13 +45013,13 @@ CodeDocument::~CodeDocument() { } -const String CodeDocument::getAllContent() const throw() +const String CodeDocument::getAllContent() const { return getTextBetween (Position (this, 0), Position (this, lines.size(), 0)); } -const String CodeDocument::getTextBetween (const Position& start, const Position& end) const throw() +const String CodeDocument::getTextBetween (const Position& start, const Position& end) const { if (end.getPosition() <= start.getPosition()) return String::empty; @@ -45628,7 +45623,7 @@ public: void draw (CodeEditorComponent& owner, Graphics& g, const Font& font, float x, const int y, const int baselineOffset, const int lineHeight, - const Colour& highlightColour) const throw() + const Colour& highlightColour) const { if (highlightColumnStart < highlightColumnEnd) { @@ -45717,7 +45712,7 @@ private: source = lastIterator; } - static void replaceTabsWithSpaces (Array & tokens, const int spacesPerTab) throw() + static void replaceTabsWithSpaces (Array & tokens, const int spacesPerTab) { int x = 0; for (int i = 0; i < tokens.size(); ++i) @@ -45885,7 +45880,7 @@ void CodeEditorComponent::paint (Graphics& g) } } -void CodeEditorComponent::setScrollbarThickness (const int thickness) throw() +void CodeEditorComponent::setScrollbarThickness (const int thickness) { if (scrollbarThickness != thickness) { @@ -46075,7 +46070,7 @@ void CodeEditorComponent::scrollToKeepCaretOnScreen() scrollToColumn (column); } -const Rectangle CodeEditorComponent::getCharacterBounds (const CodeDocument::Position& pos) const throw() +const Rectangle CodeEditorComponent::getCharacterBounds (const CodeDocument::Position& pos) const { return Rectangle (roundToInt ((gutter - xOffset * charWidth) + indexToColumn (pos.getLineNumber(), pos.getIndexInLine()) * charWidth), (pos.getLineNumber() - firstLineOnScreen) * lineHeight, @@ -46575,7 +46570,7 @@ void CodeEditorComponent::focusLost (FocusChangeType) caret->updatePosition(); } -void CodeEditorComponent::setTabSize (const int numSpaces, const bool insertSpaces) throw() +void CodeEditorComponent::setTabSize (const int numSpaces, const bool insertSpaces) { useSpacesForTabs = insertSpaces; @@ -46653,7 +46648,7 @@ void CodeEditorComponent::setColourForTokenType (const int tokenType, const Colo repaint(); } -const Colour CodeEditorComponent::getColourForTokenType (const int tokenType) const throw() +const Colour CodeEditorComponent::getColourForTokenType (const int tokenType) const { if (((unsigned int) tokenType) >= (unsigned int) coloursForTokenCategories.size()) return findColour (CodeEditorComponent::defaultTextColourId); @@ -46661,7 +46656,7 @@ const Colour CodeEditorComponent::getColourForTokenType (const int tokenType) co return coloursForTokenCategories.getReference (tokenType); } -void CodeEditorComponent::clearCachedIterators (const int firstLineToBeInvalid) throw() +void CodeEditorComponent::clearCachedIterators (const int firstLineToBeInvalid) { int i; for (i = cachedIterators.size(); --i >= 0;) @@ -47372,7 +47367,7 @@ bool ComboBox::isTextEditable() const throw() return label->isEditable(); } -void ComboBox::setJustificationType (const Justification& justification) throw() +void ComboBox::setJustificationType (const Justification& justification) { label->setJustificationType (justification); } @@ -47388,8 +47383,7 @@ void ComboBox::setTooltip (const String& newTooltip) label->setTooltip (newTooltip); } -void ComboBox::addItem (const String& newItemText, - const int newItemId) throw() +void ComboBox::addItem (const String& newItemText, const int newItemId) { // you can't add empty strings to the list.. jassert (newItemText.isNotEmpty()); @@ -47422,12 +47416,12 @@ void ComboBox::addItem (const String& newItemText, } } -void ComboBox::addSeparator() throw() +void ComboBox::addSeparator() { separatorPending = (items.size() > 0); } -void ComboBox::addSectionHeading (const String& headingName) throw() +void ComboBox::addSectionHeading (const String& headingName) { // you can't add empty strings to the list.. jassert (headingName.isNotEmpty()); @@ -47454,8 +47448,7 @@ void ComboBox::addSectionHeading (const String& headingName) throw() } } -void ComboBox::setItemEnabled (const int itemId, - const bool shouldBeEnabled) throw() +void ComboBox::setItemEnabled (const int itemId, const bool shouldBeEnabled) { ItemInfo* const item = getItemForId (itemId); @@ -47463,8 +47456,7 @@ void ComboBox::setItemEnabled (const int itemId, item->isEnabled = shouldBeEnabled; } -void ComboBox::changeItemText (const int itemId, - const String& newText) throw() +void ComboBox::changeItemText (const int itemId, const String& newText) { ItemInfo* const item = getItemForId (itemId); @@ -47532,7 +47524,7 @@ int ComboBox::getNumItems() const throw() return n; } -const String ComboBox::getItemText (const int index) const throw() +const String ComboBox::getItemText (const int index) const { const ItemInfo* const item = getItemForIndex (index); @@ -47569,7 +47561,7 @@ int ComboBox::indexOfItemId (const int itemId) const throw() return -1; } -int ComboBox::getSelectedItemIndex() const throw() +int ComboBox::getSelectedItemIndex() const { int index = indexOfItemId (currentId.getValue()); @@ -47579,8 +47571,7 @@ int ComboBox::getSelectedItemIndex() const throw() return index; } -void ComboBox::setSelectedItemIndex (const int index, - const bool dontSendChangeMessage) throw() +void ComboBox::setSelectedItemIndex (const int index, const bool dontSendChangeMessage) { setSelectedId (getItemId (index), dontSendChangeMessage); } @@ -47589,13 +47580,10 @@ int ComboBox::getSelectedId() const throw() { const ItemInfo* const item = getItemForId (currentId.getValue()); - return (item != 0 && getText() == item->name) - ? item->itemId - : 0; + return (item != 0 && getText() == item->name) ? item->itemId : 0; } -void ComboBox::setSelectedId (const int newItemId, - const bool dontSendChangeMessage) throw() +void ComboBox::setSelectedId (const int newItemId, const bool dontSendChangeMessage) { const ItemInfo* const item = getItemForId (newItemId); const String newItemText (item != 0 ? item->name : String::empty); @@ -47619,13 +47607,12 @@ void ComboBox::valueChanged (Value&) setSelectedId (currentId.getValue(), false); } -const String ComboBox::getText() const throw() +const String ComboBox::getText() const { return label->getText(); } -void ComboBox::setText (const String& newText, - const bool dontSendChangeMessage) throw() +void ComboBox::setText (const String& newText, const bool dontSendChangeMessage) { for (int i = items.size(); --i >= 0;) { @@ -47660,7 +47647,7 @@ void ComboBox::showEditor() label->showEditor(); } -void ComboBox::setTextWhenNothingSelected (const String& newMessage) throw() +void ComboBox::setTextWhenNothingSelected (const String& newMessage) { if (textWhenNothingSelected != newMessage) { @@ -47669,17 +47656,17 @@ void ComboBox::setTextWhenNothingSelected (const String& newMessage) throw() } } -const String ComboBox::getTextWhenNothingSelected() const throw() +const String ComboBox::getTextWhenNothingSelected() const { return textWhenNothingSelected; } -void ComboBox::setTextWhenNoChoicesAvailable (const String& newMessage) throw() +void ComboBox::setTextWhenNoChoicesAvailable (const String& newMessage) { noChoicesMessage = newMessage; } -const String ComboBox::getTextWhenNoChoicesAvailable() const throw() +const String ComboBox::getTextWhenNoChoicesAvailable() const { return noChoicesMessage; } @@ -47903,12 +47890,12 @@ void ComboBox::mouseUp (const MouseEvent& e2) } } -void ComboBox::addListener (Listener* const listener) throw() +void ComboBox::addListener (Listener* const listener) { listeners.add (listener); } -void ComboBox::removeListener (Listener* const listener) throw() +void ComboBox::removeListener (Listener* const listener) { listeners.remove (listener); } @@ -47979,7 +47966,7 @@ void Label::setText (const String& newText, } } -const String Label::getText (const bool returnActiveEditorContents) const throw() +const String Label::getText (const bool returnActiveEditorContents) const { return (returnActiveEditorContents && isBeingEdited()) ? editor->getText() @@ -47992,7 +47979,7 @@ void Label::valueChanged (Value&) setText (textValue.toString(), true); } -void Label::setFont (const Font& newFont) throw() +void Label::setFont (const Font& newFont) { if (font != newFont) { @@ -48008,7 +47995,7 @@ const Font& Label::getFont() const throw() void Label::setEditable (const bool editOnSingleClick, const bool editOnDoubleClick, - const bool lossOfFocusDiscardsChanges_) throw() + const bool lossOfFocusDiscardsChanges_) { editSingleClick = editOnSingleClick; editDoubleClick = editOnDoubleClick; @@ -48018,7 +48005,7 @@ void Label::setEditable (const bool editOnSingleClick, setFocusContainer (editOnSingleClick || editOnDoubleClick); } -void Label::setJustificationType (const Justification& newJustification) throw() +void Label::setJustificationType (const Justification& newJustification) { if (justification != newJustification) { @@ -48289,12 +48276,12 @@ KeyboardFocusTraverser* Label::createFocusTraverser() return new LabelKeyboardFocusTraverser(); } -void Label::addListener (Listener* const listener) throw() +void Label::addListener (Listener* const listener) { listeners.add (listener); } -void Label::removeListener (Listener* const listener) throw() +void Label::removeListener (Listener* const listener) { listeners.remove (listener); } diff --git a/juce_amalgamated.h b/juce_amalgamated.h index b1e14199dc..2cbe15f21c 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -14225,10 +14225,6 @@ public: const String& procedureName); #endif -#if JUCE_LINUX || DOXYGEN - -#endif - private: PlatformUtilities(); PlatformUtilities (const PlatformUtilities&); @@ -33917,7 +33913,7 @@ public: MidiBuffer& operator= (const MidiBuffer& other) throw(); /** Destructor */ - ~MidiBuffer() throw(); + ~MidiBuffer(); /** Removes all events from the buffer. */ void clear() throw(); @@ -33927,8 +33923,7 @@ public: All events for which (start <= event position < start + numSamples) will be removed. */ - void clear (const int start, - const int numSamples) throw(); + void clear (int start, int numSamples); /** Returns true if the buffer is empty. @@ -33955,8 +33950,7 @@ public: To retrieve events, use a MidiBuffer::Iterator object */ - void addEvent (const MidiMessage& midiMessage, - const int sampleNumber) throw(); + void addEvent (const MidiMessage& midiMessage, int sampleNumber); /** Adds an event to the buffer from raw midi data. @@ -33974,9 +33968,9 @@ public: To retrieve events, use a MidiBuffer::Iterator object */ - void addEvent (const uint8* const rawMidiData, - const int maxBytesOfMidiData, - const int sampleNumber) throw(); + void addEvent (const void* rawMidiData, + int maxBytesOfMidiData, + int sampleNumber); /** Adds some events from another buffer to this one. @@ -33993,9 +33987,9 @@ public: that are added to this buffer */ void addEvents (const MidiBuffer& otherBuffer, - const int startSample, - const int numSamples, - const int sampleDeltaToAdd) throw(); + int startSample, + int numSamples, + int sampleDeltaToAdd); /** Returns the sample number of the first event in the buffer. @@ -34043,7 +34037,7 @@ public: /** Repositions the iterator so that the next event retrieved will be the first one whose sample position is at greater than or equal to the given position. */ - void setNextSamplePosition (const int samplePosition) throw(); + void setNextSamplePosition (int samplePosition) throw(); /** Retrieves a copy of the next event from the buffer. @@ -34090,7 +34084,7 @@ private: int bytesUsed; uint8* getData() const throw(); - uint8* findEventAfter (uint8* d, const int samplePosition) const throw(); + uint8* findEventAfter (uint8* d, int samplePosition) const throw(); static int getEventTime (const void* d) throw(); static uint16 getEventDataSize (const void* d) throw(); static uint16 getEventTotalSize (const void* d) throw(); @@ -36510,7 +36504,7 @@ public: the user has finished typing and pressed the return key. */ - const String getText (bool returnActiveEditorContents = false) const throw(); + const String getText (bool returnActiveEditorContents = false) const; /** Returns the text content as a Value object. You can call Value::referTo() on this object to make the label read and control @@ -36522,7 +36516,7 @@ public: @see getFont */ - void setFont (const Font& newFont) throw(); + void setFont (const Font& newFont); /** Returns the font currently being used. @@ -36552,7 +36546,7 @@ public: (The default is Justification::centredLeft) */ - void setJustificationType (const Justification& justification) throw(); + void setJustificationType (const Justification& justification); /** Returns the type of justification, as set in setJustificationType(). */ const Justification getJustificationType() const throw() { return justification; } @@ -36627,10 +36621,10 @@ public: }; /** Registers a listener that will be called when the label's text changes. */ - void addListener (Listener* listener) throw(); + void addListener (Listener* listener); /** Deregisters a previously-registered listener. */ - void removeListener (Listener* listener) throw(); + void removeListener (Listener* listener); /** Makes the label turn into a TextEditor when clicked. @@ -36654,7 +36648,7 @@ public: */ void setEditable (bool editOnSingleClick, bool editOnDoubleClick = false, - bool lossOfFocusDiscardsChanges = false) throw(); + bool lossOfFocusDiscardsChanges = false); /** Returns true if this option was set using setEditable(). */ bool isEditableOnSingleClick() const throw() { return editSingleClick; } @@ -36822,7 +36816,7 @@ public: The default is Justification::centredLeft. The text is displayed using a Label component inside the ComboBox. */ - void setJustificationType (const Justification& justification) throw(); + void setJustificationType (const Justification& justification); /** Returns the current justification for the text box. @see setJustificationType @@ -36837,14 +36831,13 @@ public: be 0! @see setItemEnabled, addSeparator, addSectionHeading, removeItem, getNumItems, getItemText, getItemId */ - void addItem (const String& newItemText, - int newItemId) throw(); + void addItem (const String& newItemText, int newItemId); /** Adds a separator line to the drop-down list. This is like adding a separator to a popup menu. See PopupMenu::addSeparator(). */ - void addSeparator() throw(); + void addSeparator(); /** Adds a heading to the drop-down list, so that you can group the items into different sections. @@ -36855,7 +36848,7 @@ public: @see addItem, addSeparator */ - void addSectionHeading (const String& headingName) throw(); + void addSectionHeading (const String& headingName); /** This allows items in the drop-down list to be selectively disabled. @@ -36865,13 +36858,11 @@ public: If you disable an item which is already selected, this won't change the current selection - it just stops the user choosing that item from the list. */ - void setItemEnabled (int itemId, - bool shouldBeEnabled) throw(); + void setItemEnabled (int itemId, bool shouldBeEnabled); /** Changes the text for an existing item. */ - void changeItemText (int itemId, - const String& newText) throw(); + void changeItemText (int itemId, const String& newText); /** Removes all the items from the drop-down list. @@ -36894,7 +36885,7 @@ public: @param index the item's index from 0 to (getNumItems() - 1) */ - const String getItemText (int index) const throw(); + const String getItemText (int index) const; /** Returns the ID for one of the items in the list. @@ -36924,7 +36915,7 @@ public: You can call Value::referTo() on this object to make the combo box control another Value object. */ - Value& getSelectedIdAsValue() throw() { return currentId; } + Value& getSelectedIdAsValue() { return currentId; } /** Sets one of the items to be the current selection. @@ -36936,8 +36927,7 @@ public: change notification @see getSelectedId, setSelectedItemIndex, setText */ - void setSelectedId (int newItemId, - bool dontSendChangeMessage = false) throw(); + void setSelectedId (int newItemId, bool dontSendChangeMessage = false); /** Returns the index of the item that's currently shown in the box. @@ -36947,7 +36937,7 @@ public: @see setSelectedItemIndex, getSelectedId, getText */ - int getSelectedItemIndex() const throw(); + int getSelectedItemIndex() const; /** Sets one of the items to be the current selection. @@ -36959,8 +36949,7 @@ public: change notification @see getSelectedItemIndex, setSelectedId, setText */ - void setSelectedItemIndex (int newItemIndex, - bool dontSendChangeMessage = false) throw(); + void setSelectedItemIndex (int newItemIndex, bool dontSendChangeMessage = false); /** Returns the text that is currently shown in the combo-box's text field. @@ -36970,7 +36959,7 @@ public: @see setText, getSelectedId, getSelectedItemIndex */ - const String getText() const throw(); + const String getText() const; /** Sets the contents of the combo-box's text field. @@ -36984,8 +36973,7 @@ public: change notification @see getText */ - void setText (const String& newText, - bool dontSendChangeMessage = false) throw(); + void setText (const String& newText, bool dontSendChangeMessage = false); /** Programmatically opens the text editor to allow the user to edit the current item. @@ -37016,22 +37004,22 @@ public: }; /** Registers a listener that will be called when the box's content changes. */ - void addListener (Listener* listener) throw(); + void addListener (Listener* listener); /** Deregisters a previously-registered listener. */ - void removeListener (Listener* listener) throw(); + void removeListener (Listener* listener); /** Sets a message to display when there is no item currently selected. @see getTextWhenNothingSelected */ - void setTextWhenNothingSelected (const String& newMessage) throw(); + void setTextWhenNothingSelected (const String& newMessage); /** Returns the text that is shown when no item is selected. @see setTextWhenNothingSelected */ - const String getTextWhenNothingSelected() const throw(); + const String getTextWhenNothingSelected() const; /** Sets the message to show when there are no items in the list, and the user clicks on the drop-down box. @@ -37039,12 +37027,12 @@ public: By default it just says "no choices", but this lets you change it to something more meaningful. */ - void setTextWhenNoChoicesAvailable (const String& newMessage) throw(); + void setTextWhenNoChoicesAvailable (const String& newMessage); /** Returns the text shown when no items have been added to the list. @see setTextWhenNoChoicesAvailable */ - const String getTextWhenNoChoicesAvailable() const throw(); + const String getTextWhenNoChoicesAvailable() const; /** Gives the ComboBox a tooltip. */ void setTooltip (const String& newTooltip); @@ -37988,7 +37976,7 @@ public: @returns a pointer to the track, or 0 if the index is out-of-range @see getNumTracks, addTrack */ - const MidiMessageSequence* getTrack (const int index) const throw(); + const MidiMessageSequence* getTrack (int index) const throw(); /** Adds a midi track to the file. @@ -38027,7 +38015,7 @@ public: @param ticksPerQuarterNote e.g. 96, 960 @see setSmpteTimeFormat */ - void setTicksPerQuarterNote (const int ticksPerQuarterNote) throw(); + void setTicksPerQuarterNote (int ticksPerQuarterNote) throw(); /** Sets the time format to use when this file is written to a stream. @@ -38041,8 +38029,8 @@ public: timing, setSmpteTimeFormat (25, 40) @see setTicksPerBeat */ - void setSmpteTimeFormat (const int framesPerSecond, - const int subframeResolution) throw(); + void setSmpteTimeFormat (int framesPerSecond, + int subframeResolution) throw(); /** Makes a list of all the tempo-change meta-events from all tracks in the midi file. @@ -38094,10 +38082,6 @@ public: juce_UseDebuggingNewOperator - /** @internal */ - static int compareElements (const MidiMessageSequence::MidiEventHolder* const first, - const MidiMessageSequence::MidiEventHolder* const second); - private: OwnedArray tracks; short timeFormat; @@ -38269,13 +38253,13 @@ public: @see removeListener */ - void addListener (MidiKeyboardStateListener* const listener) throw(); + void addListener (MidiKeyboardStateListener* listener); /** Deregisters a listener. @see addListener */ - void removeListener (MidiKeyboardStateListener* const listener) throw(); + void removeListener (MidiKeyboardStateListener* listener); juce_UseDebuggingNewOperator @@ -39099,10 +39083,10 @@ public: virtual void setCurrentProgramStateInformation (const void* data, int sizeInBytes); /** Adds a listener that will be called when an aspect of this processor changes. */ - void addListener (AudioProcessorListener* const newListener) throw(); + void addListener (AudioProcessorListener* const newListener); /** Removes a previously added listener. */ - void removeListener (AudioProcessorListener* const listenerToRemove) throw(); + void removeListener (AudioProcessorListener* const listenerToRemove); /** Not for public use - this is called before deleting an editor component. */ void editorBeingDeleted (AudioProcessorEditor* const editor) throw(); @@ -39182,10 +39166,10 @@ class JUCE_API PluginDescription { public: - PluginDescription() throw(); - PluginDescription (const PluginDescription& other) throw(); - PluginDescription& operator= (const PluginDescription& other) throw(); - ~PluginDescription() throw(); + PluginDescription(); + PluginDescription (const PluginDescription& other); + PluginDescription& operator= (const PluginDescription& other); + ~PluginDescription(); /** The name of the plugin. */ String name; @@ -39249,7 +39233,7 @@ public: plugin's file location, so can be used to store a plugin ID for use across different machines. */ - const String createIdentifierString() const throw(); + const String createIdentifierString() const; /** Creates an XML object containing these details. @@ -39730,10 +39714,10 @@ class JUCE_API AudioPluginFormatManager : public DeletedAtShutdown { public: - AudioPluginFormatManager() throw(); + AudioPluginFormatManager(); /** Destructor. */ - ~AudioPluginFormatManager() throw(); + ~AudioPluginFormatManager(); juce_DeclareSingleton_SingleThreaded (AudioPluginFormatManager, false); @@ -39745,19 +39729,19 @@ public: Use getFormat() to get one of them. */ - int getNumFormats() throw(); + int getNumFormats(); /** Returns one of the available formats. @see getNumFormats */ - AudioPluginFormat* getFormat (const int index) throw(); + AudioPluginFormat* getFormat (const int index); /** Adds a format to the list. The object passed in will be owned and deleted by the manager. */ - void addFormat (AudioPluginFormat* const format) throw(); + void addFormat (AudioPluginFormat* const format); /** Tries to load the type for this description, by trying all the formats that this manager knows about. @@ -39846,7 +39830,7 @@ public: bool addType (const PluginDescription& type); /** Removes a type. */ - void removeType (int index) throw(); + void removeType (int index); /** Looks for all types that can be loaded from a given file, and adds them to the list. @@ -39997,7 +39981,7 @@ public: This is handy if you want to show the user which file is currently getting scanned. */ - const String getNextPluginFileThatWillBeScanned() const throw(); + const String getNextPluginFileThatWillBeScanned() const; /** Returns the estimated progress, between 0 and 1. */ @@ -40019,8 +40003,8 @@ private: int nextIndex; float progress; - const StringArray getDeadMansPedalFile() throw(); - void setDeadMansPedalFile (const StringArray& newContents) throw(); + const StringArray getDeadMansPedalFile(); + void setDeadMansPedalFile (const StringArray& newContents); PluginDirectoryScanner (const PluginDirectoryScanner&); PluginDirectoryScanner& operator= (const PluginDirectoryScanner&); @@ -42624,10 +42608,10 @@ public: @see broadcastMessage */ - void registerBroadcastListener (ActionListener* listener) throw(); + void registerBroadcastListener (ActionListener* listener); /** Deregisters a broadcast listener. */ - void deregisterBroadcastListener (ActionListener* listener) throw(); + void deregisterBroadcastListener (ActionListener* listener); /** @internal */ void deliverMessage (Message*); @@ -42746,14 +42730,14 @@ public: @endcode */ - MessageManagerLock (Thread* threadToCheckForExitSignal = 0) throw(); + MessageManagerLock (Thread* threadToCheckForExitSignal = 0); /** This has the same behaviour as the other constructor, but takes a ThreadPoolJob instead of a thread. See the MessageManagerLock (Thread*) constructor for details on how this works. */ - MessageManagerLock (ThreadPoolJob* jobToCheckForExitSignal) throw(); + MessageManagerLock (ThreadPoolJob* jobToCheckForExitSignal); /** Releases the current thread's lock on the message manager. @@ -42776,7 +42760,7 @@ private: SharedEvents* sharedEvents; bool locked; - void init (Thread* thread, ThreadPoolJob* job) throw(); + void init (Thread* thread, ThreadPoolJob* job); MessageManagerLock (const MessageManagerLock&); MessageManagerLock& operator= (const MessageManagerLock&); @@ -45192,9 +45176,9 @@ public: Position (const Position& other) throw(); /** Destructor. */ - ~Position() throw(); + ~Position(); - Position& operator= (const Position& other) throw(); + Position& operator= (const Position& other); bool operator== (const Position& other) const throw(); bool operator!= (const Position& other) const throw(); @@ -45204,7 +45188,7 @@ public: inside. @see getPosition, setLineAndIndex */ - void setPosition (int charactersFromStartOfDocument) throw(); + void setPosition (int charactersFromStartOfDocument); /** Returns the position as the number of characters from the start of the document. @see setPosition, getLineNumber, getIndexInLine @@ -45220,7 +45204,7 @@ public: Lines are numbered from zero, and if the line or index are beyond the bounds of the document, they will be adjusted to keep them within its limits. */ - void setLineAndIndex (int newLine, int newIndexInLine) throw(); + void setLineAndIndex (int newLine, int newIndexInLine); /** Returns the line number of this position. The first line in the document is numbered zero, not one! @@ -45241,34 +45225,34 @@ public: when the document has text inserted or deleted, this position will be automatically moved to keep it at the same position in the text. */ - void setPositionMaintained (bool isMaintained) throw(); + void setPositionMaintained (bool isMaintained); /** Moves the position forwards or backwards by the specified number of characters. @see movedBy */ - void moveBy (int characterDelta) throw(); + void moveBy (int characterDelta); /** Returns a position which is the same as this one, moved by the specified number of characters. @see moveBy */ - const Position movedBy (int characterDelta) const throw(); + const Position movedBy (int characterDelta) const; /** Returns a position which is the same as this one, moved up or down by the specified number of lines. @see movedBy */ - const Position movedByLines (int deltaLines) const throw(); + const Position movedByLines (int deltaLines) const; /** Returns the character in the document at this position. @see getLineText */ - const juce_wchar getCharacter() const throw(); + const juce_wchar getCharacter() const; /** Returns the line from the document that this position is within. @see getCharacter, getLineNumber */ - const String getLineText() const throw(); + const String getLineText() const; private: CodeDocument* owner; @@ -45277,10 +45261,10 @@ public: }; /** Returns the full text of the document. */ - const String getAllContent() const throw(); + const String getAllContent() const; /** Returns a section of the document's text. */ - const String getTextBetween (const Position& start, const Position& end) const throw(); + const String getTextBetween (const Position& start, const Position& end) const; /** Returns a line from the document. */ const String getLine (int lineIndex) const throw(); @@ -45605,7 +45589,7 @@ public: /** Returns the on-screen position of a character in the document. The rectangle returned is relative to this component's top-left origin. */ - const Rectangle getCharacterBounds (const CodeDocument::Position& pos) const throw(); + const Rectangle getCharacterBounds (const CodeDocument::Position& pos) const; /** Finds the character at a given on-screen position. The co-ordinates are relative to this component's top-left origin. @@ -45655,8 +45639,7 @@ public: This lets you change the tab size and whether pressing the tab key inserts a tab character, or its equivalent number of spaces. */ - void setTabSize (int numSpacesPerTab, - bool insertSpacesInsteadOfTabCharacters) throw(); + void setTabSize (int numSpacesPerTab, bool insertSpacesInsteadOfTabCharacters); /** Returns the current number of spaces per tab. @see setTabSize @@ -45694,7 +45677,7 @@ public: CodeTokeniser::getTokenTypes() to get a list of the token types. @see setColourForTokenType */ - const Colour getColourForTokenType (int tokenType) const throw(); + const Colour getColourForTokenType (int tokenType) const; /** A set of colour IDs to use to change the colour of various aspects of the editor. @@ -45714,7 +45697,7 @@ public: }; /** Changes the size of the scrollbars. */ - void setScrollbarThickness (int thickness) throw(); + void setScrollbarThickness (int thickness); /** Returns the thickness of the scrollbars. */ int getScrollbarThickness() const throw() { return scrollbarThickness; } @@ -45788,7 +45771,7 @@ private: void rebuildLineTokens(); OwnedArray cachedIterators; - void clearCachedIterators (int firstLineToBeInvalid) throw(); + void clearCachedIterators (int firstLineToBeInvalid); void updateCachedIterators (int maxLineNum); void getIteratorForPosition (int position, CodeDocument::Iterator& result); void moveLineDelta (int delta, bool selecting); diff --git a/src/audio/midi/juce_MidiBuffer.cpp b/src/audio/midi/juce_MidiBuffer.cpp index 3d8974f750..54e8f9f279 100644 --- a/src/audio/midi/juce_MidiBuffer.cpp +++ b/src/audio/midi/juce_MidiBuffer.cpp @@ -62,7 +62,7 @@ void MidiBuffer::swapWith (MidiBuffer& other) swapVariables (bytesUsed, other.bytesUsed); } -MidiBuffer::~MidiBuffer() throw() +MidiBuffer::~MidiBuffer() { } @@ -91,8 +91,7 @@ void MidiBuffer::clear() throw() bytesUsed = 0; } -void MidiBuffer::clear (const int startSample, - const int numSamples) throw() +void MidiBuffer::clear (const int startSample, const int numSamples) { uint8* const start = findEventAfter (getData(), startSample - 1); uint8* const end = findEventAfter (start, startSample + numSamples - 1); @@ -108,17 +107,14 @@ void MidiBuffer::clear (const int startSample, } } -void MidiBuffer::addEvent (const MidiMessage& m, - const int sampleNumber) throw() +void MidiBuffer::addEvent (const MidiMessage& m, const int sampleNumber) { addEvent (m.getRawData(), m.getRawDataSize(), sampleNumber); } -static int findActualEventLength (const uint8* const data, - const int maxBytes) throw() +static int findActualEventLength (const uint8* const data, const int maxBytes) throw() { unsigned int byte = (unsigned int) *data; - int size = 0; if (byte == 0xf0 || byte == 0xf7) @@ -145,11 +141,9 @@ static int findActualEventLength (const uint8* const data, return size; } -void MidiBuffer::addEvent (const uint8* const newData, - const int maxBytes, - const int sampleNumber) throw() +void MidiBuffer::addEvent (const void* const newData, const int maxBytes, const int sampleNumber) { - const int numBytes = findActualEventLength (newData, maxBytes); + const int numBytes = findActualEventLength (static_cast (newData), maxBytes); if (numBytes > 0) { @@ -176,7 +170,7 @@ void MidiBuffer::addEvent (const uint8* const newData, void MidiBuffer::addEvents (const MidiBuffer& otherBuffer, const int startSample, const int numSamples, - const int sampleDeltaToAdd) throw() + const int sampleDeltaToAdd) { Iterator i (otherBuffer); i.setNextSamplePosition (startSample); diff --git a/src/audio/midi/juce_MidiBuffer.h b/src/audio/midi/juce_MidiBuffer.h index 5bbbe550d4..9f26006798 100644 --- a/src/audio/midi/juce_MidiBuffer.h +++ b/src/audio/midi/juce_MidiBuffer.h @@ -56,7 +56,7 @@ public: MidiBuffer& operator= (const MidiBuffer& other) throw(); /** Destructor */ - ~MidiBuffer() throw(); + ~MidiBuffer(); //============================================================================== /** Removes all events from the buffer. */ @@ -67,8 +67,7 @@ public: All events for which (start <= event position < start + numSamples) will be removed. */ - void clear (const int start, - const int numSamples) throw(); + void clear (int start, int numSamples); /** Returns true if the buffer is empty. @@ -95,8 +94,7 @@ public: To retrieve events, use a MidiBuffer::Iterator object */ - void addEvent (const MidiMessage& midiMessage, - const int sampleNumber) throw(); + void addEvent (const MidiMessage& midiMessage, int sampleNumber); /** Adds an event to the buffer from raw midi data. @@ -114,9 +112,9 @@ public: To retrieve events, use a MidiBuffer::Iterator object */ - void addEvent (const uint8* const rawMidiData, - const int maxBytesOfMidiData, - const int sampleNumber) throw(); + void addEvent (const void* rawMidiData, + int maxBytesOfMidiData, + int sampleNumber); /** Adds some events from another buffer to this one. @@ -133,9 +131,9 @@ public: that are added to this buffer */ void addEvents (const MidiBuffer& otherBuffer, - const int startSample, - const int numSamples, - const int sampleDeltaToAdd) throw(); + int startSample, + int numSamples, + int sampleDeltaToAdd); /** Returns the sample number of the first event in the buffer. @@ -186,7 +184,7 @@ public: /** Repositions the iterator so that the next event retrieved will be the first one whose sample position is at greater than or equal to the given position. */ - void setNextSamplePosition (const int samplePosition) throw(); + void setNextSamplePosition (int samplePosition) throw(); /** Retrieves a copy of the next event from the buffer. @@ -236,7 +234,7 @@ private: int bytesUsed; uint8* getData() const throw(); - uint8* findEventAfter (uint8* d, const int samplePosition) const throw(); + uint8* findEventAfter (uint8* d, int samplePosition) const throw(); static int getEventTime (const void* d) throw(); static uint16 getEventDataSize (const void* d) throw(); static uint16 getEventTotalSize (const void* d) throw(); diff --git a/src/audio/midi/juce_MidiFile.cpp b/src/audio/midi/juce_MidiFile.cpp index ad3d458a83..31b4cab7fa 100644 --- a/src/audio/midi/juce_MidiFile.cpp +++ b/src/audio/midi/juce_MidiFile.cpp @@ -160,6 +160,31 @@ namespace MidiFileHelpers return time / (((timeFormat & 0x7fff) >> 8) * (timeFormat & 0xff)); } } + + // a comparator that puts all the note-offs before note-ons that have the same time + struct Sorter + { + static int compareElements (const MidiMessageSequence::MidiEventHolder* const first, + const MidiMessageSequence::MidiEventHolder* const second) throw() + { + const double diff = (first->message.getTimeStamp() - second->message.getTimeStamp()); + + if (diff == 0) + { + if (first->message.isNoteOff() && second->message.isNoteOn()) + return -1; + else if (first->message.isNoteOn() && second->message.isNoteOff()) + return 1; + else + return 0; + } + else + { + return (diff > 0) ? 1 : -1; + } + } + }; + } //============================================================================== @@ -305,27 +330,6 @@ bool MidiFile::readFrom (InputStream& sourceStream) return false; } -// a comparator that puts all the note-offs before note-ons that have the same time -int MidiFile::compareElements (const MidiMessageSequence::MidiEventHolder* const first, - const MidiMessageSequence::MidiEventHolder* const second) -{ - const double diff = (first->message.getTimeStamp() - second->message.getTimeStamp()); - - if (diff == 0) - { - if (first->message.isNoteOff() && second->message.isNoteOn()) - return -1; - else if (first->message.isNoteOn() && second->message.isNoteOff()) - return 1; - else - return 0; - } - else - { - return (diff > 0) ? 1 : -1; - } -} - void MidiFile::readNextTrack (const uint8* data, int size) { double time = 0; @@ -358,7 +362,8 @@ void MidiFile::readNextTrack (const uint8* data, int size) } // use a sort that puts all the note-offs before note-ons that have the same time - result.list.sort (*this, true); + MidiFileHelpers::Sorter sorter; + result.list.sort (sorter, true); result.updateMatchedPairs(); diff --git a/src/audio/midi/juce_MidiFile.h b/src/audio/midi/juce_MidiFile.h index 599cb44389..84047b67aa 100644 --- a/src/audio/midi/juce_MidiFile.h +++ b/src/audio/midi/juce_MidiFile.h @@ -67,7 +67,7 @@ public: @returns a pointer to the track, or 0 if the index is out-of-range @see getNumTracks, addTrack */ - const MidiMessageSequence* getTrack (const int index) const throw(); + const MidiMessageSequence* getTrack (int index) const throw(); /** Adds a midi track to the file. @@ -106,7 +106,7 @@ public: @param ticksPerQuarterNote e.g. 96, 960 @see setSmpteTimeFormat */ - void setTicksPerQuarterNote (const int ticksPerQuarterNote) throw(); + void setTicksPerQuarterNote (int ticksPerQuarterNote) throw(); /** Sets the time format to use when this file is written to a stream. @@ -120,8 +120,8 @@ public: timing, setSmpteTimeFormat (25, 40) @see setTicksPerBeat */ - void setSmpteTimeFormat (const int framesPerSecond, - const int subframeResolution) throw(); + void setSmpteTimeFormat (int framesPerSecond, + int subframeResolution) throw(); //============================================================================== /** Makes a list of all the tempo-change meta-events from all tracks in the midi file. @@ -177,10 +177,6 @@ public: //============================================================================== juce_UseDebuggingNewOperator - /** @internal */ - static int compareElements (const MidiMessageSequence::MidiEventHolder* const first, - const MidiMessageSequence::MidiEventHolder* const second); - private: OwnedArray tracks; short timeFormat; diff --git a/src/audio/midi/juce_MidiKeyboardState.cpp b/src/audio/midi/juce_MidiKeyboardState.cpp index 1a2281a1b8..d663e6d8a7 100644 --- a/src/audio/midi/juce_MidiKeyboardState.cpp +++ b/src/audio/midi/juce_MidiKeyboardState.cpp @@ -180,13 +180,13 @@ void MidiKeyboardState::processNextMidiBuffer (MidiBuffer& buffer, } //============================================================================== -void MidiKeyboardState::addListener (MidiKeyboardStateListener* const listener) throw() +void MidiKeyboardState::addListener (MidiKeyboardStateListener* const listener) { const ScopedLock sl (lock); listeners.addIfNotAlreadyThere (listener); } -void MidiKeyboardState::removeListener (MidiKeyboardStateListener* const listener) throw() +void MidiKeyboardState::removeListener (MidiKeyboardStateListener* const listener) { const ScopedLock sl (lock); listeners.removeValue (listener); diff --git a/src/audio/midi/juce_MidiKeyboardState.h b/src/audio/midi/juce_MidiKeyboardState.h index b57f44cf36..5a71bf6845 100644 --- a/src/audio/midi/juce_MidiKeyboardState.h +++ b/src/audio/midi/juce_MidiKeyboardState.h @@ -186,13 +186,13 @@ public: @see removeListener */ - void addListener (MidiKeyboardStateListener* const listener) throw(); + void addListener (MidiKeyboardStateListener* listener); /** Deregisters a listener. @see addListener */ - void removeListener (MidiKeyboardStateListener* const listener) throw(); + void removeListener (MidiKeyboardStateListener* listener); //============================================================================== juce_UseDebuggingNewOperator diff --git a/src/audio/midi/juce_MidiMessage.cpp b/src/audio/midi/juce_MidiMessage.cpp index d29d06a36e..a57c90933f 100644 --- a/src/audio/midi/juce_MidiMessage.cpp +++ b/src/audio/midi/juce_MidiMessage.cpp @@ -32,8 +32,7 @@ BEGIN_JUCE_NAMESPACE //============================================================================== -int MidiMessage::readVariableLengthVal (const uint8* data, - int& numBytesUsed) throw() +int MidiMessage::readVariableLengthVal (const uint8* data, int& numBytesUsed) throw() { numBytesUsed = 0; int v = 0; diff --git a/src/audio/plugins/juce_AudioPluginFormatManager.cpp b/src/audio/plugins/juce_AudioPluginFormatManager.cpp index 201fa4bcf8..2d7fdba17d 100644 --- a/src/audio/plugins/juce_AudioPluginFormatManager.cpp +++ b/src/audio/plugins/juce_AudioPluginFormatManager.cpp @@ -38,11 +38,11 @@ BEGIN_JUCE_NAMESPACE //============================================================================== -AudioPluginFormatManager::AudioPluginFormatManager() throw() +AudioPluginFormatManager::AudioPluginFormatManager() { } -AudioPluginFormatManager::~AudioPluginFormatManager() throw() +AudioPluginFormatManager::~AudioPluginFormatManager() { clearSingletonInstance(); } @@ -91,17 +91,17 @@ void AudioPluginFormatManager::addDefaultFormats() #endif } -int AudioPluginFormatManager::getNumFormats() throw() +int AudioPluginFormatManager::getNumFormats() { return formats.size(); } -AudioPluginFormat* AudioPluginFormatManager::getFormat (const int index) throw() +AudioPluginFormat* AudioPluginFormatManager::getFormat (const int index) { return formats [index]; } -void AudioPluginFormatManager::addFormat (AudioPluginFormat* const format) throw() +void AudioPluginFormatManager::addFormat (AudioPluginFormat* const format) { formats.add (format); } diff --git a/src/audio/plugins/juce_AudioPluginFormatManager.h b/src/audio/plugins/juce_AudioPluginFormatManager.h index 5d49509322..02bdd38293 100644 --- a/src/audio/plugins/juce_AudioPluginFormatManager.h +++ b/src/audio/plugins/juce_AudioPluginFormatManager.h @@ -41,10 +41,10 @@ class JUCE_API AudioPluginFormatManager : public DeletedAtShutdown { public: //============================================================================== - AudioPluginFormatManager() throw(); + AudioPluginFormatManager(); /** Destructor. */ - ~AudioPluginFormatManager() throw(); + ~AudioPluginFormatManager(); juce_DeclareSingleton_SingleThreaded (AudioPluginFormatManager, false); @@ -58,20 +58,20 @@ public: Use getFormat() to get one of them. */ - int getNumFormats() throw(); + int getNumFormats(); /** Returns one of the available formats. @see getNumFormats */ - AudioPluginFormat* getFormat (const int index) throw(); + AudioPluginFormat* getFormat (const int index); //============================================================================== /** Adds a format to the list. The object passed in will be owned and deleted by the manager. */ - void addFormat (AudioPluginFormat* const format) throw(); + void addFormat (AudioPluginFormat* const format); //============================================================================== diff --git a/src/audio/plugins/juce_KnownPluginList.cpp b/src/audio/plugins/juce_KnownPluginList.cpp index 6e1d14eaca..78e73c4d18 100644 --- a/src/audio/plugins/juce_KnownPluginList.cpp +++ b/src/audio/plugins/juce_KnownPluginList.cpp @@ -87,7 +87,7 @@ bool KnownPluginList::addType (const PluginDescription& type) return true; } -void KnownPluginList::removeType (const int index) throw() +void KnownPluginList::removeType (const int index) { types.remove (index); sendChangeMessage (this); @@ -95,11 +95,8 @@ void KnownPluginList::removeType (const int index) throw() static Time getFileModTime (const String& fileOrIdentifier) throw() { - if (fileOrIdentifier.startsWithChar ('/') - || fileOrIdentifier[1] == ':') - { + if (fileOrIdentifier.startsWithChar ('/') || fileOrIdentifier[1] == ':') return File (fileOrIdentifier).getLastModificationTime(); - } return Time (0); } diff --git a/src/audio/plugins/juce_KnownPluginList.h b/src/audio/plugins/juce_KnownPluginList.h index ace0c131ea..d7fc868120 100644 --- a/src/audio/plugins/juce_KnownPluginList.h +++ b/src/audio/plugins/juce_KnownPluginList.h @@ -81,7 +81,7 @@ public: bool addType (const PluginDescription& type); /** Removes a type. */ - void removeType (int index) throw(); + void removeType (int index); /** Looks for all types that can be loaded from a given file, and adds them to the list. diff --git a/src/audio/plugins/juce_PluginDescription.cpp b/src/audio/plugins/juce_PluginDescription.cpp index 33f410c3b0..6372a5e0f1 100644 --- a/src/audio/plugins/juce_PluginDescription.cpp +++ b/src/audio/plugins/juce_PluginDescription.cpp @@ -32,7 +32,7 @@ BEGIN_JUCE_NAMESPACE //============================================================================== -PluginDescription::PluginDescription() throw() +PluginDescription::PluginDescription() : uid (0), isInstrument (false), numInputChannels (0), @@ -40,11 +40,11 @@ PluginDescription::PluginDescription() throw() { } -PluginDescription::~PluginDescription() throw() +PluginDescription::~PluginDescription() { } -PluginDescription::PluginDescription (const PluginDescription& other) throw() +PluginDescription::PluginDescription (const PluginDescription& other) : name (other.name), pluginFormatName (other.pluginFormatName), category (other.category), @@ -59,7 +59,7 @@ PluginDescription::PluginDescription (const PluginDescription& other) throw() { } -PluginDescription& PluginDescription::operator= (const PluginDescription& other) throw() +PluginDescription& PluginDescription::operator= (const PluginDescription& other) { name = other.name; pluginFormatName = other.pluginFormatName; @@ -82,7 +82,7 @@ bool PluginDescription::isDuplicateOf (const PluginDescription& other) const && uid == other.uid; } -const String PluginDescription::createIdentifierString() const throw() +const String PluginDescription::createIdentifierString() const { return pluginFormatName + "-" + name diff --git a/src/audio/plugins/juce_PluginDescription.h b/src/audio/plugins/juce_PluginDescription.h index 790e36d204..3d782e0490 100644 --- a/src/audio/plugins/juce_PluginDescription.h +++ b/src/audio/plugins/juce_PluginDescription.h @@ -45,10 +45,10 @@ class JUCE_API PluginDescription { public: //============================================================================== - PluginDescription() throw(); - PluginDescription (const PluginDescription& other) throw(); - PluginDescription& operator= (const PluginDescription& other) throw(); - ~PluginDescription() throw(); + PluginDescription(); + PluginDescription (const PluginDescription& other); + PluginDescription& operator= (const PluginDescription& other); + ~PluginDescription(); //============================================================================== /** The name of the plugin. */ @@ -114,7 +114,7 @@ public: plugin's file location, so can be used to store a plugin ID for use across different machines. */ - const String createIdentifierString() const throw(); + const String createIdentifierString() const; //============================================================================== /** Creates an XML object containing these details. diff --git a/src/audio/plugins/juce_PluginDirectoryScanner.cpp b/src/audio/plugins/juce_PluginDirectoryScanner.cpp index 2886fd8e3e..2806ede58e 100644 --- a/src/audio/plugins/juce_PluginDirectoryScanner.cpp +++ b/src/audio/plugins/juce_PluginDirectoryScanner.cpp @@ -67,7 +67,7 @@ PluginDirectoryScanner::~PluginDirectoryScanner() } //============================================================================== -const String PluginDirectoryScanner::getNextPluginFileThatWillBeScanned() const throw() +const String PluginDirectoryScanner::getNextPluginFileThatWillBeScanned() const { return format.getNameOfPluginFromIdentifier (filesOrIdentifiersToScan [nextIndex]); } @@ -108,7 +108,7 @@ bool PluginDirectoryScanner::scanNextFile (const bool dontRescanIfAlreadyInList) return nextIndex < filesOrIdentifiersToScan.size(); } -const StringArray PluginDirectoryScanner::getDeadMansPedalFile() throw() +const StringArray PluginDirectoryScanner::getDeadMansPedalFile() { StringArray lines; @@ -121,7 +121,7 @@ const StringArray PluginDirectoryScanner::getDeadMansPedalFile() throw() return lines; } -void PluginDirectoryScanner::setDeadMansPedalFile (const StringArray& newContents) throw() +void PluginDirectoryScanner::setDeadMansPedalFile (const StringArray& newContents) { if (deadMansPedalFile != File::nonexistent) deadMansPedalFile.replaceWithText (newContents.joinIntoString ("\n"), true, true); diff --git a/src/audio/plugins/juce_PluginDirectoryScanner.h b/src/audio/plugins/juce_PluginDirectoryScanner.h index edb146ee7f..4aefc9704a 100644 --- a/src/audio/plugins/juce_PluginDirectoryScanner.h +++ b/src/audio/plugins/juce_PluginDirectoryScanner.h @@ -89,7 +89,7 @@ public: This is handy if you want to show the user which file is currently getting scanned. */ - const String getNextPluginFileThatWillBeScanned() const throw(); + const String getNextPluginFileThatWillBeScanned() const; /** Returns the estimated progress, between 0 and 1. */ @@ -112,8 +112,8 @@ private: int nextIndex; float progress; - const StringArray getDeadMansPedalFile() throw(); - void setDeadMansPedalFile (const StringArray& newContents) throw(); + const StringArray getDeadMansPedalFile(); + void setDeadMansPedalFile (const StringArray& newContents); PluginDirectoryScanner (const PluginDirectoryScanner&); PluginDirectoryScanner& operator= (const PluginDirectoryScanner&); diff --git a/src/audio/processors/juce_AudioProcessor.cpp b/src/audio/processors/juce_AudioProcessor.cpp index ff17d955ef..17b5a8e627 100644 --- a/src/audio/processors/juce_AudioProcessor.cpp +++ b/src/audio/processors/juce_AudioProcessor.cpp @@ -64,13 +64,13 @@ void AudioProcessor::setPlayHead (AudioPlayHead* const newPlayHead) throw() playHead = newPlayHead; } -void AudioProcessor::addListener (AudioProcessorListener* const newListener) throw() +void AudioProcessor::addListener (AudioProcessorListener* const newListener) { const ScopedLock sl (listenerLock); listeners.addIfNotAlreadyThere (newListener); } -void AudioProcessor::removeListener (AudioProcessorListener* const listenerToRemove) throw() +void AudioProcessor::removeListener (AudioProcessorListener* const listenerToRemove) { const ScopedLock sl (listenerLock); listeners.removeValue (listenerToRemove); diff --git a/src/audio/processors/juce_AudioProcessor.h b/src/audio/processors/juce_AudioProcessor.h index 181d92cd9f..bc16ad75df 100644 --- a/src/audio/processors/juce_AudioProcessor.h +++ b/src/audio/processors/juce_AudioProcessor.h @@ -523,10 +523,10 @@ public: //============================================================================== /** Adds a listener that will be called when an aspect of this processor changes. */ - void addListener (AudioProcessorListener* const newListener) throw(); + void addListener (AudioProcessorListener* const newListener); /** Removes a previously added listener. */ - void removeListener (AudioProcessorListener* const listenerToRemove) throw(); + void removeListener (AudioProcessorListener* const listenerToRemove); //============================================================================== /** Not for public use - this is called before deleting an editor component. */ diff --git a/src/core/juce_PlatformUtilities.h b/src/core/juce_PlatformUtilities.h index b01e1c2424..97208224a4 100644 --- a/src/core/juce_PlatformUtilities.h +++ b/src/core/juce_PlatformUtilities.h @@ -195,11 +195,6 @@ public: const String& procedureName); #endif -#if JUCE_LINUX || DOXYGEN - //============================================================================== - -#endif - private: PlatformUtilities(); PlatformUtilities (const PlatformUtilities&); diff --git a/src/events/juce_MessageManager.cpp b/src/events/juce_MessageManager.cpp index 28bdeeda4c..eaf163fde0 100644 --- a/src/events/juce_MessageManager.cpp +++ b/src/events/juce_MessageManager.cpp @@ -184,7 +184,7 @@ void MessageManager::deliverBroadcastMessage (const String& value) broadcastListeners->sendActionMessage (value); } -void MessageManager::registerBroadcastListener (ActionListener* const listener) throw() +void MessageManager::registerBroadcastListener (ActionListener* const listener) { if (broadcastListeners == 0) broadcastListeners = new ActionListenerList(); @@ -192,7 +192,7 @@ void MessageManager::registerBroadcastListener (ActionListener* const listener) broadcastListeners->addActionListener (listener); } -void MessageManager::deregisterBroadcastListener (ActionListener* const listener) throw() +void MessageManager::deregisterBroadcastListener (ActionListener* const listener) { if (broadcastListeners != 0) broadcastListeners->removeActionListener (listener); @@ -271,21 +271,21 @@ private: }; //============================================================================== -MessageManagerLock::MessageManagerLock (Thread* const threadToCheck) throw() +MessageManagerLock::MessageManagerLock (Thread* const threadToCheck) : sharedEvents (0), locked (false) { init (threadToCheck, 0); } -MessageManagerLock::MessageManagerLock (ThreadPoolJob* const jobToCheckForExitSignal) throw() +MessageManagerLock::MessageManagerLock (ThreadPoolJob* const jobToCheckForExitSignal) : sharedEvents (0), locked (false) { init (0, jobToCheckForExitSignal); } -void MessageManagerLock::init (Thread* const threadToCheck, ThreadPoolJob* const job) throw() +void MessageManagerLock::init (Thread* const threadToCheck, ThreadPoolJob* const job) { if (MessageManager::instance != 0) { diff --git a/src/events/juce_MessageManager.h b/src/events/juce_MessageManager.h index 14e799440e..ce29de2d30 100644 --- a/src/events/juce_MessageManager.h +++ b/src/events/juce_MessageManager.h @@ -149,10 +149,10 @@ public: @see broadcastMessage */ - void registerBroadcastListener (ActionListener* listener) throw(); + void registerBroadcastListener (ActionListener* listener); /** Deregisters a broadcast listener. */ - void deregisterBroadcastListener (ActionListener* listener) throw(); + void deregisterBroadcastListener (ActionListener* listener); //============================================================================== /** @internal */ @@ -275,7 +275,7 @@ public: @endcode */ - MessageManagerLock (Thread* threadToCheckForExitSignal = 0) throw(); + MessageManagerLock (Thread* threadToCheckForExitSignal = 0); //============================================================================== /** This has the same behaviour as the other constructor, but takes a ThreadPoolJob @@ -283,7 +283,7 @@ public: See the MessageManagerLock (Thread*) constructor for details on how this works. */ - MessageManagerLock (ThreadPoolJob* jobToCheckForExitSignal) throw(); + MessageManagerLock (ThreadPoolJob* jobToCheckForExitSignal); //============================================================================== @@ -310,7 +310,7 @@ private: SharedEvents* sharedEvents; bool locked; - void init (Thread* thread, ThreadPoolJob* job) throw(); + void init (Thread* thread, ThreadPoolJob* job); MessageManagerLock (const MessageManagerLock&); MessageManagerLock& operator= (const MessageManagerLock&); diff --git a/src/gui/components/code_editor/juce_CodeDocument.cpp b/src/gui/components/code_editor/juce_CodeDocument.cpp index 4672c252c6..4977a0ceb4 100644 --- a/src/gui/components/code_editor/juce_CodeDocument.cpp +++ b/src/gui/components/code_editor/juce_CodeDocument.cpp @@ -242,12 +242,12 @@ CodeDocument::Position::Position (const Position& other) throw() jassert (*this == other); } -CodeDocument::Position::~Position() throw() +CodeDocument::Position::~Position() { setPositionMaintained (false); } -CodeDocument::Position& CodeDocument::Position::operator= (const Position& other) throw() +CodeDocument::Position& CodeDocument::Position::operator= (const Position& other) { if (this != &other) { @@ -283,7 +283,7 @@ bool CodeDocument::Position::operator!= (const Position& other) const throw() return ! operator== (other); } -void CodeDocument::Position::setLineAndIndex (const int newLine, const int newIndexInLine) throw() +void CodeDocument::Position::setLineAndIndex (const int newLine, const int newIndexInLine) { jassert (owner != 0); @@ -322,7 +322,7 @@ void CodeDocument::Position::setLineAndIndex (const int newLine, const int newIn } } -void CodeDocument::Position::setPosition (const int newPosition) throw() +void CodeDocument::Position::setPosition (const int newPosition) { jassert (owner != 0); @@ -369,7 +369,7 @@ void CodeDocument::Position::setPosition (const int newPosition) throw() } } -void CodeDocument::Position::moveBy (int characterDelta) throw() +void CodeDocument::Position::moveBy (int characterDelta) { jassert (owner != 0); @@ -390,33 +390,33 @@ void CodeDocument::Position::moveBy (int characterDelta) throw() setPosition (characterPos + characterDelta); } -const CodeDocument::Position CodeDocument::Position::movedBy (const int characterDelta) const throw() +const CodeDocument::Position CodeDocument::Position::movedBy (const int characterDelta) const { CodeDocument::Position p (*this); p.moveBy (characterDelta); return p; } -const CodeDocument::Position CodeDocument::Position::movedByLines (const int deltaLines) const throw() +const CodeDocument::Position CodeDocument::Position::movedByLines (const int deltaLines) const { CodeDocument::Position p (*this); p.setLineAndIndex (getLineNumber() + deltaLines, getIndexInLine()); return p; } -const juce_wchar CodeDocument::Position::getCharacter() const throw() +const juce_wchar CodeDocument::Position::getCharacter() const { const CodeDocumentLine* const l = owner->lines [line]; return l == 0 ? 0 : l->line [getIndexInLine()]; } -const String CodeDocument::Position::getLineText() const throw() +const String CodeDocument::Position::getLineText() const { const CodeDocumentLine* const l = owner->lines [line]; return l == 0 ? String::empty : l->line; } -void CodeDocument::Position::setPositionMaintained (const bool isMaintained) throw() +void CodeDocument::Position::setPositionMaintained (const bool isMaintained) { if (isMaintained != positionMaintained) { @@ -453,13 +453,13 @@ CodeDocument::~CodeDocument() { } -const String CodeDocument::getAllContent() const throw() +const String CodeDocument::getAllContent() const { return getTextBetween (Position (this, 0), Position (this, lines.size(), 0)); } -const String CodeDocument::getTextBetween (const Position& start, const Position& end) const throw() +const String CodeDocument::getTextBetween (const Position& start, const Position& end) const { if (end.getPosition() <= start.getPosition()) return String::empty; diff --git a/src/gui/components/code_editor/juce_CodeDocument.h b/src/gui/components/code_editor/juce_CodeDocument.h index 039ff5b6de..9da358d3f4 100644 --- a/src/gui/components/code_editor/juce_CodeDocument.h +++ b/src/gui/components/code_editor/juce_CodeDocument.h @@ -103,9 +103,9 @@ public: Position (const Position& other) throw(); /** Destructor. */ - ~Position() throw(); + ~Position(); - Position& operator= (const Position& other) throw(); + Position& operator= (const Position& other); bool operator== (const Position& other) const throw(); bool operator!= (const Position& other) const throw(); @@ -115,7 +115,7 @@ public: inside. @see getPosition, setLineAndIndex */ - void setPosition (int charactersFromStartOfDocument) throw(); + void setPosition (int charactersFromStartOfDocument); /** Returns the position as the number of characters from the start of the document. @see setPosition, getLineNumber, getIndexInLine @@ -131,7 +131,7 @@ public: Lines are numbered from zero, and if the line or index are beyond the bounds of the document, they will be adjusted to keep them within its limits. */ - void setLineAndIndex (int newLine, int newIndexInLine) throw(); + void setLineAndIndex (int newLine, int newIndexInLine); /** Returns the line number of this position. The first line in the document is numbered zero, not one! @@ -152,35 +152,35 @@ public: when the document has text inserted or deleted, this position will be automatically moved to keep it at the same position in the text. */ - void setPositionMaintained (bool isMaintained) throw(); + void setPositionMaintained (bool isMaintained); //============================================================================== /** Moves the position forwards or backwards by the specified number of characters. @see movedBy */ - void moveBy (int characterDelta) throw(); + void moveBy (int characterDelta); /** Returns a position which is the same as this one, moved by the specified number of characters. @see moveBy */ - const Position movedBy (int characterDelta) const throw(); + const Position movedBy (int characterDelta) const; /** Returns a position which is the same as this one, moved up or down by the specified number of lines. @see movedBy */ - const Position movedByLines (int deltaLines) const throw(); + const Position movedByLines (int deltaLines) const; /** Returns the character in the document at this position. @see getLineText */ - const juce_wchar getCharacter() const throw(); + const juce_wchar getCharacter() const; /** Returns the line from the document that this position is within. @see getCharacter, getLineNumber */ - const String getLineText() const throw(); + const String getLineText() const; //============================================================================== private: @@ -191,10 +191,10 @@ public: //============================================================================== /** Returns the full text of the document. */ - const String getAllContent() const throw(); + const String getAllContent() const; /** Returns a section of the document's text. */ - const String getTextBetween (const Position& start, const Position& end) const throw(); + const String getTextBetween (const Position& start, const Position& end) const; /** Returns a line from the document. */ const String getLine (int lineIndex) const throw(); diff --git a/src/gui/components/code_editor/juce_CodeEditorComponent.cpp b/src/gui/components/code_editor/juce_CodeEditorComponent.cpp index fca78a08c4..8671e0c11d 100644 --- a/src/gui/components/code_editor/juce_CodeEditorComponent.cpp +++ b/src/gui/components/code_editor/juce_CodeEditorComponent.cpp @@ -155,7 +155,7 @@ public: void draw (CodeEditorComponent& owner, Graphics& g, const Font& font, float x, const int y, const int baselineOffset, const int lineHeight, - const Colour& highlightColour) const throw() + const Colour& highlightColour) const { if (highlightColumnStart < highlightColumnEnd) { @@ -244,7 +244,7 @@ private: source = lastIterator; } - static void replaceTabsWithSpaces (Array & tokens, const int spacesPerTab) throw() + static void replaceTabsWithSpaces (Array & tokens, const int spacesPerTab) { int x = 0; for (int i = 0; i < tokens.size(); ++i) @@ -414,7 +414,7 @@ void CodeEditorComponent::paint (Graphics& g) } } -void CodeEditorComponent::setScrollbarThickness (const int thickness) throw() +void CodeEditorComponent::setScrollbarThickness (const int thickness) { if (scrollbarThickness != thickness) { @@ -605,7 +605,7 @@ void CodeEditorComponent::scrollToKeepCaretOnScreen() scrollToColumn (column); } -const Rectangle CodeEditorComponent::getCharacterBounds (const CodeDocument::Position& pos) const throw() +const Rectangle CodeEditorComponent::getCharacterBounds (const CodeDocument::Position& pos) const { return Rectangle (roundToInt ((gutter - xOffset * charWidth) + indexToColumn (pos.getLineNumber(), pos.getIndexInLine()) * charWidth), (pos.getLineNumber() - firstLineOnScreen) * lineHeight, @@ -1111,7 +1111,7 @@ void CodeEditorComponent::focusLost (FocusChangeType) } //============================================================================== -void CodeEditorComponent::setTabSize (const int numSpaces, const bool insertSpaces) throw() +void CodeEditorComponent::setTabSize (const int numSpaces, const bool insertSpaces) { useSpacesForTabs = insertSpaces; @@ -1190,7 +1190,7 @@ void CodeEditorComponent::setColourForTokenType (const int tokenType, const Colo repaint(); } -const Colour CodeEditorComponent::getColourForTokenType (const int tokenType) const throw() +const Colour CodeEditorComponent::getColourForTokenType (const int tokenType) const { if (((unsigned int) tokenType) >= (unsigned int) coloursForTokenCategories.size()) return findColour (CodeEditorComponent::defaultTextColourId); @@ -1198,7 +1198,7 @@ const Colour CodeEditorComponent::getColourForTokenType (const int tokenType) co return coloursForTokenCategories.getReference (tokenType); } -void CodeEditorComponent::clearCachedIterators (const int firstLineToBeInvalid) throw() +void CodeEditorComponent::clearCachedIterators (const int firstLineToBeInvalid) { int i; for (i = cachedIterators.size(); --i >= 0;) diff --git a/src/gui/components/code_editor/juce_CodeEditorComponent.h b/src/gui/components/code_editor/juce_CodeEditorComponent.h index 745e3ae08c..95bf67eabc 100644 --- a/src/gui/components/code_editor/juce_CodeEditorComponent.h +++ b/src/gui/components/code_editor/juce_CodeEditorComponent.h @@ -104,7 +104,7 @@ public: /** Returns the on-screen position of a character in the document. The rectangle returned is relative to this component's top-left origin. */ - const Rectangle getCharacterBounds (const CodeDocument::Position& pos) const throw(); + const Rectangle getCharacterBounds (const CodeDocument::Position& pos) const; /** Finds the character at a given on-screen position. The co-ordinates are relative to this component's top-left origin. @@ -157,8 +157,7 @@ public: This lets you change the tab size and whether pressing the tab key inserts a tab character, or its equivalent number of spaces. */ - void setTabSize (int numSpacesPerTab, - bool insertSpacesInsteadOfTabCharacters) throw(); + void setTabSize (int numSpacesPerTab, bool insertSpacesInsteadOfTabCharacters); /** Returns the current number of spaces per tab. @see setTabSize @@ -196,7 +195,7 @@ public: CodeTokeniser::getTokenTypes() to get a list of the token types. @see setColourForTokenType */ - const Colour getColourForTokenType (int tokenType) const throw(); + const Colour getColourForTokenType (int tokenType) const; //============================================================================== /** A set of colour IDs to use to change the colour of various aspects of the editor. @@ -218,7 +217,7 @@ public: //============================================================================== /** Changes the size of the scrollbars. */ - void setScrollbarThickness (int thickness) throw(); + void setScrollbarThickness (int thickness); /** Returns the thickness of the scrollbars. */ int getScrollbarThickness() const throw() { return scrollbarThickness; } @@ -295,7 +294,7 @@ private: void rebuildLineTokens(); OwnedArray cachedIterators; - void clearCachedIterators (int firstLineToBeInvalid) throw(); + void clearCachedIterators (int firstLineToBeInvalid); void updateCachedIterators (int maxLineNum); void getIteratorForPosition (int position, CodeDocument::Iterator& result); void moveLineDelta (int delta, bool selecting); diff --git a/src/gui/components/controls/juce_ComboBox.cpp b/src/gui/components/controls/juce_ComboBox.cpp index d9b88d6983..6afc369870 100644 --- a/src/gui/components/controls/juce_ComboBox.cpp +++ b/src/gui/components/controls/juce_ComboBox.cpp @@ -77,7 +77,7 @@ bool ComboBox::isTextEditable() const throw() return label->isEditable(); } -void ComboBox::setJustificationType (const Justification& justification) throw() +void ComboBox::setJustificationType (const Justification& justification) { label->setJustificationType (justification); } @@ -94,8 +94,7 @@ void ComboBox::setTooltip (const String& newTooltip) } //============================================================================== -void ComboBox::addItem (const String& newItemText, - const int newItemId) throw() +void ComboBox::addItem (const String& newItemText, const int newItemId) { // you can't add empty strings to the list.. jassert (newItemText.isNotEmpty()); @@ -128,12 +127,12 @@ void ComboBox::addItem (const String& newItemText, } } -void ComboBox::addSeparator() throw() +void ComboBox::addSeparator() { separatorPending = (items.size() > 0); } -void ComboBox::addSectionHeading (const String& headingName) throw() +void ComboBox::addSectionHeading (const String& headingName) { // you can't add empty strings to the list.. jassert (headingName.isNotEmpty()); @@ -160,8 +159,7 @@ void ComboBox::addSectionHeading (const String& headingName) throw() } } -void ComboBox::setItemEnabled (const int itemId, - const bool shouldBeEnabled) throw() +void ComboBox::setItemEnabled (const int itemId, const bool shouldBeEnabled) { ItemInfo* const item = getItemForId (itemId); @@ -169,8 +167,7 @@ void ComboBox::setItemEnabled (const int itemId, item->isEnabled = shouldBeEnabled; } -void ComboBox::changeItemText (const int itemId, - const String& newText) throw() +void ComboBox::changeItemText (const int itemId, const String& newText) { ItemInfo* const item = getItemForId (itemId); @@ -240,7 +237,7 @@ int ComboBox::getNumItems() const throw() return n; } -const String ComboBox::getItemText (const int index) const throw() +const String ComboBox::getItemText (const int index) const { const ItemInfo* const item = getItemForIndex (index); @@ -278,7 +275,7 @@ int ComboBox::indexOfItemId (const int itemId) const throw() } //============================================================================== -int ComboBox::getSelectedItemIndex() const throw() +int ComboBox::getSelectedItemIndex() const { int index = indexOfItemId (currentId.getValue()); @@ -288,8 +285,7 @@ int ComboBox::getSelectedItemIndex() const throw() return index; } -void ComboBox::setSelectedItemIndex (const int index, - const bool dontSendChangeMessage) throw() +void ComboBox::setSelectedItemIndex (const int index, const bool dontSendChangeMessage) { setSelectedId (getItemId (index), dontSendChangeMessage); } @@ -298,13 +294,10 @@ int ComboBox::getSelectedId() const throw() { const ItemInfo* const item = getItemForId (currentId.getValue()); - return (item != 0 && getText() == item->name) - ? item->itemId - : 0; + return (item != 0 && getText() == item->name) ? item->itemId : 0; } -void ComboBox::setSelectedId (const int newItemId, - const bool dontSendChangeMessage) throw() +void ComboBox::setSelectedId (const int newItemId, const bool dontSendChangeMessage) { const ItemInfo* const item = getItemForId (newItemId); const String newItemText (item != 0 ? item->name : String::empty); @@ -329,13 +322,12 @@ void ComboBox::valueChanged (Value&) } //============================================================================== -const String ComboBox::getText() const throw() +const String ComboBox::getText() const { return label->getText(); } -void ComboBox::setText (const String& newText, - const bool dontSendChangeMessage) throw() +void ComboBox::setText (const String& newText, const bool dontSendChangeMessage) { for (int i = items.size(); --i >= 0;) { @@ -371,7 +363,7 @@ void ComboBox::showEditor() } //============================================================================== -void ComboBox::setTextWhenNothingSelected (const String& newMessage) throw() +void ComboBox::setTextWhenNothingSelected (const String& newMessage) { if (textWhenNothingSelected != newMessage) { @@ -380,17 +372,17 @@ void ComboBox::setTextWhenNothingSelected (const String& newMessage) throw() } } -const String ComboBox::getTextWhenNothingSelected() const throw() +const String ComboBox::getTextWhenNothingSelected() const { return textWhenNothingSelected; } -void ComboBox::setTextWhenNoChoicesAvailable (const String& newMessage) throw() +void ComboBox::setTextWhenNoChoicesAvailable (const String& newMessage) { noChoicesMessage = newMessage; } -const String ComboBox::getTextWhenNoChoicesAvailable() const throw() +const String ComboBox::getTextWhenNoChoicesAvailable() const { return noChoicesMessage; } @@ -623,12 +615,12 @@ void ComboBox::mouseUp (const MouseEvent& e2) } //============================================================================== -void ComboBox::addListener (Listener* const listener) throw() +void ComboBox::addListener (Listener* const listener) { listeners.add (listener); } -void ComboBox::removeListener (Listener* const listener) throw() +void ComboBox::removeListener (Listener* const listener) { listeners.remove (listener); } diff --git a/src/gui/components/controls/juce_ComboBox.h b/src/gui/components/controls/juce_ComboBox.h index 2659901603..041ef5d872 100644 --- a/src/gui/components/controls/juce_ComboBox.h +++ b/src/gui/components/controls/juce_ComboBox.h @@ -85,7 +85,7 @@ public: The default is Justification::centredLeft. The text is displayed using a Label component inside the ComboBox. */ - void setJustificationType (const Justification& justification) throw(); + void setJustificationType (const Justification& justification); /** Returns the current justification for the text box. @see setJustificationType @@ -101,14 +101,13 @@ public: be 0! @see setItemEnabled, addSeparator, addSectionHeading, removeItem, getNumItems, getItemText, getItemId */ - void addItem (const String& newItemText, - int newItemId) throw(); + void addItem (const String& newItemText, int newItemId); /** Adds a separator line to the drop-down list. This is like adding a separator to a popup menu. See PopupMenu::addSeparator(). */ - void addSeparator() throw(); + void addSeparator(); /** Adds a heading to the drop-down list, so that you can group the items into different sections. @@ -119,7 +118,7 @@ public: @see addItem, addSeparator */ - void addSectionHeading (const String& headingName) throw(); + void addSectionHeading (const String& headingName); /** This allows items in the drop-down list to be selectively disabled. @@ -129,13 +128,11 @@ public: If you disable an item which is already selected, this won't change the current selection - it just stops the user choosing that item from the list. */ - void setItemEnabled (int itemId, - bool shouldBeEnabled) throw(); + void setItemEnabled (int itemId, bool shouldBeEnabled); /** Changes the text for an existing item. */ - void changeItemText (int itemId, - const String& newText) throw(); + void changeItemText (int itemId, const String& newText); /** Removes all the items from the drop-down list. @@ -158,7 +155,7 @@ public: @param index the item's index from 0 to (getNumItems() - 1) */ - const String getItemText (int index) const throw(); + const String getItemText (int index) const; /** Returns the ID for one of the items in the list. @@ -189,7 +186,7 @@ public: You can call Value::referTo() on this object to make the combo box control another Value object. */ - Value& getSelectedIdAsValue() throw() { return currentId; } + Value& getSelectedIdAsValue() { return currentId; } /** Sets one of the items to be the current selection. @@ -201,8 +198,7 @@ public: change notification @see getSelectedId, setSelectedItemIndex, setText */ - void setSelectedId (int newItemId, - bool dontSendChangeMessage = false) throw(); + void setSelectedId (int newItemId, bool dontSendChangeMessage = false); //============================================================================== /** Returns the index of the item that's currently shown in the box. @@ -213,7 +209,7 @@ public: @see setSelectedItemIndex, getSelectedId, getText */ - int getSelectedItemIndex() const throw(); + int getSelectedItemIndex() const; /** Sets one of the items to be the current selection. @@ -225,8 +221,7 @@ public: change notification @see getSelectedItemIndex, setSelectedId, setText */ - void setSelectedItemIndex (int newItemIndex, - bool dontSendChangeMessage = false) throw(); + void setSelectedItemIndex (int newItemIndex, bool dontSendChangeMessage = false); //============================================================================== /** Returns the text that is currently shown in the combo-box's text field. @@ -237,7 +232,7 @@ public: @see setText, getSelectedId, getSelectedItemIndex */ - const String getText() const throw(); + const String getText() const; /** Sets the contents of the combo-box's text field. @@ -251,8 +246,7 @@ public: change notification @see getText */ - void setText (const String& newText, - bool dontSendChangeMessage = false) throw(); + void setText (const String& newText, bool dontSendChangeMessage = false); /** Programmatically opens the text editor to allow the user to edit the current item. @@ -284,23 +278,23 @@ public: }; /** Registers a listener that will be called when the box's content changes. */ - void addListener (Listener* listener) throw(); + void addListener (Listener* listener); /** Deregisters a previously-registered listener. */ - void removeListener (Listener* listener) throw(); + void removeListener (Listener* listener); //============================================================================== /** Sets a message to display when there is no item currently selected. @see getTextWhenNothingSelected */ - void setTextWhenNothingSelected (const String& newMessage) throw(); + void setTextWhenNothingSelected (const String& newMessage); /** Returns the text that is shown when no item is selected. @see setTextWhenNothingSelected */ - const String getTextWhenNothingSelected() const throw(); + const String getTextWhenNothingSelected() const; /** Sets the message to show when there are no items in the list, and the user clicks @@ -309,12 +303,12 @@ public: By default it just says "no choices", but this lets you change it to something more meaningful. */ - void setTextWhenNoChoicesAvailable (const String& newMessage) throw(); + void setTextWhenNoChoicesAvailable (const String& newMessage); /** Returns the text shown when no items have been added to the list. @see setTextWhenNoChoicesAvailable */ - const String getTextWhenNoChoicesAvailable() const throw(); + const String getTextWhenNoChoicesAvailable() const; //============================================================================== /** Gives the ComboBox a tooltip. */ diff --git a/src/gui/components/controls/juce_Label.cpp b/src/gui/components/controls/juce_Label.cpp index adf2bfdee1..e26f958b15 100644 --- a/src/gui/components/controls/juce_Label.cpp +++ b/src/gui/components/controls/juce_Label.cpp @@ -87,7 +87,7 @@ void Label::setText (const String& newText, } } -const String Label::getText (const bool returnActiveEditorContents) const throw() +const String Label::getText (const bool returnActiveEditorContents) const { return (returnActiveEditorContents && isBeingEdited()) ? editor->getText() @@ -101,7 +101,7 @@ void Label::valueChanged (Value&) } //============================================================================== -void Label::setFont (const Font& newFont) throw() +void Label::setFont (const Font& newFont) { if (font != newFont) { @@ -117,7 +117,7 @@ const Font& Label::getFont() const throw() void Label::setEditable (const bool editOnSingleClick, const bool editOnDoubleClick, - const bool lossOfFocusDiscardsChanges_) throw() + const bool lossOfFocusDiscardsChanges_) { editSingleClick = editOnSingleClick; editDoubleClick = editOnDoubleClick; @@ -127,7 +127,7 @@ void Label::setEditable (const bool editOnSingleClick, setFocusContainer (editOnSingleClick || editOnDoubleClick); } -void Label::setJustificationType (const Justification& newJustification) throw() +void Label::setJustificationType (const Justification& newJustification) { if (justification != newJustification) { @@ -403,12 +403,12 @@ KeyboardFocusTraverser* Label::createFocusTraverser() } //============================================================================== -void Label::addListener (Listener* const listener) throw() +void Label::addListener (Listener* const listener) { listeners.add (listener); } -void Label::removeListener (Listener* const listener) throw() +void Label::removeListener (Listener* const listener) { listeners.remove (listener); } diff --git a/src/gui/components/controls/juce_Label.h b/src/gui/components/controls/juce_Label.h index 71bad18805..3c3fbfb48c 100644 --- a/src/gui/components/controls/juce_Label.h +++ b/src/gui/components/controls/juce_Label.h @@ -71,7 +71,7 @@ public: the user has finished typing and pressed the return key. */ - const String getText (bool returnActiveEditorContents = false) const throw(); + const String getText (bool returnActiveEditorContents = false) const; /** Returns the text content as a Value object. You can call Value::referTo() on this object to make the label read and control @@ -84,7 +84,7 @@ public: @see getFont */ - void setFont (const Font& newFont) throw(); + void setFont (const Font& newFont); /** Returns the font currently being used. @@ -116,7 +116,7 @@ public: (The default is Justification::centredLeft) */ - void setJustificationType (const Justification& justification) throw(); + void setJustificationType (const Justification& justification); /** Returns the type of justification, as set in setJustificationType(). */ const Justification getJustificationType() const throw() { return justification; } @@ -192,10 +192,10 @@ public: }; /** Registers a listener that will be called when the label's text changes. */ - void addListener (Listener* listener) throw(); + void addListener (Listener* listener); /** Deregisters a previously-registered listener. */ - void removeListener (Listener* listener) throw(); + void removeListener (Listener* listener); //============================================================================== /** Makes the label turn into a TextEditor when clicked. @@ -220,7 +220,7 @@ public: */ void setEditable (bool editOnSingleClick, bool editOnDoubleClick = false, - bool lossOfFocusDiscardsChanges = false) throw(); + bool lossOfFocusDiscardsChanges = false); /** Returns true if this option was set using setEditable(). */ bool isEditableOnSingleClick() const throw() { return editSingleClick; }