Skip to content

Commit

Permalink
fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Oct 8, 2024
1 parent 83ef284 commit 3056634
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
22 changes: 11 additions & 11 deletions Source/Common/Command/ui/BaseCommandHandlerEditor.cpp
Original file line number Diff line number Diff line change
@@ -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
==============================================================================
*/
Expand All @@ -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;

Expand All @@ -31,7 +31,7 @@ BaseCommandHandlerEditor::BaseCommandHandlerEditor(BaseCommandHandler * _handler
}

setSize(10, 40);

updateChooserLabel();

resetAndBuild();
Expand All @@ -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<int>& 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()
Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EnablingNetworkControllableContainerEditor::~EnablingNetworkControllableContaine

void EnablingNetworkControllableContainerEditor::resizedInternalHeader(Rectangle<int>& 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);
}
10 changes: 7 additions & 3 deletions Source/Module/modules/oscquery/generic/GenericOSCQueryModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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();
}
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class GenericOSCQueryModule :

Array<Controllable*> noFeedbackList;

int connectionTries;

void setupWSClient();

Expand Down

0 comments on commit 3056634

Please sign in to comment.