diff --git a/Modules/juce_organicui b/Modules/juce_organicui index c643d3b41..b50128d88 160000 --- a/Modules/juce_organicui +++ b/Modules/juce_organicui @@ -1 +1 @@ -Subproject commit c643d3b41f3f3fb8574b4fb944eec005d6308871 +Subproject commit b50128d883167ba435332f4457e451fe13c3afc0 diff --git a/Source/Common/Command/ui/BaseCommandHandlerEditor.cpp b/Source/Common/Command/ui/BaseCommandHandlerEditor.cpp index d41a9f5f4..fb5ede3d5 100644 --- a/Source/Common/Command/ui/BaseCommandHandlerEditor.cpp +++ b/Source/Common/Command/ui/BaseCommandHandlerEditor.cpp @@ -1,9 +1,9 @@ /* ============================================================================== - BaseCommandHandlerEditor.cpp - Created: 19 Jan 2017 6:41:22pm - Author: Ben + BaseCommandHandlerEditor.cpp + Created: 19 Jan 2017 6:41:22pm + Author: Ben ============================================================================== */ @@ -13,11 +13,11 @@ #include "CommandChooserUI.cpp" #include "../BaseCommandHandler.h" -BaseCommandHandlerEditor::BaseCommandHandlerEditor(BaseCommandHandler * _handler, bool isRoot) : +BaseCommandHandlerEditor::BaseCommandHandlerEditor(BaseCommandHandler* _handler, bool isRoot) : BaseItemEditor(_handler, isRoot), handler(_handler), chooser(_handler->context, _handler->isMultiplexed()) -{ +{ chooser.addChooserListener(this); chooser.lockedModule = handler->lockedModule; @@ -31,7 +31,7 @@ BaseCommandHandlerEditor::BaseCommandHandlerEditor(BaseCommandHandler * _handler } setSize(10, 40); - + updateChooserLabel(); resetAndBuild(); @@ -41,13 +41,13 @@ BaseCommandHandlerEditor::BaseCommandHandlerEditor(BaseCommandHandler * _handler BaseCommandHandlerEditor::~BaseCommandHandlerEditor() { - if(!inspectable.wasObjectDeleted()) handler->removeAsyncCommandHandlerListener(this); + if (!inspectable.wasObjectDeleted()) handler->removeAsyncCommandHandlerListener(this); } void BaseCommandHandlerEditor::resizedInternalHeaderItemInternal(Rectangle& r) { - if(triggerBT != nullptr) triggerBT->setBounds(r.removeFromRight(50).reduced(2)); - chooser.setBounds(r.removeFromRight(chooser.label.getFont().getStringWidth(chooser.label.getText()) + 50)); + if (triggerBT != nullptr) triggerBT->setBounds(r.removeFromRight(50).reduced(2)); + chooser.setBounds(r.removeFromRight(TextLayout::getStringWidth(chooser.label.getFont(), chooser.label.getText()) + 50)); } void BaseCommandHandlerEditor::updateChooserLabel() @@ -70,12 +70,12 @@ void BaseCommandHandlerEditor::updateChooserLabel() chooser.repaint(); } -void BaseCommandHandlerEditor::definitionChosen(CommandDefinition * d) +void BaseCommandHandlerEditor::definitionChosen(CommandDefinition* d) { handler->setCommand(d); } -void BaseCommandHandlerEditor::newMessage(const CommandHandlerEvent & e) +void BaseCommandHandlerEditor::newMessage(const CommandHandlerEvent& e) { if (e.type == CommandHandlerEvent::COMMAND_CHANGED) { diff --git a/Source/Module/modules/common/ui/EnablingNetworkControllableContainerEditor.cpp b/Source/Module/modules/common/ui/EnablingNetworkControllableContainerEditor.cpp index b2725ddb6..311441b12 100644 --- a/Source/Module/modules/common/ui/EnablingNetworkControllableContainerEditor.cpp +++ b/Source/Module/modules/common/ui/EnablingNetworkControllableContainerEditor.cpp @@ -24,7 +24,7 @@ EnablingNetworkControllableContainerEditor::~EnablingNetworkControllableContaine void EnablingNetworkControllableContainerEditor::resizedInternalHeader(Rectangle& r) { - ipLabel.setBounds(r.removeFromRight(jmin(ipLabel.getFont().getStringWidth(ipLabel.getText()),getWidth()-100))); + ipLabel.setBounds(r.removeFromRight(jmin((int)TextLayout::getStringWidth(ipLabel.getFont(), ipLabel.getText()), getWidth() - 100))); r.removeFromRight(2); EnablingControllableContainerEditor::resizedInternalHeader(r); } diff --git a/Source/Module/modules/oscquery/generic/GenericOSCQueryModule.cpp b/Source/Module/modules/oscquery/generic/GenericOSCQueryModule.cpp index b822c81b8..fee84a211 100644 --- a/Source/Module/modules/oscquery/generic/GenericOSCQueryModule.cpp +++ b/Source/Module/modules/oscquery/generic/GenericOSCQueryModule.cpp @@ -18,7 +18,8 @@ GenericOSCQueryModule::GenericOSCQueryModule(const String& name, int defaultRemo remoteHost(nullptr), remotePort(nullptr), isUpdatingStructure(false), - hasListenExtension(false) + hasListenExtension(false), + connectionTries(0) { alwaysShowValues = true; canHandleRouteValues = true; @@ -97,7 +98,9 @@ void GenericOSCQueryModule::setupWSClient() String url = host + ":" + wsPort + "/"; - if (wsPort != remoteHost->stringValue()) LOG("Connecting to custom WS Port : " + url + "..."); + connectionTries++; + + if (wsPort != remoteHost->stringValue() && connectionTries == 0) LOG("Connecting to custom WS Port : " + url + "..."); wsClient->start(url); } @@ -386,6 +389,7 @@ void GenericOSCQueryModule::connectionOpened() { NLOG(niceName, "Websocket connection is opened, let's get bi, baby !"); isConnected->setValue(true); + connectionTries = 0; clearWarning("sync"); updateAllListens(); } @@ -398,7 +402,7 @@ void GenericOSCQueryModule::connectionClosed(int status, const String& reason) void GenericOSCQueryModule::connectionError(const String& errorMessage) { - NLOGERROR(niceName, "Connection error " << errorMessage); + if(connectionTries == 0) NLOGERROR(niceName, "Connection error " << errorMessage); isConnected->setValue(false); } diff --git a/Source/Module/modules/oscquery/generic/GenericOSCQueryModule.h b/Source/Module/modules/oscquery/generic/GenericOSCQueryModule.h index 5314441f2..80aff6ca7 100644 --- a/Source/Module/modules/oscquery/generic/GenericOSCQueryModule.h +++ b/Source/Module/modules/oscquery/generic/GenericOSCQueryModule.h @@ -63,6 +63,7 @@ class GenericOSCQueryModule : Array noFeedbackList; + int connectionTries; void setupWSClient();