Browse Source

Added fake placeholder versions of the new c++0x 'noexcept' and 'nullptr' keywords, and altered the library classes to use these instead of 'throw()' and '0'. This shouldn't make any difference at all to existing code, but will enable better static checking with future c++0x compilers.

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
f04309f44a
100 changed files with 8115 additions and 8116 deletions
  1. +6
    -6
      extras/Introjucer/Source/Application/jucer_Application.h
  2. +4
    -4
      extras/Introjucer/Source/Application/jucer_DocumentEditorComponent.cpp
  3. +3
    -3
      extras/Introjucer/Source/Application/jucer_FilePreviewComponent.cpp
  4. +9
    -7
      extras/Introjucer/Source/Application/jucer_JuceUpdater.cpp
  5. +14
    -14
      extras/Introjucer/Source/Application/jucer_MainWindow.cpp
  6. +2
    -2
      extras/Introjucer/Source/Application/jucer_MainWindow.h
  7. +11
    -11
      extras/Introjucer/Source/Application/jucer_OpenDocumentManager.cpp
  8. +1
    -1
      extras/Introjucer/Source/Project/jucer_GroupInformationComponent.cpp
  9. +1
    -1
      extras/Introjucer/Source/Project/jucer_NewFileWizard.cpp
  10. +1
    -1
      extras/Introjucer/Source/Project/jucer_NewProjectWizard.cpp
  11. +7
    -7
      extras/Introjucer/Source/Project/jucer_Project.cpp
  12. +35
    -35
      extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp
  13. +4
    -4
      extras/Introjucer/Source/Project/jucer_ProjectExport_XCode.h
  14. +9
    -9
      extras/Introjucer/Source/Project/jucer_ProjectExporter.cpp
  15. +4
    -4
      extras/Introjucer/Source/Project/jucer_ProjectInformationComponent.cpp
  16. +3
    -3
      extras/Introjucer/Source/Project/jucer_ProjectSaver.h
  17. +20
    -20
      extras/Introjucer/Source/Project/jucer_ProjectTreeViewBase.cpp
  18. +6
    -6
      extras/Introjucer/Source/Project/jucer_ResourceFile.cpp
  19. +5
    -5
      extras/Introjucer/Source/Project/jucer_TreeViewTypes.cpp
  20. +1
    -1
      extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp
  21. +7
    -7
      extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp
  22. +7
    -8
      extras/Introjucer/Source/Utility/jucer_StoredSettings.cpp
  23. +33
    -33
      extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm
  24. +22
    -22
      extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp
  25. +1
    -1
      extras/audio plugins/wrapper/Standalone/juce_AudioFilterStreamer.cpp
  26. +27
    -24
      extras/audio plugins/wrapper/Standalone/juce_StandaloneFilterWindow.cpp
  27. +35
    -35
      extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp
  28. +2
    -2
      extras/audio plugins/wrapper/juce_PluginHeaders.h
  29. +12
    -12
      extras/audio plugins/wrapper/juce_PluginHostType.h
  30. +4376
    -4397
      juce_amalgamated.cpp
  31. +2512
    -2495
      juce_amalgamated.h
  32. +12
    -12
      src/application/juce_Application.cpp
  33. +6
    -6
      src/application/juce_Application.h
  34. +5
    -5
      src/application/juce_ApplicationCommandInfo.cpp
  35. +5
    -5
      src/application/juce_ApplicationCommandInfo.h
  36. +25
    -25
      src/application/juce_ApplicationCommandManager.cpp
  37. +7
    -7
      src/application/juce_ApplicationCommandManager.h
  38. +10
    -10
      src/application/juce_ApplicationCommandTarget.cpp
  39. +11
    -11
      src/application/juce_ApplicationProperties.cpp
  40. +1
    -1
      src/application/juce_ApplicationProperties.h
  41. +3
    -3
      src/audio/audio_file_formats/juce_AiffAudioFormat.cpp
  42. +1
    -1
      src/audio/audio_file_formats/juce_AudioCDBurner.h
  43. +6
    -6
      src/audio/audio_file_formats/juce_AudioFormatManager.cpp
  44. +5
    -5
      src/audio/audio_file_formats/juce_AudioFormatReader.cpp
  45. +3
    -3
      src/audio/audio_file_formats/juce_AudioFormatReader.h
  46. +5
    -5
      src/audio/audio_file_formats/juce_AudioFormatWriter.cpp
  47. +7
    -7
      src/audio/audio_file_formats/juce_AudioFormatWriter.h
  48. +1
    -1
      src/audio/audio_file_formats/juce_AudioSubsectionReader.cpp
  49. +30
    -30
      src/audio/audio_file_formats/juce_AudioThumbnail.cpp
  50. +4
    -4
      src/audio/audio_file_formats/juce_AudioThumbnail.h
  51. +2
    -2
      src/audio/audio_file_formats/juce_AudioThumbnailCache.cpp
  52. +5
    -5
      src/audio/audio_file_formats/juce_FlacAudioFormat.cpp
  53. +11
    -11
      src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp
  54. +5
    -5
      src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp
  55. +12
    -12
      src/audio/audio_file_formats/juce_WavAudioFormat.cpp
  56. +1
    -1
      src/audio/audio_file_formats/oggvorbis/libvorbis-1.3.2/lib/psy.c
  57. +1
    -1
      src/audio/audio_sources/juce_AudioFormatReaderSource.cpp
  58. +1
    -1
      src/audio/audio_sources/juce_AudioFormatReaderSource.h
  59. +2
    -2
      src/audio/audio_sources/juce_AudioSource.h
  60. +11
    -11
      src/audio/audio_sources/juce_AudioSourcePlayer.cpp
  61. +3
    -3
      src/audio/audio_sources/juce_AudioSourcePlayer.h
  62. +24
    -24
      src/audio/audio_sources/juce_AudioTransportSource.cpp
  63. +4
    -4
      src/audio/audio_sources/juce_AudioTransportSource.h
  64. +6
    -6
      src/audio/audio_sources/juce_BufferingAudioSource.cpp
  65. +1
    -1
      src/audio/audio_sources/juce_IIRFilterAudioSource.cpp
  66. +2
    -2
      src/audio/audio_sources/juce_MixerAudioSource.cpp
  67. +1
    -1
      src/audio/audio_sources/juce_PositionableAudioSource.h
  68. +3
    -3
      src/audio/audio_sources/juce_ResamplingAudioSource.cpp
  69. +1
    -1
      src/audio/audio_sources/juce_ResamplingAudioSource.h
  70. +37
    -39
      src/audio/devices/juce_AudioDeviceManager.cpp
  71. +4
    -4
      src/audio/devices/juce_AudioDeviceManager.h
  72. +2
    -2
      src/audio/devices/juce_AudioIODevice.h
  73. +1
    -1
      src/audio/devices/juce_AudioIODeviceType.h
  74. +155
    -155
      src/audio/dsp/juce_AudioDataConverters.h
  75. +38
    -38
      src/audio/dsp/juce_AudioSampleBuffer.cpp
  76. +30
    -30
      src/audio/dsp/juce_AudioSampleBuffer.h
  77. +15
    -15
      src/audio/dsp/juce_IIRFilter.cpp
  78. +11
    -11
      src/audio/dsp/juce_IIRFilter.h
  79. +21
    -21
      src/audio/midi/juce_MidiBuffer.cpp
  80. +20
    -20
      src/audio/midi/juce_MidiBuffer.h
  81. +7
    -7
      src/audio/midi/juce_MidiFile.cpp
  82. +5
    -5
      src/audio/midi/juce_MidiFile.h
  83. +2
    -2
      src/audio/midi/juce_MidiInput.h
  84. +2
    -2
      src/audio/midi/juce_MidiKeyboardState.cpp
  85. +3
    -3
      src/audio/midi/juce_MidiKeyboardState.h
  86. +89
    -89
      src/audio/midi/juce_MidiMessage.cpp
  87. +92
    -92
      src/audio/midi/juce_MidiMessage.h
  88. +6
    -6
      src/audio/midi/juce_MidiMessageSequence.cpp
  89. +2
    -2
      src/audio/midi/juce_MidiMessageSequence.h
  90. +8
    -8
      src/audio/midi/juce_MidiOutput.cpp
  91. +37
    -37
      src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm
  92. +4
    -4
      src/audio/plugins/formats/juce_VSTMidiEventList.h
  93. +60
    -59
      src/audio/plugins/formats/juce_VSTPluginFormat.cpp
  94. +1
    -1
      src/audio/plugins/juce_AudioPluginFormat.cpp
  95. +1
    -1
      src/audio/plugins/juce_AudioPluginFormat.h
  96. +25
    -25
      src/audio/plugins/juce_AudioPluginFormatManager.cpp
  97. +4
    -4
      src/audio/plugins/juce_KnownPluginList.cpp
  98. +2
    -2
      src/audio/plugins/juce_KnownPluginList.h
  99. +1
    -1
      src/audio/plugins/juce_PluginDirectoryScanner.h
  100. +7
    -7
      src/audio/plugins/juce_PluginListComponent.cpp

+ 6
- 6
extras/Introjucer/Source/Application/jucer_Application.h View File

