diff --git a/extras/audio plugin host/Source/FilterGraph.cpp b/extras/audio plugin host/Source/FilterGraph.cpp index 38817ccdb2..1c0772b5ac 100644 --- a/extras/audio plugin host/Source/FilterGraph.cpp +++ b/extras/audio plugin host/Source/FilterGraph.cpp @@ -243,31 +243,23 @@ const String FilterGraph::getDocumentTitle() const String FilterGraph::loadDocument (const File& file) { XmlDocument doc (file); - XmlElement* xml = doc.getDocumentElement(); + ScopedPointer xml (doc.getDocumentElement()); - if (xml == nullptr || ! xml->hasTagName (T("FILTERGRAPH"))) - { - delete xml; + if (xml == nullptr || ! xml->hasTagName ("FILTERGRAPH")) return "Not a valid filter graph file"; - } restoreFromXml (*xml); - delete xml; - return String::empty; } const String FilterGraph::saveDocument (const File& file) { - XmlElement* xml = createXml(); - - String error; + ScopedPointer xml (createXml()); if (! xml->writeToFile (file, String::empty)) - error = "Couldn't write to the file"; + return "Couldn't write to the file"; - delete xml; - return error; + return String::empty; } const File FilterGraph::getLastDocumentOpened() @@ -303,14 +295,13 @@ static XmlElement* createNodeXml (AudioProcessorGraph::Node* const node) noexcep } XmlElement* e = new XmlElement ("FILTER"); - e->setAttribute (T("uid"), (int) node->id); - e->setAttribute (T("x"), node->properties ["x"].toString()); - e->setAttribute (T("y"), node->properties ["y"].toString()); - e->setAttribute (T("uiLastX"), node->properties ["uiLastX"].toString()); - e->setAttribute (T("uiLastY"), node->properties ["uiLastY"].toString()); + e->setAttribute ("uid", (int) node->id); + e->setAttribute ("x", node->properties ["x"].toString()); + e->setAttribute ("y", node->properties ["y"].toString()); + e->setAttribute ("uiLastX", node->properties ["uiLastX"].toString()); + e->setAttribute ("uiLastY", node->properties ["uiLastY"].toString()); PluginDescription pd; - plugin->fillInPluginDescription (pd); e->addChildElement (pd.createXml()); @@ -348,9 +339,9 @@ void FilterGraph::createNodeFromXml (const XmlElement& xml) if (instance == nullptr) return; - AudioProcessorGraph::Node::Ptr node (graph.addNode (instance, xml.getIntAttribute (T("uid")))); + AudioProcessorGraph::Node::Ptr node (graph.addNode (instance, xml.getIntAttribute ("uid"))); - const XmlElement* const state = xml.getChildByName (T("STATE")); + const XmlElement* const state = xml.getChildByName ("STATE"); if (state != nullptr) { @@ -360,10 +351,10 @@ void FilterGraph::createNodeFromXml (const XmlElement& xml) node->getProcessor()->setStateInformation (m.getData(), (int) m.getSize()); } - node->properties.set ("x", xml.getDoubleAttribute (T("x"))); - node->properties.set ("y", xml.getDoubleAttribute (T("y"))); - node->properties.set ("uiLastX", xml.getIntAttribute (T("uiLastX"))); - node->properties.set ("uiLastY", xml.getIntAttribute (T("uiLastY"))); + node->properties.set ("x", xml.getDoubleAttribute ("x")); + node->properties.set ("y", xml.getDoubleAttribute ("y")); + node->properties.set ("uiLastX", xml.getIntAttribute ("uiLastX")); + node->properties.set ("uiLastY", xml.getIntAttribute ("uiLastY")); } XmlElement* FilterGraph::createXml() const @@ -382,10 +373,10 @@ XmlElement* FilterGraph::createXml() const XmlElement* e = new XmlElement ("CONNECTION"); - e->setAttribute (T("srcFilter"), (int) fc->sourceNodeId); - e->setAttribute (T("srcChannel"), fc->sourceChannelIndex); - e->setAttribute (T("dstFilter"), (int) fc->destNodeId); - e->setAttribute (T("dstChannel"), fc->destChannelIndex); + e->setAttribute ("srcFilter", (int) fc->sourceNodeId); + e->setAttribute ("srcChannel", fc->sourceChannelIndex); + e->setAttribute ("dstFilter", (int) fc->destNodeId); + e->setAttribute ("dstChannel", fc->destChannelIndex); xml->addChildElement (e); } @@ -397,18 +388,18 @@ void FilterGraph::restoreFromXml (const XmlElement& xml) { clear(); - forEachXmlChildElementWithTagName (xml, e, T("FILTER")) + forEachXmlChildElementWithTagName (xml, e, "FILTER") { createNodeFromXml (*e); changed(); } - forEachXmlChildElementWithTagName (xml, e, T("CONNECTION")) + forEachXmlChildElementWithTagName (xml, e, "CONNECTION") { - addConnection ((uint32) e->getIntAttribute (T("srcFilter")), - e->getIntAttribute (T("srcChannel")), - (uint32) e->getIntAttribute (T("dstFilter")), - e->getIntAttribute (T("dstChannel"))); + addConnection ((uint32) e->getIntAttribute ("srcFilter"), + e->getIntAttribute ("srcChannel"), + (uint32) e->getIntAttribute ("dstFilter"), + e->getIntAttribute ("dstChannel")); } graph.removeIllegalConnections(); diff --git a/extras/audio plugin host/Source/MainHostWindow.cpp b/extras/audio plugin host/Source/MainHostWindow.cpp index 52e78707a9..55d59726d1 100644 --- a/extras/audio plugin host/Source/MainHostWindow.cpp +++ b/extras/audio plugin host/Source/MainHostWindow.cpp @@ -415,7 +415,7 @@ bool MainHostWindow::perform (const InvocationInfo& info) { /* AboutBoxComponent aboutComp; - DialogWindow::showModalDialog (T("About"), + DialogWindow::showModalDialog ("About", &aboutComp, this, Colours::white, true, false, false); @@ -439,7 +439,7 @@ void MainHostWindow::showAudioSettings() audioSettingsComp.setSize (500, 450); - DialogWindow::showModalDialog (T("Audio Settings"), + DialogWindow::showModalDialog ("Audio Settings", &audioSettingsComp, this, Colours::azure, @@ -448,7 +448,7 @@ void MainHostWindow::showAudioSettings() XmlElement* const audioState = deviceManager.createStateXml(); ApplicationProperties::getInstance()->getUserSettings() - ->setValue (T("audioDeviceState"), audioState); + ->setValue ("audioDeviceState", audioState); delete audioState; diff --git a/extras/binarybuilder/Source/Main.cpp b/extras/binarybuilder/Source/Main.cpp index 08130408a3..5610d5fa35 100644 --- a/extras/binarybuilder/Source/Main.cpp +++ b/extras/binarybuilder/Source/Main.cpp @@ -24,7 +24,7 @@ static int addFile (const File& file, const String name (file.getFileName().toLowerCase() .replaceCharacter (' ', '_') .replaceCharacter ('.', '_') - .retainCharacters (T("abcdefghijklmnopqrstuvwxyz_0123456789"))); + .retainCharacters ("abcdefghijklmnopqrstuvwxyz_0123456789")); std::cout << "Adding " << name << ": " << (int) mb.getSize() << " bytes" << std::endl; @@ -60,9 +60,9 @@ static int addFile (const File& file, static bool isHiddenFile (const File& f, const File& root) { - return f.getFileName().endsWithIgnoreCase (T(".scc")) - || f.getFileName() == T(".svn") - || f.getFileName().startsWithChar (T('.')) + return f.getFileName().endsWithIgnoreCase (".scc") + || f.getFileName() == ".svn" + || f.getFileName().startsWithChar ('.') || (f.getSize() == 0 && ! f.isDirectory()) || (f.getParentDirectory() != root && isHiddenFile (f.getParentDirectory(), root)); } @@ -117,8 +117,8 @@ int main (int argc, char* argv[]) String className (argv[3]); className = className.trim(); - const File headerFile (destDirectory.getChildFile (className).withFileExtension (T(".h"))); - const File cppFile (destDirectory.getChildFile (className).withFileExtension (T(".cpp"))); + const File headerFile (destDirectory.getChildFile (className).withFileExtension (".h")); + const File cppFile (destDirectory.getChildFile (className).withFileExtension (".cpp")); std::cout << "Creating " << headerFile.getFullPathName() << " and " << cppFile.getFullPathName() diff --git a/src/core/juce_PlatformDefs.h b/src/core/juce_PlatformDefs.h index 50e3c122af..59bdb06769 100644 --- a/src/core/juce_PlatformDefs.h +++ b/src/core/juce_PlatformDefs.h @@ -273,6 +273,10 @@ #endif #endif +#if defined (_MSC_VER) && _MSC_VER >= 1600 + //#define JUCE_COMPILER_SUPPORTS_CXX2011 1 +#endif + #if ! (DOXYGEN || JUCE_COMPILER_SUPPORTS_CXX2011) #define noexcept throw() // for c++98 compilers, we can fake these newer language features. #define nullptr (0) diff --git a/src/memory/juce_WeakReference.h b/src/memory/juce_WeakReference.h index 5558633926..7f3687cf7e 100644 --- a/src/memory/juce_WeakReference.h +++ b/src/memory/juce_WeakReference.h @@ -98,7 +98,7 @@ public: WeakReference& operator= (const WeakReference& other) { holder = other.holder; return *this; } /** Copies another pointer to this one. */ - WeakReference& operator= (ObjectType* const newObject) { holder = newObject != nullptr ? newObject->getWeakReference() : nullptr; return *this; } + WeakReference& operator= (ObjectType* const newObject) { holder = (newObject != nullptr) ? newObject->getWeakReference() : nullptr; return *this; } /** Returns the object that this pointer refers to, or null if the object no longer exists. */ ObjectType* get() const noexcept { return holder != nullptr ? holder->get() : nullptr; } diff --git a/src/native/mac/juce_mac_SystemStats.mm b/src/native/mac/juce_mac_SystemStats.mm index 9e035fe853..7223285fc9 100644 --- a/src/native/mac/juce_mac_SystemStats.mm +++ b/src/native/mac/juce_mac_SystemStats.mm @@ -184,8 +184,11 @@ const String SystemStats::getFullUserName() const String SystemStats::getComputerName() { - return nsStringToJuce ([[NSProcessInfo processInfo] hostName]) - .upToLastOccurrenceOf (".local", false, true); + char name [256] = { 0 }; + if (gethostname (name, sizeof (name) - 1) == 0) + return String (name).upToLastOccurrenceOf (".local", false, true); + + return String::empty; } //==============================================================================