| @@ -163,9 +163,9 @@ public: | |||||
| //============================================================================== | //============================================================================== | ||||
| bool isValid() const { return node.isValid(); } | bool isValid() const { return node.isValid(); } | ||||
| const ValueTree& getNode() const throw() { return node; } | |||||
| ValueTree& getNode() throw() { return node; } | |||||
| Project& getProject() const throw() { return *project; } | |||||
| const ValueTree& getNode() const noexcept { return node; } | |||||
| ValueTree& getNode() noexcept { return node; } | |||||
| Project& getProject() const noexcept { return *project; } | |||||
| bool operator== (const Item& other) const { return node == other.node && project == other.project; } | bool operator== (const Item& other) const { return node == other.node && project == other.project; } | ||||
| bool operator!= (const Item& other) const { return ! operator== (other); } | bool operator!= (const Item& other) const { return ! operator== (other); } | ||||
| @@ -57,7 +57,7 @@ public: | |||||
| PropertyPanelWithTooltips(); | PropertyPanelWithTooltips(); | ||||
| ~PropertyPanelWithTooltips(); | ~PropertyPanelWithTooltips(); | ||||
| PropertyPanel& getPanel() throw() { return panel; } | |||||
| PropertyPanel& getPanel() noexcept { return panel; } | |||||
| void paint (Graphics& g); | void paint (Graphics& g); | ||||
| void resized(); | void resized(); | ||||
| @@ -111,6 +111,7 @@ private: | |||||
| << "Time and date: " << Time::getCurrentTime().toString (true, true) | << "Time and date: " << Time::getCurrentTime().toString (true, true) | ||||
| << "\nUser logon name: " << SystemStats::getLogonName() | << "\nUser logon name: " << SystemStats::getLogonName() | ||||
| << "\nFull user name: " << SystemStats::getFullUserName() | << "\nFull user name: " << SystemStats::getFullUserName() | ||||
| << "\nHost name: " << SystemStats::getComputerName() | |||||
| << "\nOperating system: " << SystemStats::getOperatingSystemName() | << "\nOperating system: " << SystemStats::getOperatingSystemName() | ||||
| << "\nCPU vendor: " << SystemStats::getCpuVendor() | << "\nCPU vendor: " << SystemStats::getCpuVendor() | ||||
| << "\nCPU speed: " << SystemStats::getCpuSpeedInMegaherz() << "MHz" | << "\nCPU speed: " << SystemStats::getCpuSpeedInMegaherz() << "MHz" | ||||
| @@ -78,42 +78,42 @@ FilterGraph::~FilterGraph() | |||||
| graph.clear(); | graph.clear(); | ||||
| } | } | ||||
| uint32 FilterGraph::getNextUID() throw() | |||||
| uint32 FilterGraph::getNextUID() noexcept | |||||
| { | { | ||||
| return ++lastUID; | return ++lastUID; | ||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| int FilterGraph::getNumFilters() const throw() | |||||
| int FilterGraph::getNumFilters() const noexcept | |||||
| { | { | ||||
| return graph.getNumNodes(); | return graph.getNumNodes(); | ||||
| } | } | ||||
| const AudioProcessorGraph::Node::Ptr FilterGraph::getNode (const int index) const throw() | |||||
| const AudioProcessorGraph::Node::Ptr FilterGraph::getNode (const int index) const noexcept | |||||
| { | { | ||||
| return graph.getNode (index); | return graph.getNode (index); | ||||
| } | } | ||||
| const AudioProcessorGraph::Node::Ptr FilterGraph::getNodeForId (const uint32 uid) const throw() | |||||
| const AudioProcessorGraph::Node::Ptr FilterGraph::getNodeForId (const uint32 uid) const noexcept | |||||
| { | { | ||||
| return graph.getNodeForId (uid); | return graph.getNodeForId (uid); | ||||
| } | } | ||||
| void FilterGraph::addFilter (const PluginDescription* desc, double x, double y) | void FilterGraph::addFilter (const PluginDescription* desc, double x, double y) | ||||
| { | { | ||||
| if (desc != 0) | |||||
| if (desc != nullptr) | |||||
| { | { | ||||
| String errorMessage; | String errorMessage; | ||||
| AudioPluginInstance* instance | AudioPluginInstance* instance | ||||
| = AudioPluginFormatManager::getInstance()->createPluginInstance (*desc, errorMessage); | = AudioPluginFormatManager::getInstance()->createPluginInstance (*desc, errorMessage); | ||||
| AudioProcessorGraph::Node* node = 0; | |||||
| AudioProcessorGraph::Node* node = nullptr; | |||||
| if (instance != 0) | |||||
| if (instance != nullptr) | |||||
| node = graph.addNode (instance); | node = graph.addNode (instance); | ||||
| if (node != 0) | |||||
| if (node != nullptr) | |||||
| { | { | ||||
| node->properties.set ("x", x); | node->properties.set ("x", x); | ||||
| node->properties.set ("y", y); | node->properties.set ("y", y); | ||||
| @@ -152,7 +152,7 @@ void FilterGraph::setNodePosition (const int nodeId, double x, double y) | |||||
| { | { | ||||
| const AudioProcessorGraph::Node::Ptr n (graph.getNodeForId (nodeId)); | const AudioProcessorGraph::Node::Ptr n (graph.getNodeForId (nodeId)); | ||||
| if (n != 0) | |||||
| if (n != nullptr) | |||||
| { | { | ||||
| n->properties.set ("x", jlimit (0.0, 1.0, x)); | n->properties.set ("x", jlimit (0.0, 1.0, x)); | ||||
| n->properties.set ("y", jlimit (0.0, 1.0, y)); | n->properties.set ("y", jlimit (0.0, 1.0, y)); | ||||
| @@ -165,7 +165,7 @@ void FilterGraph::getNodePosition (const int nodeId, double& x, double& y) const | |||||
| const AudioProcessorGraph::Node::Ptr n (graph.getNodeForId (nodeId)); | const AudioProcessorGraph::Node::Ptr n (graph.getNodeForId (nodeId)); | ||||
| if (n != 0) | |||||
| if (n != nullptr) | |||||
| { | { | ||||
| x = (double) n->properties ["x"]; | x = (double) n->properties ["x"]; | ||||
| y = (double) n->properties ["y"]; | y = (double) n->properties ["y"]; | ||||
| @@ -173,25 +173,25 @@ void FilterGraph::getNodePosition (const int nodeId, double& x, double& y) const | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| int FilterGraph::getNumConnections() const throw() | |||||
| int FilterGraph::getNumConnections() const noexcept | |||||
| { | { | ||||
| return graph.getNumConnections(); | return graph.getNumConnections(); | ||||
| } | } | ||||
| const AudioProcessorGraph::Connection* FilterGraph::getConnection (const int index) const throw() | |||||
| const AudioProcessorGraph::Connection* FilterGraph::getConnection (const int index) const noexcept | |||||
| { | { | ||||
| return graph.getConnection (index); | return graph.getConnection (index); | ||||
| } | } | ||||
| const AudioProcessorGraph::Connection* FilterGraph::getConnectionBetween (uint32 sourceFilterUID, int sourceFilterChannel, | const AudioProcessorGraph::Connection* FilterGraph::getConnectionBetween (uint32 sourceFilterUID, int sourceFilterChannel, | ||||
| uint32 destFilterUID, int destFilterChannel) const throw() | |||||
| uint32 destFilterUID, int destFilterChannel) const noexcept | |||||
| { | { | ||||
| return graph.getConnectionBetween (sourceFilterUID, sourceFilterChannel, | return graph.getConnectionBetween (sourceFilterUID, sourceFilterChannel, | ||||
| destFilterUID, destFilterChannel); | destFilterUID, destFilterChannel); | ||||
| } | } | ||||
| bool FilterGraph::canConnect (uint32 sourceFilterUID, int sourceFilterChannel, | bool FilterGraph::canConnect (uint32 sourceFilterUID, int sourceFilterChannel, | ||||
| uint32 destFilterUID, int destFilterChannel) const throw() | |||||
| uint32 destFilterUID, int destFilterChannel) const noexcept | |||||
| { | { | ||||
| return graph.canConnect (sourceFilterUID, sourceFilterChannel, | return graph.canConnect (sourceFilterUID, sourceFilterChannel, | ||||
| destFilterUID, destFilterChannel); | destFilterUID, destFilterChannel); | ||||
| @@ -245,7 +245,7 @@ const String FilterGraph::loadDocument (const File& file) | |||||
| XmlDocument doc (file); | XmlDocument doc (file); | ||||
| XmlElement* xml = doc.getDocumentElement(); | XmlElement* xml = doc.getDocumentElement(); | ||||
| if (xml == 0 || ! xml->hasTagName (T("FILTERGRAPH"))) | |||||
| if (xml == nullptr || ! xml->hasTagName (T("FILTERGRAPH"))) | |||||
| { | { | ||||
| delete xml; | delete xml; | ||||
| return "Not a valid filter graph file"; | return "Not a valid filter graph file"; | ||||
| @@ -292,14 +292,14 @@ void FilterGraph::setLastDocumentOpened (const File& file) | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| static XmlElement* createNodeXml (AudioProcessorGraph::Node* const node) throw() | |||||
| static XmlElement* createNodeXml (AudioProcessorGraph::Node* const node) noexcept | |||||
| { | { | ||||
| AudioPluginInstance* plugin = dynamic_cast <AudioPluginInstance*> (node->getProcessor()); | AudioPluginInstance* plugin = dynamic_cast <AudioPluginInstance*> (node->getProcessor()); | ||||
| if (plugin == 0) | |||||
| if (plugin == nullptr) | |||||
| { | { | ||||
| jassertfalse | jassertfalse | ||||
| return 0; | |||||
| return nullptr; | |||||
| } | } | ||||
| XmlElement* e = new XmlElement ("FILTER"); | XmlElement* e = new XmlElement ("FILTER"); | ||||
| @@ -340,19 +340,19 @@ void FilterGraph::createNodeFromXml (const XmlElement& xml) | |||||
| AudioPluginInstance* instance | AudioPluginInstance* instance | ||||
| = AudioPluginFormatManager::getInstance()->createPluginInstance (pd, errorMessage); | = AudioPluginFormatManager::getInstance()->createPluginInstance (pd, errorMessage); | ||||
| if (instance == 0) | |||||
| if (instance == nullptr) | |||||
| { | { | ||||
| // xxx handle ins + outs | // xxx handle ins + outs | ||||
| } | } | ||||
| if (instance == 0) | |||||
| if (instance == nullptr) | |||||
| return; | return; | ||||
| AudioProcessorGraph::Node::Ptr node (graph.addNode (instance, xml.getIntAttribute (T("uid")))); | AudioProcessorGraph::Node::Ptr node (graph.addNode (instance, xml.getIntAttribute (T("uid")))); | ||||
| const XmlElement* const state = xml.getChildByName (T("STATE")); | const XmlElement* const state = xml.getChildByName (T("STATE")); | ||||
| if (state != 0) | |||||
| if (state != nullptr) | |||||
| { | { | ||||
| MemoryBlock m; | MemoryBlock m; | ||||
| m.fromBase64Encoding (state->getAllSubText()); | m.fromBase64Encoding (state->getAllSubText()); | ||||
| @@ -71,11 +71,11 @@ public: | |||||
| ~FilterGraph(); | ~FilterGraph(); | ||||
| //============================================================================== | //============================================================================== | ||||
| AudioProcessorGraph& getGraph() throw() { return graph; } | |||||
| AudioProcessorGraph& getGraph() noexcept { return graph; } | |||||
| int getNumFilters() const throw(); | |||||
| const AudioProcessorGraph::Node::Ptr getNode (const int index) const throw(); | |||||
| const AudioProcessorGraph::Node::Ptr getNodeForId (const uint32 uid) const throw(); | |||||
| int getNumFilters() const noexcept; | |||||
| const AudioProcessorGraph::Node::Ptr getNode (const int index) const noexcept; | |||||
| const AudioProcessorGraph::Node::Ptr getNodeForId (const uint32 uid) const noexcept; | |||||
| void addFilter (const PluginDescription* desc, double x, double y); | void addFilter (const PluginDescription* desc, double x, double y); | ||||
| @@ -88,14 +88,14 @@ public: | |||||
| void getNodePosition (const int nodeId, double& x, double& y) const; | void getNodePosition (const int nodeId, double& x, double& y) const; | ||||
| //============================================================================== | //============================================================================== | ||||
| int getNumConnections() const throw(); | |||||
| const AudioProcessorGraph::Connection* getConnection (const int index) const throw(); | |||||
| int getNumConnections() const noexcept; | |||||
| const AudioProcessorGraph::Connection* getConnection (const int index) const noexcept; | |||||
| const AudioProcessorGraph::Connection* getConnectionBetween (uint32 sourceFilterUID, int sourceFilterChannel, | const AudioProcessorGraph::Connection* getConnectionBetween (uint32 sourceFilterUID, int sourceFilterChannel, | ||||
| uint32 destFilterUID, int destFilterChannel) const throw(); | |||||
| uint32 destFilterUID, int destFilterChannel) const noexcept; | |||||
| bool canConnect (uint32 sourceFilterUID, int sourceFilterChannel, | bool canConnect (uint32 sourceFilterUID, int sourceFilterChannel, | ||||
| uint32 destFilterUID, int destFilterChannel) const throw(); | |||||
| uint32 destFilterUID, int destFilterChannel) const noexcept; | |||||
| bool addConnection (uint32 sourceFilterUID, int sourceFilterChannel, | bool addConnection (uint32 sourceFilterUID, int sourceFilterChannel, | ||||
| uint32 destFilterUID, int destFilterChannel); | uint32 destFilterUID, int destFilterChannel); | ||||
| @@ -130,7 +130,7 @@ private: | |||||
| AudioProcessorPlayer player; | AudioProcessorPlayer player; | ||||
| uint32 lastUID; | uint32 lastUID; | ||||
| uint32 getNextUID() throw(); | |||||
| uint32 getNextUID() noexcept; | |||||
| void createNodeFromXml (const XmlElement& xml); | void createNodeFromXml (const XmlElement& xml); | ||||
| @@ -73,13 +73,13 @@ PluginWindow* PluginWindow::getWindowFor (AudioProcessorGraph::Node* node, | |||||
| && activePluginWindows.getUnchecked(i)->isGeneric == useGenericView) | && activePluginWindows.getUnchecked(i)->isGeneric == useGenericView) | ||||
| return activePluginWindows.getUnchecked(i); | return activePluginWindows.getUnchecked(i); | ||||
| AudioProcessorEditor* ui = 0; | |||||
| AudioProcessorEditor* ui = nullptr; | |||||
| if (! useGenericView) | if (! useGenericView) | ||||
| { | { | ||||
| ui = node->getProcessor()->createEditorIfNeeded(); | ui = node->getProcessor()->createEditorIfNeeded(); | ||||
| if (ui == 0) | |||||
| if (ui == nullptr) | |||||
| useGenericView = true; | useGenericView = true; | ||||
| } | } | ||||
| @@ -88,17 +88,17 @@ PluginWindow* PluginWindow::getWindowFor (AudioProcessorGraph::Node* node, | |||||
| ui = new GenericAudioProcessorEditor (node->getProcessor()); | ui = new GenericAudioProcessorEditor (node->getProcessor()); | ||||
| } | } | ||||
| if (ui != 0) | |||||
| if (ui != nullptr) | |||||
| { | { | ||||
| AudioPluginInstance* const plugin = dynamic_cast <AudioPluginInstance*> (node->getProcessor()); | AudioPluginInstance* const plugin = dynamic_cast <AudioPluginInstance*> (node->getProcessor()); | ||||
| if (plugin != 0) | |||||
| if (plugin != nullptr) | |||||
| ui->setName (plugin->getName()); | ui->setName (plugin->getName()); | ||||
| return new PluginWindow (ui, node, useGenericView); | return new PluginWindow (ui, node, useGenericView); | ||||
| } | } | ||||
| return 0; | |||||
| return nullptr; | |||||
| } | } | ||||
| PluginWindow::~PluginWindow() | PluginWindow::~PluginWindow() | ||||
| @@ -132,7 +132,7 @@ public: | |||||
| { | { | ||||
| const AudioProcessorGraph::Node::Ptr node (graph.getNodeForId (filterID_)); | const AudioProcessorGraph::Node::Ptr node (graph.getNodeForId (filterID_)); | ||||
| if (node != 0) | |||||
| if (node != nullptr) | |||||
| { | { | ||||
| String tip; | String tip; | ||||
| @@ -195,9 +195,9 @@ public: | |||||
| private: | private: | ||||
| FilterGraph& graph; | FilterGraph& graph; | ||||
| GraphEditorPanel* getGraphPanel() const throw() | |||||
| GraphEditorPanel* getGraphPanel() const noexcept | |||||
| { | { | ||||
| return findParentComponentOfClass ((GraphEditorPanel*) 0); | |||||
| return findParentComponentOfClass ((GraphEditorPanel*) nullptr); | |||||
| } | } | ||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PinComponent); | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PinComponent); | ||||
| @@ -259,11 +259,11 @@ public: | |||||
| { | { | ||||
| AudioProcessorGraph::Node::Ptr f (graph.getNodeForId (filterID)); | AudioProcessorGraph::Node::Ptr f (graph.getNodeForId (filterID)); | ||||
| if (f != 0) | |||||
| if (f != nullptr) | |||||
| { | { | ||||
| PluginWindow* const w = PluginWindow::getWindowFor (f, r == 4); | PluginWindow* const w = PluginWindow::getWindowFor (f, r == 4); | ||||
| if (w != 0) | |||||
| if (w != nullptr) | |||||
| w->toFront (true); | w->toFront (true); | ||||
| } | } | ||||
| } | } | ||||
| @@ -276,8 +276,8 @@ public: | |||||
| { | { | ||||
| Point<int> pos (originalPos + Point<int> (e.getDistanceFromDragStartX(), e.getDistanceFromDragStartY())); | Point<int> pos (originalPos + Point<int> (e.getDistanceFromDragStartX(), e.getDistanceFromDragStartY())); | ||||
| if (getParentComponent() != 0) | |||||
| pos = getParentComponent()->getLocalPoint (0, pos); | |||||
| if (getParentComponent() != nullptr) | |||||
| pos = getParentComponent()->getLocalPoint (nullptr, pos); | |||||
| graph.setNodePosition (filterID, | graph.setNodePosition (filterID, | ||||
| (pos.getX() + getWidth() / 2) / (double) getParentWidth(), | (pos.getX() + getWidth() / 2) / (double) getParentWidth(), | ||||
| @@ -293,11 +293,11 @@ public: | |||||
| { | { | ||||
| const AudioProcessorGraph::Node::Ptr f (graph.getNodeForId (filterID)); | const AudioProcessorGraph::Node::Ptr f (graph.getNodeForId (filterID)); | ||||
| if (f != 0) | |||||
| if (f != nullptr) | |||||
| { | { | ||||
| PluginWindow* const w = PluginWindow::getWindowFor (f, false); | PluginWindow* const w = PluginWindow::getWindowFor (f, false); | ||||
| if (w != 0) | |||||
| if (w != nullptr) | |||||
| w->toFront (true); | w->toFront (true); | ||||
| } | } | ||||
| } | } | ||||
| @@ -343,7 +343,7 @@ public: | |||||
| { | { | ||||
| PinComponent* const pc = dynamic_cast <PinComponent*> (getChildComponent(i)); | PinComponent* const pc = dynamic_cast <PinComponent*> (getChildComponent(i)); | ||||
| if (pc != 0) | |||||
| if (pc != nullptr) | |||||
| { | { | ||||
| const int total = pc->isInput ? numIns : numOuts; | const int total = pc->isInput ? numIns : numOuts; | ||||
| const int index = pc->index == FilterGraph::midiChannelNumber ? (total - 1) : pc->index; | const int index = pc->index == FilterGraph::midiChannelNumber ? (total - 1) : pc->index; | ||||
| @@ -361,7 +361,7 @@ public: | |||||
| { | { | ||||
| PinComponent* const pc = dynamic_cast <PinComponent*> (getChildComponent(i)); | PinComponent* const pc = dynamic_cast <PinComponent*> (getChildComponent(i)); | ||||
| if (pc != 0 && pc->index == index && isInput == pc->isInput) | |||||
| if (pc != nullptr && pc->index == index && isInput == pc->isInput) | |||||
| { | { | ||||
| x = getX() + pc->getX() + pc->getWidth() * 0.5f; | x = getX() + pc->getX() + pc->getWidth() * 0.5f; | ||||
| y = getY() + pc->getY() + pc->getHeight() * 0.5f; | y = getY() + pc->getY() + pc->getHeight() * 0.5f; | ||||
| @@ -374,7 +374,7 @@ public: | |||||
| { | { | ||||
| const AudioProcessorGraph::Node::Ptr f (graph.getNodeForId (filterID)); | const AudioProcessorGraph::Node::Ptr f (graph.getNodeForId (filterID)); | ||||
| if (f == 0) | |||||
| if (f == nullptr) | |||||
| { | { | ||||
| delete this; | delete this; | ||||
| return; | return; | ||||
| @@ -443,9 +443,9 @@ private: | |||||
| int numIns, numOuts; | int numIns, numOuts; | ||||
| DropShadowEffect shadow; | DropShadowEffect shadow; | ||||
| GraphEditorPanel* getGraphPanel() const throw() | |||||
| GraphEditorPanel* getGraphPanel() const noexcept | |||||
| { | { | ||||
| return findParentComponentOfClass ((GraphEditorPanel*) 0); | |||||
| return findParentComponentOfClass ((GraphEditorPanel*) nullptr); | |||||
| } | } | ||||
| FilterComponent (const FilterComponent&); | FilterComponent (const FilterComponent&); | ||||
| @@ -550,16 +550,16 @@ public: | |||||
| GraphEditorPanel* const hostPanel = getGraphPanel(); | GraphEditorPanel* const hostPanel = getGraphPanel(); | ||||
| if (hostPanel != 0) | |||||
| if (hostPanel != nullptr) | |||||
| { | { | ||||
| FilterComponent* srcFilterComp = hostPanel->getComponentForFilter (sourceFilterID); | FilterComponent* srcFilterComp = hostPanel->getComponentForFilter (sourceFilterID); | ||||
| if (srcFilterComp != 0) | |||||
| if (srcFilterComp != nullptr) | |||||
| srcFilterComp->getPinPos (sourceFilterChannel, false, x1, y1); | srcFilterComp->getPinPos (sourceFilterChannel, false, x1, y1); | ||||
| FilterComponent* dstFilterComp = hostPanel->getComponentForFilter (destFilterID); | FilterComponent* dstFilterComp = hostPanel->getComponentForFilter (destFilterID); | ||||
| if (dstFilterComp != 0) | |||||
| if (dstFilterComp != nullptr) | |||||
| dstFilterComp->getPinPos (destFilterChannel, true, x2, y2); | dstFilterComp->getPinPos (destFilterChannel, true, x2, y2); | ||||
| } | } | ||||
| } | } | ||||
| @@ -681,9 +681,9 @@ private: | |||||
| Path linePath, hitPath; | Path linePath, hitPath; | ||||
| bool dragging; | bool dragging; | ||||
| GraphEditorPanel* getGraphPanel() const throw() | |||||
| GraphEditorPanel* getGraphPanel() const noexcept | |||||
| { | { | ||||
| return findParentComponentOfClass ((GraphEditorPanel*) 0); | |||||
| return findParentComponentOfClass ((GraphEditorPanel*) nullptr); | |||||
| } | } | ||||
| void getDistancesFromEnds (int x, int y, double& distanceFromStart, double& distanceFromEnd) const | void getDistancesFromEnds (int x, int y, double& distanceFromStart, double& distanceFromEnd) const | ||||
| @@ -702,7 +702,7 @@ private: | |||||
| //============================================================================== | //============================================================================== | ||||
| GraphEditorPanel::GraphEditorPanel (FilterGraph& graph_) | GraphEditorPanel::GraphEditorPanel (FilterGraph& graph_) | ||||
| : graph (graph_), | : graph (graph_), | ||||
| draggingConnector (0) | |||||
| draggingConnector (nullptr) | |||||
| { | { | ||||
| graph.addChangeListener (this); | graph.addChangeListener (this); | ||||
| setOpaque (true); | setOpaque (true); | ||||
| @@ -726,9 +726,9 @@ void GraphEditorPanel::mouseDown (const MouseEvent& e) | |||||
| { | { | ||||
| PopupMenu m; | PopupMenu m; | ||||
| MainHostWindow* const mainWindow = findParentComponentOfClass ((MainHostWindow*) 0); | |||||
| MainHostWindow* const mainWindow = findParentComponentOfClass ((MainHostWindow*) nullptr); | |||||
| if (mainWindow != 0) | |||||
| if (mainWindow != nullptr) | |||||
| { | { | ||||
| mainWindow->addPluginsToMenu (m); | mainWindow->addPluginsToMenu (m); | ||||
| @@ -750,11 +750,11 @@ FilterComponent* GraphEditorPanel::getComponentForFilter (const uint32 filterID) | |||||
| { | { | ||||
| FilterComponent* const fc = dynamic_cast <FilterComponent*> (getChildComponent (i)); | FilterComponent* const fc = dynamic_cast <FilterComponent*> (getChildComponent (i)); | ||||
| if (fc != 0 && fc->filterID == filterID) | |||||
| if (fc != nullptr && fc->filterID == filterID) | |||||
| return fc; | return fc; | ||||
| } | } | ||||
| return 0; | |||||
| return nullptr; | |||||
| } | } | ||||
| ConnectorComponent* GraphEditorPanel::getComponentForConnection (const AudioProcessorGraph::Connection& conn) const | ConnectorComponent* GraphEditorPanel::getComponentForConnection (const AudioProcessorGraph::Connection& conn) const | ||||
| @@ -763,7 +763,7 @@ ConnectorComponent* GraphEditorPanel::getComponentForConnection (const AudioProc | |||||
| { | { | ||||
| ConnectorComponent* const c = dynamic_cast <ConnectorComponent*> (getChildComponent (i)); | ConnectorComponent* const c = dynamic_cast <ConnectorComponent*> (getChildComponent (i)); | ||||
| if (c != 0 | |||||
| if (c != nullptr | |||||
| && c->sourceFilterID == conn.sourceNodeId | && c->sourceFilterID == conn.sourceNodeId | ||||
| && c->destFilterID == conn.destNodeId | && c->destFilterID == conn.destNodeId | ||||
| && c->sourceFilterChannel == conn.sourceChannelIndex | && c->sourceFilterChannel == conn.sourceChannelIndex | ||||
| @@ -773,7 +773,7 @@ ConnectorComponent* GraphEditorPanel::getComponentForConnection (const AudioProc | |||||
| } | } | ||||
| } | } | ||||
| return 0; | |||||
| return nullptr; | |||||
| } | } | ||||
| PinComponent* GraphEditorPanel::findPinAt (const int x, const int y) const | PinComponent* GraphEditorPanel::findPinAt (const int x, const int y) const | ||||
| @@ -782,18 +782,18 @@ PinComponent* GraphEditorPanel::findPinAt (const int x, const int y) const | |||||
| { | { | ||||
| FilterComponent* const fc = dynamic_cast <FilterComponent*> (getChildComponent (i)); | FilterComponent* const fc = dynamic_cast <FilterComponent*> (getChildComponent (i)); | ||||
| if (fc != 0) | |||||
| if (fc != nullptr) | |||||
| { | { | ||||
| PinComponent* const pin | PinComponent* const pin | ||||
| = dynamic_cast <PinComponent*> (fc->getComponentAt (x - fc->getX(), | = dynamic_cast <PinComponent*> (fc->getComponentAt (x - fc->getX(), | ||||
| y - fc->getY())); | y - fc->getY())); | ||||
| if (pin != 0) | |||||
| if (pin != nullptr) | |||||
| return pin; | return pin; | ||||
| } | } | ||||
| } | } | ||||
| return 0; | |||||
| return nullptr; | |||||
| } | } | ||||
| void GraphEditorPanel::resized() | void GraphEditorPanel::resized() | ||||
| @@ -813,7 +813,7 @@ void GraphEditorPanel::updateComponents() | |||||
| { | { | ||||
| FilterComponent* const fc = dynamic_cast <FilterComponent*> (getChildComponent (i)); | FilterComponent* const fc = dynamic_cast <FilterComponent*> (getChildComponent (i)); | ||||
| if (fc != 0) | |||||
| if (fc != nullptr) | |||||
| fc->update(); | fc->update(); | ||||
| } | } | ||||
| @@ -821,10 +821,10 @@ void GraphEditorPanel::updateComponents() | |||||
| { | { | ||||
| ConnectorComponent* const cc = dynamic_cast <ConnectorComponent*> (getChildComponent (i)); | ConnectorComponent* const cc = dynamic_cast <ConnectorComponent*> (getChildComponent (i)); | ||||
| if (cc != 0 && cc != draggingConnector) | |||||
| if (cc != nullptr && cc != draggingConnector) | |||||
| { | { | ||||
| if (graph.getConnectionBetween (cc->sourceFilterID, cc->sourceFilterChannel, | if (graph.getConnectionBetween (cc->sourceFilterID, cc->sourceFilterChannel, | ||||
| cc->destFilterID, cc->destFilterChannel) == 0) | |||||
| cc->destFilterID, cc->destFilterChannel) == nullptr) | |||||
| { | { | ||||
| delete cc; | delete cc; | ||||
| } | } | ||||
| @@ -869,7 +869,7 @@ void GraphEditorPanel::beginConnectorDrag (const uint32 sourceFilterID, const in | |||||
| delete draggingConnector; | delete draggingConnector; | ||||
| draggingConnector = dynamic_cast <ConnectorComponent*> (e.originalComponent); | draggingConnector = dynamic_cast <ConnectorComponent*> (e.originalComponent); | ||||
| if (draggingConnector == 0) | |||||
| if (draggingConnector == nullptr) | |||||
| draggingConnector = new ConnectorComponent (graph); | draggingConnector = new ConnectorComponent (graph); | ||||
| draggingConnector->setInput (sourceFilterID, sourceFilterChannel); | draggingConnector->setInput (sourceFilterID, sourceFilterChannel); | ||||
| @@ -885,7 +885,7 @@ void GraphEditorPanel::dragConnector (const MouseEvent& e) | |||||
| { | { | ||||
| const MouseEvent e2 (e.getEventRelativeTo (this)); | const MouseEvent e2 (e.getEventRelativeTo (this)); | ||||
| if (draggingConnector != 0) | |||||
| if (draggingConnector != nullptr) | |||||
| { | { | ||||
| draggingConnector->setTooltip (String::empty); | draggingConnector->setTooltip (String::empty); | ||||
| @@ -894,7 +894,7 @@ void GraphEditorPanel::dragConnector (const MouseEvent& e) | |||||
| PinComponent* const pin = findPinAt (x, y); | PinComponent* const pin = findPinAt (x, y); | ||||
| if (pin != 0) | |||||
| if (pin != nullptr) | |||||
| { | { | ||||
| uint32 srcFilter = draggingConnector->sourceFilterID; | uint32 srcFilter = draggingConnector->sourceFilterID; | ||||
| int srcChannel = draggingConnector->sourceFilterChannel; | int srcChannel = draggingConnector->sourceFilterChannel; | ||||
| @@ -930,7 +930,7 @@ void GraphEditorPanel::dragConnector (const MouseEvent& e) | |||||
| void GraphEditorPanel::endDraggingConnector (const MouseEvent& e) | void GraphEditorPanel::endDraggingConnector (const MouseEvent& e) | ||||
| { | { | ||||
| if (draggingConnector == 0) | |||||
| if (draggingConnector == nullptr) | |||||
| return; | return; | ||||
| draggingConnector->setTooltip (String::empty); | draggingConnector->setTooltip (String::empty); | ||||
| @@ -946,7 +946,7 @@ void GraphEditorPanel::endDraggingConnector (const MouseEvent& e) | |||||
| PinComponent* const pin = findPinAt (e2.x, e2.y); | PinComponent* const pin = findPinAt (e2.x, e2.y); | ||||
| if (pin != 0) | |||||
| if (pin != nullptr) | |||||
| { | { | ||||
| if (srcFilter == 0) | if (srcFilter == 0) | ||||
| { | { | ||||
| @@ -994,7 +994,7 @@ public: | |||||
| String newTip; | String newTip; | ||||
| if (ttc != 0 && ! (underMouse->isMouseButtonDown() || underMouse->isCurrentlyBlockedByAnotherModalComponent())) | |||||
| if (ttc != nullptr && ! (underMouse->isMouseButtonDown() || underMouse->isCurrentlyBlockedByAnotherModalComponent())) | |||||
| newTip = ttc->getTooltip(); | newTip = ttc->getTooltip(); | ||||
| if (newTip != tip) | if (newTip != tip) | ||||
| @@ -1038,7 +1038,7 @@ GraphDocumentComponent::~GraphDocumentComponent() | |||||
| deleteAllChildren(); | deleteAllChildren(); | ||||
| graphPlayer.setProcessor (0); | |||||
| graphPlayer.setProcessor (nullptr); | |||||
| keyState.removeListener (&graphPlayer.getMidiMessageCollector()); | keyState.removeListener (&graphPlayer.getMidiMessageCollector()); | ||||
| graph.clear(); | graph.clear(); | ||||
| @@ -148,7 +148,7 @@ public: | |||||
| private: | private: | ||||
| StringPool identifierPool; | StringPool identifierPool; | ||||
| static DISPID getHashFromString (const String::CharPointerType& s) throw() | |||||
| static DISPID getHashFromString (const String::CharPointerType& s) noexcept | |||||
| { | { | ||||
| return (DISPID) (pointer_sized_int) s.getAddress(); | return (DISPID) (pointer_sized_int) s.getAddress(); | ||||
| } | } | ||||
| @@ -539,7 +539,7 @@ public: | |||||
| }; | }; | ||||
| //============================================================================== | //============================================================================== | ||||
| static NPIdentifier getIdentifierFromString (const var::identifier& s) throw() | |||||
| static NPIdentifier getIdentifierFromString (const var::identifier& s) noexcept | |||||
| { | { | ||||
| return browser.getstringidentifier (s.toString().toUTF8()); | return browser.getstringidentifier (s.toString().toUTF8()); | ||||
| } | } | ||||
| @@ -22716,6 +22716,7 @@ const StringPairArray WavAudioFormat::createBWAVMetadata (const String& descript | |||||
| namespace WavFileHelpers | namespace WavFileHelpers | ||||
| { | { | ||||
| inline int chunkName (const char* const name) noexcept { return (int) ByteOrder::littleEndianInt (name); } | |||||
| #if JUCE_MSVC | #if JUCE_MSVC | ||||
| #pragma pack (push, 1) | #pragma pack (push, 1) | ||||
| @@ -22854,7 +22855,7 @@ struct SMPLChunk | |||||
| MemoryBlock data ((sizeNeeded + 3) & ~3); | MemoryBlock data ((sizeNeeded + 3) & ~3); | ||||
| data.fillWith (0); | data.fillWith (0); | ||||
| SMPLChunk* s = (SMPLChunk*) data.getData(); | |||||
| SMPLChunk* const s = static_cast <SMPLChunk*> (data.getData()); | |||||
| // Allow these calls to overwrite an extra byte at the end, which is fine as long | // Allow these calls to overwrite an extra byte at the end, which is fine as long | ||||
| // as they get called in the right order.. | // as they get called in the right order.. | ||||
| @@ -22883,6 +22884,73 @@ struct SMPLChunk | |||||
| } | } | ||||
| } PACKED; | } PACKED; | ||||
| struct CueChunk | |||||
| { | |||||
| struct Cue | |||||
| { | |||||
| uint32 identifier; | |||||
| uint32 order; | |||||
| uint32 chunkID; | |||||
| uint32 chunkStart; | |||||
| uint32 blockStart; | |||||
| uint32 offset; | |||||
| } PACKED; | |||||
| uint32 numCues; | |||||
| Cue cues[1]; | |||||
| void copyTo (StringPairArray& values, const int totalSize) const | |||||
| { | |||||
| values.set ("NumCuePoints", String (ByteOrder::swapIfBigEndian (numCues))); | |||||
| for (uint32 i = 0; i < numCues; ++i) | |||||
| { | |||||
| if ((uint8*) (cues + (i + 1)) > ((uint8*) this) + totalSize) | |||||
| break; | |||||
| const String prefix ("Cue" + String(i)); | |||||
| values.set (prefix + "Identifier", String (ByteOrder::swapIfBigEndian (cues[i].identifier))); | |||||
| values.set (prefix + "Order", String (ByteOrder::swapIfBigEndian (cues[i].order))); | |||||
| values.set (prefix + "ChunkID", String (ByteOrder::swapIfBigEndian (cues[i].chunkID))); | |||||
| values.set (prefix + "ChunkStart", String (ByteOrder::swapIfBigEndian (cues[i].chunkStart))); | |||||
| values.set (prefix + "BlockStart", String (ByteOrder::swapIfBigEndian (cues[i].blockStart))); | |||||
| values.set (prefix + "Offset", String (ByteOrder::swapIfBigEndian (cues[i].offset))); | |||||
| } | |||||
| } | |||||
| static MemoryBlock createFrom (const StringPairArray& values) | |||||
| { | |||||
| const int numCues = values.getValue ("NumCuePoints", "0").getIntValue(); | |||||
| if (numCues <= 0) | |||||
| return MemoryBlock(); | |||||
| const size_t sizeNeeded = sizeof (CueChunk) + (numCues - 1) * sizeof (Cue); | |||||
| MemoryBlock data ((sizeNeeded + 3) & ~3); | |||||
| data.fillWith (0); | |||||
| CueChunk* const c = static_cast <CueChunk*> (data.getData()); | |||||
| c->numCues = ByteOrder::swapIfBigEndian ((uint32) numCues); | |||||
| const String dataChunkID (chunkName ("data")); | |||||
| for (int i = 0; i < numCues; ++i) | |||||
| { | |||||
| const String prefix ("Cue" + String(i)); | |||||
| c->cues[i].identifier = ByteOrder::swapIfBigEndian ((uint32) values.getValue (prefix + "Identifier", "0").getIntValue()); | |||||
| c->cues[i].order = ByteOrder::swapIfBigEndian ((uint32) values.getValue (prefix + "Order", "0").getIntValue()); | |||||
| c->cues[i].chunkID = ByteOrder::swapIfBigEndian ((uint32) values.getValue (prefix + "ChunkID", dataChunkID).getIntValue()); | |||||
| c->cues[i].chunkStart = ByteOrder::swapIfBigEndian ((uint32) values.getValue (prefix + "ChunkStart", "0").getIntValue()); | |||||
| c->cues[i].blockStart = ByteOrder::swapIfBigEndian ((uint32) values.getValue (prefix + "BlockStart", "0").getIntValue()); | |||||
| c->cues[i].offset = ByteOrder::swapIfBigEndian ((uint32) values.getValue (prefix + "Offset", "0").getIntValue()); | |||||
| } | |||||
| return data; | |||||
| } | |||||
| } PACKED; | |||||
| struct ExtensibleWavSubFormat | struct ExtensibleWavSubFormat | ||||
| { | { | ||||
| uint32 data1; | uint32 data1; | ||||
| @@ -22907,8 +22975,6 @@ struct DataSize64Chunk // chunk ID = 'ds64' if data size > 0xffffffff, 'JUNK' | |||||
| #endif | #endif | ||||
| #undef PACKED | #undef PACKED | ||||
| inline int chunkName (const char* const name) { return (int) ByteOrder::littleEndianInt (name); } | |||||
| } | } | ||||
| class WavAudioFormatReader : public AudioFormatReader | class WavAudioFormatReader : public AudioFormatReader | ||||
| @@ -23026,7 +23092,6 @@ public: | |||||
| } | } | ||||
| else if (chunkType == chunkName ("data")) | else if (chunkType == chunkName ("data")) | ||||
| { | { | ||||
| // get the data chunk's position | |||||
| if (! isRF64) // data size is expected to be -1, actual data size is in ds64 chunk | if (! isRF64) // data size is expected to be -1, actual data size is in ds64 chunk | ||||
| dataLength = length; | dataLength = length; | ||||
| @@ -23040,7 +23105,6 @@ public: | |||||
| bwavChunkStart = input->getPosition(); | bwavChunkStart = input->getPosition(); | ||||
| bwavSize = length; | bwavSize = length; | ||||
| // Broadcast-wav extension chunk.. | |||||
| HeapBlock <BWAVChunk> bwav; | HeapBlock <BWAVChunk> bwav; | ||||
| bwav.calloc (jmax ((size_t) length + 1, sizeof (BWAVChunk)), 1); | bwav.calloc (jmax ((size_t) length + 1, sizeof (BWAVChunk)), 1); | ||||
| input->read (bwav, length); | input->read (bwav, length); | ||||
| @@ -23053,6 +23117,13 @@ public: | |||||
| input->read (smpl, length); | input->read (smpl, length); | ||||
| smpl->copyTo (metadataValues, length); | smpl->copyTo (metadataValues, length); | ||||
| } | } | ||||
| else if (chunkType == chunkName ("cue ")) | |||||
| { | |||||
| HeapBlock <CueChunk> cue; | |||||
| cue.calloc (jmax ((size_t) length + 1, sizeof (CueChunk)), 1); | |||||
| input->read (cue, length); | |||||
| cue->copyTo (metadataValues, length); | |||||
| } | |||||
| else if (chunkEnd <= input->getPosition()) | else if (chunkEnd <= input->getPosition()) | ||||
| { | { | ||||
| break; | break; | ||||
| @@ -23143,6 +23214,7 @@ public: | |||||
| { | { | ||||
| bwavChunk = BWAVChunk::createFrom (metadataValues); | bwavChunk = BWAVChunk::createFrom (metadataValues); | ||||
| smplChunk = SMPLChunk::createFrom (metadataValues); | smplChunk = SMPLChunk::createFrom (metadataValues); | ||||
| cueChunk = CueChunk ::createFrom (metadataValues); | |||||
| } | } | ||||
| headerPosition = out->getPosition(); | headerPosition = out->getPosition(); | ||||
| @@ -23199,7 +23271,7 @@ public: | |||||
| private: | private: | ||||
| ScopedPointer<AudioData::Converter> converter; | ScopedPointer<AudioData::Converter> converter; | ||||
| MemoryBlock tempBlock, bwavChunk, smplChunk; | |||||
| MemoryBlock tempBlock, bwavChunk, smplChunk, cueChunk; | |||||
| uint64 lengthInSamples, bytesWritten; | uint64 lengthInSamples, bytesWritten; | ||||
| int64 headerPosition; | int64 headerPosition; | ||||
| bool writeFailed; | bool writeFailed; | ||||
| @@ -23238,6 +23310,7 @@ private: | |||||
| + 8 + audioDataSize + (audioDataSize & 1) | + 8 + audioDataSize + (audioDataSize & 1) | ||||
| + (bwavChunk.getSize() > 0 ? (8 + bwavChunk.getSize()) : 0) | + (bwavChunk.getSize() > 0 ? (8 + bwavChunk.getSize()) : 0) | ||||
| + (smplChunk.getSize() > 0 ? (8 + smplChunk.getSize()) : 0) | + (smplChunk.getSize() > 0 ? (8 + smplChunk.getSize()) : 0) | ||||
| + (cueChunk .getSize() > 0 ? (8 + cueChunk .getSize()) : 0) | |||||
| + (8 + 28); // (ds64 chunk) | + (8 + 28); // (ds64 chunk) | ||||
| riffChunkSize += (riffChunkSize & 0x1); | riffChunkSize += (riffChunkSize & 0x1); | ||||
| @@ -23316,6 +23389,13 @@ private: | |||||
| output->write (smplChunk.getData(), (int) smplChunk.getSize()); | output->write (smplChunk.getData(), (int) smplChunk.getSize()); | ||||
| } | } | ||||
| if (cueChunk.getSize() > 0) | |||||
| { | |||||
| output->writeInt (chunkName ("cue ")); | |||||
| output->writeInt ((int) cueChunk.getSize()); | |||||
| output->write (cueChunk.getData(), (int) cueChunk.getSize()); | |||||
| } | |||||
| output->writeInt (chunkName ("data")); | output->writeInt (chunkName ("data")); | ||||
| output->writeInt (isRF64 ? -1 : (int) (lengthInSamples * bytesPerFrame)); | output->writeInt (isRF64 ? -1 : (int) (lengthInSamples * bytesPerFrame)); | ||||
| @@ -242212,16 +242292,17 @@ static void juce_getCpuVendor (char* const v) | |||||
| { | { | ||||
| int vendor[4] = { 0 }; | int vendor[4] = { 0 }; | ||||
| #ifdef JUCE_64BIT | |||||
| #else | |||||
| #if JUCE_64BIT | |||||
| /// xxx todo | |||||
| #else | |||||
| #ifndef __MINGW32__ | #ifndef __MINGW32__ | ||||
| __try | __try | ||||
| #endif | #endif | ||||
| { | { | ||||
| #if JUCE_GCC | |||||
| #if JUCE_GCC | |||||
| unsigned int dummy = 0; | unsigned int dummy = 0; | ||||
| __asm__ ("cpuid" : "=a" (dummy), "=b" (vendor[0]), "=c" (vendor[2]),"=d" (vendor[1]) : "a" (0)); | __asm__ ("cpuid" : "=a" (dummy), "=b" (vendor[0]), "=c" (vendor[2]),"=d" (vendor[1]) : "a" (0)); | ||||
| #else | |||||
| #else | |||||
| __asm | __asm | ||||
| { | { | ||||
| mov eax, 0 | mov eax, 0 | ||||
| @@ -242230,15 +242311,15 @@ static void juce_getCpuVendor (char* const v) | |||||
| mov [vendor + 4], edx | mov [vendor + 4], edx | ||||
| mov [vendor + 8], ecx | mov [vendor + 8], ecx | ||||
| } | } | ||||
| #endif | |||||
| #endif | |||||
| } | } | ||||
| #ifndef __MINGW32__ | |||||
| #ifndef __MINGW32__ | |||||
| __except (EXCEPTION_EXECUTE_HANDLER) | __except (EXCEPTION_EXECUTE_HANDLER) | ||||
| { | { | ||||
| *v = 0; | *v = 0; | ||||
| } | } | ||||
| #endif | |||||
| #endif | |||||
| #endif | |||||
| #endif | |||||
| memcpy (v, vendor, 16); | memcpy (v, vendor, 16); | ||||
| } | } | ||||
| @@ -242256,11 +242337,11 @@ void SystemStats::initialiseStats() | |||||
| cpuFlags.hasMMX = IsProcessorFeaturePresent (PF_MMX_INSTRUCTIONS_AVAILABLE) != 0; | cpuFlags.hasMMX = IsProcessorFeaturePresent (PF_MMX_INSTRUCTIONS_AVAILABLE) != 0; | ||||
| cpuFlags.hasSSE = IsProcessorFeaturePresent (PF_XMMI_INSTRUCTIONS_AVAILABLE) != 0; | cpuFlags.hasSSE = IsProcessorFeaturePresent (PF_XMMI_INSTRUCTIONS_AVAILABLE) != 0; | ||||
| cpuFlags.hasSSE2 = IsProcessorFeaturePresent (PF_XMMI64_INSTRUCTIONS_AVAILABLE) != 0; | cpuFlags.hasSSE2 = IsProcessorFeaturePresent (PF_XMMI64_INSTRUCTIONS_AVAILABLE) != 0; | ||||
| #ifdef PF_AMD3D_INSTRUCTIONS_AVAILABLE | |||||
| #ifdef PF_AMD3D_INSTRUCTIONS_AVAILABLE | |||||
| cpuFlags.has3DNow = IsProcessorFeaturePresent (PF_AMD3D_INSTRUCTIONS_AVAILABLE) != 0; | cpuFlags.has3DNow = IsProcessorFeaturePresent (PF_AMD3D_INSTRUCTIONS_AVAILABLE) != 0; | ||||
| #else | |||||
| #else | |||||
| cpuFlags.has3DNow = IsProcessorFeaturePresent (PF_3DNOW_INSTRUCTIONS_AVAILABLE) != 0; | cpuFlags.has3DNow = IsProcessorFeaturePresent (PF_3DNOW_INSTRUCTIONS_AVAILABLE) != 0; | ||||
| #endif | |||||
| #endif | |||||
| { | { | ||||
| SYSTEM_INFO systemInfo; | SYSTEM_INFO systemInfo; | ||||
| @@ -242279,9 +242360,9 @@ void SystemStats::initialiseStats() | |||||
| (void) res; | (void) res; | ||||
| jassert (res == TIMERR_NOERROR); | jassert (res == TIMERR_NOERROR); | ||||
| #if JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS | |||||
| #if JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS | |||||
| _CrtSetDbgFlag (_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); | _CrtSetDbgFlag (_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); | ||||
| #endif | |||||
| #endif | |||||
| } | } | ||||
| SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() | SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() | ||||
| @@ -242327,9 +242408,9 @@ const String SystemStats::getOperatingSystemName() | |||||
| bool SystemStats::isOperatingSystem64Bit() | bool SystemStats::isOperatingSystem64Bit() | ||||
| { | { | ||||
| #ifdef _WIN64 | |||||
| #ifdef _WIN64 | |||||
| return true; | return true; | ||||
| #else | |||||
| #else | |||||
| typedef BOOL (WINAPI* LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); | typedef BOOL (WINAPI* LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); | ||||
| LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress (GetModuleHandle (L"kernel32"), "IsWow64Process"); | LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress (GetModuleHandle (L"kernel32"), "IsWow64Process"); | ||||
| @@ -242339,7 +242420,7 @@ bool SystemStats::isOperatingSystem64Bit() | |||||
| return (fnIsWow64Process != 0) | return (fnIsWow64Process != 0) | ||||
| && fnIsWow64Process (GetCurrentProcess(), &isWow64) | && fnIsWow64Process (GetCurrentProcess(), &isWow64) | ||||
| && (isWow64 != FALSE); | && (isWow64 != FALSE); | ||||
| #endif | |||||
| #endif | |||||
| } | } | ||||
| int SystemStats::getMemorySizeInMegabytes() | int SystemStats::getMemorySizeInMegabytes() | ||||
| @@ -242386,11 +242467,11 @@ int64 Time::getHighResolutionTicksPerSecond() noexcept | |||||
| static int64 juce_getClockCycleCounter() noexcept | static int64 juce_getClockCycleCounter() noexcept | ||||
| { | { | ||||
| #if JUCE_USE_INTRINSICS | |||||
| #if JUCE_USE_INTRINSICS | |||||
| // MS intrinsics version... | // MS intrinsics version... | ||||
| return __rdtsc(); | return __rdtsc(); | ||||
| #elif JUCE_GCC | |||||
| #elif JUCE_GCC | |||||
| // GNU inline asm version... | // GNU inline asm version... | ||||
| unsigned int hi = 0, lo = 0; | unsigned int hi = 0, lo = 0; | ||||
| @@ -242406,7 +242487,7 @@ static int64 juce_getClockCycleCounter() noexcept | |||||
| : "cc", "eax", "ebx", "ecx", "edx", "memory"); | : "cc", "eax", "ebx", "ecx", "edx", "memory"); | ||||
| return (int64) ((((uint64) hi) << 32) | lo); | return (int64) ((((uint64) hi) << 32) | lo); | ||||
| #else | |||||
| #else | |||||
| // MSVC inline asm version... | // MSVC inline asm version... | ||||
| unsigned int hi = 0, lo = 0; | unsigned int hi = 0, lo = 0; | ||||
| @@ -242420,7 +242501,7 @@ static int64 juce_getClockCycleCounter() noexcept | |||||
| } | } | ||||
| return (int64) ((((uint64) hi) << 32) | lo); | return (int64) ((((uint64) hi) << 32) | lo); | ||||
| #endif | |||||
| #endif | |||||
| } | } | ||||
| int SystemStats::getCpuSpeedInMegaherz() | int SystemStats::getCpuSpeedInMegaherz() | ||||
| @@ -242479,7 +242560,7 @@ int SystemStats::getPageSize() | |||||
| const String SystemStats::getLogonName() | const String SystemStats::getLogonName() | ||||
| { | { | ||||
| TCHAR text [256] = { 0 }; | TCHAR text [256] = { 0 }; | ||||
| DWORD len = numElementsInArray (text) - 2; | |||||
| DWORD len = numElementsInArray (text) - 1; | |||||
| GetUserName (text, &len); | GetUserName (text, &len); | ||||
| return String (text, len); | return String (text, len); | ||||
| } | } | ||||
| @@ -242489,6 +242570,14 @@ const String SystemStats::getFullUserName() | |||||
| return getLogonName(); | return getLogonName(); | ||||
| } | } | ||||
| const String SystemStats::getComputerName() | |||||
| { | |||||
| TCHAR text [MAX_COMPUTERNAME_LENGTH + 1] = { 0 }; | |||||
| DWORD len = numElementsInArray (text) - 1; | |||||
| GetComputerName (text, &len); | |||||
| return String (text, len); | |||||
| } | |||||
| #endif | #endif | ||||
| /*** End of inlined file: juce_win32_SystemStats.cpp ***/ | /*** End of inlined file: juce_win32_SystemStats.cpp ***/ | ||||
| @@ -260274,6 +260363,15 @@ const String SystemStats::getFullUserName() | |||||
| return getLogonName(); | return getLogonName(); | ||||
| } | } | ||||
| const String SystemStats::getComputerName() | |||||
| { | |||||
| char name [256] = { 0 }; | |||||
| if (gethostname (name, sizeof (name) - 1) == 0) | |||||
| return name; | |||||
| return String::empty; | |||||
| } | |||||
| void SystemStats::initialiseStats() | void SystemStats::initialiseStats() | ||||
| { | { | ||||
| const String flags (LinuxStatsHelpers::getCpuInfo ("flags")); | const String flags (LinuxStatsHelpers::getCpuInfo ("flags")); | ||||
| @@ -267642,6 +267740,12 @@ const String SystemStats::getFullUserName() | |||||
| return nsStringToJuce (NSFullUserName()); | return nsStringToJuce (NSFullUserName()); | ||||
| } | } | ||||
| const String SystemStats::getComputerName() | |||||
| { | |||||
| return nsStringToJuce ([[NSProcessInfo processInfo] hostName]) | |||||
| .upToLastOccurrenceOf (".local", false, true); | |||||
| } | |||||
| uint32 juce_millisecondsSinceStartup() noexcept | uint32 juce_millisecondsSinceStartup() noexcept | ||||
| { | { | ||||
| return (uint32) (mach_absolute_time() * SystemStatsHelpers::highResTimerToMillisecRatio); | return (uint32) (mach_absolute_time() * SystemStatsHelpers::highResTimerToMillisecRatio); | ||||
| @@ -284701,6 +284805,15 @@ const String SystemStats::getFullUserName() | |||||
| return getLogonName(); | return getLogonName(); | ||||
| } | } | ||||
| const String SystemStats::getComputerName() | |||||
| { | |||||
| char name [256] = { 0 }; | |||||
| if (gethostname (name, sizeof (name) - 1) == 0) | |||||
| return name; | |||||
| return String::empty; | |||||
| } | |||||
| void SystemStats::initialiseStats() | void SystemStats::initialiseStats() | ||||
| { | { | ||||
| // TODO | // TODO | ||||
| @@ -18160,6 +18160,9 @@ public: | |||||
| */ | */ | ||||
| static const String getFullUserName(); | static const String getFullUserName(); | ||||
| /** Returns the host-name of the computer. */ | |||||
| static const String getComputerName(); | |||||
| // CPU and memory information.. | // CPU and memory information.. | ||||
| /** Returns the approximate CPU speed. | /** Returns the approximate CPU speed. | ||||
| @@ -71,6 +71,7 @@ const StringPairArray WavAudioFormat::createBWAVMetadata (const String& descript | |||||
| //============================================================================== | //============================================================================== | ||||
| namespace WavFileHelpers | namespace WavFileHelpers | ||||
| { | { | ||||
| inline int chunkName (const char* const name) noexcept { return (int) ByteOrder::littleEndianInt (name); } | |||||
| #if JUCE_MSVC | #if JUCE_MSVC | ||||
| #pragma pack (push, 1) | #pragma pack (push, 1) | ||||
| @@ -211,7 +212,7 @@ struct SMPLChunk | |||||
| MemoryBlock data ((sizeNeeded + 3) & ~3); | MemoryBlock data ((sizeNeeded + 3) & ~3); | ||||
| data.fillWith (0); | data.fillWith (0); | ||||
| SMPLChunk* s = (SMPLChunk*) data.getData(); | |||||
| SMPLChunk* const s = static_cast <SMPLChunk*> (data.getData()); | |||||
| // Allow these calls to overwrite an extra byte at the end, which is fine as long | // Allow these calls to overwrite an extra byte at the end, which is fine as long | ||||
| // as they get called in the right order.. | // as they get called in the right order.. | ||||
| @@ -240,7 +241,75 @@ struct SMPLChunk | |||||
| } | } | ||||
| } PACKED; | } PACKED; | ||||
| //============================================================================== | |||||
| struct CueChunk | |||||
| { | |||||
| struct Cue | |||||
| { | |||||
| uint32 identifier; | |||||
| uint32 order; | |||||
| uint32 chunkID; | |||||
| uint32 chunkStart; | |||||
| uint32 blockStart; | |||||
| uint32 offset; | |||||
| } PACKED; | |||||
| uint32 numCues; | |||||
| Cue cues[1]; | |||||
| void copyTo (StringPairArray& values, const int totalSize) const | |||||
| { | |||||
| values.set ("NumCuePoints", String (ByteOrder::swapIfBigEndian (numCues))); | |||||
| for (uint32 i = 0; i < numCues; ++i) | |||||
| { | |||||
| if ((uint8*) (cues + (i + 1)) > ((uint8*) this) + totalSize) | |||||
| break; | |||||
| const String prefix ("Cue" + String(i)); | |||||
| values.set (prefix + "Identifier", String (ByteOrder::swapIfBigEndian (cues[i].identifier))); | |||||
| values.set (prefix + "Order", String (ByteOrder::swapIfBigEndian (cues[i].order))); | |||||
| values.set (prefix + "ChunkID", String (ByteOrder::swapIfBigEndian (cues[i].chunkID))); | |||||
| values.set (prefix + "ChunkStart", String (ByteOrder::swapIfBigEndian (cues[i].chunkStart))); | |||||
| values.set (prefix + "BlockStart", String (ByteOrder::swapIfBigEndian (cues[i].blockStart))); | |||||
| values.set (prefix + "Offset", String (ByteOrder::swapIfBigEndian (cues[i].offset))); | |||||
| } | |||||
| } | |||||
| static MemoryBlock createFrom (const StringPairArray& values) | |||||
| { | |||||
| const int numCues = values.getValue ("NumCuePoints", "0").getIntValue(); | |||||
| if (numCues <= 0) | |||||
| return MemoryBlock(); | |||||
| const size_t sizeNeeded = sizeof (CueChunk) + (numCues - 1) * sizeof (Cue); | |||||
| MemoryBlock data ((sizeNeeded + 3) & ~3); | |||||
| data.fillWith (0); | |||||
| CueChunk* const c = static_cast <CueChunk*> (data.getData()); | |||||
| c->numCues = ByteOrder::swapIfBigEndian ((uint32) numCues); | |||||
| const String dataChunkID (chunkName ("data")); | |||||
| for (int i = 0; i < numCues; ++i) | |||||
| { | |||||
| const String prefix ("Cue" + String(i)); | |||||
| c->cues[i].identifier = ByteOrder::swapIfBigEndian ((uint32) values.getValue (prefix + "Identifier", "0").getIntValue()); | |||||
| c->cues[i].order = ByteOrder::swapIfBigEndian ((uint32) values.getValue (prefix + "Order", "0").getIntValue()); | |||||
| c->cues[i].chunkID = ByteOrder::swapIfBigEndian ((uint32) values.getValue (prefix + "ChunkID", dataChunkID).getIntValue()); | |||||
| c->cues[i].chunkStart = ByteOrder::swapIfBigEndian ((uint32) values.getValue (prefix + "ChunkStart", "0").getIntValue()); | |||||
| c->cues[i].blockStart = ByteOrder::swapIfBigEndian ((uint32) values.getValue (prefix + "BlockStart", "0").getIntValue()); | |||||
| c->cues[i].offset = ByteOrder::swapIfBigEndian ((uint32) values.getValue (prefix + "Offset", "0").getIntValue()); | |||||
| } | |||||
| return data; | |||||
| } | |||||
| } PACKED; | |||||
| //============================================================================== | |||||
| struct ExtensibleWavSubFormat | struct ExtensibleWavSubFormat | ||||
| { | { | ||||
| uint32 data1; | uint32 data1; | ||||
| @@ -266,8 +335,6 @@ struct DataSize64Chunk // chunk ID = 'ds64' if data size > 0xffffffff, 'JUNK' | |||||
| #endif | #endif | ||||
| #undef PACKED | #undef PACKED | ||||
| inline int chunkName (const char* const name) { return (int) ByteOrder::littleEndianInt (name); } | |||||
| } | } | ||||
| @@ -387,7 +454,6 @@ public: | |||||
| } | } | ||||
| else if (chunkType == chunkName ("data")) | else if (chunkType == chunkName ("data")) | ||||
| { | { | ||||
| // get the data chunk's position | |||||
| if (! isRF64) // data size is expected to be -1, actual data size is in ds64 chunk | if (! isRF64) // data size is expected to be -1, actual data size is in ds64 chunk | ||||
| dataLength = length; | dataLength = length; | ||||
| @@ -401,7 +467,6 @@ public: | |||||
| bwavChunkStart = input->getPosition(); | bwavChunkStart = input->getPosition(); | ||||
| bwavSize = length; | bwavSize = length; | ||||
| // Broadcast-wav extension chunk.. | |||||
| HeapBlock <BWAVChunk> bwav; | HeapBlock <BWAVChunk> bwav; | ||||
| bwav.calloc (jmax ((size_t) length + 1, sizeof (BWAVChunk)), 1); | bwav.calloc (jmax ((size_t) length + 1, sizeof (BWAVChunk)), 1); | ||||
| input->read (bwav, length); | input->read (bwav, length); | ||||
| @@ -414,6 +479,13 @@ public: | |||||
| input->read (smpl, length); | input->read (smpl, length); | ||||
| smpl->copyTo (metadataValues, length); | smpl->copyTo (metadataValues, length); | ||||
| } | } | ||||
| else if (chunkType == chunkName ("cue ")) | |||||
| { | |||||
| HeapBlock <CueChunk> cue; | |||||
| cue.calloc (jmax ((size_t) length + 1, sizeof (CueChunk)), 1); | |||||
| input->read (cue, length); | |||||
| cue->copyTo (metadataValues, length); | |||||
| } | |||||
| else if (chunkEnd <= input->getPosition()) | else if (chunkEnd <= input->getPosition()) | ||||
| { | { | ||||
| break; | break; | ||||
| @@ -506,6 +578,7 @@ public: | |||||
| { | { | ||||
| bwavChunk = BWAVChunk::createFrom (metadataValues); | bwavChunk = BWAVChunk::createFrom (metadataValues); | ||||
| smplChunk = SMPLChunk::createFrom (metadataValues); | smplChunk = SMPLChunk::createFrom (metadataValues); | ||||
| cueChunk = CueChunk ::createFrom (metadataValues); | |||||
| } | } | ||||
| headerPosition = out->getPosition(); | headerPosition = out->getPosition(); | ||||
| @@ -563,7 +636,7 @@ public: | |||||
| private: | private: | ||||
| ScopedPointer<AudioData::Converter> converter; | ScopedPointer<AudioData::Converter> converter; | ||||
| MemoryBlock tempBlock, bwavChunk, smplChunk; | |||||
| MemoryBlock tempBlock, bwavChunk, smplChunk, cueChunk; | |||||
| uint64 lengthInSamples, bytesWritten; | uint64 lengthInSamples, bytesWritten; | ||||
| int64 headerPosition; | int64 headerPosition; | ||||
| bool writeFailed; | bool writeFailed; | ||||
| @@ -602,6 +675,7 @@ private: | |||||
| + 8 + audioDataSize + (audioDataSize & 1) | + 8 + audioDataSize + (audioDataSize & 1) | ||||
| + (bwavChunk.getSize() > 0 ? (8 + bwavChunk.getSize()) : 0) | + (bwavChunk.getSize() > 0 ? (8 + bwavChunk.getSize()) : 0) | ||||
| + (smplChunk.getSize() > 0 ? (8 + smplChunk.getSize()) : 0) | + (smplChunk.getSize() > 0 ? (8 + smplChunk.getSize()) : 0) | ||||
| + (cueChunk .getSize() > 0 ? (8 + cueChunk .getSize()) : 0) | |||||
| + (8 + 28); // (ds64 chunk) | + (8 + 28); // (ds64 chunk) | ||||
| riffChunkSize += (riffChunkSize & 0x1); | riffChunkSize += (riffChunkSize & 0x1); | ||||
| @@ -680,6 +754,13 @@ private: | |||||
| output->write (smplChunk.getData(), (int) smplChunk.getSize()); | output->write (smplChunk.getData(), (int) smplChunk.getSize()); | ||||
| } | } | ||||
| if (cueChunk.getSize() > 0) | |||||
| { | |||||
| output->writeInt (chunkName ("cue ")); | |||||
| output->writeInt ((int) cueChunk.getSize()); | |||||
| output->write (cueChunk.getData(), (int) cueChunk.getSize()); | |||||
| } | |||||
| output->writeInt (chunkName ("data")); | output->writeInt (chunkName ("data")); | ||||
| output->writeInt (isRF64 ? -1 : (int) (lengthInSamples * bytesPerFrame)); | output->writeInt (isRF64 ? -1 : (int) (lengthInSamples * bytesPerFrame)); | ||||
| @@ -99,6 +99,9 @@ public: | |||||
| */ | */ | ||||
| static const String getFullUserName(); | static const String getFullUserName(); | ||||
| /** Returns the host-name of the computer. */ | |||||
| static const String getComputerName(); | |||||
| //============================================================================== | //============================================================================== | ||||
| // CPU and memory information.. | // CPU and memory information.. | ||||
| @@ -105,6 +105,15 @@ const String SystemStats::getFullUserName() | |||||
| return getLogonName(); | return getLogonName(); | ||||
| } | } | ||||
| const String SystemStats::getComputerName() | |||||
| { | |||||
| char name [256] = { 0 }; | |||||
| if (gethostname (name, sizeof (name) - 1) == 0) | |||||
| return name; | |||||
| return String::empty; | |||||
| } | |||||
| //============================================================================== | //============================================================================== | ||||
| void SystemStats::initialiseStats() | void SystemStats::initialiseStats() | ||||
| { | { | ||||
| @@ -116,6 +116,15 @@ const String SystemStats::getFullUserName() | |||||
| return getLogonName(); | return getLogonName(); | ||||
| } | } | ||||
| const String SystemStats::getComputerName() | |||||
| { | |||||
| char name [256] = { 0 }; | |||||
| if (gethostname (name, sizeof (name) - 1) == 0) | |||||
| return name; | |||||
| return String::empty; | |||||
| } | |||||
| //============================================================================== | //============================================================================== | ||||
| void SystemStats::initialiseStats() | void SystemStats::initialiseStats() | ||||
| { | { | ||||
| @@ -182,6 +182,12 @@ const String SystemStats::getFullUserName() | |||||
| return nsStringToJuce (NSFullUserName()); | return nsStringToJuce (NSFullUserName()); | ||||
| } | } | ||||
| const String SystemStats::getComputerName() | |||||
| { | |||||
| return nsStringToJuce ([[NSProcessInfo processInfo] hostName]) | |||||
| .upToLastOccurrenceOf (".local", false, true); | |||||
| } | |||||
| //============================================================================== | //============================================================================== | ||||
| uint32 juce_millisecondsSinceStartup() noexcept | uint32 juce_millisecondsSinceStartup() noexcept | ||||
| { | { | ||||
| @@ -69,16 +69,17 @@ static void juce_getCpuVendor (char* const v) | |||||
| { | { | ||||
| int vendor[4] = { 0 }; | int vendor[4] = { 0 }; | ||||
| #ifdef JUCE_64BIT | |||||
| #else | |||||
| #if JUCE_64BIT | |||||
| /// xxx todo | |||||
| #else | |||||
| #ifndef __MINGW32__ | #ifndef __MINGW32__ | ||||
| __try | __try | ||||
| #endif | #endif | ||||
| { | { | ||||
| #if JUCE_GCC | |||||
| #if JUCE_GCC | |||||
| unsigned int dummy = 0; | unsigned int dummy = 0; | ||||
| __asm__ ("cpuid" : "=a" (dummy), "=b" (vendor[0]), "=c" (vendor[2]),"=d" (vendor[1]) : "a" (0)); | __asm__ ("cpuid" : "=a" (dummy), "=b" (vendor[0]), "=c" (vendor[2]),"=d" (vendor[1]) : "a" (0)); | ||||
| #else | |||||
| #else | |||||
| __asm | __asm | ||||
| { | { | ||||
| mov eax, 0 | mov eax, 0 | ||||
| @@ -87,15 +88,15 @@ static void juce_getCpuVendor (char* const v) | |||||
| mov [vendor + 4], edx | mov [vendor + 4], edx | ||||
| mov [vendor + 8], ecx | mov [vendor + 8], ecx | ||||
| } | } | ||||
| #endif | |||||
| #endif | |||||
| } | } | ||||
| #ifndef __MINGW32__ | |||||
| #ifndef __MINGW32__ | |||||
| __except (EXCEPTION_EXECUTE_HANDLER) | __except (EXCEPTION_EXECUTE_HANDLER) | ||||
| { | { | ||||
| *v = 0; | *v = 0; | ||||
| } | } | ||||
| #endif | |||||
| #endif | |||||
| #endif | |||||
| #endif | |||||
| memcpy (v, vendor, 16); | memcpy (v, vendor, 16); | ||||
| } | } | ||||
| @@ -115,11 +116,11 @@ void SystemStats::initialiseStats() | |||||
| cpuFlags.hasMMX = IsProcessorFeaturePresent (PF_MMX_INSTRUCTIONS_AVAILABLE) != 0; | cpuFlags.hasMMX = IsProcessorFeaturePresent (PF_MMX_INSTRUCTIONS_AVAILABLE) != 0; | ||||
| cpuFlags.hasSSE = IsProcessorFeaturePresent (PF_XMMI_INSTRUCTIONS_AVAILABLE) != 0; | cpuFlags.hasSSE = IsProcessorFeaturePresent (PF_XMMI_INSTRUCTIONS_AVAILABLE) != 0; | ||||
| cpuFlags.hasSSE2 = IsProcessorFeaturePresent (PF_XMMI64_INSTRUCTIONS_AVAILABLE) != 0; | cpuFlags.hasSSE2 = IsProcessorFeaturePresent (PF_XMMI64_INSTRUCTIONS_AVAILABLE) != 0; | ||||
| #ifdef PF_AMD3D_INSTRUCTIONS_AVAILABLE | |||||
| #ifdef PF_AMD3D_INSTRUCTIONS_AVAILABLE | |||||
| cpuFlags.has3DNow = IsProcessorFeaturePresent (PF_AMD3D_INSTRUCTIONS_AVAILABLE) != 0; | cpuFlags.has3DNow = IsProcessorFeaturePresent (PF_AMD3D_INSTRUCTIONS_AVAILABLE) != 0; | ||||
| #else | |||||
| #else | |||||
| cpuFlags.has3DNow = IsProcessorFeaturePresent (PF_3DNOW_INSTRUCTIONS_AVAILABLE) != 0; | cpuFlags.has3DNow = IsProcessorFeaturePresent (PF_3DNOW_INSTRUCTIONS_AVAILABLE) != 0; | ||||
| #endif | |||||
| #endif | |||||
| { | { | ||||
| SYSTEM_INFO systemInfo; | SYSTEM_INFO systemInfo; | ||||
| @@ -138,9 +139,9 @@ void SystemStats::initialiseStats() | |||||
| (void) res; | (void) res; | ||||
| jassert (res == TIMERR_NOERROR); | jassert (res == TIMERR_NOERROR); | ||||
| #if JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS | |||||
| #if JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS | |||||
| _CrtSetDbgFlag (_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); | _CrtSetDbgFlag (_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); | ||||
| #endif | |||||
| #endif | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -187,9 +188,9 @@ const String SystemStats::getOperatingSystemName() | |||||
| bool SystemStats::isOperatingSystem64Bit() | bool SystemStats::isOperatingSystem64Bit() | ||||
| { | { | ||||
| #ifdef _WIN64 | |||||
| #ifdef _WIN64 | |||||
| return true; | return true; | ||||
| #else | |||||
| #else | |||||
| typedef BOOL (WINAPI* LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); | typedef BOOL (WINAPI* LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); | ||||
| LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress (GetModuleHandle (L"kernel32"), "IsWow64Process"); | LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress (GetModuleHandle (L"kernel32"), "IsWow64Process"); | ||||
| @@ -199,10 +200,9 @@ bool SystemStats::isOperatingSystem64Bit() | |||||
| return (fnIsWow64Process != 0) | return (fnIsWow64Process != 0) | ||||
| && fnIsWow64Process (GetCurrentProcess(), &isWow64) | && fnIsWow64Process (GetCurrentProcess(), &isWow64) | ||||
| && (isWow64 != FALSE); | && (isWow64 != FALSE); | ||||
| #endif | |||||
| #endif | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| int SystemStats::getMemorySizeInMegabytes() | int SystemStats::getMemorySizeInMegabytes() | ||||
| { | { | ||||
| @@ -249,11 +249,11 @@ int64 Time::getHighResolutionTicksPerSecond() noexcept | |||||
| static int64 juce_getClockCycleCounter() noexcept | static int64 juce_getClockCycleCounter() noexcept | ||||
| { | { | ||||
| #if JUCE_USE_INTRINSICS | |||||
| #if JUCE_USE_INTRINSICS | |||||
| // MS intrinsics version... | // MS intrinsics version... | ||||
| return __rdtsc(); | return __rdtsc(); | ||||
| #elif JUCE_GCC | |||||
| #elif JUCE_GCC | |||||
| // GNU inline asm version... | // GNU inline asm version... | ||||
| unsigned int hi = 0, lo = 0; | unsigned int hi = 0, lo = 0; | ||||
| @@ -269,7 +269,7 @@ static int64 juce_getClockCycleCounter() noexcept | |||||
| : "cc", "eax", "ebx", "ecx", "edx", "memory"); | : "cc", "eax", "ebx", "ecx", "edx", "memory"); | ||||
| return (int64) ((((uint64) hi) << 32) | lo); | return (int64) ((((uint64) hi) << 32) | lo); | ||||
| #else | |||||
| #else | |||||
| // MSVC inline asm version... | // MSVC inline asm version... | ||||
| unsigned int hi = 0, lo = 0; | unsigned int hi = 0, lo = 0; | ||||
| @@ -283,7 +283,7 @@ static int64 juce_getClockCycleCounter() noexcept | |||||
| } | } | ||||
| return (int64) ((((uint64) hi) << 32) | lo); | return (int64) ((((uint64) hi) << 32) | lo); | ||||
| #endif | |||||
| #endif | |||||
| } | } | ||||
| int SystemStats::getCpuSpeedInMegaherz() | int SystemStats::getCpuSpeedInMegaherz() | ||||
| @@ -345,7 +345,7 @@ int SystemStats::getPageSize() | |||||
| const String SystemStats::getLogonName() | const String SystemStats::getLogonName() | ||||
| { | { | ||||
| TCHAR text [256] = { 0 }; | TCHAR text [256] = { 0 }; | ||||
| DWORD len = numElementsInArray (text) - 2; | |||||
| DWORD len = numElementsInArray (text) - 1; | |||||
| GetUserName (text, &len); | GetUserName (text, &len); | ||||
| return String (text, len); | return String (text, len); | ||||
| } | } | ||||
| @@ -355,5 +355,12 @@ const String SystemStats::getFullUserName() | |||||
| return getLogonName(); | return getLogonName(); | ||||
| } | } | ||||
| const String SystemStats::getComputerName() | |||||
| { | |||||
| TCHAR text [MAX_COMPUTERNAME_LENGTH + 1] = { 0 }; | |||||
| DWORD len = numElementsInArray (text) - 1; | |||||
| GetComputerName (text, &len); | |||||
| return String (text, len); | |||||
| } | |||||
| #endif | #endif | ||||