@@ -86,9 +86,9 @@ public:
void shutdown()
{
#if JUCE_MAC
MenuBarModel::setMacMainMenu (0);
MenuBarModel::setMacMainMenu (nullptr);
#endif
menuModel = 0;
menuModel = nullptr;
StoredSettings::deleteInstance();
mainWindows.clear();
@@ -365,7 +365,7 @@ public:
MainWindow* mw = createNewMainWindow (false);
ScopedPointer <Project> newProj (NewProjectWizard::runNewProjectWizard (mw));
if (newProj != 0)
if (newProj != nullptr)
{
mw->setProject (newProj.release());
mw->setVisible (true);
@@ -388,7 +388,7 @@ public:
{
for (int j = mainWindows.size(); --j >= 0;)
{
if (mainWindows.getUnchecked(j)->getProject() != 0
if (mainWindows.getUnchecked(j)->getProject() != nullptr
&& mainWindows.getUnchecked(j)->getProject()->getFile() == file)
{
mainWindows.getUnchecked(j)->toFront (true);
@@ -442,7 +442,7 @@ public:
{
MainWindow* mw = mainWindows[i];
if (mw != 0 && mw->getProject() != 0)
if (mw != nullptr && mw->getProject() != nullptr)
projects.add (mw->getProject()->getFile());
}
@@ -494,7 +494,7 @@ private:
for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;)
{
MainWindow* mw = dynamic_cast <MainWindow*> (Desktop::getInstance().getComponent (i));
if (mainWindows.contains (mw) && mw->getProject() == 0)
if (mainWindows.contains (mw) && mw->getProject() == nullptr)
return mw;
}


+ 4
- 4
extras/Introjucer/Source/Application/jucer_DocumentEditorComponent.cpp View File

@@ -43,10 +43,10 @@ void DocumentEditorComponent::documentAboutToClose (OpenDocumentManager::Documen
{
if (document == closingDoc)
{
jassert (document != 0);
jassert (document != nullptr);
ProjectContentComponent* pcc = findParentComponentOfClass ((ProjectContentComponent*) 0);
if (pcc != 0)
if (pcc != nullptr)
{
pcc->hideDocument (document);
return;
@@ -72,10 +72,10 @@ void DocumentEditorComponent::getAllCommands (Array <CommandID>& commands)
void DocumentEditorComponent::getCommandInfo (const CommandID commandID, ApplicationCommandInfo& result)
{
result.setActive (document != 0);
result.setActive (document != nullptr);
String name;
if (document != 0)
if (document != nullptr)
name = " '" + document->getName().substring (0, 32) + "'";
switch (commandID)


+ 3
- 3
extras/Introjucer/Source/Application/jucer_FilePreviewComponent.cpp View File

@@ -42,14 +42,14 @@ void ItemPreviewComponent::tryToLoadImage()
ScopedPointer <InputStream> input (file.createInputStream());
if (input != 0)
if (input != nullptr)
{
const int64 totalSize = input->getTotalLength();
ImageFileFormat* format = ImageFileFormat::findImageFormatForStream (*input);
input = 0;
input = nullptr;
String formatName;
if (format != 0)
if (format != nullptr)
formatName = " " + format->getFormatName();
image = ImageCache::getFromFile (file);


+ 9
- 7
extras/Introjucer/Source/Application/jucer_JuceUpdater.cpp View File

@@ -128,7 +128,7 @@ void JuceUpdater::buttonClicked (Button*)
{
ScopedPointer<XmlElement> xml (downloadVersionList());
if (xml == 0 || xml->hasTagName ("html"))
if (xml == nullptr || xml->hasTagName ("html"))
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon, "Connection Problems...",
"Couldn't connect to the Raw Material Software website!");
@@ -166,7 +166,7 @@ public:
ScopedPointer<InputStream> input (url.createInputStream (false));
if (input == 0)
if (input == nullptr)
{
error = "Couldn't connect to the website...";
return;
@@ -180,7 +180,7 @@ public:
ScopedPointer<OutputStream> output (target.createOutputStream (32768));
if (output == 0)
if (output == nullptr)
{
error = "Couldn't write to the destination file...";
return;
@@ -336,7 +336,9 @@ Component* JuceUpdater::refreshComponentForRow (int rowNumber, bool isRowSelecte
{
public:
UpdateListComponent (JuceUpdater& updater_)
: updater (updater_), version (0), applyButton ("Install this version...")
: updater (updater_),
version (nullptr),
applyButton ("Install this version...")
{
addAndMakeVisible (&applyButton);
applyButton.addListener (this);
@@ -360,7 +362,7 @@ Component* JuceUpdater::refreshComponentForRow (int rowNumber, bool isRowSelecte
void paint (Graphics& g)
{
if (version != 0)
if (version != nullptr)
{
g.setColour (Colours::green.withAlpha (0.12f));
@@ -379,7 +381,7 @@ Component* JuceUpdater::refreshComponentForRow (int rowNumber, bool isRowSelecte
{
applyButton.changeWidthToFitText (getHeight() - 4);
applyButton.setTopRightPosition (getWidth(), 2);
applyButton.setVisible (version != 0);
applyButton.setVisible (version != nullptr);
}
void buttonClicked (Button*)
@@ -394,7 +396,7 @@ Component* JuceUpdater::refreshComponentForRow (int rowNumber, bool isRowSelecte
};
UpdateListComponent* c = dynamic_cast <UpdateListComponent*> (existingComponentToUpdate);
if (c == 0)
if (c == nullptr)
c = new UpdateListComponent (*this);
c->setVersion (availableVersions [rowNumber]);


+ 14
- 14
extras/Introjucer/Source/Application/jucer_MainWindow.cpp View File

@@ -30,7 +30,7 @@
#include "../Code Editor/jucer_SourceCodeEditor.h"
#include "../Project/jucer_NewProjectWizard.h"
ApplicationCommandManager* commandManager = 0;
ApplicationCommandManager* commandManager = nullptr;
//==============================================================================
@@ -59,7 +59,7 @@ MainWindow::MainWindow()
ProjectContentComponent pcc;
commandManager->registerAllCommandsForTarget (&pcc);
DocumentEditorComponent dec (0);
DocumentEditorComponent dec (nullptr);
commandManager->registerAllCommandsForTarget (&dec);
}
@@ -67,7 +67,7 @@ MainWindow::MainWindow()
ScopedPointer <XmlElement> keys (StoredSettings::getInstance()->getProps().getXmlValue ("keyMappings"));
if (keys != 0)
if (keys != nullptr)
commandManager->getKeyMappings()->restoreFromXml (*keys);
addKeyListener (commandManager->getKeyMappings());
@@ -81,9 +81,9 @@ MainWindow::MainWindow()
MainWindow::~MainWindow()
{
#if ! JUCE_MAC
setMenuBar (0);
#endif
#if ! JUCE_MAC
setMenuBar (nullptr);
#endif
removeKeyListener (commandManager->getKeyMappings());
@@ -92,7 +92,7 @@ MainWindow::~MainWindow()
.setValue ("lastMainWindowPos", getWindowStateAsString());
clearContentComponent();
currentProject = 0;
currentProject = nullptr;
}
ProjectContentComponent* MainWindow::getProjectContentComponent() const
@@ -111,9 +111,9 @@ void MainWindow::closeButtonPressed()
bool MainWindow::closeProject (Project* project)
{
jassert (project == currentProject && project != 0);
jassert (project == currentProject && project != nullptr);
if (project == 0)
if (project == nullptr)
return true;
StoredSettings::getInstance()->getProps()
@@ -126,7 +126,7 @@ bool MainWindow::closeProject (Project* project)
if (r == FileBasedDocument::savedOk)
{
setProject (0);
setProject (nullptr);
return true;
}
@@ -135,7 +135,7 @@ bool MainWindow::closeProject (Project* project)
bool MainWindow::closeCurrentProject()
{
return currentProject == 0 || closeProject (currentProject);
return currentProject == nullptr || closeProject (currentProject);
}
void MainWindow::setProject (Project* newProject)
@@ -146,7 +146,7 @@ void MainWindow::setProject (Project* newProject)
// (mustn't do this when the project is 0, because that'll happen on shutdown,
// which will erase the list of recent projects)
if (newProject != 0)
if (newProject != nullptr)
static_cast<JucerApplication*> (JUCEApplication::getInstance())->updateRecentProjectList();
}
@@ -154,7 +154,7 @@ void MainWindow::restoreWindowPosition()
{
String windowState;
if (currentProject != 0)
if (currentProject != nullptr)
windowState = StoredSettings::getInstance()->getProps().getValue (getProjectWindowPosName());
if (windowState.isEmpty())
@@ -217,7 +217,7 @@ void MainWindow::activeWindowStatusChanged()
{
DocumentWindow::activeWindowStatusChanged();
if (getProjectContentComponent() != 0)
if (getProjectContentComponent() != nullptr)
getProjectContentComponent()->updateMissingFileStatuses();
OpenDocumentManager::getInstance()->reloadModifiedFiles();


+ 2
- 2
extras/Introjucer/Source/Application/jucer_MainWindow.h View File

@@ -76,8 +76,8 @@ private:
const String getProjectWindowPosName() const
{
jassert (currentProject != 0);
if (currentProject == 0)
jassert (currentProject != nullptr);
if (currentProject == nullptr)
return String::empty;
return "projectWindowPos_" + currentProject->getProjectUID();


+ 11
- 11
extras/Introjucer/Source/Application/jucer_OpenDocumentManager.cpp View File

@@ -62,7 +62,7 @@ public:
bool refersToProject (Project& project) const { return false; }
const String getName() const { return modDetector.getFile().getFileName(); }
const String getType() const { return modDetector.getFile().getFileExtension() + " file"; }
bool needsSaving() const { return codeDoc != 0 && codeDoc->hasChangedSinceSavePoint(); }
bool needsSaving() const { return codeDoc != nullptr && codeDoc->hasChangedSinceSavePoint(); }
bool hasFileBeenModifiedExternally() { return modDetector.hasBeenModified(); }
void fileHasBeenRenamed (const File& newFile) { modDetector.fileHasBeenRenamed (newFile); }
@@ -72,7 +72,7 @@ public:
ScopedPointer <InputStream> in (modDetector.getFile().createInputStream());
if (in != 0)
if (in != nullptr)
codeDoc->loadFromStream (*in);
}
@@ -81,10 +81,10 @@ public:
TemporaryFile temp (modDetector.getFile());
ScopedPointer <FileOutputStream> out (temp.getFile().createOutputStream());
if (out == 0 || ! codeDoc->writeToStream (*out))
if (out == nullptr || ! codeDoc->writeToStream (*out))
return false;
out = 0;
out = nullptr;
if (! temp.overwriteTargetFileWithTemporary())
return false;
@@ -94,7 +94,7 @@ public:
Component* createEditor()
{
CodeTokeniser* tokeniser = 0;
CodeTokeniser* tokeniser = nullptr;
if (SourceCodeEditor::isCppFile (modDetector.getFile()))
tokeniser = &cppTokeniser;
@@ -212,20 +212,20 @@ OpenDocumentManager::Document* OpenDocumentManager::getDocumentForFile (Project*
if (documents.getUnchecked(i)->isForFile (file))
return documents.getUnchecked(i);
Document* d = 0;
Document* d = nullptr;
for (int i = types.size(); --i >= 0 && d == 0;)
for (int i = types.size(); --i >= 0 && d == nullptr;)
{
if (types.getUnchecked(i)->canOpenFile (file))
{
d = types.getUnchecked(i)->openFile (project, file);
jassert (d != 0);
jassert (d != nullptr);
}
}
jassert (d != 0);
jassert (d != nullptr);
if (d != 0)
if (d != nullptr)
documents.add (d);
commandManager->commandStatusChanged();
@@ -288,7 +288,7 @@ bool OpenDocumentManager::closeDocument (int index, bool saveIfNeeded)
{
Document* doc = documents [index];
if (doc != 0)
if (doc != nullptr)
{
if (saveIfNeeded)
{


+ 1
- 1
extras/Introjucer/Source/Project/jucer_GroupInformationComponent.cpp View File

@@ -140,7 +140,7 @@ Component* GroupInformationComponent::refreshComponentForRow (int rowNumber, boo
{
Project::Item child (item.getChild (rowNumber));
if (existingComponentToUpdate == 0
if (existingComponentToUpdate == nullptr
|| dynamic_cast <FileOptionComponent*> (existingComponentToUpdate)->item != child)
{
delete existingComponentToUpdate;


+ 1
- 1
extras/Introjucer/Source/Project/jucer_NewFileWizard.cpp View File

@@ -169,7 +169,7 @@ bool NewFileWizard::runWizardFromMenu (int chosenMenuItemID, const Project::Item
{
Type* wiz = wizards [chosenMenuItemID - menuBaseID];
if (wiz != 0)
if (wiz != nullptr)
{
wiz->createNewFile (projectGroupToAddTo);
return true;


+ 1
- 1
extras/Introjucer/Source/Project/jucer_NewProjectWizard.cpp View File

@@ -490,5 +490,5 @@ Project* NewProjectWizard::runNewProjectWizard (Component* ownerWindow)
}
}
return wizard != 0 ? wizard->runWizard (ownerWindow) : 0;
return wizard != nullptr ? wizard->runWizard (ownerWindow) : 0;
}

+ 7
- 7
extras/Introjucer/Source/Project/jucer_Project.cpp View File

@@ -159,7 +159,7 @@ const String Project::loadDocument (const File& file)
{
ScopedPointer <XmlElement> xml (XmlDocument::parse (file));
if (xml == 0 || ! xml->hasTagName (Tags::projectRoot.toString()))
if (xml == nullptr || ! xml->hasTagName (Tags::projectRoot.toString()))
return "Not a valid Jucer project!";
ValueTree newTree (ValueTree::fromXml (*xml));
@@ -304,7 +304,7 @@ const File Project::getLocalJuceFolder()
{
ScopedPointer <ProjectExporter> exp (ProjectExporter::createPlatformDefaultExporter (*this));
if (exp != 0)
if (exp != nullptr)
{
File f (resolveFilename (exp->getJuceFolder().toString()));
@@ -925,8 +925,8 @@ const String Project::getUniqueConfigName (String name) const
void Project::addNewConfiguration (BuildConfiguration* configToCopy)
{
const String configName (getUniqueConfigName (configToCopy != 0 ? configToCopy->config [Ids::name].toString()
: "New Build Configuration"));
const String configName (getUniqueConfigName (configToCopy != nullptr ? configToCopy->config [Ids::name].toString()
: "New Build Configuration"));
ValueTree configs (getConfigurations());
@@ -937,7 +937,7 @@ void Project::addNewConfiguration (BuildConfiguration* configToCopy)
}
ValueTree newConfig (Tags::configuration);
if (configToCopy != 0)
if (configToCopy != nullptr)
newConfig = configToCopy->config.createCopy();
newConfig.setProperty (Ids::name, configName, 0);
@@ -955,7 +955,7 @@ void Project::createDefaultConfigs()
{
for (int i = 0; i < 2; ++i)
{
addNewConfiguration (0);
addNewConfiguration (nullptr);
BuildConfiguration config = getConfiguration (i);
const bool debugConfig = i == 0;
@@ -1128,7 +1128,7 @@ const String Project::getFileTemplate (const String& templateName)
int dataSize;
const char* data = BinaryData::getNamedResource (templateName.toUTF8(), dataSize);
if (data == 0)
if (data == nullptr)
{
jassertfalse;
return String::empty;


+ 35
- 35
extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp View File

@@ -33,8 +33,8 @@
//==============================================================================
ProjectContentComponent::ProjectContentComponent()
: project (0),
currentDocument (0)
: project (nullptr),
currentDocument (nullptr)
{
setOpaque (true);
setWantsKeyboardFocus (true);
@@ -45,8 +45,8 @@ ProjectContentComponent::ProjectContentComponent()
ProjectContentComponent::~ProjectContentComponent()
{
setProject (0);
contentView = 0;
setProject (nullptr);
contentView = nullptr;
jassert (getNumChildComponents() == 0);
}
@@ -59,22 +59,22 @@ void ProjectContentComponent::setProject (Project* newProject)
{
if (project != newProject)
{
if (project != 0)
if (project != nullptr)
project->removeChangeListener (this);
contentView = 0;
resizerBar = 0;
contentView = nullptr;
resizerBar = nullptr;
if (projectTree != 0)
if (projectTree != nullptr)
{
StoredSettings::getInstance()->getProps().setValue ("projectTreeviewWidth", projectTree->getWidth());
projectTree->deleteRootItem();
projectTree = 0;
projectTree = nullptr;
}
project = newProject;
if (project != 0)
if (project != nullptr)
{
addAndMakeVisible (projectTree = new TreeView());
projectTree->setComponentID ("tree");
@@ -100,7 +100,7 @@ void ProjectContentComponent::setProject (Project* newProject)
project->addChangeListener (this);
if (currentDocument == 0)
if (currentDocument == nullptr)
invokeDirectly (CommandIDs::showProjectSettings, true);
updateMissingFileStatuses();
@@ -115,10 +115,10 @@ void ProjectContentComponent::changeListenerCallback (ChangeBroadcaster*)
void ProjectContentComponent::updateMissingFileStatuses()
{
if (projectTree != 0)
if (projectTree != nullptr)
{
ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (projectTree->getRootItem());
if (p != 0)
if (p != nullptr)
p->checkFileStatus();
}
}
@@ -131,7 +131,7 @@ bool ProjectContentComponent::showEditorForFile (const File& f)
bool ProjectContentComponent::showDocument (OpenDocumentManager::Document* doc)
{
if (doc == 0)
if (doc == nullptr)
return false;
OpenDocumentManager::getInstance()->moveDocumentToTopOfStack (doc);
@@ -146,8 +146,8 @@ void ProjectContentComponent::hideDocument (OpenDocumentManager::Document* doc)
{
if (doc == currentDocument)
{
currentDocument = 0;
contentView = 0;
currentDocument = nullptr;
contentView = nullptr;
updateMainWindowTitle();
commandManager->commandStatusChanged();
}
@@ -155,7 +155,7 @@ void ProjectContentComponent::hideDocument (OpenDocumentManager::Document* doc)
bool ProjectContentComponent::setEditorComponent (Component* editor, OpenDocumentManager::Document* doc)
{
if (editor != 0)
if (editor != nullptr)
{
contentView = editor;
currentDocument = doc;
@@ -176,8 +176,8 @@ void ProjectContentComponent::updateMainWindowTitle()
{
MainWindow* mw = Component::findParentComponentOfClass ((MainWindow*) 0);
if (mw != 0)
mw->updateTitle (currentDocument != 0 ? currentDocument->getName() : String::empty);
if (mw != nullptr)
mw->updateTitle (currentDocument != nullptr ? currentDocument->getName() : String::empty);
}
ApplicationCommandTarget* ProjectContentComponent::getNextCommandTarget()
@@ -206,7 +206,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica
result.setInfo ("Save Project",
"Saves the current project",
CommandCategories::general, 0);
result.setActive (project != 0);
result.setActive (project != nullptr);
result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier, 0));
break;
@@ -214,7 +214,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica
result.setInfo ("Save Project As...",
"Saves the current project to a different filename",
CommandCategories::general, 0);
result.setActive (project != 0);
result.setActive (project != nullptr);
result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
break;
@@ -222,7 +222,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica
result.setInfo ("Close Project",
"Closes the current project",
CommandCategories::general, 0);
result.setActive (project != 0);
result.setActive (project != nullptr);
result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
break;
@@ -236,7 +236,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica
#endif
"Launches the project in an external IDE",
CommandCategories::general, 0);
result.setActive (project != 0);
result.setActive (project != nullptr);
break;
case CommandIDs::saveAndOpenInIDE:
@@ -249,7 +249,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica
#endif
"Saves the project and launches it in an external IDE",
CommandCategories::general, 0);
result.setActive (project != 0);
result.setActive (project != nullptr);
result.defaultKeypresses.add (KeyPress ('l', ModifierKeys::commandModifier, 0));
break;
@@ -257,7 +257,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica
result.setInfo ("Show Project Build Settings",
"Shows the build options for the project",
CommandCategories::general, 0);
result.setActive (project != 0);
result.setActive (project != nullptr);
result.defaultKeypresses.add (KeyPress ('i', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
break;
@@ -265,7 +265,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica
result.setInfo ("Delete", String::empty, CommandCategories::general, 0);
result.defaultKeypresses.add (KeyPress (KeyPress::deleteKey, 0, 0));
result.defaultKeypresses.add (KeyPress (KeyPress::backspaceKey, 0, 0));
result.setActive (projectTree != 0);
result.setActive (projectTree != nullptr);
break;
default:
@@ -275,7 +275,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica
bool ProjectContentComponent::isCommandActive (const CommandID commandID)
{
return project != 0;
return project != nullptr;
}
bool ProjectContentComponent::perform (const InvocationInfo& info)
@@ -283,13 +283,13 @@ bool ProjectContentComponent::perform (const InvocationInfo& info)
switch (info.commandID)
{
case CommandIDs::saveProject:
if (project != 0)
if (project != nullptr)
project->save (true, true);
break;
case CommandIDs::saveProjectAs:
if (project != 0)
if (project != nullptr)
project->saveAsInteractive (true);
break;
@@ -298,14 +298,14 @@ bool ProjectContentComponent::perform (const InvocationInfo& info)
{
MainWindow* mw = Component::findParentComponentOfClass ((MainWindow*) 0);
if (mw != 0)
if (mw != nullptr)
mw->closeCurrentProject();
}
break;
case CommandIDs::openInIDE:
if (project != 0)
if (project != nullptr)
{
ScopedPointer <ProjectExporter> exporter (ProjectExporter::createPlatformDefaultExporter (*project));
exporter->launchProject();
@@ -313,7 +313,7 @@ bool ProjectContentComponent::perform (const InvocationInfo& info)
break;
case CommandIDs::saveAndOpenInIDE:
if (project != 0 && project->save (true, true) == FileBasedDocument::savedOk)
if (project != nullptr && project->save (true, true) == FileBasedDocument::savedOk)
{
ScopedPointer <ProjectExporter> exporter (ProjectExporter::createPlatformDefaultExporter (*project));
exporter->launchProject();
@@ -321,16 +321,16 @@ bool ProjectContentComponent::perform (const InvocationInfo& info)
break;
case CommandIDs::showProjectSettings:
if (projectTree != 0)
if (projectTree != nullptr)
projectTree->getRootItem()->setSelected (true, true);
break;
case StandardApplicationCommandIDs::del:
if (projectTree != 0)
if (projectTree != nullptr)
{
ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (projectTree->getRootItem());
if (p != 0)
if (p != nullptr)
p->deleteAllSelectedItems();
}


+ 4
- 4
extras/Introjucer/Source/Project/jucer_ProjectExport_XCode.h View File

@@ -247,8 +247,8 @@ private:
const int w = image.getWidth();
const int h = image.getHeight();
const char* type = 0;
const char* maskType = 0;
const char* type = nullptr;
const char* maskType = nullptr;
if (w == h)
{
@@ -258,7 +258,7 @@ private:
if (w == 128) { type = "it32"; maskType = "t8mk"; }
}
if (type != 0)
if (type != nullptr)
{
data.write (type, 4);
data.writeIntBigEndian (8 + 4 * w * h);
@@ -975,7 +975,7 @@ private:
v->setProperty ("buildConfigurations", "(" + indentList (configIDs, ",") + " )", 0);
v->setProperty ("defaultConfigurationIsVisible", (int) 0, 0);
if (configsToUse[0] != 0)
if (configsToUse[0] != nullptr)
v->setProperty ("defaultConfigurationName", configsToUse[0]->getProperty (Ids::name), 0);
misc.add (v);


+ 9
- 9
extras/Introjucer/Source/Project/jucer_ProjectExporter.cpp View File

@@ -62,7 +62,7 @@ const StringArray ProjectExporter::getExporterNames()
ProjectExporter* ProjectExporter::createNewExporter (Project& project, const int index)
{
ProjectExporter* exp = 0;
ProjectExporter* exp = nullptr;
switch (index)
{
@@ -91,14 +91,14 @@ ProjectExporter* ProjectExporter::createNewExporter (Project& project, const int
ProjectExporter* ProjectExporter::createExporter (Project& project, const ValueTree& settings)
{
ProjectExporter* exp = MSVCProjectExporterVC6::createForSettings (project, settings);
if (exp == 0) exp = MSVCProjectExporterVC2005::createForSettings (project, settings);
if (exp == 0) exp = MSVCProjectExporterVC2008::createForSettings (project, settings);
if (exp == 0) exp = MSVCProjectExporterVC2010::createForSettings (project, settings);
if (exp == 0) exp = XCodeProjectExporter::createForSettings (project, settings);
if (exp == 0) exp = MakefileProjectExporter::createForSettings (project, settings);
if (exp == 0) exp = AndroidProjectExporter::createForSettings (project, settings);
jassert (exp != 0);
if (exp == nullptr) exp = MSVCProjectExporterVC2005::createForSettings (project, settings);
if (exp == nullptr) exp = MSVCProjectExporterVC2008::createForSettings (project, settings);
if (exp == nullptr) exp = MSVCProjectExporterVC2010::createForSettings (project, settings);
if (exp == nullptr) exp = XCodeProjectExporter::createForSettings (project, settings);
if (exp == nullptr) exp = MakefileProjectExporter::createForSettings (project, settings);
if (exp == nullptr) exp = AndroidProjectExporter::createForSettings (project, settings);
jassert (exp != nullptr);
return exp;
}


+ 4
- 4
extras/Introjucer/Source/Project/jucer_ProjectInformationComponent.cpp View File

@@ -76,7 +76,7 @@ public:
// An export tab..
ScopedPointer <ProjectExporter> exp (project.createExporter (tabIndex - (2 + project.getNumConfigurations())));
if (exp != 0)
if (exp != nullptr)
exp->createPropertyEditors (props);
for (int i = props.size(); --i >= 0;)
@@ -241,7 +241,7 @@ void ProjectInformationComponent::rebuildConfigTabs()
{
ScopedPointer <ProjectExporter> exp (project.createExporter (i));
if (exp != 0)
if (exp != nullptr)
{
panel = new PropertiesWithHelpComponent (project, index++);
configTabBox.addTab (exp->getName(), Colours::lightsteelblue, panel, true, -1);
@@ -298,7 +298,7 @@ void ProjectInformationComponent::showConfigMenu()
}
else if (r == 1)
{
project.addNewConfiguration (0);
project.addNewConfiguration (nullptr);
}
}
@@ -313,7 +313,7 @@ void ProjectInformationComponent::showExporterMenu()
{
ScopedPointer<ProjectExporter> exp (project.createExporter (i));
if (exp != 0)
if (exp != nullptr)
removeMenu.addItem (i + 20000, "Delete " + exp->getName());
}


+ 3
- 3
extras/Introjucer/Source/Project/jucer_ProjectSaver.h View File

@@ -102,9 +102,9 @@ private:
void writeMainProjectFile()
{
ScopedPointer <XmlElement> xml (project.getProjectRoot().createXml());
jassert (xml != 0);
jassert (xml != nullptr);
if (xml != 0)
if (xml != nullptr)
{
#if JUCE_DEBUG
{
@@ -249,7 +249,7 @@ private:
{
ScopedPointer <ProjectExporter> exporter (project.createExporter (i));
if (exporter != 0)
if (exporter != nullptr)
{
paths.add (exporter->getIncludePathForFileInJuceFolder (pathFromJuceFolder, juceHeaderFile));
guards.add ("defined (" + exporter->getExporterIdentifierMacro() + ")");


+ 20
- 20
extras/Introjucer/Source/Project/jucer_ProjectTreeViewBase.cpp View File

@@ -79,7 +79,7 @@ void ProjectTreeViewBase::addFiles (const StringArray& files, int insertIndex)
{
ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (getParentItem());
if (p != 0)
if (p != nullptr)
p->addFiles (files, insertIndex);
}
@@ -104,11 +104,11 @@ ProjectTreeViewBase* ProjectTreeViewBase::findTreeViewItem (const Project::Item&
{
ProjectTreeViewBase* pg = dynamic_cast <ProjectTreeViewBase*> (getSubItem(i));
if (pg != 0)
if (pg != nullptr)
{
pg = pg->findTreeViewItem (itemToFind);
if (pg != 0)
if (pg != nullptr)
return pg;
}
}
@@ -130,15 +130,15 @@ void ProjectTreeViewBase::triggerAsyncRename (const Project::Item& itemToRename)
void messageCallback()
{
if (tree != 0)
if (tree != nullptr)
{
ProjectTreeViewBase* pg = dynamic_cast <ProjectTreeViewBase*> (tree->getRootItem());
if (pg != 0)
if (pg != nullptr)
{
pg = pg->findTreeViewItem (itemToRename);
if (pg != 0)
if (pg != nullptr)
pg->showRenameBox();
}
}
@@ -187,7 +187,7 @@ void ProjectTreeViewBase::deleteAllSelectedItems()
{
const ProjectTreeViewBase* const p = dynamic_cast <ProjectTreeViewBase*> (tree->getSelectedItem (i));
if (p != 0)
if (p != nullptr)
{
itemsToRemove.add (new Project::Item (p->item));
@@ -222,9 +222,9 @@ void ProjectTreeViewBase::deleteAllSelectedItems()
}
ProjectTreeViewBase* treeRootItem = dynamic_cast <ProjectTreeViewBase*> (tree->getRootItem());
jassert (treeRootItem != 0);
jassert (treeRootItem != nullptr);
if (treeRootItem != 0)
if (treeRootItem != nullptr)
{
for (i = filesToTrash.size(); --i >= 0;)
{
@@ -242,7 +242,7 @@ void ProjectTreeViewBase::deleteAllSelectedItems()
{
ProjectTreeViewBase* itemToRemove = treeRootItem->findTreeViewItem (*itemsToRemove.getUnchecked(i));
if (itemToRemove != 0)
if (itemToRemove != nullptr)
{
OpenDocumentManager::getInstance()->closeFile (itemToRemove->getFile(), false);
itemToRemove->deleteItem();
@@ -319,10 +319,10 @@ void ProjectTreeViewBase::getAllSelectedNodesInTree (Component* componentInTree,
{
TreeView* tree = dynamic_cast <TreeView*> (componentInTree);
if (tree == 0)
if (tree == nullptr)
tree = componentInTree->findParentComponentOfClass ((TreeView*) 0);
if (tree != 0)
if (tree != nullptr)
{
const int numSelected = tree->getNumSelectedItems();
@@ -330,7 +330,7 @@ void ProjectTreeViewBase::getAllSelectedNodesInTree (Component* componentInTree,
{
const ProjectTreeViewBase* const p = dynamic_cast <ProjectTreeViewBase*> (tree->getSelectedItem (i));
if (p != 0)
if (p != nullptr)
selectedNodes.add (new Project::Item (p->item));
}
}
@@ -359,7 +359,7 @@ void ProjectTreeViewBase::itemDropped (const String& sourceDescription, Componen
moveSelectedItemsTo (selectedNodes, insertIndex);
if (oldOpenness != 0)
if (oldOpenness != nullptr)
tree->restoreOpennessState (*oldOpenness);
}
}
@@ -424,7 +424,7 @@ void ProjectTreeViewBase::addSubItems()
{
ProjectTreeViewBase* p = createSubItem (item.getChild(i));
if (p != 0)
if (p != nullptr)
addSubItem (p);
}
}
@@ -483,7 +483,7 @@ void ProjectTreeViewBase::itemSelectionChanged (bool isNowSelected)
}
else
{
delayedSelectionTimer = 0;
delayedSelectionTimer = nullptr;
}
}
@@ -494,13 +494,13 @@ const String ProjectTreeViewBase::getTooltip()
const String ProjectTreeViewBase::getDragSourceDescription()
{
delayedSelectionTimer = 0;
delayedSelectionTimer = nullptr;
return projectItemDragType;
}
void ProjectTreeViewBase::invokeShowDocument()
{
delayedSelectionTimer = 0;
delayedSelectionTimer = nullptr;
showDocument();
}
@@ -514,11 +514,11 @@ ProjectContentComponent* ProjectTreeViewBase::getProjectContentComponent() const
{
Component* c = getOwnerView();
while (c != 0)
while (c != nullptr)
{
ProjectContentComponent* pcc = dynamic_cast <ProjectContentComponent*> (c);
if (pcc != 0)
if (pcc != nullptr)
return pcc;
c = c->getParentComponent();


+ 6
- 6
extras/Introjucer/Source/Project/jucer_ResourceFile.cpp View File

@@ -48,7 +48,7 @@ bool ResourceFile::isResourceFile (const File& file)
{
ScopedPointer <InputStream> in (file.createInputStream());
if (in != 0)
if (in != nullptr)
{
MemoryBlock mb;
in->readIntoMemoryBlock (mb, 256);
@@ -167,9 +167,9 @@ bool ResourceFile::write (const File& cppFile, OutputStream& cpp, OutputStream&
const int64 dataSize = file.getSize();
ScopedPointer <InputStream> fileStream (file.createInputStream());
jassert (fileStream != 0);
jassert (fileStream != nullptr);
if (fileStream != 0)
if (fileStream != nullptr)
{
const String variableName (variableNames[i]);
const String tempVariable ("temp_" + String::toHexString (file.hashCode()));
@@ -209,12 +209,12 @@ bool ResourceFile::write (const File& cppFile)
ScopedPointer <FileOutputStream> cppOut (tempCpp.getFile().createOutputStream (32768));
ScopedPointer <FileOutputStream> hppOut (tempH.getFile().createOutputStream (32768));
if (cppOut != 0 && hppOut != 0)
if (cppOut != nullptr && hppOut != nullptr)
{
if (write (cppFile, *cppOut, *hppOut))
{
cppOut = 0;
hppOut = 0;
cppOut = nullptr;
hppOut = nullptr;
return (tempCpp.getFile().hasIdenticalContentTo (tempCpp.getTargetFile()) || tempCpp.overwriteTargetFileWithTemporary())
&& (tempH.getFile().hasIdenticalContentTo (tempH.getTargetFile()) || tempH.overwriteTargetFileWithTemporary());


+ 5
- 5
extras/Introjucer/Source/Project/jucer_TreeViewTypes.cpp View File

@@ -79,7 +79,7 @@ void GroupTreeViewItem::checkFileStatus()
{
ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (getSubItem(i));
if (p != 0)
if (p != nullptr)
p->checkFileStatus();
}
}
@@ -100,7 +100,7 @@ void GroupTreeViewItem::showDocument()
{
ProjectContentComponent* pcc = getProjectContentComponent();
if (pcc != 0)
if (pcc != nullptr)
{
if (isRoot())
pcc->setEditorComponent (new ProjectInformationComponent (item.getProject()), 0);
@@ -237,7 +237,7 @@ void SourceFileTreeViewItem::showDocument()
ProjectContentComponent* pcc = getProjectContentComponent();
const File f (getFile());
if (pcc != 0 && f.exists())
if (pcc != nullptr && f.exists())
pcc->showEditorForFile (f);
}
@@ -247,7 +247,7 @@ void SourceFileTreeViewItem::showPopupMenu()
PopupMenu m;
if (parentGroup != 0)
if (parentGroup != nullptr)
{
parentGroup->addCreateFileMenuItems (m);
m.addSeparator();
@@ -274,7 +274,7 @@ void SourceFileTreeViewItem::showPopupMenu()
case 4: triggerAsyncRename (item); break;
default:
if (parentGroup != 0)
if (parentGroup != nullptr)
parentGroup->processCreateFileMenuItem (res);
break;


+ 1
- 1
extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp View File

@@ -40,7 +40,7 @@ namespace FileHelpers
int64 calculateFileHashCode (const File& file)
{
ScopedPointer <FileInputStream> stream (file.createInputStream());
return stream != 0 ? calculateStreamHashCode (*stream) : 0;
return stream != nullptr ? calculateStreamHashCode (*stream) : 0;
}
bool overwriteFileWithNewDataIfDifferent (const File& file, const void* data, int numBytes)


+ 7
- 7
extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp View File

@@ -169,7 +169,7 @@ void autoScrollForMouseEvent (const MouseEvent& e, bool scrollX, bool scrollY)
{
Viewport* const viewport = e.eventComponent->findParentComponentOfClass ((Viewport*) 0);
if (viewport != 0)
if (viewport != nullptr)
{
const MouseEvent e2 (e.getEventRelativeTo (viewport));
viewport->autoScroll (scrollX ? e2.x : 20, scrollY ? e2.y : 20, 8, 16);
@@ -235,7 +235,7 @@ int indexOfLineStartingWith (const StringArray& lines, const String& text, int s
//==============================================================================
PropertyPanelWithTooltips::PropertyPanelWithTooltips()
: lastComp (0)
: lastComp (nullptr)
{
addAndMakeVisible (&panel);
startTimer (150);
@@ -270,8 +270,8 @@ void PropertyPanelWithTooltips::timerCallback()
{
Component* newComp = Desktop::getInstance().getMainMouseSource().getComponentUnderMouse();
if (newComp != 0 && newComp->getTopLevelComponent() != getTopLevelComponent())
newComp = 0;
if (newComp != nullptr && newComp->getTopLevelComponent() != getTopLevelComponent())
newComp = nullptr;
if (newComp != lastComp)
{
@@ -289,10 +289,10 @@ void PropertyPanelWithTooltips::timerCallback()
const String PropertyPanelWithTooltips::findTip (Component* c)
{
while (c != 0 && c != this)
while (c != nullptr && c != this)
{
TooltipClient* const tc = dynamic_cast <TooltipClient*> (c);
if (tc != 0)
if (tc != nullptr)
{
const String tip (tc->getTooltip());
@@ -315,7 +315,7 @@ FloatingLabelComponent::FloatingLabelComponent()
void FloatingLabelComponent::remove()
{
if (getParentComponent() != 0)
if (getParentComponent() != nullptr)
getParentComponent()->removeChildComponent (this);
}


+ 7
- 8
extras/Introjucer/Source/Utility/jucer_StoredSettings.cpp View File

@@ -29,7 +29,6 @@
//==============================================================================
StoredSettings::StoredSettings()
: props (0)
{
flush();
}
@@ -37,7 +36,7 @@ StoredSettings::StoredSettings()
StoredSettings::~StoredSettings()
{
flush();
props = 0;
props = nullptr;
clearSingletonInstance();
}
@@ -47,28 +46,28 @@ juce_ImplementSingleton (StoredSettings);
//==============================================================================
PropertiesFile& StoredSettings::getProps()
{
jassert (props != 0);
jassert (props != nullptr);
return *props;
}
void StoredSettings::flush()
{
if (props != 0)
if (props != nullptr)
{
props->setValue ("recentFiles", recentFiles.toString());
props->removeValue ("keyMappings");
if (commandManager != 0)
if (commandManager != nullptr)
{
ScopedPointer <XmlElement> keys (commandManager->getKeyMappings()->createXml (true));
if (keys != 0)
if (keys != nullptr)
props->setValue ("keyMappings", (XmlElement*) keys);
}
}
props = 0;
props = nullptr;
props = PropertiesFile::createDefaultAppPropertiesFile ("Jucer2", "settings", String::empty,
false, 3000, PropertiesFile::storeAsXML);
@@ -155,7 +154,7 @@ const Image StoredSettings::getFallbackImage()
const Drawable* StoredSettings::getImageFileIcon()
{
if (imageFileIcon == 0)
if (imageFileIcon == nullptr)
{
static const unsigned char data[] =
{ 120,218,197,90,75,111,28,199,17,158,181,60,146,98,36,135,28,98,58,185,100,175,1,164,65,87,117,87,63,142,74,156,228,34,3,129,125,80,146,27,37,46,229,141,41,238,130,92,37,240,191,207,87,61,59,195,158,215,138,176,44,154,132,128,209,246,199,154,238,122,126,


+ 33
- 33
extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm View File

@@ -146,7 +146,7 @@ public:
}
juceFilter = createPluginFilter();
jassert (juceFilter != 0);
jassert (juceFilter != nullptr);
juceFilter->setPlayHead (this);
juceFilter->addListener (this);
@@ -166,7 +166,7 @@ public:
for (int i = activeUIs.size(); --i >= 0;)
[((JuceUIViewClass*) activeUIs.getUnchecked(i)) filterBeingDeleted: this];
juceFilter = 0;
juceFilter = nullptr;
jassert (activePlugins.contains (this));
activePlugins.removeValue (this);
@@ -234,7 +234,7 @@ public:
}
else if (inID == kAudioUnitProperty_OfflineRender)
{
*(UInt32*) outData = (juceFilter != 0 && juceFilter->isNonRealtime()) ? 1 : 0;
*(UInt32*) outData = (juceFilter != nullptr && juceFilter->isNonRealtime()) ? 1 : 0;
return noErr;
}
else if (inID == kMusicDeviceProperty_InstrumentCount)
@@ -276,7 +276,7 @@ public:
{
if (inScope == kAudioUnitScope_Global && inID == kAudioUnitProperty_OfflineRender)
{
if (juceFilter != 0)
if (juceFilter != nullptr)
juceFilter->setNonRealtime ((*(UInt32*) inData) != 0);
return noErr;
@@ -296,7 +296,7 @@ public:
CFMutableDictionaryRef dict = (CFMutableDictionaryRef) *outData;
if (juceFilter != 0)
if (juceFilter != nullptr)
{
MemoryBlock state;
juceFilter->getCurrentProgramStateInformation (state);
@@ -319,7 +319,7 @@ public:
if (err != noErr)
return err;
if (juceFilter != 0)
if (juceFilter != nullptr)
{
CFDictionaryRef dict = (CFDictionaryRef) inData;
CFDataRef data = 0;
@@ -346,7 +346,7 @@ public:
// value in your JucePluginCharacteristics.h file..
jassert (numChannelConfigs > 0);
if (outInfo != 0)
if (outInfo != nullptr)
{
*outInfo = channelInfo;
@@ -372,7 +372,7 @@ public:
const int index = (int) inParameterID;
if (inScope == kAudioUnitScope_Global
&& juceFilter != 0
&& juceFilter != nullptr
&& index < juceFilter->getNumParameters())
{
outParameterInfo.flags = kAudioUnitParameterFlag_IsWritable
@@ -410,7 +410,7 @@ public:
AudioUnitElement inElement,
Float32& outValue)
{
if (inScope == kAudioUnitScope_Global && juceFilter != 0)
if (inScope == kAudioUnitScope_Global && juceFilter != nullptr)
{
outValue = juceFilter->getParameter ((int) inID);
return noErr;
@@ -425,7 +425,7 @@ public:
Float32 inValue,
UInt32 inBufferOffsetInFrames)
{
if (inScope == kAudioUnitScope_Global && juceFilter != 0)
if (inScope == kAudioUnitScope_Global && juceFilter != nullptr)
{
juceFilter->setParameter ((int) inID, inValue);
return noErr;
@@ -594,7 +594,7 @@ public:
{
JuceAUBaseClass::Cleanup();
if (juceFilter != 0)
if (juceFilter != nullptr)
juceFilter->releaseResources();
bufferSpace.setSize (2, 16);
@@ -608,7 +608,7 @@ public:
if (! prepared)
prepareToPlay();
if (juceFilter != 0)
if (juceFilter != nullptr)
juceFilter->reset();
return JuceAUBaseClass::Reset (inScope, inElement);
@@ -616,7 +616,7 @@ public:
void prepareToPlay()
{
if (juceFilter != 0)
if (juceFilter != nullptr)
{
juceFilter->setPlayConfigDetails (
#if ! JucePlugin_IsSynth
@@ -667,7 +667,7 @@ public:
AudioBufferList& outBuffer,
UInt32 numSamples)
{
if (juceFilter != 0)
if (juceFilter != nullptr)
{
jassert (prepared);
@@ -856,7 +856,7 @@ protected:
//==============================================================================
ComponentResult GetPresets (CFArrayRef* outData) const
{
if (outData != 0)
if (outData != nullptr)
{
const int numPrograms = juceFilter->getNumPrograms();
presetsArray.ensureSize (sizeof (AUPreset) * numPrograms, true);
@@ -950,7 +950,7 @@ public:
{
Component* editor = getChildComponent(0);
if (editor != 0)
if (editor != nullptr)
{
const int w = jmax (32, editor->getWidth());
const int h = jmax (32, editor->getHeight());
@@ -1017,7 +1017,7 @@ private:
{
// there's some kind of component currently modal, but the host
// is trying to delete our plugin..
jassert (Component::getCurrentlyModalComponent() == 0);
jassert (Component::getCurrentlyModalComponent() == nullptr);
[[NSNotificationCenter defaultCenter] removeObserver: self];
[self deleteEditor];
@@ -1030,11 +1030,11 @@ private:
- (void) viewDidMoveToWindow
{
if ([self window] != 0)
if ([self window] != nil)
{
[[self window] setAcceptsMouseMovedEvents: YES];
if (editorComp != 0)
if (editorComp != nullptr)
[[self window] makeFirstResponder: (NSView*) editorComp->getWindowHandle()];
}
}
@@ -1046,16 +1046,16 @@ private:
- (void) deleteEditor
{
if (editorComp != 0)
if (editorComp != nullptr)
{
if (editorComp->getChildComponent(0) != 0)
if (editorComp->getChildComponent(0) != nullptr)
if (activePlugins.contains ((void*) au)) // plugin may have been deleted before the UI
filter->editorBeingDeleted ((AudioProcessorEditor*) editorComp->getChildComponent(0));
deleteAndZero (editorComp);
}
editorComp = 0;
editorComp = nullptr;
}
- (void) filterBeingDeleted: (JuceAU*) au_
@@ -1106,12 +1106,12 @@ private:
AudioProcessor* filter = (AudioProcessor*) pointers[0];
JuceAU* au = (JuceAU*) pointers[1];
if (filter == 0)
if (filter == nullptr)
return 0;
AudioProcessorEditor* editorComp = filter->createEditorIfNeeded();
if (editorComp == 0)
if (editorComp == nullptr)
return 0;
return [[[JuceUIViewClass alloc] initWithFilter: filter
@@ -1129,7 +1129,7 @@ class JuceAUView : public AUCarbonViewBase
public:
JuceAUView (AudioUnitCarbonView auview)
: AUCarbonViewBase (auview),
juceFilter (0)
juceFilter (nullptr)
{
}
@@ -1142,7 +1142,7 @@ public:
{
JUCE_AUTORELEASEPOOL
if (juceFilter == 0)
if (juceFilter == nullptr)
{
void* pointers[2];
UInt32 propertySize = sizeof (pointers);
@@ -1157,7 +1157,7 @@ public:
juceFilter = (AudioProcessor*) pointers[0];
}
if (juceFilter != 0)
if (juceFilter != nullptr)
{
deleteUI();
@@ -1184,7 +1184,7 @@ private:
void deleteUI()
{
if (windowComp != 0)
if (windowComp != nullptr)
{
PopupMenu::dismissAllActiveMenus();
@@ -1195,12 +1195,12 @@ private:
will be performed on completion. (Note that this assertion could actually trigger
a false alarm even if you're doing it correctly, but is here to catch people who
aren't so careful) */
jassert (Component::getCurrentlyModalComponent() == 0);
jassert (Component::getCurrentlyModalComponent() == nullptr);
if (windowComp != 0 && windowComp->getChildComponent(0) != 0)
if (windowComp != nullptr && windowComp->getChildComponent(0) != nullptr)
juceFilter->editorBeingDeleted ((AudioProcessorEditor*) windowComp->getChildComponent(0));
windowComp = 0;
windowComp = nullptr;
}
}
@@ -1217,7 +1217,7 @@ private:
{
JUCE_AUTORELEASEPOOL
jassert (editor_ != 0);
jassert (editor_ != nullptr);
addAndMakeVisible (&editor);
setOpaque (true);
setVisible (true);
@@ -1299,7 +1299,7 @@ private:
void resized()
{
Component* const child = getChildComponent (0);
if (child != 0)
if (child != nullptr)
child->setBounds (getLocalBounds());
}


+ 22
- 22
extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp View File

@@ -161,8 +161,8 @@ public:
if (mLoggedIn)
MIDILogOut();
midiBufferNode = 0;
midiTransport = 0;
midiBufferNode = nullptr;
midiTransport = nullptr;
if (prepared)
juceFilter->releaseResources();
@@ -172,11 +172,11 @@ public:
if (--numInstances == 0)
{
#if JUCE_MAC
#if JUCE_MAC
// Hack to allow any NSWindows to clear themselves up before returning to PT..
for (int i = 20; --i >= 0;)
MessageManager::getInstance()->runDispatchLoopUntil (1);
#endif
#endif
shutdownJuce_GUI();
}
@@ -204,10 +204,10 @@ public:
//==============================================================================
void updateSize()
{
if (editorComp == 0)
if (editorComp == nullptr)
{
editorComp = filter->createEditorIfNeeded();
jassert (editorComp != 0);
jassert (editorComp != nullptr);
}
if (editorComp->getWidth() != 0 && editorComp->getHeight() != 0)
@@ -251,7 +251,7 @@ public:
#else
void* const hostWindow = (void*) GetWindowFromPort (port);
#endif
wrapper = 0;
wrapper = nullptr;
wrapper = new EditorCompWrapper (hostWindow, editorComp, this);
process->touchAllParameters();
@@ -265,11 +265,11 @@ public:
void DrawContents (Rect*)
{
#if JUCE_WINDOWS
if (wrapper != 0)
if (wrapper != nullptr)
{
ComponentPeer* const peer = wrapper->getPeer();
if (peer != 0)
if (peer != nullptr)
{
// (seems to be required in PT6.4, but not in 7.x)
peer->repaint (wrapper->getLocalBounds());
@@ -289,19 +289,19 @@ public:
void deleteEditorComp()
{
if (editorComp != 0 || wrapper != 0)
if (editorComp != 0 || wrapper != nullptr)
{
JUCE_AUTORELEASEPOOL
PopupMenu::dismissAllActiveMenus();
JUCE_NAMESPACE::Component* const modalComponent = JUCE_NAMESPACE::Component::getCurrentlyModalComponent();
if (modalComponent != 0)
if (modalComponent != nullptr)
modalComponent->exitModalState (0);
filter->editorBeingDeleted (editorComp);
editorComp = 0;
wrapper = 0;
editorComp = nullptr;
wrapper = nullptr;
}
}
@@ -363,7 +363,7 @@ public:
{
JUCE_NAMESPACE::Component* const c = getChildComponent (0);
if (c != 0)
if (c != nullptr)
c->setBounds (0, 0, getWidth(), getHeight());
repaint();
@@ -421,7 +421,7 @@ public:
void GetViewRect (Rect* size)
{
if (getView() != 0)
if (getView() != nullptr)
getView()->updateSize();
CEffectProcessRTAS::GetViewRect (size);
@@ -436,7 +436,7 @@ public:
{
CEffectProcessRTAS::SetViewPort (port);
if (getView() != 0)
if (getView() != nullptr)
getView()->attachToWindow (port);
}
@@ -444,8 +444,8 @@ public:
protected:
ComponentResult GetDelaySamplesLong (long* aNumSamples)
{
if (aNumSamples != 0)
*aNumSamples = juceFilter != 0 ? juceFilter->getLatencySamples() : 0;
if (aNumSamples != nullptr)
*aNumSamples = juceFilter != nullptr ? juceFilter->getLatencySamples() : 0;
return noErr;
}
@@ -472,7 +472,7 @@ protected:
#if JucePlugin_WantsMidiInput
CEffectType* const type = dynamic_cast <CEffectType*> (this->GetProcessType());
if (type != 0)
if (type != nullptr)
{
char nodeName [64];
type->GetProcessTypeName (63, nodeName);
@@ -832,12 +832,12 @@ private:
bool prepared;
double sampleRate;
static float longToFloat (const long n) throw()
static float longToFloat (const long n) noexcept
{
return (float) ((((double) n) + (double) 0x80000000) / (double) 0xffffffff);
}
static long floatToLong (const float n) throw()
static long floatToLong (const float n) noexcept
{
return roundToInt (jlimit (-(double) 0x80000000, (double) 0x7fffffff,
n * (double) 0xffffffff - (double) 0x80000000));
@@ -992,7 +992,7 @@ private:
+ String (JucePlugin_Name).substring (0, 4);
}
static EPlugIn_StemFormat getFormatForChans (const int numChans) throw()
static EPlugIn_StemFormat getFormatForChans (const int numChans) noexcept
{
switch (numChans)
{


+ 1
- 1
extras/audio plugins/wrapper/Standalone/juce_AudioFilterStreamer.cpp View File

@@ -38,7 +38,7 @@ AudioFilterStreamingDeviceManager::AudioFilterStreamingDeviceManager()
AudioFilterStreamingDeviceManager::~AudioFilterStreamingDeviceManager()
{
setFilter (0);
setFilter (nullptr);
removeMidiInputCallback (String::empty, player);
removeAudioCallback (player);


+ 27
- 24
extras/audio plugins/wrapper/Standalone/juce_StandaloneFilterWindow.cpp View File

@@ -51,7 +51,7 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title,
{
filter = createPluginFilter();
if (filter != 0)
if (filter != nullptr)
{
filter->setPlayConfigDetails (JucePlugin_MaxNumInputChannels,
JucePlugin_MaxNumOutputChannels,
@@ -64,7 +64,7 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title,
ScopedPointer<XmlElement> savedState;
if (globalSettings != 0)
if (globalSettings != nullptr)
savedState = globalSettings->getXmlValue ("audioSetup");
deviceManager->initialise (filter->getNumInputChannels(),
@@ -72,7 +72,7 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title,
savedState,
true);
if (globalSettings != 0)
if (globalSettings != nullptr)
{
MemoryBlock data;
@@ -96,7 +96,7 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title,
}
JUCE_CATCH_ALL
if (deviceManager == 0)
if (deviceManager == nullptr)
{
jassertfalse // Your filter didn't create correctly! In a standalone app that's not too great.
JUCEApplication::quit();
@@ -107,18 +107,21 @@ StandaloneFilterWindow::~StandaloneFilterWindow()
{
PropertySet* const globalSettings = getGlobalSettings();
globalSettings->setValue ("windowX", getX());
globalSettings->setValue ("windowY", getY());
if (globalSettings != 0 && deviceManager != 0)
if (globalSettings != nullptr)
{
ScopedPointer<XmlElement> xml (deviceManager->createStateXml());
globalSettings->setValue ("audioSetup", xml);
globalSettings->setValue ("windowX", getX());
globalSettings->setValue ("windowY", getY());
if (deviceManager != nullptr)
{
ScopedPointer<XmlElement> xml (deviceManager->createStateXml());
globalSettings->setValue ("audioSetup", xml);
}
}
deviceManager = 0;
deviceManager = nullptr;
if (globalSettings != 0 && filter != 0)
if (globalSettings != nullptr && filter != nullptr)
{
MemoryBlock data;
filter->getStateInformation (data);
@@ -132,16 +135,16 @@ StandaloneFilterWindow::~StandaloneFilterWindow()
//==============================================================================
void StandaloneFilterWindow::deleteFilter()
{
if (deviceManager != 0)
deviceManager->setFilter (0);
if (deviceManager != nullptr)
deviceManager->setFilter (nullptr);
if (filter != 0 && getContentComponent() != 0)
if (filter != nullptr && getContentComponent() != nullptr)
{
filter->editorBeingDeleted (dynamic_cast <AudioProcessorEditor*> (getContentComponent()));
clearContentComponent();
}
filter = 0;
filter = nullptr;
}
void StandaloneFilterWindow::resetFilter()
@@ -150,9 +153,9 @@ void StandaloneFilterWindow::resetFilter()
filter = createPluginFilter();
if (filter != 0)
if (filter != nullptr)
{
if (deviceManager != 0)
if (deviceManager != nullptr)
deviceManager->setFilter (filter);
setContentOwned (filter->createEditorIfNeeded(), true);
@@ -160,7 +163,7 @@ void StandaloneFilterWindow::resetFilter()
PropertySet* const globalSettings = getGlobalSettings();
if (globalSettings != 0)
if (globalSettings != nullptr)
globalSettings->removeValue ("filterState");
}
@@ -170,8 +173,8 @@ void StandaloneFilterWindow::saveState()
PropertySet* const globalSettings = getGlobalSettings();
FileChooser fc (TRANS("Save current state"),
globalSettings != 0 ? File (globalSettings->getValue ("lastStateFile"))
: File::nonexistent);
globalSettings != nullptr ? File (globalSettings->getValue ("lastStateFile"))
: File::nonexistent);
if (fc.browseForFileToSave (true))
{
@@ -192,8 +195,8 @@ void StandaloneFilterWindow::loadState()
PropertySet* const globalSettings = getGlobalSettings();
FileChooser fc (TRANS("Load a saved state"),
globalSettings != 0 ? File (globalSettings->getValue ("lastStateFile"))
: File::nonexistent);
globalSettings != nullptr ? File (globalSettings->getValue ("lastStateFile"))
: File::nonexistent);
if (fc.browseForFileToOpen())
{
@@ -255,7 +258,7 @@ void StandaloneFilterWindow::resized()
void StandaloneFilterWindow::buttonClicked (Button*)
{
if (filter == 0)
if (filter == nullptr)
return;
PopupMenu m;


+ 35
- 35
extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp View File

@@ -229,7 +229,7 @@ namespace
Component* const comp = Desktop::getInstance().findComponentAt (Point<int> (hs.pt.x,
hs.pt.y));
if (comp != 0 && comp->getWindowHandle() != 0)
if (comp != nullptr && comp->getWindowHandle() != 0)
return PostMessage ((HWND) comp->getWindowHandle(), WM_MOUSEWHEEL,
hs.mouseData & 0xffff0000, (hs.pt.x & 0xffff) | (hs.pt.y << 16));
}
@@ -472,7 +472,7 @@ public:
bool getInputProperties (VstInt32 index, VstPinProperties* properties)
{
if (filter == 0 || index >= JucePlugin_MaxNumInputChannels)
if (filter == nullptr || index >= JucePlugin_MaxNumInputChannels)
return false;
setPinProperties (*properties, filter->getInputChannelName ((int) index),
@@ -482,7 +482,7 @@ public:
bool getOutputProperties (VstInt32 index, VstPinProperties* properties)
{
if (filter == 0 || index >= JucePlugin_MaxNumOutputChannels)
if (filter == nullptr || index >= JucePlugin_MaxNumOutputChannels)
return false;
setPinProperties (*properties, filter->getOutputChannelName ((int) index),
@@ -668,7 +668,7 @@ public:
void resume()
{
if (filter != 0)
if (filter != nullptr)
{
isProcessing = true;
channels.calloc (numInChans + numOutChans);
@@ -709,7 +709,7 @@ public:
void suspend()
{
if (filter != 0)
if (filter != nullptr)
{
AudioEffectX::suspend();
@@ -728,7 +728,7 @@ public:
const VstTimeInfo* const ti = getTimeInfo (kVstPpqPosValid | kVstTempoValid | kVstBarsValid //| kVstCyclePosValid
| kVstTimeSigValid | kVstSmpteValid | kVstClockValid);
if (ti == 0 || ti->sampleRate <= 0)
if (ti == nullptr || ti->sampleRate <= 0)
return false;
info.bpm = (ti->flags & kVstTempoValid) != 0 ? ti->tempo : 0.0;
@@ -791,30 +791,30 @@ public:
//==============================================================================
VstInt32 getProgram()
{
return filter != 0 ? filter->getCurrentProgram() : 0;
return filter != nullptr ? filter->getCurrentProgram() : 0;
}
void setProgram (VstInt32 program)
{
if (filter != 0)
if (filter != nullptr)
filter->setCurrentProgram (program);
}
void setProgramName (char* name)
{
if (filter != 0)
if (filter != nullptr)
filter->changeProgramName (filter->getCurrentProgram(), name);
}
void getProgramName (char* name)
{
if (filter != 0)
if (filter != nullptr)
filter->getProgramName (filter->getCurrentProgram()).copyToUTF8 (name, 24);
}
bool getProgramNameIndexed (VstInt32 /*category*/, VstInt32 index, char* text)
{
if (filter != 0 && isPositiveAndBelow (index, filter->getNumPrograms()))
if (filter != nullptr && isPositiveAndBelow (index, filter->getNumPrograms()))
{
filter->getProgramName (index).copyToUTF8 (text, 24);
return true;
@@ -826,7 +826,7 @@ public:
//==============================================================================
float getParameter (VstInt32 index)
{
if (filter == 0)
if (filter == nullptr)
return 0.0f;
jassert (isPositiveAndBelow (index, filter->getNumParameters()));
@@ -835,7 +835,7 @@ public:
void setParameter (VstInt32 index, float value)
{
if (filter != 0)
if (filter != nullptr)
{
jassert (isPositiveAndBelow (index, filter->getNumParameters()));
filter->setParameter (index, value);
@@ -844,7 +844,7 @@ public:
void getParameterDisplay (VstInt32 index, char* text)
{
if (filter != 0)
if (filter != nullptr)
{
jassert (isPositiveAndBelow (index, filter->getNumParameters()));
filter->getParameterText (index).copyToUTF8 (text, 24); // length should technically be kVstMaxParamStrLen, which is 8, but hosts will normally allow a bit more.
@@ -853,7 +853,7 @@ public:
void getParameterName (VstInt32 index, char* text)
{
if (filter != 0)
if (filter != nullptr)
{
jassert (isPositiveAndBelow (index, filter->getNumParameters()));
filter->getParameterName (index).copyToUTF8 (text, 16); // length should technically be kVstMaxParamStrLen, which is 8, but hosts will normally allow a bit more.
@@ -875,13 +875,13 @@ public:
bool canParameterBeAutomated (VstInt32 index)
{
return filter != 0 && filter->isParameterAutomatable ((int) index);
return filter != nullptr && filter->isParameterAutomatable ((int) index);
}
class ChannelConfigComparator
{
public:
static int compareElements (const short* const first, const short* const second) throw()
static int compareElements (const short* const first, const short* const second) noexcept
{
if (first[0] < second[0]) return -1;
else if (first[0] > second[0]) return 1;
@@ -929,7 +929,7 @@ public:
//==============================================================================
VstInt32 getChunk (void** data, bool onlyStoreCurrentProgramData)
{
if (filter == 0)
if (filter == nullptr)
return 0;
chunkMemory.setSize (0);
@@ -949,13 +949,13 @@ public:
VstInt32 setChunk (void* data, VstInt32 byteSize, bool onlyRestoreCurrentProgramData)
{
if (filter == 0)
if (filter == nullptr)
return 0;
chunkMemory.setSize (0);
chunkMemoryTime = 0;
if (byteSize > 0 && data != 0)
if (byteSize > 0 && data != nullptr)
{
if (onlyRestoreCurrentProgramData)
filter->setCurrentProgramStateInformation (data, byteSize);
@@ -996,7 +996,7 @@ public:
{
const JUCE_NAMESPACE::uint32 now = JUCE_NAMESPACE::Time::getMillisecondCounter();
if (now > lastMasterIdleCall + 20 && editorComp != 0)
if (now > lastMasterIdleCall + 20 && editorComp != nullptr)
{
lastMasterIdleCall = now;
@@ -1027,14 +1027,14 @@ public:
void createEditorComp()
{
if (hasShutdown || filter == 0)
if (hasShutdown || filter == nullptr)
return;
if (editorComp == 0)
if (editorComp == nullptr)
{
AudioProcessorEditor* const ed = filter->createEditorIfNeeded();
if (ed != 0)
if (ed != nullptr)
{
cEffect.flags |= effFlagsHasEditor;
ed->setOpaque (true);
@@ -1059,10 +1059,10 @@ public:
jassert (! recursionCheck);
recursionCheck = true;
if (editorComp != 0)
if (editorComp != nullptr)
{
Component* const modalComponent = Component::getCurrentlyModalComponent();
if (modalComponent != 0)
if (modalComponent != nullptr)
{
modalComponent->exitModalState (0);
@@ -1084,11 +1084,11 @@ public:
filter->editorBeingDeleted (editorComp->getEditorComp());
editorComp = 0;
editorComp = nullptr;
// there's some kind of component currently modal, but the host
// is trying to delete our plugin. You should try to avoid this happening..
jassert (Component::getCurrentlyModalComponent() == 0);
jassert (Component::getCurrentlyModalComponent() == nullptr);
}
#if JUCE_LINUX
@@ -1119,7 +1119,7 @@ public:
deleteEditor (true);
createEditorComp();
if (editorComp != 0)
if (editorComp != nullptr)
{
editorComp->setOpaque (true);
editorComp->setVisible (false);
@@ -1153,7 +1153,7 @@ public:
const MessageManagerLock mmLock;
createEditorComp();
if (editorComp != 0)
if (editorComp != nullptr)
{
editorSize.left = 0;
editorSize.top = 0;
@@ -1175,7 +1175,7 @@ public:
void resizeHostWindow (int newWidth, int newHeight)
{
if (editorComp != 0)
if (editorComp != nullptr)
{
if (! (canHostDo (const_cast <char*> ("sizeWindow")) && sizeWindow (newWidth, newHeight)))
{
@@ -1232,7 +1232,7 @@ public:
#endif
}
if (editorComp->getPeer() != 0)
if (editorComp->getPeer() != nullptr)
editorComp->getPeer()->handleMovedOrResized();
}
}
@@ -1308,7 +1308,7 @@ public:
{
Component* const editor = getChildComponent(0);
if (editor != 0)
if (editor != nullptr)
editor->setBounds (getLocalBounds());
}
@@ -1428,7 +1428,7 @@ private:
tempChannels.clear();
if (filter != 0)
if (filter != nullptr)
tempChannels.insertMultiple (0, 0, filter->getNumInputChannels() + filter->getNumOutputChannels());
}
@@ -1460,7 +1460,7 @@ namespace
AudioProcessor* const filter = createPluginFilter();
if (filter != 0)
if (filter != nullptr)
{
JuceVSTWrapper* const wrapper = new JuceVSTWrapper (audioMaster, filter);
return wrapper->getAeffect();


+ 2
- 2
extras/audio plugins/wrapper/juce_PluginHeaders.h View File

@@ -54,11 +54,11 @@ public:
{
Component* comp = Desktop::getInstance().findComponentAt (screenPos);
if (comp != 0)
if (comp != nullptr)
{
ComponentPeer* const peer = comp->getPeer();
if (peer != 0 && ! peer->isFocused())
if (peer != nullptr && ! peer->isFocused())
peer->handleMouseEvent (0, screenPos - peer->getScreenPosition(), mods, Time::currentTimeMillis());
}
}


+ 12
- 12
extras/audio plugins/wrapper/juce_PluginHostType.h View File

@@ -66,62 +66,62 @@ public:
const HostType type;
//==============================================================================
bool isAbletonLive() const throw()
bool isAbletonLive() const noexcept
{
return type == AbletonLive6 || type == AbletonLive7 || type == AbletonLive8 || type == AbletonLiveGeneric;
}
bool isCubase() const throw()
bool isCubase() const noexcept
{
return type == SteinbergCubase4 || type == SteinbergCubase5 || type == SteinbergCubase5Bridged || type == SteinbergCubaseGeneric;
}
bool isCubaseBridged() const throw()
bool isCubaseBridged() const noexcept
{
return type == SteinbergCubase5Bridged;
}
bool isTracktion() const throw()
bool isTracktion() const noexcept
{
return type == MackieTracktion3 || type == MackieTracktionGeneric;
}
bool isSonar() const throw()
bool isSonar() const noexcept
{
return type == CakewalkSonar8 || type == CakewalkSonarGeneric;
}
bool isWavelab() const throw()
bool isWavelab() const noexcept
{
return type == SteinbergWavelab5 || type == SteinbergWavelab6 || type == SteinbergWavelab7 || type == SteinbergWavelabGeneric;
}
bool isWavelabLegacy() const throw()
bool isWavelabLegacy() const noexcept
{
return type == SteinbergWavelab5 || type == SteinbergWavelab6;
}
bool isPremiere() const throw()
bool isPremiere() const noexcept
{
return type == AdobePremierePro;
}
bool isLogic() const throw()
bool isLogic() const noexcept
{
return type == AppleLogic || type == EmagicLogic;
}
bool isReceptor() const throw()
bool isReceptor() const noexcept
{
return type == MuseReceptorGeneric;
}
bool isSamplitude() const throw()
bool isSamplitude() const noexcept
{
return type == MagixSamplitude;
}
bool isFruityLoops() const throw()
bool isFruityLoops() const noexcept
{
return type == FruityLoops;
}


+ 4376
- 4397
juce_amalgamated.cpp
File diff suppressed because it is too large
View File


+ 2512
- 2495
juce_amalgamated.h
File diff suppressed because it is too large
View File


+ 12
- 12
src/application/juce_Application.cpp View File

@@ -43,24 +43,24 @@ JUCEApplication::JUCEApplication()
: appReturnValue (0),
stillInitialising (true)
{
jassert (isStandaloneApp() && appInstance == 0);
jassert (isStandaloneApp() && appInstance == nullptr);
appInstance = this;
}
JUCEApplication::~JUCEApplication()
{
if (appLock != 0)
if (appLock != nullptr)
{
appLock->exit();
appLock = 0;
appLock = nullptr;
}
jassert (appInstance == this);
appInstance = 0;
appInstance = nullptr;
}
JUCEApplication::CreateInstanceFunction JUCEApplication::createInstance = 0;
JUCEApplication* JUCEApplication::appInstance = 0;
JUCEApplication* JUCEApplication::appInstance = nullptr;
//==============================================================================
bool JUCEApplication::moreThanOneInstanceAllowed()
@@ -82,7 +82,7 @@ void JUCEApplication::quit()
MessageManager::getInstance()->stopDispatchLoop();
}
void JUCEApplication::setApplicationReturnValue (const int newReturnValue) throw()
void JUCEApplication::setApplicationReturnValue (const int newReturnValue) noexcept
{
appReturnValue = newReturnValue;
}
@@ -105,7 +105,7 @@ void JUCEApplication::sendUnhandledException (const std::exception* const e,
const char* const sourceFile,
const int lineNumber)
{
if (appInstance != 0)
if (appInstance != nullptr)
appInstance->unhandledException (e, sourceFile, lineNumber);
}
@@ -150,7 +150,7 @@ bool JUCEApplication::initialiseApp (const String& commandLine)
commandLineParameters = commandLine.trim();
#if ! JUCE_IOS
jassert (appLock == 0); // initialiseApp must only be called once!
jassert (appLock == nullptr); // initialiseApp must only be called once!
if (! moreThanOneInstanceAllowed())
{
@@ -158,7 +158,7 @@ bool JUCEApplication::initialiseApp (const String& commandLine)
if (! appLock->enter(0))
{
appLock = 0;
appLock = nullptr;
MessageManager::broadcastMessage (getApplicationName() + "/" + commandLineParameters);
DBG ("Another instance is running - quitting...");
@@ -203,7 +203,7 @@ void JUCEApplication::appWillTerminateByForce()
{
const ScopedPointer<JUCEApplication> app (JUCEApplication::getInstance());
if (app != 0)
if (app != nullptr)
app->shutdownApp();
}
@@ -215,7 +215,7 @@ void JUCEApplication::appWillTerminateByForce()
int JUCEApplication::main (const String& commandLine)
{
ScopedJuceInitialiser_GUI libraryInitialiser;
jassert (createInstance != 0);
jassert (createInstance != nullptr);
int returnCode = 0;
{
@@ -250,7 +250,7 @@ int JUCEApplication::main (int argc, const char* argv[])
JUCE_AUTORELEASEPOOL
#if ! JUCE_WINDOWS
jassert (createInstance != 0);
jassert (createInstance != nullptr);
juce_Argv0 = argv[0];
#endif


+ 6
- 6
src/application/juce_Application.h View File

@@ -111,7 +111,7 @@ public:
//==============================================================================
/** Returns the global instance of the application object being run. */
static JUCEApplication* getInstance() throw() { return appInstance; }
static JUCEApplication* getInstance() noexcept { return appInstance; }
//==============================================================================
/** Called when the application starts.
@@ -139,7 +139,7 @@ public:
This is handy for things like splash screens to know when the app's up-and-running
properly.
*/
bool isInitialising() const throw() { return stillInitialising; }
bool isInitialising() const noexcept { return stillInitialising; }
/* Called to allow the application to clear up before exiting.
@@ -233,16 +233,16 @@ public:
@see getApplicationReturnValue
*/
void setApplicationReturnValue (int newReturnValue) throw();
void setApplicationReturnValue (int newReturnValue) noexcept;
/** Returns the value that has been set as the application's exit code.
@see setApplicationReturnValue
*/
int getApplicationReturnValue() const throw() { return appReturnValue; }
int getApplicationReturnValue() const noexcept { return appReturnValue; }
/** Returns the application's command line params.
*/
const String getCommandLineParameters() const throw() { return commandLineParameters; }
const String getCommandLineParameters() const noexcept { return commandLineParameters; }
//==============================================================================
// These are used by the START_JUCE_APPLICATION() macro and aren't for public use.
@@ -256,7 +256,7 @@ public:
/** Returns true if this executable is running as an app (as opposed to being a plugin
or other kind of shared library. */
static inline bool isStandaloneApp() throw() { return createInstance != 0; }
static inline bool isStandaloneApp() noexcept { return createInstance != 0; }
/** @internal */
ApplicationCommandTarget* getNextCommandTarget();


+ 5
- 5
src/application/juce_ApplicationCommandInfo.cpp View File

@@ -31,7 +31,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
ApplicationCommandInfo::ApplicationCommandInfo (const CommandID commandID_) throw()
ApplicationCommandInfo::ApplicationCommandInfo (const CommandID commandID_) noexcept
: commandID (commandID_),
flags (0)
{
@@ -40,7 +40,7 @@ ApplicationCommandInfo::ApplicationCommandInfo (const CommandID commandID_) thro
void ApplicationCommandInfo::setInfo (const String& shortName_,
const String& description_,
const String& categoryName_,
const int flags_) throw()
const int flags_) noexcept
{
shortName = shortName_;
description = description_;
@@ -48,7 +48,7 @@ void ApplicationCommandInfo::setInfo (const String& shortName_,
flags = flags_;
}
void ApplicationCommandInfo::setActive (const bool b) throw()
void ApplicationCommandInfo::setActive (const bool b) noexcept
{
if (b)
flags &= ~isDisabled;
@@ -56,7 +56,7 @@ void ApplicationCommandInfo::setActive (const bool b) throw()
flags |= isDisabled;
}
void ApplicationCommandInfo::setTicked (const bool b) throw()
void ApplicationCommandInfo::setTicked (const bool b) noexcept
{
if (b)
flags |= isTicked;
@@ -64,7 +64,7 @@ void ApplicationCommandInfo::setTicked (const bool b) throw()
flags &= ~isTicked;
}
void ApplicationCommandInfo::addDefaultKeypress (const int keyCode, const ModifierKeys& modifiers) throw()
void ApplicationCommandInfo::addDefaultKeypress (const int keyCode, const ModifierKeys& modifiers) noexcept
{
defaultKeypresses.add (KeyPress (keyCode, modifiers, 0));
}


+ 5
- 5
src/application/juce_ApplicationCommandInfo.h View File

@@ -48,7 +48,7 @@
struct JUCE_API ApplicationCommandInfo
{
//==============================================================================
explicit ApplicationCommandInfo (CommandID commandID) throw();
explicit ApplicationCommandInfo (CommandID commandID) noexcept;
//==============================================================================
/** Sets a number of the structures values at once.
@@ -59,18 +59,18 @@ struct JUCE_API ApplicationCommandInfo
void setInfo (const String& shortName,
const String& description,
const String& categoryName,
int flags) throw();
int flags) noexcept;
/** An easy way to set or remove the isDisabled bit in the structure's flags field.
If isActive is true, the flags member has the isDisabled bit cleared; if isActive
is false, the bit is set.
*/
void setActive (bool isActive) throw();
void setActive (bool isActive) noexcept;
/** An easy way to set or remove the isTicked bit in the structure's flags field.
*/
void setTicked (bool isTicked) throw();
void setTicked (bool isTicked) noexcept;
/** Handy method for adding a keypress to the defaultKeypresses array.
@@ -84,7 +84,7 @@ struct JUCE_API ApplicationCommandInfo
@endcode
*/
void addDefaultKeypress (int keyCode,
const ModifierKeys& modifiers) throw();
const ModifierKeys& modifiers) noexcept;
//==============================================================================
/** The command's unique ID number.


+ 25
- 25
src/application/juce_ApplicationCommandManager.cpp View File

@@ -39,7 +39,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
ApplicationCommandManager::ApplicationCommandManager()
: firstTarget (0)
: firstTarget (nullptr)
{
keyMappings = new KeyPressMappingSet (this);
@@ -49,7 +49,7 @@ ApplicationCommandManager::ApplicationCommandManager()
ApplicationCommandManager::~ApplicationCommandManager()
{
Desktop::getInstance().removeFocusChangeListener (this);
keyMappings = 0;
keyMappings = nullptr;
}
//==============================================================================
@@ -92,7 +92,7 @@ void ApplicationCommandManager::registerCommand (const ApplicationCommandInfo& n
void ApplicationCommandManager::registerAllCommandsForTarget (ApplicationCommandTarget* target)
{
if (target != 0)
if (target != nullptr)
{
Array <CommandID> commandIDs;
target->getAllCommands (commandIDs);
@@ -130,7 +130,7 @@ void ApplicationCommandManager::commandStatusChanged()
}
//==============================================================================
const ApplicationCommandInfo* ApplicationCommandManager::getCommandForID (const CommandID commandID) const throw()
const ApplicationCommandInfo* ApplicationCommandManager::getCommandForID (const CommandID commandID) const noexcept
{
for (int i = commands.size(); --i >= 0;)
if (commands.getUnchecked(i)->commandID == commandID)
@@ -139,19 +139,19 @@ const ApplicationCommandInfo* ApplicationCommandManager::getCommandForID (const
return 0;
}
const String ApplicationCommandManager::getNameOfCommand (const CommandID commandID) const throw()
const String ApplicationCommandManager::getNameOfCommand (const CommandID commandID) const noexcept
{
const ApplicationCommandInfo* const ci = getCommandForID (commandID);
return (ci != 0) ? ci->shortName : String::empty;
return ci != nullptr ? ci->shortName : String::empty;
}
const String ApplicationCommandManager::getDescriptionOfCommand (const CommandID commandID) const throw()
const String ApplicationCommandManager::getDescriptionOfCommand (const CommandID commandID) const noexcept
{
const ApplicationCommandInfo* const ci = getCommandForID (commandID);
return (ci != 0) ? (ci->description.isNotEmpty() ? ci->description : ci->shortName)
: String::empty;
return ci != nullptr ? (ci->description.isNotEmpty() ? ci->description : ci->shortName)
: String::empty;
}
const StringArray ApplicationCommandManager::getCommandCategories() const
@@ -193,7 +193,7 @@ bool ApplicationCommandManager::invoke (const ApplicationCommandTarget::Invocati
ApplicationCommandInfo commandInfo (0);
ApplicationCommandTarget* const target = getTargetForCommand (info_.commandID, commandInfo);
if (target == 0)
if (target == nullptr)
return false;
ApplicationCommandTarget::InvocationInfo info (info_);
@@ -211,11 +211,11 @@ bool ApplicationCommandManager::invoke (const ApplicationCommandTarget::Invocati
//==============================================================================
ApplicationCommandTarget* ApplicationCommandManager::getFirstCommandTarget (const CommandID)
{
return firstTarget != 0 ? firstTarget
: findDefaultComponentTarget();
return firstTarget != nullptr ? firstTarget
: findDefaultComponentTarget();
}
void ApplicationCommandManager::setFirstCommandTarget (ApplicationCommandTarget* const newTarget) throw()
void ApplicationCommandManager::setFirstCommandTarget (ApplicationCommandTarget* const newTarget) noexcept
{
firstTarget = newTarget;
}
@@ -225,13 +225,13 @@ ApplicationCommandTarget* ApplicationCommandManager::getTargetForCommand (const
{
ApplicationCommandTarget* target = getFirstCommandTarget (commandID);
if (target == 0)
if (target == nullptr)
target = JUCEApplication::getInstance();
if (target != 0)
if (target != nullptr)
target = target->getTargetForCommand (commandID);
if (target != 0)
if (target != nullptr)
target->getCommandInfo (commandID, upToDateInfo);
return target;
@@ -242,7 +242,7 @@ ApplicationCommandTarget* ApplicationCommandManager::findTargetForComponent (Com
{
ApplicationCommandTarget* target = dynamic_cast <ApplicationCommandTarget*> (c);
if (target == 0 && c != 0)
if (target == nullptr && c != nullptr)
// (unable to use the syntax findParentComponentOfClass <ApplicationCommandTarget> () because of a VC6 compiler bug)
target = c->findParentComponentOfClass ((ApplicationCommandTarget*) 0);
@@ -253,20 +253,20 @@ ApplicationCommandTarget* ApplicationCommandManager::findDefaultComponentTarget(
{
Component* c = Component::getCurrentlyFocusedComponent();
if (c == 0)
if (c == nullptr)
{
TopLevelWindow* const activeWindow = TopLevelWindow::getActiveTopLevelWindow();
if (activeWindow != 0)
if (activeWindow != nullptr)
{
c = activeWindow->getPeer()->getLastFocusedSubcomponent();
if (c == 0)
if (c == nullptr)
c = activeWindow;
}
}
if (c == 0 && Process::isForegroundProcess())
if (c == nullptr && Process::isForegroundProcess())
{
// getting a bit desperate now - try all desktop comps..
for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;)
@@ -275,12 +275,12 @@ ApplicationCommandTarget* ApplicationCommandManager::findDefaultComponentTarget(
= findTargetForComponent (Desktop::getInstance().getComponent (i)
->getPeer()->getLastFocusedSubcomponent());
if (target != 0)
if (target != nullptr)
return target;
}
}
if (c != 0)
if (c != nullptr)
{
ResizableWindow* const resizableWindow = dynamic_cast <ResizableWindow*> (c);
@@ -288,12 +288,12 @@ ApplicationCommandTarget* ApplicationCommandManager::findDefaultComponentTarget(
// component that really should get the event. And if not, the event will
// still be passed up to the top level window anyway, so let's send it to the
// content comp.
if (resizableWindow != 0 && resizableWindow->getContentComponent() != 0)
if (resizableWindow != nullptr && resizableWindow->getContentComponent() != nullptr)
c = resizableWindow->getContentComponent();
ApplicationCommandTarget* const target = findTargetForComponent (c);
if (target != 0)
if (target != nullptr)
return target;
}


+ 7
- 7
src/application/juce_ApplicationCommandManager.h View File

@@ -155,13 +155,13 @@ public:
@see registerCommand
*/
int getNumCommands() const throw() { return commands.size(); }
int getNumCommands() const noexcept { return commands.size(); }
/** Returns the details about one of the registered commands.
The index is between 0 and (getNumCommands() - 1).
*/
const ApplicationCommandInfo* getCommandForIndex (int index) const throw() { return commands [index]; }
const ApplicationCommandInfo* getCommandForIndex (int index) const noexcept { return commands [index]; }
/** Returns the details about a given command ID.
@@ -169,14 +169,14 @@ public:
ID number, and return its associated info. If no matching command is found, this
will return 0.
*/
const ApplicationCommandInfo* getCommandForID (CommandID commandID) const throw();
const ApplicationCommandInfo* getCommandForID (CommandID commandID) const noexcept;
/** Returns the name field for a command.
An empty string is returned if no command with this ID has been registered.
@see getDescriptionOfCommand
*/
const String getNameOfCommand (CommandID commandID) const throw();
const String getNameOfCommand (CommandID commandID) const noexcept;
/** Returns the description field for a command.
@@ -185,7 +185,7 @@ public:
@see getNameOfCommand
*/
const String getDescriptionOfCommand (CommandID commandID) const throw();
const String getDescriptionOfCommand (CommandID commandID) const noexcept;
/** Returns the list of categories.
@@ -211,7 +211,7 @@ public:
@see KeyPressMappingSet
*/
KeyPressMappingSet* getKeyMappings() const throw() { return keyMappings; }
KeyPressMappingSet* getKeyMappings() const noexcept { return keyMappings; }
//==============================================================================
@@ -268,7 +268,7 @@ public:
If you use this to set a target, make sure you call setFirstCommandTarget (0) before
deleting the target object.
*/
void setFirstCommandTarget (ApplicationCommandTarget* newTarget) throw();
void setFirstCommandTarget (ApplicationCommandTarget* newTarget) noexcept;
/** Tries to find the best target to use to perform a given command.


+ 10
- 10
src/application/juce_ApplicationCommandTarget.cpp View File

@@ -38,7 +38,7 @@ ApplicationCommandTarget::ApplicationCommandTarget()
ApplicationCommandTarget::~ApplicationCommandTarget()
{
messageInvoker = 0;
messageInvoker = nullptr;
}
//==============================================================================
@@ -48,7 +48,7 @@ bool ApplicationCommandTarget::tryToInvoke (const InvocationInfo& info, const bo
{
if (async)
{
if (messageInvoker == 0)
if (messageInvoker == nullptr)
messageInvoker = new CommandTargetMessageInvoker (this);
messageInvoker->postMessage (new Message (0, 0, 0, new ApplicationCommandTarget::InvocationInfo (info)));
@@ -72,7 +72,7 @@ ApplicationCommandTarget* ApplicationCommandTarget::findFirstTargetParentCompone
{
Component* c = dynamic_cast <Component*> (this);
if (c != 0)
if (c != nullptr)
// (unable to use the syntax findParentComponentOfClass <ApplicationCommandTarget> () because of a VC6 compiler bug)
return c->findParentComponentOfClass ((ApplicationCommandTarget*) 0);
@@ -84,7 +84,7 @@ ApplicationCommandTarget* ApplicationCommandTarget::getTargetForCommand (const C
ApplicationCommandTarget* target = this;
int depth = 0;
while (target != 0)
while (target != nullptr)
{
Array <CommandID> commandIDs;
target->getAllCommands (commandIDs);
@@ -102,11 +102,11 @@ ApplicationCommandTarget* ApplicationCommandTarget::getTargetForCommand (const C
break;
}
if (target == 0)
if (target == nullptr)
{
target = JUCEApplication::getInstance();
if (target != 0)
if (target != nullptr)
{
Array <CommandID> commandIDs;
target->getAllCommands (commandIDs);
@@ -135,7 +135,7 @@ bool ApplicationCommandTarget::invoke (const InvocationInfo& info, const bool as
ApplicationCommandTarget* target = this;
int depth = 0;
while (target != 0)
while (target != nullptr)
{
if (target->tryToInvoke (info, async))
return true;
@@ -150,11 +150,11 @@ bool ApplicationCommandTarget::invoke (const InvocationInfo& info, const bool as
break;
}
if (target == 0)
if (target == nullptr)
{
target = JUCEApplication::getInstance();
if (target != 0)
if (target != nullptr)
return target->tryToInvoke (info, async);
}
@@ -174,7 +174,7 @@ ApplicationCommandTarget::InvocationInfo::InvocationInfo (const CommandID comman
: commandID (commandID_),
commandFlags (0),
invocationMethod (direct),
originatingComponent (0),
originatingComponent (nullptr),
isKeyDown (false),
millisecsSinceKeyPressed (0)
{


+ 11
- 11
src/application/juce_ApplicationProperties.cpp View File

@@ -41,7 +41,7 @@ ApplicationProperties::ApplicationProperties()
: msBeforeSaving (3000),
options (PropertiesFile::storeAsBinary),
commonSettingsAreReadOnly (0),
processLock (0)
processLock (nullptr)
{
}
@@ -80,10 +80,10 @@ bool ApplicationProperties::testWriteAccess (const bool testUserSettings,
{
String filenames;
if (userProps != 0 && ! userOk)
if (userProps != nullptr && ! userOk)
filenames << '\n' << userProps->getFile().getFullPathName();
if (commonProps != 0 && ! commonOk)
if (commonProps != nullptr && ! commonOk)
filenames << '\n' << commonProps->getFile().getFullPathName();
AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon,
@@ -109,11 +109,11 @@ void ApplicationProperties::openFiles()
if (appName.isNotEmpty())
{
if (userProps == 0)
if (userProps == nullptr)
userProps = PropertiesFile::createDefaultAppPropertiesFile (appName, fileSuffix, folderName,
false, msBeforeSaving, options, processLock);
if (commonProps == 0)
if (commonProps == nullptr)
commonProps = PropertiesFile::createDefaultAppPropertiesFile (appName, fileSuffix, folderName,
true, msBeforeSaving, options, processLock);
@@ -123,7 +123,7 @@ void ApplicationProperties::openFiles()
PropertiesFile* ApplicationProperties::getUserSettings()
{
if (userProps == 0)
if (userProps == nullptr)
openFiles();
return userProps;
@@ -131,7 +131,7 @@ PropertiesFile* ApplicationProperties::getUserSettings()
PropertiesFile* ApplicationProperties::getCommonSettings (const bool returnUserPropsIfReadOnly)
{
if (commonProps == 0)
if (commonProps == nullptr)
openFiles();
if (returnUserPropsIfReadOnly)
@@ -148,14 +148,14 @@ PropertiesFile* ApplicationProperties::getCommonSettings (const bool returnUserP
bool ApplicationProperties::saveIfNeeded()
{
return (userProps == 0 || userProps->saveIfNeeded())
&& (commonProps == 0 || commonProps->saveIfNeeded());
return (userProps == nullptr || userProps->saveIfNeeded())
&& (commonProps == nullptr || commonProps->saveIfNeeded());
}
void ApplicationProperties::closeFiles()
{
userProps = 0;
commonProps = 0;
userProps = nullptr;
commonProps = nullptr;
}


+ 1
- 1
src/application/juce_ApplicationProperties.h View File

@@ -82,7 +82,7 @@ public:
const String& folderName,
int millisecondsBeforeSaving,
int propertiesFileOptions,
InterProcessLock* processLock = 0);
InterProcessLock* processLock = nullptr);
/** Tests whether the files can be successfully written to, and can show
an error message if not.


+ 3
- 3
src/audio/audio_file_formats/juce_AiffAudioFormat.cpp View File

@@ -153,7 +153,7 @@ public:
if (samplesAvailable < numSamples)
{
for (int i = numDestChannels; --i >= 0;)
if (destSamples[i] != 0)
if (destSamples[i] != nullptr)
zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * numSamples);
numSamples = (int) samplesAvailable;
@@ -242,7 +242,7 @@ public:
//==============================================================================
bool write (const int** data, int numSamples)
{
jassert (data != 0 && *data != 0); // the input must contain at least one channel!
jassert (data != nullptr && *data != nullptr); // the input must contain at least one channel!
if (writeFailed)
return false;
@@ -407,7 +407,7 @@ AudioFormatReader* AiffAudioFormat::createReaderFor (InputStream* sourceStream,
return w.release();
if (! deleteStreamIfOpeningFails)
w->input = 0;
w->input = nullptr;
return 0;
}


+ 1
- 1
src/audio/audio_file_formats/juce_AudioCDBurner.h View File

@@ -125,7 +125,7 @@ public:
class BurnProgressListener
{
public:
BurnProgressListener() throw() {}
BurnProgressListener() noexcept {}
virtual ~BurnProgressListener() {}
/** Called at intervals to report on the progress of the AudioCDBurner.


+ 6
- 6
src/audio/audio_file_formats/juce_AudioFormatManager.cpp View File

@@ -49,9 +49,9 @@ AudioFormatManager::~AudioFormatManager()
//==============================================================================
void AudioFormatManager::registerFormat (AudioFormat* newFormat, const bool makeThisTheDefaultFormat)
{
jassert (newFormat != 0);
jassert (newFormat != nullptr);
if (newFormat != 0)
if (newFormat != nullptr)
{
#if JUCE_DEBUG
for (int i = getNumKnownFormats(); --i >= 0;)
@@ -166,11 +166,11 @@ AudioFormatReader* AudioFormatManager::createReaderFor (const File& file)
{
InputStream* const in = file.createInputStream();
if (in != 0)
if (in != nullptr)
{
AudioFormatReader* const r = af->createReaderFor (in, true);
if (r != 0)
if (r != nullptr)
return r;
}
}
@@ -187,7 +187,7 @@ AudioFormatReader* AudioFormatManager::createReaderFor (InputStream* audioFileSt
ScopedPointer <InputStream> in (audioFileStream);
if (in != 0)
if (in != nullptr)
{
const int64 originalStreamPos = in->getPosition();
@@ -195,7 +195,7 @@ AudioFormatReader* AudioFormatManager::createReaderFor (InputStream* audioFileSt
{
AudioFormatReader* const r = getKnownFormat(i)->createReaderFor (in, false);
if (r != 0)
if (r != nullptr)
{
in.release();
return r;


+ 5
- 5
src/audio/audio_file_formats/juce_AudioFormatReader.cpp View File

@@ -64,7 +64,7 @@ bool AudioFormatReader::read (int* const* destSamples,
const int silence = (int) jmin (-startSampleInSource, (int64) numSamplesToRead);
for (int i = numDestChannels; --i >= 0;)
if (destSamples[i] != 0)
if (destSamples[i] != nullptr)
zeromem (destSamples[i], sizeof (int) * silence);
startOffsetInDestBuffer += silence;
@@ -88,22 +88,22 @@ bool AudioFormatReader::read (int* const* destSamples,
for (int i = (int) numChannels; --i > 0;)
{
if (destSamples[i] != 0)
if (destSamples[i] != nullptr)
{
lastFullChannel = destSamples[i];
break;
}
}
if (lastFullChannel != 0)
if (lastFullChannel != nullptr)
for (int i = numChannels; i < numDestChannels; ++i)
if (destSamples[i] != 0)
if (destSamples[i] != nullptr)
memcpy (destSamples[i], lastFullChannel, sizeof (int) * numSamplesToRead);
}
else
{
for (int i = numChannels; i < numDestChannels; ++i)
if (destSamples[i] != 0)
if (destSamples[i] != nullptr)
zeromem (destSamples[i], sizeof (int) * numSamplesToRead);
}
}


+ 3
- 3
src/audio/audio_file_formats/juce_AudioFormatReader.h View File

@@ -66,7 +66,7 @@ public:
E.g. "AIFF"
*/
const String getFormatName() const throw() { return formatName; }
const String getFormatName() const noexcept { return formatName; }
//==============================================================================
/** Reads samples from the stream.
@@ -225,11 +225,11 @@ protected:
typedef AudioData::Pointer <DestSampleType, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> DestType;
typedef AudioData::Pointer <SourceSampleType, SourceEndianness, AudioData::Interleaved, AudioData::Const> SourceType;
static void read (int** destData, int destOffset, int numDestChannels, const void* sourceData, int numSourceChannels, int numSamples) throw()
static void read (int** destData, int destOffset, int numDestChannels, const void* sourceData, int numSourceChannels, int numSamples) noexcept
{
for (int i = 0; i < numDestChannels; ++i)
{
if (destData[i] != 0)
if (destData[i] != nullptr)
{
DestType dest (destData[i]);
dest += destOffset;


+ 5
- 5
src/audio/audio_file_formats/juce_AudioFormatWriter.cpp View File

@@ -79,7 +79,7 @@ bool AudioFormatWriter::writeFromAudioReader (AudioFormatReader& reader,
{
int** bufferChan = buffers;
while (*bufferChan != 0)
while (*bufferChan != nullptr)
{
int* b = *bufferChan++;
@@ -188,7 +188,7 @@ public:
buffer (numChannels, bufferSize_),
timeSliceThread (timeSliceThread_),
writer (writer_),
thumbnailToUpdate (0),
thumbnailToUpdate (nullptr),
samplesWritten (0),
isRunning (true)
{
@@ -241,7 +241,7 @@ public:
writer->writeFromAudioSampleBuffer (buffer, start1, size1);
const ScopedLock sl (thumbnailLock);
if (thumbnailToUpdate != 0)
if (thumbnailToUpdate != nullptr)
thumbnailToUpdate->addBlock (samplesWritten, buffer, start1, size1);
samplesWritten += size1;
@@ -250,7 +250,7 @@ public:
{
writer->writeFromAudioSampleBuffer (buffer, start2, size2);
if (thumbnailToUpdate != 0)
if (thumbnailToUpdate != nullptr)
thumbnailToUpdate->addBlock (samplesWritten, buffer, start2, size2);
samplesWritten += size2;
@@ -262,7 +262,7 @@ public:
void setThumbnail (AudioThumbnail* thumb)
{
if (thumb != 0)
if (thumb != nullptr)
thumb->reset (buffer.getNumChannels(), writer->getSampleRate(), 0);
const ScopedLock sl (thumbnailLock);


+ 7
- 7
src/audio/audio_file_formats/juce_AudioFormatWriter.h View File

@@ -77,7 +77,7 @@ public:
E.g. "AIFF file"
*/
const String getFormatName() const throw() { return formatName; }
const String getFormatName() const noexcept { return formatName; }
//==============================================================================
/** Writes a set of samples to the audio stream.
@@ -138,16 +138,16 @@ public:
//==============================================================================
/** Returns the sample rate being used. */
double getSampleRate() const throw() { return sampleRate; }
double getSampleRate() const noexcept { return sampleRate; }
/** Returns the number of channels being written. */
int getNumChannels() const throw() { return numChannels; }
int getNumChannels() const noexcept { return numChannels; }
/** Returns the bit-depth of the data being written. */
int getBitsPerSample() const throw() { return bitsPerSample; }
int getBitsPerSample() const noexcept { return bitsPerSample; }
/** Returns true if it's a floating-point format, false if it's fixed-point. */
bool isFloatingPoint() const throw() { return usesFloatingPointData; }
bool isFloatingPoint() const noexcept { return usesFloatingPointData; }
//==============================================================================
/**
@@ -225,13 +225,13 @@ protected:
typedef AudioData::Pointer <SourceSampleType, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const> SourceType;
static void write (void* destData, int numDestChannels, const int** source,
int numSamples, const int sourceOffset = 0) throw()
int numSamples, const int sourceOffset = 0) noexcept
{
for (int i = 0; i < numDestChannels; ++i)
{
const DestType dest (addBytesToPointer (destData, i * DestType::getBytesPerSample()), numDestChannels);
if (*source != 0)
if (*source != nullptr)
{
dest.convertSamples (SourceType (*source + sourceOffset), numSamples);
++source;


+ 1
- 1
src/audio/audio_file_formats/juce_AudioSubsectionReader.cpp View File

@@ -62,7 +62,7 @@ bool AudioSubsectionReader::readSamples (int** destSamples, int numDestChannels,
if (startSampleInFile + numSamples > length)
{
for (int i = numDestChannels; --i >= 0;)
if (destSamples[i] != 0)
if (destSamples[i] != nullptr)
zeromem (destSamples[i], sizeof (int) * numSamples);
numSamples = jmin (numSamples, (int) (length - startSampleInFile));


+ 30
- 30
src/audio/audio_file_formats/juce_AudioThumbnail.cpp View File

@@ -42,13 +42,13 @@ struct AudioThumbnail::MinMaxValue
{
}
inline void set (const char newMin, const char newMax) throw()
inline void set (const char newMin, const char newMax) noexcept
{
minValue = newMin;
maxValue = newMax;
}
inline void setFloat (const float newMin, const float newMax) throw()
inline void setFloat (const float newMin, const float newMax) noexcept
{
minValue = (char) jlimit (-128, 127, roundFloatToInt (newMin * 127.0f));
maxValue = (char) jlimit (-128, 127, roundFloatToInt (newMax * 127.0f));
@@ -57,12 +57,12 @@ struct AudioThumbnail::MinMaxValue
maxValue = (char) jmin (127, maxValue + 1);
}
inline bool isNonZero() const throw()
inline bool isNonZero() const noexcept
{
return maxValue > minValue;
}
inline int getPeak() const throw()
inline int getPeak() const noexcept
{
return jmax (std::abs ((int) minValue),
std::abs ((int) maxValue));
@@ -112,14 +112,14 @@ public:
createReader();
if (reader != 0)
if (reader != nullptr)
{
lengthInSamples = reader->lengthInSamples;
numChannels = reader->numChannels;
sampleRate = reader->sampleRate;
if (lengthInSamples <= 0 || isFullyLoaded())
reader = 0;
reader = nullptr;
else
owner.cache.addTimeSliceClient (this);
}
@@ -129,15 +129,15 @@ public:
{
const ScopedLock sl (readerLock);
if (reader == 0)
if (reader == nullptr)
{
createReader();
if (reader != 0)
if (reader != nullptr)
owner.cache.addTimeSliceClient (this);
}
if (reader != 0)
if (reader != nullptr)
{
float l[4] = { 0 };
reader->readMaxLevels (startSample, numSamples, l[0], l[1], l[2], l[3]);
@@ -150,14 +150,14 @@ public:
void releaseResources()
{
const ScopedLock sl (readerLock);
reader = 0;
reader = nullptr;
}
int useTimeSlice()
{
if (isFullyLoaded())
{
if (reader != 0 && source != 0)
if (reader != nullptr && source != nullptr)
releaseResources();
return -1;
@@ -170,7 +170,7 @@ public:
createReader();
if (reader != 0)
if (reader != nullptr)
{
if (! readNextBlock())
return 0;
@@ -185,12 +185,12 @@ public:
return timeBeforeDeletingReader;
}
bool isFullyLoaded() const throw()
bool isFullyLoaded() const noexcept
{
return numSamplesFinished >= lengthInSamples;
}
inline int sampleToThumbSample (const int64 originalSample) const throw()
inline int sampleToThumbSample (const int64 originalSample) const noexcept
{
return (int) (originalSample / owner.samplesPerThumbSample);
}
@@ -208,18 +208,18 @@ private:
void createReader()
{
if (reader == 0 && source != 0)
if (reader == nullptr && source != nullptr)
{
InputStream* audioFileStream = source->createInputStream();
if (audioFileStream != 0)
if (audioFileStream != nullptr)
reader = owner.formatManagerToUse.createReaderFor (audioFileStream);
}
}
bool readNextBlock()
{
jassert (reader != 0);
jassert (reader != nullptr);
if (! isFullyLoaded())
{
@@ -270,18 +270,18 @@ public:
ensureSize (numThumbSamples);
}
inline MinMaxValue* getData (const int thumbSampleIndex) throw()
inline MinMaxValue* getData (const int thumbSampleIndex) noexcept
{
jassert (thumbSampleIndex < data.size());
return data.getRawDataPointer() + thumbSampleIndex;
}
int getSize() const throw()
int getSize() const noexcept
{
return data.size();
}
void getMinMax (int startSample, int endSample, MinMaxValue& result) throw()
void getMinMax (int startSample, int endSample, MinMaxValue& result) noexcept
{
if (startSample >= 0)
{
@@ -442,7 +442,7 @@ private:
ensureSize (numSamples);
if (timePerPixel * sampleRate <= samplesPerThumbSample && levelData != 0)
if (timePerPixel * sampleRate <= samplesPerThumbSample && levelData != nullptr)
{
int sample = roundToInt (startTime * sampleRate);
Array<float> levels;
@@ -500,7 +500,7 @@ private:
}
}
MinMaxValue* getData (const int channelNum, const int cacheIndex) throw()
MinMaxValue* getData (const int channelNum, const int cacheIndex) noexcept
{
jassert (isPositiveAndBelow (channelNum, numChannelsCached) && isPositiveAndBelow (cacheIndex, data.size()));
@@ -538,7 +538,7 @@ AudioThumbnail::~AudioThumbnail()
void AudioThumbnail::clear()
{
source = 0;
source = nullptr;
const ScopedLock sl (lock);
window->invalidate();
@@ -648,20 +648,20 @@ bool AudioThumbnail::setSource (InputSource* const newSource)
{
clear();
return newSource != 0 && setDataSource (new LevelDataSource (*this, newSource));
return newSource != nullptr && setDataSource (new LevelDataSource (*this, newSource));
}
void AudioThumbnail::setReader (AudioFormatReader* newReader, int64 hash)
{
clear();
if (newReader != 0)
if (newReader != nullptr)
setDataSource (new LevelDataSource (*this, newReader, hash));
}
int64 AudioThumbnail::getHashCode() const
{
return source == 0 ? 0 : source->hashCode;
return source == nullptr ? 0 : source->hashCode;
}
void AudioThumbnail::addBlock (const int64 startSample, const AudioSampleBuffer& incoming,
@@ -713,22 +713,22 @@ void AudioThumbnail::setLevels (const MinMaxValue* const* values, int thumbIndex
}
//==============================================================================
int AudioThumbnail::getNumChannels() const throw()
int AudioThumbnail::getNumChannels() const noexcept
{
return numChannels;
}
double AudioThumbnail::getTotalLength() const throw()
double AudioThumbnail::getTotalLength() const noexcept
{
return sampleRate > 0 ? (totalSamples / sampleRate) : 0;
}
bool AudioThumbnail::isFullyLoaded() const throw()
bool AudioThumbnail::isFullyLoaded() const noexcept
{
return numSamplesFinished >= totalSamples - samplesPerThumbSample;
}
int64 AudioThumbnail::getNumSamplesFinished() const throw()
int64 AudioThumbnail::getNumSamplesFinished() const noexcept
{
return numSamplesFinished;
}


+ 4
- 4
src/audio/audio_file_formats/juce_AudioThumbnail.h View File

@@ -139,10 +139,10 @@ public:
//==============================================================================
/** Returns the number of channels in the file. */
int getNumChannels() const throw();
int getNumChannels() const noexcept;
/** Returns the length of the audio file, in seconds. */
double getTotalLength() const throw();
double getTotalLength() const noexcept;
/** Draws the waveform for a channel.
@@ -175,10 +175,10 @@ public:
float verticalZoomFactor);
/** Returns true if the low res preview is fully generated. */
bool isFullyLoaded() const throw();
bool isFullyLoaded() const noexcept;
/** Returns the number of samples that have been set in the thumbnail. */
int64 getNumSamplesFinished() const throw();
int64 getNumSamplesFinished() const noexcept;
/** Returns the highest level in the thumbnail.
Note that because the thumb only stores low-resolution data, this isn't


+ 2
- 2
src/audio/audio_file_formats/juce_AudioThumbnailCache.cpp View File

@@ -67,7 +67,7 @@ bool AudioThumbnailCache::loadThumb (AudioThumbnail& thumb, const int64 hashCode
{
ThumbnailCacheEntry* te = findThumbFor (hashCode);
if (te != 0)
if (te != nullptr)
{
te->lastUsed = Time::getMillisecondCounter();
@@ -84,7 +84,7 @@ void AudioThumbnailCache::storeThumb (const AudioThumbnail& thumb,
{
ThumbnailCacheEntry* te = findThumbFor (hashCode);
if (te == 0)
if (te == nullptr)
{
te = new ThumbnailCacheEntry();
te->hash = hashCode;


+ 5
- 5
src/audio/audio_file_formats/juce_FlacAudioFormat.cpp View File

@@ -161,7 +161,7 @@ public:
jassert (num > 0);
for (int i = jmin (numDestChannels, reservoir.getNumChannels()); --i >= 0;)
if (destSamples[i] != 0)
if (destSamples[i] != nullptr)
memcpy (destSamples[i] + startOffsetInDestBuffer,
reservoir.getSampleData (i, (int) (startSampleInFile - reservoirStart)),
sizeof (int) * num);
@@ -200,7 +200,7 @@ public:
if (numSamples > 0)
{
for (int i = numDestChannels; --i >= 0;)
if (destSamples[i] != 0)
if (destSamples[i] != nullptr)
zeromem (destSamples[i] + startOffsetInDestBuffer,
sizeof (int) * numSamples);
}
@@ -229,7 +229,7 @@ public:
while (src == 0 && n > 0)
src = buffer [--n];
if (src != 0)
if (src != nullptr)
{
int* dest = reinterpret_cast<int*> (reservoir.getSampleData(i));
@@ -374,7 +374,7 @@ public:
buf[2] = 0;
for (int i = numChannelsToWrite; --i >= 0;)
if (samplesToWrite[i] != 0)
if (samplesToWrite[i] != nullptr)
for (int j = 0; j < numSamples; ++j)
buf [i][j] = (samplesToWrite [i][j] >> bitsToShift);
@@ -511,7 +511,7 @@ AudioFormatReader* FlacAudioFormat::createReaderFor (InputStream* in,
return r.release();
if (! deleteStreamIfOpeningFails)
r->input = 0;
r->input = nullptr;
return 0;
}


+ 11
- 11
src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp View File

@@ -147,7 +147,7 @@ public:
const int numToUse = jmin (numSamples, numAvailable);
for (int i = jmin (numDestChannels, reservoir.getNumChannels()); --i >= 0;)
if (destSamples[i] != 0)
if (destSamples[i] != nullptr)
memcpy (destSamples[i] + startOffsetInDestBuffer,
reservoir.getSampleData (i, (int) (startSampleInFile - reservoirStart)),
sizeof (float) * numToUse);
@@ -177,7 +177,7 @@ public:
while (numToRead > 0)
{
float** dataIn = 0;
float** dataIn = nullptr;
const int samps = OggVorbisNamespace::ov_read_float (&ovFile, &dataIn, numToRead, &bitStream);
if (samps <= 0)
@@ -204,7 +204,7 @@ public:
if (numSamples > 0)
{
for (int i = numDestChannels; --i >= 0;)
if (destSamples[i] != 0)
if (destSamples[i] != nullptr)
zeromem (destSamples[i] + startOffsetInDestBuffer,
sizeof (int) * numSamples);
}
@@ -277,7 +277,7 @@ public:
{
vorbis_comment_init (&vc);
if (JUCEApplication::getInstance() != 0)
if (JUCEApplication::getInstance() != nullptr)
vorbis_comment_add_tag (&vc, "ENCODER", const_cast <char*> (JUCEApplication::getInstance()->getApplicationName().toUTF8().getAddress()));
vorbis_analysis_init (&vd, &vi);
@@ -327,8 +327,8 @@ public:
else
{
vorbis_info_clear (&vi);
output = 0; // to stop the base class deleting this, as it needs to be returned
// to the caller of createWriter()
output = nullptr; // to stop the base class deleting this, as it needs to be returned
// to the caller of createWriter()
}
}
@@ -349,7 +349,7 @@ public:
float* const dst = vorbisBuffer[i];
const int* const src = samplesToWrite [i];
if (src != 0 && dst != 0)
if (src != nullptr && dst != nullptr)
{
for (int j = 0; j < numSamples; ++j)
dst[j] = (float) (src[j] * gain);
@@ -425,7 +425,7 @@ AudioFormatReader* OggVorbisAudioFormat::createReaderFor (InputStream* in,
return r.release();
if (! deleteStreamIfOpeningFails)
r->input = 0;
r->input = nullptr;
return 0;
}
@@ -457,14 +457,14 @@ int OggVorbisAudioFormat::estimateOggFileQuality (const File& source)
{
FileInputStream* const in = source.createInputStream();
if (in != 0)
if (in != nullptr)
{
ScopedPointer <AudioFormatReader> r (createReaderFor (in, true));
if (r != 0)
if (r != nullptr)
{
const int64 numSamps = r->lengthInSamples;
r = 0;
r = nullptr;
const int64 fileNumSamps = source.getSize() / 4;
const double ratio = numSamps / (double) fileNumSamps;


+ 5
- 5
src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp View File

@@ -216,13 +216,13 @@ public:
JUCE_AUTORELEASEPOOL
checkThreadIsAttached();
if (dataHandle != 0)
if (dataHandle != nullptr)
DisposeHandle (dataHandle);
if (extractor != 0)
if (extractor != nullptr)
{
MovieAudioExtractionEnd (extractor);
extractor = 0;
extractor = nullptr;
}
DisposeMovie (movie);
@@ -278,7 +278,7 @@ public:
for (int j = numDestChannels; --j >= 0;)
{
if (destSamples[j] != 0)
if (destSamples[j] != nullptr)
{
const short* src = ((const short*) bufferList->mBuffers[0].mData) + j;
@@ -297,7 +297,7 @@ public:
if (((outFlags & kQTMovieAudioExtractionComplete) != 0 || samplesReceived == 0) && numSamples > 0)
{
for (int j = numDestChannels; --j >= 0;)
if (destSamples[j] != 0)
if (destSamples[j] != nullptr)
zeromem (destSamples[j] + startOffsetInDestBuffer, sizeof (int) * numSamples);
break;


+ 12
- 12
src/audio/audio_file_formats/juce_WavAudioFormat.cpp View File

@@ -428,13 +428,13 @@ public:
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
{
jassert (destSamples != 0);
jassert (destSamples != nullptr);
const int64 samplesAvailable = lengthInSamples - startSampleInFile;
if (samplesAvailable < numSamples)
{
for (int i = numDestChannels; --i >= 0;)
if (destSamples[i] != 0)
if (destSamples[i] != nullptr)
zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * numSamples);
numSamples = (int) samplesAvailable;
@@ -526,7 +526,7 @@ public:
//==============================================================================
bool write (const int** data, int numSamples)
{
jassert (data != 0 && *data != 0); // the input must contain at least one channel!
jassert (data != nullptr && *data != nullptr); // the input must contain at least one channel!
if (writeFailed)
return false;
@@ -568,7 +568,7 @@ private:
int64 headerPosition;
bool writeFailed;
static int getChannelMask (const int numChannels) throw()
static int getChannelMask (const int numChannels) noexcept
{
switch (numChannels)
{
@@ -723,7 +723,7 @@ AudioFormatReader* WavAudioFormat::createReaderFor (InputStream* sourceStream,
return r.release();
if (! deleteStreamIfOpeningFails)
r->input = 0;
r->input = nullptr;
return 0;
}
@@ -747,23 +747,23 @@ namespace WavFileHelpers
WavAudioFormat wav;
ScopedPointer <AudioFormatReader> reader (wav.createReaderFor (file.createInputStream(), true));
if (reader != 0)
if (reader != nullptr)
{
ScopedPointer <OutputStream> outStream (tempFile.getFile().createOutputStream());
if (outStream != 0)
if (outStream != nullptr)
{
ScopedPointer <AudioFormatWriter> writer (wav.createWriterFor (outStream, reader->sampleRate,
reader->numChannels, reader->bitsPerSample,
metadata, 0));
if (writer != 0)
if (writer != nullptr)
{
outStream.release();
bool ok = writer->writeFromAudioReader (*reader, 0, -1);
writer = 0;
reader = 0;
writer = nullptr;
reader = nullptr;
return ok && tempFile.overwriteTargetFileWithTemporary();
}
@@ -779,11 +779,11 @@ bool WavAudioFormat::replaceMetadataInFile (const File& wavFile, const StringPai
using namespace WavFileHelpers;
ScopedPointer <WavAudioFormatReader> reader (static_cast <WavAudioFormatReader*> (createReaderFor (wavFile.createInputStream(), true)));
if (reader != 0)
if (reader != nullptr)
{
const int64 bwavPos = reader->bwavChunkStart;
const int64 bwavSize = reader->bwavSize;
reader = 0;
reader = nullptr;
if (bwavSize > 0)
{


+ 1
- 1
src/audio/audio_file_formats/oggvorbis/libvorbis-1.3.2/lib/psy.c View File

@@ -1165,7 +1165,7 @@ void _vp_couple_quantize_normalize(int blobno,
However, this is a temporary patch.
by Aoyumi @ 2004/04/18
*/
/*float derate = (1.0 - de*((float)(j-limit+i) / (float)(n-limit)));
/*float derate = (1.0 - de*((float)(j-limit+i) / (float)(n-limit)));*/
/* elliptical
if(reM[j]+reA[j]<0){
reM[j] = - (qeM[j] = (fabs(reM[j])+fabs(reA[j]))*derate*derate);


+ 1
- 1
src/audio/audio_sources/juce_AudioFormatReaderSource.cpp View File

@@ -38,7 +38,7 @@ AudioFormatReaderSource::AudioFormatReaderSource (AudioFormatReader* const reade
nextPlayPos (0),
looping (false)
{
jassert (reader != 0);
jassert (reader != nullptr);
}
AudioFormatReaderSource::~AudioFormatReaderSource()


+ 1
- 1
src/audio/audio_sources/juce_AudioFormatReaderSource.h View File

@@ -69,7 +69,7 @@ public:
bool isLooping() const { return looping; }
/** Returns the reader that's being used. */
AudioFormatReader* getAudioFormatReader() const throw() { return reader; }
AudioFormatReader* getAudioFormatReader() const noexcept { return reader; }
//==============================================================================
/** Implementation of the AudioSource method. */


+ 2
- 2
src/audio/audio_sources/juce_AudioSource.h View File

@@ -64,7 +64,7 @@ struct JUCE_API AudioSourceChannelInfo
/** Convenient method to clear the buffer if the source is not producing any data. */
void clearActiveBufferRegion() const
{
if (buffer != 0)
if (buffer != nullptr)
buffer->clear (startSample, numSamples);
}
};
@@ -90,7 +90,7 @@ class JUCE_API AudioSource
protected:
//==============================================================================
/** Creates an AudioSource. */
AudioSource() throw() {}
AudioSource() noexcept {}
public:
/** Destructor. */


+ 11
- 11
src/audio/audio_sources/juce_AudioSourcePlayer.cpp View File

@@ -32,7 +32,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
AudioSourcePlayer::AudioSourcePlayer()
: source (0),
: source (nullptr),
sampleRate (0),
bufferSize (0),
tempBuffer (2, 8),
@@ -43,7 +43,7 @@ AudioSourcePlayer::AudioSourcePlayer()
AudioSourcePlayer::~AudioSourcePlayer()
{
setSource (0);
setSource (nullptr);
}
void AudioSourcePlayer::setSource (AudioSource* newSource)
@@ -52,7 +52,7 @@ void AudioSourcePlayer::setSource (AudioSource* newSource)
{
AudioSource* const oldSource = source;
if (newSource != 0 && bufferSize > 0 && sampleRate > 0)
if (newSource != nullptr && bufferSize > 0 && sampleRate > 0)
newSource->prepareToPlay (bufferSize, sampleRate);
{
@@ -60,12 +60,12 @@ void AudioSourcePlayer::setSource (AudioSource* newSource)
source = newSource;
}
if (oldSource != 0)
if (oldSource != nullptr)
oldSource->releaseResources();
}
}
void AudioSourcePlayer::setGain (const float newGain) throw()
void AudioSourcePlayer::setGain (const float newGain) noexcept
{
gain = newGain;
}
@@ -81,7 +81,7 @@ void AudioSourcePlayer::audioDeviceIOCallback (const float** inputChannelData,
const ScopedLock sl (readLock);
if (source != 0)
if (source != nullptr)
{
AudioSourceChannelInfo info;
int i, numActiveChans = 0, numInputs = 0, numOutputs = 0;
@@ -90,7 +90,7 @@ void AudioSourcePlayer::audioDeviceIOCallback (const float** inputChannelData,
// of non-zero pointers..
for (i = 0; i < totalNumInputChannels; ++i)
{
if (inputChannelData[i] != 0)
if (inputChannelData[i] != nullptr)
{
inputChans [numInputs++] = inputChannelData[i];
if (numInputs >= numElementsInArray (inputChans))
@@ -100,7 +100,7 @@ void AudioSourcePlayer::audioDeviceIOCallback (const float** inputChannelData,
for (i = 0; i < totalNumOutputChannels; ++i)
{
if (outputChannelData[i] != 0)
if (outputChannelData[i] != nullptr)
{
outputChans [numOutputs++] = outputChannelData[i];
if (numOutputs >= numElementsInArray (outputChans))
@@ -163,7 +163,7 @@ void AudioSourcePlayer::audioDeviceIOCallback (const float** inputChannelData,
else
{
for (int i = 0; i < totalNumOutputChannels; ++i)
if (outputChannelData[i] != 0)
if (outputChannelData[i] != nullptr)
zeromem (outputChannelData[i], sizeof (float) * numSamples);
}
}
@@ -174,13 +174,13 @@ void AudioSourcePlayer::audioDeviceAboutToStart (AudioIODevice* device)
bufferSize = device->getCurrentBufferSizeSamples();
zeromem (channels, sizeof (channels));
if (source != 0)
if (source != nullptr)
source->prepareToPlay (bufferSize, sampleRate);
}
void AudioSourcePlayer::audioDeviceStopped()
{
if (source != 0)
if (source != nullptr)
source->releaseResources();
sampleRate = 0.0;


+ 3
- 3
src/audio/audio_sources/juce_AudioSourcePlayer.h View File

@@ -72,17 +72,17 @@ public:
May return 0 if there's no source.
*/
AudioSource* getCurrentSource() const throw() { return source; }
AudioSource* getCurrentSource() const noexcept { return source; }
/** Sets a gain to apply to the audio data.
@see getGain
*/
void setGain (float newGain) throw();
void setGain (float newGain) noexcept;
/** Returns the current gain.
@see setGain
*/
float getGain() const throw() { return gain; }
float getGain() const noexcept { return gain; }
//==============================================================================
/** Implementation of the AudioIODeviceCallback method. */


+ 24
- 24
src/audio/audio_sources/juce_AudioTransportSource.cpp View File

@@ -33,11 +33,11 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
AudioTransportSource::AudioTransportSource()
: source (0),
resamplerSource (0),
bufferingSource (0),
positionableSource (0),
masterSource (0),
: source (nullptr),
resamplerSource (nullptr),
bufferingSource (nullptr),
positionableSource (nullptr),
masterSource (nullptr),
gain (1.0f),
lastGain (1.0f),
playing (false),
@@ -53,7 +53,7 @@ AudioTransportSource::AudioTransportSource()
AudioTransportSource::~AudioTransportSource()
{
setSource (0);
setSource (nullptr);
releaseResources();
}
@@ -65,7 +65,7 @@ void AudioTransportSource::setSource (PositionableAudioSource* const newSource,
{
if (source == newSource)
{
if (source == 0)
if (source == nullptr)
return;
setSource (0, 0, 0); // deselect and reselect to avoid releasing resources wrongly
@@ -74,16 +74,16 @@ void AudioTransportSource::setSource (PositionableAudioSource* const newSource,
readAheadBufferSize = readAheadBufferSize_;
sourceSampleRate = sourceSampleRateToCorrectFor;
ResamplingAudioSource* newResamplerSource = 0;
BufferingAudioSource* newBufferingSource = 0;
PositionableAudioSource* newPositionableSource = 0;
AudioSource* newMasterSource = 0;
ResamplingAudioSource* newResamplerSource = nullptr;
BufferingAudioSource* newBufferingSource = nullptr;
PositionableAudioSource* newPositionableSource = nullptr;
AudioSource* newMasterSource = nullptr;
ScopedPointer <ResamplingAudioSource> oldResamplerSource (resamplerSource);
ScopedPointer <BufferingAudioSource> oldBufferingSource (bufferingSource);
AudioSource* oldMasterSource = masterSource;
if (newSource != 0)
if (newSource != nullptr)
{
newPositionableSource = newSource;
@@ -101,7 +101,7 @@ void AudioTransportSource::setSource (PositionableAudioSource* const newSource,
if (isPrepared)
{
if (newResamplerSource != 0 && sourceSampleRate > 0 && sampleRate > 0)
if (newResamplerSource != nullptr && sourceSampleRate > 0 && sampleRate > 0)
newResamplerSource->setResamplingRatio (sourceSampleRate / sampleRate);
newMasterSource->prepareToPlay (blockSize, sampleRate);
@@ -120,13 +120,13 @@ void AudioTransportSource::setSource (PositionableAudioSource* const newSource,
playing = false;
}
if (oldMasterSource != 0)
if (oldMasterSource != nullptr)
oldMasterSource->releaseResources();
}
void AudioTransportSource::start()
{
if ((! playing) && masterSource != 0)
if ((! playing) && masterSource != nullptr)
{
{
const ScopedLock sl (callbackLock);
@@ -177,7 +177,7 @@ double AudioTransportSource::getLengthInSeconds() const
void AudioTransportSource::setNextReadPosition (int64 newPosition)
{
if (positionableSource != 0)
if (positionableSource != nullptr)
{
if (sampleRate > 0 && sourceSampleRate > 0)
newPosition = (int64) (newPosition * sourceSampleRate / sampleRate);
@@ -188,7 +188,7 @@ void AudioTransportSource::setNextReadPosition (int64 newPosition)
int64 AudioTransportSource::getNextReadPosition() const
{
if (positionableSource != 0)
if (positionableSource != nullptr)
{
const double ratio = (sampleRate > 0 && sourceSampleRate > 0) ? sampleRate / sourceSampleRate : 1.0;
@@ -202,7 +202,7 @@ int64 AudioTransportSource::getTotalLength() const
{
const ScopedLock sl (callbackLock);
if (positionableSource != 0)
if (positionableSource != nullptr)
{
const double ratio = (sampleRate > 0 && sourceSampleRate > 0) ? sampleRate / sourceSampleRate : 1.0;
@@ -216,11 +216,11 @@ bool AudioTransportSource::isLooping() const
{
const ScopedLock sl (callbackLock);
return positionableSource != 0
return positionableSource != nullptr
&& positionableSource->isLooping();
}
void AudioTransportSource::setGain (const float newGain) throw()
void AudioTransportSource::setGain (const float newGain) noexcept
{
gain = newGain;
}
@@ -233,10 +233,10 @@ void AudioTransportSource::prepareToPlay (int samplesPerBlockExpected,
sampleRate = sampleRate_;
blockSize = samplesPerBlockExpected;
if (masterSource != 0)
if (masterSource != nullptr)
masterSource->prepareToPlay (samplesPerBlockExpected, sampleRate);
if (resamplerSource != 0 && sourceSampleRate > 0)
if (resamplerSource != nullptr && sourceSampleRate > 0)
resamplerSource->setResamplingRatio (sourceSampleRate / sampleRate);
isPrepared = true;
@@ -246,7 +246,7 @@ void AudioTransportSource::releaseResources()
{
const ScopedLock sl (callbackLock);
if (masterSource != 0)
if (masterSource != nullptr)
masterSource->releaseResources();
isPrepared = false;
@@ -258,7 +258,7 @@ void AudioTransportSource::getNextAudioBlock (const AudioSourceChannelInfo& info
inputStreamEOF = false;
if (masterSource != 0 && ! stopped)
if (masterSource != nullptr && ! stopped)
{
masterSource->getNextAudioBlock (info);


+ 4
- 4
src/audio/audio_sources/juce_AudioTransportSource.h View File

@@ -103,7 +103,7 @@ public:
/** Returns true if the player has stopped because its input stream ran out of data.
*/
bool hasStreamFinished() const throw() { return inputStreamEOF; }
bool hasStreamFinished() const noexcept { return inputStreamEOF; }
//==============================================================================
/** Starts playing (if a source has been selected).
@@ -121,7 +121,7 @@ public:
void stop();
/** Returns true if it's currently playing. */
bool isPlaying() const throw() { return playing; }
bool isPlaying() const noexcept { return playing; }
//==============================================================================
/** Changes the gain to apply to the output.
@@ -129,13 +129,13 @@ public:
@param newGain a factor by which to multiply the outgoing samples,
so 1.0 = 0dB, 0.5 = -6dB, 2.0 = 6dB, etc.
*/
void setGain (float newGain) throw();
void setGain (float newGain) noexcept;
/** Returns the current gain setting.
@see setGain
*/
float getGain() const throw() { return gain; }
float getGain() const noexcept { return gain; }
//==============================================================================


+ 6
- 6
src/audio/audio_sources/juce_BufferingAudioSource.cpp View File

@@ -96,7 +96,7 @@ private:
BufferingAudioSource* const b = sources[i];
if (b != 0 && b->readNextBufferChunk())
if (b != nullptr && b->readNextBufferChunk())
busy = true;
}
@@ -131,7 +131,7 @@ BufferingAudioSource::BufferingAudioSource (PositionableAudioSource* source_,
nextPlayPos (0),
wasSourceLooping (false)
{
jassert (source_ != 0);
jassert (source_ != nullptr);
jassert (numberOfSamplesToBuffer_ > 1024); // not much point using this class if you're
// not using a larger buffer..
@@ -141,7 +141,7 @@ BufferingAudioSource::~BufferingAudioSource()
{
SharedBufferingAudioSourceThread* const thread = SharedBufferingAudioSourceThread::getInstanceWithoutCreating();
if (thread != 0)
if (thread != nullptr)
thread->removeSource (this);
if (deleteSourceWhenDeleted)
@@ -175,7 +175,7 @@ void BufferingAudioSource::releaseResources()
{
SharedBufferingAudioSourceThread* const thread = SharedBufferingAudioSourceThread::getInstanceWithoutCreating();
if (thread != 0)
if (thread != nullptr)
thread->removeSource (this);
buffer.setSize (2, 0);
@@ -242,7 +242,7 @@ void BufferingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& info
SharedBufferingAudioSourceThread* const thread = SharedBufferingAudioSourceThread::getInstanceWithoutCreating();
if (thread != 0)
if (thread != nullptr)
thread->notify();
}
@@ -261,7 +261,7 @@ void BufferingAudioSource::setNextReadPosition (int64 newPosition)
SharedBufferingAudioSourceThread* const thread = SharedBufferingAudioSourceThread::getInstanceWithoutCreating();
if (thread != 0)
if (thread != nullptr)
thread->notify();
}


+ 1
- 1
src/audio/audio_sources/juce_IIRFilterAudioSource.cpp View File

@@ -35,7 +35,7 @@ IIRFilterAudioSource::IIRFilterAudioSource (AudioSource* const inputSource,
: input (inputSource),
deleteInputWhenDeleted (deleteInputWhenDeleted_)
{
jassert (inputSource != 0);
jassert (inputSource != nullptr);
for (int i = 2; --i >= 0;)
iirFilters.add (new IIRFilter());


+ 2
- 2
src/audio/audio_sources/juce_MixerAudioSource.cpp View File

@@ -47,7 +47,7 @@ MixerAudioSource::~MixerAudioSource()
//==============================================================================
void MixerAudioSource::addInputSource (AudioSource* input, const bool deleteWhenRemoved)
{
if (input != 0 && ! inputs.contains (input))
if (input != nullptr && ! inputs.contains (input))
{
double localRate;
int localBufferSize;
@@ -70,7 +70,7 @@ void MixerAudioSource::addInputSource (AudioSource* input, const bool deleteWhen
void MixerAudioSource::removeInputSource (AudioSource* input, const bool deleteInput)
{
if (input != 0)
if (input != nullptr)
{
int index;


+ 1
- 1
src/audio/audio_sources/juce_PositionableAudioSource.h View File

@@ -44,7 +44,7 @@ class JUCE_API PositionableAudioSource : public AudioSource
protected:
//==============================================================================
/** Creates the PositionableAudioSource. */
PositionableAudioSource() throw() {}
PositionableAudioSource() noexcept {}
public:
/** Destructor */


+ 3
- 3
src/audio/audio_sources/juce_ResamplingAudioSource.cpp View File

@@ -42,7 +42,7 @@ ResamplingAudioSource::ResamplingAudioSource (AudioSource* const inputSource,
sampsInBuffer (0),
numChannels (numChannels_)
{
jassert (input != 0);
jassert (input != nullptr);
}
ResamplingAudioSource::~ResamplingAudioSource()
@@ -256,10 +256,10 @@ void ResamplingAudioSource::applyFilter (float* samples, int num, FilterState& f
- coefficients[4] * fs.y1
- coefficients[5] * fs.y2;
#if JUCE_INTEL
#if JUCE_INTEL
if (! (out < -1.0e-8 || out > 1.0e-8))
out = 0;
#endif
#endif
fs.x2 = fs.x1;
fs.x1 = in;


+ 1
- 1
src/audio/audio_sources/juce_ResamplingAudioSource.h View File

@@ -68,7 +68,7 @@ public:
This is the value that was set by setResamplingRatio().
*/
double getResamplingRatio() const throw() { return ratio; }
double getResamplingRatio() const noexcept { return ratio; }
//==============================================================================
void prepareToPlay (int samplesPerBlockExpected, double sampleRate);


+ 37
- 39
src/audio/devices/juce_AudioDeviceManager.cpp View File

@@ -57,15 +57,13 @@ bool AudioDeviceManager::AudioDeviceSetup::operator== (const AudioDeviceManager:
//==============================================================================
AudioDeviceManager::AudioDeviceManager()
: currentAudioDevice (0),
numInputChansNeeded (0),
: numInputChansNeeded (0),
numOutputChansNeeded (2),
listNeedsScanning (true),
useInputNames (false),
inputLevelMeasurementEnabledCount (0),
inputLevel (0),
tempBuffer (2, 2),
defaultMidiOutput (0),
cpuUsageMs (0),
timeToCpuScale (0)
{
@@ -74,8 +72,8 @@ AudioDeviceManager::AudioDeviceManager()
AudioDeviceManager::~AudioDeviceManager()
{
currentAudioDevice = 0;
defaultMidiOutput = 0;
currentAudioDevice = nullptr;
defaultMidiOutput = nullptr;
}
@@ -103,7 +101,7 @@ const OwnedArray <AudioIODeviceType>& AudioDeviceManager::getAvailableDeviceType
//==============================================================================
static void addIfNotNull (OwnedArray <AudioIODeviceType>& list, AudioIODeviceType* const device)
{
if (device != 0)
if (device != nullptr)
list.add (device);
}
@@ -132,14 +130,14 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
numInputChansNeeded = numInputChannelsNeeded;
numOutputChansNeeded = numOutputChannelsNeeded;
if (e != 0 && e->hasTagName ("DEVICESETUP"))
if (e != nullptr && e->hasTagName ("DEVICESETUP"))
{
lastExplicitSettings = new XmlElement (*e);
String error;
AudioDeviceSetup setup;
if (preferredSetupOptions != 0)
if (preferredSetupOptions != nullptr)
setup = *preferredSetupOptions;
if (e->getStringAttribute ("audioDeviceName").isNotEmpty())
@@ -158,7 +156,7 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
{
AudioIODeviceType* const type = findType (setup.inputDeviceName, setup.outputDeviceName);
if (type != 0)
if (type != nullptr)
currentDeviceType = type->getTypeName();
else if (availableDeviceTypes.size() > 0)
currentDeviceType = availableDeviceTypes[0]->getTypeName();
@@ -196,7 +194,7 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
{
AudioDeviceSetup setup;
if (preferredSetupOptions != 0)
if (preferredSetupOptions != nullptr)
{
setup = *preferredSetupOptions;
}
@@ -239,7 +237,7 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
void AudioDeviceManager::insertDefaultDeviceNames (AudioDeviceSetup& setup) const
{
AudioIODeviceType* type = getCurrentDeviceTypeObject();
if (type != 0)
if (type != nullptr)
{
if (setup.outputDeviceName.isEmpty())
setup.outputDeviceName = type->getDeviceNames (false) [type->getDefaultDeviceIndex (false)];
@@ -251,7 +249,7 @@ void AudioDeviceManager::insertDefaultDeviceNames (AudioDeviceSetup& setup) cons
XmlElement* AudioDeviceManager::createStateXml() const
{
return lastExplicitSettings != 0 ? new XmlElement (*lastExplicitSettings) : 0;
return lastExplicitSettings != nullptr ? new XmlElement (*lastExplicitSettings) : 0;
}
//==============================================================================
@@ -293,7 +291,7 @@ void AudioDeviceManager::getAudioDeviceSetup (AudioDeviceSetup& setup)
void AudioDeviceManager::deleteCurrentDevice()
{
currentAudioDevice = 0;
currentAudioDevice = nullptr;
currentSetup.inputDeviceName = String::empty;
currentSetup.outputDeviceName = String::empty;
}
@@ -333,7 +331,7 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne
{
jassert (&newSetup != &currentSetup); // this will have no effect
if (newSetup == currentSetup && currentAudioDevice != 0)
if (newSetup == currentSetup && currentAudioDevice != nullptr)
return String::empty;
if (! (newSetup == currentSetup))
@@ -347,7 +345,7 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne
String error;
AudioIODeviceType* type = getCurrentDeviceTypeObject();
if (type == 0 || (newInputDeviceName.isEmpty() && newOutputDeviceName.isEmpty()))
if (type == nullptr || (newInputDeviceName.isEmpty() && newOutputDeviceName.isEmpty()))
{
deleteCurrentDevice();
@@ -359,7 +357,7 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne
if (currentSetup.inputDeviceName != newInputDeviceName
|| currentSetup.outputDeviceName != newOutputDeviceName
|| currentAudioDevice == 0)
|| currentAudioDevice == nullptr)
{
deleteCurrentDevice();
scanDevicesIfNeeded();
@@ -378,7 +376,7 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne
currentAudioDevice = type->createDevice (newOutputDeviceName, newInputDeviceName);
if (currentAudioDevice == 0)
if (currentAudioDevice == nullptr)
error = "Can't open the audio device!\n\nThis may be because another application is currently using the same device - if so, you should close any other applications and try again!";
else
error = currentAudioDevice->getLastError();
@@ -452,7 +450,7 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne
double AudioDeviceManager::chooseBestSampleRate (double rate) const
{
jassert (currentAudioDevice != 0);
jassert (currentAudioDevice != nullptr);
if (rate > 0)
for (int i = currentAudioDevice->getNumSampleRates(); --i >= 0;)
@@ -477,7 +475,7 @@ double AudioDeviceManager::chooseBestSampleRate (double rate) const
int AudioDeviceManager::chooseBestBufferSize (int bufferSize) const
{
jassert (currentAudioDevice != 0);
jassert (currentAudioDevice != nullptr);
if (bufferSize > 0)
for (int i = currentAudioDevice->getNumBufferSizesAvailable(); --i >= 0;)
@@ -489,21 +487,21 @@ int AudioDeviceManager::chooseBestBufferSize (int bufferSize) const
void AudioDeviceManager::stopDevice()
{
if (currentAudioDevice != 0)
if (currentAudioDevice != nullptr)
currentAudioDevice->stop();
testSound = 0;
testSound = nullptr;
}
void AudioDeviceManager::closeAudioDevice()
{
stopDevice();
currentAudioDevice = 0;
currentAudioDevice = nullptr;
}
void AudioDeviceManager::restartLastAudioDevice()
{
if (currentAudioDevice == 0)
if (currentAudioDevice == nullptr)
{
if (currentSetup.inputDeviceName.isEmpty()
&& currentSetup.outputDeviceName.isEmpty())
@@ -528,7 +526,7 @@ void AudioDeviceManager::updateXml()
lastExplicitSettings->setAttribute ("audioOutputDeviceName", currentSetup.outputDeviceName);
lastExplicitSettings->setAttribute ("audioInputDeviceName", currentSetup.inputDeviceName);
if (currentAudioDevice != 0)
if (currentAudioDevice != nullptr)
{
lastExplicitSettings->setAttribute ("audioDeviceRate", currentAudioDevice->getCurrentSampleRate());
@@ -577,7 +575,7 @@ void AudioDeviceManager::addAudioCallback (AudioIODeviceCallback* newCallback)
return;
}
if (currentAudioDevice != 0 && newCallback != 0)
if (currentAudioDevice != nullptr && newCallback != nullptr)
newCallback->audioDeviceAboutToStart (currentAudioDevice);
const ScopedLock sl (audioCallbackLock);
@@ -586,9 +584,9 @@ void AudioDeviceManager::addAudioCallback (AudioIODeviceCallback* newCallback)
void AudioDeviceManager::removeAudioCallback (AudioIODeviceCallback* callbackToRemove)
{
if (callbackToRemove != 0)
if (callbackToRemove != nullptr)
{
bool needsDeinitialising = currentAudioDevice != 0;
bool needsDeinitialising = currentAudioDevice != nullptr;
{
const ScopedLock sl (audioCallbackLock);
@@ -657,7 +655,7 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat
const float* const src = tempChans [chan];
float* const dst = outputChannelData [chan];
if (src != 0 && dst != 0)
if (src != nullptr && dst != nullptr)
for (int j = 0; j < numSamples; ++j)
dst[j] += src[j];
}
@@ -673,7 +671,7 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat
zeromem (outputChannelData[i], sizeof (float) * numSamples);
}
if (testSound != 0)
if (testSound != nullptr)
{
const int numSamps = jmin (numSamples, testSound->getNumSamples() - testSoundPosition);
const float* const src = testSound->getSampleData (0, testSoundPosition);
@@ -684,7 +682,7 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat
testSoundPosition += numSamps;
if (testSoundPosition >= testSound->getNumSamples())
testSound = 0;
testSound = nullptr;
}
}
@@ -738,12 +736,12 @@ void AudioDeviceManager::setMidiInputEnabled (const String& name,
if (index >= 0)
{
MidiInput* const min = MidiInput::openDevice (index, &callbackHandler);
MidiInput* const midiIn = MidiInput::openDevice (index, &callbackHandler);
if (min != 0)
if (midiIn != nullptr)
{
enabledMidiInputs.add (min);
min->start();
enabledMidiInputs.add (midiIn);
midiIn->start();
}
}
}
@@ -799,7 +797,7 @@ void AudioDeviceManager::handleIncomingMidiMessageInt (MidiInput* source,
{
if (! message.isActiveSense())
{
const bool isDefaultSource = (source == 0 || source == enabledMidiInputs.getFirst());
const bool isDefaultSource = (source == nullptr || source == enabledMidiInputs.getFirst());
const ScopedLock sl (midiCallbackLock);
@@ -826,17 +824,17 @@ void AudioDeviceManager::setDefaultMidiOutput (const String& deviceName)
callbacks.clear();
}
if (currentAudioDevice != 0)
if (currentAudioDevice != nullptr)
for (int i = oldCallbacks.size(); --i >= 0;)
oldCallbacks.getUnchecked(i)->audioDeviceStopped();
defaultMidiOutput = 0;
defaultMidiOutput = nullptr;
defaultMidiOutputName = deviceName;
if (deviceName.isNotEmpty())
defaultMidiOutput = MidiOutput::openDevice (MidiOutput::getDevices().indexOf (deviceName));
if (currentAudioDevice != 0)
if (currentAudioDevice != nullptr)
for (int i = oldCallbacks.size(); --i >= 0;)
oldCallbacks.getUnchecked(i)->audioDeviceAboutToStart (currentAudioDevice);
@@ -889,7 +887,7 @@ void AudioDeviceManager::playTestSound()
testSoundPosition = 0;
if (currentAudioDevice != 0)
if (currentAudioDevice != nullptr)
{
const double sampleRate = currentAudioDevice->getCurrentSampleRate();
const int soundLength = (int) sampleRate;


+ 4
- 4
src/audio/devices/juce_AudioDeviceManager.h View File

@@ -235,7 +235,7 @@ public:
/** Returns the currently-active audio device. */
AudioIODevice* getCurrentAudioDevice() const throw() { return currentAudioDevice; }
AudioIODevice* getCurrentAudioDevice() const noexcept { return currentAudioDevice; }
/** Returns the type of audio device currently in use.
@see setCurrentAudioDeviceType
@@ -380,7 +380,7 @@ public:
@see getDefaultMidiOutputName
*/
MidiOutput* getDefaultMidiOutput() const throw() { return defaultMidiOutput; }
MidiOutput* getDefaultMidiOutput() const noexcept { return defaultMidiOutput; }
/** Returns a list of the types of device supported.
*/
@@ -432,13 +432,13 @@ public:
Obviously while this is locked, you're blocking the audio thread from running, so
it must only be used for very brief periods when absolutely necessary.
*/
CriticalSection& getAudioCallbackLock() throw() { return audioCallbackLock; }
CriticalSection& getAudioCallbackLock() noexcept { return audioCallbackLock; }
/** Returns the a lock that can be used to synchronise access to the midi callback.
Obviously while this is locked, you're blocking the midi system from running, so
it must only be used for very brief periods when absolutely necessary.
*/
CriticalSection& getMidiCallbackLock() throw() { return midiCallbackLock; }
CriticalSection& getMidiCallbackLock() noexcept { return midiCallbackLock; }
private:
//==============================================================================


+ 2
- 2
src/audio/devices/juce_AudioIODevice.h View File

@@ -136,13 +136,13 @@ public:
//==============================================================================
/** Returns the device's name, (as set in the constructor). */
const String& getName() const throw() { return name; }
const String& getName() const noexcept { return name; }
/** Returns the type of the device.
E.g. "CoreAudio", "ASIO", etc. - this comes from the AudioIODeviceType that created it.
*/
const String& getTypeName() const throw() { return typeName; }
const String& getTypeName() const noexcept { return typeName; }
//==============================================================================
/** Returns the names of all the available output channels on this device.


+ 1
- 1
src/audio/devices/juce_AudioIODeviceType.h View File

@@ -71,7 +71,7 @@ public:
This will be something like "DirectSound", "ASIO", "CoreAudio", "ALSA", etc.
*/
const String& getTypeName() const throw() { return typeName; }
const String& getTypeName() const noexcept { return typeName; }
//==============================================================================
/** Refreshes the object's cached list of known devices.


+ 155
- 155
src/audio/dsp/juce_AudioDataConverters.h View File

@@ -71,22 +71,22 @@ public:
class BigEndian
{
public:
template <class SampleFormatType> static inline float getAsFloat (SampleFormatType& s) throw() { return s.getAsFloatBE(); }
template <class SampleFormatType> static inline void setAsFloat (SampleFormatType& s, float newValue) throw() { s.setAsFloatBE (newValue); }
template <class SampleFormatType> static inline int32 getAsInt32 (SampleFormatType& s) throw() { return s.getAsInt32BE(); }
template <class SampleFormatType> static inline void setAsInt32 (SampleFormatType& s, int32 newValue) throw() { s.setAsInt32BE (newValue); }
template <class SourceType, class DestType> static inline void copyFrom (DestType& dest, SourceType& source) throw() { dest.copyFromBE (source); }
template <class SampleFormatType> static inline float getAsFloat (SampleFormatType& s) noexcept { return s.getAsFloatBE(); }
template <class SampleFormatType> static inline void setAsFloat (SampleFormatType& s, float newValue) noexcept { s.setAsFloatBE (newValue); }
template <class SampleFormatType> static inline int32 getAsInt32 (SampleFormatType& s) noexcept { return s.getAsInt32BE(); }
template <class SampleFormatType> static inline void setAsInt32 (SampleFormatType& s, int32 newValue) noexcept { s.setAsInt32BE (newValue); }
template <class SourceType, class DestType> static inline void copyFrom (DestType& dest, SourceType& source) noexcept { dest.copyFromBE (source); }
enum { isBigEndian = 1 };
};
class LittleEndian
{
public:
template <class SampleFormatType> static inline float getAsFloat (SampleFormatType& s) throw() { return s.getAsFloatLE(); }
template <class SampleFormatType> static inline void setAsFloat (SampleFormatType& s, float newValue) throw() { s.setAsFloatLE (newValue); }
template <class SampleFormatType> static inline int32 getAsInt32 (SampleFormatType& s) throw() { return s.getAsInt32LE(); }
template <class SampleFormatType> static inline void setAsInt32 (SampleFormatType& s, int32 newValue) throw() { s.setAsInt32LE (newValue); }
template <class SourceType, class DestType> static inline void copyFrom (DestType& dest, SourceType& source) throw() { dest.copyFromLE (source); }
template <class SampleFormatType> static inline float getAsFloat (SampleFormatType& s) noexcept { return s.getAsFloatLE(); }
template <class SampleFormatType> static inline void setAsFloat (SampleFormatType& s, float newValue) noexcept { s.setAsFloatLE (newValue); }
template <class SampleFormatType> static inline int32 getAsInt32 (SampleFormatType& s) noexcept { return s.getAsInt32LE(); }
template <class SampleFormatType> static inline void setAsInt32 (SampleFormatType& s, int32 newValue) noexcept { s.setAsInt32LE (newValue); }
template <class SourceType, class DestType> static inline void copyFrom (DestType& dest, SourceType& source) noexcept { dest.copyFromLE (source); }
enum { isBigEndian = 0 };
};
@@ -100,23 +100,23 @@ public:
class Int8
{
public:
inline Int8 (void* data_) throw() : data (static_cast <int8*> (data_)) {}
inline void advance() throw() { ++data; }
inline void skip (int numSamples) throw() { data += numSamples; }
inline float getAsFloatLE() const throw() { return (float) (*data * (1.0 / (1.0 + maxValue))); }
inline float getAsFloatBE() const throw() { return getAsFloatLE(); }
inline void setAsFloatLE (float newValue) throw() { *data = (int8) jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue))); }
inline void setAsFloatBE (float newValue) throw() { setAsFloatLE (newValue); }
inline int32 getAsInt32LE() const throw() { return (int) (*data << 24); }
inline int32 getAsInt32BE() const throw() { return getAsInt32LE(); }
inline void setAsInt32LE (int newValue) throw() { *data = (int8) (newValue >> 24); }
inline void setAsInt32BE (int newValue) throw() { setAsInt32LE (newValue); }
inline void clear() throw() { *data = 0; }
inline void clearMultiple (int num) throw() { zeromem (data, num * bytesPerSample) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) throw() { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) throw() { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int8& source) throw() { *data = *source.data; }
inline Int8 (void* data_) noexcept : data (static_cast <int8*> (data_)) {}
inline void advance() noexcept { ++data; }
inline void skip (int numSamples) noexcept { data += numSamples; }
inline float getAsFloatLE() const noexcept { return (float) (*data * (1.0 / (1.0 + maxValue))); }
inline float getAsFloatBE() const noexcept { return getAsFloatLE(); }
inline void setAsFloatLE (float newValue) noexcept { *data = (int8) jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue))); }
inline void setAsFloatBE (float newValue) noexcept { setAsFloatLE (newValue); }
inline int32 getAsInt32LE() const noexcept { return (int) (*data << 24); }
inline int32 getAsInt32BE() const noexcept { return getAsInt32LE(); }
inline void setAsInt32LE (int newValue) noexcept { *data = (int8) (newValue >> 24); }
inline void setAsInt32BE (int newValue) noexcept { setAsInt32LE (newValue); }
inline void clear() noexcept { *data = 0; }
inline void clearMultiple (int num) noexcept { zeromem (data, num * bytesPerSample) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int8& source) noexcept { *data = *source.data; }
int8* data;
enum { bytesPerSample = 1, maxValue = 0x7f, resolution = (1 << 24), isFloat = 0 };
@@ -125,23 +125,23 @@ public:
class UInt8
{
public:
inline UInt8 (void* data_) throw() : data (static_cast <uint8*> (data_)) {}
inline void advance() throw() { ++data; }
inline void skip (int numSamples) throw() { data += numSamples; }
inline float getAsFloatLE() const throw() { return (float) ((*data - 128) * (1.0 / (1.0 + maxValue))); }
inline float getAsFloatBE() const throw() { return getAsFloatLE(); }
inline void setAsFloatLE (float newValue) throw() { *data = (uint8) jlimit (0, 255, 128 + roundToInt (newValue * (1.0 + maxValue))); }
inline void setAsFloatBE (float newValue) throw() { setAsFloatLE (newValue); }
inline int32 getAsInt32LE() const throw() { return (int) ((*data - 128) << 24); }
inline int32 getAsInt32BE() const throw() { return getAsInt32LE(); }
inline void setAsInt32LE (int newValue) throw() { *data = (uint8) (128 + (newValue >> 24)); }
inline void setAsInt32BE (int newValue) throw() { setAsInt32LE (newValue); }
inline void clear() throw() { *data = 128; }
inline void clearMultiple (int num) throw() { memset (data, 128, num) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) throw() { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) throw() { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (UInt8& source) throw() { *data = *source.data; }
inline UInt8 (void* data_) noexcept : data (static_cast <uint8*> (data_)) {}
inline void advance() noexcept { ++data; }
inline void skip (int numSamples) noexcept { data += numSamples; }
inline float getAsFloatLE() const noexcept { return (float) ((*data - 128) * (1.0 / (1.0 + maxValue))); }
inline float getAsFloatBE() const noexcept { return getAsFloatLE(); }
inline void setAsFloatLE (float newValue) noexcept { *data = (uint8) jlimit (0, 255, 128 + roundToInt (newValue * (1.0 + maxValue))); }
inline void setAsFloatBE (float newValue) noexcept { setAsFloatLE (newValue); }
inline int32 getAsInt32LE() const noexcept { return (int) ((*data - 128) << 24); }
inline int32 getAsInt32BE() const noexcept { return getAsInt32LE(); }
inline void setAsInt32LE (int newValue) noexcept { *data = (uint8) (128 + (newValue >> 24)); }
inline void setAsInt32BE (int newValue) noexcept { setAsInt32LE (newValue); }
inline void clear() noexcept { *data = 128; }
inline void clearMultiple (int num) noexcept { memset (data, 128, num) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (UInt8& source) noexcept { *data = *source.data; }
uint8* data;
enum { bytesPerSample = 1, maxValue = 0x7f, resolution = (1 << 24), isFloat = 0 };
@@ -150,23 +150,23 @@ public:
class Int16
{
public:
inline Int16 (void* data_) throw() : data (static_cast <uint16*> (data_)) {}
inline void advance() throw() { ++data; }
inline void skip (int numSamples) throw() { data += numSamples; }
inline float getAsFloatLE() const throw() { return (float) ((1.0 / (1.0 + maxValue)) * (int16) ByteOrder::swapIfBigEndian (*data)); }
inline float getAsFloatBE() const throw() { return (float) ((1.0 / (1.0 + maxValue)) * (int16) ByteOrder::swapIfLittleEndian (*data)); }
inline void setAsFloatLE (float newValue) throw() { *data = ByteOrder::swapIfBigEndian ((uint16) jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue)))); }
inline void setAsFloatBE (float newValue) throw() { *data = ByteOrder::swapIfLittleEndian ((uint16) jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue)))); }
inline int32 getAsInt32LE() const throw() { return (int32) (ByteOrder::swapIfBigEndian ((uint16) *data) << 16); }
inline int32 getAsInt32BE() const throw() { return (int32) (ByteOrder::swapIfLittleEndian ((uint16) *data) << 16); }
inline void setAsInt32LE (int32 newValue) throw() { *data = ByteOrder::swapIfBigEndian ((uint16) (newValue >> 16)); }
inline void setAsInt32BE (int32 newValue) throw() { *data = ByteOrder::swapIfLittleEndian ((uint16) (newValue >> 16)); }
inline void clear() throw() { *data = 0; }
inline void clearMultiple (int num) throw() { zeromem (data, num * bytesPerSample) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) throw() { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) throw() { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int16& source) throw() { *data = *source.data; }
inline Int16 (void* data_) noexcept : data (static_cast <uint16*> (data_)) {}
inline void advance() noexcept { ++data; }
inline void skip (int numSamples) noexcept { data += numSamples; }
inline float getAsFloatLE() const noexcept { return (float) ((1.0 / (1.0 + maxValue)) * (int16) ByteOrder::swapIfBigEndian (*data)); }
inline float getAsFloatBE() const noexcept { return (float) ((1.0 / (1.0 + maxValue)) * (int16) ByteOrder::swapIfLittleEndian (*data)); }
inline void setAsFloatLE (float newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint16) jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue)))); }
inline void setAsFloatBE (float newValue) noexcept { *data = ByteOrder::swapIfLittleEndian ((uint16) jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue)))); }
inline int32 getAsInt32LE() const noexcept { return (int32) (ByteOrder::swapIfBigEndian ((uint16) *data) << 16); }
inline int32 getAsInt32BE() const noexcept { return (int32) (ByteOrder::swapIfLittleEndian ((uint16) *data) << 16); }
inline void setAsInt32LE (int32 newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint16) (newValue >> 16)); }
inline void setAsInt32BE (int32 newValue) noexcept { *data = ByteOrder::swapIfLittleEndian ((uint16) (newValue >> 16)); }
inline void clear() noexcept { *data = 0; }
inline void clearMultiple (int num) noexcept { zeromem (data, num * bytesPerSample) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int16& source) noexcept { *data = *source.data; }
uint16* data;
enum { bytesPerSample = 2, maxValue = 0x7fff, resolution = (1 << 16), isFloat = 0 };
@@ -175,23 +175,23 @@ public:
class Int24
{
public:
inline Int24 (void* data_) throw() : data (static_cast <char*> (data_)) {}
inline void advance() throw() { data += 3; }
inline void skip (int numSamples) throw() { data += 3 * numSamples; }
inline float getAsFloatLE() const throw() { return (float) (ByteOrder::littleEndian24Bit (data) * (1.0 / (1.0 + maxValue))); }
inline float getAsFloatBE() const throw() { return (float) (ByteOrder::bigEndian24Bit (data) * (1.0 / (1.0 + maxValue))); }
inline void setAsFloatLE (float newValue) throw() { ByteOrder::littleEndian24BitToChars (jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue))), data); }
inline void setAsFloatBE (float newValue) throw() { ByteOrder::bigEndian24BitToChars (jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue))), data); }
inline int32 getAsInt32LE() const throw() { return (int32) ByteOrder::littleEndian24Bit (data) << 8; }
inline int32 getAsInt32BE() const throw() { return (int32) ByteOrder::bigEndian24Bit (data) << 8; }
inline void setAsInt32LE (int32 newValue) throw() { ByteOrder::littleEndian24BitToChars (newValue >> 8, data); }
inline void setAsInt32BE (int32 newValue) throw() { ByteOrder::bigEndian24BitToChars (newValue >> 8, data); }
inline void clear() throw() { data[0] = 0; data[1] = 0; data[2] = 0; }
inline void clearMultiple (int num) throw() { zeromem (data, num * bytesPerSample) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) throw() { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) throw() { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int24& source) throw() { data[0] = source.data[0]; data[1] = source.data[1]; data[2] = source.data[2]; }
inline Int24 (void* data_) noexcept : data (static_cast <char*> (data_)) {}
inline void advance() noexcept { data += 3; }
inline void skip (int numSamples) noexcept { data += 3 * numSamples; }
inline float getAsFloatLE() const noexcept { return (float) (ByteOrder::littleEndian24Bit (data) * (1.0 / (1.0 + maxValue))); }
inline float getAsFloatBE() const noexcept { return (float) (ByteOrder::bigEndian24Bit (data) * (1.0 / (1.0 + maxValue))); }
inline void setAsFloatLE (float newValue) noexcept { ByteOrder::littleEndian24BitToChars (jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue))), data); }
inline void setAsFloatBE (float newValue) noexcept { ByteOrder::bigEndian24BitToChars (jlimit ((int) -maxValue, (int) maxValue, roundToInt (newValue * (1.0 + maxValue))), data); }
inline int32 getAsInt32LE() const noexcept { return (int32) ByteOrder::littleEndian24Bit (data) << 8; }
inline int32 getAsInt32BE() const noexcept { return (int32) ByteOrder::bigEndian24Bit (data) << 8; }
inline void setAsInt32LE (int32 newValue) noexcept { ByteOrder::littleEndian24BitToChars (newValue >> 8, data); }
inline void setAsInt32BE (int32 newValue) noexcept { ByteOrder::bigEndian24BitToChars (newValue >> 8, data); }
inline void clear() noexcept { data[0] = 0; data[1] = 0; data[2] = 0; }
inline void clearMultiple (int num) noexcept { zeromem (data, num * bytesPerSample) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int24& source) noexcept { data[0] = source.data[0]; data[1] = source.data[1]; data[2] = source.data[2]; }
char* data;
enum { bytesPerSample = 3, maxValue = 0x7fffff, resolution = (1 << 8), isFloat = 0 };
@@ -200,23 +200,23 @@ public:
class Int32
{
public:
inline Int32 (void* data_) throw() : data (static_cast <uint32*> (data_)) {}
inline void advance() throw() { ++data; }
inline void skip (int numSamples) throw() { data += numSamples; }
inline float getAsFloatLE() const throw() { return (float) ((1.0 / (1.0 + maxValue)) * (int32) ByteOrder::swapIfBigEndian (*data)); }
inline float getAsFloatBE() const throw() { return (float) ((1.0 / (1.0 + maxValue)) * (int32) ByteOrder::swapIfLittleEndian (*data)); }
inline void setAsFloatLE (float newValue) throw() { *data = ByteOrder::swapIfBigEndian ((uint32) (maxValue * jlimit (-1.0, 1.0, (double) newValue))); }
inline void setAsFloatBE (float newValue) throw() { *data = ByteOrder::swapIfLittleEndian ((uint32) (maxValue * jlimit (-1.0, 1.0, (double) newValue))); }
inline int32 getAsInt32LE() const throw() { return (int32) ByteOrder::swapIfBigEndian (*data); }
inline int32 getAsInt32BE() const throw() { return (int32) ByteOrder::swapIfLittleEndian (*data); }
inline void setAsInt32LE (int32 newValue) throw() { *data = ByteOrder::swapIfBigEndian ((uint32) newValue); }
inline void setAsInt32BE (int32 newValue) throw() { *data = ByteOrder::swapIfLittleEndian ((uint32) newValue); }
inline void clear() throw() { *data = 0; }
inline void clearMultiple (int num) throw() { zeromem (data, num * bytesPerSample) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) throw() { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) throw() { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int32& source) throw() { *data = *source.data; }
inline Int32 (void* data_) noexcept : data (static_cast <uint32*> (data_)) {}
inline void advance() noexcept { ++data; }
inline void skip (int numSamples) noexcept { data += numSamples; }
inline float getAsFloatLE() const noexcept { return (float) ((1.0 / (1.0 + maxValue)) * (int32) ByteOrder::swapIfBigEndian (*data)); }
inline float getAsFloatBE() const noexcept { return (float) ((1.0 / (1.0 + maxValue)) * (int32) ByteOrder::swapIfLittleEndian (*data)); }
inline void setAsFloatLE (float newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint32) (maxValue * jlimit (-1.0, 1.0, (double) newValue))); }
inline void setAsFloatBE (float newValue) noexcept { *data = ByteOrder::swapIfLittleEndian ((uint32) (maxValue * jlimit (-1.0, 1.0, (double) newValue))); }
inline int32 getAsInt32LE() const noexcept { return (int32) ByteOrder::swapIfBigEndian (*data); }
inline int32 getAsInt32BE() const noexcept { return (int32) ByteOrder::swapIfLittleEndian (*data); }
inline void setAsInt32LE (int32 newValue) noexcept { *data = ByteOrder::swapIfBigEndian ((uint32) newValue); }
inline void setAsInt32BE (int32 newValue) noexcept { *data = ByteOrder::swapIfLittleEndian ((uint32) newValue); }
inline void clear() noexcept { *data = 0; }
inline void clearMultiple (int num) noexcept { zeromem (data, num * bytesPerSample) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int32& source) noexcept { *data = *source.data; }
uint32* data;
enum { bytesPerSample = 4, maxValue = 0x7fffffff, resolution = 1, isFloat = 0 };
@@ -225,30 +225,30 @@ public:
class Float32
{
public:
inline Float32 (void* data_) throw() : data (static_cast <float*> (data_)) {}
inline Float32 (void* data_) noexcept : data (static_cast <float*> (data_)) {}
inline void advance() throw() { ++data; }
inline void skip (int numSamples) throw() { data += numSamples; }
inline void advance() noexcept { ++data; }
inline void skip (int numSamples) noexcept { data += numSamples; }
#if JUCE_BIG_ENDIAN
inline float getAsFloatBE() const throw() { return *data; }
inline void setAsFloatBE (float newValue) throw() { *data = newValue; }
inline float getAsFloatLE() const throw() { union { uint32 asInt; float asFloat; } n; n.asInt = ByteOrder::swap (*(uint32*) data); return n.asFloat; }
inline void setAsFloatLE (float newValue) throw() { union { uint32 asInt; float asFloat; } n; n.asFloat = newValue; *(uint32*) data = ByteOrder::swap (n.asInt); }
inline float getAsFloatBE() const noexcept { return *data; }
inline void setAsFloatBE (float newValue) noexcept { *data = newValue; }
inline float getAsFloatLE() const noexcept { union { uint32 asInt; float asFloat; } n; n.asInt = ByteOrder::swap (*(uint32*) data); return n.asFloat; }
inline void setAsFloatLE (float newValue) noexcept { union { uint32 asInt; float asFloat; } n; n.asFloat = newValue; *(uint32*) data = ByteOrder::swap (n.asInt); }
#else
inline float getAsFloatLE() const throw() { return *data; }
inline void setAsFloatLE (float newValue) throw() { *data = newValue; }
inline float getAsFloatBE() const throw() { union { uint32 asInt; float asFloat; } n; n.asInt = ByteOrder::swap (*(uint32*) data); return n.asFloat; }
inline void setAsFloatBE (float newValue) throw() { union { uint32 asInt; float asFloat; } n; n.asFloat = newValue; *(uint32*) data = ByteOrder::swap (n.asInt); }
inline float getAsFloatLE() const noexcept { return *data; }
inline void setAsFloatLE (float newValue) noexcept { *data = newValue; }
inline float getAsFloatBE() const noexcept { union { uint32 asInt; float asFloat; } n; n.asInt = ByteOrder::swap (*(uint32*) data); return n.asFloat; }
inline void setAsFloatBE (float newValue) noexcept { union { uint32 asInt; float asFloat; } n; n.asFloat = newValue; *(uint32*) data = ByteOrder::swap (n.asInt); }
#endif
inline int32 getAsInt32LE() const throw() { return (int32) roundToInt (jlimit (-1.0, 1.0, (double) getAsFloatLE()) * (double) maxValue); }
inline int32 getAsInt32BE() const throw() { return (int32) roundToInt (jlimit (-1.0, 1.0, (double) getAsFloatBE()) * (double) maxValue); }
inline void setAsInt32LE (int32 newValue) throw() { setAsFloatLE ((float) (newValue * (1.0 / (1.0 + maxValue)))); }
inline void setAsInt32BE (int32 newValue) throw() { setAsFloatBE ((float) (newValue * (1.0 / (1.0 + maxValue)))); }
inline void clear() throw() { *data = 0; }
inline void clearMultiple (int num) throw() { zeromem (data, num * bytesPerSample) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) throw() { setAsFloatLE (source.getAsFloat()); }
template <class SourceType> inline void copyFromBE (SourceType& source) throw() { setAsFloatBE (source.getAsFloat()); }
inline void copyFromSameType (Float32& source) throw() { *data = *source.data; }
inline int32 getAsInt32LE() const noexcept { return (int32) roundToInt (jlimit (-1.0, 1.0, (double) getAsFloatLE()) * (double) maxValue); }
inline int32 getAsInt32BE() const noexcept { return (int32) roundToInt (jlimit (-1.0, 1.0, (double) getAsFloatBE()) * (double) maxValue); }
inline void setAsInt32LE (int32 newValue) noexcept { setAsFloatLE ((float) (newValue * (1.0 / (1.0 + maxValue)))); }
inline void setAsInt32BE (int32 newValue) noexcept { setAsFloatBE ((float) (newValue * (1.0 / (1.0 + maxValue)))); }
inline void clear() noexcept { *data = 0; }
inline void clearMultiple (int num) noexcept { zeromem (data, num * bytesPerSample) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsFloatLE (source.getAsFloat()); }
template <class SourceType> inline void copyFromBE (SourceType& source) noexcept { setAsFloatBE (source.getAsFloat()); }
inline void copyFromSameType (Float32& source) noexcept { *data = *source.data; }
float* data;
enum { bytesPerSample = 4, maxValue = 0x7fffffff, resolution = (1 << 8), isFloat = 1 };
@@ -258,14 +258,14 @@ public:
class NonInterleaved
{
public:
inline NonInterleaved() throw() {}
inline NonInterleaved (const NonInterleaved&) throw() {}
inline NonInterleaved (const int) throw() {}
inline void copyFrom (const NonInterleaved&) throw() {}
template <class SampleFormatType> inline void advanceData (SampleFormatType& s) throw() { s.advance(); }
template <class SampleFormatType> inline void advanceDataBy (SampleFormatType& s, int numSamples) throw() { s.skip (numSamples); }
template <class SampleFormatType> inline void clear (SampleFormatType& s, int numSamples) throw() { s.clearMultiple (numSamples); }
template <class SampleFormatType> inline static int getNumBytesBetweenSamples (const SampleFormatType&) throw() { return SampleFormatType::bytesPerSample; }
inline NonInterleaved() noexcept {}
inline NonInterleaved (const NonInterleaved&) noexcept {}
inline NonInterleaved (const int) noexcept {}
inline void copyFrom (const NonInterleaved&) noexcept {}
template <class SampleFormatType> inline void advanceData (SampleFormatType& s) noexcept { s.advance(); }
template <class SampleFormatType> inline void advanceDataBy (SampleFormatType& s, int numSamples) noexcept { s.skip (numSamples); }
template <class SampleFormatType> inline void clear (SampleFormatType& s, int numSamples) noexcept { s.clearMultiple (numSamples); }
template <class SampleFormatType> inline static int getNumBytesBetweenSamples (const SampleFormatType&) noexcept { return SampleFormatType::bytesPerSample; }
enum { isInterleavedType = 0, numInterleavedChannels = 1 };
};
@@ -273,14 +273,14 @@ public:
class Interleaved
{
public:
inline Interleaved() throw() : numInterleavedChannels (1) {}
inline Interleaved (const Interleaved& other) throw() : numInterleavedChannels (other.numInterleavedChannels) {}
inline Interleaved (const int numInterleavedChannels_) throw() : numInterleavedChannels (numInterleavedChannels_) {}
inline void copyFrom (const Interleaved& other) throw() { numInterleavedChannels = other.numInterleavedChannels; }
template <class SampleFormatType> inline void advanceData (SampleFormatType& s) throw() { s.skip (numInterleavedChannels); }
template <class SampleFormatType> inline void advanceDataBy (SampleFormatType& s, int numSamples) throw() { s.skip (numInterleavedChannels * numSamples); }
template <class SampleFormatType> inline void clear (SampleFormatType& s, int numSamples) throw() { while (--numSamples >= 0) { s.clear(); s.skip (numInterleavedChannels); } }
template <class SampleFormatType> inline int getNumBytesBetweenSamples (const SampleFormatType&) const throw() { return numInterleavedChannels * SampleFormatType::bytesPerSample; }
inline Interleaved() noexcept : numInterleavedChannels (1) {}
inline Interleaved (const Interleaved& other) noexcept : numInterleavedChannels (other.numInterleavedChannels) {}
inline Interleaved (const int numInterleavedChannels_) noexcept : numInterleavedChannels (numInterleavedChannels_) {}
inline void copyFrom (const Interleaved& other) noexcept { numInterleavedChannels = other.numInterleavedChannels; }
template <class SampleFormatType> inline void advanceData (SampleFormatType& s) noexcept { s.skip (numInterleavedChannels); }
template <class SampleFormatType> inline void advanceDataBy (SampleFormatType& s, int numSamples) noexcept { s.skip (numInterleavedChannels * numSamples); }
template <class SampleFormatType> inline void clear (SampleFormatType& s, int numSamples) noexcept { while (--numSamples >= 0) { s.clear(); s.skip (numInterleavedChannels); } }
template <class SampleFormatType> inline int getNumBytesBetweenSamples (const SampleFormatType&) const noexcept { return numInterleavedChannels * SampleFormatType::bytesPerSample; }
int numInterleavedChannels;
enum { isInterleavedType = 1 };
};
@@ -290,7 +290,7 @@ public:
{
public:
typedef void VoidType;
static inline void* toVoidPtr (VoidType* v) throw() { return v; }
static inline void* toVoidPtr (VoidType* v) noexcept { return v; }
enum { isConst = 0 };
};
@@ -298,7 +298,7 @@ public:
{
public:
typedef const void VoidType;
static inline void* toVoidPtr (VoidType* v) throw() { return const_cast<void*> (v); }
static inline void* toVoidPtr (VoidType* v) noexcept { return const_cast<void*> (v); }
enum { isConst = 1 };
};
#endif
@@ -340,7 +340,7 @@ public:
This constructor is only used if you've specified the AudioData::NonInterleaved option -
for interleaved formats, use the constructor that also takes a number of channels.
*/
Pointer (typename Constness::VoidType* sourceData) throw()
Pointer (typename Constness::VoidType* sourceData) noexcept
: data (Constness::toVoidPtr (sourceData))
{
// If you're using interleaved data, call the other constructor! If you're using non-interleaved data,
@@ -351,20 +351,20 @@ public:
/** Creates a pointer from some raw data in the appropriate format with the specified number of interleaved channels.
For non-interleaved data, use the other constructor.
*/
Pointer (typename Constness::VoidType* sourceData, int numInterleavedChannels) throw()
Pointer (typename Constness::VoidType* sourceData, int numInterleavedChannels) noexcept
: data (Constness::toVoidPtr (sourceData)),
interleaving (numInterleavedChannels)
{
}
/** Creates a copy of another pointer. */
Pointer (const Pointer& other) throw()
Pointer (const Pointer& other) noexcept
: data (other.data),
interleaving (other.interleaving)
{
}
Pointer& operator= (const Pointer& other) throw()
Pointer& operator= (const Pointer& other) noexcept
{
data = other.data;
interleaving.copyFrom (other.interleaving);
@@ -376,7 +376,7 @@ public:
The value will be in the range -1.0 to 1.0 for integer formats. For floating point
formats, the value could be outside that range, although -1 to 1 is the standard range.
*/
inline float getAsFloat() const throw() { return Endianness::getAsFloat (data); }
inline float getAsFloat() const noexcept { return Endianness::getAsFloat (data); }
/** Sets the value of the first sample as a floating point value.
@@ -385,7 +385,7 @@ public:
range will be clipped. For floating point formats, any value passed in here will be
written directly, although -1 to 1 is the standard range.
*/
inline void setAsFloat (float newValue) throw()
inline void setAsFloat (float newValue) noexcept
{
static_jassert (Constness::isConst == 0); // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead!
Endianness::setAsFloat (data, newValue);
@@ -397,30 +397,30 @@ public:
by 8 bits when returned here). If the source data is floating point, values beyond -1.0 to 1.0 will
be clipped so that -1.0 maps onto -0x7fffffff and 1.0 maps to 0x7fffffff.
*/
inline int32 getAsInt32() const throw() { return Endianness::getAsInt32 (data); }
inline int32 getAsInt32() const noexcept { return Endianness::getAsInt32 (data); }
/** Sets the value of the first sample as a 32-bit integer.
This will be mapped to the range of the format that is being written - see getAsInt32().
*/
inline void setAsInt32 (int32 newValue) throw()
inline void setAsInt32 (int32 newValue) noexcept
{
static_jassert (Constness::isConst == 0); // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead!
Endianness::setAsInt32 (data, newValue);
}
/** Moves the pointer along to the next sample. */
inline Pointer& operator++() throw() { advance(); return *this; }
inline Pointer& operator++() noexcept { advance(); return *this; }
/** Moves the pointer back to the previous sample. */
inline Pointer& operator--() throw() { interleaving.advanceDataBy (data, -1); return *this; }
inline Pointer& operator--() noexcept { interleaving.advanceDataBy (data, -1); return *this; }
/** Adds a number of samples to the pointer's position. */
Pointer& operator+= (int samplesToJump) throw() { interleaving.advanceDataBy (data, samplesToJump); return *this; }
Pointer& operator+= (int samplesToJump) noexcept { interleaving.advanceDataBy (data, samplesToJump); return *this; }
/** Writes a stream of samples into this pointer from another pointer.
This will copy the specified number of samples, converting between formats appropriately.
*/
void convertSamples (Pointer source, int numSamples) const throw()
void convertSamples (Pointer source, int numSamples) const noexcept
{
static_jassert (Constness::isConst == 0); // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead!
@@ -437,7 +437,7 @@ public:
This will copy the specified number of samples, converting between formats appropriately.
*/
template <class OtherPointerType>
void convertSamples (OtherPointerType source, int numSamples) const throw()
void convertSamples (OtherPointerType source, int numSamples) const noexcept
{
static_jassert (Constness::isConst == 0); // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead!
@@ -463,36 +463,36 @@ public:
}
/** Sets a number of samples to zero. */
void clearSamples (int numSamples) const throw()
void clearSamples (int numSamples) const noexcept
{
Pointer dest (*this);
dest.interleaving.clear (dest.data, numSamples);
}
/** Returns true if the pointer is using a floating-point format. */
static bool isFloatingPoint() throw() { return (bool) SampleFormat::isFloat; }
static bool isFloatingPoint() noexcept { return (bool) SampleFormat::isFloat; }
/** Returns true if the format is big-endian. */
static bool isBigEndian() throw() { return (bool) Endianness::isBigEndian; }
static bool isBigEndian() noexcept { return (bool) Endianness::isBigEndian; }
/** Returns the number of bytes in each sample (ignoring the number of interleaved channels). */
static int getBytesPerSample() throw() { return (int) SampleFormat::bytesPerSample; }
static int getBytesPerSample() noexcept { return (int) SampleFormat::bytesPerSample; }
/** Returns the number of interleaved channels in the format. */
int getNumInterleavedChannels() const throw() { return (int) this->numInterleavedChannels; }
int getNumInterleavedChannels() const noexcept { return (int) this->numInterleavedChannels; }
/** Returns the number of bytes between the start address of each sample. */
int getNumBytesBetweenSamples() const throw() { return interleaving.getNumBytesBetweenSamples (data); }
int getNumBytesBetweenSamples() const noexcept { return interleaving.getNumBytesBetweenSamples (data); }
/** Returns the accuracy of this format when represented as a 32-bit integer.
This is the smallest number above 0 that can be represented in the sample format, converted to
a 32-bit range. E,g. if the format is 8-bit, its resolution is 0x01000000; if the format is 24-bit,
its resolution is 0x100.
*/
static int get32BitResolution() throw() { return (int) SampleFormat::resolution; }
static int get32BitResolution() noexcept { return (int) SampleFormat::resolution; }
/** Returns a pointer to the underlying data. */
const void* getRawData() const throw() { return data.data; }
const void* getRawData() const noexcept { return data.data; }
private:
//==============================================================================
@@ -500,7 +500,7 @@ public:
InterleavingType interleaving; // annoyingly, making the interleaving type a superclass to take
// advantage of EBCO causes an internal compiler error in VC6..
inline void advance() throw() { interleaving.advanceData (data); }
inline void advance() noexcept { interleaving.advanceData (data); }
Pointer operator++ (int); // private to force you to use the more efficient pre-increment!
Pointer operator-- (int);


+ 38
- 38
src/audio/dsp/juce_AudioSampleBuffer.cpp View File

@@ -34,7 +34,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
AudioSampleBuffer::AudioSampleBuffer (const int numChannels_,
const int numSamples) throw()
const int numSamples) noexcept
: numChannels (numChannels_),
size (numSamples)
{
@@ -44,7 +44,7 @@ AudioSampleBuffer::AudioSampleBuffer (const int numChannels_,
allocateData();
}
AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) throw()
AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) noexcept
: numChannels (other.numChannels),
size (other.size)
{
@@ -74,7 +74,7 @@ void AudioSampleBuffer::allocateData()
AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo,
const int numChannels_,
const int numSamples) throw()
const int numSamples) noexcept
: numChannels (numChannels_),
size (numSamples),
allocatedBytes (0)
@@ -86,7 +86,7 @@ AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo,
AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo,
const int numChannels_,
const int startSample,
const int numSamples) throw()
const int numSamples) noexcept
: numChannels (numChannels_),
size (numSamples),
allocatedBytes (0)
@@ -97,7 +97,7 @@ AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo,
void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo,
const int newNumChannels,
const int newNumSamples) throw()
const int newNumSamples) noexcept
{
jassert (newNumChannels > 0);
@@ -126,7 +126,7 @@ void AudioSampleBuffer::allocateChannels (float** const dataToReferTo, int offse
for (int i = 0; i < numChannels; ++i)
{
// you have to pass in the same number of valid pointers as numChannels
jassert (dataToReferTo[i] != 0);
jassert (dataToReferTo[i] != nullptr);
channels[i] = dataToReferTo[i] + offset;
}
@@ -134,7 +134,7 @@ void AudioSampleBuffer::allocateChannels (float** const dataToReferTo, int offse
channels [numChannels] = 0;
}
AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& other) throw()
AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& other) noexcept
{
if (this != &other)
{
@@ -149,7 +149,7 @@ AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& other)
return *this;
}
AudioSampleBuffer::~AudioSampleBuffer() throw()
AudioSampleBuffer::~AudioSampleBuffer() noexcept
{
}
@@ -157,7 +157,7 @@ void AudioSampleBuffer::setSize (const int newNumChannels,
const int newNumSamples,
const bool keepExistingContent,
const bool clearExtraSpace,
const bool avoidReallocating) throw()
const bool avoidReallocating) noexcept
{
jassert (newNumChannels > 0);
@@ -215,14 +215,14 @@ void AudioSampleBuffer::setSize (const int newNumChannels,
}
}
void AudioSampleBuffer::clear() throw()
void AudioSampleBuffer::clear() noexcept
{
for (int i = 0; i < numChannels; ++i)
zeromem (channels[i], size * sizeof (float));
}
void AudioSampleBuffer::clear (const int startSample,
const int numSamples) throw()
const int numSamples) noexcept
{
jassert (startSample >= 0 && startSample + numSamples <= size);
@@ -232,7 +232,7 @@ void AudioSampleBuffer::clear (const int startSample,
void AudioSampleBuffer::clear (const int channel,
const int startSample,
const int numSamples) throw()
const int numSamples) noexcept
{
jassert (isPositiveAndBelow (channel, numChannels));
jassert (startSample >= 0 && startSample + numSamples <= size);
@@ -243,7 +243,7 @@ void AudioSampleBuffer::clear (const int channel,
void AudioSampleBuffer::applyGain (const int channel,
const int startSample,
int numSamples,
const float gain) throw()
const float gain) noexcept
{
jassert (isPositiveAndBelow (channel, numChannels));
jassert (startSample >= 0 && startSample + numSamples <= size);
@@ -268,7 +268,7 @@ void AudioSampleBuffer::applyGainRamp (const int channel,
const int startSample,
int numSamples,
float startGain,
float endGain) throw()
float endGain) noexcept
{
if (startGain == endGain)
{
@@ -292,7 +292,7 @@ void AudioSampleBuffer::applyGainRamp (const int channel,
void AudioSampleBuffer::applyGain (const int startSample,
const int numSamples,
const float gain) throw()
const float gain) noexcept
{
for (int i = 0; i < numChannels; ++i)
applyGain (i, startSample, numSamples, gain);
@@ -304,7 +304,7 @@ void AudioSampleBuffer::addFrom (const int destChannel,
const int sourceChannel,
const int sourceStartSample,
int numSamples,
const float gain) throw()
const float gain) noexcept
{
jassert (&source != this || sourceChannel != destChannel);
jassert (isPositiveAndBelow (destChannel, numChannels));
@@ -334,11 +334,11 @@ void AudioSampleBuffer::addFrom (const int destChannel,
const int destStartSample,
const float* source,
int numSamples,
const float gain) throw()
const float gain) noexcept
{
jassert (isPositiveAndBelow (destChannel, numChannels));
jassert (destStartSample >= 0 && destStartSample + numSamples <= size);
jassert (source != 0);
jassert (source != nullptr);
if (gain != 0.0f && numSamples > 0)
{
@@ -362,11 +362,11 @@ void AudioSampleBuffer::addFromWithRamp (const int destChannel,
const float* source,
int numSamples,
float startGain,
const float endGain) throw()
const float endGain) noexcept
{
jassert (isPositiveAndBelow (destChannel, numChannels));
jassert (destStartSample >= 0 && destStartSample + numSamples <= size);
jassert (source != 0);
jassert (source != nullptr);
if (startGain == endGain)
{
@@ -397,7 +397,7 @@ void AudioSampleBuffer::copyFrom (const int destChannel,
const AudioSampleBuffer& source,
const int sourceChannel,
const int sourceStartSample,
int numSamples) throw()
int numSamples) noexcept
{
jassert (&source != this || sourceChannel != destChannel);
jassert (isPositiveAndBelow (destChannel, numChannels));
@@ -416,11 +416,11 @@ void AudioSampleBuffer::copyFrom (const int destChannel,
void AudioSampleBuffer::copyFrom (const int destChannel,
const int destStartSample,
const float* source,
int numSamples) throw()
int numSamples) noexcept
{
jassert (isPositiveAndBelow (destChannel, numChannels));
jassert (destStartSample >= 0 && destStartSample + numSamples <= size);
jassert (source != 0);
jassert (source != nullptr);
if (numSamples > 0)
{
@@ -434,11 +434,11 @@ void AudioSampleBuffer::copyFrom (const int destChannel,
const int destStartSample,
const float* source,
int numSamples,
const float gain) throw()
const float gain) noexcept
{
jassert (isPositiveAndBelow (destChannel, numChannels));
jassert (destStartSample >= 0 && destStartSample + numSamples <= size);
jassert (source != 0);
jassert (source != nullptr);
if (numSamples > 0)
{
@@ -468,11 +468,11 @@ void AudioSampleBuffer::copyFromWithRamp (const int destChannel,
const float* source,
int numSamples,
float startGain,
float endGain) throw()
float endGain) noexcept
{
jassert (isPositiveAndBelow (destChannel, numChannels));
jassert (destStartSample >= 0 && destStartSample + numSamples <= size);
jassert (source != 0);
jassert (source != nullptr);
if (startGain == endGain)
{
@@ -502,7 +502,7 @@ void AudioSampleBuffer::findMinMax (const int channel,
const int startSample,
int numSamples,
float& minVal,
float& maxVal) const throw()
float& maxVal) const noexcept
{
jassert (isPositiveAndBelow (channel, numChannels));
jassert (startSample >= 0 && startSample + numSamples <= size);
@@ -512,7 +512,7 @@ void AudioSampleBuffer::findMinMax (const int channel,
float AudioSampleBuffer::getMagnitude (const int channel,
const int startSample,
const int numSamples) const throw()
const int numSamples) const noexcept
{
jassert (isPositiveAndBelow (channel, numChannels));
jassert (startSample >= 0 && startSample + numSamples <= size);
@@ -524,7 +524,7 @@ float AudioSampleBuffer::getMagnitude (const int channel,
}
float AudioSampleBuffer::getMagnitude (const int startSample,
const int numSamples) const throw()
const int numSamples) const noexcept
{
float mag = 0.0f;
@@ -536,7 +536,7 @@ float AudioSampleBuffer::getMagnitude (const int startSample,
float AudioSampleBuffer::getRMSLevel (const int channel,
const int startSample,
const int numSamples) const throw()
const int numSamples) const noexcept
{
jassert (isPositiveAndBelow (channel, numChannels));
jassert (startSample >= 0 && startSample + numSamples <= size);
@@ -563,7 +563,7 @@ void AudioSampleBuffer::readFromAudioReader (AudioFormatReader* reader,
const bool useLeftChan,
const bool useRightChan)
{
jassert (reader != 0);
jassert (reader != nullptr);
jassert (startSample >= 0 && startSample + numSamples <= size);
if (numSamples > 0)
@@ -578,15 +578,15 @@ void AudioSampleBuffer::readFromAudioReader (AudioFormatReader* reader,
else if (useLeftChan || (reader->numChannels == 1))
{
chans[0] = reinterpret_cast<int*> (getSampleData (0, startSample));
chans[1] = 0;
chans[1] = nullptr;
}
else if (useRightChan)
{
chans[0] = 0;
chans[0] = nullptr;
chans[1] = reinterpret_cast<int*> (getSampleData (0, startSample));
}
chans[2] = 0;
chans[2] = nullptr;
reader->read (chans, 2, readerStartSample, numSamples, true);
@@ -596,7 +596,7 @@ void AudioSampleBuffer::readFromAudioReader (AudioFormatReader* reader,
{
float* const d = reinterpret_cast <float*> (chans[j]);
if (d != 0)
if (d != nullptr)
{
const float multiplier = 1.0f / 0x7fffffff;
@@ -606,7 +606,7 @@ void AudioSampleBuffer::readFromAudioReader (AudioFormatReader* reader,
}
}
if (numChannels > 1 && (chans[0] == 0 || chans[1] == 0))
if (numChannels > 1 && (chans[0] == nullptr || chans[1] == nullptr))
{
// if this is a stereo buffer and the source was mono, dupe the first channel..
memcpy (getSampleData (1, startSample),
@@ -620,7 +620,7 @@ void AudioSampleBuffer::writeToAudioWriter (AudioFormatWriter* writer,
const int startSample,
const int numSamples) const
{
jassert (writer != 0);
jassert (writer != nullptr);
writer->writeFromAudioSampleBuffer (*this, startSample, numSamples);
}


+ 30
- 30
src/audio/dsp/juce_AudioSampleBuffer.h View File

@@ -49,7 +49,7 @@ public:
when the buffer is deleted.
*/
AudioSampleBuffer (int numChannels,
int numSamples) throw();
int numSamples) noexcept;
/** Creates a buffer using a pre-allocated block of memory.
@@ -68,7 +68,7 @@ public:
*/
AudioSampleBuffer (float** dataToReferTo,
int numChannels,
int numSamples) throw();
int numSamples) noexcept;
/** Creates a buffer using a pre-allocated block of memory.
@@ -89,7 +89,7 @@ public:
AudioSampleBuffer (float** dataToReferTo,
int numChannels,
int startSample,
int numSamples) throw();
int numSamples) noexcept;
/** Copies another buffer.
@@ -97,39 +97,39 @@ public:
using an external data buffer, in which case boths buffers will just point to the same
shared block of data.
*/
AudioSampleBuffer (const AudioSampleBuffer& other) throw();
AudioSampleBuffer (const AudioSampleBuffer& other) noexcept;
/** Copies another buffer onto this one.
This buffer's size will be changed to that of the other buffer.
*/
AudioSampleBuffer& operator= (const AudioSampleBuffer& other) throw();
AudioSampleBuffer& operator= (const AudioSampleBuffer& other) noexcept;
/** Destructor.
This will free any memory allocated by the buffer.
*/
virtual ~AudioSampleBuffer() throw();
virtual ~AudioSampleBuffer() noexcept;
//==============================================================================
/** Returns the number of channels of audio data that this buffer contains.
@see getSampleData
*/
int getNumChannels() const throw() { return numChannels; }
int getNumChannels() const noexcept { return numChannels; }
/** Returns the number of samples allocated in each of the buffer's channels.
@see getSampleData
*/
int getNumSamples() const throw() { return size; }
int getNumSamples() const noexcept { return size; }
/** Returns a pointer one of the buffer's channels.
For speed, this doesn't check whether the channel number is out of range,
so be careful when using it!
*/
float* getSampleData (const int channelNumber) const throw()
float* getSampleData (const int channelNumber) const noexcept
{
jassert (isPositiveAndBelow (channelNumber, numChannels));
return channels [channelNumber];
@@ -141,7 +141,7 @@ public:
are out-of-range, so be careful when using it!
*/
float* getSampleData (const int channelNumber,
const int sampleOffset) const throw()
const int sampleOffset) const noexcept
{
jassert (isPositiveAndBelow (channelNumber, numChannels));
jassert (isPositiveAndBelow (sampleOffset, size));
@@ -153,7 +153,7 @@ public:
Don't modify any of the pointers that are returned, and bear in mind that
these will become invalid if the buffer is resized.
*/
float** getArrayOfChannels() const throw() { return channels; }
float** getArrayOfChannels() const noexcept { return channels; }
//==============================================================================
/** Changes the buffer's size or number of channels.
@@ -177,7 +177,7 @@ public:
int newNumSamples,
bool keepExistingContent = false,
bool clearExtraSpace = false,
bool avoidReallocating = false) throw();
bool avoidReallocating = false) noexcept;
/** Makes this buffer point to a pre-allocated set of channel data arrays.
@@ -200,11 +200,11 @@ public:
*/
void setDataToReferTo (float** dataToReferTo,
int numChannels,
int numSamples) throw();
int numSamples) noexcept;
//==============================================================================
/** Clears all the samples in all channels. */
void clear() throw();
void clear() noexcept;
/** Clears a specified region of all the channels.
@@ -212,7 +212,7 @@ public:
are in-range, so be careful!
*/
void clear (int startSample,
int numSamples) throw();
int numSamples) noexcept;
/** Clears a specified region of just one channel.
@@ -221,7 +221,7 @@ public:
*/
void clear (int channel,
int startSample,
int numSamples) throw();
int numSamples) noexcept;
/** Applies a gain multiple to a region of one channel.
@@ -231,7 +231,7 @@ public:
void applyGain (int channel,
int startSample,
int numSamples,
float gain) throw();
float gain) noexcept;
/** Applies a gain multiple to a region of all the channels.
@@ -240,7 +240,7 @@ public:
*/
void applyGain (int startSample,
int numSamples,
float gain) throw();
float gain) noexcept;
/** Applies a range of gains to a region of a channel.
@@ -255,7 +255,7 @@ public:
int startSample,
int numSamples,
float startGain,
float endGain) throw();
float endGain) noexcept;
/** Adds samples from another buffer to this one.
@@ -276,7 +276,7 @@ public:
int sourceChannel,
int sourceStartSample,
int numSamples,
float gainToApplyToSource = 1.0f) throw();
float gainToApplyToSource = 1.0f) noexcept;
/** Adds samples from an array of floats to one of the channels.
@@ -293,7 +293,7 @@ public:
int destStartSample,
const float* source,
int numSamples,
float gainToApplyToSource = 1.0f) throw();
float gainToApplyToSource = 1.0f) noexcept;
/** Adds samples from an array of floats, applying a gain ramp to them.
@@ -311,7 +311,7 @@ public:
const float* source,
int numSamples,
float startGain,
float endGain) throw();
float endGain) noexcept;
/** Copies samples from another buffer to this one.
@@ -329,7 +329,7 @@ public:
const AudioSampleBuffer& source,
int sourceChannel,
int sourceStartSample,
int numSamples) throw();
int numSamples) noexcept;
/** Copies samples from an array of floats into one of the channels.
@@ -343,7 +343,7 @@ public:
void copyFrom (int destChannel,
int destStartSample,
const float* source,
int numSamples) throw();
int numSamples) noexcept;
/** Copies samples from an array of floats into one of the channels, applying a gain to it.
@@ -359,7 +359,7 @@ public:
int destStartSample,
const float* source,
int numSamples,
float gain) throw();
float gain) noexcept;
/** Copies samples from an array of floats into one of the channels, applying a gain ramp.
@@ -379,7 +379,7 @@ public:
const float* source,
int numSamples,
float startGain,
float endGain) throw();
float endGain) noexcept;
/** Finds the highest and lowest sample values in a given range.
@@ -394,24 +394,24 @@ public:
int startSample,
int numSamples,
float& minVal,
float& maxVal) const throw();
float& maxVal) const noexcept;
/** Finds the highest absolute sample value within a region of a channel.
*/
float getMagnitude (int channel,
int startSample,
int numSamples) const throw();
int numSamples) const noexcept;
/** Finds the highest absolute sample value within a region on all channels.
*/
float getMagnitude (int startSample,
int numSamples) const throw();
int numSamples) const noexcept;
/** Returns the root mean squared level for a region of a channel.
*/
float getRMSLevel (int channel,
int startSample,
int numSamples) const throw();
int numSamples) const noexcept;
//==============================================================================
/** Fills a section of the buffer using an AudioReader as its source.


+ 15
- 15
src/audio/dsp/juce_IIRFilter.cpp View File

@@ -50,7 +50,7 @@ IIRFilter::~IIRFilter()
}
//==============================================================================
void IIRFilter::reset() throw()
void IIRFilter::reset() noexcept
{
const ScopedLock sl (processLock);
@@ -60,7 +60,7 @@ void IIRFilter::reset() throw()
y2 = 0;
}
float IIRFilter::processSingleSampleRaw (const float in) throw()
float IIRFilter::processSingleSampleRaw (const float in) noexcept
{
float out = coefficients[0] * in
+ coefficients[1] * x1
@@ -68,10 +68,10 @@ float IIRFilter::processSingleSampleRaw (const float in) throw()
- coefficients[4] * y1
- coefficients[5] * y2;
#if JUCE_INTEL
#if JUCE_INTEL
if (! (out < -1.0e-8 || out > 1.0e-8))
out = 0;
#endif
#endif
x2 = x1;
x1 = in;
@@ -82,7 +82,7 @@ float IIRFilter::processSingleSampleRaw (const float in) throw()
}
void IIRFilter::processSamples (float* const samples,
const int numSamples) throw()
const int numSamples) noexcept
{
const ScopedLock sl (processLock);
@@ -98,10 +98,10 @@ void IIRFilter::processSamples (float* const samples,
- coefficients[4] * y1
- coefficients[5] * y2;
#if JUCE_INTEL
#if JUCE_INTEL
if (! (out < -1.0e-8 || out > 1.0e-8))
out = 0;
#endif
#endif
x2 = x1;
x1 = in;
@@ -115,7 +115,7 @@ void IIRFilter::processSamples (float* const samples,
//==============================================================================
void IIRFilter::makeLowPass (const double sampleRate,
const double frequency) throw()
const double frequency) noexcept
{
jassert (sampleRate > 0);
@@ -132,7 +132,7 @@ void IIRFilter::makeLowPass (const double sampleRate,
}
void IIRFilter::makeHighPass (const double sampleRate,
const double frequency) throw()
const double frequency) noexcept
{
const double n = tan (double_Pi * frequency / sampleRate);
const double nSquared = n * n;
@@ -149,7 +149,7 @@ void IIRFilter::makeHighPass (const double sampleRate,
void IIRFilter::makeLowShelf (const double sampleRate,
const double cutOffFrequency,
const double Q,
const float gainFactor) throw()
const float gainFactor) noexcept
{
jassert (sampleRate > 0);
jassert (Q > 0);
@@ -173,7 +173,7 @@ void IIRFilter::makeLowShelf (const double sampleRate,
void IIRFilter::makeHighShelf (const double sampleRate,
const double cutOffFrequency,
const double Q,
const float gainFactor) throw()
const float gainFactor) noexcept
{
jassert (sampleRate > 0);
jassert (Q > 0);
@@ -197,7 +197,7 @@ void IIRFilter::makeHighShelf (const double sampleRate,
void IIRFilter::makeBandPass (const double sampleRate,
const double centreFrequency,
const double Q,
const float gainFactor) throw()
const float gainFactor) noexcept
{
jassert (sampleRate > 0);
jassert (Q > 0);
@@ -217,14 +217,14 @@ void IIRFilter::makeBandPass (const double sampleRate,
1.0 - alphaOverA);
}
void IIRFilter::makeInactive() throw()
void IIRFilter::makeInactive() noexcept
{
const ScopedLock sl (processLock);
active = false;
}
//==============================================================================
void IIRFilter::copyCoefficientsFrom (const IIRFilter& other) throw()
void IIRFilter::copyCoefficientsFrom (const IIRFilter& other) noexcept
{
const ScopedLock sl (processLock);
@@ -234,7 +234,7 @@ void IIRFilter::copyCoefficientsFrom (const IIRFilter& other) throw()
//==============================================================================
void IIRFilter::setCoefficients (double c1, double c2, double c3,
double c4, double c5, double c6) throw()
double c4, double c5, double c6) noexcept
{
const double a = 1.0 / c4;


+ 11
- 11
src/audio/dsp/juce_IIRFilter.h View File

@@ -61,30 +61,30 @@ public:
its coefficients aren't changed. To put a filter into an inactive state, use
the makeInactive() method.
*/
void reset() throw();
void reset() noexcept;
/** Performs the filter operation on the given set of samples.
*/
void processSamples (float* samples,
int numSamples) throw();
int numSamples) noexcept;
/** Processes a single sample, without any locking or checking.
Use this if you need fast processing of a single value, but be aware that
this isn't thread-safe in the way that processSamples() is.
*/
float processSingleSampleRaw (float sample) throw();
float processSingleSampleRaw (float sample) noexcept;
//==============================================================================
/** Sets the filter up to act as a low-pass filter.
*/
void makeLowPass (double sampleRate,
double frequency) throw();
double frequency) noexcept;
/** Sets the filter up to act as a high-pass filter.
*/
void makeHighPass (double sampleRate,
double frequency) throw();
double frequency) noexcept;
//==============================================================================
/** Sets the filter up to act as a low-pass shelf filter with variable Q and gain.
@@ -96,7 +96,7 @@ public:
void makeLowShelf (double sampleRate,
double cutOffFrequency,
double Q,
float gainFactor) throw();
float gainFactor) noexcept;
/** Sets the filter up to act as a high-pass shelf filter with variable Q and gain.
@@ -107,7 +107,7 @@ public:
void makeHighShelf (double sampleRate,
double cutOffFrequency,
double Q,
float gainFactor) throw();
float gainFactor) noexcept;
/** Sets the filter up to act as a band pass filter centred around a
frequency, with a variable Q and gain.
@@ -119,16 +119,16 @@ public:
void makeBandPass (double sampleRate,
double centreFrequency,
double Q,
float gainFactor) throw();
float gainFactor) noexcept;
/** Clears the filter's coefficients so that it becomes inactive.
*/
void makeInactive() throw();
void makeInactive() noexcept;
//==============================================================================
/** Makes this filter duplicate the set-up of another one.
*/
void copyCoefficientsFrom (const IIRFilter& other) throw();
void copyCoefficientsFrom (const IIRFilter& other) noexcept;
protected:
@@ -136,7 +136,7 @@ protected:
CriticalSection processLock;
void setCoefficients (double c1, double c2, double c3,
double c4, double c5, double c6) throw();
double c4, double c5, double c6) noexcept;
bool active;
float coefficients[6];


+ 21
- 21
src/audio/midi/juce_MidiBuffer.cpp View File

@@ -31,24 +31,24 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
MidiBuffer::MidiBuffer() throw()
MidiBuffer::MidiBuffer() noexcept
: bytesUsed (0)
{
}
MidiBuffer::MidiBuffer (const MidiMessage& message) throw()
MidiBuffer::MidiBuffer (const MidiMessage& message) noexcept
: bytesUsed (0)
{
addEvent (message, 0);
}
MidiBuffer::MidiBuffer (const MidiBuffer& other) throw()
MidiBuffer::MidiBuffer (const MidiBuffer& other) noexcept
: data (other.data),
bytesUsed (other.bytesUsed)
{
}
MidiBuffer& MidiBuffer::operator= (const MidiBuffer& other) throw()
MidiBuffer& MidiBuffer::operator= (const MidiBuffer& other) noexcept
{
bytesUsed = other.bytesUsed;
data = other.data;
@@ -56,7 +56,7 @@ MidiBuffer& MidiBuffer::operator= (const MidiBuffer& other) throw()
return *this;
}
void MidiBuffer::swapWith (MidiBuffer& other) throw()
void MidiBuffer::swapWith (MidiBuffer& other) noexcept
{
data.swapWith (other.data);
std::swap (bytesUsed, other.bytesUsed);
@@ -66,27 +66,27 @@ MidiBuffer::~MidiBuffer()
{
}
inline uint8* MidiBuffer::getData() const throw()
inline uint8* MidiBuffer::getData() const noexcept
{
return static_cast <uint8*> (data.getData());
}
inline int MidiBuffer::getEventTime (const void* const d) throw()
inline int MidiBuffer::getEventTime (const void* const d) noexcept
{
return *static_cast <const int*> (d);
}
inline uint16 MidiBuffer::getEventDataSize (const void* const d) throw()
inline uint16 MidiBuffer::getEventDataSize (const void* const d) noexcept
{
return *reinterpret_cast <const uint16*> (static_cast <const char*> (d) + sizeof (int));
}
inline uint16 MidiBuffer::getEventTotalSize (const void* const d) throw()
inline uint16 MidiBuffer::getEventTotalSize (const void* const d) noexcept
{
return getEventDataSize (d) + sizeof (int) + sizeof (uint16);
}
void MidiBuffer::clear() throw()
void MidiBuffer::clear() noexcept
{
bytesUsed = 0;
}
@@ -114,7 +114,7 @@ void MidiBuffer::addEvent (const MidiMessage& m, const int sampleNumber)
namespace MidiBufferHelpers
{
int findActualEventLength (const uint8* const data, const int maxBytes) throw()
int findActualEventLength (const uint8* const data, const int maxBytes) noexcept
{
unsigned int byte = (unsigned int) *data;
int size = 0;
@@ -193,12 +193,12 @@ void MidiBuffer::ensureSize (size_t minimumNumBytes)
data.ensureSize (minimumNumBytes);
}
bool MidiBuffer::isEmpty() const throw()
bool MidiBuffer::isEmpty() const noexcept
{
return bytesUsed == 0;
}
int MidiBuffer::getNumEvents() const throw()
int MidiBuffer::getNumEvents() const noexcept
{
int n = 0;
const uint8* d = getData();
@@ -213,12 +213,12 @@ int MidiBuffer::getNumEvents() const throw()
return n;
}
int MidiBuffer::getFirstEventTime() const throw()
int MidiBuffer::getFirstEventTime() const noexcept
{
return bytesUsed > 0 ? getEventTime (data.getData()) : 0;
}
int MidiBuffer::getLastEventTime() const throw()
int MidiBuffer::getLastEventTime() const noexcept
{
if (bytesUsed == 0)
return 0;
@@ -237,7 +237,7 @@ int MidiBuffer::getLastEventTime() const throw()
}
}
uint8* MidiBuffer::findEventAfter (uint8* d, const int samplePosition) const throw()
uint8* MidiBuffer::findEventAfter (uint8* d, const int samplePosition) const noexcept
{
const uint8* const endData = getData() + bytesUsed;
@@ -248,18 +248,18 @@ uint8* MidiBuffer::findEventAfter (uint8* d, const int samplePosition) const thr
}
//==============================================================================
MidiBuffer::Iterator::Iterator (const MidiBuffer& buffer_) throw()
MidiBuffer::Iterator::Iterator (const MidiBuffer& buffer_) noexcept
: buffer (buffer_),
data (buffer_.getData())
{
}
MidiBuffer::Iterator::~Iterator() throw()
MidiBuffer::Iterator::~Iterator() noexcept
{
}
//==============================================================================
void MidiBuffer::Iterator::setNextSamplePosition (const int samplePosition) throw()
void MidiBuffer::Iterator::setNextSamplePosition (const int samplePosition) noexcept
{
data = buffer.getData();
const uint8* dataEnd = data + buffer.bytesUsed;
@@ -268,7 +268,7 @@ void MidiBuffer::Iterator::setNextSamplePosition (const int samplePosition) thro
data += getEventTotalSize (data);
}
bool MidiBuffer::Iterator::getNextEvent (const uint8* &midiData, int& numBytes, int& samplePosition) throw()
bool MidiBuffer::Iterator::getNextEvent (const uint8* &midiData, int& numBytes, int& samplePosition) noexcept
{
if (data >= buffer.getData() + buffer.bytesUsed)
return false;
@@ -282,7 +282,7 @@ bool MidiBuffer::Iterator::getNextEvent (const uint8* &midiData, int& numBytes,
return true;
}
bool MidiBuffer::Iterator::getNextEvent (MidiMessage& result, int& samplePosition) throw()
bool MidiBuffer::Iterator::getNextEvent (MidiMessage& result, int& samplePosition) noexcept
{
if (data >= buffer.getData() + buffer.bytesUsed)
return false;


+ 20
- 20
src/audio/midi/juce_MidiBuffer.h View File

@@ -44,23 +44,23 @@ class JUCE_API MidiBuffer
public:
//==============================================================================
/** Creates an empty MidiBuffer. */
MidiBuffer() throw();
MidiBuffer() noexcept;
/** Creates a MidiBuffer containing a single midi message. */
explicit MidiBuffer (const MidiMessage& message) throw();
explicit MidiBuffer (const MidiMessage& message) noexcept;
/** Creates a copy of another MidiBuffer. */
MidiBuffer (const MidiBuffer& other) throw();
MidiBuffer (const MidiBuffer& other) noexcept;
/** Makes a copy of another MidiBuffer. */
MidiBuffer& operator= (const MidiBuffer& other) throw();
MidiBuffer& operator= (const MidiBuffer& other) noexcept;
/** Destructor */
~MidiBuffer();
//==============================================================================
/** Removes all events from the buffer. */
void clear() throw();
void clear() noexcept;
/** Removes all events between two times from the buffer.
@@ -73,7 +73,7 @@ public:
To actually retrieve the events, use a MidiBuffer::Iterator object
*/
bool isEmpty() const throw();
bool isEmpty() const noexcept;
/** Counts the number of events in the buffer.
@@ -81,7 +81,7 @@ public:
the events, so you might prefer to call isEmpty() if that's all you need
to know.
*/
int getNumEvents() const throw();
int getNumEvents() const noexcept;
/** Adds an event to the buffer.
@@ -139,13 +139,13 @@ public:
If the buffer's empty, this will just return 0.
*/
int getFirstEventTime() const throw();
int getFirstEventTime() const noexcept;
/** Returns the sample number of the last event in the buffer.
If the buffer's empty, this will just return 0.
*/
int getLastEventTime() const throw();
int getLastEventTime() const noexcept;
//==============================================================================
/** Exchanges the contents of this buffer with another one.
@@ -153,7 +153,7 @@ public:
This is a quick operation, because no memory allocating or copying is done, it
just swaps the internal state of the two buffers.
*/
void swapWith (MidiBuffer& other) throw();
void swapWith (MidiBuffer& other) noexcept;
/** Preallocates some memory for the buffer to use.
This helps to avoid needing to reallocate space when the buffer has messages
@@ -175,16 +175,16 @@ public:
public:
//==============================================================================
/** Creates an Iterator for this MidiBuffer. */
Iterator (const MidiBuffer& buffer) throw();
Iterator (const MidiBuffer& buffer) noexcept;
/** Destructor. */
~Iterator() throw();
~Iterator() noexcept;
//==============================================================================
/** 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 (int samplePosition) throw();
void setNextSamplePosition (int samplePosition) noexcept;
/** Retrieves a copy of the next event from the buffer.
@@ -195,7 +195,7 @@ public:
the end of the buffer
*/
bool getNextEvent (MidiMessage& result,
int& samplePosition) throw();
int& samplePosition) noexcept;
/** Retrieves the next event from the buffer.
@@ -211,7 +211,7 @@ public:
*/
bool getNextEvent (const uint8* &midiData,
int& numBytesOfMidiData,
int& samplePosition) throw();
int& samplePosition) noexcept;
private:
//==============================================================================
@@ -227,11 +227,11 @@ private:
MemoryBlock data;
int bytesUsed;
uint8* getData() 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();
uint8* getData() const noexcept;
uint8* findEventAfter (uint8* d, int samplePosition) const noexcept;
static int getEventTime (const void* d) noexcept;
static uint16 getEventDataSize (const void* d) noexcept;
static uint16 getEventTotalSize (const void* d) noexcept;
JUCE_LEAK_DETECTOR (MidiBuffer);
};


+ 7
- 7
src/audio/midi/juce_MidiFile.cpp View File

@@ -55,7 +55,7 @@ namespace MidiFileHelpers
}
}
bool parseMidiHeader (const uint8* &data, short& timeFormat, short& fileType, short& numberOfTracks) throw()
bool parseMidiHeader (const uint8* &data, short& timeFormat, short& fileType, short& numberOfTracks) noexcept
{
unsigned int ch = (int) ByteOrder::bigEndianInt (data);
data += 4;
@@ -164,7 +164,7 @@ namespace MidiFileHelpers
struct Sorter
{
static int compareElements (const MidiMessageSequence::MidiEventHolder* const first,
const MidiMessageSequence::MidiEventHolder* const second) throw()
const MidiMessageSequence::MidiEventHolder* const second) noexcept
{
const double diff = (first->message.getTimeStamp() - second->message.getTimeStamp());
@@ -199,12 +199,12 @@ void MidiFile::clear()
}
//==============================================================================
int MidiFile::getNumTracks() const throw()
int MidiFile::getNumTracks() const noexcept
{
return tracks.size();
}
const MidiMessageSequence* MidiFile::getTrack (const int index) const throw()
const MidiMessageSequence* MidiFile::getTrack (const int index) const noexcept
{
return tracks [index];
}
@@ -215,18 +215,18 @@ void MidiFile::addTrack (const MidiMessageSequence& trackSequence)
}
//==============================================================================
short MidiFile::getTimeFormat() const throw()
short MidiFile::getTimeFormat() const noexcept
{
return timeFormat;
}
void MidiFile::setTicksPerQuarterNote (const int ticks) throw()
void MidiFile::setTicksPerQuarterNote (const int ticks) noexcept
{
timeFormat = (short) ticks;
}
void MidiFile::setSmpteTimeFormat (const int framesPerSecond,
const int subframeResolution) throw()
const int subframeResolution) noexcept
{
timeFormat = (short) (((-framesPerSecond) << 8) | subframeResolution);
}


+ 5
- 5
src/audio/midi/juce_MidiFile.h View File

@@ -60,14 +60,14 @@ public:
@see getTrack, addTrack
*/
int getNumTracks() const throw();
int getNumTracks() const noexcept;
/** Returns a pointer to one of the tracks in the file.
@returns a pointer to the track, or 0 if the index is out-of-range
@see getNumTracks, addTrack
*/
const MidiMessageSequence* getTrack (int index) const throw();
const MidiMessageSequence* getTrack (int index) const noexcept;
/** Adds a midi track to the file.
@@ -95,7 +95,7 @@ public:
It it's negative, the upper byte indicates the frames-per-second (but negative), and
the lower byte is the number of ticks per frame - see setSmpteTimeFormat().
*/
short getTimeFormat() const throw();
short getTimeFormat() const noexcept;
/** Sets the time format to use when this file is written to a stream.
@@ -106,7 +106,7 @@ public:
@param ticksPerQuarterNote e.g. 96, 960
@see setSmpteTimeFormat
*/
void setTicksPerQuarterNote (int ticksPerQuarterNote) throw();
void setTicksPerQuarterNote (int ticksPerQuarterNote) noexcept;
/** Sets the time format to use when this file is written to a stream.
@@ -121,7 +121,7 @@ public:
@see setTicksPerBeat
*/
void setSmpteTimeFormat (int framesPerSecond,
int subframeResolution) throw();
int subframeResolution) noexcept;
//==============================================================================
/** Makes a list of all the tempo-change meta-events from all tracks in the midi file.


+ 2
- 2
src/audio/midi/juce_MidiInput.h View File

@@ -146,12 +146,12 @@ public:
/** Returns the name of this device.
*/
virtual const String getName() const throw() { return name; }
virtual const String getName() const noexcept { return name; }
/** Allows you to set a custom name for the device, in case you don't like the name
it was given when created.
*/
virtual void setName (const String& newName) throw() { name = newName; }
virtual void setName (const String& newName) noexcept { name = newName; }
//==============================================================================
/** Starts the device running.


+ 2
- 2
src/audio/midi/juce_MidiKeyboardState.cpp View File

@@ -49,7 +49,7 @@ void MidiKeyboardState::reset()
eventsToAdd.clear();
}
bool MidiKeyboardState::isNoteOn (const int midiChannel, const int n) const throw()
bool MidiKeyboardState::isNoteOn (const int midiChannel, const int n) const noexcept
{
jassert (midiChannel >= 0 && midiChannel <= 16);
@@ -57,7 +57,7 @@ bool MidiKeyboardState::isNoteOn (const int midiChannel, const int n) const thro
&& (noteStates[n] & (1 << (midiChannel - 1))) != 0;
}
bool MidiKeyboardState::isNoteOnForChannels (const int midiChannelMask, const int n) const throw()
bool MidiKeyboardState::isNoteOnForChannels (const int midiChannelMask, const int n) const noexcept
{
return isPositiveAndBelow (n, (int) 128)
&& (noteStates[n] & midiChannelMask) != 0;


+ 3
- 3
src/audio/midi/juce_MidiKeyboardState.h View File

@@ -41,7 +41,7 @@ class JUCE_API MidiKeyboardStateListener
{
public:
//==============================================================================
MidiKeyboardStateListener() throw() {}
MidiKeyboardStateListener() noexcept {}
virtual ~MidiKeyboardStateListener() {}
//==============================================================================
@@ -107,7 +107,7 @@ public:
The channel number must be between 1 and 16. If you want to see if any notes are
on for a range of channels, use the isNoteOnForChannels() method.
*/
bool isNoteOn (int midiChannel, int midiNoteNumber) const throw();
bool isNoteOn (int midiChannel, int midiNoteNumber) const noexcept;
/** Returns true if the given midi key is currently held down on any of a set of midi channels.
@@ -116,7 +116,7 @@ public:
If a note is on for at least one of the specified channels, this returns true.
*/
bool isNoteOnForChannels (int midiChannelMask, int midiNoteNumber) const throw();
bool isNoteOnForChannels (int midiChannelMask, int midiNoteNumber) const noexcept;
/** Turns a specified note on.


+ 89
- 89
src/audio/midi/juce_MidiMessage.cpp View File

@@ -32,19 +32,19 @@ BEGIN_JUCE_NAMESPACE
namespace MidiHelpers
{
inline uint8 initialByte (const int type, const int channel) throw()
inline uint8 initialByte (const int type, const int channel) noexcept
{
return (uint8) (type | jlimit (0, 15, channel - 1));
}
inline uint8 validVelocity (const int v) throw()
inline uint8 validVelocity (const int v) noexcept
{
return (uint8) jlimit (0, 127, v);
}
}
//==============================================================================
int MidiMessage::readVariableLengthVal (const uint8* data, int& numBytesUsed) throw()
int MidiMessage::readVariableLengthVal (const uint8* data, int& numBytesUsed) noexcept
{
numBytesUsed = 0;
int v = 0;
@@ -64,7 +64,7 @@ int MidiMessage::readVariableLengthVal (const uint8* data, int& numBytesUsed) th
return v;
}
int MidiMessage::getMessageLengthFromFirstByte (const uint8 firstByte) throw()
int MidiMessage::getMessageLengthFromFirstByte (const uint8 firstByte) noexcept
{
// this method only works for valid starting bytes of a short midi message
jassert (firstByte >= 0x80 && firstByte != 0xf0 && firstByte != 0xf7);
@@ -85,7 +85,7 @@ int MidiMessage::getMessageLengthFromFirstByte (const uint8 firstByte) throw()
}
//==============================================================================
MidiMessage::MidiMessage() throw()
MidiMessage::MidiMessage() noexcept
: timeStamp (0),
data (static_cast<uint8*> (preallocatedData.asBytes)),
size (2)
@@ -111,7 +111,7 @@ MidiMessage::MidiMessage (const void* const d, const int dataSize, const double
jassert (size > 3 || data[0] >= 0xf0 || getMessageLengthFromFirstByte (data[0]) == size);
}
MidiMessage::MidiMessage (const int byte1, const double t) throw()
MidiMessage::MidiMessage (const int byte1, const double t) noexcept
: timeStamp (t),
data (static_cast<uint8*> (preallocatedData.asBytes)),
size (1)
@@ -122,7 +122,7 @@ MidiMessage::MidiMessage (const int byte1, const double t) throw()
jassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 1);
}
MidiMessage::MidiMessage (const int byte1, const int byte2, const double t) throw()
MidiMessage::MidiMessage (const int byte1, const int byte2, const double t) noexcept
: timeStamp (t),
data (static_cast<uint8*> (preallocatedData.asBytes)),
size (2)
@@ -134,7 +134,7 @@ MidiMessage::MidiMessage (const int byte1, const int byte2, const double t) thro
jassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 2);
}
MidiMessage::MidiMessage (const int byte1, const int byte2, const int byte3, const double t) throw()
MidiMessage::MidiMessage (const int byte1, const int byte2, const int byte3, const double t) noexcept
: timeStamp (t),
data (static_cast<uint8*> (preallocatedData.asBytes)),
size (3)
@@ -297,7 +297,7 @@ MidiMessage::~MidiMessage()
delete[] data;
}
int MidiMessage::getChannel() const throw()
int MidiMessage::getChannel() const noexcept
{
if ((data[0] & 0xf0) != 0xf0)
return (data[0] & 0xf) + 1;
@@ -305,7 +305,7 @@ int MidiMessage::getChannel() const throw()
return 0;
}
bool MidiMessage::isForChannel (const int channel) const throw()
bool MidiMessage::isForChannel (const int channel) const noexcept
{
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16
@@ -313,7 +313,7 @@ bool MidiMessage::isForChannel (const int channel) const throw()
&& ((data[0] & 0xf0) != 0xf0);
}
void MidiMessage::setChannel (const int channel) throw()
void MidiMessage::setChannel (const int channel) noexcept
{
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16
@@ -322,36 +322,36 @@ void MidiMessage::setChannel (const int channel) throw()
| (uint8)(channel - 1));
}
bool MidiMessage::isNoteOn (const bool returnTrueForVelocity0) const throw()
bool MidiMessage::isNoteOn (const bool returnTrueForVelocity0) const noexcept
{
return ((data[0] & 0xf0) == 0x90)
&& (returnTrueForVelocity0 || data[2] != 0);
}
bool MidiMessage::isNoteOff (const bool returnTrueForNoteOnVelocity0) const throw()
bool MidiMessage::isNoteOff (const bool returnTrueForNoteOnVelocity0) const noexcept
{
return ((data[0] & 0xf0) == 0x80)
|| (returnTrueForNoteOnVelocity0 && (data[2] == 0) && ((data[0] & 0xf0) == 0x90));
}
bool MidiMessage::isNoteOnOrOff() const throw()
bool MidiMessage::isNoteOnOrOff() const noexcept
{
const int d = data[0] & 0xf0;
return (d == 0x90) || (d == 0x80);
}
int MidiMessage::getNoteNumber() const throw()
int MidiMessage::getNoteNumber() const noexcept
{
return data[1];
}
void MidiMessage::setNoteNumber (const int newNoteNumber) throw()
void MidiMessage::setNoteNumber (const int newNoteNumber) noexcept
{
if (isNoteOnOrOff())
data[1] = newNoteNumber & 127;
}
uint8 MidiMessage::getVelocity() const throw()
uint8 MidiMessage::getVelocity() const noexcept
{
if (isNoteOnOrOff())
return data[2];
@@ -359,36 +359,36 @@ uint8 MidiMessage::getVelocity() const throw()
return 0;
}
float MidiMessage::getFloatVelocity() const throw()
float MidiMessage::getFloatVelocity() const noexcept
{
return getVelocity() * (1.0f / 127.0f);
}
void MidiMessage::setVelocity (const float newVelocity) throw()
void MidiMessage::setVelocity (const float newVelocity) noexcept
{
if (isNoteOnOrOff())
data[2] = MidiHelpers::validVelocity (roundToInt (newVelocity * 127.0f));
}
void MidiMessage::multiplyVelocity (const float scaleFactor) throw()
void MidiMessage::multiplyVelocity (const float scaleFactor) noexcept
{
if (isNoteOnOrOff())
data[2] = MidiHelpers::validVelocity (roundToInt (scaleFactor * data[2]));
}
bool MidiMessage::isAftertouch() const throw()
bool MidiMessage::isAftertouch() const noexcept
{
return (data[0] & 0xf0) == 0xa0;
}
int MidiMessage::getAfterTouchValue() const throw()
int MidiMessage::getAfterTouchValue() const noexcept
{
return data[2];
}
const MidiMessage MidiMessage::aftertouchChange (const int channel,
const int noteNum,
const int aftertouchValue) throw()
const int aftertouchValue) noexcept
{
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16
jassert (isPositiveAndBelow (noteNum, (int) 128));
@@ -399,12 +399,12 @@ const MidiMessage MidiMessage::aftertouchChange (const int channel,
aftertouchValue & 0x7f);
}
bool MidiMessage::isChannelPressure() const throw()
bool MidiMessage::isChannelPressure() const noexcept
{
return (data[0] & 0xf0) == 0xd0;
}
int MidiMessage::getChannelPressureValue() const throw()
int MidiMessage::getChannelPressureValue() const noexcept
{
jassert (isChannelPressure());
@@ -412,7 +412,7 @@ int MidiMessage::getChannelPressureValue() const throw()
}
const MidiMessage MidiMessage::channelPressureChange (const int channel,
const int pressure) throw()
const int pressure) noexcept
{
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16
jassert (isPositiveAndBelow (pressure, (int) 128));
@@ -420,36 +420,36 @@ const MidiMessage MidiMessage::channelPressureChange (const int channel,
return MidiMessage (MidiHelpers::initialByte (0xd0, channel), pressure & 0x7f);
}
bool MidiMessage::isProgramChange() const throw()
bool MidiMessage::isProgramChange() const noexcept
{
return (data[0] & 0xf0) == 0xc0;
}
int MidiMessage::getProgramChangeNumber() const throw()
int MidiMessage::getProgramChangeNumber() const noexcept
{
return data[1];
}
const MidiMessage MidiMessage::programChange (const int channel,
const int programNumber) throw()
const int programNumber) noexcept
{
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16
return MidiMessage (MidiHelpers::initialByte (0xc0, channel), programNumber & 0x7f);
}
bool MidiMessage::isPitchWheel() const throw()
bool MidiMessage::isPitchWheel() const noexcept
{
return (data[0] & 0xf0) == 0xe0;
}
int MidiMessage::getPitchWheelValue() const throw()
int MidiMessage::getPitchWheelValue() const noexcept
{
return data[1] | (data[2] << 7);
}
const MidiMessage MidiMessage::pitchWheel (const int channel,
const int position) throw()
const int position) noexcept
{
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16
jassert (isPositiveAndBelow (position, (int) 0x4000));
@@ -457,26 +457,26 @@ const MidiMessage MidiMessage::pitchWheel (const int channel,
return MidiMessage (MidiHelpers::initialByte (0xe0, channel), position & 127, (position >> 7) & 127);
}
bool MidiMessage::isController() const throw()
bool MidiMessage::isController() const noexcept
{
return (data[0] & 0xf0) == 0xb0;
}
int MidiMessage::getControllerNumber() const throw()
int MidiMessage::getControllerNumber() const noexcept
{
jassert (isController());
return data[1];
}
int MidiMessage::getControllerValue() const throw()
int MidiMessage::getControllerValue() const noexcept
{
jassert (isController());
return data[2];
}
const MidiMessage MidiMessage::controllerEvent (const int channel, const int controllerType, const int value) throw()
const MidiMessage MidiMessage::controllerEvent (const int channel, const int controllerType, const int value) noexcept
{
// the channel must be between 1 and 16 inclusive
jassert (channel > 0 && channel <= 16);
@@ -484,12 +484,12 @@ const MidiMessage MidiMessage::controllerEvent (const int channel, const int con
return MidiMessage (MidiHelpers::initialByte (0xb0, channel), controllerType & 127, value & 127);
}
const MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const float velocity) throw()
const MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const float velocity) noexcept
{
return noteOn (channel, noteNumber, (uint8)(velocity * 127.0f));
}
const MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const uint8 velocity) throw()
const MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const uint8 velocity) noexcept
{
jassert (channel > 0 && channel <= 16);
jassert (isPositiveAndBelow (noteNumber, (int) 128));
@@ -497,7 +497,7 @@ const MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber,
return MidiMessage (MidiHelpers::initialByte (0x90, channel), noteNumber & 127, MidiHelpers::validVelocity (velocity));
}
const MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber, uint8 velocity) throw()
const MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber, uint8 velocity) noexcept
{
jassert (channel > 0 && channel <= 16);
jassert (isPositiveAndBelow (noteNumber, (int) 128));
@@ -505,27 +505,27 @@ const MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber,
return MidiMessage (MidiHelpers::initialByte (0x80, channel), noteNumber & 127, MidiHelpers::validVelocity (velocity));
}
const MidiMessage MidiMessage::allNotesOff (const int channel) throw()
const MidiMessage MidiMessage::allNotesOff (const int channel) noexcept
{
return controllerEvent (channel, 123, 0);
}
bool MidiMessage::isAllNotesOff() const throw()
bool MidiMessage::isAllNotesOff() const noexcept
{
return (data[0] & 0xf0) == 0xb0 && data[1] == 123;
}
const MidiMessage MidiMessage::allSoundOff (const int channel) throw()
const MidiMessage MidiMessage::allSoundOff (const int channel) noexcept
{
return controllerEvent (channel, 120, 0);
}
bool MidiMessage::isAllSoundOff() const throw()
bool MidiMessage::isAllSoundOff() const noexcept
{
return (data[0] & 0xf0) == 0xb0 && data[1] == 120;
}
const MidiMessage MidiMessage::allControllersOff (const int channel) throw()
const MidiMessage MidiMessage::allControllersOff (const int channel) noexcept
{
return controllerEvent (channel, 121, 0);
}
@@ -548,7 +548,7 @@ const MidiMessage MidiMessage::masterVolume (const float volume)
}
//==============================================================================
bool MidiMessage::isSysEx() const throw()
bool MidiMessage::isSysEx() const noexcept
{
return *data == 0xf0;
}
@@ -564,33 +564,33 @@ const MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const
return MidiMessage (m, dataSize + 2);
}
const uint8* MidiMessage::getSysExData() const throw()
const uint8* MidiMessage::getSysExData() const noexcept
{
return isSysEx() ? getRawData() + 1 : 0;
}
int MidiMessage::getSysExDataSize() const throw()
int MidiMessage::getSysExDataSize() const noexcept
{
return isSysEx() ? size - 2 : 0;
}
bool MidiMessage::isMetaEvent() const throw()
bool MidiMessage::isMetaEvent() const noexcept
{
return *data == 0xff;
}
bool MidiMessage::isActiveSense() const throw()
bool MidiMessage::isActiveSense() const noexcept
{
return *data == 0xfe;
}
//==============================================================================
int MidiMessage::getMetaEventType() const throw()
int MidiMessage::getMetaEventType() const noexcept
{
return *data != 0xff ? -1 : data[1];
}
int MidiMessage::getMetaEventLength() const throw()
int MidiMessage::getMetaEventLength() const noexcept
{
if (*data == 0xff)
{
@@ -601,7 +601,7 @@ int MidiMessage::getMetaEventLength() const throw()
return 0;
}
const uint8* MidiMessage::getMetaEventData() const throw()
const uint8* MidiMessage::getMetaEventData() const noexcept
{
int n;
const uint8* d = data + 2;
@@ -609,17 +609,17 @@ const uint8* MidiMessage::getMetaEventData() const throw()
return d + n;
}
bool MidiMessage::isTrackMetaEvent() const throw()
bool MidiMessage::isTrackMetaEvent() const noexcept
{
return getMetaEventType() == 0;
}
bool MidiMessage::isEndOfTrackMetaEvent() const throw()
bool MidiMessage::isEndOfTrackMetaEvent() const noexcept
{
return getMetaEventType() == 47;
}
bool MidiMessage::isTextMetaEvent() const throw()
bool MidiMessage::isTextMetaEvent() const noexcept
{
const int t = getMetaEventType();
@@ -631,27 +631,27 @@ const String MidiMessage::getTextFromTextMetaEvent() const
return String (reinterpret_cast <const char*> (getMetaEventData()), getMetaEventLength());
}
bool MidiMessage::isTrackNameEvent() const throw()
bool MidiMessage::isTrackNameEvent() const noexcept
{
return (data[1] == 3) && (*data == 0xff);
}
bool MidiMessage::isTempoMetaEvent() const throw()
bool MidiMessage::isTempoMetaEvent() const noexcept
{
return (data[1] == 81) && (*data == 0xff);
}
bool MidiMessage::isMidiChannelMetaEvent() const throw()
bool MidiMessage::isMidiChannelMetaEvent() const noexcept
{
return (data[1] == 0x20) && (*data == 0xff) && (data[2] == 1);
}
int MidiMessage::getMidiChannelMetaEventChannel() const throw()
int MidiMessage::getMidiChannelMetaEventChannel() const noexcept
{
return data[3] + 1;
}
double MidiMessage::getTempoSecondsPerQuarterNote() const throw()
double MidiMessage::getTempoSecondsPerQuarterNote() const noexcept
{
if (! isTempoMetaEvent())
return 0.0;
@@ -664,7 +664,7 @@ double MidiMessage::getTempoSecondsPerQuarterNote() const throw()
/ 1000000.0;
}
double MidiMessage::getTempoMetaEventTickLength (const short timeFormat) const throw()
double MidiMessage::getTempoMetaEventTickLength (const short timeFormat) const noexcept
{
if (timeFormat > 0)
{
@@ -691,7 +691,7 @@ double MidiMessage::getTempoMetaEventTickLength (const short timeFormat) const t
}
}
const MidiMessage MidiMessage::tempoMetaEvent (int microsecondsPerQuarterNote) throw()
const MidiMessage MidiMessage::tempoMetaEvent (int microsecondsPerQuarterNote) noexcept
{
uint8 d[8];
d[0] = 0xff;
@@ -704,12 +704,12 @@ const MidiMessage MidiMessage::tempoMetaEvent (int microsecondsPerQuarterNote) t
return MidiMessage (d, 6, 0.0);
}
bool MidiMessage::isTimeSignatureMetaEvent() const throw()
bool MidiMessage::isTimeSignatureMetaEvent() const noexcept
{
return (data[1] == 0x58) && (*data == (uint8) 0xff);
}
void MidiMessage::getTimeSignatureInfo (int& numerator, int& denominator) const throw()
void MidiMessage::getTimeSignatureInfo (int& numerator, int& denominator) const noexcept
{
if (isTimeSignatureMetaEvent())
{
@@ -748,7 +748,7 @@ const MidiMessage MidiMessage::timeSignatureMetaEvent (const int numerator, cons
return MidiMessage (d, 7, 0.0);
}
const MidiMessage MidiMessage::midiChannelMetaEvent (const int channel) throw()
const MidiMessage MidiMessage::midiChannelMetaEvent (const int channel) noexcept
{
uint8 d[8];
d[0] = 0xff;
@@ -759,101 +759,101 @@ const MidiMessage MidiMessage::midiChannelMetaEvent (const int channel) throw()
return MidiMessage (d, 4, 0.0);
}
bool MidiMessage::isKeySignatureMetaEvent() const throw()
bool MidiMessage::isKeySignatureMetaEvent() const noexcept
{
return getMetaEventType() == 89;
}
int MidiMessage::getKeySignatureNumberOfSharpsOrFlats() const throw()
int MidiMessage::getKeySignatureNumberOfSharpsOrFlats() const noexcept
{
return (int) *getMetaEventData();
}
const MidiMessage MidiMessage::endOfTrack() throw()
const MidiMessage MidiMessage::endOfTrack() noexcept
{
return MidiMessage (0xff, 0x2f, 0, 0.0);
}
//==============================================================================
bool MidiMessage::isSongPositionPointer() const throw()
bool MidiMessage::isSongPositionPointer() const noexcept
{
return *data == 0xf2;
}
int MidiMessage::getSongPositionPointerMidiBeat() const throw()
int MidiMessage::getSongPositionPointerMidiBeat() const noexcept
{
return data[1] | (data[2] << 7);
}
const MidiMessage MidiMessage::songPositionPointer (const int positionInMidiBeats) throw()
const MidiMessage MidiMessage::songPositionPointer (const int positionInMidiBeats) noexcept
{
return MidiMessage (0xf2,
positionInMidiBeats & 127,
(positionInMidiBeats >> 7) & 127);
}
bool MidiMessage::isMidiStart() const throw()
bool MidiMessage::isMidiStart() const noexcept
{
return *data == 0xfa;
}
const MidiMessage MidiMessage::midiStart() throw()
const MidiMessage MidiMessage::midiStart() noexcept
{
return MidiMessage (0xfa);
}
bool MidiMessage::isMidiContinue() const throw()
bool MidiMessage::isMidiContinue() const noexcept
{
return *data == 0xfb;
}
const MidiMessage MidiMessage::midiContinue() throw()
const MidiMessage MidiMessage::midiContinue() noexcept
{
return MidiMessage (0xfb);
}
bool MidiMessage::isMidiStop() const throw()
bool MidiMessage::isMidiStop() const noexcept
{
return *data == 0xfc;
}
const MidiMessage MidiMessage::midiStop() throw()
const MidiMessage MidiMessage::midiStop() noexcept
{
return MidiMessage (0xfc);
}
bool MidiMessage::isMidiClock() const throw()
bool MidiMessage::isMidiClock() const noexcept
{
return *data == 0xf8;
}
const MidiMessage MidiMessage::midiClock() throw()
const MidiMessage MidiMessage::midiClock() noexcept
{
return MidiMessage (0xf8);
}
bool MidiMessage::isQuarterFrame() const throw()
bool MidiMessage::isQuarterFrame() const noexcept
{
return *data == 0xf1;
}
int MidiMessage::getQuarterFrameSequenceNumber() const throw()
int MidiMessage::getQuarterFrameSequenceNumber() const noexcept
{
return ((int) data[1]) >> 4;
}
int MidiMessage::getQuarterFrameValue() const throw()
int MidiMessage::getQuarterFrameValue() const noexcept
{
return ((int) data[1]) & 0x0f;
}
const MidiMessage MidiMessage::quarterFrame (const int sequenceNumber,
const int value) throw()
const int value) noexcept
{
return MidiMessage (0xf1, (sequenceNumber << 4) | value);
}
bool MidiMessage::isFullFrame() const throw()
bool MidiMessage::isFullFrame() const noexcept
{
return data[0] == 0xf0
&& data[1] == 0x7f
@@ -866,7 +866,7 @@ void MidiMessage::getFullFrameParameters (int& hours,
int& minutes,
int& seconds,
int& frames,
MidiMessage::SmpteTimecodeType& timecodeType) const throw()
MidiMessage::SmpteTimecodeType& timecodeType) const noexcept
{
jassert (isFullFrame());
@@ -898,7 +898,7 @@ const MidiMessage MidiMessage::fullFrame (const int hours,
return MidiMessage (d, 10, 0.0);
}
bool MidiMessage::isMidiMachineControlMessage() const throw()
bool MidiMessage::isMidiMachineControlMessage() const noexcept
{
return data[0] == 0xf0
&& data[1] == 0x7f
@@ -906,7 +906,7 @@ bool MidiMessage::isMidiMachineControlMessage() const throw()
&& size > 5;
}
MidiMessage::MidiMachineControlCommand MidiMessage::getMidiMachineControlCommand() const throw()
MidiMessage::MidiMachineControlCommand MidiMessage::getMidiMachineControlCommand() const noexcept
{
jassert (isMidiMachineControlMessage());
@@ -930,7 +930,7 @@ const MidiMessage MidiMessage::midiMachineControlCommand (MidiMessage::MidiMachi
bool MidiMessage::isMidiMachineControlGoto (int& hours,
int& minutes,
int& seconds,
int& frames) const throw()
int& frames) const noexcept
{
if (size >= 12
&& data[0] == 0xf0
@@ -993,7 +993,7 @@ const String MidiMessage::getMidiNoteName (int note, bool useSharps, bool includ
return String::empty;
}
const double MidiMessage::getMidiNoteInHertz (int noteNumber, const double frequencyOfA) throw()
const double MidiMessage::getMidiNoteInHertz (int noteNumber, const double frequencyOfA) noexcept
{
noteNumber -= 12 * 6 + 9; // now 0 = A
return frequencyOfA * pow (2.0, noteNumber / 12.0);


+ 92
- 92
src/audio/midi/juce_MidiMessage.h View File

@@ -47,7 +47,7 @@ public:
@param timeStamp the time to give the midi message - this value doesn't
use any particular units, so will be application-specific
*/
MidiMessage (int byte1, int byte2, int byte3, double timeStamp = 0) throw();
MidiMessage (int byte1, int byte2, int byte3, double timeStamp = 0) noexcept;
/** Creates a 2-byte short midi message.
@@ -56,7 +56,7 @@ public:
@param timeStamp the time to give the midi message - this value doesn't
use any particular units, so will be application-specific
*/
MidiMessage (int byte1, int byte2, double timeStamp = 0) throw();
MidiMessage (int byte1, int byte2, double timeStamp = 0) noexcept;
/** Creates a 1-byte short midi message.
@@ -64,7 +64,7 @@ public:
@param timeStamp the time to give the midi message - this value doesn't
use any particular units, so will be application-specific
*/
MidiMessage (int byte1, double timeStamp = 0) throw();
MidiMessage (int byte1, double timeStamp = 0) noexcept;
/** Creates a midi message from a block of data. */
MidiMessage (const void* data, int numBytes, double timeStamp = 0);
@@ -94,7 +94,7 @@ public:
Since the MidiMessage has to contain a valid message, this default constructor
just initialises it with an empty sysex message.
*/
MidiMessage() throw();
MidiMessage() noexcept;
/** Creates a copy of another midi message. */
MidiMessage (const MidiMessage& other);
@@ -113,13 +113,13 @@ public:
@see getRawDataSize
*/
uint8* getRawData() const throw() { return data; }
uint8* getRawData() const noexcept { return data; }
/** Returns the number of bytes of data in the message.
@see getRawData
*/
int getRawDataSize() const throw() { return size; }
int getRawDataSize() const noexcept { return size; }
//==============================================================================
/** Returns the timestamp associated with this message.
@@ -138,7 +138,7 @@ public:
@see setTimeStamp, addToTimeStamp
*/
double getTimeStamp() const throw() { return timeStamp; }
double getTimeStamp() const noexcept { return timeStamp; }
/** Changes the message's associated timestamp.
@@ -146,13 +146,13 @@ public:
@see addToTimeStamp, getTimeStamp
*/
void setTimeStamp (double newTimestamp) throw() { timeStamp = newTimestamp; }
void setTimeStamp (double newTimestamp) noexcept { timeStamp = newTimestamp; }
/** Adds a value to the message's timestamp.
The units for the timestamp will be application-specific.
*/
void addToTimeStamp (double delta) throw() { timeStamp += delta; }
void addToTimeStamp (double delta) noexcept { timeStamp += delta; }
//==============================================================================
/** Returns the midi channel associated with the message.
@@ -161,14 +161,14 @@ public:
if it's a sysex)
@see isForChannel, setChannel
*/
int getChannel() const throw();
int getChannel() const noexcept;
/** Returns true if the message applies to the given midi channel.
@param channelNumber the channel number to look for, in the range 1 to 16
@see getChannel, setChannel
*/
bool isForChannel (int channelNumber) const throw();
bool isForChannel (int channelNumber) const noexcept;
/** Changes the message's midi channel.
@@ -176,12 +176,12 @@ public:
@param newChannelNumber the channel number to change it to, in the range 1 to 16
*/
void setChannel (int newChannelNumber) throw();
void setChannel (int newChannelNumber) noexcept;
//==============================================================================
/** Returns true if this is a system-exclusive message.
*/
bool isSysEx() const throw();
bool isSysEx() const noexcept;
/** Returns a pointer to the sysex data inside the message.
@@ -189,7 +189,7 @@ public:
@see getSysExDataSize
*/
const uint8* getSysExData() const throw();
const uint8* getSysExData() const noexcept;
/** Returns the size of the sysex data.
@@ -197,7 +197,7 @@ public:
@see getSysExData
*/
int getSysExDataSize() const throw();
int getSysExDataSize() const noexcept;
//==============================================================================
/** Returns true if this message is a 'key-down' event.
@@ -210,7 +210,7 @@ public:
@see isNoteOff, getNoteNumber, getVelocity, noteOn
*/
bool isNoteOn (bool returnTrueForVelocity0 = false) const throw();
bool isNoteOn (bool returnTrueForVelocity0 = false) const noexcept;
/** Creates a key-down message (using a floating-point velocity).
@@ -219,7 +219,7 @@ public:
@param velocity in the range 0 to 1.0
@see isNoteOn
*/
static const MidiMessage noteOn (int channel, int noteNumber, float velocity) throw();
static const MidiMessage noteOn (int channel, int noteNumber, float velocity) noexcept;
/** Creates a key-down message (using an integer velocity).
@@ -228,7 +228,7 @@ public:
@param velocity in the range 0 to 127
@see isNoteOn
*/
static const MidiMessage noteOn (int channel, int noteNumber, uint8 velocity) throw();
static const MidiMessage noteOn (int channel, int noteNumber, uint8 velocity) noexcept;
/** Returns true if this message is a 'key-up' event.
@@ -237,7 +237,7 @@ public:
@see isNoteOn, getNoteNumber, getVelocity, noteOff
*/
bool isNoteOff (bool returnTrueForNoteOnVelocity0 = true) const throw();
bool isNoteOff (bool returnTrueForNoteOnVelocity0 = true) const noexcept;
/** Creates a key-up message.
@@ -246,13 +246,13 @@ public:
@param velocity in the range 0 to 127
@see isNoteOff
*/
static const MidiMessage noteOff (int channel, int noteNumber, uint8 velocity = 0) throw();
static const MidiMessage noteOff (int channel, int noteNumber, uint8 velocity = 0) noexcept;
/** Returns true if this message is a 'key-down' or 'key-up' event.
@see isNoteOn, isNoteOff
*/
bool isNoteOnOrOff() const throw();
bool isNoteOnOrOff() const noexcept;
/** Returns the midi note number for note-on and note-off messages.
@@ -261,13 +261,13 @@ public:
@see isNoteOff, getMidiNoteName, getMidiNoteInHertz, setNoteNumber
*/
int getNoteNumber() const throw();
int getNoteNumber() const noexcept;
/** Changes the midi note number of a note-on or note-off message.
If the message isn't a note on or off, this will do nothing.
*/
void setNoteNumber (int newNoteNumber) throw();
void setNoteNumber (int newNoteNumber) noexcept;
//==============================================================================
/** Returns the velocity of a note-on or note-off message.
@@ -278,7 +278,7 @@ public:
@see getFloatVelocity
*/
uint8 getVelocity() const throw();
uint8 getVelocity() const noexcept;
/** Returns the velocity of a note-on or note-off message.
@@ -288,7 +288,7 @@ public:
@see getVelocity, setVelocity
*/
float getFloatVelocity() const throw();
float getFloatVelocity() const noexcept;
/** Changes the velocity of a note-on or note-off message.
@@ -297,7 +297,7 @@ public:
@param newVelocity the new velocity, in the range 0 to 1.0
@see getFloatVelocity, multiplyVelocity
*/
void setVelocity (float newVelocity) throw();
void setVelocity (float newVelocity) noexcept;
/** Multiplies the velocity of a note-on or note-off message by a given amount.
@@ -306,14 +306,14 @@ public:
@param scaleFactor the value by which to multiply the velocity
@see setVelocity
*/
void multiplyVelocity (float scaleFactor) throw();
void multiplyVelocity (float scaleFactor) noexcept;
//==============================================================================
/** Returns true if the message is a program (patch) change message.
@see getProgramChangeNumber, getGMInstrumentName
*/
bool isProgramChange() const throw();
bool isProgramChange() const noexcept;
/** Returns the new program number of a program change message.
@@ -322,7 +322,7 @@ public:
@see isProgramChange, getGMInstrumentName
*/
int getProgramChangeNumber() const throw();
int getProgramChangeNumber() const noexcept;
/** Creates a program-change message.
@@ -330,14 +330,14 @@ public:
@param programNumber the midi program number, 0 to 127
@see isProgramChange, getGMInstrumentName
*/
static const MidiMessage programChange (int channel, int programNumber) throw();
static const MidiMessage programChange (int channel, int programNumber) noexcept;
//==============================================================================
/** Returns true if the message is a pitch-wheel move.
@see getPitchWheelValue, pitchWheel
*/
bool isPitchWheel() const throw();
bool isPitchWheel() const noexcept;
/** Returns the pitch wheel position from a pitch-wheel move message.
@@ -347,7 +347,7 @@ public:
@see isPitchWheel
*/
int getPitchWheelValue() const throw();
int getPitchWheelValue() const noexcept;
/** Creates a pitch-wheel move message.
@@ -355,7 +355,7 @@ public:
@param position the wheel position, in the range 0 to 16383
@see isPitchWheel
*/
static const MidiMessage pitchWheel (int channel, int position) throw();
static const MidiMessage pitchWheel (int channel, int position) noexcept;
//==============================================================================
/** Returns true if the message is an aftertouch event.
@@ -366,7 +366,7 @@ public:
@see getAftertouchValue, getNoteNumber
*/
bool isAftertouch() const throw();
bool isAftertouch() const noexcept;
/** Returns the amount of aftertouch from an aftertouch messages.
@@ -375,7 +375,7 @@ public:
@see isAftertouch
*/
int getAfterTouchValue() const throw();
int getAfterTouchValue() const noexcept;
/** Creates an aftertouch message.
@@ -386,7 +386,7 @@ public:
*/
static const MidiMessage aftertouchChange (int channel,
int noteNumber,
int aftertouchAmount) throw();
int aftertouchAmount) noexcept;
/** Returns true if the message is a channel-pressure change event.
@@ -396,14 +396,14 @@ public:
@see channelPressureChange
*/
bool isChannelPressure() const throw();
bool isChannelPressure() const noexcept;
/** Returns the pressure from a channel pressure change message.
@returns the pressure, in the range 0 to 127
@see isChannelPressure, channelPressureChange
*/
int getChannelPressureValue() const throw();
int getChannelPressureValue() const noexcept;
/** Creates a channel-pressure change event.
@@ -411,14 +411,14 @@ public:
@param pressure the pressure, 0 to 127
@see isChannelPressure
*/
static const MidiMessage channelPressureChange (int channel, int pressure) throw();
static const MidiMessage channelPressureChange (int channel, int pressure) noexcept;
//==============================================================================
/** Returns true if this is a midi controller message.
@see getControllerNumber, getControllerValue, controllerEvent
*/
bool isController() const throw();
bool isController() const noexcept;
/** Returns the controller number of a controller message.
@@ -428,7 +428,7 @@ public:
@see isController, getControllerName, getControllerValue
*/
int getControllerNumber() const throw();
int getControllerNumber() const noexcept;
/** Returns the controller value from a controller message.
@@ -438,7 +438,7 @@ public:
@see isController, getControllerNumber
*/
int getControllerValue() const throw();
int getControllerValue() const noexcept;
/** Creates a controller message.
@@ -449,39 +449,39 @@ public:
*/
static const MidiMessage controllerEvent (int channel,
int controllerType,
int value) throw();
int value) noexcept;
/** Checks whether this message is an all-notes-off message.
@see allNotesOff
*/
bool isAllNotesOff() const throw();
bool isAllNotesOff() const noexcept;
/** Checks whether this message is an all-sound-off message.
@see allSoundOff
*/
bool isAllSoundOff() const throw();
bool isAllSoundOff() const noexcept;
/** Creates an all-notes-off message.
@param channel the midi channel, in the range 1 to 16
@see isAllNotesOff
*/
static const MidiMessage allNotesOff (int channel) throw();
static const MidiMessage allNotesOff (int channel) noexcept;
/** Creates an all-sound-off message.
@param channel the midi channel, in the range 1 to 16
@see isAllSoundOff
*/
static const MidiMessage allSoundOff (int channel) throw();
static const MidiMessage allSoundOff (int channel) noexcept;
/** Creates an all-controllers-off message.
@param channel the midi channel, in the range 1 to 16
*/
static const MidiMessage allControllersOff (int channel) throw();
static const MidiMessage allControllersOff (int channel) noexcept;
//==============================================================================
/** Returns true if this event is a meta-event.
@@ -492,7 +492,7 @@ public:
isTextMetaEvent, isTrackNameEvent, isTempoMetaEvent, isTimeSignatureMetaEvent,
isKeySignatureMetaEvent, isMidiChannelMetaEvent
*/
bool isMetaEvent() const throw();
bool isMetaEvent() const noexcept;
/** Returns a meta-event's type number.
@@ -502,44 +502,44 @@ public:
isTextMetaEvent, isTrackNameEvent, isTempoMetaEvent, isTimeSignatureMetaEvent,
isKeySignatureMetaEvent, isMidiChannelMetaEvent
*/
int getMetaEventType() const throw();
int getMetaEventType() const noexcept;
/** Returns a pointer to the data in a meta-event.
@see isMetaEvent, getMetaEventLength
*/
const uint8* getMetaEventData() const throw();
const uint8* getMetaEventData() const noexcept;
/** Returns the length of the data for a meta-event.
@see isMetaEvent, getMetaEventData
*/
int getMetaEventLength() const throw();
int getMetaEventLength() const noexcept;
//==============================================================================
/** Returns true if this is a 'track' meta-event. */
bool isTrackMetaEvent() const throw();
bool isTrackMetaEvent() const noexcept;
/** Returns true if this is an 'end-of-track' meta-event. */
bool isEndOfTrackMetaEvent() const throw();
bool isEndOfTrackMetaEvent() const noexcept;
/** Creates an end-of-track meta-event.
@see isEndOfTrackMetaEvent
*/
static const MidiMessage endOfTrack() throw();
static const MidiMessage endOfTrack() noexcept;
/** Returns true if this is an 'track name' meta-event.
You can use the getTextFromTextMetaEvent() method to get the track's name.
*/
bool isTrackNameEvent() const throw();
bool isTrackNameEvent() const noexcept;
/** Returns true if this is a 'text' meta-event.
@see getTextFromTextMetaEvent
*/
bool isTextMetaEvent() const throw();
bool isTextMetaEvent() const noexcept;
/** Returns the text from a text meta-event.
@@ -552,7 +552,7 @@ public:
@see getTempoMetaEventTickLength, getTempoSecondsPerQuarterNote
*/
bool isTempoMetaEvent() const throw();
bool isTempoMetaEvent() const noexcept;
/** Returns the tick length from a tempo meta-event.
@@ -560,32 +560,32 @@ public:
@returns the tick length (in seconds).
@see isTempoMetaEvent
*/
double getTempoMetaEventTickLength (short timeFormat) const throw();
double getTempoMetaEventTickLength (short timeFormat) const noexcept;
/** Calculates the seconds-per-quarter-note from a tempo meta-event.
@see isTempoMetaEvent, getTempoMetaEventTickLength
*/
double getTempoSecondsPerQuarterNote() const throw();
double getTempoSecondsPerQuarterNote() const noexcept;
/** Creates a tempo meta-event.
@see isTempoMetaEvent
*/
static const MidiMessage tempoMetaEvent (int microsecondsPerQuarterNote) throw();
static const MidiMessage tempoMetaEvent (int microsecondsPerQuarterNote) noexcept;
//==============================================================================
/** Returns true if this is a 'time-signature' meta-event.
@see getTimeSignatureInfo
*/
bool isTimeSignatureMetaEvent() const throw();
bool isTimeSignatureMetaEvent() const noexcept;
/** Returns the time-signature values from a time-signature meta-event.
@see isTimeSignatureMetaEvent
*/
void getTimeSignatureInfo (int& numerator, int& denominator) const throw();
void getTimeSignatureInfo (int& numerator, int& denominator) const noexcept;
/** Creates a time-signature meta-event.
@@ -598,13 +598,13 @@ public:
@see getKeySignatureNumberOfSharpsOrFlats
*/
bool isKeySignatureMetaEvent() const throw();
bool isKeySignatureMetaEvent() const noexcept;
/** Returns the key from a key-signature meta-event.
@see isKeySignatureMetaEvent
*/
int getKeySignatureNumberOfSharpsOrFlats() const throw();
int getKeySignatureNumberOfSharpsOrFlats() const noexcept;
//==============================================================================
/** Returns true if this is a 'channel' meta-event.
@@ -614,74 +614,74 @@ public:
@see getMidiChannelMetaEventChannel
*/
bool isMidiChannelMetaEvent() const throw();
bool isMidiChannelMetaEvent() const noexcept;
/** Returns the channel number from a channel meta-event.
@returns the channel, in the range 1 to 16.
@see isMidiChannelMetaEvent
*/
int getMidiChannelMetaEventChannel() const throw();
int getMidiChannelMetaEventChannel() const noexcept;
/** Creates a midi channel meta-event.
@param channel the midi channel, in the range 1 to 16
@see isMidiChannelMetaEvent
*/
static const MidiMessage midiChannelMetaEvent (int channel) throw();
static const MidiMessage midiChannelMetaEvent (int channel) noexcept;
//==============================================================================
/** Returns true if this is an active-sense message. */
bool isActiveSense() const throw();
bool isActiveSense() const noexcept;
//==============================================================================
/** Returns true if this is a midi start event.
@see midiStart
*/
bool isMidiStart() const throw();
bool isMidiStart() const noexcept;
/** Creates a midi start event. */
static const MidiMessage midiStart() throw();
static const MidiMessage midiStart() noexcept;
/** Returns true if this is a midi continue event.
@see midiContinue
*/
bool isMidiContinue() const throw();
bool isMidiContinue() const noexcept;
/** Creates a midi continue event. */
static const MidiMessage midiContinue() throw();
static const MidiMessage midiContinue() noexcept;
/** Returns true if this is a midi stop event.
@see midiStop
*/
bool isMidiStop() const throw();
bool isMidiStop() const noexcept;
/** Creates a midi stop event. */
static const MidiMessage midiStop() throw();
static const MidiMessage midiStop() noexcept;
/** Returns true if this is a midi clock event.
@see midiClock, songPositionPointer
*/
bool isMidiClock() const throw();
bool isMidiClock() const noexcept;
/** Creates a midi clock event. */
static const MidiMessage midiClock() throw();
static const MidiMessage midiClock() noexcept;
/** Returns true if this is a song-position-pointer message.
@see getSongPositionPointerMidiBeat, songPositionPointer
*/
bool isSongPositionPointer() const throw();
bool isSongPositionPointer() const noexcept;
/** Returns the midi beat-number of a song-position-pointer message.
@see isSongPositionPointer, songPositionPointer
*/
int getSongPositionPointerMidiBeat() const throw();
int getSongPositionPointerMidiBeat() const noexcept;
/** Creates a song-position-pointer message.
@@ -691,14 +691,14 @@ public:
@see isSongPositionPointer, getSongPositionPointerMidiBeat
*/
static const MidiMessage songPositionPointer (int positionInMidiBeats) throw();
static const MidiMessage songPositionPointer (int positionInMidiBeats) noexcept;
//==============================================================================
/** Returns true if this is a quarter-frame midi timecode message.
@see quarterFrame, getQuarterFrameSequenceNumber, getQuarterFrameValue
*/
bool isQuarterFrame() const throw();
bool isQuarterFrame() const noexcept;
/** Returns the sequence number of a quarter-frame midi timecode message.
@@ -706,21 +706,21 @@ public:
@see isQuarterFrame, getQuarterFrameValue, quarterFrame
*/
int getQuarterFrameSequenceNumber() const throw();
int getQuarterFrameSequenceNumber() const noexcept;
/** Returns the value from a quarter-frame message.
This will be the lower nybble of the message's data-byte, a value
between 0 and 15
*/
int getQuarterFrameValue() const throw();
int getQuarterFrameValue() const noexcept;
/** Creates a quarter-frame MTC message.
@param sequenceNumber a value 0 to 7 for the upper nybble of the message's data byte
@param value a value 0 to 15 for the lower nybble of the message's data byte
*/
static const MidiMessage quarterFrame (int sequenceNumber, int value) throw();
static const MidiMessage quarterFrame (int sequenceNumber, int value) noexcept;
/** SMPTE timecode types.
@@ -736,7 +736,7 @@ public:
/** Returns true if this is a full-frame midi timecode message.
*/
bool isFullFrame() const throw();
bool isFullFrame() const noexcept;
/** Extracts the timecode information from a full-frame midi timecode message.
@@ -747,7 +747,7 @@ public:
int& minutes,
int& seconds,
int& frames,
SmpteTimecodeType& timecodeType) const throw();
SmpteTimecodeType& timecodeType) const noexcept;
/** Creates a full-frame MTC message.
*/
@@ -778,14 +778,14 @@ public:
If it is, you can use the getMidiMachineControlCommand() to find out its type.
*/
bool isMidiMachineControlMessage() const throw();
bool isMidiMachineControlMessage() const noexcept;
/** For an MMC message, this returns its type.
Make sure it's actually an MMC message with isMidiMachineControlMessage() before
calling this method.
*/
MidiMachineControlCommand getMidiMachineControlCommand() const throw();
MidiMachineControlCommand getMidiMachineControlCommand() const noexcept;
/** Creates an MMC message.
*/
@@ -800,7 +800,7 @@ public:
bool isMidiMachineControlGoto (int& hours,
int& minutes,
int& seconds,
int& frames) const throw();
int& frames) const noexcept;
/** Creates an MMC "goto" message.
@@ -836,14 +836,14 @@ public:
@param numBytesUsed on return, this will be set to the number of bytes that were read
*/
static int readVariableLengthVal (const uint8* data,
int& numBytesUsed) throw();
int& numBytesUsed) noexcept;
/** Based on the first byte of a short midi message, this uses a lookup table
to return the message length (either 1, 2, or 3 bytes).
The value passed in must be 0x80 or higher.
*/
static int getMessageLengthFromFirstByte (const uint8 firstByte) throw();
static int getMessageLengthFromFirstByte (const uint8 firstByte) noexcept;
//==============================================================================
/** Returns the name of a midi note number.
@@ -870,7 +870,7 @@ public:
The frequencyOfA parameter is an optional frequency for 'A', normally 440-444Hz for concert pitch.
@see getMidiNoteName
*/
static const double getMidiNoteInHertz (int noteNumber, const double frequencyOfA = 440.0) throw();
static const double getMidiNoteInHertz (int noteNumber, const double frequencyOfA = 440.0) noexcept;
/** Returns the standard name of a GM instrument.


+ 6
- 6
src/audio/midi/juce_MidiMessageSequence.cpp View File

@@ -51,7 +51,7 @@ MidiMessageSequence& MidiMessageSequence::operator= (const MidiMessageSequence&
return *this;
}
void MidiMessageSequence::swapWith (MidiMessageSequence& other) throw()
void MidiMessageSequence::swapWith (MidiMessageSequence& other) noexcept
{
list.swapWithArray (other.list);
}
@@ -79,7 +79,7 @@ double MidiMessageSequence::getTimeOfMatchingKeyUp (const int index) const
{
const MidiEventHolder* const meh = list [index];
if (meh != 0 && meh->noteOffObject != 0)
if (meh != nullptr && meh->noteOffObject != nullptr)
return meh->noteOffObject->message.getTimeStamp();
else
return 0.0;
@@ -89,7 +89,7 @@ int MidiMessageSequence::getIndexOfMatchingKeyUp (const int index) const
{
const MidiEventHolder* const meh = list [index];
return (meh != 0) ? list.indexOf (meh->noteOffObject) : -1;
return meh != nullptr ? list.indexOf (meh->noteOffObject) : -1;
}
int MidiMessageSequence::getIndexOf (MidiEventHolder* const event) const
@@ -190,7 +190,7 @@ void MidiMessageSequence::addSequence (const MidiMessageSequence& other,
//==============================================================================
int MidiMessageSequence::compareElements (const MidiMessageSequence::MidiEventHolder* const first,
const MidiMessageSequence::MidiEventHolder* const second) throw()
const MidiMessageSequence::MidiEventHolder* const second) noexcept
{
const double diff = first->message.getTimeStamp()
- second->message.getTimeStamp();
@@ -212,7 +212,7 @@ void MidiMessageSequence::updateMatchedPairs()
if (m1.isNoteOn())
{
list.getUnchecked(i)->noteOffObject = 0;
list.getUnchecked(i)->noteOffObject = nullptr;
const int note = m1.getNoteNumber();
const int chan = m1.getChannel();
const int len = list.size();
@@ -339,7 +339,7 @@ void MidiMessageSequence::createControllerUpdatesForTime (const int channelNumbe
//==============================================================================
MidiMessageSequence::MidiEventHolder::MidiEventHolder (const MidiMessage& message_)
: message (message_),
noteOffObject (0)
noteOffObject (nullptr)
{
}


+ 2
- 2
src/audio/midi/juce_MidiMessageSequence.h View File

@@ -263,12 +263,12 @@ public:
//==============================================================================
/** Swaps this sequence with another one. */
void swapWith (MidiMessageSequence& other) throw();
void swapWith (MidiMessageSequence& other) noexcept;
//==============================================================================
/** @internal */
static int compareElements (const MidiMessageSequence::MidiEventHolder* first,
const MidiMessageSequence::MidiEventHolder* second) throw();
const MidiMessageSequence::MidiEventHolder* second) noexcept;
private:
//==============================================================================


+ 8
- 8
src/audio/midi/juce_MidiOutput.cpp View File

@@ -34,8 +34,8 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
MidiOutput::MidiOutput()
: Thread ("midi out"),
internal (0),
firstMessage (0)
internal (nullptr),
firstMessage (nullptr)
{
}
@@ -70,7 +70,7 @@ void MidiOutput::sendBlockOfMessages (const MidiBuffer& buffer,
const ScopedLock sl (lock);
if (firstMessage == 0 || firstMessage->message.getTimeStamp() > eventTime)
if (firstMessage == nullptr || firstMessage->message.getTimeStamp() > eventTime)
{
m->next = firstMessage;
firstMessage = m;
@@ -79,7 +79,7 @@ void MidiOutput::sendBlockOfMessages (const MidiBuffer& buffer,
{
PendingMessage* mm = firstMessage;
while (mm->next != 0 && mm->next->message.getTimeStamp() <= eventTime)
while (mm->next != nullptr && mm->next->message.getTimeStamp() <= eventTime)
mm = mm->next;
m->next = mm->next;
@@ -94,7 +94,7 @@ void MidiOutput::clearAllPendingMessages()
{
const ScopedLock sl (lock);
while (firstMessage != 0)
while (firstMessage != nullptr)
{
PendingMessage* const m = firstMessage;
firstMessage = firstMessage->next;
@@ -126,14 +126,14 @@ void MidiOutput::run()
const ScopedLock sl (lock);
message = firstMessage;
if (message != 0)
if (message != nullptr)
{
eventTime = roundToInt (message->message.getTimeStamp());
if (eventTime > now + 20)
{
timeToWait = eventTime - (now + 20);
message = 0;
message = nullptr;
}
else
{
@@ -142,7 +142,7 @@ void MidiOutput::run()
}
}
if (message != 0)
if (message != nullptr)
{
if (eventTime > now)
{


+ 37
- 37
src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm View File

@@ -411,7 +411,7 @@ private:
AudioUnitPluginInstance::AudioUnitPluginInstance (const String& fileOrIdentifier)
: fileOrIdentifier (fileOrIdentifier),
wantsMidiMessages (false), wasPlaying (false), prepared (false),
currentBuffer (0),
currentBuffer (nullptr),
audioUnit (0)
{
using namespace AudioUnitFormatHelpers;
@@ -768,20 +768,20 @@ OSStatus AudioUnitPluginInstance::getBeatAndTempo (Float64* outCurrentBeat, Floa
AudioPlayHead* const ph = getPlayHead();
AudioPlayHead::CurrentPositionInfo result;
if (ph != 0 && ph->getCurrentPosition (result))
if (ph != nullptr && ph->getCurrentPosition (result))
{
if (outCurrentBeat != 0)
if (outCurrentBeat != nullptr)
*outCurrentBeat = result.ppqPosition;
if (outCurrentTempo != 0)
if (outCurrentTempo != nullptr)
*outCurrentTempo = result.bpm;
}
else
{
if (outCurrentBeat != 0)
if (outCurrentBeat != nullptr)
*outCurrentBeat = 0;
if (outCurrentTempo != 0)
if (outCurrentTempo != nullptr)
*outCurrentTempo = 120.0;
}
@@ -796,32 +796,32 @@ OSStatus AudioUnitPluginInstance::getMusicalTimeLocation (UInt32* outDeltaSample
AudioPlayHead* const ph = getPlayHead();
AudioPlayHead::CurrentPositionInfo result;
if (ph != 0 && ph->getCurrentPosition (result))
if (ph != nullptr && ph->getCurrentPosition (result))
{
if (outTimeSig_Numerator != 0)
if (outTimeSig_Numerator != nullptr)
*outTimeSig_Numerator = result.timeSigNumerator;
if (outTimeSig_Denominator != 0)
if (outTimeSig_Denominator != nullptr)
*outTimeSig_Denominator = result.timeSigDenominator;
if (outDeltaSampleOffsetToNextBeat != 0)
if (outDeltaSampleOffsetToNextBeat != nullptr)
*outDeltaSampleOffsetToNextBeat = 0; //xxx
if (outCurrentMeasureDownBeat != 0)
if (outCurrentMeasureDownBeat != nullptr)
*outCurrentMeasureDownBeat = result.ppqPositionOfLastBarStart; //xxx wrong
}
else
{
if (outDeltaSampleOffsetToNextBeat != 0)
if (outDeltaSampleOffsetToNextBeat != nullptr)
*outDeltaSampleOffsetToNextBeat = 0;
if (outTimeSig_Numerator != 0)
if (outTimeSig_Numerator != nullptr)
*outTimeSig_Numerator = 4;
if (outTimeSig_Denominator != 0)
if (outTimeSig_Denominator != nullptr)
*outTimeSig_Denominator = 4;
if (outCurrentMeasureDownBeat != 0)
if (outCurrentMeasureDownBeat != nullptr)
*outCurrentMeasureDownBeat = 0;
}
@@ -838,47 +838,47 @@ OSStatus AudioUnitPluginInstance::getTransportState (Boolean* outIsPlaying,
AudioPlayHead* const ph = getPlayHead();
AudioPlayHead::CurrentPositionInfo result;
if (ph != 0 && ph->getCurrentPosition (result))
if (ph != nullptr && ph->getCurrentPosition (result))
{
if (outIsPlaying != 0)
if (outIsPlaying != nullptr)
*outIsPlaying = result.isPlaying;
if (outTransportStateChanged != 0)
if (outTransportStateChanged != nullptr)
{
*outTransportStateChanged = result.isPlaying != wasPlaying;
wasPlaying = result.isPlaying;
}
if (outCurrentSampleInTimeLine != 0)
if (outCurrentSampleInTimeLine != nullptr)
*outCurrentSampleInTimeLine = roundToInt (result.timeInSeconds * getSampleRate());
if (outIsCycling != 0)
if (outIsCycling != nullptr)
*outIsCycling = false;
if (outCycleStartBeat != 0)
if (outCycleStartBeat != nullptr)
*outCycleStartBeat = 0;
if (outCycleEndBeat != 0)
if (outCycleEndBeat != nullptr)
*outCycleEndBeat = 0;
}
else
{
if (outIsPlaying != 0)
if (outIsPlaying != nullptr)
*outIsPlaying = false;
if (outTransportStateChanged != 0)
if (outTransportStateChanged != nullptr)
*outTransportStateChanged = false;
if (outCurrentSampleInTimeLine != 0)
if (outCurrentSampleInTimeLine != nullptr)
*outCurrentSampleInTimeLine = 0;
if (outIsCycling != 0)
if (outIsCycling != nullptr)
*outIsCycling = false;
if (outCycleStartBeat != 0)
if (outCycleStartBeat != nullptr)
*outCycleStartBeat = 0;
if (outCycleEndBeat != 0)
if (outCycleEndBeat != nullptr)
*outCycleEndBeat = 0;
}
@@ -944,7 +944,7 @@ private:
bool createView (const bool createGenericViewIfNeeded)
{
NSView* pluginView = 0;
NSView* pluginView = nil;
UInt32 dataSize = 0;
Boolean isWritable = false;
@@ -989,13 +989,13 @@ private:
wrapper.setView (pluginView);
if (pluginView != 0)
if (pluginView != nil)
{
timerCallback();
startTimer (70);
}
return pluginView != 0;
return pluginView != nil;
}
};
@@ -1033,7 +1033,7 @@ public:
plugin.editorBeingDeleted (this);
}
bool isValid() const throw() { return componentRecord != 0; }
bool isValid() const noexcept { return componentRecord != 0; }
//==============================================================================
void paint (Graphics& g)
@@ -1155,7 +1155,7 @@ AudioProcessorEditor* AudioUnitPluginInstance::createEditor()
w = 0;
#if JUCE_SUPPORT_CARBON
if (w == 0)
if (w == nullptr)
{
w = new AudioUnitPluginWindowCarbon (*this);
@@ -1164,7 +1164,7 @@ AudioProcessorEditor* AudioUnitPluginInstance::createEditor()
}
#endif
if (w == 0)
if (w == nullptr)
w = new AudioUnitPluginWindowCocoa (*this, true); // use AUGenericView as a fallback
return w.release();
@@ -1174,7 +1174,7 @@ AudioProcessorEditor* AudioUnitPluginInstance::createEditor()
//==============================================================================
const String AudioUnitPluginInstance::getCategory() const
{
const char* result = 0;
const char* result = nullptr;
switch (componentDesc.componentType)
{
@@ -1327,7 +1327,7 @@ const String AudioUnitPluginInstance::getProgramName (int index)
{
const AUPreset* p = (const AUPreset*) CFArrayGetValueAtIndex (presets, i);
if (p != 0 && p->presetNumber == index)
if (p != nullptr && p->presetNumber == index)
{
s = PlatformUtilities::cfStringToJuceString (p->presetName);
break;
@@ -1466,7 +1466,7 @@ void AudioUnitPluginFormat::findAllTypesForFile (OwnedArray <PluginDescription>&
ScopedPointer <AudioPluginInstance> createdInstance (createInstanceFromDescription (desc));
AudioUnitPluginInstance* const auInstance = dynamic_cast <AudioUnitPluginInstance*> ((AudioPluginInstance*) createdInstance);
if (auInstance != 0)
if (auInstance != nullptr)
{
auInstance->fillInPluginDescription (desc);
results.add (new PluginDescription (desc));


+ 4
- 4
src/audio/plugins/formats/juce_VSTMidiEventList.h View File

@@ -54,7 +54,7 @@ public:
{
numEventsUsed = 0;
if (events != 0)
if (events != nullptr)
events->numEvents = 0;
}
@@ -110,7 +110,7 @@ public:
{
const VstEvent* const e = events->events[i];
if (e != 0)
if (e != nullptr)
{
if (e->type == kVstMidiType)
{
@@ -136,7 +136,7 @@ public:
const int size = 20 + sizeof (VstEvent*) * numEventsNeeded;
if (events == 0)
if (events == nullptr)
events.calloc (size, 1);
else
events.realloc (size, 1);
@@ -157,7 +157,7 @@ public:
void freeEvents()
{
if (events != 0)
if (events != nullptr)
{
for (int i = numEventsAllocated; --i >= 0;)
{


+ 60
- 59
src/audio/plugins/formats/juce_VSTPluginFormat.cpp View File

@@ -177,7 +177,7 @@ struct fxProgramSet
namespace
{
long vst_swap (const long x) throw()
long vst_swap (const long x) noexcept
{
#ifdef JUCE_LITTLE_ENDIAN
return (long) ByteOrder::swap ((uint32) x);
@@ -186,7 +186,7 @@ namespace
#endif
}
float vst_swapFloat (const float x) throw()
float vst_swapFloat (const float x) noexcept
{
#ifdef JUCE_LITTLE_ENDIAN
union { uint32 asInt; float asFloat; } n;
@@ -238,7 +238,7 @@ class VSTPluginWindow;
//==============================================================================
#if JUCE_MAC && JUCE_PPC
static void* NewCFMFromMachO (void* const machofp) throw()
static void* NewCFMFromMachO (void* const machofp) noexcept
{
void* result = (void*) new char[8];
@@ -305,7 +305,7 @@ namespace
return 0;
}
void translateJuceToXButtonModifiers (const MouseEvent& e, XEvent& ev) throw()
void translateJuceToXButtonModifiers (const MouseEvent& e, XEvent& ev) noexcept
{
if (e.mods.isLeftButtonDown())
{
@@ -324,21 +324,21 @@ namespace
}
}
void translateJuceToXMotionModifiers (const MouseEvent& e, XEvent& ev) throw()
void translateJuceToXMotionModifiers (const MouseEvent& e, XEvent& ev) noexcept
{
if (e.mods.isLeftButtonDown()) ev.xmotion.state |= Button1Mask;
else if (e.mods.isRightButtonDown()) ev.xmotion.state |= Button3Mask;
else if (e.mods.isMiddleButtonDown()) ev.xmotion.state |= Button2Mask;
}
void translateJuceToXCrossingModifiers (const MouseEvent& e, XEvent& ev) throw()
void translateJuceToXCrossingModifiers (const MouseEvent& e, XEvent& ev) noexcept
{
if (e.mods.isLeftButtonDown()) ev.xcrossing.state |= Button1Mask;
else if (e.mods.isRightButtonDown()) ev.xcrossing.state |= Button3Mask;
else if (e.mods.isMiddleButtonDown()) ev.xcrossing.state |= Button2Mask;
}
void translateJuceToXMouseWheelModifiers (const MouseEvent& e, const float increment, XEvent& ev) throw()
void translateJuceToXMouseWheelModifiers (const MouseEvent& e, const float increment, XEvent& ev) noexcept
{
if (increment < 0)
{
@@ -390,7 +390,7 @@ public:
ScopedPointer <ModuleHandle> m (new ModuleHandle (file));
if (! m->open())
m = 0;
m = nullptr;
--insideVSTCallback;
_fpreset(); // (doesn't do any harm)
@@ -732,7 +732,7 @@ public:
desc.version = getVersion();
desc.numInputChannels = getNumInputChannels();
desc.numOutputChannels = getNumOutputChannels();
desc.isInstrument = (effect != 0 && (effect->flags & effFlagsIsSynth) != 0);
desc.isInstrument = (effect != nullptr && (effect->flags & effFlagsIsSynth) != 0);
}
void* getPlatformSpecificData() { return effect; }
@@ -749,7 +749,7 @@ public:
void processBlock (AudioSampleBuffer& buffer,
MidiBuffer& midiMessages);
bool hasEditor() const { return effect != 0 && (effect->flags & effFlagsHasEditor) != 0; }
bool hasEditor() const { return effect != nullptr && (effect->flags & effFlagsHasEditor) != 0; }
AudioProcessorEditor* createEditor();
const String getInputChannelName (int index) const;
@@ -759,7 +759,7 @@ public:
bool isOutputChannelStereoPair (int index) const;
//==============================================================================
int getNumParameters() { return effect != 0 ? effect->numParams : 0; }
int getNumParameters() { return effect != nullptr ? effect->numParams : 0; }
float getParameter (int index);
void setParameter (int index, float newValue);
const String getParameterName (int index);
@@ -767,7 +767,7 @@ public:
bool isParameterAutomatable (int index) const;
//==============================================================================
int getNumPrograms() { return effect != 0 ? effect->numPrograms : 0; }
int getNumPrograms() { return effect != nullptr ? effect->numPrograms : 0; }
int getCurrentProgram() { return dispatch (effGetProgram, 0, 0, 0, 0); }
void setCurrentProgram (int index);
const String getProgramName (int index);
@@ -814,13 +814,13 @@ private:
void restoreFromTempParameterStore (const MemoryBlock& mb);
const String getParameterLabel (int index) const;
bool usesChunks() const throw() { return effect != 0 && (effect->flags & effFlagsProgramChunks) != 0; }
bool usesChunks() const noexcept { return effect != nullptr && (effect->flags & effFlagsProgramChunks) != 0; }
void getChunkData (MemoryBlock& mb, bool isPreset, int maxSizeMB) const;
void setChunkData (const char* data, int size, bool isPreset);
bool loadFromFXBFile (const void* data, int numBytes);
bool saveToFXBFile (MemoryBlock& dest, bool isFXB, int maxSizeMB);
int getVersionNumber() const throw() { return effect != 0 ? effect->version : 0; }
int getVersionNumber() const noexcept { return effect != nullptr ? effect->version : 0; }
const String getVersion() const;
const String getCategory() const;
@@ -855,7 +855,7 @@ VSTPluginInstance::VSTPluginInstance (const ReferenceCountedObjectPtr <ModuleHan
#if JUCE_PPC
if (module->fragId != 0)
{
static void* audioMasterCoerced = 0;
static void* audioMasterCoerced = nullptr;
if (audioMasterCoerced == 0)
audioMasterCoerced = NewCFMFromMachO ((void*) &audioMaster);
@@ -870,7 +870,7 @@ VSTPluginInstance::VSTPluginInstance (const ReferenceCountedObjectPtr <ModuleHan
--insideVSTCallback;
if (effect != 0 && effect->magic == kEffectMagic)
if (effect != nullptr && effect->magic == kEffectMagic)
{
#if JUCE_PPC
module->coerceAEffectFunctionCalls (effect);
@@ -883,7 +883,7 @@ VSTPluginInstance::VSTPluginInstance (const ReferenceCountedObjectPtr <ModuleHan
}
else
{
effect = 0;
effect = nullptr;
}
}
catch (...)
@@ -898,7 +898,7 @@ VSTPluginInstance::~VSTPluginInstance()
jassert (insideVSTCallback == 0);
if (effect != 0 && effect->magic == kEffectMagic)
if (effect != nullptr && effect->magic == kEffectMagic)
{
try
{
@@ -918,8 +918,8 @@ VSTPluginInstance::~VSTPluginInstance()
{}
}
module = 0;
effect = 0;
module = nullptr;
effect = nullptr;
}
//==============================================================================
@@ -1037,7 +1037,7 @@ void VSTPluginInstance::processBlock (AudioSampleBuffer& buffer,
{
AudioPlayHead* playHead = getPlayHead();
if (playHead != 0)
if (playHead != nullptr)
{
AudioPlayHead::CurrentPositionInfo position;
playHead->getCurrentPosition (position);
@@ -1126,7 +1126,7 @@ void VSTPluginInstance::processBlock (AudioSampleBuffer& buffer,
//==============================================================================
void VSTPluginInstance::handleMidiFromPlugin (const VstEvents* const events)
{
if (events != 0)
if (events != nullptr)
{
const ScopedLock sl (midiInLock);
VSTMidiEventList::addEventsToMidiBuffer (events, incomingMidi);
@@ -1157,15 +1157,15 @@ public:
pluginRefusesToResize (false),
alreadyInside (false)
{
#if JUCE_WINDOWS
#if JUCE_WINDOWS
sizeCheckCount = 0;
pluginHWND = 0;
#elif JUCE_LINUX
#elif JUCE_LINUX
pluginWindow = None;
pluginProc = None;
#else
#else
addAndMakeVisible (innerWrapper = new InnerWrapperComponent (this));
#endif
#endif
activeVSTWindows.add (this);
@@ -1176,11 +1176,12 @@ public:
~VSTPluginWindow()
{
#if JUCE_MAC
innerWrapper = 0;
#else
#if JUCE_MAC
innerWrapper = nullptr;
#else
closePluginWindow();
#endif
#endif
activeVSTWindows.removeValue (this);
plugin.editorBeingDeleted (this);
}
@@ -1194,7 +1195,7 @@ public:
Component* const topComp = getTopLevelComponent();
if (topComp->getPeer() != 0)
if (topComp->getPeer() != nullptr)
{
const Point<int> pos (topComp->getLocalPoint (this, Point<int>()));
@@ -1257,7 +1258,7 @@ public:
{
ComponentPeer* const peer = getPeer();
if (peer != 0)
if (peer != nullptr)
{
const Point<int> pos (getScreenPosition() - peer->getScreenPosition());
peer->addMaskedRegion (pos.getX(), pos.getY(), getWidth(), getHeight());
@@ -1380,7 +1381,7 @@ private:
isOpen = true;
ERect* rect = 0;
ERect* rect = nullptr;
dispatch (effEditGetRect, 0, 0, &rect, 0);
dispatch (effEditOpen, 0, 0, parentWindow, 0);
@@ -1394,7 +1395,7 @@ private:
// double-check it's not too tiny
int w = 250, h = 150;
if (rect != 0)
if (rect != nullptr)
{
w = rect->right - rect->left;
h = rect->bottom - rect->top;
@@ -1424,7 +1425,7 @@ private:
log ("Opening VST UI: " + plugin.name);
isOpen = true;
ERect* rect = 0;
ERect* rect = nullptr;
dispatch (effEditGetRect, 0, 0, &rect, 0);
dispatch (effEditOpen, 0, 0, getWindowHandle(), 0);
@@ -1462,7 +1463,7 @@ private:
w = r.right - r.left;
h = r.bottom - r.top;
if (rect != 0)
if (rect != nullptr)
{
const int rw = rect->right - rect->left;
const int rh = rect->bottom - rect->top;
@@ -1499,7 +1500,7 @@ private:
int w = 250, h = 150;
if (rect != 0)
if (rect != nullptr)
{
w = rect->right - rect->left;
h = rect->bottom - rect->top;
@@ -1810,7 +1811,7 @@ private:
bool getEmbeddedViewSize (int& w, int& h)
{
ERect* rect = 0;
ERect* rect = nullptr;
owner->dispatch (effEditGetRect, 0, 0, &rect, 0);
w = rect->right - rect->left;
h = rect->bottom - rect->top;
@@ -1836,7 +1837,7 @@ private:
{
ComponentPeer* const peer = getPeer();
if (peer != 0)
if (peer != nullptr)
{
const Point<int> pos (getScreenPosition() - peer->getScreenPosition());
ERect r;
@@ -2110,10 +2111,10 @@ void VSTPluginInstance::getChunkData (MemoryBlock& mb, bool isPreset, int maxSiz
{
if (usesChunks())
{
void* data = 0;
void* data = nullptr;
const int bytes = dispatch (effGetChunk, isPreset ? 1 : 0, 0, &data, 0.0f);
if (data != 0 && bytes <= maxSizeMB * 1024 * 1024)
if (data != nullptr && bytes <= maxSizeMB * 1024 * 1024)
{
mb.setSize (bytes);
mb.copyFrom (data, 0, bytes);
@@ -2217,7 +2218,7 @@ namespace
{
String hostName ("Juce VST Host");
if (JUCEApplication::getInstance() != 0)
if (JUCEApplication::getInstance() != nullptr)
hostName = JUCEApplication::getInstance()->getApplicationName();
hostName.copyToUTF8 ((char*) ptr, jmin (kVstMaxVendorStrLen, kVstMaxProductStrLen) - 1);
@@ -2268,7 +2269,7 @@ VstIntPtr VSTPluginInstance::handleCallback (VstInt32 opcode, VstInt32 index, Vs
{
++insideVSTCallback;
#if JUCE_MAC
if (getActiveEditor() != 0)
if (getActiveEditor() != nullptr)
dispatch (effEditIdle, 0, 0, 0, 0);
#endif
juce_callAnyTimersSynchronously();
@@ -2295,7 +2296,7 @@ VstIntPtr VSTPluginInstance::handleCallback (VstInt32 opcode, VstInt32 index, Vs
break;
case audioMasterSizeWindow:
if (getActiveEditor() != 0)
if (getActiveEditor() != nullptr)
getActiveEditor()->setSize (index, value);
return 1;
@@ -2358,7 +2359,7 @@ static VstIntPtr VSTCALLBACK audioMaster (AEffect* effect, VstInt32 opcode, VstI
{
try
{
if (effect != 0 && effect->resvd2 != 0)
if (effect != nullptr && effect->resvd2 != 0)
{
return ((VSTPluginInstance*)(effect->resvd2))
->handleCallback (opcode, index, value, ptr, opt);
@@ -2409,7 +2410,7 @@ const String VSTPluginInstance::getVersion() const
int VSTPluginInstance::getUID() const
{
int uid = effect != 0 ? effect->uniqueID : 0;
int uid = effect != nullptr ? effect->uniqueID : 0;
if (uid == 0)
uid = module->file.hashCode();
@@ -2419,7 +2420,7 @@ int VSTPluginInstance::getUID() const
const String VSTPluginInstance::getCategory() const
{
const char* result = 0;
const char* result = nullptr;
switch (dispatch (effGetPlugCategory, 0, 0, 0, 0))
{
@@ -2441,7 +2442,7 @@ const String VSTPluginInstance::getCategory() const
//==============================================================================
float VSTPluginInstance::getParameter (int index)
{
if (effect != 0 && isPositiveAndBelow (index, (int) effect->numParams))
if (effect != nullptr && isPositiveAndBelow (index, (int) effect->numParams))
{
try
{
@@ -2458,7 +2459,7 @@ float VSTPluginInstance::getParameter (int index)
void VSTPluginInstance::setParameter (int index, float newValue)
{
if (effect != 0 && isPositiveAndBelow (index, (int) effect->numParams))
if (effect != nullptr && isPositiveAndBelow (index, (int) effect->numParams))
{
try
{
@@ -2475,7 +2476,7 @@ void VSTPluginInstance::setParameter (int index, float newValue)
const String VSTPluginInstance::getParameterName (int index)
{
if (effect != 0)
if (effect != nullptr)
{
jassert (index >= 0 && index < effect->numParams);
@@ -2489,7 +2490,7 @@ const String VSTPluginInstance::getParameterName (int index)
const String VSTPluginInstance::getParameterLabel (int index) const
{
if (effect != 0)
if (effect != nullptr)
{
jassert (index >= 0 && index < effect->numParams);
@@ -2503,7 +2504,7 @@ const String VSTPluginInstance::getParameterLabel (int index) const
const String VSTPluginInstance::getParameterText (int index)
{
if (effect != 0)
if (effect != nullptr)
{
jassert (index >= 0 && index < effect->numParams);
@@ -2517,7 +2518,7 @@ const String VSTPluginInstance::getParameterText (int index)
bool VSTPluginInstance::isParameterAutomatable (int index) const
{
if (effect != 0)
if (effect != nullptr)
{
jassert (index >= 0 && index < effect->numParams);
return dispatch (effCanBeAutomated, index, 0, 0, 0) != 0;
@@ -2560,7 +2561,7 @@ const String VSTPluginInstance::getProgramName (int index)
{
return getCurrentProgramName();
}
else if (effect != 0)
else if (effect != nullptr)
{
char nm [256] = { 0 };
@@ -2590,7 +2591,7 @@ void VSTPluginInstance::changeProgramName (int index, const String& newName)
void VSTPluginInstance::updateStoredProgramNames()
{
if (effect != 0 && getNumPrograms() > 0)
if (effect != nullptr && getNumPrograms() > 0)
{
char nm [256] = { 0 };
@@ -2615,7 +2616,7 @@ void VSTPluginInstance::updateStoredProgramNames()
const String VSTPluginInstance::getCurrentProgramName()
{
if (effect != 0)
if (effect != nullptr)
{
char nm [256] = { 0 };
dispatch (effGetProgramName, 0, 0, nm, 0);
@@ -2815,20 +2816,20 @@ AudioPluginInstance* VSTPluginFormat::createInstanceFromDescription (const Plugi
const ReferenceCountedObjectPtr <ModuleHandle> module (ModuleHandle::findOrCreateModule (file));
if (module != 0)
if (module != nullptr)
{
shellUIDToCreate = desc.uid;
result = new VSTPluginInstance (module);
if (result->effect != 0)
if (result->effect != nullptr)
{
result->effect->resvd2 = (VstIntPtr) (pointer_sized_int) (VSTPluginInstance*) result;
result->initialise();
}
else
{
result = 0;
result = nullptr;
}
}


+ 1
- 1
src/audio/plugins/juce_AudioPluginFormat.cpp View File

@@ -31,7 +31,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
AudioPluginFormat::AudioPluginFormat() throw()
AudioPluginFormat::AudioPluginFormat() noexcept
{
}


+ 1
- 1
src/audio/plugins/juce_AudioPluginFormat.h View File

@@ -107,7 +107,7 @@ public:
protected:
//==============================================================================
AudioPluginFormat() throw();
AudioPluginFormat() noexcept;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginFormat);
};


+ 25
- 25
src/audio/plugins/juce_AudioPluginFormatManager.cpp View File

@@ -52,43 +52,43 @@ juce_ImplementSingleton_SingleThreaded (AudioPluginFormatManager);
//==============================================================================
void AudioPluginFormatManager::addDefaultFormats()
{
#if JUCE_DEBUG
#if JUCE_DEBUG
// you should only call this method once!
for (int i = formats.size(); --i >= 0;)
{
#if JUCE_PLUGINHOST_VST && ! (JUCE_MAC && JUCE_64BIT)
jassert (dynamic_cast <VSTPluginFormat*> (formats[i]) == 0);
#endif
#if JUCE_PLUGINHOST_VST && ! (JUCE_MAC && JUCE_64BIT)
jassert (dynamic_cast <VSTPluginFormat*> (formats[i]) == nullptr);
#endif
#if JUCE_PLUGINHOST_AU && JUCE_MAC
jassert (dynamic_cast <AudioUnitPluginFormat*> (formats[i]) == 0);
#endif
#if JUCE_PLUGINHOST_AU && JUCE_MAC
jassert (dynamic_cast <AudioUnitPluginFormat*> (formats[i]) == nullptr);
#endif
#if JUCE_PLUGINHOST_DX && JUCE_WINDOWS
jassert (dynamic_cast <DirectXPluginFormat*> (formats[i]) == 0);
#endif
#if JUCE_PLUGINHOST_DX && JUCE_WINDOWS
jassert (dynamic_cast <DirectXPluginFormat*> (formats[i]) == nullptr);
#endif
#if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX
jassert (dynamic_cast <LADSPAPluginFormat*> (formats[i]) == 0);
#endif
#if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX
jassert (dynamic_cast <LADSPAPluginFormat*> (formats[i]) == nullptr);
#endif
}
#endif
#endif
#if JUCE_PLUGINHOST_AU && JUCE_MAC
#if JUCE_PLUGINHOST_AU && JUCE_MAC
formats.add (new AudioUnitPluginFormat());
#endif
#endif
#if JUCE_PLUGINHOST_VST && ! (JUCE_MAC && JUCE_64BIT)
#if JUCE_PLUGINHOST_VST && ! (JUCE_MAC && JUCE_64BIT)
formats.add (new VSTPluginFormat());
#endif
#endif
#if JUCE_PLUGINHOST_DX && JUCE_WINDOWS
#if JUCE_PLUGINHOST_DX && JUCE_WINDOWS
formats.add (new DirectXPluginFormat());
#endif
#endif
#if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX
#if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX
formats.add (new LADSPAPluginFormat());
#endif
#endif
}
int AudioPluginFormatManager::getNumFormats()
@@ -109,17 +109,17 @@ void AudioPluginFormatManager::addFormat (AudioPluginFormat* const format)
AudioPluginInstance* AudioPluginFormatManager::createPluginInstance (const PluginDescription& description,
String& errorMessage) const
{
AudioPluginInstance* result = 0;
AudioPluginInstance* result = nullptr;
for (int i = 0; i < formats.size(); ++i)
{
result = formats.getUnchecked(i)->createInstanceFromDescription (description);
if (result != 0)
if (result != nullptr)
break;
}
if (result == 0)
if (result == nullptr)
{
if (! doesPluginStillExist (description))
errorMessage = TRANS ("This plug-in file no longer exists");


+ 4
- 4
src/audio/plugins/juce_KnownPluginList.cpp View File

@@ -103,7 +103,7 @@ namespace
return Time();
}
bool timesAreDifferent (const Time& t1, const Time& t2) throw()
bool timesAreDifferent (const Time& t1, const Time& t2) noexcept
{
return t1 != t2 || t1 == Time();
}
@@ -136,7 +136,7 @@ bool KnownPluginList::scanAndAddFile (const String& fileOrIdentifier,
bool addedOne = false;
if (dontRescanIfAlreadyInList
&& getTypeForFile (fileOrIdentifier) != 0)
&& getTypeForFile (fileOrIdentifier) != nullptr)
{
bool needsRescanning = false;
@@ -163,7 +163,7 @@ bool KnownPluginList::scanAndAddFile (const String& fileOrIdentifier,
for (int i = 0; i < found.size(); ++i)
{
PluginDescription* const desc = found.getUnchecked(i);
jassert (desc != 0);
jassert (desc != nullptr);
if (addType (*desc))
addedOne = true;
@@ -217,7 +217,7 @@ class PluginSorter
public:
KnownPluginList::SortMethod method;
PluginSorter() throw() {}
PluginSorter() noexcept {}
int compareElements (const PluginDescription* const first,
const PluginDescription* const second) const


+ 2
- 2
src/audio/plugins/juce_KnownPluginList.h View File

@@ -59,12 +59,12 @@ public:
/** Returns the number of types currently in the list.
@see getType
*/
int getNumTypes() const throw() { return types.size(); }
int getNumTypes() const noexcept { return types.size(); }
/** Returns one of the types.
@see getNumTypes
*/
PluginDescription* getType (int index) const throw() { return types [index]; }
PluginDescription* getType (int index) const noexcept { return types [index]; }
/** Looks for a type in the list which comes from this file.
*/


+ 1
- 1
src/audio/plugins/juce_PluginDirectoryScanner.h View File

@@ -103,7 +103,7 @@ public:
/** This returns a list of all the filenames of things that looked like being
a plugin file, but which failed to open for some reason.
*/
const StringArray& getFailedFiles() const throw() { return failedFiles; }
const StringArray& getFailedFiles() const noexcept { return failedFiles; }
private:
//==============================================================================


+ 7
- 7
src/audio/plugins/juce_PluginListComponent.cpp View File

@@ -55,7 +55,7 @@ PluginListComponent::PluginListComponent (KnownPluginList& listToEdit,
setSize (400, 600);
list.addChangeListener (this);
changeListenerCallback (0);
changeListenerCallback (nullptr);
}
PluginListComponent::~PluginListComponent()
@@ -91,7 +91,7 @@ void PluginListComponent::paintListBoxItem (int row,
const PluginDescription* const pd = list.getType (row);
if (pd != 0)
if (pd != nullptr)
{
GlyphArrangement ga;
ga.addCurtailedLineOfText (Font (height * 0.7f, Font::bold), pd->name, 8.0f, height * 0.8f, width - 10.0f, true);
@@ -166,7 +166,7 @@ void PluginListComponent::optionsMenuCallback (int result)
{
const PluginDescription* const desc = list.getType (listBox.getSelectedRow());
if (desc != 0)
if (desc != nullptr)
{
if (File (desc->fileOrIdentifier).existsAsFile())
File (desc->fileOrIdentifier).getParentDirectory().startAsProcess();
@@ -195,7 +195,7 @@ void PluginListComponent::optionsMenuCallback (int result)
void PluginListComponent::optionsMenuStaticCallback (int result, PluginListComponent* pluginList)
{
if (pluginList != 0)
if (pluginList != nullptr)
pluginList->optionsMenuCallback (result);
}
@@ -247,12 +247,12 @@ void PluginListComponent::filesDropped (const StringArray& files, int, int)
void PluginListComponent::scanFor (AudioPluginFormat* format)
{
#if JUCE_MODAL_LOOPS_PERMITTED
if (format == 0)
if (format == nullptr)
return;
FileSearchPath path (format->getDefaultLocationsToSearch());
if (propertiesToUse != 0)
if (propertiesToUse != nullptr)
path = propertiesToUse->getValue ("lastPluginScanPath_" + format->getName(), path.toString());
{
@@ -271,7 +271,7 @@ void PluginListComponent::scanFor (AudioPluginFormat* format)
path = pathList.getPath();
}
if (propertiesToUse != 0)
if (propertiesToUse != nullptr)
{
propertiesToUse->setValue ("lastPluginScanPath_" + format->getName(), path.toString());
propertiesToUse->saveIfNeeded();


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save