@@ -86,9 +86,9 @@ public: | |||||
void shutdown() | void shutdown() | ||||
{ | { | ||||
#if JUCE_MAC | #if JUCE_MAC | ||||
MenuBarModel::setMacMainMenu (0); | |||||
MenuBarModel::setMacMainMenu (nullptr); | |||||
#endif | #endif | ||||
menuModel = 0; | |||||
menuModel = nullptr; | |||||
StoredSettings::deleteInstance(); | StoredSettings::deleteInstance(); | ||||
mainWindows.clear(); | mainWindows.clear(); | ||||
@@ -365,7 +365,7 @@ public: | |||||
MainWindow* mw = createNewMainWindow (false); | MainWindow* mw = createNewMainWindow (false); | ||||
ScopedPointer <Project> newProj (NewProjectWizard::runNewProjectWizard (mw)); | ScopedPointer <Project> newProj (NewProjectWizard::runNewProjectWizard (mw)); | ||||
if (newProj != 0) | |||||
if (newProj != nullptr) | |||||
{ | { | ||||
mw->setProject (newProj.release()); | mw->setProject (newProj.release()); | ||||
mw->setVisible (true); | mw->setVisible (true); | ||||
@@ -388,7 +388,7 @@ public: | |||||
{ | { | ||||
for (int j = mainWindows.size(); --j >= 0;) | 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)->getProject()->getFile() == file) | ||||
{ | { | ||||
mainWindows.getUnchecked(j)->toFront (true); | mainWindows.getUnchecked(j)->toFront (true); | ||||
@@ -442,7 +442,7 @@ public: | |||||
{ | { | ||||
MainWindow* mw = mainWindows[i]; | MainWindow* mw = mainWindows[i]; | ||||
if (mw != 0 && mw->getProject() != 0) | |||||
if (mw != nullptr && mw->getProject() != nullptr) | |||||
projects.add (mw->getProject()->getFile()); | projects.add (mw->getProject()->getFile()); | ||||
} | } | ||||
@@ -494,7 +494,7 @@ private: | |||||
for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) | for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) | ||||
{ | { | ||||
MainWindow* mw = dynamic_cast <MainWindow*> (Desktop::getInstance().getComponent (i)); | 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; | return mw; | ||||
} | } | ||||
@@ -43,10 +43,10 @@ void DocumentEditorComponent::documentAboutToClose (OpenDocumentManager::Documen | |||||
{ | { | ||||
if (document == closingDoc) | if (document == closingDoc) | ||||
{ | { | ||||
jassert (document != 0); | |||||
jassert (document != nullptr); | |||||
ProjectContentComponent* pcc = findParentComponentOfClass ((ProjectContentComponent*) 0); | ProjectContentComponent* pcc = findParentComponentOfClass ((ProjectContentComponent*) 0); | ||||
if (pcc != 0) | |||||
if (pcc != nullptr) | |||||
{ | { | ||||
pcc->hideDocument (document); | pcc->hideDocument (document); | ||||
return; | return; | ||||
@@ -72,10 +72,10 @@ void DocumentEditorComponent::getAllCommands (Array <CommandID>& commands) | |||||
void DocumentEditorComponent::getCommandInfo (const CommandID commandID, ApplicationCommandInfo& result) | void DocumentEditorComponent::getCommandInfo (const CommandID commandID, ApplicationCommandInfo& result) | ||||
{ | { | ||||
result.setActive (document != 0); | |||||
result.setActive (document != nullptr); | |||||
String name; | String name; | ||||
if (document != 0) | |||||
if (document != nullptr) | |||||
name = " '" + document->getName().substring (0, 32) + "'"; | name = " '" + document->getName().substring (0, 32) + "'"; | ||||
switch (commandID) | switch (commandID) | ||||
@@ -42,14 +42,14 @@ void ItemPreviewComponent::tryToLoadImage() | |||||
ScopedPointer <InputStream> input (file.createInputStream()); | ScopedPointer <InputStream> input (file.createInputStream()); | ||||
if (input != 0) | |||||
if (input != nullptr) | |||||
{ | { | ||||
const int64 totalSize = input->getTotalLength(); | const int64 totalSize = input->getTotalLength(); | ||||
ImageFileFormat* format = ImageFileFormat::findImageFormatForStream (*input); | ImageFileFormat* format = ImageFileFormat::findImageFormatForStream (*input); | ||||
input = 0; | |||||
input = nullptr; | |||||
String formatName; | String formatName; | ||||
if (format != 0) | |||||
if (format != nullptr) | |||||
formatName = " " + format->getFormatName(); | formatName = " " + format->getFormatName(); | ||||
image = ImageCache::getFromFile (file); | image = ImageCache::getFromFile (file); | ||||
@@ -128,7 +128,7 @@ void JuceUpdater::buttonClicked (Button*) | |||||
{ | { | ||||
ScopedPointer<XmlElement> xml (downloadVersionList()); | ScopedPointer<XmlElement> xml (downloadVersionList()); | ||||
if (xml == 0 || xml->hasTagName ("html")) | |||||
if (xml == nullptr || xml->hasTagName ("html")) | |||||
{ | { | ||||
AlertWindow::showMessageBox (AlertWindow::WarningIcon, "Connection Problems...", | AlertWindow::showMessageBox (AlertWindow::WarningIcon, "Connection Problems...", | ||||
"Couldn't connect to the Raw Material Software website!"); | "Couldn't connect to the Raw Material Software website!"); | ||||
@@ -166,7 +166,7 @@ public: | |||||
ScopedPointer<InputStream> input (url.createInputStream (false)); | ScopedPointer<InputStream> input (url.createInputStream (false)); | ||||
if (input == 0) | |||||
if (input == nullptr) | |||||
{ | { | ||||
error = "Couldn't connect to the website..."; | error = "Couldn't connect to the website..."; | ||||
return; | return; | ||||
@@ -180,7 +180,7 @@ public: | |||||
ScopedPointer<OutputStream> output (target.createOutputStream (32768)); | ScopedPointer<OutputStream> output (target.createOutputStream (32768)); | ||||
if (output == 0) | |||||
if (output == nullptr) | |||||
{ | { | ||||
error = "Couldn't write to the destination file..."; | error = "Couldn't write to the destination file..."; | ||||
return; | return; | ||||
@@ -336,7 +336,9 @@ Component* JuceUpdater::refreshComponentForRow (int rowNumber, bool isRowSelecte | |||||
{ | { | ||||
public: | public: | ||||
UpdateListComponent (JuceUpdater& updater_) | UpdateListComponent (JuceUpdater& updater_) | ||||
: updater (updater_), version (0), applyButton ("Install this version...") | |||||
: updater (updater_), | |||||
version (nullptr), | |||||
applyButton ("Install this version...") | |||||
{ | { | ||||
addAndMakeVisible (&applyButton); | addAndMakeVisible (&applyButton); | ||||
applyButton.addListener (this); | applyButton.addListener (this); | ||||
@@ -360,7 +362,7 @@ Component* JuceUpdater::refreshComponentForRow (int rowNumber, bool isRowSelecte | |||||
void paint (Graphics& g) | void paint (Graphics& g) | ||||
{ | { | ||||
if (version != 0) | |||||
if (version != nullptr) | |||||
{ | { | ||||
g.setColour (Colours::green.withAlpha (0.12f)); | g.setColour (Colours::green.withAlpha (0.12f)); | ||||
@@ -379,7 +381,7 @@ Component* JuceUpdater::refreshComponentForRow (int rowNumber, bool isRowSelecte | |||||
{ | { | ||||
applyButton.changeWidthToFitText (getHeight() - 4); | applyButton.changeWidthToFitText (getHeight() - 4); | ||||
applyButton.setTopRightPosition (getWidth(), 2); | applyButton.setTopRightPosition (getWidth(), 2); | ||||
applyButton.setVisible (version != 0); | |||||
applyButton.setVisible (version != nullptr); | |||||
} | } | ||||
void buttonClicked (Button*) | void buttonClicked (Button*) | ||||
@@ -394,7 +396,7 @@ Component* JuceUpdater::refreshComponentForRow (int rowNumber, bool isRowSelecte | |||||
}; | }; | ||||
UpdateListComponent* c = dynamic_cast <UpdateListComponent*> (existingComponentToUpdate); | UpdateListComponent* c = dynamic_cast <UpdateListComponent*> (existingComponentToUpdate); | ||||
if (c == 0) | |||||
if (c == nullptr) | |||||
c = new UpdateListComponent (*this); | c = new UpdateListComponent (*this); | ||||
c->setVersion (availableVersions [rowNumber]); | c->setVersion (availableVersions [rowNumber]); | ||||
@@ -30,7 +30,7 @@ | |||||
#include "../Code Editor/jucer_SourceCodeEditor.h" | #include "../Code Editor/jucer_SourceCodeEditor.h" | ||||
#include "../Project/jucer_NewProjectWizard.h" | #include "../Project/jucer_NewProjectWizard.h" | ||||
ApplicationCommandManager* commandManager = 0; | |||||
ApplicationCommandManager* commandManager = nullptr; | |||||
//============================================================================== | //============================================================================== | ||||
@@ -59,7 +59,7 @@ MainWindow::MainWindow() | |||||
ProjectContentComponent pcc; | ProjectContentComponent pcc; | ||||
commandManager->registerAllCommandsForTarget (&pcc); | commandManager->registerAllCommandsForTarget (&pcc); | ||||
DocumentEditorComponent dec (0); | |||||
DocumentEditorComponent dec (nullptr); | |||||
commandManager->registerAllCommandsForTarget (&dec); | commandManager->registerAllCommandsForTarget (&dec); | ||||
} | } | ||||
@@ -67,7 +67,7 @@ MainWindow::MainWindow() | |||||
ScopedPointer <XmlElement> keys (StoredSettings::getInstance()->getProps().getXmlValue ("keyMappings")); | ScopedPointer <XmlElement> keys (StoredSettings::getInstance()->getProps().getXmlValue ("keyMappings")); | ||||
if (keys != 0) | |||||
if (keys != nullptr) | |||||
commandManager->getKeyMappings()->restoreFromXml (*keys); | commandManager->getKeyMappings()->restoreFromXml (*keys); | ||||
addKeyListener (commandManager->getKeyMappings()); | addKeyListener (commandManager->getKeyMappings()); | ||||
@@ -81,9 +81,9 @@ MainWindow::MainWindow() | |||||
MainWindow::~MainWindow() | MainWindow::~MainWindow() | ||||
{ | { | ||||
#if ! JUCE_MAC | |||||
setMenuBar (0); | |||||
#endif | |||||
#if ! JUCE_MAC | |||||
setMenuBar (nullptr); | |||||
#endif | |||||
removeKeyListener (commandManager->getKeyMappings()); | removeKeyListener (commandManager->getKeyMappings()); | ||||
@@ -92,7 +92,7 @@ MainWindow::~MainWindow() | |||||
.setValue ("lastMainWindowPos", getWindowStateAsString()); | .setValue ("lastMainWindowPos", getWindowStateAsString()); | ||||
clearContentComponent(); | clearContentComponent(); | ||||
currentProject = 0; | |||||
currentProject = nullptr; | |||||
} | } | ||||
ProjectContentComponent* MainWindow::getProjectContentComponent() const | ProjectContentComponent* MainWindow::getProjectContentComponent() const | ||||
@@ -111,9 +111,9 @@ void MainWindow::closeButtonPressed() | |||||
bool MainWindow::closeProject (Project* project) | bool MainWindow::closeProject (Project* project) | ||||
{ | { | ||||
jassert (project == currentProject && project != 0); | |||||
jassert (project == currentProject && project != nullptr); | |||||
if (project == 0) | |||||
if (project == nullptr) | |||||
return true; | return true; | ||||
StoredSettings::getInstance()->getProps() | StoredSettings::getInstance()->getProps() | ||||
@@ -126,7 +126,7 @@ bool MainWindow::closeProject (Project* project) | |||||
if (r == FileBasedDocument::savedOk) | if (r == FileBasedDocument::savedOk) | ||||
{ | { | ||||
setProject (0); | |||||
setProject (nullptr); | |||||
return true; | return true; | ||||
} | } | ||||
@@ -135,7 +135,7 @@ bool MainWindow::closeProject (Project* project) | |||||
bool MainWindow::closeCurrentProject() | bool MainWindow::closeCurrentProject() | ||||
{ | { | ||||
return currentProject == 0 || closeProject (currentProject); | |||||
return currentProject == nullptr || closeProject (currentProject); | |||||
} | } | ||||
void MainWindow::setProject (Project* newProject) | 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, | // (mustn't do this when the project is 0, because that'll happen on shutdown, | ||||
// which will erase the list of recent projects) | // which will erase the list of recent projects) | ||||
if (newProject != 0) | |||||
if (newProject != nullptr) | |||||
static_cast<JucerApplication*> (JUCEApplication::getInstance())->updateRecentProjectList(); | static_cast<JucerApplication*> (JUCEApplication::getInstance())->updateRecentProjectList(); | ||||
} | } | ||||
@@ -154,7 +154,7 @@ void MainWindow::restoreWindowPosition() | |||||
{ | { | ||||
String windowState; | String windowState; | ||||
if (currentProject != 0) | |||||
if (currentProject != nullptr) | |||||
windowState = StoredSettings::getInstance()->getProps().getValue (getProjectWindowPosName()); | windowState = StoredSettings::getInstance()->getProps().getValue (getProjectWindowPosName()); | ||||
if (windowState.isEmpty()) | if (windowState.isEmpty()) | ||||
@@ -217,7 +217,7 @@ void MainWindow::activeWindowStatusChanged() | |||||
{ | { | ||||
DocumentWindow::activeWindowStatusChanged(); | DocumentWindow::activeWindowStatusChanged(); | ||||
if (getProjectContentComponent() != 0) | |||||
if (getProjectContentComponent() != nullptr) | |||||
getProjectContentComponent()->updateMissingFileStatuses(); | getProjectContentComponent()->updateMissingFileStatuses(); | ||||
OpenDocumentManager::getInstance()->reloadModifiedFiles(); | OpenDocumentManager::getInstance()->reloadModifiedFiles(); | ||||
@@ -76,8 +76,8 @@ private: | |||||
const String getProjectWindowPosName() const | const String getProjectWindowPosName() const | ||||
{ | { | ||||
jassert (currentProject != 0); | |||||
if (currentProject == 0) | |||||
jassert (currentProject != nullptr); | |||||
if (currentProject == nullptr) | |||||
return String::empty; | return String::empty; | ||||
return "projectWindowPos_" + currentProject->getProjectUID(); | return "projectWindowPos_" + currentProject->getProjectUID(); | ||||
@@ -62,7 +62,7 @@ public: | |||||
bool refersToProject (Project& project) const { return false; } | bool refersToProject (Project& project) const { return false; } | ||||
const String getName() const { return modDetector.getFile().getFileName(); } | const String getName() const { return modDetector.getFile().getFileName(); } | ||||
const String getType() const { return modDetector.getFile().getFileExtension() + " file"; } | 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(); } | bool hasFileBeenModifiedExternally() { return modDetector.hasBeenModified(); } | ||||
void fileHasBeenRenamed (const File& newFile) { modDetector.fileHasBeenRenamed (newFile); } | void fileHasBeenRenamed (const File& newFile) { modDetector.fileHasBeenRenamed (newFile); } | ||||
@@ -72,7 +72,7 @@ public: | |||||
ScopedPointer <InputStream> in (modDetector.getFile().createInputStream()); | ScopedPointer <InputStream> in (modDetector.getFile().createInputStream()); | ||||
if (in != 0) | |||||
if (in != nullptr) | |||||
codeDoc->loadFromStream (*in); | codeDoc->loadFromStream (*in); | ||||
} | } | ||||
@@ -81,10 +81,10 @@ public: | |||||
TemporaryFile temp (modDetector.getFile()); | TemporaryFile temp (modDetector.getFile()); | ||||
ScopedPointer <FileOutputStream> out (temp.getFile().createOutputStream()); | ScopedPointer <FileOutputStream> out (temp.getFile().createOutputStream()); | ||||
if (out == 0 || ! codeDoc->writeToStream (*out)) | |||||
if (out == nullptr || ! codeDoc->writeToStream (*out)) | |||||
return false; | return false; | ||||
out = 0; | |||||
out = nullptr; | |||||
if (! temp.overwriteTargetFileWithTemporary()) | if (! temp.overwriteTargetFileWithTemporary()) | ||||
return false; | return false; | ||||
@@ -94,7 +94,7 @@ public: | |||||
Component* createEditor() | Component* createEditor() | ||||
{ | { | ||||
CodeTokeniser* tokeniser = 0; | |||||
CodeTokeniser* tokeniser = nullptr; | |||||
if (SourceCodeEditor::isCppFile (modDetector.getFile())) | if (SourceCodeEditor::isCppFile (modDetector.getFile())) | ||||
tokeniser = &cppTokeniser; | tokeniser = &cppTokeniser; | ||||
@@ -212,20 +212,20 @@ OpenDocumentManager::Document* OpenDocumentManager::getDocumentForFile (Project* | |||||
if (documents.getUnchecked(i)->isForFile (file)) | if (documents.getUnchecked(i)->isForFile (file)) | ||||
return documents.getUnchecked(i); | 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)) | if (types.getUnchecked(i)->canOpenFile (file)) | ||||
{ | { | ||||
d = types.getUnchecked(i)->openFile (project, 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); | documents.add (d); | ||||
commandManager->commandStatusChanged(); | commandManager->commandStatusChanged(); | ||||
@@ -288,7 +288,7 @@ bool OpenDocumentManager::closeDocument (int index, bool saveIfNeeded) | |||||
{ | { | ||||
Document* doc = documents [index]; | Document* doc = documents [index]; | ||||
if (doc != 0) | |||||
if (doc != nullptr) | |||||
{ | { | ||||
if (saveIfNeeded) | if (saveIfNeeded) | ||||
{ | { | ||||
@@ -140,7 +140,7 @@ Component* GroupInformationComponent::refreshComponentForRow (int rowNumber, boo | |||||
{ | { | ||||
Project::Item child (item.getChild (rowNumber)); | Project::Item child (item.getChild (rowNumber)); | ||||
if (existingComponentToUpdate == 0 | |||||
if (existingComponentToUpdate == nullptr | |||||
|| dynamic_cast <FileOptionComponent*> (existingComponentToUpdate)->item != child) | || dynamic_cast <FileOptionComponent*> (existingComponentToUpdate)->item != child) | ||||
{ | { | ||||
delete existingComponentToUpdate; | delete existingComponentToUpdate; | ||||
@@ -169,7 +169,7 @@ bool NewFileWizard::runWizardFromMenu (int chosenMenuItemID, const Project::Item | |||||
{ | { | ||||
Type* wiz = wizards [chosenMenuItemID - menuBaseID]; | Type* wiz = wizards [chosenMenuItemID - menuBaseID]; | ||||
if (wiz != 0) | |||||
if (wiz != nullptr) | |||||
{ | { | ||||
wiz->createNewFile (projectGroupToAddTo); | wiz->createNewFile (projectGroupToAddTo); | ||||
return true; | return true; | ||||
@@ -490,5 +490,5 @@ Project* NewProjectWizard::runNewProjectWizard (Component* ownerWindow) | |||||
} | } | ||||
} | } | ||||
return wizard != 0 ? wizard->runWizard (ownerWindow) : 0; | |||||
return wizard != nullptr ? wizard->runWizard (ownerWindow) : 0; | |||||
} | } |
@@ -159,7 +159,7 @@ const String Project::loadDocument (const File& file) | |||||
{ | { | ||||
ScopedPointer <XmlElement> xml (XmlDocument::parse (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!"; | return "Not a valid Jucer project!"; | ||||
ValueTree newTree (ValueTree::fromXml (*xml)); | ValueTree newTree (ValueTree::fromXml (*xml)); | ||||
@@ -304,7 +304,7 @@ const File Project::getLocalJuceFolder() | |||||
{ | { | ||||
ScopedPointer <ProjectExporter> exp (ProjectExporter::createPlatformDefaultExporter (*this)); | ScopedPointer <ProjectExporter> exp (ProjectExporter::createPlatformDefaultExporter (*this)); | ||||
if (exp != 0) | |||||
if (exp != nullptr) | |||||
{ | { | ||||
File f (resolveFilename (exp->getJuceFolder().toString())); | File f (resolveFilename (exp->getJuceFolder().toString())); | ||||
@@ -925,8 +925,8 @@ const String Project::getUniqueConfigName (String name) const | |||||
void Project::addNewConfiguration (BuildConfiguration* configToCopy) | 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()); | ValueTree configs (getConfigurations()); | ||||
@@ -937,7 +937,7 @@ void Project::addNewConfiguration (BuildConfiguration* configToCopy) | |||||
} | } | ||||
ValueTree newConfig (Tags::configuration); | ValueTree newConfig (Tags::configuration); | ||||
if (configToCopy != 0) | |||||
if (configToCopy != nullptr) | |||||
newConfig = configToCopy->config.createCopy(); | newConfig = configToCopy->config.createCopy(); | ||||
newConfig.setProperty (Ids::name, configName, 0); | newConfig.setProperty (Ids::name, configName, 0); | ||||
@@ -955,7 +955,7 @@ void Project::createDefaultConfigs() | |||||
{ | { | ||||
for (int i = 0; i < 2; ++i) | for (int i = 0; i < 2; ++i) | ||||
{ | { | ||||
addNewConfiguration (0); | |||||
addNewConfiguration (nullptr); | |||||
BuildConfiguration config = getConfiguration (i); | BuildConfiguration config = getConfiguration (i); | ||||
const bool debugConfig = i == 0; | const bool debugConfig = i == 0; | ||||
@@ -1128,7 +1128,7 @@ const String Project::getFileTemplate (const String& templateName) | |||||
int dataSize; | int dataSize; | ||||
const char* data = BinaryData::getNamedResource (templateName.toUTF8(), dataSize); | const char* data = BinaryData::getNamedResource (templateName.toUTF8(), dataSize); | ||||
if (data == 0) | |||||
if (data == nullptr) | |||||
{ | { | ||||
jassertfalse; | jassertfalse; | ||||
return String::empty; | return String::empty; | ||||
@@ -33,8 +33,8 @@ | |||||
//============================================================================== | //============================================================================== | ||||
ProjectContentComponent::ProjectContentComponent() | ProjectContentComponent::ProjectContentComponent() | ||||
: project (0), | |||||
currentDocument (0) | |||||
: project (nullptr), | |||||
currentDocument (nullptr) | |||||
{ | { | ||||
setOpaque (true); | setOpaque (true); | ||||
setWantsKeyboardFocus (true); | setWantsKeyboardFocus (true); | ||||
@@ -45,8 +45,8 @@ ProjectContentComponent::ProjectContentComponent() | |||||
ProjectContentComponent::~ProjectContentComponent() | ProjectContentComponent::~ProjectContentComponent() | ||||
{ | { | ||||
setProject (0); | |||||
contentView = 0; | |||||
setProject (nullptr); | |||||
contentView = nullptr; | |||||
jassert (getNumChildComponents() == 0); | jassert (getNumChildComponents() == 0); | ||||
} | } | ||||
@@ -59,22 +59,22 @@ void ProjectContentComponent::setProject (Project* newProject) | |||||
{ | { | ||||
if (project != newProject) | if (project != newProject) | ||||
{ | { | ||||
if (project != 0) | |||||
if (project != nullptr) | |||||
project->removeChangeListener (this); | project->removeChangeListener (this); | ||||
contentView = 0; | |||||
resizerBar = 0; | |||||
contentView = nullptr; | |||||
resizerBar = nullptr; | |||||
if (projectTree != 0) | |||||
if (projectTree != nullptr) | |||||
{ | { | ||||
StoredSettings::getInstance()->getProps().setValue ("projectTreeviewWidth", projectTree->getWidth()); | StoredSettings::getInstance()->getProps().setValue ("projectTreeviewWidth", projectTree->getWidth()); | ||||
projectTree->deleteRootItem(); | projectTree->deleteRootItem(); | ||||
projectTree = 0; | |||||
projectTree = nullptr; | |||||
} | } | ||||
project = newProject; | project = newProject; | ||||
if (project != 0) | |||||
if (project != nullptr) | |||||
{ | { | ||||
addAndMakeVisible (projectTree = new TreeView()); | addAndMakeVisible (projectTree = new TreeView()); | ||||
projectTree->setComponentID ("tree"); | projectTree->setComponentID ("tree"); | ||||
@@ -100,7 +100,7 @@ void ProjectContentComponent::setProject (Project* newProject) | |||||
project->addChangeListener (this); | project->addChangeListener (this); | ||||
if (currentDocument == 0) | |||||
if (currentDocument == nullptr) | |||||
invokeDirectly (CommandIDs::showProjectSettings, true); | invokeDirectly (CommandIDs::showProjectSettings, true); | ||||
updateMissingFileStatuses(); | updateMissingFileStatuses(); | ||||
@@ -115,10 +115,10 @@ void ProjectContentComponent::changeListenerCallback (ChangeBroadcaster*) | |||||
void ProjectContentComponent::updateMissingFileStatuses() | void ProjectContentComponent::updateMissingFileStatuses() | ||||
{ | { | ||||
if (projectTree != 0) | |||||
if (projectTree != nullptr) | |||||
{ | { | ||||
ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (projectTree->getRootItem()); | ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (projectTree->getRootItem()); | ||||
if (p != 0) | |||||
if (p != nullptr) | |||||
p->checkFileStatus(); | p->checkFileStatus(); | ||||
} | } | ||||
} | } | ||||
@@ -131,7 +131,7 @@ bool ProjectContentComponent::showEditorForFile (const File& f) | |||||
bool ProjectContentComponent::showDocument (OpenDocumentManager::Document* doc) | bool ProjectContentComponent::showDocument (OpenDocumentManager::Document* doc) | ||||
{ | { | ||||
if (doc == 0) | |||||
if (doc == nullptr) | |||||
return false; | return false; | ||||
OpenDocumentManager::getInstance()->moveDocumentToTopOfStack (doc); | OpenDocumentManager::getInstance()->moveDocumentToTopOfStack (doc); | ||||
@@ -146,8 +146,8 @@ void ProjectContentComponent::hideDocument (OpenDocumentManager::Document* doc) | |||||
{ | { | ||||
if (doc == currentDocument) | if (doc == currentDocument) | ||||
{ | { | ||||
currentDocument = 0; | |||||
contentView = 0; | |||||
currentDocument = nullptr; | |||||
contentView = nullptr; | |||||
updateMainWindowTitle(); | updateMainWindowTitle(); | ||||
commandManager->commandStatusChanged(); | commandManager->commandStatusChanged(); | ||||
} | } | ||||
@@ -155,7 +155,7 @@ void ProjectContentComponent::hideDocument (OpenDocumentManager::Document* doc) | |||||
bool ProjectContentComponent::setEditorComponent (Component* editor, OpenDocumentManager::Document* doc) | bool ProjectContentComponent::setEditorComponent (Component* editor, OpenDocumentManager::Document* doc) | ||||
{ | { | ||||
if (editor != 0) | |||||
if (editor != nullptr) | |||||
{ | { | ||||
contentView = editor; | contentView = editor; | ||||
currentDocument = doc; | currentDocument = doc; | ||||
@@ -176,8 +176,8 @@ void ProjectContentComponent::updateMainWindowTitle() | |||||
{ | { | ||||
MainWindow* mw = Component::findParentComponentOfClass ((MainWindow*) 0); | 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() | ApplicationCommandTarget* ProjectContentComponent::getNextCommandTarget() | ||||
@@ -206,7 +206,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica | |||||
result.setInfo ("Save Project", | result.setInfo ("Save Project", | ||||
"Saves the current project", | "Saves the current project", | ||||
CommandCategories::general, 0); | CommandCategories::general, 0); | ||||
result.setActive (project != 0); | |||||
result.setActive (project != nullptr); | |||||
result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier, 0)); | result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier, 0)); | ||||
break; | break; | ||||
@@ -214,7 +214,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica | |||||
result.setInfo ("Save Project As...", | result.setInfo ("Save Project As...", | ||||
"Saves the current project to a different filename", | "Saves the current project to a different filename", | ||||
CommandCategories::general, 0); | CommandCategories::general, 0); | ||||
result.setActive (project != 0); | |||||
result.setActive (project != nullptr); | |||||
result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); | result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); | ||||
break; | break; | ||||
@@ -222,7 +222,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica | |||||
result.setInfo ("Close Project", | result.setInfo ("Close Project", | ||||
"Closes the current project", | "Closes the current project", | ||||
CommandCategories::general, 0); | CommandCategories::general, 0); | ||||
result.setActive (project != 0); | |||||
result.setActive (project != nullptr); | |||||
result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); | result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); | ||||
break; | break; | ||||
@@ -236,7 +236,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica | |||||
#endif | #endif | ||||
"Launches the project in an external IDE", | "Launches the project in an external IDE", | ||||
CommandCategories::general, 0); | CommandCategories::general, 0); | ||||
result.setActive (project != 0); | |||||
result.setActive (project != nullptr); | |||||
break; | break; | ||||
case CommandIDs::saveAndOpenInIDE: | case CommandIDs::saveAndOpenInIDE: | ||||
@@ -249,7 +249,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica | |||||
#endif | #endif | ||||
"Saves the project and launches it in an external IDE", | "Saves the project and launches it in an external IDE", | ||||
CommandCategories::general, 0); | CommandCategories::general, 0); | ||||
result.setActive (project != 0); | |||||
result.setActive (project != nullptr); | |||||
result.defaultKeypresses.add (KeyPress ('l', ModifierKeys::commandModifier, 0)); | result.defaultKeypresses.add (KeyPress ('l', ModifierKeys::commandModifier, 0)); | ||||
break; | break; | ||||
@@ -257,7 +257,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica | |||||
result.setInfo ("Show Project Build Settings", | result.setInfo ("Show Project Build Settings", | ||||
"Shows the build options for the project", | "Shows the build options for the project", | ||||
CommandCategories::general, 0); | CommandCategories::general, 0); | ||||
result.setActive (project != 0); | |||||
result.setActive (project != nullptr); | |||||
result.defaultKeypresses.add (KeyPress ('i', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); | result.defaultKeypresses.add (KeyPress ('i', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); | ||||
break; | break; | ||||
@@ -265,7 +265,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica | |||||
result.setInfo ("Delete", String::empty, CommandCategories::general, 0); | result.setInfo ("Delete", String::empty, CommandCategories::general, 0); | ||||
result.defaultKeypresses.add (KeyPress (KeyPress::deleteKey, 0, 0)); | result.defaultKeypresses.add (KeyPress (KeyPress::deleteKey, 0, 0)); | ||||
result.defaultKeypresses.add (KeyPress (KeyPress::backspaceKey, 0, 0)); | result.defaultKeypresses.add (KeyPress (KeyPress::backspaceKey, 0, 0)); | ||||
result.setActive (projectTree != 0); | |||||
result.setActive (projectTree != nullptr); | |||||
break; | break; | ||||
default: | default: | ||||
@@ -275,7 +275,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica | |||||
bool ProjectContentComponent::isCommandActive (const CommandID commandID) | bool ProjectContentComponent::isCommandActive (const CommandID commandID) | ||||
{ | { | ||||
return project != 0; | |||||
return project != nullptr; | |||||
} | } | ||||
bool ProjectContentComponent::perform (const InvocationInfo& info) | bool ProjectContentComponent::perform (const InvocationInfo& info) | ||||
@@ -283,13 +283,13 @@ bool ProjectContentComponent::perform (const InvocationInfo& info) | |||||
switch (info.commandID) | switch (info.commandID) | ||||
{ | { | ||||
case CommandIDs::saveProject: | case CommandIDs::saveProject: | ||||
if (project != 0) | |||||
if (project != nullptr) | |||||
project->save (true, true); | project->save (true, true); | ||||
break; | break; | ||||
case CommandIDs::saveProjectAs: | case CommandIDs::saveProjectAs: | ||||
if (project != 0) | |||||
if (project != nullptr) | |||||
project->saveAsInteractive (true); | project->saveAsInteractive (true); | ||||
break; | break; | ||||
@@ -298,14 +298,14 @@ bool ProjectContentComponent::perform (const InvocationInfo& info) | |||||
{ | { | ||||
MainWindow* mw = Component::findParentComponentOfClass ((MainWindow*) 0); | MainWindow* mw = Component::findParentComponentOfClass ((MainWindow*) 0); | ||||
if (mw != 0) | |||||
if (mw != nullptr) | |||||
mw->closeCurrentProject(); | mw->closeCurrentProject(); | ||||
} | } | ||||
break; | break; | ||||
case CommandIDs::openInIDE: | case CommandIDs::openInIDE: | ||||
if (project != 0) | |||||
if (project != nullptr) | |||||
{ | { | ||||
ScopedPointer <ProjectExporter> exporter (ProjectExporter::createPlatformDefaultExporter (*project)); | ScopedPointer <ProjectExporter> exporter (ProjectExporter::createPlatformDefaultExporter (*project)); | ||||
exporter->launchProject(); | exporter->launchProject(); | ||||
@@ -313,7 +313,7 @@ bool ProjectContentComponent::perform (const InvocationInfo& info) | |||||
break; | break; | ||||
case CommandIDs::saveAndOpenInIDE: | 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)); | ScopedPointer <ProjectExporter> exporter (ProjectExporter::createPlatformDefaultExporter (*project)); | ||||
exporter->launchProject(); | exporter->launchProject(); | ||||
@@ -321,16 +321,16 @@ bool ProjectContentComponent::perform (const InvocationInfo& info) | |||||
break; | break; | ||||
case CommandIDs::showProjectSettings: | case CommandIDs::showProjectSettings: | ||||
if (projectTree != 0) | |||||
if (projectTree != nullptr) | |||||
projectTree->getRootItem()->setSelected (true, true); | projectTree->getRootItem()->setSelected (true, true); | ||||
break; | break; | ||||
case StandardApplicationCommandIDs::del: | case StandardApplicationCommandIDs::del: | ||||
if (projectTree != 0) | |||||
if (projectTree != nullptr) | |||||
{ | { | ||||
ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (projectTree->getRootItem()); | ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (projectTree->getRootItem()); | ||||
if (p != 0) | |||||
if (p != nullptr) | |||||
p->deleteAllSelectedItems(); | p->deleteAllSelectedItems(); | ||||
} | } | ||||
@@ -247,8 +247,8 @@ private: | |||||
const int w = image.getWidth(); | const int w = image.getWidth(); | ||||
const int h = image.getHeight(); | const int h = image.getHeight(); | ||||
const char* type = 0; | |||||
const char* maskType = 0; | |||||
const char* type = nullptr; | |||||
const char* maskType = nullptr; | |||||
if (w == h) | if (w == h) | ||||
{ | { | ||||
@@ -258,7 +258,7 @@ private: | |||||
if (w == 128) { type = "it32"; maskType = "t8mk"; } | if (w == 128) { type = "it32"; maskType = "t8mk"; } | ||||
} | } | ||||
if (type != 0) | |||||
if (type != nullptr) | |||||
{ | { | ||||
data.write (type, 4); | data.write (type, 4); | ||||
data.writeIntBigEndian (8 + 4 * w * h); | data.writeIntBigEndian (8 + 4 * w * h); | ||||
@@ -975,7 +975,7 @@ private: | |||||
v->setProperty ("buildConfigurations", "(" + indentList (configIDs, ",") + " )", 0); | v->setProperty ("buildConfigurations", "(" + indentList (configIDs, ",") + " )", 0); | ||||
v->setProperty ("defaultConfigurationIsVisible", (int) 0, 0); | v->setProperty ("defaultConfigurationIsVisible", (int) 0, 0); | ||||
if (configsToUse[0] != 0) | |||||
if (configsToUse[0] != nullptr) | |||||
v->setProperty ("defaultConfigurationName", configsToUse[0]->getProperty (Ids::name), 0); | v->setProperty ("defaultConfigurationName", configsToUse[0]->getProperty (Ids::name), 0); | ||||
misc.add (v); | misc.add (v); | ||||
@@ -62,7 +62,7 @@ const StringArray ProjectExporter::getExporterNames() | |||||
ProjectExporter* ProjectExporter::createNewExporter (Project& project, const int index) | ProjectExporter* ProjectExporter::createNewExporter (Project& project, const int index) | ||||
{ | { | ||||
ProjectExporter* exp = 0; | |||||
ProjectExporter* exp = nullptr; | |||||
switch (index) | switch (index) | ||||
{ | { | ||||
@@ -91,14 +91,14 @@ ProjectExporter* ProjectExporter::createNewExporter (Project& project, const int | |||||
ProjectExporter* ProjectExporter::createExporter (Project& project, const ValueTree& settings) | ProjectExporter* ProjectExporter::createExporter (Project& project, const ValueTree& settings) | ||||
{ | { | ||||
ProjectExporter* exp = MSVCProjectExporterVC6::createForSettings (project, 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; | return exp; | ||||
} | } | ||||
@@ -76,7 +76,7 @@ public: | |||||
// An export tab.. | // An export tab.. | ||||
ScopedPointer <ProjectExporter> exp (project.createExporter (tabIndex - (2 + project.getNumConfigurations()))); | ScopedPointer <ProjectExporter> exp (project.createExporter (tabIndex - (2 + project.getNumConfigurations()))); | ||||
if (exp != 0) | |||||
if (exp != nullptr) | |||||
exp->createPropertyEditors (props); | exp->createPropertyEditors (props); | ||||
for (int i = props.size(); --i >= 0;) | for (int i = props.size(); --i >= 0;) | ||||
@@ -241,7 +241,7 @@ void ProjectInformationComponent::rebuildConfigTabs() | |||||
{ | { | ||||
ScopedPointer <ProjectExporter> exp (project.createExporter (i)); | ScopedPointer <ProjectExporter> exp (project.createExporter (i)); | ||||
if (exp != 0) | |||||
if (exp != nullptr) | |||||
{ | { | ||||
panel = new PropertiesWithHelpComponent (project, index++); | panel = new PropertiesWithHelpComponent (project, index++); | ||||
configTabBox.addTab (exp->getName(), Colours::lightsteelblue, panel, true, -1); | configTabBox.addTab (exp->getName(), Colours::lightsteelblue, panel, true, -1); | ||||
@@ -298,7 +298,7 @@ void ProjectInformationComponent::showConfigMenu() | |||||
} | } | ||||
else if (r == 1) | else if (r == 1) | ||||
{ | { | ||||
project.addNewConfiguration (0); | |||||
project.addNewConfiguration (nullptr); | |||||
} | } | ||||
} | } | ||||
@@ -313,7 +313,7 @@ void ProjectInformationComponent::showExporterMenu() | |||||
{ | { | ||||
ScopedPointer<ProjectExporter> exp (project.createExporter (i)); | ScopedPointer<ProjectExporter> exp (project.createExporter (i)); | ||||
if (exp != 0) | |||||
if (exp != nullptr) | |||||
removeMenu.addItem (i + 20000, "Delete " + exp->getName()); | removeMenu.addItem (i + 20000, "Delete " + exp->getName()); | ||||
} | } | ||||
@@ -102,9 +102,9 @@ private: | |||||
void writeMainProjectFile() | void writeMainProjectFile() | ||||
{ | { | ||||
ScopedPointer <XmlElement> xml (project.getProjectRoot().createXml()); | ScopedPointer <XmlElement> xml (project.getProjectRoot().createXml()); | ||||
jassert (xml != 0); | |||||
jassert (xml != nullptr); | |||||
if (xml != 0) | |||||
if (xml != nullptr) | |||||
{ | { | ||||
#if JUCE_DEBUG | #if JUCE_DEBUG | ||||
{ | { | ||||
@@ -249,7 +249,7 @@ private: | |||||
{ | { | ||||
ScopedPointer <ProjectExporter> exporter (project.createExporter (i)); | ScopedPointer <ProjectExporter> exporter (project.createExporter (i)); | ||||
if (exporter != 0) | |||||
if (exporter != nullptr) | |||||
{ | { | ||||
paths.add (exporter->getIncludePathForFileInJuceFolder (pathFromJuceFolder, juceHeaderFile)); | paths.add (exporter->getIncludePathForFileInJuceFolder (pathFromJuceFolder, juceHeaderFile)); | ||||
guards.add ("defined (" + exporter->getExporterIdentifierMacro() + ")"); | guards.add ("defined (" + exporter->getExporterIdentifierMacro() + ")"); | ||||
@@ -79,7 +79,7 @@ void ProjectTreeViewBase::addFiles (const StringArray& files, int insertIndex) | |||||
{ | { | ||||
ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (getParentItem()); | ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (getParentItem()); | ||||
if (p != 0) | |||||
if (p != nullptr) | |||||
p->addFiles (files, insertIndex); | p->addFiles (files, insertIndex); | ||||
} | } | ||||
@@ -104,11 +104,11 @@ ProjectTreeViewBase* ProjectTreeViewBase::findTreeViewItem (const Project::Item& | |||||
{ | { | ||||
ProjectTreeViewBase* pg = dynamic_cast <ProjectTreeViewBase*> (getSubItem(i)); | ProjectTreeViewBase* pg = dynamic_cast <ProjectTreeViewBase*> (getSubItem(i)); | ||||
if (pg != 0) | |||||
if (pg != nullptr) | |||||
{ | { | ||||
pg = pg->findTreeViewItem (itemToFind); | pg = pg->findTreeViewItem (itemToFind); | ||||
if (pg != 0) | |||||
if (pg != nullptr) | |||||
return pg; | return pg; | ||||
} | } | ||||
} | } | ||||
@@ -130,15 +130,15 @@ void ProjectTreeViewBase::triggerAsyncRename (const Project::Item& itemToRename) | |||||
void messageCallback() | void messageCallback() | ||||
{ | { | ||||
if (tree != 0) | |||||
if (tree != nullptr) | |||||
{ | { | ||||
ProjectTreeViewBase* pg = dynamic_cast <ProjectTreeViewBase*> (tree->getRootItem()); | ProjectTreeViewBase* pg = dynamic_cast <ProjectTreeViewBase*> (tree->getRootItem()); | ||||
if (pg != 0) | |||||
if (pg != nullptr) | |||||
{ | { | ||||
pg = pg->findTreeViewItem (itemToRename); | pg = pg->findTreeViewItem (itemToRename); | ||||
if (pg != 0) | |||||
if (pg != nullptr) | |||||
pg->showRenameBox(); | pg->showRenameBox(); | ||||
} | } | ||||
} | } | ||||
@@ -187,7 +187,7 @@ void ProjectTreeViewBase::deleteAllSelectedItems() | |||||
{ | { | ||||
const ProjectTreeViewBase* const p = dynamic_cast <ProjectTreeViewBase*> (tree->getSelectedItem (i)); | const ProjectTreeViewBase* const p = dynamic_cast <ProjectTreeViewBase*> (tree->getSelectedItem (i)); | ||||
if (p != 0) | |||||
if (p != nullptr) | |||||
{ | { | ||||
itemsToRemove.add (new Project::Item (p->item)); | itemsToRemove.add (new Project::Item (p->item)); | ||||
@@ -222,9 +222,9 @@ void ProjectTreeViewBase::deleteAllSelectedItems() | |||||
} | } | ||||
ProjectTreeViewBase* treeRootItem = dynamic_cast <ProjectTreeViewBase*> (tree->getRootItem()); | 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;) | for (i = filesToTrash.size(); --i >= 0;) | ||||
{ | { | ||||
@@ -242,7 +242,7 @@ void ProjectTreeViewBase::deleteAllSelectedItems() | |||||
{ | { | ||||
ProjectTreeViewBase* itemToRemove = treeRootItem->findTreeViewItem (*itemsToRemove.getUnchecked(i)); | ProjectTreeViewBase* itemToRemove = treeRootItem->findTreeViewItem (*itemsToRemove.getUnchecked(i)); | ||||
if (itemToRemove != 0) | |||||
if (itemToRemove != nullptr) | |||||
{ | { | ||||
OpenDocumentManager::getInstance()->closeFile (itemToRemove->getFile(), false); | OpenDocumentManager::getInstance()->closeFile (itemToRemove->getFile(), false); | ||||
itemToRemove->deleteItem(); | itemToRemove->deleteItem(); | ||||
@@ -319,10 +319,10 @@ void ProjectTreeViewBase::getAllSelectedNodesInTree (Component* componentInTree, | |||||
{ | { | ||||
TreeView* tree = dynamic_cast <TreeView*> (componentInTree); | TreeView* tree = dynamic_cast <TreeView*> (componentInTree); | ||||
if (tree == 0) | |||||
if (tree == nullptr) | |||||
tree = componentInTree->findParentComponentOfClass ((TreeView*) 0); | tree = componentInTree->findParentComponentOfClass ((TreeView*) 0); | ||||
if (tree != 0) | |||||
if (tree != nullptr) | |||||
{ | { | ||||
const int numSelected = tree->getNumSelectedItems(); | const int numSelected = tree->getNumSelectedItems(); | ||||
@@ -330,7 +330,7 @@ void ProjectTreeViewBase::getAllSelectedNodesInTree (Component* componentInTree, | |||||
{ | { | ||||
const ProjectTreeViewBase* const p = dynamic_cast <ProjectTreeViewBase*> (tree->getSelectedItem (i)); | const ProjectTreeViewBase* const p = dynamic_cast <ProjectTreeViewBase*> (tree->getSelectedItem (i)); | ||||
if (p != 0) | |||||
if (p != nullptr) | |||||
selectedNodes.add (new Project::Item (p->item)); | selectedNodes.add (new Project::Item (p->item)); | ||||
} | } | ||||
} | } | ||||
@@ -359,7 +359,7 @@ void ProjectTreeViewBase::itemDropped (const String& sourceDescription, Componen | |||||
moveSelectedItemsTo (selectedNodes, insertIndex); | moveSelectedItemsTo (selectedNodes, insertIndex); | ||||
if (oldOpenness != 0) | |||||
if (oldOpenness != nullptr) | |||||
tree->restoreOpennessState (*oldOpenness); | tree->restoreOpennessState (*oldOpenness); | ||||
} | } | ||||
} | } | ||||
@@ -424,7 +424,7 @@ void ProjectTreeViewBase::addSubItems() | |||||
{ | { | ||||
ProjectTreeViewBase* p = createSubItem (item.getChild(i)); | ProjectTreeViewBase* p = createSubItem (item.getChild(i)); | ||||
if (p != 0) | |||||
if (p != nullptr) | |||||
addSubItem (p); | addSubItem (p); | ||||
} | } | ||||
} | } | ||||
@@ -483,7 +483,7 @@ void ProjectTreeViewBase::itemSelectionChanged (bool isNowSelected) | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
delayedSelectionTimer = 0; | |||||
delayedSelectionTimer = nullptr; | |||||
} | } | ||||
} | } | ||||
@@ -494,13 +494,13 @@ const String ProjectTreeViewBase::getTooltip() | |||||
const String ProjectTreeViewBase::getDragSourceDescription() | const String ProjectTreeViewBase::getDragSourceDescription() | ||||
{ | { | ||||
delayedSelectionTimer = 0; | |||||
delayedSelectionTimer = nullptr; | |||||
return projectItemDragType; | return projectItemDragType; | ||||
} | } | ||||
void ProjectTreeViewBase::invokeShowDocument() | void ProjectTreeViewBase::invokeShowDocument() | ||||
{ | { | ||||
delayedSelectionTimer = 0; | |||||
delayedSelectionTimer = nullptr; | |||||
showDocument(); | showDocument(); | ||||
} | } | ||||
@@ -514,11 +514,11 @@ ProjectContentComponent* ProjectTreeViewBase::getProjectContentComponent() const | |||||
{ | { | ||||
Component* c = getOwnerView(); | Component* c = getOwnerView(); | ||||
while (c != 0) | |||||
while (c != nullptr) | |||||
{ | { | ||||
ProjectContentComponent* pcc = dynamic_cast <ProjectContentComponent*> (c); | ProjectContentComponent* pcc = dynamic_cast <ProjectContentComponent*> (c); | ||||
if (pcc != 0) | |||||
if (pcc != nullptr) | |||||
return pcc; | return pcc; | ||||
c = c->getParentComponent(); | c = c->getParentComponent(); | ||||
@@ -48,7 +48,7 @@ bool ResourceFile::isResourceFile (const File& file) | |||||
{ | { | ||||
ScopedPointer <InputStream> in (file.createInputStream()); | ScopedPointer <InputStream> in (file.createInputStream()); | ||||
if (in != 0) | |||||
if (in != nullptr) | |||||
{ | { | ||||
MemoryBlock mb; | MemoryBlock mb; | ||||
in->readIntoMemoryBlock (mb, 256); | in->readIntoMemoryBlock (mb, 256); | ||||
@@ -167,9 +167,9 @@ bool ResourceFile::write (const File& cppFile, OutputStream& cpp, OutputStream& | |||||
const int64 dataSize = file.getSize(); | const int64 dataSize = file.getSize(); | ||||
ScopedPointer <InputStream> fileStream (file.createInputStream()); | ScopedPointer <InputStream> fileStream (file.createInputStream()); | ||||
jassert (fileStream != 0); | |||||
jassert (fileStream != nullptr); | |||||
if (fileStream != 0) | |||||
if (fileStream != nullptr) | |||||
{ | { | ||||
const String variableName (variableNames[i]); | const String variableName (variableNames[i]); | ||||
const String tempVariable ("temp_" + String::toHexString (file.hashCode())); | 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> cppOut (tempCpp.getFile().createOutputStream (32768)); | ||||
ScopedPointer <FileOutputStream> hppOut (tempH.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)) | if (write (cppFile, *cppOut, *hppOut)) | ||||
{ | { | ||||
cppOut = 0; | |||||
hppOut = 0; | |||||
cppOut = nullptr; | |||||
hppOut = nullptr; | |||||
return (tempCpp.getFile().hasIdenticalContentTo (tempCpp.getTargetFile()) || tempCpp.overwriteTargetFileWithTemporary()) | return (tempCpp.getFile().hasIdenticalContentTo (tempCpp.getTargetFile()) || tempCpp.overwriteTargetFileWithTemporary()) | ||||
&& (tempH.getFile().hasIdenticalContentTo (tempH.getTargetFile()) || tempH.overwriteTargetFileWithTemporary()); | && (tempH.getFile().hasIdenticalContentTo (tempH.getTargetFile()) || tempH.overwriteTargetFileWithTemporary()); | ||||
@@ -79,7 +79,7 @@ void GroupTreeViewItem::checkFileStatus() | |||||
{ | { | ||||
ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (getSubItem(i)); | ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (getSubItem(i)); | ||||
if (p != 0) | |||||
if (p != nullptr) | |||||
p->checkFileStatus(); | p->checkFileStatus(); | ||||
} | } | ||||
} | } | ||||
@@ -100,7 +100,7 @@ void GroupTreeViewItem::showDocument() | |||||
{ | { | ||||
ProjectContentComponent* pcc = getProjectContentComponent(); | ProjectContentComponent* pcc = getProjectContentComponent(); | ||||
if (pcc != 0) | |||||
if (pcc != nullptr) | |||||
{ | { | ||||
if (isRoot()) | if (isRoot()) | ||||
pcc->setEditorComponent (new ProjectInformationComponent (item.getProject()), 0); | pcc->setEditorComponent (new ProjectInformationComponent (item.getProject()), 0); | ||||
@@ -237,7 +237,7 @@ void SourceFileTreeViewItem::showDocument() | |||||
ProjectContentComponent* pcc = getProjectContentComponent(); | ProjectContentComponent* pcc = getProjectContentComponent(); | ||||
const File f (getFile()); | const File f (getFile()); | ||||
if (pcc != 0 && f.exists()) | |||||
if (pcc != nullptr && f.exists()) | |||||
pcc->showEditorForFile (f); | pcc->showEditorForFile (f); | ||||
} | } | ||||
@@ -247,7 +247,7 @@ void SourceFileTreeViewItem::showPopupMenu() | |||||
PopupMenu m; | PopupMenu m; | ||||
if (parentGroup != 0) | |||||
if (parentGroup != nullptr) | |||||
{ | { | ||||
parentGroup->addCreateFileMenuItems (m); | parentGroup->addCreateFileMenuItems (m); | ||||
m.addSeparator(); | m.addSeparator(); | ||||
@@ -274,7 +274,7 @@ void SourceFileTreeViewItem::showPopupMenu() | |||||
case 4: triggerAsyncRename (item); break; | case 4: triggerAsyncRename (item); break; | ||||
default: | default: | ||||
if (parentGroup != 0) | |||||
if (parentGroup != nullptr) | |||||
parentGroup->processCreateFileMenuItem (res); | parentGroup->processCreateFileMenuItem (res); | ||||
break; | break; | ||||
@@ -40,7 +40,7 @@ namespace FileHelpers | |||||
int64 calculateFileHashCode (const File& file) | int64 calculateFileHashCode (const File& file) | ||||
{ | { | ||||
ScopedPointer <FileInputStream> stream (file.createInputStream()); | 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) | bool overwriteFileWithNewDataIfDifferent (const File& file, const void* data, int numBytes) | ||||
@@ -169,7 +169,7 @@ void autoScrollForMouseEvent (const MouseEvent& e, bool scrollX, bool scrollY) | |||||
{ | { | ||||
Viewport* const viewport = e.eventComponent->findParentComponentOfClass ((Viewport*) 0); | Viewport* const viewport = e.eventComponent->findParentComponentOfClass ((Viewport*) 0); | ||||
if (viewport != 0) | |||||
if (viewport != nullptr) | |||||
{ | { | ||||
const MouseEvent e2 (e.getEventRelativeTo (viewport)); | const MouseEvent e2 (e.getEventRelativeTo (viewport)); | ||||
viewport->autoScroll (scrollX ? e2.x : 20, scrollY ? e2.y : 20, 8, 16); | 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() | PropertyPanelWithTooltips::PropertyPanelWithTooltips() | ||||
: lastComp (0) | |||||
: lastComp (nullptr) | |||||
{ | { | ||||
addAndMakeVisible (&panel); | addAndMakeVisible (&panel); | ||||
startTimer (150); | startTimer (150); | ||||
@@ -270,8 +270,8 @@ void PropertyPanelWithTooltips::timerCallback() | |||||
{ | { | ||||
Component* newComp = Desktop::getInstance().getMainMouseSource().getComponentUnderMouse(); | 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) | if (newComp != lastComp) | ||||
{ | { | ||||
@@ -289,10 +289,10 @@ void PropertyPanelWithTooltips::timerCallback() | |||||
const String PropertyPanelWithTooltips::findTip (Component* c) | const String PropertyPanelWithTooltips::findTip (Component* c) | ||||
{ | { | ||||
while (c != 0 && c != this) | |||||
while (c != nullptr && c != this) | |||||
{ | { | ||||
TooltipClient* const tc = dynamic_cast <TooltipClient*> (c); | TooltipClient* const tc = dynamic_cast <TooltipClient*> (c); | ||||
if (tc != 0) | |||||
if (tc != nullptr) | |||||
{ | { | ||||
const String tip (tc->getTooltip()); | const String tip (tc->getTooltip()); | ||||
@@ -315,7 +315,7 @@ FloatingLabelComponent::FloatingLabelComponent() | |||||
void FloatingLabelComponent::remove() | void FloatingLabelComponent::remove() | ||||
{ | { | ||||
if (getParentComponent() != 0) | |||||
if (getParentComponent() != nullptr) | |||||
getParentComponent()->removeChildComponent (this); | getParentComponent()->removeChildComponent (this); | ||||
} | } | ||||
@@ -29,7 +29,6 @@ | |||||
//============================================================================== | //============================================================================== | ||||
StoredSettings::StoredSettings() | StoredSettings::StoredSettings() | ||||
: props (0) | |||||
{ | { | ||||
flush(); | flush(); | ||||
} | } | ||||
@@ -37,7 +36,7 @@ StoredSettings::StoredSettings() | |||||
StoredSettings::~StoredSettings() | StoredSettings::~StoredSettings() | ||||
{ | { | ||||
flush(); | flush(); | ||||
props = 0; | |||||
props = nullptr; | |||||
clearSingletonInstance(); | clearSingletonInstance(); | ||||
} | } | ||||
@@ -47,28 +46,28 @@ juce_ImplementSingleton (StoredSettings); | |||||
//============================================================================== | //============================================================================== | ||||
PropertiesFile& StoredSettings::getProps() | PropertiesFile& StoredSettings::getProps() | ||||
{ | { | ||||
jassert (props != 0); | |||||
jassert (props != nullptr); | |||||
return *props; | return *props; | ||||
} | } | ||||
void StoredSettings::flush() | void StoredSettings::flush() | ||||
{ | { | ||||
if (props != 0) | |||||
if (props != nullptr) | |||||
{ | { | ||||
props->setValue ("recentFiles", recentFiles.toString()); | props->setValue ("recentFiles", recentFiles.toString()); | ||||
props->removeValue ("keyMappings"); | props->removeValue ("keyMappings"); | ||||
if (commandManager != 0) | |||||
if (commandManager != nullptr) | |||||
{ | { | ||||
ScopedPointer <XmlElement> keys (commandManager->getKeyMappings()->createXml (true)); | ScopedPointer <XmlElement> keys (commandManager->getKeyMappings()->createXml (true)); | ||||
if (keys != 0) | |||||
if (keys != nullptr) | |||||
props->setValue ("keyMappings", (XmlElement*) keys); | props->setValue ("keyMappings", (XmlElement*) keys); | ||||
} | } | ||||
} | } | ||||
props = 0; | |||||
props = nullptr; | |||||
props = PropertiesFile::createDefaultAppPropertiesFile ("Jucer2", "settings", String::empty, | props = PropertiesFile::createDefaultAppPropertiesFile ("Jucer2", "settings", String::empty, | ||||
false, 3000, PropertiesFile::storeAsXML); | false, 3000, PropertiesFile::storeAsXML); | ||||
@@ -155,7 +154,7 @@ const Image StoredSettings::getFallbackImage() | |||||
const Drawable* StoredSettings::getImageFileIcon() | const Drawable* StoredSettings::getImageFileIcon() | ||||
{ | { | ||||
if (imageFileIcon == 0) | |||||
if (imageFileIcon == nullptr) | |||||
{ | { | ||||
static const unsigned char data[] = | 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, | { 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, | ||||
@@ -146,7 +146,7 @@ public: | |||||
} | } | ||||
juceFilter = createPluginFilter(); | juceFilter = createPluginFilter(); | ||||
jassert (juceFilter != 0); | |||||
jassert (juceFilter != nullptr); | |||||
juceFilter->setPlayHead (this); | juceFilter->setPlayHead (this); | ||||
juceFilter->addListener (this); | juceFilter->addListener (this); | ||||
@@ -166,7 +166,7 @@ public: | |||||
for (int i = activeUIs.size(); --i >= 0;) | for (int i = activeUIs.size(); --i >= 0;) | ||||
[((JuceUIViewClass*) activeUIs.getUnchecked(i)) filterBeingDeleted: this]; | [((JuceUIViewClass*) activeUIs.getUnchecked(i)) filterBeingDeleted: this]; | ||||
juceFilter = 0; | |||||
juceFilter = nullptr; | |||||
jassert (activePlugins.contains (this)); | jassert (activePlugins.contains (this)); | ||||
activePlugins.removeValue (this); | activePlugins.removeValue (this); | ||||
@@ -234,7 +234,7 @@ public: | |||||
} | } | ||||
else if (inID == kAudioUnitProperty_OfflineRender) | else if (inID == kAudioUnitProperty_OfflineRender) | ||||
{ | { | ||||
*(UInt32*) outData = (juceFilter != 0 && juceFilter->isNonRealtime()) ? 1 : 0; | |||||
*(UInt32*) outData = (juceFilter != nullptr && juceFilter->isNonRealtime()) ? 1 : 0; | |||||
return noErr; | return noErr; | ||||
} | } | ||||
else if (inID == kMusicDeviceProperty_InstrumentCount) | else if (inID == kMusicDeviceProperty_InstrumentCount) | ||||
@@ -276,7 +276,7 @@ public: | |||||
{ | { | ||||
if (inScope == kAudioUnitScope_Global && inID == kAudioUnitProperty_OfflineRender) | if (inScope == kAudioUnitScope_Global && inID == kAudioUnitProperty_OfflineRender) | ||||
{ | { | ||||
if (juceFilter != 0) | |||||
if (juceFilter != nullptr) | |||||
juceFilter->setNonRealtime ((*(UInt32*) inData) != 0); | juceFilter->setNonRealtime ((*(UInt32*) inData) != 0); | ||||
return noErr; | return noErr; | ||||
@@ -296,7 +296,7 @@ public: | |||||
CFMutableDictionaryRef dict = (CFMutableDictionaryRef) *outData; | CFMutableDictionaryRef dict = (CFMutableDictionaryRef) *outData; | ||||
if (juceFilter != 0) | |||||
if (juceFilter != nullptr) | |||||
{ | { | ||||
MemoryBlock state; | MemoryBlock state; | ||||
juceFilter->getCurrentProgramStateInformation (state); | juceFilter->getCurrentProgramStateInformation (state); | ||||
@@ -319,7 +319,7 @@ public: | |||||
if (err != noErr) | if (err != noErr) | ||||
return err; | return err; | ||||
if (juceFilter != 0) | |||||
if (juceFilter != nullptr) | |||||
{ | { | ||||
CFDictionaryRef dict = (CFDictionaryRef) inData; | CFDictionaryRef dict = (CFDictionaryRef) inData; | ||||
CFDataRef data = 0; | CFDataRef data = 0; | ||||
@@ -346,7 +346,7 @@ public: | |||||
// value in your JucePluginCharacteristics.h file.. | // value in your JucePluginCharacteristics.h file.. | ||||
jassert (numChannelConfigs > 0); | jassert (numChannelConfigs > 0); | ||||
if (outInfo != 0) | |||||
if (outInfo != nullptr) | |||||
{ | { | ||||
*outInfo = channelInfo; | *outInfo = channelInfo; | ||||
@@ -372,7 +372,7 @@ public: | |||||
const int index = (int) inParameterID; | const int index = (int) inParameterID; | ||||
if (inScope == kAudioUnitScope_Global | if (inScope == kAudioUnitScope_Global | ||||
&& juceFilter != 0 | |||||
&& juceFilter != nullptr | |||||
&& index < juceFilter->getNumParameters()) | && index < juceFilter->getNumParameters()) | ||||
{ | { | ||||
outParameterInfo.flags = kAudioUnitParameterFlag_IsWritable | outParameterInfo.flags = kAudioUnitParameterFlag_IsWritable | ||||
@@ -410,7 +410,7 @@ public: | |||||
AudioUnitElement inElement, | AudioUnitElement inElement, | ||||
Float32& outValue) | Float32& outValue) | ||||
{ | { | ||||
if (inScope == kAudioUnitScope_Global && juceFilter != 0) | |||||
if (inScope == kAudioUnitScope_Global && juceFilter != nullptr) | |||||
{ | { | ||||
outValue = juceFilter->getParameter ((int) inID); | outValue = juceFilter->getParameter ((int) inID); | ||||
return noErr; | return noErr; | ||||
@@ -425,7 +425,7 @@ public: | |||||
Float32 inValue, | Float32 inValue, | ||||
UInt32 inBufferOffsetInFrames) | UInt32 inBufferOffsetInFrames) | ||||
{ | { | ||||
if (inScope == kAudioUnitScope_Global && juceFilter != 0) | |||||
if (inScope == kAudioUnitScope_Global && juceFilter != nullptr) | |||||
{ | { | ||||
juceFilter->setParameter ((int) inID, inValue); | juceFilter->setParameter ((int) inID, inValue); | ||||
return noErr; | return noErr; | ||||
@@ -594,7 +594,7 @@ public: | |||||
{ | { | ||||
JuceAUBaseClass::Cleanup(); | JuceAUBaseClass::Cleanup(); | ||||
if (juceFilter != 0) | |||||
if (juceFilter != nullptr) | |||||
juceFilter->releaseResources(); | juceFilter->releaseResources(); | ||||
bufferSpace.setSize (2, 16); | bufferSpace.setSize (2, 16); | ||||
@@ -608,7 +608,7 @@ public: | |||||
if (! prepared) | if (! prepared) | ||||
prepareToPlay(); | prepareToPlay(); | ||||
if (juceFilter != 0) | |||||
if (juceFilter != nullptr) | |||||
juceFilter->reset(); | juceFilter->reset(); | ||||
return JuceAUBaseClass::Reset (inScope, inElement); | return JuceAUBaseClass::Reset (inScope, inElement); | ||||
@@ -616,7 +616,7 @@ public: | |||||
void prepareToPlay() | void prepareToPlay() | ||||
{ | { | ||||
if (juceFilter != 0) | |||||
if (juceFilter != nullptr) | |||||
{ | { | ||||
juceFilter->setPlayConfigDetails ( | juceFilter->setPlayConfigDetails ( | ||||
#if ! JucePlugin_IsSynth | #if ! JucePlugin_IsSynth | ||||
@@ -667,7 +667,7 @@ public: | |||||
AudioBufferList& outBuffer, | AudioBufferList& outBuffer, | ||||
UInt32 numSamples) | UInt32 numSamples) | ||||
{ | { | ||||
if (juceFilter != 0) | |||||
if (juceFilter != nullptr) | |||||
{ | { | ||||
jassert (prepared); | jassert (prepared); | ||||
@@ -856,7 +856,7 @@ protected: | |||||
//============================================================================== | //============================================================================== | ||||
ComponentResult GetPresets (CFArrayRef* outData) const | ComponentResult GetPresets (CFArrayRef* outData) const | ||||
{ | { | ||||
if (outData != 0) | |||||
if (outData != nullptr) | |||||
{ | { | ||||
const int numPrograms = juceFilter->getNumPrograms(); | const int numPrograms = juceFilter->getNumPrograms(); | ||||
presetsArray.ensureSize (sizeof (AUPreset) * numPrograms, true); | presetsArray.ensureSize (sizeof (AUPreset) * numPrograms, true); | ||||
@@ -950,7 +950,7 @@ public: | |||||
{ | { | ||||
Component* editor = getChildComponent(0); | Component* editor = getChildComponent(0); | ||||
if (editor != 0) | |||||
if (editor != nullptr) | |||||
{ | { | ||||
const int w = jmax (32, editor->getWidth()); | const int w = jmax (32, editor->getWidth()); | ||||
const int h = jmax (32, editor->getHeight()); | const int h = jmax (32, editor->getHeight()); | ||||
@@ -1017,7 +1017,7 @@ private: | |||||
{ | { | ||||
// there's some kind of component currently modal, but the host | // there's some kind of component currently modal, but the host | ||||
// is trying to delete our plugin.. | // is trying to delete our plugin.. | ||||
jassert (Component::getCurrentlyModalComponent() == 0); | |||||
jassert (Component::getCurrentlyModalComponent() == nullptr); | |||||
[[NSNotificationCenter defaultCenter] removeObserver: self]; | [[NSNotificationCenter defaultCenter] removeObserver: self]; | ||||
[self deleteEditor]; | [self deleteEditor]; | ||||
@@ -1030,11 +1030,11 @@ private: | |||||
- (void) viewDidMoveToWindow | - (void) viewDidMoveToWindow | ||||
{ | { | ||||
if ([self window] != 0) | |||||
if ([self window] != nil) | |||||
{ | { | ||||
[[self window] setAcceptsMouseMovedEvents: YES]; | [[self window] setAcceptsMouseMovedEvents: YES]; | ||||
if (editorComp != 0) | |||||
if (editorComp != nullptr) | |||||
[[self window] makeFirstResponder: (NSView*) editorComp->getWindowHandle()]; | [[self window] makeFirstResponder: (NSView*) editorComp->getWindowHandle()]; | ||||
} | } | ||||
} | } | ||||
@@ -1046,16 +1046,16 @@ private: | |||||
- (void) deleteEditor | - (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 | if (activePlugins.contains ((void*) au)) // plugin may have been deleted before the UI | ||||
filter->editorBeingDeleted ((AudioProcessorEditor*) editorComp->getChildComponent(0)); | filter->editorBeingDeleted ((AudioProcessorEditor*) editorComp->getChildComponent(0)); | ||||
deleteAndZero (editorComp); | deleteAndZero (editorComp); | ||||
} | } | ||||
editorComp = 0; | |||||
editorComp = nullptr; | |||||
} | } | ||||
- (void) filterBeingDeleted: (JuceAU*) au_ | - (void) filterBeingDeleted: (JuceAU*) au_ | ||||
@@ -1106,12 +1106,12 @@ private: | |||||
AudioProcessor* filter = (AudioProcessor*) pointers[0]; | AudioProcessor* filter = (AudioProcessor*) pointers[0]; | ||||
JuceAU* au = (JuceAU*) pointers[1]; | JuceAU* au = (JuceAU*) pointers[1]; | ||||
if (filter == 0) | |||||
if (filter == nullptr) | |||||
return 0; | return 0; | ||||
AudioProcessorEditor* editorComp = filter->createEditorIfNeeded(); | AudioProcessorEditor* editorComp = filter->createEditorIfNeeded(); | ||||
if (editorComp == 0) | |||||
if (editorComp == nullptr) | |||||
return 0; | return 0; | ||||
return [[[JuceUIViewClass alloc] initWithFilter: filter | return [[[JuceUIViewClass alloc] initWithFilter: filter | ||||
@@ -1129,7 +1129,7 @@ class JuceAUView : public AUCarbonViewBase | |||||
public: | public: | ||||
JuceAUView (AudioUnitCarbonView auview) | JuceAUView (AudioUnitCarbonView auview) | ||||
: AUCarbonViewBase (auview), | : AUCarbonViewBase (auview), | ||||
juceFilter (0) | |||||
juceFilter (nullptr) | |||||
{ | { | ||||
} | } | ||||
@@ -1142,7 +1142,7 @@ public: | |||||
{ | { | ||||
JUCE_AUTORELEASEPOOL | JUCE_AUTORELEASEPOOL | ||||
if (juceFilter == 0) | |||||
if (juceFilter == nullptr) | |||||
{ | { | ||||
void* pointers[2]; | void* pointers[2]; | ||||
UInt32 propertySize = sizeof (pointers); | UInt32 propertySize = sizeof (pointers); | ||||
@@ -1157,7 +1157,7 @@ public: | |||||
juceFilter = (AudioProcessor*) pointers[0]; | juceFilter = (AudioProcessor*) pointers[0]; | ||||
} | } | ||||
if (juceFilter != 0) | |||||
if (juceFilter != nullptr) | |||||
{ | { | ||||
deleteUI(); | deleteUI(); | ||||
@@ -1184,7 +1184,7 @@ private: | |||||
void deleteUI() | void deleteUI() | ||||
{ | { | ||||
if (windowComp != 0) | |||||
if (windowComp != nullptr) | |||||
{ | { | ||||
PopupMenu::dismissAllActiveMenus(); | PopupMenu::dismissAllActiveMenus(); | ||||
@@ -1195,12 +1195,12 @@ private: | |||||
will be performed on completion. (Note that this assertion could actually trigger | 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 | a false alarm even if you're doing it correctly, but is here to catch people who | ||||
aren't so careful) */ | 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)); | juceFilter->editorBeingDeleted ((AudioProcessorEditor*) windowComp->getChildComponent(0)); | ||||
windowComp = 0; | |||||
windowComp = nullptr; | |||||
} | } | ||||
} | } | ||||
@@ -1217,7 +1217,7 @@ private: | |||||
{ | { | ||||
JUCE_AUTORELEASEPOOL | JUCE_AUTORELEASEPOOL | ||||
jassert (editor_ != 0); | |||||
jassert (editor_ != nullptr); | |||||
addAndMakeVisible (&editor); | addAndMakeVisible (&editor); | ||||
setOpaque (true); | setOpaque (true); | ||||
setVisible (true); | setVisible (true); | ||||
@@ -1299,7 +1299,7 @@ private: | |||||
void resized() | void resized() | ||||
{ | { | ||||
Component* const child = getChildComponent (0); | Component* const child = getChildComponent (0); | ||||
if (child != 0) | |||||
if (child != nullptr) | |||||
child->setBounds (getLocalBounds()); | child->setBounds (getLocalBounds()); | ||||
} | } | ||||
@@ -161,8 +161,8 @@ public: | |||||
if (mLoggedIn) | if (mLoggedIn) | ||||
MIDILogOut(); | MIDILogOut(); | ||||
midiBufferNode = 0; | |||||
midiTransport = 0; | |||||
midiBufferNode = nullptr; | |||||
midiTransport = nullptr; | |||||
if (prepared) | if (prepared) | ||||
juceFilter->releaseResources(); | juceFilter->releaseResources(); | ||||
@@ -172,11 +172,11 @@ public: | |||||
if (--numInstances == 0) | if (--numInstances == 0) | ||||
{ | { | ||||
#if JUCE_MAC | |||||
#if JUCE_MAC | |||||
// Hack to allow any NSWindows to clear themselves up before returning to PT.. | // Hack to allow any NSWindows to clear themselves up before returning to PT.. | ||||
for (int i = 20; --i >= 0;) | for (int i = 20; --i >= 0;) | ||||
MessageManager::getInstance()->runDispatchLoopUntil (1); | MessageManager::getInstance()->runDispatchLoopUntil (1); | ||||
#endif | |||||
#endif | |||||
shutdownJuce_GUI(); | shutdownJuce_GUI(); | ||||
} | } | ||||
@@ -204,10 +204,10 @@ public: | |||||
//============================================================================== | //============================================================================== | ||||
void updateSize() | void updateSize() | ||||
{ | { | ||||
if (editorComp == 0) | |||||
if (editorComp == nullptr) | |||||
{ | { | ||||
editorComp = filter->createEditorIfNeeded(); | editorComp = filter->createEditorIfNeeded(); | ||||
jassert (editorComp != 0); | |||||
jassert (editorComp != nullptr); | |||||
} | } | ||||
if (editorComp->getWidth() != 0 && editorComp->getHeight() != 0) | if (editorComp->getWidth() != 0 && editorComp->getHeight() != 0) | ||||
@@ -251,7 +251,7 @@ public: | |||||
#else | #else | ||||
void* const hostWindow = (void*) GetWindowFromPort (port); | void* const hostWindow = (void*) GetWindowFromPort (port); | ||||
#endif | #endif | ||||
wrapper = 0; | |||||
wrapper = nullptr; | |||||
wrapper = new EditorCompWrapper (hostWindow, editorComp, this); | wrapper = new EditorCompWrapper (hostWindow, editorComp, this); | ||||
process->touchAllParameters(); | process->touchAllParameters(); | ||||
@@ -265,11 +265,11 @@ public: | |||||
void DrawContents (Rect*) | void DrawContents (Rect*) | ||||
{ | { | ||||
#if JUCE_WINDOWS | #if JUCE_WINDOWS | ||||
if (wrapper != 0) | |||||
if (wrapper != nullptr) | |||||
{ | { | ||||
ComponentPeer* const peer = wrapper->getPeer(); | ComponentPeer* const peer = wrapper->getPeer(); | ||||
if (peer != 0) | |||||
if (peer != nullptr) | |||||
{ | { | ||||
// (seems to be required in PT6.4, but not in 7.x) | // (seems to be required in PT6.4, but not in 7.x) | ||||
peer->repaint (wrapper->getLocalBounds()); | peer->repaint (wrapper->getLocalBounds()); | ||||
@@ -289,19 +289,19 @@ public: | |||||
void deleteEditorComp() | void deleteEditorComp() | ||||
{ | { | ||||
if (editorComp != 0 || wrapper != 0) | |||||
if (editorComp != 0 || wrapper != nullptr) | |||||
{ | { | ||||
JUCE_AUTORELEASEPOOL | JUCE_AUTORELEASEPOOL | ||||
PopupMenu::dismissAllActiveMenus(); | PopupMenu::dismissAllActiveMenus(); | ||||
JUCE_NAMESPACE::Component* const modalComponent = JUCE_NAMESPACE::Component::getCurrentlyModalComponent(); | JUCE_NAMESPACE::Component* const modalComponent = JUCE_NAMESPACE::Component::getCurrentlyModalComponent(); | ||||
if (modalComponent != 0) | |||||
if (modalComponent != nullptr) | |||||
modalComponent->exitModalState (0); | modalComponent->exitModalState (0); | ||||
filter->editorBeingDeleted (editorComp); | filter->editorBeingDeleted (editorComp); | ||||
editorComp = 0; | |||||
wrapper = 0; | |||||
editorComp = nullptr; | |||||
wrapper = nullptr; | |||||
} | } | ||||
} | } | ||||
@@ -363,7 +363,7 @@ public: | |||||
{ | { | ||||
JUCE_NAMESPACE::Component* const c = getChildComponent (0); | JUCE_NAMESPACE::Component* const c = getChildComponent (0); | ||||
if (c != 0) | |||||
if (c != nullptr) | |||||
c->setBounds (0, 0, getWidth(), getHeight()); | c->setBounds (0, 0, getWidth(), getHeight()); | ||||
repaint(); | repaint(); | ||||
@@ -421,7 +421,7 @@ public: | |||||
void GetViewRect (Rect* size) | void GetViewRect (Rect* size) | ||||
{ | { | ||||
if (getView() != 0) | |||||
if (getView() != nullptr) | |||||
getView()->updateSize(); | getView()->updateSize(); | ||||
CEffectProcessRTAS::GetViewRect (size); | CEffectProcessRTAS::GetViewRect (size); | ||||
@@ -436,7 +436,7 @@ public: | |||||
{ | { | ||||
CEffectProcessRTAS::SetViewPort (port); | CEffectProcessRTAS::SetViewPort (port); | ||||
if (getView() != 0) | |||||
if (getView() != nullptr) | |||||
getView()->attachToWindow (port); | getView()->attachToWindow (port); | ||||
} | } | ||||
@@ -444,8 +444,8 @@ public: | |||||
protected: | protected: | ||||
ComponentResult GetDelaySamplesLong (long* aNumSamples) | ComponentResult GetDelaySamplesLong (long* aNumSamples) | ||||
{ | { | ||||
if (aNumSamples != 0) | |||||
*aNumSamples = juceFilter != 0 ? juceFilter->getLatencySamples() : 0; | |||||
if (aNumSamples != nullptr) | |||||
*aNumSamples = juceFilter != nullptr ? juceFilter->getLatencySamples() : 0; | |||||
return noErr; | return noErr; | ||||
} | } | ||||
@@ -472,7 +472,7 @@ protected: | |||||
#if JucePlugin_WantsMidiInput | #if JucePlugin_WantsMidiInput | ||||
CEffectType* const type = dynamic_cast <CEffectType*> (this->GetProcessType()); | CEffectType* const type = dynamic_cast <CEffectType*> (this->GetProcessType()); | ||||
if (type != 0) | |||||
if (type != nullptr) | |||||
{ | { | ||||
char nodeName [64]; | char nodeName [64]; | ||||
type->GetProcessTypeName (63, nodeName); | type->GetProcessTypeName (63, nodeName); | ||||
@@ -832,12 +832,12 @@ private: | |||||
bool prepared; | bool prepared; | ||||
double sampleRate; | double sampleRate; | ||||
static float longToFloat (const long n) throw() | |||||
static float longToFloat (const long n) noexcept | |||||
{ | { | ||||
return (float) ((((double) n) + (double) 0x80000000) / (double) 0xffffffff); | 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, | return roundToInt (jlimit (-(double) 0x80000000, (double) 0x7fffffff, | ||||
n * (double) 0xffffffff - (double) 0x80000000)); | n * (double) 0xffffffff - (double) 0x80000000)); | ||||
@@ -992,7 +992,7 @@ private: | |||||
+ String (JucePlugin_Name).substring (0, 4); | + String (JucePlugin_Name).substring (0, 4); | ||||
} | } | ||||
static EPlugIn_StemFormat getFormatForChans (const int numChans) throw() | |||||
static EPlugIn_StemFormat getFormatForChans (const int numChans) noexcept | |||||
{ | { | ||||
switch (numChans) | switch (numChans) | ||||
{ | { | ||||
@@ -38,7 +38,7 @@ AudioFilterStreamingDeviceManager::AudioFilterStreamingDeviceManager() | |||||
AudioFilterStreamingDeviceManager::~AudioFilterStreamingDeviceManager() | AudioFilterStreamingDeviceManager::~AudioFilterStreamingDeviceManager() | ||||
{ | { | ||||
setFilter (0); | |||||
setFilter (nullptr); | |||||
removeMidiInputCallback (String::empty, player); | removeMidiInputCallback (String::empty, player); | ||||
removeAudioCallback (player); | removeAudioCallback (player); | ||||
@@ -51,7 +51,7 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title, | |||||
{ | { | ||||
filter = createPluginFilter(); | filter = createPluginFilter(); | ||||
if (filter != 0) | |||||
if (filter != nullptr) | |||||
{ | { | ||||
filter->setPlayConfigDetails (JucePlugin_MaxNumInputChannels, | filter->setPlayConfigDetails (JucePlugin_MaxNumInputChannels, | ||||
JucePlugin_MaxNumOutputChannels, | JucePlugin_MaxNumOutputChannels, | ||||
@@ -64,7 +64,7 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title, | |||||
ScopedPointer<XmlElement> savedState; | ScopedPointer<XmlElement> savedState; | ||||
if (globalSettings != 0) | |||||
if (globalSettings != nullptr) | |||||
savedState = globalSettings->getXmlValue ("audioSetup"); | savedState = globalSettings->getXmlValue ("audioSetup"); | ||||
deviceManager->initialise (filter->getNumInputChannels(), | deviceManager->initialise (filter->getNumInputChannels(), | ||||
@@ -72,7 +72,7 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title, | |||||
savedState, | savedState, | ||||
true); | true); | ||||
if (globalSettings != 0) | |||||
if (globalSettings != nullptr) | |||||
{ | { | ||||
MemoryBlock data; | MemoryBlock data; | ||||
@@ -96,7 +96,7 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title, | |||||
} | } | ||||
JUCE_CATCH_ALL | 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. | jassertfalse // Your filter didn't create correctly! In a standalone app that's not too great. | ||||
JUCEApplication::quit(); | JUCEApplication::quit(); | ||||
@@ -107,18 +107,21 @@ StandaloneFilterWindow::~StandaloneFilterWindow() | |||||
{ | { | ||||
PropertySet* const globalSettings = getGlobalSettings(); | 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; | MemoryBlock data; | ||||
filter->getStateInformation (data); | filter->getStateInformation (data); | ||||
@@ -132,16 +135,16 @@ StandaloneFilterWindow::~StandaloneFilterWindow() | |||||
//============================================================================== | //============================================================================== | ||||
void StandaloneFilterWindow::deleteFilter() | 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())); | filter->editorBeingDeleted (dynamic_cast <AudioProcessorEditor*> (getContentComponent())); | ||||
clearContentComponent(); | clearContentComponent(); | ||||
} | } | ||||
filter = 0; | |||||
filter = nullptr; | |||||
} | } | ||||
void StandaloneFilterWindow::resetFilter() | void StandaloneFilterWindow::resetFilter() | ||||
@@ -150,9 +153,9 @@ void StandaloneFilterWindow::resetFilter() | |||||
filter = createPluginFilter(); | filter = createPluginFilter(); | ||||
if (filter != 0) | |||||
if (filter != nullptr) | |||||
{ | { | ||||
if (deviceManager != 0) | |||||
if (deviceManager != nullptr) | |||||
deviceManager->setFilter (filter); | deviceManager->setFilter (filter); | ||||
setContentOwned (filter->createEditorIfNeeded(), true); | setContentOwned (filter->createEditorIfNeeded(), true); | ||||
@@ -160,7 +163,7 @@ void StandaloneFilterWindow::resetFilter() | |||||
PropertySet* const globalSettings = getGlobalSettings(); | PropertySet* const globalSettings = getGlobalSettings(); | ||||
if (globalSettings != 0) | |||||
if (globalSettings != nullptr) | |||||
globalSettings->removeValue ("filterState"); | globalSettings->removeValue ("filterState"); | ||||
} | } | ||||
@@ -170,8 +173,8 @@ void StandaloneFilterWindow::saveState() | |||||
PropertySet* const globalSettings = getGlobalSettings(); | PropertySet* const globalSettings = getGlobalSettings(); | ||||
FileChooser fc (TRANS("Save current state"), | 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)) | if (fc.browseForFileToSave (true)) | ||||
{ | { | ||||
@@ -192,8 +195,8 @@ void StandaloneFilterWindow::loadState() | |||||
PropertySet* const globalSettings = getGlobalSettings(); | PropertySet* const globalSettings = getGlobalSettings(); | ||||
FileChooser fc (TRANS("Load a saved state"), | 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()) | if (fc.browseForFileToOpen()) | ||||
{ | { | ||||
@@ -255,7 +258,7 @@ void StandaloneFilterWindow::resized() | |||||
void StandaloneFilterWindow::buttonClicked (Button*) | void StandaloneFilterWindow::buttonClicked (Button*) | ||||
{ | { | ||||
if (filter == 0) | |||||
if (filter == nullptr) | |||||
return; | return; | ||||
PopupMenu m; | PopupMenu m; | ||||
@@ -229,7 +229,7 @@ namespace | |||||
Component* const comp = Desktop::getInstance().findComponentAt (Point<int> (hs.pt.x, | Component* const comp = Desktop::getInstance().findComponentAt (Point<int> (hs.pt.x, | ||||
hs.pt.y)); | hs.pt.y)); | ||||
if (comp != 0 && comp->getWindowHandle() != 0) | |||||
if (comp != nullptr && comp->getWindowHandle() != 0) | |||||
return PostMessage ((HWND) comp->getWindowHandle(), WM_MOUSEWHEEL, | return PostMessage ((HWND) comp->getWindowHandle(), WM_MOUSEWHEEL, | ||||
hs.mouseData & 0xffff0000, (hs.pt.x & 0xffff) | (hs.pt.y << 16)); | hs.mouseData & 0xffff0000, (hs.pt.x & 0xffff) | (hs.pt.y << 16)); | ||||
} | } | ||||
@@ -472,7 +472,7 @@ public: | |||||
bool getInputProperties (VstInt32 index, VstPinProperties* properties) | bool getInputProperties (VstInt32 index, VstPinProperties* properties) | ||||
{ | { | ||||
if (filter == 0 || index >= JucePlugin_MaxNumInputChannels) | |||||
if (filter == nullptr || index >= JucePlugin_MaxNumInputChannels) | |||||
return false; | return false; | ||||
setPinProperties (*properties, filter->getInputChannelName ((int) index), | setPinProperties (*properties, filter->getInputChannelName ((int) index), | ||||
@@ -482,7 +482,7 @@ public: | |||||
bool getOutputProperties (VstInt32 index, VstPinProperties* properties) | bool getOutputProperties (VstInt32 index, VstPinProperties* properties) | ||||
{ | { | ||||
if (filter == 0 || index >= JucePlugin_MaxNumOutputChannels) | |||||
if (filter == nullptr || index >= JucePlugin_MaxNumOutputChannels) | |||||
return false; | return false; | ||||
setPinProperties (*properties, filter->getOutputChannelName ((int) index), | setPinProperties (*properties, filter->getOutputChannelName ((int) index), | ||||
@@ -668,7 +668,7 @@ public: | |||||
void resume() | void resume() | ||||
{ | { | ||||
if (filter != 0) | |||||
if (filter != nullptr) | |||||
{ | { | ||||
isProcessing = true; | isProcessing = true; | ||||
channels.calloc (numInChans + numOutChans); | channels.calloc (numInChans + numOutChans); | ||||
@@ -709,7 +709,7 @@ public: | |||||
void suspend() | void suspend() | ||||
{ | { | ||||
if (filter != 0) | |||||
if (filter != nullptr) | |||||
{ | { | ||||
AudioEffectX::suspend(); | AudioEffectX::suspend(); | ||||
@@ -728,7 +728,7 @@ public: | |||||
const VstTimeInfo* const ti = getTimeInfo (kVstPpqPosValid | kVstTempoValid | kVstBarsValid //| kVstCyclePosValid | const VstTimeInfo* const ti = getTimeInfo (kVstPpqPosValid | kVstTempoValid | kVstBarsValid //| kVstCyclePosValid | ||||
| kVstTimeSigValid | kVstSmpteValid | kVstClockValid); | | kVstTimeSigValid | kVstSmpteValid | kVstClockValid); | ||||
if (ti == 0 || ti->sampleRate <= 0) | |||||
if (ti == nullptr || ti->sampleRate <= 0) | |||||
return false; | return false; | ||||
info.bpm = (ti->flags & kVstTempoValid) != 0 ? ti->tempo : 0.0; | info.bpm = (ti->flags & kVstTempoValid) != 0 ? ti->tempo : 0.0; | ||||
@@ -791,30 +791,30 @@ public: | |||||
//============================================================================== | //============================================================================== | ||||
VstInt32 getProgram() | VstInt32 getProgram() | ||||
{ | { | ||||
return filter != 0 ? filter->getCurrentProgram() : 0; | |||||
return filter != nullptr ? filter->getCurrentProgram() : 0; | |||||
} | } | ||||
void setProgram (VstInt32 program) | void setProgram (VstInt32 program) | ||||
{ | { | ||||
if (filter != 0) | |||||
if (filter != nullptr) | |||||
filter->setCurrentProgram (program); | filter->setCurrentProgram (program); | ||||
} | } | ||||
void setProgramName (char* name) | void setProgramName (char* name) | ||||
{ | { | ||||
if (filter != 0) | |||||
if (filter != nullptr) | |||||
filter->changeProgramName (filter->getCurrentProgram(), name); | filter->changeProgramName (filter->getCurrentProgram(), name); | ||||
} | } | ||||
void getProgramName (char* name) | void getProgramName (char* name) | ||||
{ | { | ||||
if (filter != 0) | |||||
if (filter != nullptr) | |||||
filter->getProgramName (filter->getCurrentProgram()).copyToUTF8 (name, 24); | filter->getProgramName (filter->getCurrentProgram()).copyToUTF8 (name, 24); | ||||
} | } | ||||
bool getProgramNameIndexed (VstInt32 /*category*/, VstInt32 index, char* text) | 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); | filter->getProgramName (index).copyToUTF8 (text, 24); | ||||
return true; | return true; | ||||
@@ -826,7 +826,7 @@ public: | |||||
//============================================================================== | //============================================================================== | ||||
float getParameter (VstInt32 index) | float getParameter (VstInt32 index) | ||||
{ | { | ||||
if (filter == 0) | |||||
if (filter == nullptr) | |||||
return 0.0f; | return 0.0f; | ||||
jassert (isPositiveAndBelow (index, filter->getNumParameters())); | jassert (isPositiveAndBelow (index, filter->getNumParameters())); | ||||
@@ -835,7 +835,7 @@ public: | |||||
void setParameter (VstInt32 index, float value) | void setParameter (VstInt32 index, float value) | ||||
{ | { | ||||
if (filter != 0) | |||||
if (filter != nullptr) | |||||
{ | { | ||||
jassert (isPositiveAndBelow (index, filter->getNumParameters())); | jassert (isPositiveAndBelow (index, filter->getNumParameters())); | ||||
filter->setParameter (index, value); | filter->setParameter (index, value); | ||||
@@ -844,7 +844,7 @@ public: | |||||
void getParameterDisplay (VstInt32 index, char* text) | void getParameterDisplay (VstInt32 index, char* text) | ||||
{ | { | ||||
if (filter != 0) | |||||
if (filter != nullptr) | |||||
{ | { | ||||
jassert (isPositiveAndBelow (index, filter->getNumParameters())); | 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. | 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) | void getParameterName (VstInt32 index, char* text) | ||||
{ | { | ||||
if (filter != 0) | |||||
if (filter != nullptr) | |||||
{ | { | ||||
jassert (isPositiveAndBelow (index, filter->getNumParameters())); | 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. | 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) | bool canParameterBeAutomated (VstInt32 index) | ||||
{ | { | ||||
return filter != 0 && filter->isParameterAutomatable ((int) index); | |||||
return filter != nullptr && filter->isParameterAutomatable ((int) index); | |||||
} | } | ||||
class ChannelConfigComparator | class ChannelConfigComparator | ||||
{ | { | ||||
public: | 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; | if (first[0] < second[0]) return -1; | ||||
else 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) | VstInt32 getChunk (void** data, bool onlyStoreCurrentProgramData) | ||||
{ | { | ||||
if (filter == 0) | |||||
if (filter == nullptr) | |||||
return 0; | return 0; | ||||
chunkMemory.setSize (0); | chunkMemory.setSize (0); | ||||
@@ -949,13 +949,13 @@ public: | |||||
VstInt32 setChunk (void* data, VstInt32 byteSize, bool onlyRestoreCurrentProgramData) | VstInt32 setChunk (void* data, VstInt32 byteSize, bool onlyRestoreCurrentProgramData) | ||||
{ | { | ||||
if (filter == 0) | |||||
if (filter == nullptr) | |||||
return 0; | return 0; | ||||
chunkMemory.setSize (0); | chunkMemory.setSize (0); | ||||
chunkMemoryTime = 0; | chunkMemoryTime = 0; | ||||
if (byteSize > 0 && data != 0) | |||||
if (byteSize > 0 && data != nullptr) | |||||
{ | { | ||||
if (onlyRestoreCurrentProgramData) | if (onlyRestoreCurrentProgramData) | ||||
filter->setCurrentProgramStateInformation (data, byteSize); | filter->setCurrentProgramStateInformation (data, byteSize); | ||||
@@ -996,7 +996,7 @@ public: | |||||
{ | { | ||||
const JUCE_NAMESPACE::uint32 now = JUCE_NAMESPACE::Time::getMillisecondCounter(); | const JUCE_NAMESPACE::uint32 now = JUCE_NAMESPACE::Time::getMillisecondCounter(); | ||||
if (now > lastMasterIdleCall + 20 && editorComp != 0) | |||||
if (now > lastMasterIdleCall + 20 && editorComp != nullptr) | |||||
{ | { | ||||
lastMasterIdleCall = now; | lastMasterIdleCall = now; | ||||
@@ -1027,14 +1027,14 @@ public: | |||||
void createEditorComp() | void createEditorComp() | ||||
{ | { | ||||
if (hasShutdown || filter == 0) | |||||
if (hasShutdown || filter == nullptr) | |||||
return; | return; | ||||
if (editorComp == 0) | |||||
if (editorComp == nullptr) | |||||
{ | { | ||||
AudioProcessorEditor* const ed = filter->createEditorIfNeeded(); | AudioProcessorEditor* const ed = filter->createEditorIfNeeded(); | ||||
if (ed != 0) | |||||
if (ed != nullptr) | |||||
{ | { | ||||
cEffect.flags |= effFlagsHasEditor; | cEffect.flags |= effFlagsHasEditor; | ||||
ed->setOpaque (true); | ed->setOpaque (true); | ||||
@@ -1059,10 +1059,10 @@ public: | |||||
jassert (! recursionCheck); | jassert (! recursionCheck); | ||||
recursionCheck = true; | recursionCheck = true; | ||||
if (editorComp != 0) | |||||
if (editorComp != nullptr) | |||||
{ | { | ||||
Component* const modalComponent = Component::getCurrentlyModalComponent(); | Component* const modalComponent = Component::getCurrentlyModalComponent(); | ||||
if (modalComponent != 0) | |||||
if (modalComponent != nullptr) | |||||
{ | { | ||||
modalComponent->exitModalState (0); | modalComponent->exitModalState (0); | ||||
@@ -1084,11 +1084,11 @@ public: | |||||
filter->editorBeingDeleted (editorComp->getEditorComp()); | filter->editorBeingDeleted (editorComp->getEditorComp()); | ||||
editorComp = 0; | |||||
editorComp = nullptr; | |||||
// there's some kind of component currently modal, but the host | // there's some kind of component currently modal, but the host | ||||
// is trying to delete our plugin. You should try to avoid this happening.. | // is trying to delete our plugin. You should try to avoid this happening.. | ||||
jassert (Component::getCurrentlyModalComponent() == 0); | |||||
jassert (Component::getCurrentlyModalComponent() == nullptr); | |||||
} | } | ||||
#if JUCE_LINUX | #if JUCE_LINUX | ||||
@@ -1119,7 +1119,7 @@ public: | |||||
deleteEditor (true); | deleteEditor (true); | ||||
createEditorComp(); | createEditorComp(); | ||||
if (editorComp != 0) | |||||
if (editorComp != nullptr) | |||||
{ | { | ||||
editorComp->setOpaque (true); | editorComp->setOpaque (true); | ||||
editorComp->setVisible (false); | editorComp->setVisible (false); | ||||
@@ -1153,7 +1153,7 @@ public: | |||||
const MessageManagerLock mmLock; | const MessageManagerLock mmLock; | ||||
createEditorComp(); | createEditorComp(); | ||||
if (editorComp != 0) | |||||
if (editorComp != nullptr) | |||||
{ | { | ||||
editorSize.left = 0; | editorSize.left = 0; | ||||
editorSize.top = 0; | editorSize.top = 0; | ||||
@@ -1175,7 +1175,7 @@ public: | |||||
void resizeHostWindow (int newWidth, int newHeight) | void resizeHostWindow (int newWidth, int newHeight) | ||||
{ | { | ||||
if (editorComp != 0) | |||||
if (editorComp != nullptr) | |||||
{ | { | ||||
if (! (canHostDo (const_cast <char*> ("sizeWindow")) && sizeWindow (newWidth, newHeight))) | if (! (canHostDo (const_cast <char*> ("sizeWindow")) && sizeWindow (newWidth, newHeight))) | ||||
{ | { | ||||
@@ -1232,7 +1232,7 @@ public: | |||||
#endif | #endif | ||||
} | } | ||||
if (editorComp->getPeer() != 0) | |||||
if (editorComp->getPeer() != nullptr) | |||||
editorComp->getPeer()->handleMovedOrResized(); | editorComp->getPeer()->handleMovedOrResized(); | ||||
} | } | ||||
} | } | ||||
@@ -1308,7 +1308,7 @@ public: | |||||
{ | { | ||||
Component* const editor = getChildComponent(0); | Component* const editor = getChildComponent(0); | ||||
if (editor != 0) | |||||
if (editor != nullptr) | |||||
editor->setBounds (getLocalBounds()); | editor->setBounds (getLocalBounds()); | ||||
} | } | ||||
@@ -1428,7 +1428,7 @@ private: | |||||
tempChannels.clear(); | tempChannels.clear(); | ||||
if (filter != 0) | |||||
if (filter != nullptr) | |||||
tempChannels.insertMultiple (0, 0, filter->getNumInputChannels() + filter->getNumOutputChannels()); | tempChannels.insertMultiple (0, 0, filter->getNumInputChannels() + filter->getNumOutputChannels()); | ||||
} | } | ||||
@@ -1460,7 +1460,7 @@ namespace | |||||
AudioProcessor* const filter = createPluginFilter(); | AudioProcessor* const filter = createPluginFilter(); | ||||
if (filter != 0) | |||||
if (filter != nullptr) | |||||
{ | { | ||||
JuceVSTWrapper* const wrapper = new JuceVSTWrapper (audioMaster, filter); | JuceVSTWrapper* const wrapper = new JuceVSTWrapper (audioMaster, filter); | ||||
return wrapper->getAeffect(); | return wrapper->getAeffect(); | ||||
@@ -54,11 +54,11 @@ public: | |||||
{ | { | ||||
Component* comp = Desktop::getInstance().findComponentAt (screenPos); | Component* comp = Desktop::getInstance().findComponentAt (screenPos); | ||||
if (comp != 0) | |||||
if (comp != nullptr) | |||||
{ | { | ||||
ComponentPeer* const peer = comp->getPeer(); | ComponentPeer* const peer = comp->getPeer(); | ||||
if (peer != 0 && ! peer->isFocused()) | |||||
if (peer != nullptr && ! peer->isFocused()) | |||||
peer->handleMouseEvent (0, screenPos - peer->getScreenPosition(), mods, Time::currentTimeMillis()); | peer->handleMouseEvent (0, screenPos - peer->getScreenPosition(), mods, Time::currentTimeMillis()); | ||||
} | } | ||||
} | } | ||||
@@ -66,62 +66,62 @@ public: | |||||
const HostType type; | const HostType type; | ||||
//============================================================================== | //============================================================================== | ||||
bool isAbletonLive() const throw() | |||||
bool isAbletonLive() const noexcept | |||||
{ | { | ||||
return type == AbletonLive6 || type == AbletonLive7 || type == AbletonLive8 || type == AbletonLiveGeneric; | 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; | return type == SteinbergCubase4 || type == SteinbergCubase5 || type == SteinbergCubase5Bridged || type == SteinbergCubaseGeneric; | ||||
} | } | ||||
bool isCubaseBridged() const throw() | |||||
bool isCubaseBridged() const noexcept | |||||
{ | { | ||||
return type == SteinbergCubase5Bridged; | return type == SteinbergCubase5Bridged; | ||||
} | } | ||||
bool isTracktion() const throw() | |||||
bool isTracktion() const noexcept | |||||
{ | { | ||||
return type == MackieTracktion3 || type == MackieTracktionGeneric; | return type == MackieTracktion3 || type == MackieTracktionGeneric; | ||||
} | } | ||||
bool isSonar() const throw() | |||||
bool isSonar() const noexcept | |||||
{ | { | ||||
return type == CakewalkSonar8 || type == CakewalkSonarGeneric; | return type == CakewalkSonar8 || type == CakewalkSonarGeneric; | ||||
} | } | ||||
bool isWavelab() const throw() | |||||
bool isWavelab() const noexcept | |||||
{ | { | ||||
return type == SteinbergWavelab5 || type == SteinbergWavelab6 || type == SteinbergWavelab7 || type == SteinbergWavelabGeneric; | return type == SteinbergWavelab5 || type == SteinbergWavelab6 || type == SteinbergWavelab7 || type == SteinbergWavelabGeneric; | ||||
} | } | ||||
bool isWavelabLegacy() const throw() | |||||
bool isWavelabLegacy() const noexcept | |||||
{ | { | ||||
return type == SteinbergWavelab5 || type == SteinbergWavelab6; | return type == SteinbergWavelab5 || type == SteinbergWavelab6; | ||||
} | } | ||||
bool isPremiere() const throw() | |||||
bool isPremiere() const noexcept | |||||
{ | { | ||||
return type == AdobePremierePro; | return type == AdobePremierePro; | ||||
} | } | ||||
bool isLogic() const throw() | |||||
bool isLogic() const noexcept | |||||
{ | { | ||||
return type == AppleLogic || type == EmagicLogic; | return type == AppleLogic || type == EmagicLogic; | ||||
} | } | ||||
bool isReceptor() const throw() | |||||
bool isReceptor() const noexcept | |||||
{ | { | ||||
return type == MuseReceptorGeneric; | return type == MuseReceptorGeneric; | ||||
} | } | ||||
bool isSamplitude() const throw() | |||||
bool isSamplitude() const noexcept | |||||
{ | { | ||||
return type == MagixSamplitude; | return type == MagixSamplitude; | ||||
} | } | ||||
bool isFruityLoops() const throw() | |||||
bool isFruityLoops() const noexcept | |||||
{ | { | ||||
return type == FruityLoops; | return type == FruityLoops; | ||||
} | } | ||||
@@ -43,24 +43,24 @@ JUCEApplication::JUCEApplication() | |||||
: appReturnValue (0), | : appReturnValue (0), | ||||
stillInitialising (true) | stillInitialising (true) | ||||
{ | { | ||||
jassert (isStandaloneApp() && appInstance == 0); | |||||
jassert (isStandaloneApp() && appInstance == nullptr); | |||||
appInstance = this; | appInstance = this; | ||||
} | } | ||||
JUCEApplication::~JUCEApplication() | JUCEApplication::~JUCEApplication() | ||||
{ | { | ||||
if (appLock != 0) | |||||
if (appLock != nullptr) | |||||
{ | { | ||||
appLock->exit(); | appLock->exit(); | ||||
appLock = 0; | |||||
appLock = nullptr; | |||||
} | } | ||||
jassert (appInstance == this); | jassert (appInstance == this); | ||||
appInstance = 0; | |||||
appInstance = nullptr; | |||||
} | } | ||||
JUCEApplication::CreateInstanceFunction JUCEApplication::createInstance = 0; | JUCEApplication::CreateInstanceFunction JUCEApplication::createInstance = 0; | ||||
JUCEApplication* JUCEApplication::appInstance = 0; | |||||
JUCEApplication* JUCEApplication::appInstance = nullptr; | |||||
//============================================================================== | //============================================================================== | ||||
bool JUCEApplication::moreThanOneInstanceAllowed() | bool JUCEApplication::moreThanOneInstanceAllowed() | ||||
@@ -82,7 +82,7 @@ void JUCEApplication::quit() | |||||
MessageManager::getInstance()->stopDispatchLoop(); | MessageManager::getInstance()->stopDispatchLoop(); | ||||
} | } | ||||
void JUCEApplication::setApplicationReturnValue (const int newReturnValue) throw() | |||||
void JUCEApplication::setApplicationReturnValue (const int newReturnValue) noexcept | |||||
{ | { | ||||
appReturnValue = newReturnValue; | appReturnValue = newReturnValue; | ||||
} | } | ||||
@@ -105,7 +105,7 @@ void JUCEApplication::sendUnhandledException (const std::exception* const e, | |||||
const char* const sourceFile, | const char* const sourceFile, | ||||
const int lineNumber) | const int lineNumber) | ||||
{ | { | ||||
if (appInstance != 0) | |||||
if (appInstance != nullptr) | |||||
appInstance->unhandledException (e, sourceFile, lineNumber); | appInstance->unhandledException (e, sourceFile, lineNumber); | ||||
} | } | ||||
@@ -150,7 +150,7 @@ bool JUCEApplication::initialiseApp (const String& commandLine) | |||||
commandLineParameters = commandLine.trim(); | commandLineParameters = commandLine.trim(); | ||||
#if ! JUCE_IOS | #if ! JUCE_IOS | ||||
jassert (appLock == 0); // initialiseApp must only be called once! | |||||
jassert (appLock == nullptr); // initialiseApp must only be called once! | |||||
if (! moreThanOneInstanceAllowed()) | if (! moreThanOneInstanceAllowed()) | ||||
{ | { | ||||
@@ -158,7 +158,7 @@ bool JUCEApplication::initialiseApp (const String& commandLine) | |||||
if (! appLock->enter(0)) | if (! appLock->enter(0)) | ||||
{ | { | ||||
appLock = 0; | |||||
appLock = nullptr; | |||||
MessageManager::broadcastMessage (getApplicationName() + "/" + commandLineParameters); | MessageManager::broadcastMessage (getApplicationName() + "/" + commandLineParameters); | ||||
DBG ("Another instance is running - quitting..."); | DBG ("Another instance is running - quitting..."); | ||||
@@ -203,7 +203,7 @@ void JUCEApplication::appWillTerminateByForce() | |||||
{ | { | ||||
const ScopedPointer<JUCEApplication> app (JUCEApplication::getInstance()); | const ScopedPointer<JUCEApplication> app (JUCEApplication::getInstance()); | ||||
if (app != 0) | |||||
if (app != nullptr) | |||||
app->shutdownApp(); | app->shutdownApp(); | ||||
} | } | ||||
@@ -215,7 +215,7 @@ void JUCEApplication::appWillTerminateByForce() | |||||
int JUCEApplication::main (const String& commandLine) | int JUCEApplication::main (const String& commandLine) | ||||
{ | { | ||||
ScopedJuceInitialiser_GUI libraryInitialiser; | ScopedJuceInitialiser_GUI libraryInitialiser; | ||||
jassert (createInstance != 0); | |||||
jassert (createInstance != nullptr); | |||||
int returnCode = 0; | int returnCode = 0; | ||||
{ | { | ||||
@@ -250,7 +250,7 @@ int JUCEApplication::main (int argc, const char* argv[]) | |||||
JUCE_AUTORELEASEPOOL | JUCE_AUTORELEASEPOOL | ||||
#if ! JUCE_WINDOWS | #if ! JUCE_WINDOWS | ||||
jassert (createInstance != 0); | |||||
jassert (createInstance != nullptr); | |||||
juce_Argv0 = argv[0]; | juce_Argv0 = argv[0]; | ||||
#endif | #endif | ||||
@@ -111,7 +111,7 @@ public: | |||||
//============================================================================== | //============================================================================== | ||||
/** Returns the global instance of the application object being run. */ | /** 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. | /** 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 | This is handy for things like splash screens to know when the app's up-and-running | ||||
properly. | properly. | ||||
*/ | */ | ||||
bool isInitialising() const throw() { return stillInitialising; } | |||||
bool isInitialising() const noexcept { return stillInitialising; } | |||||
/* Called to allow the application to clear up before exiting. | /* Called to allow the application to clear up before exiting. | ||||
@@ -233,16 +233,16 @@ public: | |||||
@see getApplicationReturnValue | @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. | /** Returns the value that has been set as the application's exit code. | ||||
@see setApplicationReturnValue | @see setApplicationReturnValue | ||||
*/ | */ | ||||
int getApplicationReturnValue() const throw() { return appReturnValue; } | |||||
int getApplicationReturnValue() const noexcept { return appReturnValue; } | |||||
/** Returns the application's command line params. | /** 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. | // 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 | /** Returns true if this executable is running as an app (as opposed to being a plugin | ||||
or other kind of shared library. */ | or other kind of shared library. */ | ||||
static inline bool isStandaloneApp() throw() { return createInstance != 0; } | |||||
static inline bool isStandaloneApp() noexcept { return createInstance != 0; } | |||||
/** @internal */ | /** @internal */ | ||||
ApplicationCommandTarget* getNextCommandTarget(); | ApplicationCommandTarget* getNextCommandTarget(); | ||||
@@ -31,7 +31,7 @@ BEGIN_JUCE_NAMESPACE | |||||
//============================================================================== | //============================================================================== | ||||
ApplicationCommandInfo::ApplicationCommandInfo (const CommandID commandID_) throw() | |||||
ApplicationCommandInfo::ApplicationCommandInfo (const CommandID commandID_) noexcept | |||||
: commandID (commandID_), | : commandID (commandID_), | ||||
flags (0) | flags (0) | ||||
{ | { | ||||
@@ -40,7 +40,7 @@ ApplicationCommandInfo::ApplicationCommandInfo (const CommandID commandID_) thro | |||||
void ApplicationCommandInfo::setInfo (const String& shortName_, | void ApplicationCommandInfo::setInfo (const String& shortName_, | ||||
const String& description_, | const String& description_, | ||||
const String& categoryName_, | const String& categoryName_, | ||||
const int flags_) throw() | |||||
const int flags_) noexcept | |||||
{ | { | ||||
shortName = shortName_; | shortName = shortName_; | ||||
description = description_; | description = description_; | ||||
@@ -48,7 +48,7 @@ void ApplicationCommandInfo::setInfo (const String& shortName_, | |||||
flags = flags_; | flags = flags_; | ||||
} | } | ||||
void ApplicationCommandInfo::setActive (const bool b) throw() | |||||
void ApplicationCommandInfo::setActive (const bool b) noexcept | |||||
{ | { | ||||
if (b) | if (b) | ||||
flags &= ~isDisabled; | flags &= ~isDisabled; | ||||
@@ -56,7 +56,7 @@ void ApplicationCommandInfo::setActive (const bool b) throw() | |||||
flags |= isDisabled; | flags |= isDisabled; | ||||
} | } | ||||
void ApplicationCommandInfo::setTicked (const bool b) throw() | |||||
void ApplicationCommandInfo::setTicked (const bool b) noexcept | |||||
{ | { | ||||
if (b) | if (b) | ||||
flags |= isTicked; | flags |= isTicked; | ||||
@@ -64,7 +64,7 @@ void ApplicationCommandInfo::setTicked (const bool b) throw() | |||||
flags &= ~isTicked; | 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)); | defaultKeypresses.add (KeyPress (keyCode, modifiers, 0)); | ||||
} | } | ||||
@@ -48,7 +48,7 @@ | |||||
struct JUCE_API ApplicationCommandInfo | struct JUCE_API ApplicationCommandInfo | ||||
{ | { | ||||
//============================================================================== | //============================================================================== | ||||
explicit ApplicationCommandInfo (CommandID commandID) throw(); | |||||
explicit ApplicationCommandInfo (CommandID commandID) noexcept; | |||||
//============================================================================== | //============================================================================== | ||||
/** Sets a number of the structures values at once. | /** Sets a number of the structures values at once. | ||||
@@ -59,18 +59,18 @@ struct JUCE_API ApplicationCommandInfo | |||||
void setInfo (const String& shortName, | void setInfo (const String& shortName, | ||||
const String& description, | const String& description, | ||||
const String& categoryName, | 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. | /** 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 | If isActive is true, the flags member has the isDisabled bit cleared; if isActive | ||||
is false, the bit is set. | 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. | /** 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. | /** Handy method for adding a keypress to the defaultKeypresses array. | ||||
@@ -84,7 +84,7 @@ struct JUCE_API ApplicationCommandInfo | |||||
@endcode | @endcode | ||||
*/ | */ | ||||
void addDefaultKeypress (int keyCode, | void addDefaultKeypress (int keyCode, | ||||
const ModifierKeys& modifiers) throw(); | |||||
const ModifierKeys& modifiers) noexcept; | |||||
//============================================================================== | //============================================================================== | ||||
/** The command's unique ID number. | /** The command's unique ID number. | ||||
@@ -39,7 +39,7 @@ BEGIN_JUCE_NAMESPACE | |||||
//============================================================================== | //============================================================================== | ||||
ApplicationCommandManager::ApplicationCommandManager() | ApplicationCommandManager::ApplicationCommandManager() | ||||
: firstTarget (0) | |||||
: firstTarget (nullptr) | |||||
{ | { | ||||
keyMappings = new KeyPressMappingSet (this); | keyMappings = new KeyPressMappingSet (this); | ||||
@@ -49,7 +49,7 @@ ApplicationCommandManager::ApplicationCommandManager() | |||||
ApplicationCommandManager::~ApplicationCommandManager() | ApplicationCommandManager::~ApplicationCommandManager() | ||||
{ | { | ||||
Desktop::getInstance().removeFocusChangeListener (this); | Desktop::getInstance().removeFocusChangeListener (this); | ||||
keyMappings = 0; | |||||
keyMappings = nullptr; | |||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
@@ -92,7 +92,7 @@ void ApplicationCommandManager::registerCommand (const ApplicationCommandInfo& n | |||||
void ApplicationCommandManager::registerAllCommandsForTarget (ApplicationCommandTarget* target) | void ApplicationCommandManager::registerAllCommandsForTarget (ApplicationCommandTarget* target) | ||||
{ | { | ||||
if (target != 0) | |||||
if (target != nullptr) | |||||
{ | { | ||||
Array <CommandID> commandIDs; | Array <CommandID> commandIDs; | ||||
target->getAllCommands (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;) | for (int i = commands.size(); --i >= 0;) | ||||
if (commands.getUnchecked(i)->commandID == commandID) | if (commands.getUnchecked(i)->commandID == commandID) | ||||
@@ -139,19 +139,19 @@ const ApplicationCommandInfo* ApplicationCommandManager::getCommandForID (const | |||||
return 0; | 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); | 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); | 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 | const StringArray ApplicationCommandManager::getCommandCategories() const | ||||
@@ -193,7 +193,7 @@ bool ApplicationCommandManager::invoke (const ApplicationCommandTarget::Invocati | |||||
ApplicationCommandInfo commandInfo (0); | ApplicationCommandInfo commandInfo (0); | ||||
ApplicationCommandTarget* const target = getTargetForCommand (info_.commandID, commandInfo); | ApplicationCommandTarget* const target = getTargetForCommand (info_.commandID, commandInfo); | ||||
if (target == 0) | |||||
if (target == nullptr) | |||||
return false; | return false; | ||||
ApplicationCommandTarget::InvocationInfo info (info_); | ApplicationCommandTarget::InvocationInfo info (info_); | ||||
@@ -211,11 +211,11 @@ bool ApplicationCommandManager::invoke (const ApplicationCommandTarget::Invocati | |||||
//============================================================================== | //============================================================================== | ||||
ApplicationCommandTarget* ApplicationCommandManager::getFirstCommandTarget (const CommandID) | 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; | firstTarget = newTarget; | ||||
} | } | ||||
@@ -225,13 +225,13 @@ ApplicationCommandTarget* ApplicationCommandManager::getTargetForCommand (const | |||||
{ | { | ||||
ApplicationCommandTarget* target = getFirstCommandTarget (commandID); | ApplicationCommandTarget* target = getFirstCommandTarget (commandID); | ||||
if (target == 0) | |||||
if (target == nullptr) | |||||
target = JUCEApplication::getInstance(); | target = JUCEApplication::getInstance(); | ||||
if (target != 0) | |||||
if (target != nullptr) | |||||
target = target->getTargetForCommand (commandID); | target = target->getTargetForCommand (commandID); | ||||
if (target != 0) | |||||
if (target != nullptr) | |||||
target->getCommandInfo (commandID, upToDateInfo); | target->getCommandInfo (commandID, upToDateInfo); | ||||
return target; | return target; | ||||
@@ -242,7 +242,7 @@ ApplicationCommandTarget* ApplicationCommandManager::findTargetForComponent (Com | |||||
{ | { | ||||
ApplicationCommandTarget* target = dynamic_cast <ApplicationCommandTarget*> (c); | 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) | // (unable to use the syntax findParentComponentOfClass <ApplicationCommandTarget> () because of a VC6 compiler bug) | ||||
target = c->findParentComponentOfClass ((ApplicationCommandTarget*) 0); | target = c->findParentComponentOfClass ((ApplicationCommandTarget*) 0); | ||||
@@ -253,20 +253,20 @@ ApplicationCommandTarget* ApplicationCommandManager::findDefaultComponentTarget( | |||||
{ | { | ||||
Component* c = Component::getCurrentlyFocusedComponent(); | Component* c = Component::getCurrentlyFocusedComponent(); | ||||
if (c == 0) | |||||
if (c == nullptr) | |||||
{ | { | ||||
TopLevelWindow* const activeWindow = TopLevelWindow::getActiveTopLevelWindow(); | TopLevelWindow* const activeWindow = TopLevelWindow::getActiveTopLevelWindow(); | ||||
if (activeWindow != 0) | |||||
if (activeWindow != nullptr) | |||||
{ | { | ||||
c = activeWindow->getPeer()->getLastFocusedSubcomponent(); | c = activeWindow->getPeer()->getLastFocusedSubcomponent(); | ||||
if (c == 0) | |||||
if (c == nullptr) | |||||
c = activeWindow; | c = activeWindow; | ||||
} | } | ||||
} | } | ||||
if (c == 0 && Process::isForegroundProcess()) | |||||
if (c == nullptr && Process::isForegroundProcess()) | |||||
{ | { | ||||
// getting a bit desperate now - try all desktop comps.. | // getting a bit desperate now - try all desktop comps.. | ||||
for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) | for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) | ||||
@@ -275,12 +275,12 @@ ApplicationCommandTarget* ApplicationCommandManager::findDefaultComponentTarget( | |||||
= findTargetForComponent (Desktop::getInstance().getComponent (i) | = findTargetForComponent (Desktop::getInstance().getComponent (i) | ||||
->getPeer()->getLastFocusedSubcomponent()); | ->getPeer()->getLastFocusedSubcomponent()); | ||||
if (target != 0) | |||||
if (target != nullptr) | |||||
return target; | return target; | ||||
} | } | ||||
} | } | ||||
if (c != 0) | |||||
if (c != nullptr) | |||||
{ | { | ||||
ResizableWindow* const resizableWindow = dynamic_cast <ResizableWindow*> (c); | 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 | // 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 | // still be passed up to the top level window anyway, so let's send it to the | ||||
// content comp. | // content comp. | ||||
if (resizableWindow != 0 && resizableWindow->getContentComponent() != 0) | |||||
if (resizableWindow != nullptr && resizableWindow->getContentComponent() != nullptr) | |||||
c = resizableWindow->getContentComponent(); | c = resizableWindow->getContentComponent(); | ||||
ApplicationCommandTarget* const target = findTargetForComponent (c); | ApplicationCommandTarget* const target = findTargetForComponent (c); | ||||
if (target != 0) | |||||
if (target != nullptr) | |||||
return target; | return target; | ||||
} | } | ||||
@@ -155,13 +155,13 @@ public: | |||||
@see registerCommand | @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. | /** Returns the details about one of the registered commands. | ||||
The index is between 0 and (getNumCommands() - 1). | 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. | /** 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 | ID number, and return its associated info. If no matching command is found, this | ||||
will return 0. | will return 0. | ||||
*/ | */ | ||||
const ApplicationCommandInfo* getCommandForID (CommandID commandID) const throw(); | |||||
const ApplicationCommandInfo* getCommandForID (CommandID commandID) const noexcept; | |||||
/** Returns the name field for a command. | /** Returns the name field for a command. | ||||
An empty string is returned if no command with this ID has been registered. | An empty string is returned if no command with this ID has been registered. | ||||
@see getDescriptionOfCommand | @see getDescriptionOfCommand | ||||
*/ | */ | ||||
const String getNameOfCommand (CommandID commandID) const throw(); | |||||
const String getNameOfCommand (CommandID commandID) const noexcept; | |||||
/** Returns the description field for a command. | /** Returns the description field for a command. | ||||
@@ -185,7 +185,7 @@ public: | |||||
@see getNameOfCommand | @see getNameOfCommand | ||||
*/ | */ | ||||
const String getDescriptionOfCommand (CommandID commandID) const throw(); | |||||
const String getDescriptionOfCommand (CommandID commandID) const noexcept; | |||||
/** Returns the list of categories. | /** Returns the list of categories. | ||||
@@ -211,7 +211,7 @@ public: | |||||
@see KeyPressMappingSet | @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 | If you use this to set a target, make sure you call setFirstCommandTarget (0) before | ||||
deleting the target object. | 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. | /** Tries to find the best target to use to perform a given command. | ||||
@@ -38,7 +38,7 @@ ApplicationCommandTarget::ApplicationCommandTarget() | |||||
ApplicationCommandTarget::~ApplicationCommandTarget() | ApplicationCommandTarget::~ApplicationCommandTarget() | ||||
{ | { | ||||
messageInvoker = 0; | |||||
messageInvoker = nullptr; | |||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
@@ -48,7 +48,7 @@ bool ApplicationCommandTarget::tryToInvoke (const InvocationInfo& info, const bo | |||||
{ | { | ||||
if (async) | if (async) | ||||
{ | { | ||||
if (messageInvoker == 0) | |||||
if (messageInvoker == nullptr) | |||||
messageInvoker = new CommandTargetMessageInvoker (this); | messageInvoker = new CommandTargetMessageInvoker (this); | ||||
messageInvoker->postMessage (new Message (0, 0, 0, new ApplicationCommandTarget::InvocationInfo (info))); | messageInvoker->postMessage (new Message (0, 0, 0, new ApplicationCommandTarget::InvocationInfo (info))); | ||||
@@ -72,7 +72,7 @@ ApplicationCommandTarget* ApplicationCommandTarget::findFirstTargetParentCompone | |||||
{ | { | ||||
Component* c = dynamic_cast <Component*> (this); | 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) | // (unable to use the syntax findParentComponentOfClass <ApplicationCommandTarget> () because of a VC6 compiler bug) | ||||
return c->findParentComponentOfClass ((ApplicationCommandTarget*) 0); | return c->findParentComponentOfClass ((ApplicationCommandTarget*) 0); | ||||
@@ -84,7 +84,7 @@ ApplicationCommandTarget* ApplicationCommandTarget::getTargetForCommand (const C | |||||
ApplicationCommandTarget* target = this; | ApplicationCommandTarget* target = this; | ||||
int depth = 0; | int depth = 0; | ||||
while (target != 0) | |||||
while (target != nullptr) | |||||
{ | { | ||||
Array <CommandID> commandIDs; | Array <CommandID> commandIDs; | ||||
target->getAllCommands (commandIDs); | target->getAllCommands (commandIDs); | ||||
@@ -102,11 +102,11 @@ ApplicationCommandTarget* ApplicationCommandTarget::getTargetForCommand (const C | |||||
break; | break; | ||||
} | } | ||||
if (target == 0) | |||||
if (target == nullptr) | |||||
{ | { | ||||
target = JUCEApplication::getInstance(); | target = JUCEApplication::getInstance(); | ||||
if (target != 0) | |||||
if (target != nullptr) | |||||
{ | { | ||||
Array <CommandID> commandIDs; | Array <CommandID> commandIDs; | ||||
target->getAllCommands (commandIDs); | target->getAllCommands (commandIDs); | ||||
@@ -135,7 +135,7 @@ bool ApplicationCommandTarget::invoke (const InvocationInfo& info, const bool as | |||||
ApplicationCommandTarget* target = this; | ApplicationCommandTarget* target = this; | ||||
int depth = 0; | int depth = 0; | ||||
while (target != 0) | |||||
while (target != nullptr) | |||||
{ | { | ||||
if (target->tryToInvoke (info, async)) | if (target->tryToInvoke (info, async)) | ||||
return true; | return true; | ||||
@@ -150,11 +150,11 @@ bool ApplicationCommandTarget::invoke (const InvocationInfo& info, const bool as | |||||
break; | break; | ||||
} | } | ||||
if (target == 0) | |||||
if (target == nullptr) | |||||
{ | { | ||||
target = JUCEApplication::getInstance(); | target = JUCEApplication::getInstance(); | ||||
if (target != 0) | |||||
if (target != nullptr) | |||||
return target->tryToInvoke (info, async); | return target->tryToInvoke (info, async); | ||||
} | } | ||||
@@ -174,7 +174,7 @@ ApplicationCommandTarget::InvocationInfo::InvocationInfo (const CommandID comman | |||||
: commandID (commandID_), | : commandID (commandID_), | ||||
commandFlags (0), | commandFlags (0), | ||||
invocationMethod (direct), | invocationMethod (direct), | ||||
originatingComponent (0), | |||||
originatingComponent (nullptr), | |||||
isKeyDown (false), | isKeyDown (false), | ||||
millisecsSinceKeyPressed (0) | millisecsSinceKeyPressed (0) | ||||
{ | { | ||||
@@ -41,7 +41,7 @@ ApplicationProperties::ApplicationProperties() | |||||
: msBeforeSaving (3000), | : msBeforeSaving (3000), | ||||
options (PropertiesFile::storeAsBinary), | options (PropertiesFile::storeAsBinary), | ||||
commonSettingsAreReadOnly (0), | commonSettingsAreReadOnly (0), | ||||
processLock (0) | |||||
processLock (nullptr) | |||||
{ | { | ||||
} | } | ||||
@@ -80,10 +80,10 @@ bool ApplicationProperties::testWriteAccess (const bool testUserSettings, | |||||
{ | { | ||||
String filenames; | String filenames; | ||||
if (userProps != 0 && ! userOk) | |||||
if (userProps != nullptr && ! userOk) | |||||
filenames << '\n' << userProps->getFile().getFullPathName(); | filenames << '\n' << userProps->getFile().getFullPathName(); | ||||
if (commonProps != 0 && ! commonOk) | |||||
if (commonProps != nullptr && ! commonOk) | |||||
filenames << '\n' << commonProps->getFile().getFullPathName(); | filenames << '\n' << commonProps->getFile().getFullPathName(); | ||||
AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon, | AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon, | ||||
@@ -109,11 +109,11 @@ void ApplicationProperties::openFiles() | |||||
if (appName.isNotEmpty()) | if (appName.isNotEmpty()) | ||||
{ | { | ||||
if (userProps == 0) | |||||
if (userProps == nullptr) | |||||
userProps = PropertiesFile::createDefaultAppPropertiesFile (appName, fileSuffix, folderName, | userProps = PropertiesFile::createDefaultAppPropertiesFile (appName, fileSuffix, folderName, | ||||
false, msBeforeSaving, options, processLock); | false, msBeforeSaving, options, processLock); | ||||
if (commonProps == 0) | |||||
if (commonProps == nullptr) | |||||
commonProps = PropertiesFile::createDefaultAppPropertiesFile (appName, fileSuffix, folderName, | commonProps = PropertiesFile::createDefaultAppPropertiesFile (appName, fileSuffix, folderName, | ||||
true, msBeforeSaving, options, processLock); | true, msBeforeSaving, options, processLock); | ||||
@@ -123,7 +123,7 @@ void ApplicationProperties::openFiles() | |||||
PropertiesFile* ApplicationProperties::getUserSettings() | PropertiesFile* ApplicationProperties::getUserSettings() | ||||
{ | { | ||||
if (userProps == 0) | |||||
if (userProps == nullptr) | |||||
openFiles(); | openFiles(); | ||||
return userProps; | return userProps; | ||||
@@ -131,7 +131,7 @@ PropertiesFile* ApplicationProperties::getUserSettings() | |||||
PropertiesFile* ApplicationProperties::getCommonSettings (const bool returnUserPropsIfReadOnly) | PropertiesFile* ApplicationProperties::getCommonSettings (const bool returnUserPropsIfReadOnly) | ||||
{ | { | ||||
if (commonProps == 0) | |||||
if (commonProps == nullptr) | |||||
openFiles(); | openFiles(); | ||||
if (returnUserPropsIfReadOnly) | if (returnUserPropsIfReadOnly) | ||||
@@ -148,14 +148,14 @@ PropertiesFile* ApplicationProperties::getCommonSettings (const bool returnUserP | |||||
bool ApplicationProperties::saveIfNeeded() | bool ApplicationProperties::saveIfNeeded() | ||||
{ | { | ||||
return (userProps == 0 || userProps->saveIfNeeded()) | |||||
&& (commonProps == 0 || commonProps->saveIfNeeded()); | |||||
return (userProps == nullptr || userProps->saveIfNeeded()) | |||||
&& (commonProps == nullptr || commonProps->saveIfNeeded()); | |||||
} | } | ||||
void ApplicationProperties::closeFiles() | void ApplicationProperties::closeFiles() | ||||
{ | { | ||||
userProps = 0; | |||||
commonProps = 0; | |||||
userProps = nullptr; | |||||
commonProps = nullptr; | |||||
} | } | ||||
@@ -82,7 +82,7 @@ public: | |||||
const String& folderName, | const String& folderName, | ||||
int millisecondsBeforeSaving, | int millisecondsBeforeSaving, | ||||
int propertiesFileOptions, | int propertiesFileOptions, | ||||
InterProcessLock* processLock = 0); | |||||
InterProcessLock* processLock = nullptr); | |||||
/** Tests whether the files can be successfully written to, and can show | /** Tests whether the files can be successfully written to, and can show | ||||
an error message if not. | an error message if not. | ||||
@@ -153,7 +153,7 @@ public: | |||||
if (samplesAvailable < numSamples) | if (samplesAvailable < numSamples) | ||||
{ | { | ||||
for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
if (destSamples[i] != 0) | |||||
if (destSamples[i] != nullptr) | |||||
zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * numSamples); | zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * numSamples); | ||||
numSamples = (int) samplesAvailable; | numSamples = (int) samplesAvailable; | ||||
@@ -242,7 +242,7 @@ public: | |||||
//============================================================================== | //============================================================================== | ||||
bool write (const int** data, int numSamples) | 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) | if (writeFailed) | ||||
return false; | return false; | ||||
@@ -407,7 +407,7 @@ AudioFormatReader* AiffAudioFormat::createReaderFor (InputStream* sourceStream, | |||||
return w.release(); | return w.release(); | ||||
if (! deleteStreamIfOpeningFails) | if (! deleteStreamIfOpeningFails) | ||||
w->input = 0; | |||||
w->input = nullptr; | |||||
return 0; | return 0; | ||||
} | } | ||||
@@ -125,7 +125,7 @@ public: | |||||
class BurnProgressListener | class BurnProgressListener | ||||
{ | { | ||||
public: | public: | ||||
BurnProgressListener() throw() {} | |||||
BurnProgressListener() noexcept {} | |||||
virtual ~BurnProgressListener() {} | virtual ~BurnProgressListener() {} | ||||
/** Called at intervals to report on the progress of the AudioCDBurner. | /** Called at intervals to report on the progress of the AudioCDBurner. | ||||
@@ -49,9 +49,9 @@ AudioFormatManager::~AudioFormatManager() | |||||
//============================================================================== | //============================================================================== | ||||
void AudioFormatManager::registerFormat (AudioFormat* newFormat, const bool makeThisTheDefaultFormat) | void AudioFormatManager::registerFormat (AudioFormat* newFormat, const bool makeThisTheDefaultFormat) | ||||
{ | { | ||||
jassert (newFormat != 0); | |||||
jassert (newFormat != nullptr); | |||||
if (newFormat != 0) | |||||
if (newFormat != nullptr) | |||||
{ | { | ||||
#if JUCE_DEBUG | #if JUCE_DEBUG | ||||
for (int i = getNumKnownFormats(); --i >= 0;) | for (int i = getNumKnownFormats(); --i >= 0;) | ||||
@@ -166,11 +166,11 @@ AudioFormatReader* AudioFormatManager::createReaderFor (const File& file) | |||||
{ | { | ||||
InputStream* const in = file.createInputStream(); | InputStream* const in = file.createInputStream(); | ||||
if (in != 0) | |||||
if (in != nullptr) | |||||
{ | { | ||||
AudioFormatReader* const r = af->createReaderFor (in, true); | AudioFormatReader* const r = af->createReaderFor (in, true); | ||||
if (r != 0) | |||||
if (r != nullptr) | |||||
return r; | return r; | ||||
} | } | ||||
} | } | ||||
@@ -187,7 +187,7 @@ AudioFormatReader* AudioFormatManager::createReaderFor (InputStream* audioFileSt | |||||
ScopedPointer <InputStream> in (audioFileStream); | ScopedPointer <InputStream> in (audioFileStream); | ||||
if (in != 0) | |||||
if (in != nullptr) | |||||
{ | { | ||||
const int64 originalStreamPos = in->getPosition(); | const int64 originalStreamPos = in->getPosition(); | ||||
@@ -195,7 +195,7 @@ AudioFormatReader* AudioFormatManager::createReaderFor (InputStream* audioFileSt | |||||
{ | { | ||||
AudioFormatReader* const r = getKnownFormat(i)->createReaderFor (in, false); | AudioFormatReader* const r = getKnownFormat(i)->createReaderFor (in, false); | ||||
if (r != 0) | |||||
if (r != nullptr) | |||||
{ | { | ||||
in.release(); | in.release(); | ||||
return r; | return r; | ||||
@@ -64,7 +64,7 @@ bool AudioFormatReader::read (int* const* destSamples, | |||||
const int silence = (int) jmin (-startSampleInSource, (int64) numSamplesToRead); | const int silence = (int) jmin (-startSampleInSource, (int64) numSamplesToRead); | ||||
for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
if (destSamples[i] != 0) | |||||
if (destSamples[i] != nullptr) | |||||
zeromem (destSamples[i], sizeof (int) * silence); | zeromem (destSamples[i], sizeof (int) * silence); | ||||
startOffsetInDestBuffer += silence; | startOffsetInDestBuffer += silence; | ||||
@@ -88,22 +88,22 @@ bool AudioFormatReader::read (int* const* destSamples, | |||||
for (int i = (int) numChannels; --i > 0;) | for (int i = (int) numChannels; --i > 0;) | ||||
{ | { | ||||
if (destSamples[i] != 0) | |||||
if (destSamples[i] != nullptr) | |||||
{ | { | ||||
lastFullChannel = destSamples[i]; | lastFullChannel = destSamples[i]; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
if (lastFullChannel != 0) | |||||
if (lastFullChannel != nullptr) | |||||
for (int i = numChannels; i < numDestChannels; ++i) | for (int i = numChannels; i < numDestChannels; ++i) | ||||
if (destSamples[i] != 0) | |||||
if (destSamples[i] != nullptr) | |||||
memcpy (destSamples[i], lastFullChannel, sizeof (int) * numSamplesToRead); | memcpy (destSamples[i], lastFullChannel, sizeof (int) * numSamplesToRead); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
for (int i = numChannels; i < numDestChannels; ++i) | for (int i = numChannels; i < numDestChannels; ++i) | ||||
if (destSamples[i] != 0) | |||||
if (destSamples[i] != nullptr) | |||||
zeromem (destSamples[i], sizeof (int) * numSamplesToRead); | zeromem (destSamples[i], sizeof (int) * numSamplesToRead); | ||||
} | } | ||||
} | } | ||||
@@ -66,7 +66,7 @@ public: | |||||
E.g. "AIFF" | E.g. "AIFF" | ||||
*/ | */ | ||||
const String getFormatName() const throw() { return formatName; } | |||||
const String getFormatName() const noexcept { return formatName; } | |||||
//============================================================================== | //============================================================================== | ||||
/** Reads samples from the stream. | /** Reads samples from the stream. | ||||
@@ -225,11 +225,11 @@ protected: | |||||
typedef AudioData::Pointer <DestSampleType, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> DestType; | typedef AudioData::Pointer <DestSampleType, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> DestType; | ||||
typedef AudioData::Pointer <SourceSampleType, SourceEndianness, AudioData::Interleaved, AudioData::Const> SourceType; | 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) | for (int i = 0; i < numDestChannels; ++i) | ||||
{ | { | ||||
if (destData[i] != 0) | |||||
if (destData[i] != nullptr) | |||||
{ | { | ||||
DestType dest (destData[i]); | DestType dest (destData[i]); | ||||
dest += destOffset; | dest += destOffset; | ||||
@@ -79,7 +79,7 @@ bool AudioFormatWriter::writeFromAudioReader (AudioFormatReader& reader, | |||||
{ | { | ||||
int** bufferChan = buffers; | int** bufferChan = buffers; | ||||
while (*bufferChan != 0) | |||||
while (*bufferChan != nullptr) | |||||
{ | { | ||||
int* b = *bufferChan++; | int* b = *bufferChan++; | ||||
@@ -188,7 +188,7 @@ public: | |||||
buffer (numChannels, bufferSize_), | buffer (numChannels, bufferSize_), | ||||
timeSliceThread (timeSliceThread_), | timeSliceThread (timeSliceThread_), | ||||
writer (writer_), | writer (writer_), | ||||
thumbnailToUpdate (0), | |||||
thumbnailToUpdate (nullptr), | |||||
samplesWritten (0), | samplesWritten (0), | ||||
isRunning (true) | isRunning (true) | ||||
{ | { | ||||
@@ -241,7 +241,7 @@ public: | |||||
writer->writeFromAudioSampleBuffer (buffer, start1, size1); | writer->writeFromAudioSampleBuffer (buffer, start1, size1); | ||||
const ScopedLock sl (thumbnailLock); | const ScopedLock sl (thumbnailLock); | ||||
if (thumbnailToUpdate != 0) | |||||
if (thumbnailToUpdate != nullptr) | |||||
thumbnailToUpdate->addBlock (samplesWritten, buffer, start1, size1); | thumbnailToUpdate->addBlock (samplesWritten, buffer, start1, size1); | ||||
samplesWritten += size1; | samplesWritten += size1; | ||||
@@ -250,7 +250,7 @@ public: | |||||
{ | { | ||||
writer->writeFromAudioSampleBuffer (buffer, start2, size2); | writer->writeFromAudioSampleBuffer (buffer, start2, size2); | ||||
if (thumbnailToUpdate != 0) | |||||
if (thumbnailToUpdate != nullptr) | |||||
thumbnailToUpdate->addBlock (samplesWritten, buffer, start2, size2); | thumbnailToUpdate->addBlock (samplesWritten, buffer, start2, size2); | ||||
samplesWritten += size2; | samplesWritten += size2; | ||||
@@ -262,7 +262,7 @@ public: | |||||
void setThumbnail (AudioThumbnail* thumb) | void setThumbnail (AudioThumbnail* thumb) | ||||
{ | { | ||||
if (thumb != 0) | |||||
if (thumb != nullptr) | |||||
thumb->reset (buffer.getNumChannels(), writer->getSampleRate(), 0); | thumb->reset (buffer.getNumChannels(), writer->getSampleRate(), 0); | ||||
const ScopedLock sl (thumbnailLock); | const ScopedLock sl (thumbnailLock); | ||||
@@ -77,7 +77,7 @@ public: | |||||
E.g. "AIFF file" | 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. | /** Writes a set of samples to the audio stream. | ||||
@@ -138,16 +138,16 @@ public: | |||||
//============================================================================== | //============================================================================== | ||||
/** Returns the sample rate being used. */ | /** 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. */ | /** 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. */ | /** 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. */ | /** 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; | typedef AudioData::Pointer <SourceSampleType, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const> SourceType; | ||||
static void write (void* destData, int numDestChannels, const int** source, | 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) | for (int i = 0; i < numDestChannels; ++i) | ||||
{ | { | ||||
const DestType dest (addBytesToPointer (destData, i * DestType::getBytesPerSample()), numDestChannels); | const DestType dest (addBytesToPointer (destData, i * DestType::getBytesPerSample()), numDestChannels); | ||||
if (*source != 0) | |||||
if (*source != nullptr) | |||||
{ | { | ||||
dest.convertSamples (SourceType (*source + sourceOffset), numSamples); | dest.convertSamples (SourceType (*source + sourceOffset), numSamples); | ||||
++source; | ++source; | ||||
@@ -62,7 +62,7 @@ bool AudioSubsectionReader::readSamples (int** destSamples, int numDestChannels, | |||||
if (startSampleInFile + numSamples > length) | if (startSampleInFile + numSamples > length) | ||||
{ | { | ||||
for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
if (destSamples[i] != 0) | |||||
if (destSamples[i] != nullptr) | |||||
zeromem (destSamples[i], sizeof (int) * numSamples); | zeromem (destSamples[i], sizeof (int) * numSamples); | ||||
numSamples = jmin (numSamples, (int) (length - startSampleInFile)); | numSamples = jmin (numSamples, (int) (length - startSampleInFile)); | ||||
@@ -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; | minValue = newMin; | ||||
maxValue = newMax; | 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)); | minValue = (char) jlimit (-128, 127, roundFloatToInt (newMin * 127.0f)); | ||||
maxValue = (char) jlimit (-128, 127, roundFloatToInt (newMax * 127.0f)); | maxValue = (char) jlimit (-128, 127, roundFloatToInt (newMax * 127.0f)); | ||||
@@ -57,12 +57,12 @@ struct AudioThumbnail::MinMaxValue | |||||
maxValue = (char) jmin (127, maxValue + 1); | maxValue = (char) jmin (127, maxValue + 1); | ||||
} | } | ||||
inline bool isNonZero() const throw() | |||||
inline bool isNonZero() const noexcept | |||||
{ | { | ||||
return maxValue > minValue; | return maxValue > minValue; | ||||
} | } | ||||
inline int getPeak() const throw() | |||||
inline int getPeak() const noexcept | |||||
{ | { | ||||
return jmax (std::abs ((int) minValue), | return jmax (std::abs ((int) minValue), | ||||
std::abs ((int) maxValue)); | std::abs ((int) maxValue)); | ||||
@@ -112,14 +112,14 @@ public: | |||||
createReader(); | createReader(); | ||||
if (reader != 0) | |||||
if (reader != nullptr) | |||||
{ | { | ||||
lengthInSamples = reader->lengthInSamples; | lengthInSamples = reader->lengthInSamples; | ||||
numChannels = reader->numChannels; | numChannels = reader->numChannels; | ||||
sampleRate = reader->sampleRate; | sampleRate = reader->sampleRate; | ||||
if (lengthInSamples <= 0 || isFullyLoaded()) | if (lengthInSamples <= 0 || isFullyLoaded()) | ||||
reader = 0; | |||||
reader = nullptr; | |||||
else | else | ||||
owner.cache.addTimeSliceClient (this); | owner.cache.addTimeSliceClient (this); | ||||
} | } | ||||
@@ -129,15 +129,15 @@ public: | |||||
{ | { | ||||
const ScopedLock sl (readerLock); | const ScopedLock sl (readerLock); | ||||
if (reader == 0) | |||||
if (reader == nullptr) | |||||
{ | { | ||||
createReader(); | createReader(); | ||||
if (reader != 0) | |||||
if (reader != nullptr) | |||||
owner.cache.addTimeSliceClient (this); | owner.cache.addTimeSliceClient (this); | ||||
} | } | ||||
if (reader != 0) | |||||
if (reader != nullptr) | |||||
{ | { | ||||
float l[4] = { 0 }; | float l[4] = { 0 }; | ||||
reader->readMaxLevels (startSample, numSamples, l[0], l[1], l[2], l[3]); | reader->readMaxLevels (startSample, numSamples, l[0], l[1], l[2], l[3]); | ||||
@@ -150,14 +150,14 @@ public: | |||||
void releaseResources() | void releaseResources() | ||||
{ | { | ||||
const ScopedLock sl (readerLock); | const ScopedLock sl (readerLock); | ||||
reader = 0; | |||||
reader = nullptr; | |||||
} | } | ||||
int useTimeSlice() | int useTimeSlice() | ||||
{ | { | ||||
if (isFullyLoaded()) | if (isFullyLoaded()) | ||||
{ | { | ||||
if (reader != 0 && source != 0) | |||||
if (reader != nullptr && source != nullptr) | |||||
releaseResources(); | releaseResources(); | ||||
return -1; | return -1; | ||||
@@ -170,7 +170,7 @@ public: | |||||
createReader(); | createReader(); | ||||
if (reader != 0) | |||||
if (reader != nullptr) | |||||
{ | { | ||||
if (! readNextBlock()) | if (! readNextBlock()) | ||||
return 0; | return 0; | ||||
@@ -185,12 +185,12 @@ public: | |||||
return timeBeforeDeletingReader; | return timeBeforeDeletingReader; | ||||
} | } | ||||
bool isFullyLoaded() const throw() | |||||
bool isFullyLoaded() const noexcept | |||||
{ | { | ||||
return numSamplesFinished >= lengthInSamples; | return numSamplesFinished >= lengthInSamples; | ||||
} | } | ||||
inline int sampleToThumbSample (const int64 originalSample) const throw() | |||||
inline int sampleToThumbSample (const int64 originalSample) const noexcept | |||||
{ | { | ||||
return (int) (originalSample / owner.samplesPerThumbSample); | return (int) (originalSample / owner.samplesPerThumbSample); | ||||
} | } | ||||
@@ -208,18 +208,18 @@ private: | |||||
void createReader() | void createReader() | ||||
{ | { | ||||
if (reader == 0 && source != 0) | |||||
if (reader == nullptr && source != nullptr) | |||||
{ | { | ||||
InputStream* audioFileStream = source->createInputStream(); | InputStream* audioFileStream = source->createInputStream(); | ||||
if (audioFileStream != 0) | |||||
if (audioFileStream != nullptr) | |||||
reader = owner.formatManagerToUse.createReaderFor (audioFileStream); | reader = owner.formatManagerToUse.createReaderFor (audioFileStream); | ||||
} | } | ||||
} | } | ||||
bool readNextBlock() | bool readNextBlock() | ||||
{ | { | ||||
jassert (reader != 0); | |||||
jassert (reader != nullptr); | |||||
if (! isFullyLoaded()) | if (! isFullyLoaded()) | ||||
{ | { | ||||
@@ -270,18 +270,18 @@ public: | |||||
ensureSize (numThumbSamples); | ensureSize (numThumbSamples); | ||||
} | } | ||||
inline MinMaxValue* getData (const int thumbSampleIndex) throw() | |||||
inline MinMaxValue* getData (const int thumbSampleIndex) noexcept | |||||
{ | { | ||||
jassert (thumbSampleIndex < data.size()); | jassert (thumbSampleIndex < data.size()); | ||||
return data.getRawDataPointer() + thumbSampleIndex; | return data.getRawDataPointer() + thumbSampleIndex; | ||||
} | } | ||||
int getSize() const throw() | |||||
int getSize() const noexcept | |||||
{ | { | ||||
return data.size(); | return data.size(); | ||||
} | } | ||||
void getMinMax (int startSample, int endSample, MinMaxValue& result) throw() | |||||
void getMinMax (int startSample, int endSample, MinMaxValue& result) noexcept | |||||
{ | { | ||||
if (startSample >= 0) | if (startSample >= 0) | ||||
{ | { | ||||
@@ -442,7 +442,7 @@ private: | |||||
ensureSize (numSamples); | ensureSize (numSamples); | ||||
if (timePerPixel * sampleRate <= samplesPerThumbSample && levelData != 0) | |||||
if (timePerPixel * sampleRate <= samplesPerThumbSample && levelData != nullptr) | |||||
{ | { | ||||
int sample = roundToInt (startTime * sampleRate); | int sample = roundToInt (startTime * sampleRate); | ||||
Array<float> levels; | 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())); | jassert (isPositiveAndBelow (channelNum, numChannelsCached) && isPositiveAndBelow (cacheIndex, data.size())); | ||||
@@ -538,7 +538,7 @@ AudioThumbnail::~AudioThumbnail() | |||||
void AudioThumbnail::clear() | void AudioThumbnail::clear() | ||||
{ | { | ||||
source = 0; | |||||
source = nullptr; | |||||
const ScopedLock sl (lock); | const ScopedLock sl (lock); | ||||
window->invalidate(); | window->invalidate(); | ||||
@@ -648,20 +648,20 @@ bool AudioThumbnail::setSource (InputSource* const newSource) | |||||
{ | { | ||||
clear(); | clear(); | ||||
return newSource != 0 && setDataSource (new LevelDataSource (*this, newSource)); | |||||
return newSource != nullptr && setDataSource (new LevelDataSource (*this, newSource)); | |||||
} | } | ||||
void AudioThumbnail::setReader (AudioFormatReader* newReader, int64 hash) | void AudioThumbnail::setReader (AudioFormatReader* newReader, int64 hash) | ||||
{ | { | ||||
clear(); | clear(); | ||||
if (newReader != 0) | |||||
if (newReader != nullptr) | |||||
setDataSource (new LevelDataSource (*this, newReader, hash)); | setDataSource (new LevelDataSource (*this, newReader, hash)); | ||||
} | } | ||||
int64 AudioThumbnail::getHashCode() const | 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, | 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; | return numChannels; | ||||
} | } | ||||
double AudioThumbnail::getTotalLength() const throw() | |||||
double AudioThumbnail::getTotalLength() const noexcept | |||||
{ | { | ||||
return sampleRate > 0 ? (totalSamples / sampleRate) : 0; | return sampleRate > 0 ? (totalSamples / sampleRate) : 0; | ||||
} | } | ||||
bool AudioThumbnail::isFullyLoaded() const throw() | |||||
bool AudioThumbnail::isFullyLoaded() const noexcept | |||||
{ | { | ||||
return numSamplesFinished >= totalSamples - samplesPerThumbSample; | return numSamplesFinished >= totalSamples - samplesPerThumbSample; | ||||
} | } | ||||
int64 AudioThumbnail::getNumSamplesFinished() const throw() | |||||
int64 AudioThumbnail::getNumSamplesFinished() const noexcept | |||||
{ | { | ||||
return numSamplesFinished; | return numSamplesFinished; | ||||
} | } | ||||
@@ -139,10 +139,10 @@ public: | |||||
//============================================================================== | //============================================================================== | ||||
/** Returns the number of channels in the file. */ | /** 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. */ | /** Returns the length of the audio file, in seconds. */ | ||||
double getTotalLength() const throw(); | |||||
double getTotalLength() const noexcept; | |||||
/** Draws the waveform for a channel. | /** Draws the waveform for a channel. | ||||
@@ -175,10 +175,10 @@ public: | |||||
float verticalZoomFactor); | float verticalZoomFactor); | ||||
/** Returns true if the low res preview is fully generated. */ | /** 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. */ | /** 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. | /** Returns the highest level in the thumbnail. | ||||
Note that because the thumb only stores low-resolution data, this isn't | Note that because the thumb only stores low-resolution data, this isn't | ||||
@@ -67,7 +67,7 @@ bool AudioThumbnailCache::loadThumb (AudioThumbnail& thumb, const int64 hashCode | |||||
{ | { | ||||
ThumbnailCacheEntry* te = findThumbFor (hashCode); | ThumbnailCacheEntry* te = findThumbFor (hashCode); | ||||
if (te != 0) | |||||
if (te != nullptr) | |||||
{ | { | ||||
te->lastUsed = Time::getMillisecondCounter(); | te->lastUsed = Time::getMillisecondCounter(); | ||||
@@ -84,7 +84,7 @@ void AudioThumbnailCache::storeThumb (const AudioThumbnail& thumb, | |||||
{ | { | ||||
ThumbnailCacheEntry* te = findThumbFor (hashCode); | ThumbnailCacheEntry* te = findThumbFor (hashCode); | ||||
if (te == 0) | |||||
if (te == nullptr) | |||||
{ | { | ||||
te = new ThumbnailCacheEntry(); | te = new ThumbnailCacheEntry(); | ||||
te->hash = hashCode; | te->hash = hashCode; | ||||
@@ -161,7 +161,7 @@ public: | |||||
jassert (num > 0); | jassert (num > 0); | ||||
for (int i = jmin (numDestChannels, reservoir.getNumChannels()); --i >= 0;) | for (int i = jmin (numDestChannels, reservoir.getNumChannels()); --i >= 0;) | ||||
if (destSamples[i] != 0) | |||||
if (destSamples[i] != nullptr) | |||||
memcpy (destSamples[i] + startOffsetInDestBuffer, | memcpy (destSamples[i] + startOffsetInDestBuffer, | ||||
reservoir.getSampleData (i, (int) (startSampleInFile - reservoirStart)), | reservoir.getSampleData (i, (int) (startSampleInFile - reservoirStart)), | ||||
sizeof (int) * num); | sizeof (int) * num); | ||||
@@ -200,7 +200,7 @@ public: | |||||
if (numSamples > 0) | if (numSamples > 0) | ||||
{ | { | ||||
for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
if (destSamples[i] != 0) | |||||
if (destSamples[i] != nullptr) | |||||
zeromem (destSamples[i] + startOffsetInDestBuffer, | zeromem (destSamples[i] + startOffsetInDestBuffer, | ||||
sizeof (int) * numSamples); | sizeof (int) * numSamples); | ||||
} | } | ||||
@@ -229,7 +229,7 @@ public: | |||||
while (src == 0 && n > 0) | while (src == 0 && n > 0) | ||||
src = buffer [--n]; | src = buffer [--n]; | ||||
if (src != 0) | |||||
if (src != nullptr) | |||||
{ | { | ||||
int* dest = reinterpret_cast<int*> (reservoir.getSampleData(i)); | int* dest = reinterpret_cast<int*> (reservoir.getSampleData(i)); | ||||
@@ -374,7 +374,7 @@ public: | |||||
buf[2] = 0; | buf[2] = 0; | ||||
for (int i = numChannelsToWrite; --i >= 0;) | for (int i = numChannelsToWrite; --i >= 0;) | ||||
if (samplesToWrite[i] != 0) | |||||
if (samplesToWrite[i] != nullptr) | |||||
for (int j = 0; j < numSamples; ++j) | for (int j = 0; j < numSamples; ++j) | ||||
buf [i][j] = (samplesToWrite [i][j] >> bitsToShift); | buf [i][j] = (samplesToWrite [i][j] >> bitsToShift); | ||||
@@ -511,7 +511,7 @@ AudioFormatReader* FlacAudioFormat::createReaderFor (InputStream* in, | |||||
return r.release(); | return r.release(); | ||||
if (! deleteStreamIfOpeningFails) | if (! deleteStreamIfOpeningFails) | ||||
r->input = 0; | |||||
r->input = nullptr; | |||||
return 0; | return 0; | ||||
} | } | ||||
@@ -147,7 +147,7 @@ public: | |||||
const int numToUse = jmin (numSamples, numAvailable); | const int numToUse = jmin (numSamples, numAvailable); | ||||
for (int i = jmin (numDestChannels, reservoir.getNumChannels()); --i >= 0;) | for (int i = jmin (numDestChannels, reservoir.getNumChannels()); --i >= 0;) | ||||
if (destSamples[i] != 0) | |||||
if (destSamples[i] != nullptr) | |||||
memcpy (destSamples[i] + startOffsetInDestBuffer, | memcpy (destSamples[i] + startOffsetInDestBuffer, | ||||
reservoir.getSampleData (i, (int) (startSampleInFile - reservoirStart)), | reservoir.getSampleData (i, (int) (startSampleInFile - reservoirStart)), | ||||
sizeof (float) * numToUse); | sizeof (float) * numToUse); | ||||
@@ -177,7 +177,7 @@ public: | |||||
while (numToRead > 0) | while (numToRead > 0) | ||||
{ | { | ||||
float** dataIn = 0; | |||||
float** dataIn = nullptr; | |||||
const int samps = OggVorbisNamespace::ov_read_float (&ovFile, &dataIn, numToRead, &bitStream); | const int samps = OggVorbisNamespace::ov_read_float (&ovFile, &dataIn, numToRead, &bitStream); | ||||
if (samps <= 0) | if (samps <= 0) | ||||
@@ -204,7 +204,7 @@ public: | |||||
if (numSamples > 0) | if (numSamples > 0) | ||||
{ | { | ||||
for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
if (destSamples[i] != 0) | |||||
if (destSamples[i] != nullptr) | |||||
zeromem (destSamples[i] + startOffsetInDestBuffer, | zeromem (destSamples[i] + startOffsetInDestBuffer, | ||||
sizeof (int) * numSamples); | sizeof (int) * numSamples); | ||||
} | } | ||||
@@ -277,7 +277,7 @@ public: | |||||
{ | { | ||||
vorbis_comment_init (&vc); | 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_comment_add_tag (&vc, "ENCODER", const_cast <char*> (JUCEApplication::getInstance()->getApplicationName().toUTF8().getAddress())); | ||||
vorbis_analysis_init (&vd, &vi); | vorbis_analysis_init (&vd, &vi); | ||||
@@ -327,8 +327,8 @@ public: | |||||
else | else | ||||
{ | { | ||||
vorbis_info_clear (&vi); | 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]; | float* const dst = vorbisBuffer[i]; | ||||
const int* const src = samplesToWrite [i]; | const int* const src = samplesToWrite [i]; | ||||
if (src != 0 && dst != 0) | |||||
if (src != nullptr && dst != nullptr) | |||||
{ | { | ||||
for (int j = 0; j < numSamples; ++j) | for (int j = 0; j < numSamples; ++j) | ||||
dst[j] = (float) (src[j] * gain); | dst[j] = (float) (src[j] * gain); | ||||
@@ -425,7 +425,7 @@ AudioFormatReader* OggVorbisAudioFormat::createReaderFor (InputStream* in, | |||||
return r.release(); | return r.release(); | ||||
if (! deleteStreamIfOpeningFails) | if (! deleteStreamIfOpeningFails) | ||||
r->input = 0; | |||||
r->input = nullptr; | |||||
return 0; | return 0; | ||||
} | } | ||||
@@ -457,14 +457,14 @@ int OggVorbisAudioFormat::estimateOggFileQuality (const File& source) | |||||
{ | { | ||||
FileInputStream* const in = source.createInputStream(); | FileInputStream* const in = source.createInputStream(); | ||||
if (in != 0) | |||||
if (in != nullptr) | |||||
{ | { | ||||
ScopedPointer <AudioFormatReader> r (createReaderFor (in, true)); | ScopedPointer <AudioFormatReader> r (createReaderFor (in, true)); | ||||
if (r != 0) | |||||
if (r != nullptr) | |||||
{ | { | ||||
const int64 numSamps = r->lengthInSamples; | const int64 numSamps = r->lengthInSamples; | ||||
r = 0; | |||||
r = nullptr; | |||||
const int64 fileNumSamps = source.getSize() / 4; | const int64 fileNumSamps = source.getSize() / 4; | ||||
const double ratio = numSamps / (double) fileNumSamps; | const double ratio = numSamps / (double) fileNumSamps; | ||||
@@ -216,13 +216,13 @@ public: | |||||
JUCE_AUTORELEASEPOOL | JUCE_AUTORELEASEPOOL | ||||
checkThreadIsAttached(); | checkThreadIsAttached(); | ||||
if (dataHandle != 0) | |||||
if (dataHandle != nullptr) | |||||
DisposeHandle (dataHandle); | DisposeHandle (dataHandle); | ||||
if (extractor != 0) | |||||
if (extractor != nullptr) | |||||
{ | { | ||||
MovieAudioExtractionEnd (extractor); | MovieAudioExtractionEnd (extractor); | ||||
extractor = 0; | |||||
extractor = nullptr; | |||||
} | } | ||||
DisposeMovie (movie); | DisposeMovie (movie); | ||||
@@ -278,7 +278,7 @@ public: | |||||
for (int j = numDestChannels; --j >= 0;) | for (int j = numDestChannels; --j >= 0;) | ||||
{ | { | ||||
if (destSamples[j] != 0) | |||||
if (destSamples[j] != nullptr) | |||||
{ | { | ||||
const short* src = ((const short*) bufferList->mBuffers[0].mData) + j; | const short* src = ((const short*) bufferList->mBuffers[0].mData) + j; | ||||
@@ -297,7 +297,7 @@ public: | |||||
if (((outFlags & kQTMovieAudioExtractionComplete) != 0 || samplesReceived == 0) && numSamples > 0) | if (((outFlags & kQTMovieAudioExtractionComplete) != 0 || samplesReceived == 0) && numSamples > 0) | ||||
{ | { | ||||
for (int j = numDestChannels; --j >= 0;) | for (int j = numDestChannels; --j >= 0;) | ||||
if (destSamples[j] != 0) | |||||
if (destSamples[j] != nullptr) | |||||
zeromem (destSamples[j] + startOffsetInDestBuffer, sizeof (int) * numSamples); | zeromem (destSamples[j] + startOffsetInDestBuffer, sizeof (int) * numSamples); | ||||
break; | break; | ||||
@@ -428,13 +428,13 @@ public: | |||||
bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer, | bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer, | ||||
int64 startSampleInFile, int numSamples) | int64 startSampleInFile, int numSamples) | ||||
{ | { | ||||
jassert (destSamples != 0); | |||||
jassert (destSamples != nullptr); | |||||
const int64 samplesAvailable = lengthInSamples - startSampleInFile; | const int64 samplesAvailable = lengthInSamples - startSampleInFile; | ||||
if (samplesAvailable < numSamples) | if (samplesAvailable < numSamples) | ||||
{ | { | ||||
for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
if (destSamples[i] != 0) | |||||
if (destSamples[i] != nullptr) | |||||
zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * numSamples); | zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * numSamples); | ||||
numSamples = (int) samplesAvailable; | numSamples = (int) samplesAvailable; | ||||
@@ -526,7 +526,7 @@ public: | |||||
//============================================================================== | //============================================================================== | ||||
bool write (const int** data, int numSamples) | 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) | if (writeFailed) | ||||
return false; | return false; | ||||
@@ -568,7 +568,7 @@ private: | |||||
int64 headerPosition; | int64 headerPosition; | ||||
bool writeFailed; | bool writeFailed; | ||||
static int getChannelMask (const int numChannels) throw() | |||||
static int getChannelMask (const int numChannels) noexcept | |||||
{ | { | ||||
switch (numChannels) | switch (numChannels) | ||||
{ | { | ||||
@@ -723,7 +723,7 @@ AudioFormatReader* WavAudioFormat::createReaderFor (InputStream* sourceStream, | |||||
return r.release(); | return r.release(); | ||||
if (! deleteStreamIfOpeningFails) | if (! deleteStreamIfOpeningFails) | ||||
r->input = 0; | |||||
r->input = nullptr; | |||||
return 0; | return 0; | ||||
} | } | ||||
@@ -747,23 +747,23 @@ namespace WavFileHelpers | |||||
WavAudioFormat wav; | WavAudioFormat wav; | ||||
ScopedPointer <AudioFormatReader> reader (wav.createReaderFor (file.createInputStream(), true)); | ScopedPointer <AudioFormatReader> reader (wav.createReaderFor (file.createInputStream(), true)); | ||||
if (reader != 0) | |||||
if (reader != nullptr) | |||||
{ | { | ||||
ScopedPointer <OutputStream> outStream (tempFile.getFile().createOutputStream()); | ScopedPointer <OutputStream> outStream (tempFile.getFile().createOutputStream()); | ||||
if (outStream != 0) | |||||
if (outStream != nullptr) | |||||
{ | { | ||||
ScopedPointer <AudioFormatWriter> writer (wav.createWriterFor (outStream, reader->sampleRate, | ScopedPointer <AudioFormatWriter> writer (wav.createWriterFor (outStream, reader->sampleRate, | ||||
reader->numChannels, reader->bitsPerSample, | reader->numChannels, reader->bitsPerSample, | ||||
metadata, 0)); | metadata, 0)); | ||||
if (writer != 0) | |||||
if (writer != nullptr) | |||||
{ | { | ||||
outStream.release(); | outStream.release(); | ||||
bool ok = writer->writeFromAudioReader (*reader, 0, -1); | bool ok = writer->writeFromAudioReader (*reader, 0, -1); | ||||
writer = 0; | |||||
reader = 0; | |||||
writer = nullptr; | |||||
reader = nullptr; | |||||
return ok && tempFile.overwriteTargetFileWithTemporary(); | return ok && tempFile.overwriteTargetFileWithTemporary(); | ||||
} | } | ||||
@@ -779,11 +779,11 @@ bool WavAudioFormat::replaceMetadataInFile (const File& wavFile, const StringPai | |||||
using namespace WavFileHelpers; | using namespace WavFileHelpers; | ||||
ScopedPointer <WavAudioFormatReader> reader (static_cast <WavAudioFormatReader*> (createReaderFor (wavFile.createInputStream(), true))); | ScopedPointer <WavAudioFormatReader> reader (static_cast <WavAudioFormatReader*> (createReaderFor (wavFile.createInputStream(), true))); | ||||
if (reader != 0) | |||||
if (reader != nullptr) | |||||
{ | { | ||||
const int64 bwavPos = reader->bwavChunkStart; | const int64 bwavPos = reader->bwavChunkStart; | ||||
const int64 bwavSize = reader->bwavSize; | const int64 bwavSize = reader->bwavSize; | ||||
reader = 0; | |||||
reader = nullptr; | |||||
if (bwavSize > 0) | if (bwavSize > 0) | ||||
{ | { | ||||
@@ -1165,7 +1165,7 @@ void _vp_couple_quantize_normalize(int blobno, | |||||
However, this is a temporary patch. | However, this is a temporary patch. | ||||
by Aoyumi @ 2004/04/18 | 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 | /* elliptical | ||||
if(reM[j]+reA[j]<0){ | if(reM[j]+reA[j]<0){ | ||||
reM[j] = - (qeM[j] = (fabs(reM[j])+fabs(reA[j]))*derate*derate); | reM[j] = - (qeM[j] = (fabs(reM[j])+fabs(reA[j]))*derate*derate); | ||||
@@ -38,7 +38,7 @@ AudioFormatReaderSource::AudioFormatReaderSource (AudioFormatReader* const reade | |||||
nextPlayPos (0), | nextPlayPos (0), | ||||
looping (false) | looping (false) | ||||
{ | { | ||||
jassert (reader != 0); | |||||
jassert (reader != nullptr); | |||||
} | } | ||||
AudioFormatReaderSource::~AudioFormatReaderSource() | AudioFormatReaderSource::~AudioFormatReaderSource() | ||||
@@ -69,7 +69,7 @@ public: | |||||
bool isLooping() const { return looping; } | bool isLooping() const { return looping; } | ||||
/** Returns the reader that's being used. */ | /** Returns the reader that's being used. */ | ||||
AudioFormatReader* getAudioFormatReader() const throw() { return reader; } | |||||
AudioFormatReader* getAudioFormatReader() const noexcept { return reader; } | |||||
//============================================================================== | //============================================================================== | ||||
/** Implementation of the AudioSource method. */ | /** Implementation of the AudioSource method. */ | ||||
@@ -64,7 +64,7 @@ struct JUCE_API AudioSourceChannelInfo | |||||
/** Convenient method to clear the buffer if the source is not producing any data. */ | /** Convenient method to clear the buffer if the source is not producing any data. */ | ||||
void clearActiveBufferRegion() const | void clearActiveBufferRegion() const | ||||
{ | { | ||||
if (buffer != 0) | |||||
if (buffer != nullptr) | |||||
buffer->clear (startSample, numSamples); | buffer->clear (startSample, numSamples); | ||||
} | } | ||||
}; | }; | ||||
@@ -90,7 +90,7 @@ class JUCE_API AudioSource | |||||
protected: | protected: | ||||
//============================================================================== | //============================================================================== | ||||
/** Creates an AudioSource. */ | /** Creates an AudioSource. */ | ||||
AudioSource() throw() {} | |||||
AudioSource() noexcept {} | |||||
public: | public: | ||||
/** Destructor. */ | /** Destructor. */ | ||||
@@ -32,7 +32,7 @@ BEGIN_JUCE_NAMESPACE | |||||
//============================================================================== | //============================================================================== | ||||
AudioSourcePlayer::AudioSourcePlayer() | AudioSourcePlayer::AudioSourcePlayer() | ||||
: source (0), | |||||
: source (nullptr), | |||||
sampleRate (0), | sampleRate (0), | ||||
bufferSize (0), | bufferSize (0), | ||||
tempBuffer (2, 8), | tempBuffer (2, 8), | ||||
@@ -43,7 +43,7 @@ AudioSourcePlayer::AudioSourcePlayer() | |||||
AudioSourcePlayer::~AudioSourcePlayer() | AudioSourcePlayer::~AudioSourcePlayer() | ||||
{ | { | ||||
setSource (0); | |||||
setSource (nullptr); | |||||
} | } | ||||
void AudioSourcePlayer::setSource (AudioSource* newSource) | void AudioSourcePlayer::setSource (AudioSource* newSource) | ||||
@@ -52,7 +52,7 @@ void AudioSourcePlayer::setSource (AudioSource* newSource) | |||||
{ | { | ||||
AudioSource* const oldSource = source; | AudioSource* const oldSource = source; | ||||
if (newSource != 0 && bufferSize > 0 && sampleRate > 0) | |||||
if (newSource != nullptr && bufferSize > 0 && sampleRate > 0) | |||||
newSource->prepareToPlay (bufferSize, sampleRate); | newSource->prepareToPlay (bufferSize, sampleRate); | ||||
{ | { | ||||
@@ -60,12 +60,12 @@ void AudioSourcePlayer::setSource (AudioSource* newSource) | |||||
source = newSource; | source = newSource; | ||||
} | } | ||||
if (oldSource != 0) | |||||
if (oldSource != nullptr) | |||||
oldSource->releaseResources(); | oldSource->releaseResources(); | ||||
} | } | ||||
} | } | ||||
void AudioSourcePlayer::setGain (const float newGain) throw() | |||||
void AudioSourcePlayer::setGain (const float newGain) noexcept | |||||
{ | { | ||||
gain = newGain; | gain = newGain; | ||||
} | } | ||||
@@ -81,7 +81,7 @@ void AudioSourcePlayer::audioDeviceIOCallback (const float** inputChannelData, | |||||
const ScopedLock sl (readLock); | const ScopedLock sl (readLock); | ||||
if (source != 0) | |||||
if (source != nullptr) | |||||
{ | { | ||||
AudioSourceChannelInfo info; | AudioSourceChannelInfo info; | ||||
int i, numActiveChans = 0, numInputs = 0, numOutputs = 0; | int i, numActiveChans = 0, numInputs = 0, numOutputs = 0; | ||||
@@ -90,7 +90,7 @@ void AudioSourcePlayer::audioDeviceIOCallback (const float** inputChannelData, | |||||
// of non-zero pointers.. | // of non-zero pointers.. | ||||
for (i = 0; i < totalNumInputChannels; ++i) | for (i = 0; i < totalNumInputChannels; ++i) | ||||
{ | { | ||||
if (inputChannelData[i] != 0) | |||||
if (inputChannelData[i] != nullptr) | |||||
{ | { | ||||
inputChans [numInputs++] = inputChannelData[i]; | inputChans [numInputs++] = inputChannelData[i]; | ||||
if (numInputs >= numElementsInArray (inputChans)) | if (numInputs >= numElementsInArray (inputChans)) | ||||
@@ -100,7 +100,7 @@ void AudioSourcePlayer::audioDeviceIOCallback (const float** inputChannelData, | |||||
for (i = 0; i < totalNumOutputChannels; ++i) | for (i = 0; i < totalNumOutputChannels; ++i) | ||||
{ | { | ||||
if (outputChannelData[i] != 0) | |||||
if (outputChannelData[i] != nullptr) | |||||
{ | { | ||||
outputChans [numOutputs++] = outputChannelData[i]; | outputChans [numOutputs++] = outputChannelData[i]; | ||||
if (numOutputs >= numElementsInArray (outputChans)) | if (numOutputs >= numElementsInArray (outputChans)) | ||||
@@ -163,7 +163,7 @@ void AudioSourcePlayer::audioDeviceIOCallback (const float** inputChannelData, | |||||
else | else | ||||
{ | { | ||||
for (int i = 0; i < totalNumOutputChannels; ++i) | for (int i = 0; i < totalNumOutputChannels; ++i) | ||||
if (outputChannelData[i] != 0) | |||||
if (outputChannelData[i] != nullptr) | |||||
zeromem (outputChannelData[i], sizeof (float) * numSamples); | zeromem (outputChannelData[i], sizeof (float) * numSamples); | ||||
} | } | ||||
} | } | ||||
@@ -174,13 +174,13 @@ void AudioSourcePlayer::audioDeviceAboutToStart (AudioIODevice* device) | |||||
bufferSize = device->getCurrentBufferSizeSamples(); | bufferSize = device->getCurrentBufferSizeSamples(); | ||||
zeromem (channels, sizeof (channels)); | zeromem (channels, sizeof (channels)); | ||||
if (source != 0) | |||||
if (source != nullptr) | |||||
source->prepareToPlay (bufferSize, sampleRate); | source->prepareToPlay (bufferSize, sampleRate); | ||||
} | } | ||||
void AudioSourcePlayer::audioDeviceStopped() | void AudioSourcePlayer::audioDeviceStopped() | ||||
{ | { | ||||
if (source != 0) | |||||
if (source != nullptr) | |||||
source->releaseResources(); | source->releaseResources(); | ||||
sampleRate = 0.0; | sampleRate = 0.0; | ||||
@@ -72,17 +72,17 @@ public: | |||||
May return 0 if there's no source. | 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. | /** Sets a gain to apply to the audio data. | ||||
@see getGain | @see getGain | ||||
*/ | */ | ||||
void setGain (float newGain) throw(); | |||||
void setGain (float newGain) noexcept; | |||||
/** Returns the current gain. | /** Returns the current gain. | ||||
@see setGain | @see setGain | ||||
*/ | */ | ||||
float getGain() const throw() { return gain; } | |||||
float getGain() const noexcept { return gain; } | |||||
//============================================================================== | //============================================================================== | ||||
/** Implementation of the AudioIODeviceCallback method. */ | /** Implementation of the AudioIODeviceCallback method. */ | ||||
@@ -33,11 +33,11 @@ BEGIN_JUCE_NAMESPACE | |||||
//============================================================================== | //============================================================================== | ||||
AudioTransportSource::AudioTransportSource() | 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), | gain (1.0f), | ||||
lastGain (1.0f), | lastGain (1.0f), | ||||
playing (false), | playing (false), | ||||
@@ -53,7 +53,7 @@ AudioTransportSource::AudioTransportSource() | |||||
AudioTransportSource::~AudioTransportSource() | AudioTransportSource::~AudioTransportSource() | ||||
{ | { | ||||
setSource (0); | |||||
setSource (nullptr); | |||||
releaseResources(); | releaseResources(); | ||||
} | } | ||||
@@ -65,7 +65,7 @@ void AudioTransportSource::setSource (PositionableAudioSource* const newSource, | |||||
{ | { | ||||
if (source == newSource) | if (source == newSource) | ||||
{ | { | ||||
if (source == 0) | |||||
if (source == nullptr) | |||||
return; | return; | ||||
setSource (0, 0, 0); // deselect and reselect to avoid releasing resources wrongly | setSource (0, 0, 0); // deselect and reselect to avoid releasing resources wrongly | ||||
@@ -74,16 +74,16 @@ void AudioTransportSource::setSource (PositionableAudioSource* const newSource, | |||||
readAheadBufferSize = readAheadBufferSize_; | readAheadBufferSize = readAheadBufferSize_; | ||||
sourceSampleRate = sourceSampleRateToCorrectFor; | 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 <ResamplingAudioSource> oldResamplerSource (resamplerSource); | ||||
ScopedPointer <BufferingAudioSource> oldBufferingSource (bufferingSource); | ScopedPointer <BufferingAudioSource> oldBufferingSource (bufferingSource); | ||||
AudioSource* oldMasterSource = masterSource; | AudioSource* oldMasterSource = masterSource; | ||||
if (newSource != 0) | |||||
if (newSource != nullptr) | |||||
{ | { | ||||
newPositionableSource = newSource; | newPositionableSource = newSource; | ||||
@@ -101,7 +101,7 @@ void AudioTransportSource::setSource (PositionableAudioSource* const newSource, | |||||
if (isPrepared) | if (isPrepared) | ||||
{ | { | ||||
if (newResamplerSource != 0 && sourceSampleRate > 0 && sampleRate > 0) | |||||
if (newResamplerSource != nullptr && sourceSampleRate > 0 && sampleRate > 0) | |||||
newResamplerSource->setResamplingRatio (sourceSampleRate / sampleRate); | newResamplerSource->setResamplingRatio (sourceSampleRate / sampleRate); | ||||
newMasterSource->prepareToPlay (blockSize, sampleRate); | newMasterSource->prepareToPlay (blockSize, sampleRate); | ||||
@@ -120,13 +120,13 @@ void AudioTransportSource::setSource (PositionableAudioSource* const newSource, | |||||
playing = false; | playing = false; | ||||
} | } | ||||
if (oldMasterSource != 0) | |||||
if (oldMasterSource != nullptr) | |||||
oldMasterSource->releaseResources(); | oldMasterSource->releaseResources(); | ||||
} | } | ||||
void AudioTransportSource::start() | void AudioTransportSource::start() | ||||
{ | { | ||||
if ((! playing) && masterSource != 0) | |||||
if ((! playing) && masterSource != nullptr) | |||||
{ | { | ||||
{ | { | ||||
const ScopedLock sl (callbackLock); | const ScopedLock sl (callbackLock); | ||||
@@ -177,7 +177,7 @@ double AudioTransportSource::getLengthInSeconds() const | |||||
void AudioTransportSource::setNextReadPosition (int64 newPosition) | void AudioTransportSource::setNextReadPosition (int64 newPosition) | ||||
{ | { | ||||
if (positionableSource != 0) | |||||
if (positionableSource != nullptr) | |||||
{ | { | ||||
if (sampleRate > 0 && sourceSampleRate > 0) | if (sampleRate > 0 && sourceSampleRate > 0) | ||||
newPosition = (int64) (newPosition * sourceSampleRate / sampleRate); | newPosition = (int64) (newPosition * sourceSampleRate / sampleRate); | ||||
@@ -188,7 +188,7 @@ void AudioTransportSource::setNextReadPosition (int64 newPosition) | |||||
int64 AudioTransportSource::getNextReadPosition() const | int64 AudioTransportSource::getNextReadPosition() const | ||||
{ | { | ||||
if (positionableSource != 0) | |||||
if (positionableSource != nullptr) | |||||
{ | { | ||||
const double ratio = (sampleRate > 0 && sourceSampleRate > 0) ? sampleRate / sourceSampleRate : 1.0; | const double ratio = (sampleRate > 0 && sourceSampleRate > 0) ? sampleRate / sourceSampleRate : 1.0; | ||||
@@ -202,7 +202,7 @@ int64 AudioTransportSource::getTotalLength() const | |||||
{ | { | ||||
const ScopedLock sl (callbackLock); | const ScopedLock sl (callbackLock); | ||||
if (positionableSource != 0) | |||||
if (positionableSource != nullptr) | |||||
{ | { | ||||
const double ratio = (sampleRate > 0 && sourceSampleRate > 0) ? sampleRate / sourceSampleRate : 1.0; | const double ratio = (sampleRate > 0 && sourceSampleRate > 0) ? sampleRate / sourceSampleRate : 1.0; | ||||
@@ -216,11 +216,11 @@ bool AudioTransportSource::isLooping() const | |||||
{ | { | ||||
const ScopedLock sl (callbackLock); | const ScopedLock sl (callbackLock); | ||||
return positionableSource != 0 | |||||
return positionableSource != nullptr | |||||
&& positionableSource->isLooping(); | && positionableSource->isLooping(); | ||||
} | } | ||||
void AudioTransportSource::setGain (const float newGain) throw() | |||||
void AudioTransportSource::setGain (const float newGain) noexcept | |||||
{ | { | ||||
gain = newGain; | gain = newGain; | ||||
} | } | ||||
@@ -233,10 +233,10 @@ void AudioTransportSource::prepareToPlay (int samplesPerBlockExpected, | |||||
sampleRate = sampleRate_; | sampleRate = sampleRate_; | ||||
blockSize = samplesPerBlockExpected; | blockSize = samplesPerBlockExpected; | ||||
if (masterSource != 0) | |||||
if (masterSource != nullptr) | |||||
masterSource->prepareToPlay (samplesPerBlockExpected, sampleRate); | masterSource->prepareToPlay (samplesPerBlockExpected, sampleRate); | ||||
if (resamplerSource != 0 && sourceSampleRate > 0) | |||||
if (resamplerSource != nullptr && sourceSampleRate > 0) | |||||
resamplerSource->setResamplingRatio (sourceSampleRate / sampleRate); | resamplerSource->setResamplingRatio (sourceSampleRate / sampleRate); | ||||
isPrepared = true; | isPrepared = true; | ||||
@@ -246,7 +246,7 @@ void AudioTransportSource::releaseResources() | |||||
{ | { | ||||
const ScopedLock sl (callbackLock); | const ScopedLock sl (callbackLock); | ||||
if (masterSource != 0) | |||||
if (masterSource != nullptr) | |||||
masterSource->releaseResources(); | masterSource->releaseResources(); | ||||
isPrepared = false; | isPrepared = false; | ||||
@@ -258,7 +258,7 @@ void AudioTransportSource::getNextAudioBlock (const AudioSourceChannelInfo& info | |||||
inputStreamEOF = false; | inputStreamEOF = false; | ||||
if (masterSource != 0 && ! stopped) | |||||
if (masterSource != nullptr && ! stopped) | |||||
{ | { | ||||
masterSource->getNextAudioBlock (info); | masterSource->getNextAudioBlock (info); | ||||
@@ -103,7 +103,7 @@ public: | |||||
/** Returns true if the player has stopped because its input stream ran out of data. | /** 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). | /** Starts playing (if a source has been selected). | ||||
@@ -121,7 +121,7 @@ public: | |||||
void stop(); | void stop(); | ||||
/** Returns true if it's currently playing. */ | /** 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. | /** Changes the gain to apply to the output. | ||||
@@ -129,13 +129,13 @@ public: | |||||
@param newGain a factor by which to multiply the outgoing samples, | @param newGain a factor by which to multiply the outgoing samples, | ||||
so 1.0 = 0dB, 0.5 = -6dB, 2.0 = 6dB, etc. | 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. | /** Returns the current gain setting. | ||||
@see setGain | @see setGain | ||||
*/ | */ | ||||
float getGain() const throw() { return gain; } | |||||
float getGain() const noexcept { return gain; } | |||||
//============================================================================== | //============================================================================== | ||||
@@ -96,7 +96,7 @@ private: | |||||
BufferingAudioSource* const b = sources[i]; | BufferingAudioSource* const b = sources[i]; | ||||
if (b != 0 && b->readNextBufferChunk()) | |||||
if (b != nullptr && b->readNextBufferChunk()) | |||||
busy = true; | busy = true; | ||||
} | } | ||||
@@ -131,7 +131,7 @@ BufferingAudioSource::BufferingAudioSource (PositionableAudioSource* source_, | |||||
nextPlayPos (0), | nextPlayPos (0), | ||||
wasSourceLooping (false) | wasSourceLooping (false) | ||||
{ | { | ||||
jassert (source_ != 0); | |||||
jassert (source_ != nullptr); | |||||
jassert (numberOfSamplesToBuffer_ > 1024); // not much point using this class if you're | jassert (numberOfSamplesToBuffer_ > 1024); // not much point using this class if you're | ||||
// not using a larger buffer.. | // not using a larger buffer.. | ||||
@@ -141,7 +141,7 @@ BufferingAudioSource::~BufferingAudioSource() | |||||
{ | { | ||||
SharedBufferingAudioSourceThread* const thread = SharedBufferingAudioSourceThread::getInstanceWithoutCreating(); | SharedBufferingAudioSourceThread* const thread = SharedBufferingAudioSourceThread::getInstanceWithoutCreating(); | ||||
if (thread != 0) | |||||
if (thread != nullptr) | |||||
thread->removeSource (this); | thread->removeSource (this); | ||||
if (deleteSourceWhenDeleted) | if (deleteSourceWhenDeleted) | ||||
@@ -175,7 +175,7 @@ void BufferingAudioSource::releaseResources() | |||||
{ | { | ||||
SharedBufferingAudioSourceThread* const thread = SharedBufferingAudioSourceThread::getInstanceWithoutCreating(); | SharedBufferingAudioSourceThread* const thread = SharedBufferingAudioSourceThread::getInstanceWithoutCreating(); | ||||
if (thread != 0) | |||||
if (thread != nullptr) | |||||
thread->removeSource (this); | thread->removeSource (this); | ||||
buffer.setSize (2, 0); | buffer.setSize (2, 0); | ||||
@@ -242,7 +242,7 @@ void BufferingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& info | |||||
SharedBufferingAudioSourceThread* const thread = SharedBufferingAudioSourceThread::getInstanceWithoutCreating(); | SharedBufferingAudioSourceThread* const thread = SharedBufferingAudioSourceThread::getInstanceWithoutCreating(); | ||||
if (thread != 0) | |||||
if (thread != nullptr) | |||||
thread->notify(); | thread->notify(); | ||||
} | } | ||||
@@ -261,7 +261,7 @@ void BufferingAudioSource::setNextReadPosition (int64 newPosition) | |||||
SharedBufferingAudioSourceThread* const thread = SharedBufferingAudioSourceThread::getInstanceWithoutCreating(); | SharedBufferingAudioSourceThread* const thread = SharedBufferingAudioSourceThread::getInstanceWithoutCreating(); | ||||
if (thread != 0) | |||||
if (thread != nullptr) | |||||
thread->notify(); | thread->notify(); | ||||
} | } | ||||
@@ -35,7 +35,7 @@ IIRFilterAudioSource::IIRFilterAudioSource (AudioSource* const inputSource, | |||||
: input (inputSource), | : input (inputSource), | ||||
deleteInputWhenDeleted (deleteInputWhenDeleted_) | deleteInputWhenDeleted (deleteInputWhenDeleted_) | ||||
{ | { | ||||
jassert (inputSource != 0); | |||||
jassert (inputSource != nullptr); | |||||
for (int i = 2; --i >= 0;) | for (int i = 2; --i >= 0;) | ||||
iirFilters.add (new IIRFilter()); | iirFilters.add (new IIRFilter()); | ||||
@@ -47,7 +47,7 @@ MixerAudioSource::~MixerAudioSource() | |||||
//============================================================================== | //============================================================================== | ||||
void MixerAudioSource::addInputSource (AudioSource* input, const bool deleteWhenRemoved) | void MixerAudioSource::addInputSource (AudioSource* input, const bool deleteWhenRemoved) | ||||
{ | { | ||||
if (input != 0 && ! inputs.contains (input)) | |||||
if (input != nullptr && ! inputs.contains (input)) | |||||
{ | { | ||||
double localRate; | double localRate; | ||||
int localBufferSize; | int localBufferSize; | ||||
@@ -70,7 +70,7 @@ void MixerAudioSource::addInputSource (AudioSource* input, const bool deleteWhen | |||||
void MixerAudioSource::removeInputSource (AudioSource* input, const bool deleteInput) | void MixerAudioSource::removeInputSource (AudioSource* input, const bool deleteInput) | ||||
{ | { | ||||
if (input != 0) | |||||
if (input != nullptr) | |||||
{ | { | ||||
int index; | int index; | ||||
@@ -44,7 +44,7 @@ class JUCE_API PositionableAudioSource : public AudioSource | |||||
protected: | protected: | ||||
//============================================================================== | //============================================================================== | ||||
/** Creates the PositionableAudioSource. */ | /** Creates the PositionableAudioSource. */ | ||||
PositionableAudioSource() throw() {} | |||||
PositionableAudioSource() noexcept {} | |||||
public: | public: | ||||
/** Destructor */ | /** Destructor */ | ||||
@@ -42,7 +42,7 @@ ResamplingAudioSource::ResamplingAudioSource (AudioSource* const inputSource, | |||||
sampsInBuffer (0), | sampsInBuffer (0), | ||||
numChannels (numChannels_) | numChannels (numChannels_) | ||||
{ | { | ||||
jassert (input != 0); | |||||
jassert (input != nullptr); | |||||
} | } | ||||
ResamplingAudioSource::~ResamplingAudioSource() | ResamplingAudioSource::~ResamplingAudioSource() | ||||
@@ -256,10 +256,10 @@ void ResamplingAudioSource::applyFilter (float* samples, int num, FilterState& f | |||||
- coefficients[4] * fs.y1 | - coefficients[4] * fs.y1 | ||||
- coefficients[5] * fs.y2; | - coefficients[5] * fs.y2; | ||||
#if JUCE_INTEL | |||||
#if JUCE_INTEL | |||||
if (! (out < -1.0e-8 || out > 1.0e-8)) | if (! (out < -1.0e-8 || out > 1.0e-8)) | ||||
out = 0; | out = 0; | ||||
#endif | |||||
#endif | |||||
fs.x2 = fs.x1; | fs.x2 = fs.x1; | ||||
fs.x1 = in; | fs.x1 = in; | ||||
@@ -68,7 +68,7 @@ public: | |||||
This is the value that was set by setResamplingRatio(). | 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); | void prepareToPlay (int samplesPerBlockExpected, double sampleRate); | ||||
@@ -57,15 +57,13 @@ bool AudioDeviceManager::AudioDeviceSetup::operator== (const AudioDeviceManager: | |||||
//============================================================================== | //============================================================================== | ||||
AudioDeviceManager::AudioDeviceManager() | AudioDeviceManager::AudioDeviceManager() | ||||
: currentAudioDevice (0), | |||||
numInputChansNeeded (0), | |||||
: numInputChansNeeded (0), | |||||
numOutputChansNeeded (2), | numOutputChansNeeded (2), | ||||
listNeedsScanning (true), | listNeedsScanning (true), | ||||
useInputNames (false), | useInputNames (false), | ||||
inputLevelMeasurementEnabledCount (0), | inputLevelMeasurementEnabledCount (0), | ||||
inputLevel (0), | inputLevel (0), | ||||
tempBuffer (2, 2), | tempBuffer (2, 2), | ||||
defaultMidiOutput (0), | |||||
cpuUsageMs (0), | cpuUsageMs (0), | ||||
timeToCpuScale (0) | timeToCpuScale (0) | ||||
{ | { | ||||
@@ -74,8 +72,8 @@ AudioDeviceManager::AudioDeviceManager() | |||||
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) | static void addIfNotNull (OwnedArray <AudioIODeviceType>& list, AudioIODeviceType* const device) | ||||
{ | { | ||||
if (device != 0) | |||||
if (device != nullptr) | |||||
list.add (device); | list.add (device); | ||||
} | } | ||||
@@ -132,14 +130,14 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, | |||||
numInputChansNeeded = numInputChannelsNeeded; | numInputChansNeeded = numInputChannelsNeeded; | ||||
numOutputChansNeeded = numOutputChannelsNeeded; | numOutputChansNeeded = numOutputChannelsNeeded; | ||||
if (e != 0 && e->hasTagName ("DEVICESETUP")) | |||||
if (e != nullptr && e->hasTagName ("DEVICESETUP")) | |||||
{ | { | ||||
lastExplicitSettings = new XmlElement (*e); | lastExplicitSettings = new XmlElement (*e); | ||||
String error; | String error; | ||||
AudioDeviceSetup setup; | AudioDeviceSetup setup; | ||||
if (preferredSetupOptions != 0) | |||||
if (preferredSetupOptions != nullptr) | |||||
setup = *preferredSetupOptions; | setup = *preferredSetupOptions; | ||||
if (e->getStringAttribute ("audioDeviceName").isNotEmpty()) | if (e->getStringAttribute ("audioDeviceName").isNotEmpty()) | ||||
@@ -158,7 +156,7 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, | |||||
{ | { | ||||
AudioIODeviceType* const type = findType (setup.inputDeviceName, setup.outputDeviceName); | AudioIODeviceType* const type = findType (setup.inputDeviceName, setup.outputDeviceName); | ||||
if (type != 0) | |||||
if (type != nullptr) | |||||
currentDeviceType = type->getTypeName(); | currentDeviceType = type->getTypeName(); | ||||
else if (availableDeviceTypes.size() > 0) | else if (availableDeviceTypes.size() > 0) | ||||
currentDeviceType = availableDeviceTypes[0]->getTypeName(); | currentDeviceType = availableDeviceTypes[0]->getTypeName(); | ||||
@@ -196,7 +194,7 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, | |||||
{ | { | ||||
AudioDeviceSetup setup; | AudioDeviceSetup setup; | ||||
if (preferredSetupOptions != 0) | |||||
if (preferredSetupOptions != nullptr) | |||||
{ | { | ||||
setup = *preferredSetupOptions; | setup = *preferredSetupOptions; | ||||
} | } | ||||
@@ -239,7 +237,7 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, | |||||
void AudioDeviceManager::insertDefaultDeviceNames (AudioDeviceSetup& setup) const | void AudioDeviceManager::insertDefaultDeviceNames (AudioDeviceSetup& setup) const | ||||
{ | { | ||||
AudioIODeviceType* type = getCurrentDeviceTypeObject(); | AudioIODeviceType* type = getCurrentDeviceTypeObject(); | ||||
if (type != 0) | |||||
if (type != nullptr) | |||||
{ | { | ||||
if (setup.outputDeviceName.isEmpty()) | if (setup.outputDeviceName.isEmpty()) | ||||
setup.outputDeviceName = type->getDeviceNames (false) [type->getDefaultDeviceIndex (false)]; | setup.outputDeviceName = type->getDeviceNames (false) [type->getDefaultDeviceIndex (false)]; | ||||
@@ -251,7 +249,7 @@ void AudioDeviceManager::insertDefaultDeviceNames (AudioDeviceSetup& setup) cons | |||||
XmlElement* AudioDeviceManager::createStateXml() const | 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() | void AudioDeviceManager::deleteCurrentDevice() | ||||
{ | { | ||||
currentAudioDevice = 0; | |||||
currentAudioDevice = nullptr; | |||||
currentSetup.inputDeviceName = String::empty; | currentSetup.inputDeviceName = String::empty; | ||||
currentSetup.outputDeviceName = String::empty; | currentSetup.outputDeviceName = String::empty; | ||||
} | } | ||||
@@ -333,7 +331,7 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne | |||||
{ | { | ||||
jassert (&newSetup != ¤tSetup); // this will have no effect | jassert (&newSetup != ¤tSetup); // this will have no effect | ||||
if (newSetup == currentSetup && currentAudioDevice != 0) | |||||
if (newSetup == currentSetup && currentAudioDevice != nullptr) | |||||
return String::empty; | return String::empty; | ||||
if (! (newSetup == currentSetup)) | if (! (newSetup == currentSetup)) | ||||
@@ -347,7 +345,7 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne | |||||
String error; | String error; | ||||
AudioIODeviceType* type = getCurrentDeviceTypeObject(); | AudioIODeviceType* type = getCurrentDeviceTypeObject(); | ||||
if (type == 0 || (newInputDeviceName.isEmpty() && newOutputDeviceName.isEmpty())) | |||||
if (type == nullptr || (newInputDeviceName.isEmpty() && newOutputDeviceName.isEmpty())) | |||||
{ | { | ||||
deleteCurrentDevice(); | deleteCurrentDevice(); | ||||
@@ -359,7 +357,7 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne | |||||
if (currentSetup.inputDeviceName != newInputDeviceName | if (currentSetup.inputDeviceName != newInputDeviceName | ||||
|| currentSetup.outputDeviceName != newOutputDeviceName | || currentSetup.outputDeviceName != newOutputDeviceName | ||||
|| currentAudioDevice == 0) | |||||
|| currentAudioDevice == nullptr) | |||||
{ | { | ||||
deleteCurrentDevice(); | deleteCurrentDevice(); | ||||
scanDevicesIfNeeded(); | scanDevicesIfNeeded(); | ||||
@@ -378,7 +376,7 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne | |||||
currentAudioDevice = type->createDevice (newOutputDeviceName, newInputDeviceName); | 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!"; | 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 | else | ||||
error = currentAudioDevice->getLastError(); | error = currentAudioDevice->getLastError(); | ||||
@@ -452,7 +450,7 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne | |||||
double AudioDeviceManager::chooseBestSampleRate (double rate) const | double AudioDeviceManager::chooseBestSampleRate (double rate) const | ||||
{ | { | ||||
jassert (currentAudioDevice != 0); | |||||
jassert (currentAudioDevice != nullptr); | |||||
if (rate > 0) | if (rate > 0) | ||||
for (int i = currentAudioDevice->getNumSampleRates(); --i >= 0;) | for (int i = currentAudioDevice->getNumSampleRates(); --i >= 0;) | ||||
@@ -477,7 +475,7 @@ double AudioDeviceManager::chooseBestSampleRate (double rate) const | |||||
int AudioDeviceManager::chooseBestBufferSize (int bufferSize) const | int AudioDeviceManager::chooseBestBufferSize (int bufferSize) const | ||||
{ | { | ||||
jassert (currentAudioDevice != 0); | |||||
jassert (currentAudioDevice != nullptr); | |||||
if (bufferSize > 0) | if (bufferSize > 0) | ||||
for (int i = currentAudioDevice->getNumBufferSizesAvailable(); --i >= 0;) | for (int i = currentAudioDevice->getNumBufferSizesAvailable(); --i >= 0;) | ||||
@@ -489,21 +487,21 @@ int AudioDeviceManager::chooseBestBufferSize (int bufferSize) const | |||||
void AudioDeviceManager::stopDevice() | void AudioDeviceManager::stopDevice() | ||||
{ | { | ||||
if (currentAudioDevice != 0) | |||||
if (currentAudioDevice != nullptr) | |||||
currentAudioDevice->stop(); | currentAudioDevice->stop(); | ||||
testSound = 0; | |||||
testSound = nullptr; | |||||
} | } | ||||
void AudioDeviceManager::closeAudioDevice() | void AudioDeviceManager::closeAudioDevice() | ||||
{ | { | ||||
stopDevice(); | stopDevice(); | ||||
currentAudioDevice = 0; | |||||
currentAudioDevice = nullptr; | |||||
} | } | ||||
void AudioDeviceManager::restartLastAudioDevice() | void AudioDeviceManager::restartLastAudioDevice() | ||||
{ | { | ||||
if (currentAudioDevice == 0) | |||||
if (currentAudioDevice == nullptr) | |||||
{ | { | ||||
if (currentSetup.inputDeviceName.isEmpty() | if (currentSetup.inputDeviceName.isEmpty() | ||||
&& currentSetup.outputDeviceName.isEmpty()) | && currentSetup.outputDeviceName.isEmpty()) | ||||
@@ -528,7 +526,7 @@ void AudioDeviceManager::updateXml() | |||||
lastExplicitSettings->setAttribute ("audioOutputDeviceName", currentSetup.outputDeviceName); | lastExplicitSettings->setAttribute ("audioOutputDeviceName", currentSetup.outputDeviceName); | ||||
lastExplicitSettings->setAttribute ("audioInputDeviceName", currentSetup.inputDeviceName); | lastExplicitSettings->setAttribute ("audioInputDeviceName", currentSetup.inputDeviceName); | ||||
if (currentAudioDevice != 0) | |||||
if (currentAudioDevice != nullptr) | |||||
{ | { | ||||
lastExplicitSettings->setAttribute ("audioDeviceRate", currentAudioDevice->getCurrentSampleRate()); | lastExplicitSettings->setAttribute ("audioDeviceRate", currentAudioDevice->getCurrentSampleRate()); | ||||
@@ -577,7 +575,7 @@ void AudioDeviceManager::addAudioCallback (AudioIODeviceCallback* newCallback) | |||||
return; | return; | ||||
} | } | ||||
if (currentAudioDevice != 0 && newCallback != 0) | |||||
if (currentAudioDevice != nullptr && newCallback != nullptr) | |||||
newCallback->audioDeviceAboutToStart (currentAudioDevice); | newCallback->audioDeviceAboutToStart (currentAudioDevice); | ||||
const ScopedLock sl (audioCallbackLock); | const ScopedLock sl (audioCallbackLock); | ||||
@@ -586,9 +584,9 @@ void AudioDeviceManager::addAudioCallback (AudioIODeviceCallback* newCallback) | |||||
void AudioDeviceManager::removeAudioCallback (AudioIODeviceCallback* callbackToRemove) | void AudioDeviceManager::removeAudioCallback (AudioIODeviceCallback* callbackToRemove) | ||||
{ | { | ||||
if (callbackToRemove != 0) | |||||
if (callbackToRemove != nullptr) | |||||
{ | { | ||||
bool needsDeinitialising = currentAudioDevice != 0; | |||||
bool needsDeinitialising = currentAudioDevice != nullptr; | |||||
{ | { | ||||
const ScopedLock sl (audioCallbackLock); | const ScopedLock sl (audioCallbackLock); | ||||
@@ -657,7 +655,7 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat | |||||
const float* const src = tempChans [chan]; | const float* const src = tempChans [chan]; | ||||
float* const dst = outputChannelData [chan]; | float* const dst = outputChannelData [chan]; | ||||
if (src != 0 && dst != 0) | |||||
if (src != nullptr && dst != nullptr) | |||||
for (int j = 0; j < numSamples; ++j) | for (int j = 0; j < numSamples; ++j) | ||||
dst[j] += src[j]; | dst[j] += src[j]; | ||||
} | } | ||||
@@ -673,7 +671,7 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat | |||||
zeromem (outputChannelData[i], sizeof (float) * numSamples); | zeromem (outputChannelData[i], sizeof (float) * numSamples); | ||||
} | } | ||||
if (testSound != 0) | |||||
if (testSound != nullptr) | |||||
{ | { | ||||
const int numSamps = jmin (numSamples, testSound->getNumSamples() - testSoundPosition); | const int numSamps = jmin (numSamples, testSound->getNumSamples() - testSoundPosition); | ||||
const float* const src = testSound->getSampleData (0, testSoundPosition); | const float* const src = testSound->getSampleData (0, testSoundPosition); | ||||
@@ -684,7 +682,7 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat | |||||
testSoundPosition += numSamps; | testSoundPosition += numSamps; | ||||
if (testSoundPosition >= testSound->getNumSamples()) | if (testSoundPosition >= testSound->getNumSamples()) | ||||
testSound = 0; | |||||
testSound = nullptr; | |||||
} | } | ||||
} | } | ||||
@@ -738,12 +736,12 @@ void AudioDeviceManager::setMidiInputEnabled (const String& name, | |||||
if (index >= 0) | 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()) | if (! message.isActiveSense()) | ||||
{ | { | ||||
const bool isDefaultSource = (source == 0 || source == enabledMidiInputs.getFirst()); | |||||
const bool isDefaultSource = (source == nullptr || source == enabledMidiInputs.getFirst()); | |||||
const ScopedLock sl (midiCallbackLock); | const ScopedLock sl (midiCallbackLock); | ||||
@@ -826,17 +824,17 @@ void AudioDeviceManager::setDefaultMidiOutput (const String& deviceName) | |||||
callbacks.clear(); | callbacks.clear(); | ||||
} | } | ||||
if (currentAudioDevice != 0) | |||||
if (currentAudioDevice != nullptr) | |||||
for (int i = oldCallbacks.size(); --i >= 0;) | for (int i = oldCallbacks.size(); --i >= 0;) | ||||
oldCallbacks.getUnchecked(i)->audioDeviceStopped(); | oldCallbacks.getUnchecked(i)->audioDeviceStopped(); | ||||
defaultMidiOutput = 0; | |||||
defaultMidiOutput = nullptr; | |||||
defaultMidiOutputName = deviceName; | defaultMidiOutputName = deviceName; | ||||
if (deviceName.isNotEmpty()) | if (deviceName.isNotEmpty()) | ||||
defaultMidiOutput = MidiOutput::openDevice (MidiOutput::getDevices().indexOf (deviceName)); | defaultMidiOutput = MidiOutput::openDevice (MidiOutput::getDevices().indexOf (deviceName)); | ||||
if (currentAudioDevice != 0) | |||||
if (currentAudioDevice != nullptr) | |||||
for (int i = oldCallbacks.size(); --i >= 0;) | for (int i = oldCallbacks.size(); --i >= 0;) | ||||
oldCallbacks.getUnchecked(i)->audioDeviceAboutToStart (currentAudioDevice); | oldCallbacks.getUnchecked(i)->audioDeviceAboutToStart (currentAudioDevice); | ||||
@@ -889,7 +887,7 @@ void AudioDeviceManager::playTestSound() | |||||
testSoundPosition = 0; | testSoundPosition = 0; | ||||
if (currentAudioDevice != 0) | |||||
if (currentAudioDevice != nullptr) | |||||
{ | { | ||||
const double sampleRate = currentAudioDevice->getCurrentSampleRate(); | const double sampleRate = currentAudioDevice->getCurrentSampleRate(); | ||||
const int soundLength = (int) sampleRate; | const int soundLength = (int) sampleRate; | ||||
@@ -235,7 +235,7 @@ public: | |||||
/** Returns the currently-active audio device. */ | /** 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. | /** Returns the type of audio device currently in use. | ||||
@see setCurrentAudioDeviceType | @see setCurrentAudioDeviceType | ||||
@@ -380,7 +380,7 @@ public: | |||||
@see getDefaultMidiOutputName | @see getDefaultMidiOutputName | ||||
*/ | */ | ||||
MidiOutput* getDefaultMidiOutput() const throw() { return defaultMidiOutput; } | |||||
MidiOutput* getDefaultMidiOutput() const noexcept { return defaultMidiOutput; } | |||||
/** Returns a list of the types of device supported. | /** 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 | 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. | 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. | /** 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 | 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. | it must only be used for very brief periods when absolutely necessary. | ||||
*/ | */ | ||||
CriticalSection& getMidiCallbackLock() throw() { return midiCallbackLock; } | |||||
CriticalSection& getMidiCallbackLock() noexcept { return midiCallbackLock; } | |||||
private: | private: | ||||
//============================================================================== | //============================================================================== | ||||
@@ -136,13 +136,13 @@ public: | |||||
//============================================================================== | //============================================================================== | ||||
/** Returns the device's name, (as set in the constructor). */ | /** 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. | /** Returns the type of the device. | ||||
E.g. "CoreAudio", "ASIO", etc. - this comes from the AudioIODeviceType that created it. | 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. | /** Returns the names of all the available output channels on this device. | ||||
@@ -71,7 +71,7 @@ public: | |||||
This will be something like "DirectSound", "ASIO", "CoreAudio", "ALSA", etc. | 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. | /** Refreshes the object's cached list of known devices. | ||||
@@ -71,22 +71,22 @@ public: | |||||
class BigEndian | class BigEndian | ||||
{ | { | ||||
public: | 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 }; | enum { isBigEndian = 1 }; | ||||
}; | }; | ||||
class LittleEndian | class LittleEndian | ||||
{ | { | ||||
public: | 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 }; | enum { isBigEndian = 0 }; | ||||
}; | }; | ||||
@@ -100,23 +100,23 @@ public: | |||||
class Int8 | class Int8 | ||||
{ | { | ||||
public: | 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; | int8* data; | ||||
enum { bytesPerSample = 1, maxValue = 0x7f, resolution = (1 << 24), isFloat = 0 }; | enum { bytesPerSample = 1, maxValue = 0x7f, resolution = (1 << 24), isFloat = 0 }; | ||||
@@ -125,23 +125,23 @@ public: | |||||
class UInt8 | class UInt8 | ||||
{ | { | ||||
public: | 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; | uint8* data; | ||||
enum { bytesPerSample = 1, maxValue = 0x7f, resolution = (1 << 24), isFloat = 0 }; | enum { bytesPerSample = 1, maxValue = 0x7f, resolution = (1 << 24), isFloat = 0 }; | ||||
@@ -150,23 +150,23 @@ public: | |||||
class Int16 | class Int16 | ||||
{ | { | ||||
public: | 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; | uint16* data; | ||||
enum { bytesPerSample = 2, maxValue = 0x7fff, resolution = (1 << 16), isFloat = 0 }; | enum { bytesPerSample = 2, maxValue = 0x7fff, resolution = (1 << 16), isFloat = 0 }; | ||||
@@ -175,23 +175,23 @@ public: | |||||
class Int24 | class Int24 | ||||
{ | { | ||||
public: | 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; | char* data; | ||||
enum { bytesPerSample = 3, maxValue = 0x7fffff, resolution = (1 << 8), isFloat = 0 }; | enum { bytesPerSample = 3, maxValue = 0x7fffff, resolution = (1 << 8), isFloat = 0 }; | ||||
@@ -200,23 +200,23 @@ public: | |||||
class Int32 | class Int32 | ||||
{ | { | ||||
public: | 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; | uint32* data; | ||||
enum { bytesPerSample = 4, maxValue = 0x7fffffff, resolution = 1, isFloat = 0 }; | enum { bytesPerSample = 4, maxValue = 0x7fffffff, resolution = 1, isFloat = 0 }; | ||||
@@ -225,30 +225,30 @@ public: | |||||
class Float32 | class Float32 | ||||
{ | { | ||||
public: | 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 | #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 | #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 | #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; | float* data; | ||||
enum { bytesPerSample = 4, maxValue = 0x7fffffff, resolution = (1 << 8), isFloat = 1 }; | enum { bytesPerSample = 4, maxValue = 0x7fffffff, resolution = (1 << 8), isFloat = 1 }; | ||||
@@ -258,14 +258,14 @@ public: | |||||
class NonInterleaved | class NonInterleaved | ||||
{ | { | ||||
public: | 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 }; | enum { isInterleavedType = 0, numInterleavedChannels = 1 }; | ||||
}; | }; | ||||
@@ -273,14 +273,14 @@ public: | |||||
class Interleaved | class Interleaved | ||||
{ | { | ||||
public: | 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; | int numInterleavedChannels; | ||||
enum { isInterleavedType = 1 }; | enum { isInterleavedType = 1 }; | ||||
}; | }; | ||||
@@ -290,7 +290,7 @@ public: | |||||
{ | { | ||||
public: | public: | ||||
typedef void VoidType; | typedef void VoidType; | ||||
static inline void* toVoidPtr (VoidType* v) throw() { return v; } | |||||
static inline void* toVoidPtr (VoidType* v) noexcept { return v; } | |||||
enum { isConst = 0 }; | enum { isConst = 0 }; | ||||
}; | }; | ||||
@@ -298,7 +298,7 @@ public: | |||||
{ | { | ||||
public: | public: | ||||
typedef const void VoidType; | 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 }; | enum { isConst = 1 }; | ||||
}; | }; | ||||
#endif | #endif | ||||
@@ -340,7 +340,7 @@ public: | |||||
This constructor is only used if you've specified the AudioData::NonInterleaved option - | 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. | 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)) | : data (Constness::toVoidPtr (sourceData)) | ||||
{ | { | ||||
// If you're using interleaved data, call the other constructor! If you're using non-interleaved data, | // 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. | /** 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. | 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)), | : data (Constness::toVoidPtr (sourceData)), | ||||
interleaving (numInterleavedChannels) | interleaving (numInterleavedChannels) | ||||
{ | { | ||||
} | } | ||||
/** Creates a copy of another pointer. */ | /** Creates a copy of another pointer. */ | ||||
Pointer (const Pointer& other) throw() | |||||
Pointer (const Pointer& other) noexcept | |||||
: data (other.data), | : data (other.data), | ||||
interleaving (other.interleaving) | interleaving (other.interleaving) | ||||
{ | { | ||||
} | } | ||||
Pointer& operator= (const Pointer& other) throw() | |||||
Pointer& operator= (const Pointer& other) noexcept | |||||
{ | { | ||||
data = other.data; | data = other.data; | ||||
interleaving.copyFrom (other.interleaving); | 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 | 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. | 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. | /** 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 | 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. | 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! | static_jassert (Constness::isConst == 0); // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead! | ||||
Endianness::setAsFloat (data, newValue); | 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 | 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. | 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. | /** 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(). | 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! | static_jassert (Constness::isConst == 0); // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead! | ||||
Endianness::setAsInt32 (data, newValue); | Endianness::setAsInt32 (data, newValue); | ||||
} | } | ||||
/** Moves the pointer along to the next sample. */ | /** 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. */ | /** 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. */ | /** 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. | /** Writes a stream of samples into this pointer from another pointer. | ||||
This will copy the specified number of samples, converting between formats appropriately. | 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! | 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. | This will copy the specified number of samples, converting between formats appropriately. | ||||
*/ | */ | ||||
template <class OtherPointerType> | 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! | 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. */ | /** Sets a number of samples to zero. */ | ||||
void clearSamples (int numSamples) const throw() | |||||
void clearSamples (int numSamples) const noexcept | |||||
{ | { | ||||
Pointer dest (*this); | Pointer dest (*this); | ||||
dest.interleaving.clear (dest.data, numSamples); | dest.interleaving.clear (dest.data, numSamples); | ||||
} | } | ||||
/** Returns true if the pointer is using a floating-point format. */ | /** 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. */ | /** 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). */ | /** 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. */ | /** 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. */ | /** 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. | /** 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 | 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, | 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. | 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. */ | /** Returns a pointer to the underlying data. */ | ||||
const void* getRawData() const throw() { return data.data; } | |||||
const void* getRawData() const noexcept { return data.data; } | |||||
private: | private: | ||||
//============================================================================== | //============================================================================== | ||||
@@ -500,7 +500,7 @@ public: | |||||
InterleavingType interleaving; // annoyingly, making the interleaving type a superclass to take | InterleavingType interleaving; // annoyingly, making the interleaving type a superclass to take | ||||
// advantage of EBCO causes an internal compiler error in VC6.. | // 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); // private to force you to use the more efficient pre-increment! | ||||
Pointer operator-- (int); | Pointer operator-- (int); | ||||
@@ -34,7 +34,7 @@ BEGIN_JUCE_NAMESPACE | |||||
//============================================================================== | //============================================================================== | ||||
AudioSampleBuffer::AudioSampleBuffer (const int numChannels_, | AudioSampleBuffer::AudioSampleBuffer (const int numChannels_, | ||||
const int numSamples) throw() | |||||
const int numSamples) noexcept | |||||
: numChannels (numChannels_), | : numChannels (numChannels_), | ||||
size (numSamples) | size (numSamples) | ||||
{ | { | ||||
@@ -44,7 +44,7 @@ AudioSampleBuffer::AudioSampleBuffer (const int numChannels_, | |||||
allocateData(); | allocateData(); | ||||
} | } | ||||
AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) throw() | |||||
AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) noexcept | |||||
: numChannels (other.numChannels), | : numChannels (other.numChannels), | ||||
size (other.size) | size (other.size) | ||||
{ | { | ||||
@@ -74,7 +74,7 @@ void AudioSampleBuffer::allocateData() | |||||
AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo, | AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo, | ||||
const int numChannels_, | const int numChannels_, | ||||
const int numSamples) throw() | |||||
const int numSamples) noexcept | |||||
: numChannels (numChannels_), | : numChannels (numChannels_), | ||||
size (numSamples), | size (numSamples), | ||||
allocatedBytes (0) | allocatedBytes (0) | ||||
@@ -86,7 +86,7 @@ AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo, | |||||
AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo, | AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo, | ||||
const int numChannels_, | const int numChannels_, | ||||
const int startSample, | const int startSample, | ||||
const int numSamples) throw() | |||||
const int numSamples) noexcept | |||||
: numChannels (numChannels_), | : numChannels (numChannels_), | ||||
size (numSamples), | size (numSamples), | ||||
allocatedBytes (0) | allocatedBytes (0) | ||||
@@ -97,7 +97,7 @@ AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo, | |||||
void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo, | void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo, | ||||
const int newNumChannels, | const int newNumChannels, | ||||
const int newNumSamples) throw() | |||||
const int newNumSamples) noexcept | |||||
{ | { | ||||
jassert (newNumChannels > 0); | jassert (newNumChannels > 0); | ||||
@@ -126,7 +126,7 @@ void AudioSampleBuffer::allocateChannels (float** const dataToReferTo, int offse | |||||
for (int i = 0; i < numChannels; ++i) | for (int i = 0; i < numChannels; ++i) | ||||
{ | { | ||||
// you have to pass in the same number of valid pointers as numChannels | // 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; | channels[i] = dataToReferTo[i] + offset; | ||||
} | } | ||||
@@ -134,7 +134,7 @@ void AudioSampleBuffer::allocateChannels (float** const dataToReferTo, int offse | |||||
channels [numChannels] = 0; | channels [numChannels] = 0; | ||||
} | } | ||||
AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& other) throw() | |||||
AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& other) noexcept | |||||
{ | { | ||||
if (this != &other) | if (this != &other) | ||||
{ | { | ||||
@@ -149,7 +149,7 @@ AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& other) | |||||
return *this; | return *this; | ||||
} | } | ||||
AudioSampleBuffer::~AudioSampleBuffer() throw() | |||||
AudioSampleBuffer::~AudioSampleBuffer() noexcept | |||||
{ | { | ||||
} | } | ||||
@@ -157,7 +157,7 @@ void AudioSampleBuffer::setSize (const int newNumChannels, | |||||
const int newNumSamples, | const int newNumSamples, | ||||
const bool keepExistingContent, | const bool keepExistingContent, | ||||
const bool clearExtraSpace, | const bool clearExtraSpace, | ||||
const bool avoidReallocating) throw() | |||||
const bool avoidReallocating) noexcept | |||||
{ | { | ||||
jassert (newNumChannels > 0); | 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) | for (int i = 0; i < numChannels; ++i) | ||||
zeromem (channels[i], size * sizeof (float)); | zeromem (channels[i], size * sizeof (float)); | ||||
} | } | ||||
void AudioSampleBuffer::clear (const int startSample, | void AudioSampleBuffer::clear (const int startSample, | ||||
const int numSamples) throw() | |||||
const int numSamples) noexcept | |||||
{ | { | ||||
jassert (startSample >= 0 && startSample + numSamples <= size); | jassert (startSample >= 0 && startSample + numSamples <= size); | ||||
@@ -232,7 +232,7 @@ void AudioSampleBuffer::clear (const int startSample, | |||||
void AudioSampleBuffer::clear (const int channel, | void AudioSampleBuffer::clear (const int channel, | ||||
const int startSample, | const int startSample, | ||||
const int numSamples) throw() | |||||
const int numSamples) noexcept | |||||
{ | { | ||||
jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
jassert (startSample >= 0 && startSample + numSamples <= size); | jassert (startSample >= 0 && startSample + numSamples <= size); | ||||
@@ -243,7 +243,7 @@ void AudioSampleBuffer::clear (const int channel, | |||||
void AudioSampleBuffer::applyGain (const int channel, | void AudioSampleBuffer::applyGain (const int channel, | ||||
const int startSample, | const int startSample, | ||||
int numSamples, | int numSamples, | ||||
const float gain) throw() | |||||
const float gain) noexcept | |||||
{ | { | ||||
jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
jassert (startSample >= 0 && startSample + numSamples <= size); | jassert (startSample >= 0 && startSample + numSamples <= size); | ||||
@@ -268,7 +268,7 @@ void AudioSampleBuffer::applyGainRamp (const int channel, | |||||
const int startSample, | const int startSample, | ||||
int numSamples, | int numSamples, | ||||
float startGain, | float startGain, | ||||
float endGain) throw() | |||||
float endGain) noexcept | |||||
{ | { | ||||
if (startGain == endGain) | if (startGain == endGain) | ||||
{ | { | ||||
@@ -292,7 +292,7 @@ void AudioSampleBuffer::applyGainRamp (const int channel, | |||||
void AudioSampleBuffer::applyGain (const int startSample, | void AudioSampleBuffer::applyGain (const int startSample, | ||||
const int numSamples, | const int numSamples, | ||||
const float gain) throw() | |||||
const float gain) noexcept | |||||
{ | { | ||||
for (int i = 0; i < numChannels; ++i) | for (int i = 0; i < numChannels; ++i) | ||||
applyGain (i, startSample, numSamples, gain); | applyGain (i, startSample, numSamples, gain); | ||||
@@ -304,7 +304,7 @@ void AudioSampleBuffer::addFrom (const int destChannel, | |||||
const int sourceChannel, | const int sourceChannel, | ||||
const int sourceStartSample, | const int sourceStartSample, | ||||
int numSamples, | int numSamples, | ||||
const float gain) throw() | |||||
const float gain) noexcept | |||||
{ | { | ||||
jassert (&source != this || sourceChannel != destChannel); | jassert (&source != this || sourceChannel != destChannel); | ||||
jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
@@ -334,11 +334,11 @@ void AudioSampleBuffer::addFrom (const int destChannel, | |||||
const int destStartSample, | const int destStartSample, | ||||
const float* source, | const float* source, | ||||
int numSamples, | int numSamples, | ||||
const float gain) throw() | |||||
const float gain) noexcept | |||||
{ | { | ||||
jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | ||||
jassert (source != 0); | |||||
jassert (source != nullptr); | |||||
if (gain != 0.0f && numSamples > 0) | if (gain != 0.0f && numSamples > 0) | ||||
{ | { | ||||
@@ -362,11 +362,11 @@ void AudioSampleBuffer::addFromWithRamp (const int destChannel, | |||||
const float* source, | const float* source, | ||||
int numSamples, | int numSamples, | ||||
float startGain, | float startGain, | ||||
const float endGain) throw() | |||||
const float endGain) noexcept | |||||
{ | { | ||||
jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | ||||
jassert (source != 0); | |||||
jassert (source != nullptr); | |||||
if (startGain == endGain) | if (startGain == endGain) | ||||
{ | { | ||||
@@ -397,7 +397,7 @@ void AudioSampleBuffer::copyFrom (const int destChannel, | |||||
const AudioSampleBuffer& source, | const AudioSampleBuffer& source, | ||||
const int sourceChannel, | const int sourceChannel, | ||||
const int sourceStartSample, | const int sourceStartSample, | ||||
int numSamples) throw() | |||||
int numSamples) noexcept | |||||
{ | { | ||||
jassert (&source != this || sourceChannel != destChannel); | jassert (&source != this || sourceChannel != destChannel); | ||||
jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
@@ -416,11 +416,11 @@ void AudioSampleBuffer::copyFrom (const int destChannel, | |||||
void AudioSampleBuffer::copyFrom (const int destChannel, | void AudioSampleBuffer::copyFrom (const int destChannel, | ||||
const int destStartSample, | const int destStartSample, | ||||
const float* source, | const float* source, | ||||
int numSamples) throw() | |||||
int numSamples) noexcept | |||||
{ | { | ||||
jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | ||||
jassert (source != 0); | |||||
jassert (source != nullptr); | |||||
if (numSamples > 0) | if (numSamples > 0) | ||||
{ | { | ||||
@@ -434,11 +434,11 @@ void AudioSampleBuffer::copyFrom (const int destChannel, | |||||
const int destStartSample, | const int destStartSample, | ||||
const float* source, | const float* source, | ||||
int numSamples, | int numSamples, | ||||
const float gain) throw() | |||||
const float gain) noexcept | |||||
{ | { | ||||
jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | ||||
jassert (source != 0); | |||||
jassert (source != nullptr); | |||||
if (numSamples > 0) | if (numSamples > 0) | ||||
{ | { | ||||
@@ -468,11 +468,11 @@ void AudioSampleBuffer::copyFromWithRamp (const int destChannel, | |||||
const float* source, | const float* source, | ||||
int numSamples, | int numSamples, | ||||
float startGain, | float startGain, | ||||
float endGain) throw() | |||||
float endGain) noexcept | |||||
{ | { | ||||
jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | ||||
jassert (source != 0); | |||||
jassert (source != nullptr); | |||||
if (startGain == endGain) | if (startGain == endGain) | ||||
{ | { | ||||
@@ -502,7 +502,7 @@ void AudioSampleBuffer::findMinMax (const int channel, | |||||
const int startSample, | const int startSample, | ||||
int numSamples, | int numSamples, | ||||
float& minVal, | float& minVal, | ||||
float& maxVal) const throw() | |||||
float& maxVal) const noexcept | |||||
{ | { | ||||
jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
jassert (startSample >= 0 && startSample + numSamples <= size); | jassert (startSample >= 0 && startSample + numSamples <= size); | ||||
@@ -512,7 +512,7 @@ void AudioSampleBuffer::findMinMax (const int channel, | |||||
float AudioSampleBuffer::getMagnitude (const int channel, | float AudioSampleBuffer::getMagnitude (const int channel, | ||||
const int startSample, | const int startSample, | ||||
const int numSamples) const throw() | |||||
const int numSamples) const noexcept | |||||
{ | { | ||||
jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
jassert (startSample >= 0 && startSample + numSamples <= size); | jassert (startSample >= 0 && startSample + numSamples <= size); | ||||
@@ -524,7 +524,7 @@ float AudioSampleBuffer::getMagnitude (const int channel, | |||||
} | } | ||||
float AudioSampleBuffer::getMagnitude (const int startSample, | float AudioSampleBuffer::getMagnitude (const int startSample, | ||||
const int numSamples) const throw() | |||||
const int numSamples) const noexcept | |||||
{ | { | ||||
float mag = 0.0f; | float mag = 0.0f; | ||||
@@ -536,7 +536,7 @@ float AudioSampleBuffer::getMagnitude (const int startSample, | |||||
float AudioSampleBuffer::getRMSLevel (const int channel, | float AudioSampleBuffer::getRMSLevel (const int channel, | ||||
const int startSample, | const int startSample, | ||||
const int numSamples) const throw() | |||||
const int numSamples) const noexcept | |||||
{ | { | ||||
jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
jassert (startSample >= 0 && startSample + numSamples <= size); | jassert (startSample >= 0 && startSample + numSamples <= size); | ||||
@@ -563,7 +563,7 @@ void AudioSampleBuffer::readFromAudioReader (AudioFormatReader* reader, | |||||
const bool useLeftChan, | const bool useLeftChan, | ||||
const bool useRightChan) | const bool useRightChan) | ||||
{ | { | ||||
jassert (reader != 0); | |||||
jassert (reader != nullptr); | |||||
jassert (startSample >= 0 && startSample + numSamples <= size); | jassert (startSample >= 0 && startSample + numSamples <= size); | ||||
if (numSamples > 0) | if (numSamples > 0) | ||||
@@ -578,15 +578,15 @@ void AudioSampleBuffer::readFromAudioReader (AudioFormatReader* reader, | |||||
else if (useLeftChan || (reader->numChannels == 1)) | else if (useLeftChan || (reader->numChannels == 1)) | ||||
{ | { | ||||
chans[0] = reinterpret_cast<int*> (getSampleData (0, startSample)); | chans[0] = reinterpret_cast<int*> (getSampleData (0, startSample)); | ||||
chans[1] = 0; | |||||
chans[1] = nullptr; | |||||
} | } | ||||
else if (useRightChan) | else if (useRightChan) | ||||
{ | { | ||||
chans[0] = 0; | |||||
chans[0] = nullptr; | |||||
chans[1] = reinterpret_cast<int*> (getSampleData (0, startSample)); | chans[1] = reinterpret_cast<int*> (getSampleData (0, startSample)); | ||||
} | } | ||||
chans[2] = 0; | |||||
chans[2] = nullptr; | |||||
reader->read (chans, 2, readerStartSample, numSamples, true); | reader->read (chans, 2, readerStartSample, numSamples, true); | ||||
@@ -596,7 +596,7 @@ void AudioSampleBuffer::readFromAudioReader (AudioFormatReader* reader, | |||||
{ | { | ||||
float* const d = reinterpret_cast <float*> (chans[j]); | float* const d = reinterpret_cast <float*> (chans[j]); | ||||
if (d != 0) | |||||
if (d != nullptr) | |||||
{ | { | ||||
const float multiplier = 1.0f / 0x7fffffff; | 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.. | // if this is a stereo buffer and the source was mono, dupe the first channel.. | ||||
memcpy (getSampleData (1, startSample), | memcpy (getSampleData (1, startSample), | ||||
@@ -620,7 +620,7 @@ void AudioSampleBuffer::writeToAudioWriter (AudioFormatWriter* writer, | |||||
const int startSample, | const int startSample, | ||||
const int numSamples) const | const int numSamples) const | ||||
{ | { | ||||
jassert (writer != 0); | |||||
jassert (writer != nullptr); | |||||
writer->writeFromAudioSampleBuffer (*this, startSample, numSamples); | writer->writeFromAudioSampleBuffer (*this, startSample, numSamples); | ||||
} | } | ||||
@@ -49,7 +49,7 @@ public: | |||||
when the buffer is deleted. | when the buffer is deleted. | ||||
*/ | */ | ||||
AudioSampleBuffer (int numChannels, | AudioSampleBuffer (int numChannels, | ||||
int numSamples) throw(); | |||||
int numSamples) noexcept; | |||||
/** Creates a buffer using a pre-allocated block of memory. | /** Creates a buffer using a pre-allocated block of memory. | ||||
@@ -68,7 +68,7 @@ public: | |||||
*/ | */ | ||||
AudioSampleBuffer (float** dataToReferTo, | AudioSampleBuffer (float** dataToReferTo, | ||||
int numChannels, | int numChannels, | ||||
int numSamples) throw(); | |||||
int numSamples) noexcept; | |||||
/** Creates a buffer using a pre-allocated block of memory. | /** Creates a buffer using a pre-allocated block of memory. | ||||
@@ -89,7 +89,7 @@ public: | |||||
AudioSampleBuffer (float** dataToReferTo, | AudioSampleBuffer (float** dataToReferTo, | ||||
int numChannels, | int numChannels, | ||||
int startSample, | int startSample, | ||||
int numSamples) throw(); | |||||
int numSamples) noexcept; | |||||
/** Copies another buffer. | /** Copies another buffer. | ||||
@@ -97,39 +97,39 @@ public: | |||||
using an external data buffer, in which case boths buffers will just point to the same | using an external data buffer, in which case boths buffers will just point to the same | ||||
shared block of data. | shared block of data. | ||||
*/ | */ | ||||
AudioSampleBuffer (const AudioSampleBuffer& other) throw(); | |||||
AudioSampleBuffer (const AudioSampleBuffer& other) noexcept; | |||||
/** Copies another buffer onto this one. | /** Copies another buffer onto this one. | ||||
This buffer's size will be changed to that of the other buffer. | 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. | /** Destructor. | ||||
This will free any memory allocated by the buffer. | 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. | /** Returns the number of channels of audio data that this buffer contains. | ||||
@see getSampleData | @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. | /** Returns the number of samples allocated in each of the buffer's channels. | ||||
@see getSampleData | @see getSampleData | ||||
*/ | */ | ||||
int getNumSamples() const throw() { return size; } | |||||
int getNumSamples() const noexcept { return size; } | |||||
/** Returns a pointer one of the buffer's channels. | /** Returns a pointer one of the buffer's channels. | ||||
For speed, this doesn't check whether the channel number is out of range, | For speed, this doesn't check whether the channel number is out of range, | ||||
so be careful when using it! | so be careful when using it! | ||||
*/ | */ | ||||
float* getSampleData (const int channelNumber) const throw() | |||||
float* getSampleData (const int channelNumber) const noexcept | |||||
{ | { | ||||
jassert (isPositiveAndBelow (channelNumber, numChannels)); | jassert (isPositiveAndBelow (channelNumber, numChannels)); | ||||
return channels [channelNumber]; | return channels [channelNumber]; | ||||
@@ -141,7 +141,7 @@ public: | |||||
are out-of-range, so be careful when using it! | are out-of-range, so be careful when using it! | ||||
*/ | */ | ||||
float* getSampleData (const int channelNumber, | float* getSampleData (const int channelNumber, | ||||
const int sampleOffset) const throw() | |||||
const int sampleOffset) const noexcept | |||||
{ | { | ||||
jassert (isPositiveAndBelow (channelNumber, numChannels)); | jassert (isPositiveAndBelow (channelNumber, numChannels)); | ||||
jassert (isPositiveAndBelow (sampleOffset, size)); | jassert (isPositiveAndBelow (sampleOffset, size)); | ||||
@@ -153,7 +153,7 @@ public: | |||||
Don't modify any of the pointers that are returned, and bear in mind that | Don't modify any of the pointers that are returned, and bear in mind that | ||||
these will become invalid if the buffer is resized. | 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. | /** Changes the buffer's size or number of channels. | ||||
@@ -177,7 +177,7 @@ public: | |||||
int newNumSamples, | int newNumSamples, | ||||
bool keepExistingContent = false, | bool keepExistingContent = false, | ||||
bool clearExtraSpace = 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. | /** Makes this buffer point to a pre-allocated set of channel data arrays. | ||||
@@ -200,11 +200,11 @@ public: | |||||
*/ | */ | ||||
void setDataToReferTo (float** dataToReferTo, | void setDataToReferTo (float** dataToReferTo, | ||||
int numChannels, | int numChannels, | ||||
int numSamples) throw(); | |||||
int numSamples) noexcept; | |||||
//============================================================================== | //============================================================================== | ||||
/** Clears all the samples in all channels. */ | /** Clears all the samples in all channels. */ | ||||
void clear() throw(); | |||||
void clear() noexcept; | |||||
/** Clears a specified region of all the channels. | /** Clears a specified region of all the channels. | ||||
@@ -212,7 +212,7 @@ public: | |||||
are in-range, so be careful! | are in-range, so be careful! | ||||
*/ | */ | ||||
void clear (int startSample, | void clear (int startSample, | ||||
int numSamples) throw(); | |||||
int numSamples) noexcept; | |||||
/** Clears a specified region of just one channel. | /** Clears a specified region of just one channel. | ||||
@@ -221,7 +221,7 @@ public: | |||||
*/ | */ | ||||
void clear (int channel, | void clear (int channel, | ||||
int startSample, | int startSample, | ||||
int numSamples) throw(); | |||||
int numSamples) noexcept; | |||||
/** Applies a gain multiple to a region of one channel. | /** Applies a gain multiple to a region of one channel. | ||||
@@ -231,7 +231,7 @@ public: | |||||
void applyGain (int channel, | void applyGain (int channel, | ||||
int startSample, | int startSample, | ||||
int numSamples, | int numSamples, | ||||
float gain) throw(); | |||||
float gain) noexcept; | |||||
/** Applies a gain multiple to a region of all the channels. | /** Applies a gain multiple to a region of all the channels. | ||||
@@ -240,7 +240,7 @@ public: | |||||
*/ | */ | ||||
void applyGain (int startSample, | void applyGain (int startSample, | ||||
int numSamples, | int numSamples, | ||||
float gain) throw(); | |||||
float gain) noexcept; | |||||
/** Applies a range of gains to a region of a channel. | /** Applies a range of gains to a region of a channel. | ||||
@@ -255,7 +255,7 @@ public: | |||||
int startSample, | int startSample, | ||||
int numSamples, | int numSamples, | ||||
float startGain, | float startGain, | ||||
float endGain) throw(); | |||||
float endGain) noexcept; | |||||
/** Adds samples from another buffer to this one. | /** Adds samples from another buffer to this one. | ||||
@@ -276,7 +276,7 @@ public: | |||||
int sourceChannel, | int sourceChannel, | ||||
int sourceStartSample, | int sourceStartSample, | ||||
int numSamples, | int numSamples, | ||||
float gainToApplyToSource = 1.0f) throw(); | |||||
float gainToApplyToSource = 1.0f) noexcept; | |||||
/** Adds samples from an array of floats to one of the channels. | /** Adds samples from an array of floats to one of the channels. | ||||
@@ -293,7 +293,7 @@ public: | |||||
int destStartSample, | int destStartSample, | ||||
const float* source, | const float* source, | ||||
int numSamples, | 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. | /** Adds samples from an array of floats, applying a gain ramp to them. | ||||
@@ -311,7 +311,7 @@ public: | |||||
const float* source, | const float* source, | ||||
int numSamples, | int numSamples, | ||||
float startGain, | float startGain, | ||||
float endGain) throw(); | |||||
float endGain) noexcept; | |||||
/** Copies samples from another buffer to this one. | /** Copies samples from another buffer to this one. | ||||
@@ -329,7 +329,7 @@ public: | |||||
const AudioSampleBuffer& source, | const AudioSampleBuffer& source, | ||||
int sourceChannel, | int sourceChannel, | ||||
int sourceStartSample, | int sourceStartSample, | ||||
int numSamples) throw(); | |||||
int numSamples) noexcept; | |||||
/** Copies samples from an array of floats into one of the channels. | /** Copies samples from an array of floats into one of the channels. | ||||
@@ -343,7 +343,7 @@ public: | |||||
void copyFrom (int destChannel, | void copyFrom (int destChannel, | ||||
int destStartSample, | int destStartSample, | ||||
const float* source, | 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. | /** Copies samples from an array of floats into one of the channels, applying a gain to it. | ||||
@@ -359,7 +359,7 @@ public: | |||||
int destStartSample, | int destStartSample, | ||||
const float* source, | const float* source, | ||||
int numSamples, | int numSamples, | ||||
float gain) throw(); | |||||
float gain) noexcept; | |||||
/** Copies samples from an array of floats into one of the channels, applying a gain ramp. | /** Copies samples from an array of floats into one of the channels, applying a gain ramp. | ||||
@@ -379,7 +379,7 @@ public: | |||||
const float* source, | const float* source, | ||||
int numSamples, | int numSamples, | ||||
float startGain, | float startGain, | ||||
float endGain) throw(); | |||||
float endGain) noexcept; | |||||
/** Finds the highest and lowest sample values in a given range. | /** Finds the highest and lowest sample values in a given range. | ||||
@@ -394,24 +394,24 @@ public: | |||||
int startSample, | int startSample, | ||||
int numSamples, | int numSamples, | ||||
float& minVal, | float& minVal, | ||||
float& maxVal) const throw(); | |||||
float& maxVal) const noexcept; | |||||
/** Finds the highest absolute sample value within a region of a channel. | /** Finds the highest absolute sample value within a region of a channel. | ||||
*/ | */ | ||||
float getMagnitude (int channel, | float getMagnitude (int channel, | ||||
int startSample, | int startSample, | ||||
int numSamples) const throw(); | |||||
int numSamples) const noexcept; | |||||
/** Finds the highest absolute sample value within a region on all channels. | /** Finds the highest absolute sample value within a region on all channels. | ||||
*/ | */ | ||||
float getMagnitude (int startSample, | float getMagnitude (int startSample, | ||||
int numSamples) const throw(); | |||||
int numSamples) const noexcept; | |||||
/** Returns the root mean squared level for a region of a channel. | /** Returns the root mean squared level for a region of a channel. | ||||
*/ | */ | ||||
float getRMSLevel (int channel, | float getRMSLevel (int channel, | ||||
int startSample, | int startSample, | ||||
int numSamples) const throw(); | |||||
int numSamples) const noexcept; | |||||
//============================================================================== | //============================================================================== | ||||
/** Fills a section of the buffer using an AudioReader as its source. | /** Fills a section of the buffer using an AudioReader as its source. | ||||
@@ -50,7 +50,7 @@ IIRFilter::~IIRFilter() | |||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
void IIRFilter::reset() throw() | |||||
void IIRFilter::reset() noexcept | |||||
{ | { | ||||
const ScopedLock sl (processLock); | const ScopedLock sl (processLock); | ||||
@@ -60,7 +60,7 @@ void IIRFilter::reset() throw() | |||||
y2 = 0; | y2 = 0; | ||||
} | } | ||||
float IIRFilter::processSingleSampleRaw (const float in) throw() | |||||
float IIRFilter::processSingleSampleRaw (const float in) noexcept | |||||
{ | { | ||||
float out = coefficients[0] * in | float out = coefficients[0] * in | ||||
+ coefficients[1] * x1 | + coefficients[1] * x1 | ||||
@@ -68,10 +68,10 @@ float IIRFilter::processSingleSampleRaw (const float in) throw() | |||||
- coefficients[4] * y1 | - coefficients[4] * y1 | ||||
- coefficients[5] * y2; | - coefficients[5] * y2; | ||||
#if JUCE_INTEL | |||||
#if JUCE_INTEL | |||||
if (! (out < -1.0e-8 || out > 1.0e-8)) | if (! (out < -1.0e-8 || out > 1.0e-8)) | ||||
out = 0; | out = 0; | ||||
#endif | |||||
#endif | |||||
x2 = x1; | x2 = x1; | ||||
x1 = in; | x1 = in; | ||||
@@ -82,7 +82,7 @@ float IIRFilter::processSingleSampleRaw (const float in) throw() | |||||
} | } | ||||
void IIRFilter::processSamples (float* const samples, | void IIRFilter::processSamples (float* const samples, | ||||
const int numSamples) throw() | |||||
const int numSamples) noexcept | |||||
{ | { | ||||
const ScopedLock sl (processLock); | const ScopedLock sl (processLock); | ||||
@@ -98,10 +98,10 @@ void IIRFilter::processSamples (float* const samples, | |||||
- coefficients[4] * y1 | - coefficients[4] * y1 | ||||
- coefficients[5] * y2; | - coefficients[5] * y2; | ||||
#if JUCE_INTEL | |||||
#if JUCE_INTEL | |||||
if (! (out < -1.0e-8 || out > 1.0e-8)) | if (! (out < -1.0e-8 || out > 1.0e-8)) | ||||
out = 0; | out = 0; | ||||
#endif | |||||
#endif | |||||
x2 = x1; | x2 = x1; | ||||
x1 = in; | x1 = in; | ||||
@@ -115,7 +115,7 @@ void IIRFilter::processSamples (float* const samples, | |||||
//============================================================================== | //============================================================================== | ||||
void IIRFilter::makeLowPass (const double sampleRate, | void IIRFilter::makeLowPass (const double sampleRate, | ||||
const double frequency) throw() | |||||
const double frequency) noexcept | |||||
{ | { | ||||
jassert (sampleRate > 0); | jassert (sampleRate > 0); | ||||
@@ -132,7 +132,7 @@ void IIRFilter::makeLowPass (const double sampleRate, | |||||
} | } | ||||
void IIRFilter::makeHighPass (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 n = tan (double_Pi * frequency / sampleRate); | ||||
const double nSquared = n * n; | const double nSquared = n * n; | ||||
@@ -149,7 +149,7 @@ void IIRFilter::makeHighPass (const double sampleRate, | |||||
void IIRFilter::makeLowShelf (const double sampleRate, | void IIRFilter::makeLowShelf (const double sampleRate, | ||||
const double cutOffFrequency, | const double cutOffFrequency, | ||||
const double Q, | const double Q, | ||||
const float gainFactor) throw() | |||||
const float gainFactor) noexcept | |||||
{ | { | ||||
jassert (sampleRate > 0); | jassert (sampleRate > 0); | ||||
jassert (Q > 0); | jassert (Q > 0); | ||||
@@ -173,7 +173,7 @@ void IIRFilter::makeLowShelf (const double sampleRate, | |||||
void IIRFilter::makeHighShelf (const double sampleRate, | void IIRFilter::makeHighShelf (const double sampleRate, | ||||
const double cutOffFrequency, | const double cutOffFrequency, | ||||
const double Q, | const double Q, | ||||
const float gainFactor) throw() | |||||
const float gainFactor) noexcept | |||||
{ | { | ||||
jassert (sampleRate > 0); | jassert (sampleRate > 0); | ||||
jassert (Q > 0); | jassert (Q > 0); | ||||
@@ -197,7 +197,7 @@ void IIRFilter::makeHighShelf (const double sampleRate, | |||||
void IIRFilter::makeBandPass (const double sampleRate, | void IIRFilter::makeBandPass (const double sampleRate, | ||||
const double centreFrequency, | const double centreFrequency, | ||||
const double Q, | const double Q, | ||||
const float gainFactor) throw() | |||||
const float gainFactor) noexcept | |||||
{ | { | ||||
jassert (sampleRate > 0); | jassert (sampleRate > 0); | ||||
jassert (Q > 0); | jassert (Q > 0); | ||||
@@ -217,14 +217,14 @@ void IIRFilter::makeBandPass (const double sampleRate, | |||||
1.0 - alphaOverA); | 1.0 - alphaOverA); | ||||
} | } | ||||
void IIRFilter::makeInactive() throw() | |||||
void IIRFilter::makeInactive() noexcept | |||||
{ | { | ||||
const ScopedLock sl (processLock); | const ScopedLock sl (processLock); | ||||
active = false; | active = false; | ||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
void IIRFilter::copyCoefficientsFrom (const IIRFilter& other) throw() | |||||
void IIRFilter::copyCoefficientsFrom (const IIRFilter& other) noexcept | |||||
{ | { | ||||
const ScopedLock sl (processLock); | const ScopedLock sl (processLock); | ||||
@@ -234,7 +234,7 @@ void IIRFilter::copyCoefficientsFrom (const IIRFilter& other) throw() | |||||
//============================================================================== | //============================================================================== | ||||
void IIRFilter::setCoefficients (double c1, double c2, double c3, | 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; | const double a = 1.0 / c4; | ||||
@@ -61,30 +61,30 @@ public: | |||||
its coefficients aren't changed. To put a filter into an inactive state, use | its coefficients aren't changed. To put a filter into an inactive state, use | ||||
the makeInactive() method. | the makeInactive() method. | ||||
*/ | */ | ||||
void reset() throw(); | |||||
void reset() noexcept; | |||||
/** Performs the filter operation on the given set of samples. | /** Performs the filter operation on the given set of samples. | ||||
*/ | */ | ||||
void processSamples (float* samples, | void processSamples (float* samples, | ||||
int numSamples) throw(); | |||||
int numSamples) noexcept; | |||||
/** Processes a single sample, without any locking or checking. | /** Processes a single sample, without any locking or checking. | ||||
Use this if you need fast processing of a single value, but be aware that | 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. | 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. | /** Sets the filter up to act as a low-pass filter. | ||||
*/ | */ | ||||
void makeLowPass (double sampleRate, | void makeLowPass (double sampleRate, | ||||
double frequency) throw(); | |||||
double frequency) noexcept; | |||||
/** Sets the filter up to act as a high-pass filter. | /** Sets the filter up to act as a high-pass filter. | ||||
*/ | */ | ||||
void makeHighPass (double sampleRate, | 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. | /** 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, | void makeLowShelf (double sampleRate, | ||||
double cutOffFrequency, | double cutOffFrequency, | ||||
double Q, | 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. | /** 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, | void makeHighShelf (double sampleRate, | ||||
double cutOffFrequency, | double cutOffFrequency, | ||||
double Q, | double Q, | ||||
float gainFactor) throw(); | |||||
float gainFactor) noexcept; | |||||
/** Sets the filter up to act as a band pass filter centred around a | /** Sets the filter up to act as a band pass filter centred around a | ||||
frequency, with a variable Q and gain. | frequency, with a variable Q and gain. | ||||
@@ -119,16 +119,16 @@ public: | |||||
void makeBandPass (double sampleRate, | void makeBandPass (double sampleRate, | ||||
double centreFrequency, | double centreFrequency, | ||||
double Q, | double Q, | ||||
float gainFactor) throw(); | |||||
float gainFactor) noexcept; | |||||
/** Clears the filter's coefficients so that it becomes inactive. | /** 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. | /** Makes this filter duplicate the set-up of another one. | ||||
*/ | */ | ||||
void copyCoefficientsFrom (const IIRFilter& other) throw(); | |||||
void copyCoefficientsFrom (const IIRFilter& other) noexcept; | |||||
protected: | protected: | ||||
@@ -136,7 +136,7 @@ protected: | |||||
CriticalSection processLock; | CriticalSection processLock; | ||||
void setCoefficients (double c1, double c2, double c3, | void setCoefficients (double c1, double c2, double c3, | ||||
double c4, double c5, double c6) throw(); | |||||
double c4, double c5, double c6) noexcept; | |||||
bool active; | bool active; | ||||
float coefficients[6]; | float coefficients[6]; | ||||
@@ -31,24 +31,24 @@ BEGIN_JUCE_NAMESPACE | |||||
//============================================================================== | //============================================================================== | ||||
MidiBuffer::MidiBuffer() throw() | |||||
MidiBuffer::MidiBuffer() noexcept | |||||
: bytesUsed (0) | : bytesUsed (0) | ||||
{ | { | ||||
} | } | ||||
MidiBuffer::MidiBuffer (const MidiMessage& message) throw() | |||||
MidiBuffer::MidiBuffer (const MidiMessage& message) noexcept | |||||
: bytesUsed (0) | : bytesUsed (0) | ||||
{ | { | ||||
addEvent (message, 0); | addEvent (message, 0); | ||||
} | } | ||||
MidiBuffer::MidiBuffer (const MidiBuffer& other) throw() | |||||
MidiBuffer::MidiBuffer (const MidiBuffer& other) noexcept | |||||
: data (other.data), | : data (other.data), | ||||
bytesUsed (other.bytesUsed) | bytesUsed (other.bytesUsed) | ||||
{ | { | ||||
} | } | ||||
MidiBuffer& MidiBuffer::operator= (const MidiBuffer& other) throw() | |||||
MidiBuffer& MidiBuffer::operator= (const MidiBuffer& other) noexcept | |||||
{ | { | ||||
bytesUsed = other.bytesUsed; | bytesUsed = other.bytesUsed; | ||||
data = other.data; | data = other.data; | ||||
@@ -56,7 +56,7 @@ MidiBuffer& MidiBuffer::operator= (const MidiBuffer& other) throw() | |||||
return *this; | return *this; | ||||
} | } | ||||
void MidiBuffer::swapWith (MidiBuffer& other) throw() | |||||
void MidiBuffer::swapWith (MidiBuffer& other) noexcept | |||||
{ | { | ||||
data.swapWith (other.data); | data.swapWith (other.data); | ||||
std::swap (bytesUsed, other.bytesUsed); | 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()); | 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); | 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)); | 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); | return getEventDataSize (d) + sizeof (int) + sizeof (uint16); | ||||
} | } | ||||
void MidiBuffer::clear() throw() | |||||
void MidiBuffer::clear() noexcept | |||||
{ | { | ||||
bytesUsed = 0; | bytesUsed = 0; | ||||
} | } | ||||
@@ -114,7 +114,7 @@ void MidiBuffer::addEvent (const MidiMessage& m, const int sampleNumber) | |||||
namespace MidiBufferHelpers | 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; | unsigned int byte = (unsigned int) *data; | ||||
int size = 0; | int size = 0; | ||||
@@ -193,12 +193,12 @@ void MidiBuffer::ensureSize (size_t minimumNumBytes) | |||||
data.ensureSize (minimumNumBytes); | data.ensureSize (minimumNumBytes); | ||||
} | } | ||||
bool MidiBuffer::isEmpty() const throw() | |||||
bool MidiBuffer::isEmpty() const noexcept | |||||
{ | { | ||||
return bytesUsed == 0; | return bytesUsed == 0; | ||||
} | } | ||||
int MidiBuffer::getNumEvents() const throw() | |||||
int MidiBuffer::getNumEvents() const noexcept | |||||
{ | { | ||||
int n = 0; | int n = 0; | ||||
const uint8* d = getData(); | const uint8* d = getData(); | ||||
@@ -213,12 +213,12 @@ int MidiBuffer::getNumEvents() const throw() | |||||
return n; | return n; | ||||
} | } | ||||
int MidiBuffer::getFirstEventTime() const throw() | |||||
int MidiBuffer::getFirstEventTime() const noexcept | |||||
{ | { | ||||
return bytesUsed > 0 ? getEventTime (data.getData()) : 0; | return bytesUsed > 0 ? getEventTime (data.getData()) : 0; | ||||
} | } | ||||
int MidiBuffer::getLastEventTime() const throw() | |||||
int MidiBuffer::getLastEventTime() const noexcept | |||||
{ | { | ||||
if (bytesUsed == 0) | if (bytesUsed == 0) | ||||
return 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; | 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_), | : buffer (buffer_), | ||||
data (buffer_.getData()) | 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(); | data = buffer.getData(); | ||||
const uint8* dataEnd = data + buffer.bytesUsed; | const uint8* dataEnd = data + buffer.bytesUsed; | ||||
@@ -268,7 +268,7 @@ void MidiBuffer::Iterator::setNextSamplePosition (const int samplePosition) thro | |||||
data += getEventTotalSize (data); | 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) | if (data >= buffer.getData() + buffer.bytesUsed) | ||||
return false; | return false; | ||||
@@ -282,7 +282,7 @@ bool MidiBuffer::Iterator::getNextEvent (const uint8* &midiData, int& numBytes, | |||||
return true; | 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) | if (data >= buffer.getData() + buffer.bytesUsed) | ||||
return false; | return false; | ||||
@@ -44,23 +44,23 @@ class JUCE_API MidiBuffer | |||||
public: | public: | ||||
//============================================================================== | //============================================================================== | ||||
/** Creates an empty MidiBuffer. */ | /** Creates an empty MidiBuffer. */ | ||||
MidiBuffer() throw(); | |||||
MidiBuffer() noexcept; | |||||
/** Creates a MidiBuffer containing a single midi message. */ | /** 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. */ | /** Creates a copy of another MidiBuffer. */ | ||||
MidiBuffer (const MidiBuffer& other) throw(); | |||||
MidiBuffer (const MidiBuffer& other) noexcept; | |||||
/** Makes a copy of another MidiBuffer. */ | /** Makes a copy of another MidiBuffer. */ | ||||
MidiBuffer& operator= (const MidiBuffer& other) throw(); | |||||
MidiBuffer& operator= (const MidiBuffer& other) noexcept; | |||||
/** Destructor */ | /** Destructor */ | ||||
~MidiBuffer(); | ~MidiBuffer(); | ||||
//============================================================================== | //============================================================================== | ||||
/** Removes all events from the buffer. */ | /** Removes all events from the buffer. */ | ||||
void clear() throw(); | |||||
void clear() noexcept; | |||||
/** Removes all events between two times from the buffer. | /** Removes all events between two times from the buffer. | ||||
@@ -73,7 +73,7 @@ public: | |||||
To actually retrieve the events, use a MidiBuffer::Iterator object | 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. | /** 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 | the events, so you might prefer to call isEmpty() if that's all you need | ||||
to know. | to know. | ||||
*/ | */ | ||||
int getNumEvents() const throw(); | |||||
int getNumEvents() const noexcept; | |||||
/** Adds an event to the buffer. | /** Adds an event to the buffer. | ||||
@@ -139,13 +139,13 @@ public: | |||||
If the buffer's empty, this will just return 0. | 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. | /** Returns the sample number of the last event in the buffer. | ||||
If the buffer's empty, this will just return 0. | 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. | /** 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 | This is a quick operation, because no memory allocating or copying is done, it | ||||
just swaps the internal state of the two buffers. | 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. | /** Preallocates some memory for the buffer to use. | ||||
This helps to avoid needing to reallocate space when the buffer has messages | This helps to avoid needing to reallocate space when the buffer has messages | ||||
@@ -175,16 +175,16 @@ public: | |||||
public: | public: | ||||
//============================================================================== | //============================================================================== | ||||
/** Creates an Iterator for this MidiBuffer. */ | /** Creates an Iterator for this MidiBuffer. */ | ||||
Iterator (const MidiBuffer& buffer) throw(); | |||||
Iterator (const MidiBuffer& buffer) noexcept; | |||||
/** Destructor. */ | /** Destructor. */ | ||||
~Iterator() throw(); | |||||
~Iterator() noexcept; | |||||
//============================================================================== | //============================================================================== | ||||
/** Repositions the iterator so that the next event retrieved will be the first | /** 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. | 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. | /** Retrieves a copy of the next event from the buffer. | ||||
@@ -195,7 +195,7 @@ public: | |||||
the end of the buffer | the end of the buffer | ||||
*/ | */ | ||||
bool getNextEvent (MidiMessage& result, | bool getNextEvent (MidiMessage& result, | ||||
int& samplePosition) throw(); | |||||
int& samplePosition) noexcept; | |||||
/** Retrieves the next event from the buffer. | /** Retrieves the next event from the buffer. | ||||
@@ -211,7 +211,7 @@ public: | |||||
*/ | */ | ||||
bool getNextEvent (const uint8* &midiData, | bool getNextEvent (const uint8* &midiData, | ||||
int& numBytesOfMidiData, | int& numBytesOfMidiData, | ||||
int& samplePosition) throw(); | |||||
int& samplePosition) noexcept; | |||||
private: | private: | ||||
//============================================================================== | //============================================================================== | ||||
@@ -227,11 +227,11 @@ private: | |||||
MemoryBlock data; | MemoryBlock data; | ||||
int bytesUsed; | 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); | JUCE_LEAK_DETECTOR (MidiBuffer); | ||||
}; | }; | ||||
@@ -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); | unsigned int ch = (int) ByteOrder::bigEndianInt (data); | ||||
data += 4; | data += 4; | ||||
@@ -164,7 +164,7 @@ namespace MidiFileHelpers | |||||
struct Sorter | struct Sorter | ||||
{ | { | ||||
static int compareElements (const MidiMessageSequence::MidiEventHolder* const first, | 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()); | 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(); | return tracks.size(); | ||||
} | } | ||||
const MidiMessageSequence* MidiFile::getTrack (const int index) const throw() | |||||
const MidiMessageSequence* MidiFile::getTrack (const int index) const noexcept | |||||
{ | { | ||||
return tracks [index]; | 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; | return timeFormat; | ||||
} | } | ||||
void MidiFile::setTicksPerQuarterNote (const int ticks) throw() | |||||
void MidiFile::setTicksPerQuarterNote (const int ticks) noexcept | |||||
{ | { | ||||
timeFormat = (short) ticks; | timeFormat = (short) ticks; | ||||
} | } | ||||
void MidiFile::setSmpteTimeFormat (const int framesPerSecond, | void MidiFile::setSmpteTimeFormat (const int framesPerSecond, | ||||
const int subframeResolution) throw() | |||||
const int subframeResolution) noexcept | |||||
{ | { | ||||
timeFormat = (short) (((-framesPerSecond) << 8) | subframeResolution); | timeFormat = (short) (((-framesPerSecond) << 8) | subframeResolution); | ||||
} | } | ||||
@@ -60,14 +60,14 @@ public: | |||||
@see getTrack, addTrack | @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 one of the tracks in the file. | ||||
@returns a pointer to the track, or 0 if the index is out-of-range | @returns a pointer to the track, or 0 if the index is out-of-range | ||||
@see getNumTracks, addTrack | @see getNumTracks, addTrack | ||||
*/ | */ | ||||
const MidiMessageSequence* getTrack (int index) const throw(); | |||||
const MidiMessageSequence* getTrack (int index) const noexcept; | |||||
/** Adds a midi track to the file. | /** 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 | 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(). | 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. | /** 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 | @param ticksPerQuarterNote e.g. 96, 960 | ||||
@see setSmpteTimeFormat | @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. | /** Sets the time format to use when this file is written to a stream. | ||||
@@ -121,7 +121,7 @@ public: | |||||
@see setTicksPerBeat | @see setTicksPerBeat | ||||
*/ | */ | ||||
void setSmpteTimeFormat (int framesPerSecond, | 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. | /** Makes a list of all the tempo-change meta-events from all tracks in the midi file. | ||||
@@ -146,12 +146,12 @@ public: | |||||
/** Returns the name of this device. | /** 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 | /** Allows you to set a custom name for the device, in case you don't like the name | ||||
it was given when created. | 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. | /** Starts the device running. | ||||
@@ -49,7 +49,7 @@ void MidiKeyboardState::reset() | |||||
eventsToAdd.clear(); | 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); | 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; | && (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) | return isPositiveAndBelow (n, (int) 128) | ||||
&& (noteStates[n] & midiChannelMask) != 0; | && (noteStates[n] & midiChannelMask) != 0; | ||||
@@ -41,7 +41,7 @@ class JUCE_API MidiKeyboardStateListener | |||||
{ | { | ||||
public: | public: | ||||
//============================================================================== | //============================================================================== | ||||
MidiKeyboardStateListener() throw() {} | |||||
MidiKeyboardStateListener() noexcept {} | |||||
virtual ~MidiKeyboardStateListener() {} | 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 | 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. | 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. | /** 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. | 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. | /** Turns a specified note on. | ||||
@@ -32,19 +32,19 @@ BEGIN_JUCE_NAMESPACE | |||||
namespace MidiHelpers | 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)); | 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); | 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; | numBytesUsed = 0; | ||||
int v = 0; | int v = 0; | ||||
@@ -64,7 +64,7 @@ int MidiMessage::readVariableLengthVal (const uint8* data, int& numBytesUsed) th | |||||
return v; | 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 | // this method only works for valid starting bytes of a short midi message | ||||
jassert (firstByte >= 0x80 && firstByte != 0xf0 && firstByte != 0xf7); | 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), | : timeStamp (0), | ||||
data (static_cast<uint8*> (preallocatedData.asBytes)), | data (static_cast<uint8*> (preallocatedData.asBytes)), | ||||
size (2) | 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); | 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), | : timeStamp (t), | ||||
data (static_cast<uint8*> (preallocatedData.asBytes)), | data (static_cast<uint8*> (preallocatedData.asBytes)), | ||||
size (1) | size (1) | ||||
@@ -122,7 +122,7 @@ MidiMessage::MidiMessage (const int byte1, const double t) throw() | |||||
jassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 1); | 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), | : timeStamp (t), | ||||
data (static_cast<uint8*> (preallocatedData.asBytes)), | data (static_cast<uint8*> (preallocatedData.asBytes)), | ||||
size (2) | 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); | 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), | : timeStamp (t), | ||||
data (static_cast<uint8*> (preallocatedData.asBytes)), | data (static_cast<uint8*> (preallocatedData.asBytes)), | ||||
size (3) | size (3) | ||||
@@ -297,7 +297,7 @@ MidiMessage::~MidiMessage() | |||||
delete[] data; | delete[] data; | ||||
} | } | ||||
int MidiMessage::getChannel() const throw() | |||||
int MidiMessage::getChannel() const noexcept | |||||
{ | { | ||||
if ((data[0] & 0xf0) != 0xf0) | if ((data[0] & 0xf0) != 0xf0) | ||||
return (data[0] & 0xf) + 1; | return (data[0] & 0xf) + 1; | ||||
@@ -305,7 +305,7 @@ int MidiMessage::getChannel() const throw() | |||||
return 0; | 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 | 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); | && ((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 | 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)); | | (uint8)(channel - 1)); | ||||
} | } | ||||
bool MidiMessage::isNoteOn (const bool returnTrueForVelocity0) const throw() | |||||
bool MidiMessage::isNoteOn (const bool returnTrueForVelocity0) const noexcept | |||||
{ | { | ||||
return ((data[0] & 0xf0) == 0x90) | return ((data[0] & 0xf0) == 0x90) | ||||
&& (returnTrueForVelocity0 || data[2] != 0); | && (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) | return ((data[0] & 0xf0) == 0x80) | ||||
|| (returnTrueForNoteOnVelocity0 && (data[2] == 0) && ((data[0] & 0xf0) == 0x90)); | || (returnTrueForNoteOnVelocity0 && (data[2] == 0) && ((data[0] & 0xf0) == 0x90)); | ||||
} | } | ||||
bool MidiMessage::isNoteOnOrOff() const throw() | |||||
bool MidiMessage::isNoteOnOrOff() const noexcept | |||||
{ | { | ||||
const int d = data[0] & 0xf0; | const int d = data[0] & 0xf0; | ||||
return (d == 0x90) || (d == 0x80); | return (d == 0x90) || (d == 0x80); | ||||
} | } | ||||
int MidiMessage::getNoteNumber() const throw() | |||||
int MidiMessage::getNoteNumber() const noexcept | |||||
{ | { | ||||
return data[1]; | return data[1]; | ||||
} | } | ||||
void MidiMessage::setNoteNumber (const int newNoteNumber) throw() | |||||
void MidiMessage::setNoteNumber (const int newNoteNumber) noexcept | |||||
{ | { | ||||
if (isNoteOnOrOff()) | if (isNoteOnOrOff()) | ||||
data[1] = newNoteNumber & 127; | data[1] = newNoteNumber & 127; | ||||
} | } | ||||
uint8 MidiMessage::getVelocity() const throw() | |||||
uint8 MidiMessage::getVelocity() const noexcept | |||||
{ | { | ||||
if (isNoteOnOrOff()) | if (isNoteOnOrOff()) | ||||
return data[2]; | return data[2]; | ||||
@@ -359,36 +359,36 @@ uint8 MidiMessage::getVelocity() const throw() | |||||
return 0; | return 0; | ||||
} | } | ||||
float MidiMessage::getFloatVelocity() const throw() | |||||
float MidiMessage::getFloatVelocity() const noexcept | |||||
{ | { | ||||
return getVelocity() * (1.0f / 127.0f); | return getVelocity() * (1.0f / 127.0f); | ||||
} | } | ||||
void MidiMessage::setVelocity (const float newVelocity) throw() | |||||
void MidiMessage::setVelocity (const float newVelocity) noexcept | |||||
{ | { | ||||
if (isNoteOnOrOff()) | if (isNoteOnOrOff()) | ||||
data[2] = MidiHelpers::validVelocity (roundToInt (newVelocity * 127.0f)); | data[2] = MidiHelpers::validVelocity (roundToInt (newVelocity * 127.0f)); | ||||
} | } | ||||
void MidiMessage::multiplyVelocity (const float scaleFactor) throw() | |||||
void MidiMessage::multiplyVelocity (const float scaleFactor) noexcept | |||||
{ | { | ||||
if (isNoteOnOrOff()) | if (isNoteOnOrOff()) | ||||
data[2] = MidiHelpers::validVelocity (roundToInt (scaleFactor * data[2])); | data[2] = MidiHelpers::validVelocity (roundToInt (scaleFactor * data[2])); | ||||
} | } | ||||
bool MidiMessage::isAftertouch() const throw() | |||||
bool MidiMessage::isAftertouch() const noexcept | |||||
{ | { | ||||
return (data[0] & 0xf0) == 0xa0; | return (data[0] & 0xf0) == 0xa0; | ||||
} | } | ||||
int MidiMessage::getAfterTouchValue() const throw() | |||||
int MidiMessage::getAfterTouchValue() const noexcept | |||||
{ | { | ||||
return data[2]; | return data[2]; | ||||
} | } | ||||
const MidiMessage MidiMessage::aftertouchChange (const int channel, | const MidiMessage MidiMessage::aftertouchChange (const int channel, | ||||
const int noteNum, | const int noteNum, | ||||
const int aftertouchValue) throw() | |||||
const int aftertouchValue) noexcept | |||||
{ | { | ||||
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | ||||
jassert (isPositiveAndBelow (noteNum, (int) 128)); | jassert (isPositiveAndBelow (noteNum, (int) 128)); | ||||
@@ -399,12 +399,12 @@ const MidiMessage MidiMessage::aftertouchChange (const int channel, | |||||
aftertouchValue & 0x7f); | aftertouchValue & 0x7f); | ||||
} | } | ||||
bool MidiMessage::isChannelPressure() const throw() | |||||
bool MidiMessage::isChannelPressure() const noexcept | |||||
{ | { | ||||
return (data[0] & 0xf0) == 0xd0; | return (data[0] & 0xf0) == 0xd0; | ||||
} | } | ||||
int MidiMessage::getChannelPressureValue() const throw() | |||||
int MidiMessage::getChannelPressureValue() const noexcept | |||||
{ | { | ||||
jassert (isChannelPressure()); | jassert (isChannelPressure()); | ||||
@@ -412,7 +412,7 @@ int MidiMessage::getChannelPressureValue() const throw() | |||||
} | } | ||||
const MidiMessage MidiMessage::channelPressureChange (const int channel, | 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 (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | ||||
jassert (isPositiveAndBelow (pressure, (int) 128)); | jassert (isPositiveAndBelow (pressure, (int) 128)); | ||||
@@ -420,36 +420,36 @@ const MidiMessage MidiMessage::channelPressureChange (const int channel, | |||||
return MidiMessage (MidiHelpers::initialByte (0xd0, channel), pressure & 0x7f); | return MidiMessage (MidiHelpers::initialByte (0xd0, channel), pressure & 0x7f); | ||||
} | } | ||||
bool MidiMessage::isProgramChange() const throw() | |||||
bool MidiMessage::isProgramChange() const noexcept | |||||
{ | { | ||||
return (data[0] & 0xf0) == 0xc0; | return (data[0] & 0xf0) == 0xc0; | ||||
} | } | ||||
int MidiMessage::getProgramChangeNumber() const throw() | |||||
int MidiMessage::getProgramChangeNumber() const noexcept | |||||
{ | { | ||||
return data[1]; | return data[1]; | ||||
} | } | ||||
const MidiMessage MidiMessage::programChange (const int channel, | 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 | jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | ||||
return MidiMessage (MidiHelpers::initialByte (0xc0, channel), programNumber & 0x7f); | return MidiMessage (MidiHelpers::initialByte (0xc0, channel), programNumber & 0x7f); | ||||
} | } | ||||
bool MidiMessage::isPitchWheel() const throw() | |||||
bool MidiMessage::isPitchWheel() const noexcept | |||||
{ | { | ||||
return (data[0] & 0xf0) == 0xe0; | return (data[0] & 0xf0) == 0xe0; | ||||
} | } | ||||
int MidiMessage::getPitchWheelValue() const throw() | |||||
int MidiMessage::getPitchWheelValue() const noexcept | |||||
{ | { | ||||
return data[1] | (data[2] << 7); | return data[1] | (data[2] << 7); | ||||
} | } | ||||
const MidiMessage MidiMessage::pitchWheel (const int channel, | 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 (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | ||||
jassert (isPositiveAndBelow (position, (int) 0x4000)); | 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); | 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; | return (data[0] & 0xf0) == 0xb0; | ||||
} | } | ||||
int MidiMessage::getControllerNumber() const throw() | |||||
int MidiMessage::getControllerNumber() const noexcept | |||||
{ | { | ||||
jassert (isController()); | jassert (isController()); | ||||
return data[1]; | return data[1]; | ||||
} | } | ||||
int MidiMessage::getControllerValue() const throw() | |||||
int MidiMessage::getControllerValue() const noexcept | |||||
{ | { | ||||
jassert (isController()); | jassert (isController()); | ||||
return data[2]; | 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 | // the channel must be between 1 and 16 inclusive | ||||
jassert (channel > 0 && channel <= 16); | 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); | 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)); | 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 (channel > 0 && channel <= 16); | ||||
jassert (isPositiveAndBelow (noteNumber, (int) 128)); | 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)); | 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 (channel > 0 && channel <= 16); | ||||
jassert (isPositiveAndBelow (noteNumber, (int) 128)); | 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)); | 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); | return controllerEvent (channel, 123, 0); | ||||
} | } | ||||
bool MidiMessage::isAllNotesOff() const throw() | |||||
bool MidiMessage::isAllNotesOff() const noexcept | |||||
{ | { | ||||
return (data[0] & 0xf0) == 0xb0 && data[1] == 123; | 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); | return controllerEvent (channel, 120, 0); | ||||
} | } | ||||
bool MidiMessage::isAllSoundOff() const throw() | |||||
bool MidiMessage::isAllSoundOff() const noexcept | |||||
{ | { | ||||
return (data[0] & 0xf0) == 0xb0 && data[1] == 120; | 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); | 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; | return *data == 0xf0; | ||||
} | } | ||||
@@ -564,33 +564,33 @@ const MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const | |||||
return MidiMessage (m, dataSize + 2); | return MidiMessage (m, dataSize + 2); | ||||
} | } | ||||
const uint8* MidiMessage::getSysExData() const throw() | |||||
const uint8* MidiMessage::getSysExData() const noexcept | |||||
{ | { | ||||
return isSysEx() ? getRawData() + 1 : 0; | return isSysEx() ? getRawData() + 1 : 0; | ||||
} | } | ||||
int MidiMessage::getSysExDataSize() const throw() | |||||
int MidiMessage::getSysExDataSize() const noexcept | |||||
{ | { | ||||
return isSysEx() ? size - 2 : 0; | return isSysEx() ? size - 2 : 0; | ||||
} | } | ||||
bool MidiMessage::isMetaEvent() const throw() | |||||
bool MidiMessage::isMetaEvent() const noexcept | |||||
{ | { | ||||
return *data == 0xff; | return *data == 0xff; | ||||
} | } | ||||
bool MidiMessage::isActiveSense() const throw() | |||||
bool MidiMessage::isActiveSense() const noexcept | |||||
{ | { | ||||
return *data == 0xfe; | return *data == 0xfe; | ||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
int MidiMessage::getMetaEventType() const throw() | |||||
int MidiMessage::getMetaEventType() const noexcept | |||||
{ | { | ||||
return *data != 0xff ? -1 : data[1]; | return *data != 0xff ? -1 : data[1]; | ||||
} | } | ||||
int MidiMessage::getMetaEventLength() const throw() | |||||
int MidiMessage::getMetaEventLength() const noexcept | |||||
{ | { | ||||
if (*data == 0xff) | if (*data == 0xff) | ||||
{ | { | ||||
@@ -601,7 +601,7 @@ int MidiMessage::getMetaEventLength() const throw() | |||||
return 0; | return 0; | ||||
} | } | ||||
const uint8* MidiMessage::getMetaEventData() const throw() | |||||
const uint8* MidiMessage::getMetaEventData() const noexcept | |||||
{ | { | ||||
int n; | int n; | ||||
const uint8* d = data + 2; | const uint8* d = data + 2; | ||||
@@ -609,17 +609,17 @@ const uint8* MidiMessage::getMetaEventData() const throw() | |||||
return d + n; | return d + n; | ||||
} | } | ||||
bool MidiMessage::isTrackMetaEvent() const throw() | |||||
bool MidiMessage::isTrackMetaEvent() const noexcept | |||||
{ | { | ||||
return getMetaEventType() == 0; | return getMetaEventType() == 0; | ||||
} | } | ||||
bool MidiMessage::isEndOfTrackMetaEvent() const throw() | |||||
bool MidiMessage::isEndOfTrackMetaEvent() const noexcept | |||||
{ | { | ||||
return getMetaEventType() == 47; | return getMetaEventType() == 47; | ||||
} | } | ||||
bool MidiMessage::isTextMetaEvent() const throw() | |||||
bool MidiMessage::isTextMetaEvent() const noexcept | |||||
{ | { | ||||
const int t = getMetaEventType(); | const int t = getMetaEventType(); | ||||
@@ -631,27 +631,27 @@ const String MidiMessage::getTextFromTextMetaEvent() const | |||||
return String (reinterpret_cast <const char*> (getMetaEventData()), getMetaEventLength()); | return String (reinterpret_cast <const char*> (getMetaEventData()), getMetaEventLength()); | ||||
} | } | ||||
bool MidiMessage::isTrackNameEvent() const throw() | |||||
bool MidiMessage::isTrackNameEvent() const noexcept | |||||
{ | { | ||||
return (data[1] == 3) && (*data == 0xff); | return (data[1] == 3) && (*data == 0xff); | ||||
} | } | ||||
bool MidiMessage::isTempoMetaEvent() const throw() | |||||
bool MidiMessage::isTempoMetaEvent() const noexcept | |||||
{ | { | ||||
return (data[1] == 81) && (*data == 0xff); | 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); | return (data[1] == 0x20) && (*data == 0xff) && (data[2] == 1); | ||||
} | } | ||||
int MidiMessage::getMidiChannelMetaEventChannel() const throw() | |||||
int MidiMessage::getMidiChannelMetaEventChannel() const noexcept | |||||
{ | { | ||||
return data[3] + 1; | return data[3] + 1; | ||||
} | } | ||||
double MidiMessage::getTempoSecondsPerQuarterNote() const throw() | |||||
double MidiMessage::getTempoSecondsPerQuarterNote() const noexcept | |||||
{ | { | ||||
if (! isTempoMetaEvent()) | if (! isTempoMetaEvent()) | ||||
return 0.0; | return 0.0; | ||||
@@ -664,7 +664,7 @@ double MidiMessage::getTempoSecondsPerQuarterNote() const throw() | |||||
/ 1000000.0; | / 1000000.0; | ||||
} | } | ||||
double MidiMessage::getTempoMetaEventTickLength (const short timeFormat) const throw() | |||||
double MidiMessage::getTempoMetaEventTickLength (const short timeFormat) const noexcept | |||||
{ | { | ||||
if (timeFormat > 0) | 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]; | uint8 d[8]; | ||||
d[0] = 0xff; | d[0] = 0xff; | ||||
@@ -704,12 +704,12 @@ const MidiMessage MidiMessage::tempoMetaEvent (int microsecondsPerQuarterNote) t | |||||
return MidiMessage (d, 6, 0.0); | return MidiMessage (d, 6, 0.0); | ||||
} | } | ||||
bool MidiMessage::isTimeSignatureMetaEvent() const throw() | |||||
bool MidiMessage::isTimeSignatureMetaEvent() const noexcept | |||||
{ | { | ||||
return (data[1] == 0x58) && (*data == (uint8) 0xff); | 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()) | if (isTimeSignatureMetaEvent()) | ||||
{ | { | ||||
@@ -748,7 +748,7 @@ const MidiMessage MidiMessage::timeSignatureMetaEvent (const int numerator, cons | |||||
return MidiMessage (d, 7, 0.0); | 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]; | uint8 d[8]; | ||||
d[0] = 0xff; | d[0] = 0xff; | ||||
@@ -759,101 +759,101 @@ const MidiMessage MidiMessage::midiChannelMetaEvent (const int channel) throw() | |||||
return MidiMessage (d, 4, 0.0); | return MidiMessage (d, 4, 0.0); | ||||
} | } | ||||
bool MidiMessage::isKeySignatureMetaEvent() const throw() | |||||
bool MidiMessage::isKeySignatureMetaEvent() const noexcept | |||||
{ | { | ||||
return getMetaEventType() == 89; | return getMetaEventType() == 89; | ||||
} | } | ||||
int MidiMessage::getKeySignatureNumberOfSharpsOrFlats() const throw() | |||||
int MidiMessage::getKeySignatureNumberOfSharpsOrFlats() const noexcept | |||||
{ | { | ||||
return (int) *getMetaEventData(); | return (int) *getMetaEventData(); | ||||
} | } | ||||
const MidiMessage MidiMessage::endOfTrack() throw() | |||||
const MidiMessage MidiMessage::endOfTrack() noexcept | |||||
{ | { | ||||
return MidiMessage (0xff, 0x2f, 0, 0.0); | return MidiMessage (0xff, 0x2f, 0, 0.0); | ||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
bool MidiMessage::isSongPositionPointer() const throw() | |||||
bool MidiMessage::isSongPositionPointer() const noexcept | |||||
{ | { | ||||
return *data == 0xf2; | return *data == 0xf2; | ||||
} | } | ||||
int MidiMessage::getSongPositionPointerMidiBeat() const throw() | |||||
int MidiMessage::getSongPositionPointerMidiBeat() const noexcept | |||||
{ | { | ||||
return data[1] | (data[2] << 7); | 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, | return MidiMessage (0xf2, | ||||
positionInMidiBeats & 127, | positionInMidiBeats & 127, | ||||
(positionInMidiBeats >> 7) & 127); | (positionInMidiBeats >> 7) & 127); | ||||
} | } | ||||
bool MidiMessage::isMidiStart() const throw() | |||||
bool MidiMessage::isMidiStart() const noexcept | |||||
{ | { | ||||
return *data == 0xfa; | return *data == 0xfa; | ||||
} | } | ||||
const MidiMessage MidiMessage::midiStart() throw() | |||||
const MidiMessage MidiMessage::midiStart() noexcept | |||||
{ | { | ||||
return MidiMessage (0xfa); | return MidiMessage (0xfa); | ||||
} | } | ||||
bool MidiMessage::isMidiContinue() const throw() | |||||
bool MidiMessage::isMidiContinue() const noexcept | |||||
{ | { | ||||
return *data == 0xfb; | return *data == 0xfb; | ||||
} | } | ||||
const MidiMessage MidiMessage::midiContinue() throw() | |||||
const MidiMessage MidiMessage::midiContinue() noexcept | |||||
{ | { | ||||
return MidiMessage (0xfb); | return MidiMessage (0xfb); | ||||
} | } | ||||
bool MidiMessage::isMidiStop() const throw() | |||||
bool MidiMessage::isMidiStop() const noexcept | |||||
{ | { | ||||
return *data == 0xfc; | return *data == 0xfc; | ||||
} | } | ||||
const MidiMessage MidiMessage::midiStop() throw() | |||||
const MidiMessage MidiMessage::midiStop() noexcept | |||||
{ | { | ||||
return MidiMessage (0xfc); | return MidiMessage (0xfc); | ||||
} | } | ||||
bool MidiMessage::isMidiClock() const throw() | |||||
bool MidiMessage::isMidiClock() const noexcept | |||||
{ | { | ||||
return *data == 0xf8; | return *data == 0xf8; | ||||
} | } | ||||
const MidiMessage MidiMessage::midiClock() throw() | |||||
const MidiMessage MidiMessage::midiClock() noexcept | |||||
{ | { | ||||
return MidiMessage (0xf8); | return MidiMessage (0xf8); | ||||
} | } | ||||
bool MidiMessage::isQuarterFrame() const throw() | |||||
bool MidiMessage::isQuarterFrame() const noexcept | |||||
{ | { | ||||
return *data == 0xf1; | return *data == 0xf1; | ||||
} | } | ||||
int MidiMessage::getQuarterFrameSequenceNumber() const throw() | |||||
int MidiMessage::getQuarterFrameSequenceNumber() const noexcept | |||||
{ | { | ||||
return ((int) data[1]) >> 4; | return ((int) data[1]) >> 4; | ||||
} | } | ||||
int MidiMessage::getQuarterFrameValue() const throw() | |||||
int MidiMessage::getQuarterFrameValue() const noexcept | |||||
{ | { | ||||
return ((int) data[1]) & 0x0f; | return ((int) data[1]) & 0x0f; | ||||
} | } | ||||
const MidiMessage MidiMessage::quarterFrame (const int sequenceNumber, | const MidiMessage MidiMessage::quarterFrame (const int sequenceNumber, | ||||
const int value) throw() | |||||
const int value) noexcept | |||||
{ | { | ||||
return MidiMessage (0xf1, (sequenceNumber << 4) | value); | return MidiMessage (0xf1, (sequenceNumber << 4) | value); | ||||
} | } | ||||
bool MidiMessage::isFullFrame() const throw() | |||||
bool MidiMessage::isFullFrame() const noexcept | |||||
{ | { | ||||
return data[0] == 0xf0 | return data[0] == 0xf0 | ||||
&& data[1] == 0x7f | && data[1] == 0x7f | ||||
@@ -866,7 +866,7 @@ void MidiMessage::getFullFrameParameters (int& hours, | |||||
int& minutes, | int& minutes, | ||||
int& seconds, | int& seconds, | ||||
int& frames, | int& frames, | ||||
MidiMessage::SmpteTimecodeType& timecodeType) const throw() | |||||
MidiMessage::SmpteTimecodeType& timecodeType) const noexcept | |||||
{ | { | ||||
jassert (isFullFrame()); | jassert (isFullFrame()); | ||||
@@ -898,7 +898,7 @@ const MidiMessage MidiMessage::fullFrame (const int hours, | |||||
return MidiMessage (d, 10, 0.0); | return MidiMessage (d, 10, 0.0); | ||||
} | } | ||||
bool MidiMessage::isMidiMachineControlMessage() const throw() | |||||
bool MidiMessage::isMidiMachineControlMessage() const noexcept | |||||
{ | { | ||||
return data[0] == 0xf0 | return data[0] == 0xf0 | ||||
&& data[1] == 0x7f | && data[1] == 0x7f | ||||
@@ -906,7 +906,7 @@ bool MidiMessage::isMidiMachineControlMessage() const throw() | |||||
&& size > 5; | && size > 5; | ||||
} | } | ||||
MidiMessage::MidiMachineControlCommand MidiMessage::getMidiMachineControlCommand() const throw() | |||||
MidiMessage::MidiMachineControlCommand MidiMessage::getMidiMachineControlCommand() const noexcept | |||||
{ | { | ||||
jassert (isMidiMachineControlMessage()); | jassert (isMidiMachineControlMessage()); | ||||
@@ -930,7 +930,7 @@ const MidiMessage MidiMessage::midiMachineControlCommand (MidiMessage::MidiMachi | |||||
bool MidiMessage::isMidiMachineControlGoto (int& hours, | bool MidiMessage::isMidiMachineControlGoto (int& hours, | ||||
int& minutes, | int& minutes, | ||||
int& seconds, | int& seconds, | ||||
int& frames) const throw() | |||||
int& frames) const noexcept | |||||
{ | { | ||||
if (size >= 12 | if (size >= 12 | ||||
&& data[0] == 0xf0 | && data[0] == 0xf0 | ||||
@@ -993,7 +993,7 @@ const String MidiMessage::getMidiNoteName (int note, bool useSharps, bool includ | |||||
return String::empty; | 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 | noteNumber -= 12 * 6 + 9; // now 0 = A | ||||
return frequencyOfA * pow (2.0, noteNumber / 12.0); | return frequencyOfA * pow (2.0, noteNumber / 12.0); | ||||
@@ -47,7 +47,7 @@ public: | |||||
@param timeStamp the time to give the midi message - this value doesn't | @param timeStamp the time to give the midi message - this value doesn't | ||||
use any particular units, so will be application-specific | 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. | /** 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 | @param timeStamp the time to give the midi message - this value doesn't | ||||
use any particular units, so will be application-specific | 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. | /** 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 | @param timeStamp the time to give the midi message - this value doesn't | ||||
use any particular units, so will be application-specific | 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. */ | /** Creates a midi message from a block of data. */ | ||||
MidiMessage (const void* data, int numBytes, double timeStamp = 0); | 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 | Since the MidiMessage has to contain a valid message, this default constructor | ||||
just initialises it with an empty sysex message. | just initialises it with an empty sysex message. | ||||
*/ | */ | ||||
MidiMessage() throw(); | |||||
MidiMessage() noexcept; | |||||
/** Creates a copy of another midi message. */ | /** Creates a copy of another midi message. */ | ||||
MidiMessage (const MidiMessage& other); | MidiMessage (const MidiMessage& other); | ||||
@@ -113,13 +113,13 @@ public: | |||||
@see getRawDataSize | @see getRawDataSize | ||||
*/ | */ | ||||
uint8* getRawData() const throw() { return data; } | |||||
uint8* getRawData() const noexcept { return data; } | |||||
/** Returns the number of bytes of data in the message. | /** Returns the number of bytes of data in the message. | ||||
@see getRawData | @see getRawData | ||||
*/ | */ | ||||
int getRawDataSize() const throw() { return size; } | |||||
int getRawDataSize() const noexcept { return size; } | |||||
//============================================================================== | //============================================================================== | ||||
/** Returns the timestamp associated with this message. | /** Returns the timestamp associated with this message. | ||||
@@ -138,7 +138,7 @@ public: | |||||
@see setTimeStamp, addToTimeStamp | @see setTimeStamp, addToTimeStamp | ||||
*/ | */ | ||||
double getTimeStamp() const throw() { return timeStamp; } | |||||
double getTimeStamp() const noexcept { return timeStamp; } | |||||
/** Changes the message's associated timestamp. | /** Changes the message's associated timestamp. | ||||
@@ -146,13 +146,13 @@ public: | |||||
@see addToTimeStamp, getTimeStamp | @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. | /** Adds a value to the message's timestamp. | ||||
The units for the timestamp will be application-specific. | 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. | /** Returns the midi channel associated with the message. | ||||
@@ -161,14 +161,14 @@ public: | |||||
if it's a sysex) | if it's a sysex) | ||||
@see isForChannel, setChannel | @see isForChannel, setChannel | ||||
*/ | */ | ||||
int getChannel() const throw(); | |||||
int getChannel() const noexcept; | |||||
/** Returns true if the message applies to the given midi channel. | /** 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 | @param channelNumber the channel number to look for, in the range 1 to 16 | ||||
@see getChannel, setChannel | @see getChannel, setChannel | ||||
*/ | */ | ||||
bool isForChannel (int channelNumber) const throw(); | |||||
bool isForChannel (int channelNumber) const noexcept; | |||||
/** Changes the message's midi channel. | /** 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 | @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. | /** 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. | /** Returns a pointer to the sysex data inside the message. | ||||
@@ -189,7 +189,7 @@ public: | |||||
@see getSysExDataSize | @see getSysExDataSize | ||||
*/ | */ | ||||
const uint8* getSysExData() const throw(); | |||||
const uint8* getSysExData() const noexcept; | |||||
/** Returns the size of the sysex data. | /** Returns the size of the sysex data. | ||||
@@ -197,7 +197,7 @@ public: | |||||
@see getSysExData | @see getSysExData | ||||
*/ | */ | ||||
int getSysExDataSize() const throw(); | |||||
int getSysExDataSize() const noexcept; | |||||
//============================================================================== | //============================================================================== | ||||
/** Returns true if this message is a 'key-down' event. | /** Returns true if this message is a 'key-down' event. | ||||
@@ -210,7 +210,7 @@ public: | |||||
@see isNoteOff, getNoteNumber, getVelocity, noteOn | @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). | /** Creates a key-down message (using a floating-point velocity). | ||||
@@ -219,7 +219,7 @@ public: | |||||
@param velocity in the range 0 to 1.0 | @param velocity in the range 0 to 1.0 | ||||
@see isNoteOn | @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). | /** Creates a key-down message (using an integer velocity). | ||||
@@ -228,7 +228,7 @@ public: | |||||
@param velocity in the range 0 to 127 | @param velocity in the range 0 to 127 | ||||
@see isNoteOn | @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. | /** Returns true if this message is a 'key-up' event. | ||||
@@ -237,7 +237,7 @@ public: | |||||
@see isNoteOn, getNoteNumber, getVelocity, noteOff | @see isNoteOn, getNoteNumber, getVelocity, noteOff | ||||
*/ | */ | ||||
bool isNoteOff (bool returnTrueForNoteOnVelocity0 = true) const throw(); | |||||
bool isNoteOff (bool returnTrueForNoteOnVelocity0 = true) const noexcept; | |||||
/** Creates a key-up message. | /** Creates a key-up message. | ||||
@@ -246,13 +246,13 @@ public: | |||||
@param velocity in the range 0 to 127 | @param velocity in the range 0 to 127 | ||||
@see isNoteOff | @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. | /** Returns true if this message is a 'key-down' or 'key-up' event. | ||||
@see isNoteOn, isNoteOff | @see isNoteOn, isNoteOff | ||||
*/ | */ | ||||
bool isNoteOnOrOff() const throw(); | |||||
bool isNoteOnOrOff() const noexcept; | |||||
/** Returns the midi note number for note-on and note-off messages. | /** Returns the midi note number for note-on and note-off messages. | ||||
@@ -261,13 +261,13 @@ public: | |||||
@see isNoteOff, getMidiNoteName, getMidiNoteInHertz, setNoteNumber | @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. | /** 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. | 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. | /** Returns the velocity of a note-on or note-off message. | ||||
@@ -278,7 +278,7 @@ public: | |||||
@see getFloatVelocity | @see getFloatVelocity | ||||
*/ | */ | ||||
uint8 getVelocity() const throw(); | |||||
uint8 getVelocity() const noexcept; | |||||
/** Returns the velocity of a note-on or note-off message. | /** Returns the velocity of a note-on or note-off message. | ||||
@@ -288,7 +288,7 @@ public: | |||||
@see getVelocity, setVelocity | @see getVelocity, setVelocity | ||||
*/ | */ | ||||
float getFloatVelocity() const throw(); | |||||
float getFloatVelocity() const noexcept; | |||||
/** Changes the velocity of a note-on or note-off message. | /** 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 | @param newVelocity the new velocity, in the range 0 to 1.0 | ||||
@see getFloatVelocity, multiplyVelocity | @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. | /** 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 | @param scaleFactor the value by which to multiply the velocity | ||||
@see setVelocity | @see setVelocity | ||||
*/ | */ | ||||
void multiplyVelocity (float scaleFactor) throw(); | |||||
void multiplyVelocity (float scaleFactor) noexcept; | |||||
//============================================================================== | //============================================================================== | ||||
/** Returns true if the message is a program (patch) change message. | /** Returns true if the message is a program (patch) change message. | ||||
@see getProgramChangeNumber, getGMInstrumentName | @see getProgramChangeNumber, getGMInstrumentName | ||||
*/ | */ | ||||
bool isProgramChange() const throw(); | |||||
bool isProgramChange() const noexcept; | |||||
/** Returns the new program number of a program change message. | /** Returns the new program number of a program change message. | ||||
@@ -322,7 +322,7 @@ public: | |||||
@see isProgramChange, getGMInstrumentName | @see isProgramChange, getGMInstrumentName | ||||
*/ | */ | ||||
int getProgramChangeNumber() const throw(); | |||||
int getProgramChangeNumber() const noexcept; | |||||
/** Creates a program-change message. | /** Creates a program-change message. | ||||
@@ -330,14 +330,14 @@ public: | |||||
@param programNumber the midi program number, 0 to 127 | @param programNumber the midi program number, 0 to 127 | ||||
@see isProgramChange, getGMInstrumentName | @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. | /** Returns true if the message is a pitch-wheel move. | ||||
@see getPitchWheelValue, pitchWheel | @see getPitchWheelValue, pitchWheel | ||||
*/ | */ | ||||
bool isPitchWheel() const throw(); | |||||
bool isPitchWheel() const noexcept; | |||||
/** Returns the pitch wheel position from a pitch-wheel move message. | /** Returns the pitch wheel position from a pitch-wheel move message. | ||||
@@ -347,7 +347,7 @@ public: | |||||
@see isPitchWheel | @see isPitchWheel | ||||
*/ | */ | ||||
int getPitchWheelValue() const throw(); | |||||
int getPitchWheelValue() const noexcept; | |||||
/** Creates a pitch-wheel move message. | /** Creates a pitch-wheel move message. | ||||
@@ -355,7 +355,7 @@ public: | |||||
@param position the wheel position, in the range 0 to 16383 | @param position the wheel position, in the range 0 to 16383 | ||||
@see isPitchWheel | @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. | /** Returns true if the message is an aftertouch event. | ||||
@@ -366,7 +366,7 @@ public: | |||||
@see getAftertouchValue, getNoteNumber | @see getAftertouchValue, getNoteNumber | ||||
*/ | */ | ||||
bool isAftertouch() const throw(); | |||||
bool isAftertouch() const noexcept; | |||||
/** Returns the amount of aftertouch from an aftertouch messages. | /** Returns the amount of aftertouch from an aftertouch messages. | ||||
@@ -375,7 +375,7 @@ public: | |||||
@see isAftertouch | @see isAftertouch | ||||
*/ | */ | ||||
int getAfterTouchValue() const throw(); | |||||
int getAfterTouchValue() const noexcept; | |||||
/** Creates an aftertouch message. | /** Creates an aftertouch message. | ||||
@@ -386,7 +386,7 @@ public: | |||||
*/ | */ | ||||
static const MidiMessage aftertouchChange (int channel, | static const MidiMessage aftertouchChange (int channel, | ||||
int noteNumber, | int noteNumber, | ||||
int aftertouchAmount) throw(); | |||||
int aftertouchAmount) noexcept; | |||||
/** Returns true if the message is a channel-pressure change event. | /** Returns true if the message is a channel-pressure change event. | ||||
@@ -396,14 +396,14 @@ public: | |||||
@see channelPressureChange | @see channelPressureChange | ||||
*/ | */ | ||||
bool isChannelPressure() const throw(); | |||||
bool isChannelPressure() const noexcept; | |||||
/** Returns the pressure from a channel pressure change message. | /** Returns the pressure from a channel pressure change message. | ||||
@returns the pressure, in the range 0 to 127 | @returns the pressure, in the range 0 to 127 | ||||
@see isChannelPressure, channelPressureChange | @see isChannelPressure, channelPressureChange | ||||
*/ | */ | ||||
int getChannelPressureValue() const throw(); | |||||
int getChannelPressureValue() const noexcept; | |||||
/** Creates a channel-pressure change event. | /** Creates a channel-pressure change event. | ||||
@@ -411,14 +411,14 @@ public: | |||||
@param pressure the pressure, 0 to 127 | @param pressure the pressure, 0 to 127 | ||||
@see isChannelPressure | @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. | /** Returns true if this is a midi controller message. | ||||
@see getControllerNumber, getControllerValue, controllerEvent | @see getControllerNumber, getControllerValue, controllerEvent | ||||
*/ | */ | ||||
bool isController() const throw(); | |||||
bool isController() const noexcept; | |||||
/** Returns the controller number of a controller message. | /** Returns the controller number of a controller message. | ||||
@@ -428,7 +428,7 @@ public: | |||||
@see isController, getControllerName, getControllerValue | @see isController, getControllerName, getControllerValue | ||||
*/ | */ | ||||
int getControllerNumber() const throw(); | |||||
int getControllerNumber() const noexcept; | |||||
/** Returns the controller value from a controller message. | /** Returns the controller value from a controller message. | ||||
@@ -438,7 +438,7 @@ public: | |||||
@see isController, getControllerNumber | @see isController, getControllerNumber | ||||
*/ | */ | ||||
int getControllerValue() const throw(); | |||||
int getControllerValue() const noexcept; | |||||
/** Creates a controller message. | /** Creates a controller message. | ||||
@@ -449,39 +449,39 @@ public: | |||||
*/ | */ | ||||
static const MidiMessage controllerEvent (int channel, | static const MidiMessage controllerEvent (int channel, | ||||
int controllerType, | int controllerType, | ||||
int value) throw(); | |||||
int value) noexcept; | |||||
/** Checks whether this message is an all-notes-off message. | /** Checks whether this message is an all-notes-off message. | ||||
@see allNotesOff | @see allNotesOff | ||||
*/ | */ | ||||
bool isAllNotesOff() const throw(); | |||||
bool isAllNotesOff() const noexcept; | |||||
/** Checks whether this message is an all-sound-off message. | /** Checks whether this message is an all-sound-off message. | ||||
@see allSoundOff | @see allSoundOff | ||||
*/ | */ | ||||
bool isAllSoundOff() const throw(); | |||||
bool isAllSoundOff() const noexcept; | |||||
/** Creates an all-notes-off message. | /** Creates an all-notes-off message. | ||||
@param channel the midi channel, in the range 1 to 16 | @param channel the midi channel, in the range 1 to 16 | ||||
@see isAllNotesOff | @see isAllNotesOff | ||||
*/ | */ | ||||
static const MidiMessage allNotesOff (int channel) throw(); | |||||
static const MidiMessage allNotesOff (int channel) noexcept; | |||||
/** Creates an all-sound-off message. | /** Creates an all-sound-off message. | ||||
@param channel the midi channel, in the range 1 to 16 | @param channel the midi channel, in the range 1 to 16 | ||||
@see isAllSoundOff | @see isAllSoundOff | ||||
*/ | */ | ||||
static const MidiMessage allSoundOff (int channel) throw(); | |||||
static const MidiMessage allSoundOff (int channel) noexcept; | |||||
/** Creates an all-controllers-off message. | /** Creates an all-controllers-off message. | ||||
@param channel the midi channel, in the range 1 to 16 | @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. | /** Returns true if this event is a meta-event. | ||||
@@ -492,7 +492,7 @@ public: | |||||
isTextMetaEvent, isTrackNameEvent, isTempoMetaEvent, isTimeSignatureMetaEvent, | isTextMetaEvent, isTrackNameEvent, isTempoMetaEvent, isTimeSignatureMetaEvent, | ||||
isKeySignatureMetaEvent, isMidiChannelMetaEvent | isKeySignatureMetaEvent, isMidiChannelMetaEvent | ||||
*/ | */ | ||||
bool isMetaEvent() const throw(); | |||||
bool isMetaEvent() const noexcept; | |||||
/** Returns a meta-event's type number. | /** Returns a meta-event's type number. | ||||
@@ -502,44 +502,44 @@ public: | |||||
isTextMetaEvent, isTrackNameEvent, isTempoMetaEvent, isTimeSignatureMetaEvent, | isTextMetaEvent, isTrackNameEvent, isTempoMetaEvent, isTimeSignatureMetaEvent, | ||||
isKeySignatureMetaEvent, isMidiChannelMetaEvent | isKeySignatureMetaEvent, isMidiChannelMetaEvent | ||||
*/ | */ | ||||
int getMetaEventType() const throw(); | |||||
int getMetaEventType() const noexcept; | |||||
/** Returns a pointer to the data in a meta-event. | /** Returns a pointer to the data in a meta-event. | ||||
@see isMetaEvent, getMetaEventLength | @see isMetaEvent, getMetaEventLength | ||||
*/ | */ | ||||
const uint8* getMetaEventData() const throw(); | |||||
const uint8* getMetaEventData() const noexcept; | |||||
/** Returns the length of the data for a meta-event. | /** Returns the length of the data for a meta-event. | ||||
@see isMetaEvent, getMetaEventData | @see isMetaEvent, getMetaEventData | ||||
*/ | */ | ||||
int getMetaEventLength() const throw(); | |||||
int getMetaEventLength() const noexcept; | |||||
//============================================================================== | //============================================================================== | ||||
/** Returns true if this is a 'track' meta-event. */ | /** 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. */ | /** 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. | /** Creates an end-of-track meta-event. | ||||
@see isEndOfTrackMetaEvent | @see isEndOfTrackMetaEvent | ||||
*/ | */ | ||||
static const MidiMessage endOfTrack() throw(); | |||||
static const MidiMessage endOfTrack() noexcept; | |||||
/** Returns true if this is an 'track name' meta-event. | /** Returns true if this is an 'track name' meta-event. | ||||
You can use the getTextFromTextMetaEvent() method to get the track's name. | 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. | /** Returns true if this is a 'text' meta-event. | ||||
@see getTextFromTextMetaEvent | @see getTextFromTextMetaEvent | ||||
*/ | */ | ||||
bool isTextMetaEvent() const throw(); | |||||
bool isTextMetaEvent() const noexcept; | |||||
/** Returns the text from a text meta-event. | /** Returns the text from a text meta-event. | ||||
@@ -552,7 +552,7 @@ public: | |||||
@see getTempoMetaEventTickLength, getTempoSecondsPerQuarterNote | @see getTempoMetaEventTickLength, getTempoSecondsPerQuarterNote | ||||
*/ | */ | ||||
bool isTempoMetaEvent() const throw(); | |||||
bool isTempoMetaEvent() const noexcept; | |||||
/** Returns the tick length from a tempo meta-event. | /** Returns the tick length from a tempo meta-event. | ||||
@@ -560,32 +560,32 @@ public: | |||||
@returns the tick length (in seconds). | @returns the tick length (in seconds). | ||||
@see isTempoMetaEvent | @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. | /** Calculates the seconds-per-quarter-note from a tempo meta-event. | ||||
@see isTempoMetaEvent, getTempoMetaEventTickLength | @see isTempoMetaEvent, getTempoMetaEventTickLength | ||||
*/ | */ | ||||
double getTempoSecondsPerQuarterNote() const throw(); | |||||
double getTempoSecondsPerQuarterNote() const noexcept; | |||||
/** Creates a tempo meta-event. | /** Creates a tempo meta-event. | ||||
@see isTempoMetaEvent | @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. | /** Returns true if this is a 'time-signature' meta-event. | ||||
@see getTimeSignatureInfo | @see getTimeSignatureInfo | ||||
*/ | */ | ||||
bool isTimeSignatureMetaEvent() const throw(); | |||||
bool isTimeSignatureMetaEvent() const noexcept; | |||||
/** Returns the time-signature values from a time-signature meta-event. | /** Returns the time-signature values from a time-signature meta-event. | ||||
@see isTimeSignatureMetaEvent | @see isTimeSignatureMetaEvent | ||||
*/ | */ | ||||
void getTimeSignatureInfo (int& numerator, int& denominator) const throw(); | |||||
void getTimeSignatureInfo (int& numerator, int& denominator) const noexcept; | |||||
/** Creates a time-signature meta-event. | /** Creates a time-signature meta-event. | ||||
@@ -598,13 +598,13 @@ public: | |||||
@see getKeySignatureNumberOfSharpsOrFlats | @see getKeySignatureNumberOfSharpsOrFlats | ||||
*/ | */ | ||||
bool isKeySignatureMetaEvent() const throw(); | |||||
bool isKeySignatureMetaEvent() const noexcept; | |||||
/** Returns the key from a key-signature meta-event. | /** Returns the key from a key-signature meta-event. | ||||
@see isKeySignatureMetaEvent | @see isKeySignatureMetaEvent | ||||
*/ | */ | ||||
int getKeySignatureNumberOfSharpsOrFlats() const throw(); | |||||
int getKeySignatureNumberOfSharpsOrFlats() const noexcept; | |||||
//============================================================================== | //============================================================================== | ||||
/** Returns true if this is a 'channel' meta-event. | /** Returns true if this is a 'channel' meta-event. | ||||
@@ -614,74 +614,74 @@ public: | |||||
@see getMidiChannelMetaEventChannel | @see getMidiChannelMetaEventChannel | ||||
*/ | */ | ||||
bool isMidiChannelMetaEvent() const throw(); | |||||
bool isMidiChannelMetaEvent() const noexcept; | |||||
/** Returns the channel number from a channel meta-event. | /** Returns the channel number from a channel meta-event. | ||||
@returns the channel, in the range 1 to 16. | @returns the channel, in the range 1 to 16. | ||||
@see isMidiChannelMetaEvent | @see isMidiChannelMetaEvent | ||||
*/ | */ | ||||
int getMidiChannelMetaEventChannel() const throw(); | |||||
int getMidiChannelMetaEventChannel() const noexcept; | |||||
/** Creates a midi channel meta-event. | /** Creates a midi channel meta-event. | ||||
@param channel the midi channel, in the range 1 to 16 | @param channel the midi channel, in the range 1 to 16 | ||||
@see isMidiChannelMetaEvent | @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. */ | /** 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. | /** Returns true if this is a midi start event. | ||||
@see midiStart | @see midiStart | ||||
*/ | */ | ||||
bool isMidiStart() const throw(); | |||||
bool isMidiStart() const noexcept; | |||||
/** Creates a midi start event. */ | /** Creates a midi start event. */ | ||||
static const MidiMessage midiStart() throw(); | |||||
static const MidiMessage midiStart() noexcept; | |||||
/** Returns true if this is a midi continue event. | /** Returns true if this is a midi continue event. | ||||
@see midiContinue | @see midiContinue | ||||
*/ | */ | ||||
bool isMidiContinue() const throw(); | |||||
bool isMidiContinue() const noexcept; | |||||
/** Creates a midi continue event. */ | /** Creates a midi continue event. */ | ||||
static const MidiMessage midiContinue() throw(); | |||||
static const MidiMessage midiContinue() noexcept; | |||||
/** Returns true if this is a midi stop event. | /** Returns true if this is a midi stop event. | ||||
@see midiStop | @see midiStop | ||||
*/ | */ | ||||
bool isMidiStop() const throw(); | |||||
bool isMidiStop() const noexcept; | |||||
/** Creates a midi stop event. */ | /** Creates a midi stop event. */ | ||||
static const MidiMessage midiStop() throw(); | |||||
static const MidiMessage midiStop() noexcept; | |||||
/** Returns true if this is a midi clock event. | /** Returns true if this is a midi clock event. | ||||
@see midiClock, songPositionPointer | @see midiClock, songPositionPointer | ||||
*/ | */ | ||||
bool isMidiClock() const throw(); | |||||
bool isMidiClock() const noexcept; | |||||
/** Creates a midi clock event. */ | /** 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. | /** Returns true if this is a song-position-pointer message. | ||||
@see getSongPositionPointerMidiBeat, songPositionPointer | @see getSongPositionPointerMidiBeat, songPositionPointer | ||||
*/ | */ | ||||
bool isSongPositionPointer() const throw(); | |||||
bool isSongPositionPointer() const noexcept; | |||||
/** Returns the midi beat-number of a song-position-pointer message. | /** Returns the midi beat-number of a song-position-pointer message. | ||||
@see isSongPositionPointer, songPositionPointer | @see isSongPositionPointer, songPositionPointer | ||||
*/ | */ | ||||
int getSongPositionPointerMidiBeat() const throw(); | |||||
int getSongPositionPointerMidiBeat() const noexcept; | |||||
/** Creates a song-position-pointer message. | /** Creates a song-position-pointer message. | ||||
@@ -691,14 +691,14 @@ public: | |||||
@see isSongPositionPointer, getSongPositionPointerMidiBeat | @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. | /** Returns true if this is a quarter-frame midi timecode message. | ||||
@see quarterFrame, getQuarterFrameSequenceNumber, getQuarterFrameValue | @see quarterFrame, getQuarterFrameSequenceNumber, getQuarterFrameValue | ||||
*/ | */ | ||||
bool isQuarterFrame() const throw(); | |||||
bool isQuarterFrame() const noexcept; | |||||
/** Returns the sequence number of a quarter-frame midi timecode message. | /** Returns the sequence number of a quarter-frame midi timecode message. | ||||
@@ -706,21 +706,21 @@ public: | |||||
@see isQuarterFrame, getQuarterFrameValue, quarterFrame | @see isQuarterFrame, getQuarterFrameValue, quarterFrame | ||||
*/ | */ | ||||
int getQuarterFrameSequenceNumber() const throw(); | |||||
int getQuarterFrameSequenceNumber() const noexcept; | |||||
/** Returns the value from a quarter-frame message. | /** Returns the value from a quarter-frame message. | ||||
This will be the lower nybble of the message's data-byte, a value | This will be the lower nybble of the message's data-byte, a value | ||||
between 0 and 15 | between 0 and 15 | ||||
*/ | */ | ||||
int getQuarterFrameValue() const throw(); | |||||
int getQuarterFrameValue() const noexcept; | |||||
/** Creates a quarter-frame MTC message. | /** Creates a quarter-frame MTC message. | ||||
@param sequenceNumber a value 0 to 7 for the upper nybble of the message's data byte | @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 | @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. | /** SMPTE timecode types. | ||||
@@ -736,7 +736,7 @@ public: | |||||
/** Returns true if this is a full-frame midi timecode message. | /** 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. | /** Extracts the timecode information from a full-frame midi timecode message. | ||||
@@ -747,7 +747,7 @@ public: | |||||
int& minutes, | int& minutes, | ||||
int& seconds, | int& seconds, | ||||
int& frames, | int& frames, | ||||
SmpteTimecodeType& timecodeType) const throw(); | |||||
SmpteTimecodeType& timecodeType) const noexcept; | |||||
/** Creates a full-frame MTC message. | /** Creates a full-frame MTC message. | ||||
*/ | */ | ||||
@@ -778,14 +778,14 @@ public: | |||||
If it is, you can use the getMidiMachineControlCommand() to find out its type. | 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. | /** For an MMC message, this returns its type. | ||||
Make sure it's actually an MMC message with isMidiMachineControlMessage() before | Make sure it's actually an MMC message with isMidiMachineControlMessage() before | ||||
calling this method. | calling this method. | ||||
*/ | */ | ||||
MidiMachineControlCommand getMidiMachineControlCommand() const throw(); | |||||
MidiMachineControlCommand getMidiMachineControlCommand() const noexcept; | |||||
/** Creates an MMC message. | /** Creates an MMC message. | ||||
*/ | */ | ||||
@@ -800,7 +800,7 @@ public: | |||||
bool isMidiMachineControlGoto (int& hours, | bool isMidiMachineControlGoto (int& hours, | ||||
int& minutes, | int& minutes, | ||||
int& seconds, | int& seconds, | ||||
int& frames) const throw(); | |||||
int& frames) const noexcept; | |||||
/** Creates an MMC "goto" message. | /** 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 | @param numBytesUsed on return, this will be set to the number of bytes that were read | ||||
*/ | */ | ||||
static int readVariableLengthVal (const uint8* data, | 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 | /** 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). | to return the message length (either 1, 2, or 3 bytes). | ||||
The value passed in must be 0x80 or higher. | 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. | /** 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. | The frequencyOfA parameter is an optional frequency for 'A', normally 440-444Hz for concert pitch. | ||||
@see getMidiNoteName | @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. | /** Returns the standard name of a GM instrument. | ||||
@@ -51,7 +51,7 @@ MidiMessageSequence& MidiMessageSequence::operator= (const MidiMessageSequence& | |||||
return *this; | return *this; | ||||
} | } | ||||
void MidiMessageSequence::swapWith (MidiMessageSequence& other) throw() | |||||
void MidiMessageSequence::swapWith (MidiMessageSequence& other) noexcept | |||||
{ | { | ||||
list.swapWithArray (other.list); | list.swapWithArray (other.list); | ||||
} | } | ||||
@@ -79,7 +79,7 @@ double MidiMessageSequence::getTimeOfMatchingKeyUp (const int index) const | |||||
{ | { | ||||
const MidiEventHolder* const meh = list [index]; | const MidiEventHolder* const meh = list [index]; | ||||
if (meh != 0 && meh->noteOffObject != 0) | |||||
if (meh != nullptr && meh->noteOffObject != nullptr) | |||||
return meh->noteOffObject->message.getTimeStamp(); | return meh->noteOffObject->message.getTimeStamp(); | ||||
else | else | ||||
return 0.0; | return 0.0; | ||||
@@ -89,7 +89,7 @@ int MidiMessageSequence::getIndexOfMatchingKeyUp (const int index) const | |||||
{ | { | ||||
const MidiEventHolder* const meh = list [index]; | 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 | 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, | 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() | const double diff = first->message.getTimeStamp() | ||||
- second->message.getTimeStamp(); | - second->message.getTimeStamp(); | ||||
@@ -212,7 +212,7 @@ void MidiMessageSequence::updateMatchedPairs() | |||||
if (m1.isNoteOn()) | if (m1.isNoteOn()) | ||||
{ | { | ||||
list.getUnchecked(i)->noteOffObject = 0; | |||||
list.getUnchecked(i)->noteOffObject = nullptr; | |||||
const int note = m1.getNoteNumber(); | const int note = m1.getNoteNumber(); | ||||
const int chan = m1.getChannel(); | const int chan = m1.getChannel(); | ||||
const int len = list.size(); | const int len = list.size(); | ||||
@@ -339,7 +339,7 @@ void MidiMessageSequence::createControllerUpdatesForTime (const int channelNumbe | |||||
//============================================================================== | //============================================================================== | ||||
MidiMessageSequence::MidiEventHolder::MidiEventHolder (const MidiMessage& message_) | MidiMessageSequence::MidiEventHolder::MidiEventHolder (const MidiMessage& message_) | ||||
: message (message_), | : message (message_), | ||||
noteOffObject (0) | |||||
noteOffObject (nullptr) | |||||
{ | { | ||||
} | } | ||||
@@ -263,12 +263,12 @@ public: | |||||
//============================================================================== | //============================================================================== | ||||
/** Swaps this sequence with another one. */ | /** Swaps this sequence with another one. */ | ||||
void swapWith (MidiMessageSequence& other) throw(); | |||||
void swapWith (MidiMessageSequence& other) noexcept; | |||||
//============================================================================== | //============================================================================== | ||||
/** @internal */ | /** @internal */ | ||||
static int compareElements (const MidiMessageSequence::MidiEventHolder* first, | static int compareElements (const MidiMessageSequence::MidiEventHolder* first, | ||||
const MidiMessageSequence::MidiEventHolder* second) throw(); | |||||
const MidiMessageSequence::MidiEventHolder* second) noexcept; | |||||
private: | private: | ||||
//============================================================================== | //============================================================================== | ||||
@@ -34,8 +34,8 @@ BEGIN_JUCE_NAMESPACE | |||||
//============================================================================== | //============================================================================== | ||||
MidiOutput::MidiOutput() | MidiOutput::MidiOutput() | ||||
: Thread ("midi out"), | : 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); | const ScopedLock sl (lock); | ||||
if (firstMessage == 0 || firstMessage->message.getTimeStamp() > eventTime) | |||||
if (firstMessage == nullptr || firstMessage->message.getTimeStamp() > eventTime) | |||||
{ | { | ||||
m->next = firstMessage; | m->next = firstMessage; | ||||
firstMessage = m; | firstMessage = m; | ||||
@@ -79,7 +79,7 @@ void MidiOutput::sendBlockOfMessages (const MidiBuffer& buffer, | |||||
{ | { | ||||
PendingMessage* mm = firstMessage; | PendingMessage* mm = firstMessage; | ||||
while (mm->next != 0 && mm->next->message.getTimeStamp() <= eventTime) | |||||
while (mm->next != nullptr && mm->next->message.getTimeStamp() <= eventTime) | |||||
mm = mm->next; | mm = mm->next; | ||||
m->next = mm->next; | m->next = mm->next; | ||||
@@ -94,7 +94,7 @@ void MidiOutput::clearAllPendingMessages() | |||||
{ | { | ||||
const ScopedLock sl (lock); | const ScopedLock sl (lock); | ||||
while (firstMessage != 0) | |||||
while (firstMessage != nullptr) | |||||
{ | { | ||||
PendingMessage* const m = firstMessage; | PendingMessage* const m = firstMessage; | ||||
firstMessage = firstMessage->next; | firstMessage = firstMessage->next; | ||||
@@ -126,14 +126,14 @@ void MidiOutput::run() | |||||
const ScopedLock sl (lock); | const ScopedLock sl (lock); | ||||
message = firstMessage; | message = firstMessage; | ||||
if (message != 0) | |||||
if (message != nullptr) | |||||
{ | { | ||||
eventTime = roundToInt (message->message.getTimeStamp()); | eventTime = roundToInt (message->message.getTimeStamp()); | ||||
if (eventTime > now + 20) | if (eventTime > now + 20) | ||||
{ | { | ||||
timeToWait = eventTime - (now + 20); | timeToWait = eventTime - (now + 20); | ||||
message = 0; | |||||
message = nullptr; | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -142,7 +142,7 @@ void MidiOutput::run() | |||||
} | } | ||||
} | } | ||||
if (message != 0) | |||||
if (message != nullptr) | |||||
{ | { | ||||
if (eventTime > now) | if (eventTime > now) | ||||
{ | { | ||||
@@ -411,7 +411,7 @@ private: | |||||
AudioUnitPluginInstance::AudioUnitPluginInstance (const String& fileOrIdentifier) | AudioUnitPluginInstance::AudioUnitPluginInstance (const String& fileOrIdentifier) | ||||
: fileOrIdentifier (fileOrIdentifier), | : fileOrIdentifier (fileOrIdentifier), | ||||
wantsMidiMessages (false), wasPlaying (false), prepared (false), | wantsMidiMessages (false), wasPlaying (false), prepared (false), | ||||
currentBuffer (0), | |||||
currentBuffer (nullptr), | |||||
audioUnit (0) | audioUnit (0) | ||||
{ | { | ||||
using namespace AudioUnitFormatHelpers; | using namespace AudioUnitFormatHelpers; | ||||
@@ -768,20 +768,20 @@ OSStatus AudioUnitPluginInstance::getBeatAndTempo (Float64* outCurrentBeat, Floa | |||||
AudioPlayHead* const ph = getPlayHead(); | AudioPlayHead* const ph = getPlayHead(); | ||||
AudioPlayHead::CurrentPositionInfo result; | AudioPlayHead::CurrentPositionInfo result; | ||||
if (ph != 0 && ph->getCurrentPosition (result)) | |||||
if (ph != nullptr && ph->getCurrentPosition (result)) | |||||
{ | { | ||||
if (outCurrentBeat != 0) | |||||
if (outCurrentBeat != nullptr) | |||||
*outCurrentBeat = result.ppqPosition; | *outCurrentBeat = result.ppqPosition; | ||||
if (outCurrentTempo != 0) | |||||
if (outCurrentTempo != nullptr) | |||||
*outCurrentTempo = result.bpm; | *outCurrentTempo = result.bpm; | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
if (outCurrentBeat != 0) | |||||
if (outCurrentBeat != nullptr) | |||||
*outCurrentBeat = 0; | *outCurrentBeat = 0; | ||||
if (outCurrentTempo != 0) | |||||
if (outCurrentTempo != nullptr) | |||||
*outCurrentTempo = 120.0; | *outCurrentTempo = 120.0; | ||||
} | } | ||||
@@ -796,32 +796,32 @@ OSStatus AudioUnitPluginInstance::getMusicalTimeLocation (UInt32* outDeltaSample | |||||
AudioPlayHead* const ph = getPlayHead(); | AudioPlayHead* const ph = getPlayHead(); | ||||
AudioPlayHead::CurrentPositionInfo result; | 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; | *outTimeSig_Numerator = result.timeSigNumerator; | ||||
if (outTimeSig_Denominator != 0) | |||||
if (outTimeSig_Denominator != nullptr) | |||||
*outTimeSig_Denominator = result.timeSigDenominator; | *outTimeSig_Denominator = result.timeSigDenominator; | ||||
if (outDeltaSampleOffsetToNextBeat != 0) | |||||
if (outDeltaSampleOffsetToNextBeat != nullptr) | |||||
*outDeltaSampleOffsetToNextBeat = 0; //xxx | *outDeltaSampleOffsetToNextBeat = 0; //xxx | ||||
if (outCurrentMeasureDownBeat != 0) | |||||
if (outCurrentMeasureDownBeat != nullptr) | |||||
*outCurrentMeasureDownBeat = result.ppqPositionOfLastBarStart; //xxx wrong | *outCurrentMeasureDownBeat = result.ppqPositionOfLastBarStart; //xxx wrong | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
if (outDeltaSampleOffsetToNextBeat != 0) | |||||
if (outDeltaSampleOffsetToNextBeat != nullptr) | |||||
*outDeltaSampleOffsetToNextBeat = 0; | *outDeltaSampleOffsetToNextBeat = 0; | ||||
if (outTimeSig_Numerator != 0) | |||||
if (outTimeSig_Numerator != nullptr) | |||||
*outTimeSig_Numerator = 4; | *outTimeSig_Numerator = 4; | ||||
if (outTimeSig_Denominator != 0) | |||||
if (outTimeSig_Denominator != nullptr) | |||||
*outTimeSig_Denominator = 4; | *outTimeSig_Denominator = 4; | ||||
if (outCurrentMeasureDownBeat != 0) | |||||
if (outCurrentMeasureDownBeat != nullptr) | |||||
*outCurrentMeasureDownBeat = 0; | *outCurrentMeasureDownBeat = 0; | ||||
} | } | ||||
@@ -838,47 +838,47 @@ OSStatus AudioUnitPluginInstance::getTransportState (Boolean* outIsPlaying, | |||||
AudioPlayHead* const ph = getPlayHead(); | AudioPlayHead* const ph = getPlayHead(); | ||||
AudioPlayHead::CurrentPositionInfo result; | AudioPlayHead::CurrentPositionInfo result; | ||||
if (ph != 0 && ph->getCurrentPosition (result)) | |||||
if (ph != nullptr && ph->getCurrentPosition (result)) | |||||
{ | { | ||||
if (outIsPlaying != 0) | |||||
if (outIsPlaying != nullptr) | |||||
*outIsPlaying = result.isPlaying; | *outIsPlaying = result.isPlaying; | ||||
if (outTransportStateChanged != 0) | |||||
if (outTransportStateChanged != nullptr) | |||||
{ | { | ||||
*outTransportStateChanged = result.isPlaying != wasPlaying; | *outTransportStateChanged = result.isPlaying != wasPlaying; | ||||
wasPlaying = result.isPlaying; | wasPlaying = result.isPlaying; | ||||
} | } | ||||
if (outCurrentSampleInTimeLine != 0) | |||||
if (outCurrentSampleInTimeLine != nullptr) | |||||
*outCurrentSampleInTimeLine = roundToInt (result.timeInSeconds * getSampleRate()); | *outCurrentSampleInTimeLine = roundToInt (result.timeInSeconds * getSampleRate()); | ||||
if (outIsCycling != 0) | |||||
if (outIsCycling != nullptr) | |||||
*outIsCycling = false; | *outIsCycling = false; | ||||
if (outCycleStartBeat != 0) | |||||
if (outCycleStartBeat != nullptr) | |||||
*outCycleStartBeat = 0; | *outCycleStartBeat = 0; | ||||
if (outCycleEndBeat != 0) | |||||
if (outCycleEndBeat != nullptr) | |||||
*outCycleEndBeat = 0; | *outCycleEndBeat = 0; | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
if (outIsPlaying != 0) | |||||
if (outIsPlaying != nullptr) | |||||
*outIsPlaying = false; | *outIsPlaying = false; | ||||
if (outTransportStateChanged != 0) | |||||
if (outTransportStateChanged != nullptr) | |||||
*outTransportStateChanged = false; | *outTransportStateChanged = false; | ||||
if (outCurrentSampleInTimeLine != 0) | |||||
if (outCurrentSampleInTimeLine != nullptr) | |||||
*outCurrentSampleInTimeLine = 0; | *outCurrentSampleInTimeLine = 0; | ||||
if (outIsCycling != 0) | |||||
if (outIsCycling != nullptr) | |||||
*outIsCycling = false; | *outIsCycling = false; | ||||
if (outCycleStartBeat != 0) | |||||
if (outCycleStartBeat != nullptr) | |||||
*outCycleStartBeat = 0; | *outCycleStartBeat = 0; | ||||
if (outCycleEndBeat != 0) | |||||
if (outCycleEndBeat != nullptr) | |||||
*outCycleEndBeat = 0; | *outCycleEndBeat = 0; | ||||
} | } | ||||
@@ -944,7 +944,7 @@ private: | |||||
bool createView (const bool createGenericViewIfNeeded) | bool createView (const bool createGenericViewIfNeeded) | ||||
{ | { | ||||
NSView* pluginView = 0; | |||||
NSView* pluginView = nil; | |||||
UInt32 dataSize = 0; | UInt32 dataSize = 0; | ||||
Boolean isWritable = false; | Boolean isWritable = false; | ||||
@@ -989,13 +989,13 @@ private: | |||||
wrapper.setView (pluginView); | wrapper.setView (pluginView); | ||||
if (pluginView != 0) | |||||
if (pluginView != nil) | |||||
{ | { | ||||
timerCallback(); | timerCallback(); | ||||
startTimer (70); | startTimer (70); | ||||
} | } | ||||
return pluginView != 0; | |||||
return pluginView != nil; | |||||
} | } | ||||
}; | }; | ||||
@@ -1033,7 +1033,7 @@ public: | |||||
plugin.editorBeingDeleted (this); | plugin.editorBeingDeleted (this); | ||||
} | } | ||||
bool isValid() const throw() { return componentRecord != 0; } | |||||
bool isValid() const noexcept { return componentRecord != 0; } | |||||
//============================================================================== | //============================================================================== | ||||
void paint (Graphics& g) | void paint (Graphics& g) | ||||
@@ -1155,7 +1155,7 @@ AudioProcessorEditor* AudioUnitPluginInstance::createEditor() | |||||
w = 0; | w = 0; | ||||
#if JUCE_SUPPORT_CARBON | #if JUCE_SUPPORT_CARBON | ||||
if (w == 0) | |||||
if (w == nullptr) | |||||
{ | { | ||||
w = new AudioUnitPluginWindowCarbon (*this); | w = new AudioUnitPluginWindowCarbon (*this); | ||||
@@ -1164,7 +1164,7 @@ AudioProcessorEditor* AudioUnitPluginInstance::createEditor() | |||||
} | } | ||||
#endif | #endif | ||||
if (w == 0) | |||||
if (w == nullptr) | |||||
w = new AudioUnitPluginWindowCocoa (*this, true); // use AUGenericView as a fallback | w = new AudioUnitPluginWindowCocoa (*this, true); // use AUGenericView as a fallback | ||||
return w.release(); | return w.release(); | ||||
@@ -1174,7 +1174,7 @@ AudioProcessorEditor* AudioUnitPluginInstance::createEditor() | |||||
//============================================================================== | //============================================================================== | ||||
const String AudioUnitPluginInstance::getCategory() const | const String AudioUnitPluginInstance::getCategory() const | ||||
{ | { | ||||
const char* result = 0; | |||||
const char* result = nullptr; | |||||
switch (componentDesc.componentType) | switch (componentDesc.componentType) | ||||
{ | { | ||||
@@ -1327,7 +1327,7 @@ const String AudioUnitPluginInstance::getProgramName (int index) | |||||
{ | { | ||||
const AUPreset* p = (const AUPreset*) CFArrayGetValueAtIndex (presets, i); | 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); | s = PlatformUtilities::cfStringToJuceString (p->presetName); | ||||
break; | break; | ||||
@@ -1466,7 +1466,7 @@ void AudioUnitPluginFormat::findAllTypesForFile (OwnedArray <PluginDescription>& | |||||
ScopedPointer <AudioPluginInstance> createdInstance (createInstanceFromDescription (desc)); | ScopedPointer <AudioPluginInstance> createdInstance (createInstanceFromDescription (desc)); | ||||
AudioUnitPluginInstance* const auInstance = dynamic_cast <AudioUnitPluginInstance*> ((AudioPluginInstance*) createdInstance); | AudioUnitPluginInstance* const auInstance = dynamic_cast <AudioUnitPluginInstance*> ((AudioPluginInstance*) createdInstance); | ||||
if (auInstance != 0) | |||||
if (auInstance != nullptr) | |||||
{ | { | ||||
auInstance->fillInPluginDescription (desc); | auInstance->fillInPluginDescription (desc); | ||||
results.add (new PluginDescription (desc)); | results.add (new PluginDescription (desc)); | ||||
@@ -54,7 +54,7 @@ public: | |||||
{ | { | ||||
numEventsUsed = 0; | numEventsUsed = 0; | ||||
if (events != 0) | |||||
if (events != nullptr) | |||||
events->numEvents = 0; | events->numEvents = 0; | ||||
} | } | ||||
@@ -110,7 +110,7 @@ public: | |||||
{ | { | ||||
const VstEvent* const e = events->events[i]; | const VstEvent* const e = events->events[i]; | ||||
if (e != 0) | |||||
if (e != nullptr) | |||||
{ | { | ||||
if (e->type == kVstMidiType) | if (e->type == kVstMidiType) | ||||
{ | { | ||||
@@ -136,7 +136,7 @@ public: | |||||
const int size = 20 + sizeof (VstEvent*) * numEventsNeeded; | const int size = 20 + sizeof (VstEvent*) * numEventsNeeded; | ||||
if (events == 0) | |||||
if (events == nullptr) | |||||
events.calloc (size, 1); | events.calloc (size, 1); | ||||
else | else | ||||
events.realloc (size, 1); | events.realloc (size, 1); | ||||
@@ -157,7 +157,7 @@ public: | |||||
void freeEvents() | void freeEvents() | ||||
{ | { | ||||
if (events != 0) | |||||
if (events != nullptr) | |||||
{ | { | ||||
for (int i = numEventsAllocated; --i >= 0;) | for (int i = numEventsAllocated; --i >= 0;) | ||||
{ | { | ||||
@@ -177,7 +177,7 @@ struct fxProgramSet | |||||
namespace | namespace | ||||
{ | { | ||||
long vst_swap (const long x) throw() | |||||
long vst_swap (const long x) noexcept | |||||
{ | { | ||||
#ifdef JUCE_LITTLE_ENDIAN | #ifdef JUCE_LITTLE_ENDIAN | ||||
return (long) ByteOrder::swap ((uint32) x); | return (long) ByteOrder::swap ((uint32) x); | ||||
@@ -186,7 +186,7 @@ namespace | |||||
#endif | #endif | ||||
} | } | ||||
float vst_swapFloat (const float x) throw() | |||||
float vst_swapFloat (const float x) noexcept | |||||
{ | { | ||||
#ifdef JUCE_LITTLE_ENDIAN | #ifdef JUCE_LITTLE_ENDIAN | ||||
union { uint32 asInt; float asFloat; } n; | union { uint32 asInt; float asFloat; } n; | ||||
@@ -238,7 +238,7 @@ class VSTPluginWindow; | |||||
//============================================================================== | //============================================================================== | ||||
#if JUCE_MAC && JUCE_PPC | #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]; | void* result = (void*) new char[8]; | ||||
@@ -305,7 +305,7 @@ namespace | |||||
return 0; | return 0; | ||||
} | } | ||||
void translateJuceToXButtonModifiers (const MouseEvent& e, XEvent& ev) throw() | |||||
void translateJuceToXButtonModifiers (const MouseEvent& e, XEvent& ev) noexcept | |||||
{ | { | ||||
if (e.mods.isLeftButtonDown()) | 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; | if (e.mods.isLeftButtonDown()) ev.xmotion.state |= Button1Mask; | ||||
else if (e.mods.isRightButtonDown()) ev.xmotion.state |= Button3Mask; | else if (e.mods.isRightButtonDown()) ev.xmotion.state |= Button3Mask; | ||||
else if (e.mods.isMiddleButtonDown()) ev.xmotion.state |= Button2Mask; | 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; | if (e.mods.isLeftButtonDown()) ev.xcrossing.state |= Button1Mask; | ||||
else if (e.mods.isRightButtonDown()) ev.xcrossing.state |= Button3Mask; | else if (e.mods.isRightButtonDown()) ev.xcrossing.state |= Button3Mask; | ||||
else if (e.mods.isMiddleButtonDown()) ev.xcrossing.state |= Button2Mask; | 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) | if (increment < 0) | ||||
{ | { | ||||
@@ -390,7 +390,7 @@ public: | |||||
ScopedPointer <ModuleHandle> m (new ModuleHandle (file)); | ScopedPointer <ModuleHandle> m (new ModuleHandle (file)); | ||||
if (! m->open()) | if (! m->open()) | ||||
m = 0; | |||||
m = nullptr; | |||||
--insideVSTCallback; | --insideVSTCallback; | ||||
_fpreset(); // (doesn't do any harm) | _fpreset(); // (doesn't do any harm) | ||||
@@ -732,7 +732,7 @@ public: | |||||
desc.version = getVersion(); | desc.version = getVersion(); | ||||
desc.numInputChannels = getNumInputChannels(); | desc.numInputChannels = getNumInputChannels(); | ||||
desc.numOutputChannels = getNumOutputChannels(); | desc.numOutputChannels = getNumOutputChannels(); | ||||
desc.isInstrument = (effect != 0 && (effect->flags & effFlagsIsSynth) != 0); | |||||
desc.isInstrument = (effect != nullptr && (effect->flags & effFlagsIsSynth) != 0); | |||||
} | } | ||||
void* getPlatformSpecificData() { return effect; } | void* getPlatformSpecificData() { return effect; } | ||||
@@ -749,7 +749,7 @@ public: | |||||
void processBlock (AudioSampleBuffer& buffer, | void processBlock (AudioSampleBuffer& buffer, | ||||
MidiBuffer& midiMessages); | MidiBuffer& midiMessages); | ||||
bool hasEditor() const { return effect != 0 && (effect->flags & effFlagsHasEditor) != 0; } | |||||
bool hasEditor() const { return effect != nullptr && (effect->flags & effFlagsHasEditor) != 0; } | |||||
AudioProcessorEditor* createEditor(); | AudioProcessorEditor* createEditor(); | ||||
const String getInputChannelName (int index) const; | const String getInputChannelName (int index) const; | ||||
@@ -759,7 +759,7 @@ public: | |||||
bool isOutputChannelStereoPair (int index) const; | 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); | float getParameter (int index); | ||||
void setParameter (int index, float newValue); | void setParameter (int index, float newValue); | ||||
const String getParameterName (int index); | const String getParameterName (int index); | ||||
@@ -767,7 +767,7 @@ public: | |||||
bool isParameterAutomatable (int index) const; | 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); } | int getCurrentProgram() { return dispatch (effGetProgram, 0, 0, 0, 0); } | ||||
void setCurrentProgram (int index); | void setCurrentProgram (int index); | ||||
const String getProgramName (int index); | const String getProgramName (int index); | ||||
@@ -814,13 +814,13 @@ private: | |||||
void restoreFromTempParameterStore (const MemoryBlock& mb); | void restoreFromTempParameterStore (const MemoryBlock& mb); | ||||
const String getParameterLabel (int index) const; | 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 getChunkData (MemoryBlock& mb, bool isPreset, int maxSizeMB) const; | ||||
void setChunkData (const char* data, int size, bool isPreset); | void setChunkData (const char* data, int size, bool isPreset); | ||||
bool loadFromFXBFile (const void* data, int numBytes); | bool loadFromFXBFile (const void* data, int numBytes); | ||||
bool saveToFXBFile (MemoryBlock& dest, bool isFXB, int maxSizeMB); | 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 getVersion() const; | ||||
const String getCategory() const; | const String getCategory() const; | ||||
@@ -855,7 +855,7 @@ VSTPluginInstance::VSTPluginInstance (const ReferenceCountedObjectPtr <ModuleHan | |||||
#if JUCE_PPC | #if JUCE_PPC | ||||
if (module->fragId != 0) | if (module->fragId != 0) | ||||
{ | { | ||||
static void* audioMasterCoerced = 0; | |||||
static void* audioMasterCoerced = nullptr; | |||||
if (audioMasterCoerced == 0) | if (audioMasterCoerced == 0) | ||||
audioMasterCoerced = NewCFMFromMachO ((void*) &audioMaster); | audioMasterCoerced = NewCFMFromMachO ((void*) &audioMaster); | ||||
@@ -870,7 +870,7 @@ VSTPluginInstance::VSTPluginInstance (const ReferenceCountedObjectPtr <ModuleHan | |||||
--insideVSTCallback; | --insideVSTCallback; | ||||
if (effect != 0 && effect->magic == kEffectMagic) | |||||
if (effect != nullptr && effect->magic == kEffectMagic) | |||||
{ | { | ||||
#if JUCE_PPC | #if JUCE_PPC | ||||
module->coerceAEffectFunctionCalls (effect); | module->coerceAEffectFunctionCalls (effect); | ||||
@@ -883,7 +883,7 @@ VSTPluginInstance::VSTPluginInstance (const ReferenceCountedObjectPtr <ModuleHan | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
effect = 0; | |||||
effect = nullptr; | |||||
} | } | ||||
} | } | ||||
catch (...) | catch (...) | ||||
@@ -898,7 +898,7 @@ VSTPluginInstance::~VSTPluginInstance() | |||||
jassert (insideVSTCallback == 0); | jassert (insideVSTCallback == 0); | ||||
if (effect != 0 && effect->magic == kEffectMagic) | |||||
if (effect != nullptr && effect->magic == kEffectMagic) | |||||
{ | { | ||||
try | 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(); | AudioPlayHead* playHead = getPlayHead(); | ||||
if (playHead != 0) | |||||
if (playHead != nullptr) | |||||
{ | { | ||||
AudioPlayHead::CurrentPositionInfo position; | AudioPlayHead::CurrentPositionInfo position; | ||||
playHead->getCurrentPosition (position); | playHead->getCurrentPosition (position); | ||||
@@ -1126,7 +1126,7 @@ void VSTPluginInstance::processBlock (AudioSampleBuffer& buffer, | |||||
//============================================================================== | //============================================================================== | ||||
void VSTPluginInstance::handleMidiFromPlugin (const VstEvents* const events) | void VSTPluginInstance::handleMidiFromPlugin (const VstEvents* const events) | ||||
{ | { | ||||
if (events != 0) | |||||
if (events != nullptr) | |||||
{ | { | ||||
const ScopedLock sl (midiInLock); | const ScopedLock sl (midiInLock); | ||||
VSTMidiEventList::addEventsToMidiBuffer (events, incomingMidi); | VSTMidiEventList::addEventsToMidiBuffer (events, incomingMidi); | ||||
@@ -1157,15 +1157,15 @@ public: | |||||
pluginRefusesToResize (false), | pluginRefusesToResize (false), | ||||
alreadyInside (false) | alreadyInside (false) | ||||
{ | { | ||||
#if JUCE_WINDOWS | |||||
#if JUCE_WINDOWS | |||||
sizeCheckCount = 0; | sizeCheckCount = 0; | ||||
pluginHWND = 0; | pluginHWND = 0; | ||||
#elif JUCE_LINUX | |||||
#elif JUCE_LINUX | |||||
pluginWindow = None; | pluginWindow = None; | ||||
pluginProc = None; | pluginProc = None; | ||||
#else | |||||
#else | |||||
addAndMakeVisible (innerWrapper = new InnerWrapperComponent (this)); | addAndMakeVisible (innerWrapper = new InnerWrapperComponent (this)); | ||||
#endif | |||||
#endif | |||||
activeVSTWindows.add (this); | activeVSTWindows.add (this); | ||||
@@ -1176,11 +1176,12 @@ public: | |||||
~VSTPluginWindow() | ~VSTPluginWindow() | ||||
{ | { | ||||
#if JUCE_MAC | |||||
innerWrapper = 0; | |||||
#else | |||||
#if JUCE_MAC | |||||
innerWrapper = nullptr; | |||||
#else | |||||
closePluginWindow(); | closePluginWindow(); | ||||
#endif | |||||
#endif | |||||
activeVSTWindows.removeValue (this); | activeVSTWindows.removeValue (this); | ||||
plugin.editorBeingDeleted (this); | plugin.editorBeingDeleted (this); | ||||
} | } | ||||
@@ -1194,7 +1195,7 @@ public: | |||||
Component* const topComp = getTopLevelComponent(); | Component* const topComp = getTopLevelComponent(); | ||||
if (topComp->getPeer() != 0) | |||||
if (topComp->getPeer() != nullptr) | |||||
{ | { | ||||
const Point<int> pos (topComp->getLocalPoint (this, Point<int>())); | const Point<int> pos (topComp->getLocalPoint (this, Point<int>())); | ||||
@@ -1257,7 +1258,7 @@ public: | |||||
{ | { | ||||
ComponentPeer* const peer = getPeer(); | ComponentPeer* const peer = getPeer(); | ||||
if (peer != 0) | |||||
if (peer != nullptr) | |||||
{ | { | ||||
const Point<int> pos (getScreenPosition() - peer->getScreenPosition()); | const Point<int> pos (getScreenPosition() - peer->getScreenPosition()); | ||||
peer->addMaskedRegion (pos.getX(), pos.getY(), getWidth(), getHeight()); | peer->addMaskedRegion (pos.getX(), pos.getY(), getWidth(), getHeight()); | ||||
@@ -1380,7 +1381,7 @@ private: | |||||
isOpen = true; | isOpen = true; | ||||
ERect* rect = 0; | |||||
ERect* rect = nullptr; | |||||
dispatch (effEditGetRect, 0, 0, &rect, 0); | dispatch (effEditGetRect, 0, 0, &rect, 0); | ||||
dispatch (effEditOpen, 0, 0, parentWindow, 0); | dispatch (effEditOpen, 0, 0, parentWindow, 0); | ||||
@@ -1394,7 +1395,7 @@ private: | |||||
// double-check it's not too tiny | // double-check it's not too tiny | ||||
int w = 250, h = 150; | int w = 250, h = 150; | ||||
if (rect != 0) | |||||
if (rect != nullptr) | |||||
{ | { | ||||
w = rect->right - rect->left; | w = rect->right - rect->left; | ||||
h = rect->bottom - rect->top; | h = rect->bottom - rect->top; | ||||
@@ -1424,7 +1425,7 @@ private: | |||||
log ("Opening VST UI: " + plugin.name); | log ("Opening VST UI: " + plugin.name); | ||||
isOpen = true; | isOpen = true; | ||||
ERect* rect = 0; | |||||
ERect* rect = nullptr; | |||||
dispatch (effEditGetRect, 0, 0, &rect, 0); | dispatch (effEditGetRect, 0, 0, &rect, 0); | ||||
dispatch (effEditOpen, 0, 0, getWindowHandle(), 0); | dispatch (effEditOpen, 0, 0, getWindowHandle(), 0); | ||||
@@ -1462,7 +1463,7 @@ private: | |||||
w = r.right - r.left; | w = r.right - r.left; | ||||
h = r.bottom - r.top; | h = r.bottom - r.top; | ||||
if (rect != 0) | |||||
if (rect != nullptr) | |||||
{ | { | ||||
const int rw = rect->right - rect->left; | const int rw = rect->right - rect->left; | ||||
const int rh = rect->bottom - rect->top; | const int rh = rect->bottom - rect->top; | ||||
@@ -1499,7 +1500,7 @@ private: | |||||
int w = 250, h = 150; | int w = 250, h = 150; | ||||
if (rect != 0) | |||||
if (rect != nullptr) | |||||
{ | { | ||||
w = rect->right - rect->left; | w = rect->right - rect->left; | ||||
h = rect->bottom - rect->top; | h = rect->bottom - rect->top; | ||||
@@ -1810,7 +1811,7 @@ private: | |||||
bool getEmbeddedViewSize (int& w, int& h) | bool getEmbeddedViewSize (int& w, int& h) | ||||
{ | { | ||||
ERect* rect = 0; | |||||
ERect* rect = nullptr; | |||||
owner->dispatch (effEditGetRect, 0, 0, &rect, 0); | owner->dispatch (effEditGetRect, 0, 0, &rect, 0); | ||||
w = rect->right - rect->left; | w = rect->right - rect->left; | ||||
h = rect->bottom - rect->top; | h = rect->bottom - rect->top; | ||||
@@ -1836,7 +1837,7 @@ private: | |||||
{ | { | ||||
ComponentPeer* const peer = getPeer(); | ComponentPeer* const peer = getPeer(); | ||||
if (peer != 0) | |||||
if (peer != nullptr) | |||||
{ | { | ||||
const Point<int> pos (getScreenPosition() - peer->getScreenPosition()); | const Point<int> pos (getScreenPosition() - peer->getScreenPosition()); | ||||
ERect r; | ERect r; | ||||
@@ -2110,10 +2111,10 @@ void VSTPluginInstance::getChunkData (MemoryBlock& mb, bool isPreset, int maxSiz | |||||
{ | { | ||||
if (usesChunks()) | if (usesChunks()) | ||||
{ | { | ||||
void* data = 0; | |||||
void* data = nullptr; | |||||
const int bytes = dispatch (effGetChunk, isPreset ? 1 : 0, 0, &data, 0.0f); | 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.setSize (bytes); | ||||
mb.copyFrom (data, 0, bytes); | mb.copyFrom (data, 0, bytes); | ||||
@@ -2217,7 +2218,7 @@ namespace | |||||
{ | { | ||||
String hostName ("Juce VST Host"); | String hostName ("Juce VST Host"); | ||||
if (JUCEApplication::getInstance() != 0) | |||||
if (JUCEApplication::getInstance() != nullptr) | |||||
hostName = JUCEApplication::getInstance()->getApplicationName(); | hostName = JUCEApplication::getInstance()->getApplicationName(); | ||||
hostName.copyToUTF8 ((char*) ptr, jmin (kVstMaxVendorStrLen, kVstMaxProductStrLen) - 1); | hostName.copyToUTF8 ((char*) ptr, jmin (kVstMaxVendorStrLen, kVstMaxProductStrLen) - 1); | ||||
@@ -2268,7 +2269,7 @@ VstIntPtr VSTPluginInstance::handleCallback (VstInt32 opcode, VstInt32 index, Vs | |||||
{ | { | ||||
++insideVSTCallback; | ++insideVSTCallback; | ||||
#if JUCE_MAC | #if JUCE_MAC | ||||
if (getActiveEditor() != 0) | |||||
if (getActiveEditor() != nullptr) | |||||
dispatch (effEditIdle, 0, 0, 0, 0); | dispatch (effEditIdle, 0, 0, 0, 0); | ||||
#endif | #endif | ||||
juce_callAnyTimersSynchronously(); | juce_callAnyTimersSynchronously(); | ||||
@@ -2295,7 +2296,7 @@ VstIntPtr VSTPluginInstance::handleCallback (VstInt32 opcode, VstInt32 index, Vs | |||||
break; | break; | ||||
case audioMasterSizeWindow: | case audioMasterSizeWindow: | ||||
if (getActiveEditor() != 0) | |||||
if (getActiveEditor() != nullptr) | |||||
getActiveEditor()->setSize (index, value); | getActiveEditor()->setSize (index, value); | ||||
return 1; | return 1; | ||||
@@ -2358,7 +2359,7 @@ static VstIntPtr VSTCALLBACK audioMaster (AEffect* effect, VstInt32 opcode, VstI | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
if (effect != 0 && effect->resvd2 != 0) | |||||
if (effect != nullptr && effect->resvd2 != 0) | |||||
{ | { | ||||
return ((VSTPluginInstance*)(effect->resvd2)) | return ((VSTPluginInstance*)(effect->resvd2)) | ||||
->handleCallback (opcode, index, value, ptr, opt); | ->handleCallback (opcode, index, value, ptr, opt); | ||||
@@ -2409,7 +2410,7 @@ const String VSTPluginInstance::getVersion() const | |||||
int VSTPluginInstance::getUID() const | int VSTPluginInstance::getUID() const | ||||
{ | { | ||||
int uid = effect != 0 ? effect->uniqueID : 0; | |||||
int uid = effect != nullptr ? effect->uniqueID : 0; | |||||
if (uid == 0) | if (uid == 0) | ||||
uid = module->file.hashCode(); | uid = module->file.hashCode(); | ||||
@@ -2419,7 +2420,7 @@ int VSTPluginInstance::getUID() const | |||||
const String VSTPluginInstance::getCategory() const | const String VSTPluginInstance::getCategory() const | ||||
{ | { | ||||
const char* result = 0; | |||||
const char* result = nullptr; | |||||
switch (dispatch (effGetPlugCategory, 0, 0, 0, 0)) | switch (dispatch (effGetPlugCategory, 0, 0, 0, 0)) | ||||
{ | { | ||||
@@ -2441,7 +2442,7 @@ const String VSTPluginInstance::getCategory() const | |||||
//============================================================================== | //============================================================================== | ||||
float VSTPluginInstance::getParameter (int index) | float VSTPluginInstance::getParameter (int index) | ||||
{ | { | ||||
if (effect != 0 && isPositiveAndBelow (index, (int) effect->numParams)) | |||||
if (effect != nullptr && isPositiveAndBelow (index, (int) effect->numParams)) | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
@@ -2458,7 +2459,7 @@ float VSTPluginInstance::getParameter (int index) | |||||
void VSTPluginInstance::setParameter (int index, float newValue) | void VSTPluginInstance::setParameter (int index, float newValue) | ||||
{ | { | ||||
if (effect != 0 && isPositiveAndBelow (index, (int) effect->numParams)) | |||||
if (effect != nullptr && isPositiveAndBelow (index, (int) effect->numParams)) | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
@@ -2475,7 +2476,7 @@ void VSTPluginInstance::setParameter (int index, float newValue) | |||||
const String VSTPluginInstance::getParameterName (int index) | const String VSTPluginInstance::getParameterName (int index) | ||||
{ | { | ||||
if (effect != 0) | |||||
if (effect != nullptr) | |||||
{ | { | ||||
jassert (index >= 0 && index < effect->numParams); | jassert (index >= 0 && index < effect->numParams); | ||||
@@ -2489,7 +2490,7 @@ const String VSTPluginInstance::getParameterName (int index) | |||||
const String VSTPluginInstance::getParameterLabel (int index) const | const String VSTPluginInstance::getParameterLabel (int index) const | ||||
{ | { | ||||
if (effect != 0) | |||||
if (effect != nullptr) | |||||
{ | { | ||||
jassert (index >= 0 && index < effect->numParams); | jassert (index >= 0 && index < effect->numParams); | ||||
@@ -2503,7 +2504,7 @@ const String VSTPluginInstance::getParameterLabel (int index) const | |||||
const String VSTPluginInstance::getParameterText (int index) | const String VSTPluginInstance::getParameterText (int index) | ||||
{ | { | ||||
if (effect != 0) | |||||
if (effect != nullptr) | |||||
{ | { | ||||
jassert (index >= 0 && index < effect->numParams); | jassert (index >= 0 && index < effect->numParams); | ||||
@@ -2517,7 +2518,7 @@ const String VSTPluginInstance::getParameterText (int index) | |||||
bool VSTPluginInstance::isParameterAutomatable (int index) const | bool VSTPluginInstance::isParameterAutomatable (int index) const | ||||
{ | { | ||||
if (effect != 0) | |||||
if (effect != nullptr) | |||||
{ | { | ||||
jassert (index >= 0 && index < effect->numParams); | jassert (index >= 0 && index < effect->numParams); | ||||
return dispatch (effCanBeAutomated, index, 0, 0, 0) != 0; | return dispatch (effCanBeAutomated, index, 0, 0, 0) != 0; | ||||
@@ -2560,7 +2561,7 @@ const String VSTPluginInstance::getProgramName (int index) | |||||
{ | { | ||||
return getCurrentProgramName(); | return getCurrentProgramName(); | ||||
} | } | ||||
else if (effect != 0) | |||||
else if (effect != nullptr) | |||||
{ | { | ||||
char nm [256] = { 0 }; | char nm [256] = { 0 }; | ||||
@@ -2590,7 +2591,7 @@ void VSTPluginInstance::changeProgramName (int index, const String& newName) | |||||
void VSTPluginInstance::updateStoredProgramNames() | void VSTPluginInstance::updateStoredProgramNames() | ||||
{ | { | ||||
if (effect != 0 && getNumPrograms() > 0) | |||||
if (effect != nullptr && getNumPrograms() > 0) | |||||
{ | { | ||||
char nm [256] = { 0 }; | char nm [256] = { 0 }; | ||||
@@ -2615,7 +2616,7 @@ void VSTPluginInstance::updateStoredProgramNames() | |||||
const String VSTPluginInstance::getCurrentProgramName() | const String VSTPluginInstance::getCurrentProgramName() | ||||
{ | { | ||||
if (effect != 0) | |||||
if (effect != nullptr) | |||||
{ | { | ||||
char nm [256] = { 0 }; | char nm [256] = { 0 }; | ||||
dispatch (effGetProgramName, 0, 0, nm, 0); | dispatch (effGetProgramName, 0, 0, nm, 0); | ||||
@@ -2815,20 +2816,20 @@ AudioPluginInstance* VSTPluginFormat::createInstanceFromDescription (const Plugi | |||||
const ReferenceCountedObjectPtr <ModuleHandle> module (ModuleHandle::findOrCreateModule (file)); | const ReferenceCountedObjectPtr <ModuleHandle> module (ModuleHandle::findOrCreateModule (file)); | ||||
if (module != 0) | |||||
if (module != nullptr) | |||||
{ | { | ||||
shellUIDToCreate = desc.uid; | shellUIDToCreate = desc.uid; | ||||
result = new VSTPluginInstance (module); | result = new VSTPluginInstance (module); | ||||
if (result->effect != 0) | |||||
if (result->effect != nullptr) | |||||
{ | { | ||||
result->effect->resvd2 = (VstIntPtr) (pointer_sized_int) (VSTPluginInstance*) result; | result->effect->resvd2 = (VstIntPtr) (pointer_sized_int) (VSTPluginInstance*) result; | ||||
result->initialise(); | result->initialise(); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
result = 0; | |||||
result = nullptr; | |||||
} | } | ||||
} | } | ||||
@@ -31,7 +31,7 @@ BEGIN_JUCE_NAMESPACE | |||||
//============================================================================== | //============================================================================== | ||||
AudioPluginFormat::AudioPluginFormat() throw() | |||||
AudioPluginFormat::AudioPluginFormat() noexcept | |||||
{ | { | ||||
} | } | ||||
@@ -107,7 +107,7 @@ public: | |||||
protected: | protected: | ||||
//============================================================================== | //============================================================================== | ||||
AudioPluginFormat() throw(); | |||||
AudioPluginFormat() noexcept; | |||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginFormat); | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginFormat); | ||||
}; | }; | ||||
@@ -52,43 +52,43 @@ juce_ImplementSingleton_SingleThreaded (AudioPluginFormatManager); | |||||
//============================================================================== | //============================================================================== | ||||
void AudioPluginFormatManager::addDefaultFormats() | void AudioPluginFormatManager::addDefaultFormats() | ||||
{ | { | ||||
#if JUCE_DEBUG | |||||
#if JUCE_DEBUG | |||||
// you should only call this method once! | // you should only call this method once! | ||||
for (int i = formats.size(); --i >= 0;) | 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()); | 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()); | formats.add (new VSTPluginFormat()); | ||||
#endif | |||||
#endif | |||||
#if JUCE_PLUGINHOST_DX && JUCE_WINDOWS | |||||
#if JUCE_PLUGINHOST_DX && JUCE_WINDOWS | |||||
formats.add (new DirectXPluginFormat()); | formats.add (new DirectXPluginFormat()); | ||||
#endif | |||||
#endif | |||||
#if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX | |||||
#if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX | |||||
formats.add (new LADSPAPluginFormat()); | formats.add (new LADSPAPluginFormat()); | ||||
#endif | |||||
#endif | |||||
} | } | ||||
int AudioPluginFormatManager::getNumFormats() | int AudioPluginFormatManager::getNumFormats() | ||||
@@ -109,17 +109,17 @@ void AudioPluginFormatManager::addFormat (AudioPluginFormat* const format) | |||||
AudioPluginInstance* AudioPluginFormatManager::createPluginInstance (const PluginDescription& description, | AudioPluginInstance* AudioPluginFormatManager::createPluginInstance (const PluginDescription& description, | ||||
String& errorMessage) const | String& errorMessage) const | ||||
{ | { | ||||
AudioPluginInstance* result = 0; | |||||
AudioPluginInstance* result = nullptr; | |||||
for (int i = 0; i < formats.size(); ++i) | for (int i = 0; i < formats.size(); ++i) | ||||
{ | { | ||||
result = formats.getUnchecked(i)->createInstanceFromDescription (description); | result = formats.getUnchecked(i)->createInstanceFromDescription (description); | ||||
if (result != 0) | |||||
if (result != nullptr) | |||||
break; | break; | ||||
} | } | ||||
if (result == 0) | |||||
if (result == nullptr) | |||||
{ | { | ||||
if (! doesPluginStillExist (description)) | if (! doesPluginStillExist (description)) | ||||
errorMessage = TRANS ("This plug-in file no longer exists"); | errorMessage = TRANS ("This plug-in file no longer exists"); | ||||
@@ -103,7 +103,7 @@ namespace | |||||
return Time(); | 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(); | return t1 != t2 || t1 == Time(); | ||||
} | } | ||||
@@ -136,7 +136,7 @@ bool KnownPluginList::scanAndAddFile (const String& fileOrIdentifier, | |||||
bool addedOne = false; | bool addedOne = false; | ||||
if (dontRescanIfAlreadyInList | if (dontRescanIfAlreadyInList | ||||
&& getTypeForFile (fileOrIdentifier) != 0) | |||||
&& getTypeForFile (fileOrIdentifier) != nullptr) | |||||
{ | { | ||||
bool needsRescanning = false; | bool needsRescanning = false; | ||||
@@ -163,7 +163,7 @@ bool KnownPluginList::scanAndAddFile (const String& fileOrIdentifier, | |||||
for (int i = 0; i < found.size(); ++i) | for (int i = 0; i < found.size(); ++i) | ||||
{ | { | ||||
PluginDescription* const desc = found.getUnchecked(i); | PluginDescription* const desc = found.getUnchecked(i); | ||||
jassert (desc != 0); | |||||
jassert (desc != nullptr); | |||||
if (addType (*desc)) | if (addType (*desc)) | ||||
addedOne = true; | addedOne = true; | ||||
@@ -217,7 +217,7 @@ class PluginSorter | |||||
public: | public: | ||||
KnownPluginList::SortMethod method; | KnownPluginList::SortMethod method; | ||||
PluginSorter() throw() {} | |||||
PluginSorter() noexcept {} | |||||
int compareElements (const PluginDescription* const first, | int compareElements (const PluginDescription* const first, | ||||
const PluginDescription* const second) const | const PluginDescription* const second) const | ||||
@@ -59,12 +59,12 @@ public: | |||||
/** Returns the number of types currently in the list. | /** Returns the number of types currently in the list. | ||||
@see getType | @see getType | ||||
*/ | */ | ||||
int getNumTypes() const throw() { return types.size(); } | |||||
int getNumTypes() const noexcept { return types.size(); } | |||||
/** Returns one of the types. | /** Returns one of the types. | ||||
@see getNumTypes | @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. | /** Looks for a type in the list which comes from this file. | ||||
*/ | */ | ||||
@@ -103,7 +103,7 @@ public: | |||||
/** This returns a list of all the filenames of things that looked like being | /** 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. | 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: | private: | ||||
//============================================================================== | //============================================================================== | ||||
@@ -55,7 +55,7 @@ PluginListComponent::PluginListComponent (KnownPluginList& listToEdit, | |||||
setSize (400, 600); | setSize (400, 600); | ||||
list.addChangeListener (this); | list.addChangeListener (this); | ||||
changeListenerCallback (0); | |||||
changeListenerCallback (nullptr); | |||||
} | } | ||||
PluginListComponent::~PluginListComponent() | PluginListComponent::~PluginListComponent() | ||||
@@ -91,7 +91,7 @@ void PluginListComponent::paintListBoxItem (int row, | |||||
const PluginDescription* const pd = list.getType (row); | const PluginDescription* const pd = list.getType (row); | ||||
if (pd != 0) | |||||
if (pd != nullptr) | |||||
{ | { | ||||
GlyphArrangement ga; | GlyphArrangement ga; | ||||
ga.addCurtailedLineOfText (Font (height * 0.7f, Font::bold), pd->name, 8.0f, height * 0.8f, width - 10.0f, true); | 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()); | const PluginDescription* const desc = list.getType (listBox.getSelectedRow()); | ||||
if (desc != 0) | |||||
if (desc != nullptr) | |||||
{ | { | ||||
if (File (desc->fileOrIdentifier).existsAsFile()) | if (File (desc->fileOrIdentifier).existsAsFile()) | ||||
File (desc->fileOrIdentifier).getParentDirectory().startAsProcess(); | File (desc->fileOrIdentifier).getParentDirectory().startAsProcess(); | ||||
@@ -195,7 +195,7 @@ void PluginListComponent::optionsMenuCallback (int result) | |||||
void PluginListComponent::optionsMenuStaticCallback (int result, PluginListComponent* pluginList) | void PluginListComponent::optionsMenuStaticCallback (int result, PluginListComponent* pluginList) | ||||
{ | { | ||||
if (pluginList != 0) | |||||
if (pluginList != nullptr) | |||||
pluginList->optionsMenuCallback (result); | pluginList->optionsMenuCallback (result); | ||||
} | } | ||||
@@ -247,12 +247,12 @@ void PluginListComponent::filesDropped (const StringArray& files, int, int) | |||||
void PluginListComponent::scanFor (AudioPluginFormat* format) | void PluginListComponent::scanFor (AudioPluginFormat* format) | ||||
{ | { | ||||
#if JUCE_MODAL_LOOPS_PERMITTED | #if JUCE_MODAL_LOOPS_PERMITTED | ||||
if (format == 0) | |||||
if (format == nullptr) | |||||
return; | return; | ||||
FileSearchPath path (format->getDefaultLocationsToSearch()); | FileSearchPath path (format->getDefaultLocationsToSearch()); | ||||
if (propertiesToUse != 0) | |||||
if (propertiesToUse != nullptr) | |||||
path = propertiesToUse->getValue ("lastPluginScanPath_" + format->getName(), path.toString()); | path = propertiesToUse->getValue ("lastPluginScanPath_" + format->getName(), path.toString()); | ||||
{ | { | ||||
@@ -271,7 +271,7 @@ void PluginListComponent::scanFor (AudioPluginFormat* format) | |||||
path = pathList.getPath(); | path = pathList.getPath(); | ||||
} | } | ||||
if (propertiesToUse != 0) | |||||
if (propertiesToUse != nullptr) | |||||
{ | { | ||||
propertiesToUse->setValue ("lastPluginScanPath_" + format->getName(), path.toString()); | propertiesToUse->setValue ("lastPluginScanPath_" + format->getName(), path.toString()); | ||||
propertiesToUse->saveIfNeeded(); | propertiesToUse->saveIfNeeded(); | ||||