Skip to content

Commit

Permalink
b6 listener and submodules updates
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Jun 21, 2024
1 parent 56f48ae commit 6e64c5d
Show file tree
Hide file tree
Showing 24 changed files with 103 additions and 72 deletions.
7 changes: 7 additions & 0 deletions JuceLibraryCode/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,13 @@
#define JUCE_IP_AND_PORT_DETECTION 1
#endif

//==============================================================================
// juce_sharedtexture flags:

#ifndef SHAREDTEXTURE_USE_CPU_IMAGE
//#define SHAREDTEXTURE_USE_CPU_IMAGE 1
#endif

//==============================================================================
// juce_timeline flags:

Expand Down
2 changes: 1 addition & 1 deletion Modules/juce_organicui
Submodule juce_organicui updated 55 files
+2 −2 app/OrganicApplication.cpp
+6 −7 app/OrganicMainComponent.cpp
+3 −1 automation/Automation.cpp
+62 −62 automation/Automation.h
+17 −17 controllable/Controllable.cpp
+4 −26 controllable/Controllable.h
+76 −34 controllable/ControllableContainer.cpp
+16 −7 controllable/ControllableContainer.h
+3 −3 controllable/Trigger.cpp
+16 −24 controllable/Trigger.h
+1 −1 controllable/dashboard/DashboardControllableItem.h
+3 −3 controllable/parameter/EnumParameter.cpp
+20 −22 controllable/parameter/EnumParameter.h
+54 −3 controllable/parameter/FileParameter.cpp
+39 −13 controllable/parameter/FileParameter.h
+22 −5 controllable/parameter/Parameter.cpp
+279 −276 controllable/parameter/Parameter.h
+19 −10 controllable/parameter/TargetParameter.cpp
+4 −1 controllable/parameter/TargetParameter.h
+1 −1 controllable/parameter/dashboard/DashboardParameterItem.h
+1 −3 controllable/parameter/gradient/GradientColorManager.h
+0 −2 controllable/parameter/ui/FloatParameterLabelUI.cpp
+6 −2 controllable/ui/GenericControllableContainerEditor.cpp
+2 −2 controllable/ui/TriggerUI.cpp
+1 −1 controllable/ui/TriggerUI.h
+14 −4 dashboard/Dashboard.cpp
+2 −4 dashboard/Dashboard.h
+10 −3 dashboard/DashboardFeedbackBroadcaster.h
+29 −25 dashboard/SharedTextureDashboardItem.cpp
+1 −1 dashboard/SharedTextureDashboardItem.h
+18 −12 engine/Engine.cpp
+13 −37 engine/Engine.h
+9 −5 helpers/QueuedNotifier.h
+14 −9 helpers/StringUtil.cpp
+8 −4 inspectable/Inspectable.cpp
+17 −24 inspectable/Inspectable.h
+1 −3 manager/BaseItem.h
+4 −1 manager/BaseManager.h
+31 −3 manager/Factory.h
+2 −0 manager/ui/BaseItemEditor.cpp
+3 −1 manager/ui/BaseItemUI.h
+5 −2 remotecontrol/OSCRemoteControl.cpp
+1 −3 remotecontrol/OSCRemoteControl.h
+14 −1 script/Script.cpp
+4 −0 script/Script.h
+19 −3 script/ScriptUtil.cpp
+1 −0 script/ScriptUtil.h
+10 −1 ui/shapeshifter/ShapeShifterContent.cpp
+5 −1 ui/shapeshifter/ShapeShifterContent.h
+1 −0 ui/shapeshifter/ShapeShifterPanel.cpp
+16 −0 ui/shapeshifter/ShapeShifterPanelHeader.cpp
+2 −0 ui/shapeshifter/ShapeShifterPanelHeader.h
+37 −13 ui/shapeshifter/ShapeShifterPanelTab.cpp
+6 −1 ui/shapeshifter/ShapeShifterPanelTab.h
+1 −1 warning/WarningTarget.cpp
2 changes: 1 addition & 1 deletion Modules/juce_simpleweb
6 changes: 2 additions & 4 deletions Source/LightBlock/LightBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ParamLinkContainer;
class LightBlock :
public ControllableContainer,
public BaseColorProvider,
public LightBlockColorProvider::ProviderListener
public LightBlockColorProvider::ColorProviderListener
{
public:
LightBlock(LightBlockColorProvider * provider = nullptr);
Expand Down Expand Up @@ -55,9 +55,7 @@ class LightBlock :
//virtual void colorsUpdated() {}
};

ListenerList<LightBlockListener> blockListeners;
void addLightBlockListener(LightBlockListener* newListener) { blockListeners.add(newListener); }
void removeLightBlockListener(LightBlockListener* listener) { blockListeners.remove(listener); }
DECLARE_INSPECTACLE_CRITICAL_LISTENER(LightBlock, block)



Expand Down
8 changes: 3 additions & 5 deletions Source/LightBlock/model/LightBlockColorProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,16 @@ class LightBlockColorProvider :

virtual void handleEnterExit(bool enter, Array<Prop *> props) {}

class ProviderListener
class ColorProviderListener
{
public:
virtual ~ProviderListener() {}
virtual ~ColorProviderListener() {}
virtual void providerParametersChanged(LightBlockColorProvider *) {}
virtual void providerParameterValueUpdated(LightBlockColorProvider *, Parameter *) {}
virtual void providerPlaybackControlUpdate(PlaybackControl control, var data = var()) {}
};

ListenerList<ProviderListener> providerListeners;
void addColorProviderListener(ProviderListener* newListener) { providerListeners.add(newListener); }
void removeColorProviderListener(ProviderListener* listener) { providerListeners.remove(listener); }
DECLARE_INSPECTACLE_CRITICAL_LISTENER(ColorProvider, provider)


InspectableEditor* getEditorInternal(bool isRoot, Array<Inspectable*> inspectables) override;
Expand Down
4 changes: 2 additions & 2 deletions Source/LightBlock/model/LightBlockModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ LightBlockModelUI * LightBlockModel::createUI()
void LightBlockModel::onControllableFeedbackUpdateInternal(ControllableContainer * cc, Controllable * c)
{
if (Engine::mainEngine->isClearing) return;
if (cc == paramsContainer.get()) providerListeners.call(&ProviderListener::providerParameterValueUpdated, this, dynamic_cast<Parameter *>(c));
if (cc == paramsContainer.get()) providerListeners.call(&ColorProviderListener::providerParameterValueUpdated, this, dynamic_cast<Parameter *>(c));
}

void LightBlockModel::childStructureChanged(ControllableContainer * cc)
{
if (cc == paramsContainer.get()) providerListeners.call(&ProviderListener::providerParametersChanged, this);
if (cc == paramsContainer.get()) providerListeners.call(&ColorProviderListener::providerParametersChanged, this);
}
8 changes: 4 additions & 4 deletions Source/LightBlock/model/blocks/node/NodeBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void NodeBlock::itemAdded(Node* n)
p->addParameterListener(this);
paramsContainer->addParameter(p);

providerListeners.call(&ProviderListener::providerParametersChanged, this);
providerListeners.call(&ColorProviderListener::providerParametersChanged, this);
}

void NodeBlock::itemsAdded(Array<Node*> nodes)
Expand All @@ -72,7 +72,7 @@ void NodeBlock::itemsAdded(Array<Node*> nodes)
paramsContainer->addParameter(p);
}

providerListeners.call(&ProviderListener::providerParametersChanged, this);
providerListeners.call(&ColorProviderListener::providerParametersChanged, this);
}

void NodeBlock::itemRemoved(Node* n)
Expand All @@ -91,7 +91,7 @@ void NodeBlock::itemRemoved(Node* n)
paramsContainer->removeControllable(p.get());
pn->removeControllableContainerListener(this);

providerListeners.call(&ProviderListener::providerParametersChanged, this);
providerListeners.call(&ColorProviderListener::providerParametersChanged, this);
}

void NodeBlock::itemsRemoved(Array<Node*> nodes)
Expand All @@ -114,7 +114,7 @@ void NodeBlock::itemsRemoved(Array<Node*> nodes)

}

providerListeners.call(&ProviderListener::providerParametersChanged, this);
providerListeners.call(&ColorProviderListener::providerParametersChanged, this);
}

void NodeBlock::childAddressChanged(ControllableContainer* cc)
Expand Down
8 changes: 4 additions & 4 deletions Source/LightBlock/model/blocks/sequence/SequenceBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void BentoSequenceBlock::sequenceCurrentTimeChanged(Sequence*, float prevTime, b
{
if (sequence->isSeeking)
{
providerListeners.call(&ProviderListener::providerPlaybackControlUpdate, SEEK, sequence->currentTime->floatValue());
providerListeners.call(&ColorProviderListener::providerPlaybackControlUpdate, SEEK, sequence->currentTime->floatValue());
}

//OSCMessage msg("/" + shortName + "/currentTime");
Expand All @@ -98,7 +98,7 @@ void BentoSequenceBlock::sequenceCurrentTimeChanged(Sequence*, float prevTime, b

void BentoSequenceBlock::sequencePlayStateChanged(Sequence* s)
{
providerListeners.call(&ProviderListener::providerPlaybackControlUpdate, sequence->isPlaying->boolValue() ? PLAY : PAUSE, sequence->currentTime->floatValue());
providerListeners.call(&ColorProviderListener::providerPlaybackControlUpdate, sequence->isPlaying->boolValue() ? PLAY : PAUSE, sequence->currentTime->floatValue());
}

void BentoSequenceBlock::sequenceEditingStateChanged(Sequence* s)
Expand All @@ -108,7 +108,7 @@ void BentoSequenceBlock::sequenceEditingStateChanged(Sequence* s)

void BentoSequenceBlock::sequenceLooped(Sequence* s)
{
providerListeners.call(&ProviderListener::providerPlaybackControlUpdate, PLAY, 0);
providerListeners.call(&ColorProviderListener::providerPlaybackControlUpdate, PLAY, 0);
}

void BentoSequenceBlock::onContainerTriggerTriggered(Trigger* t)
Expand All @@ -126,7 +126,7 @@ void BentoSequenceBlock::onControllableFeedbackUpdateInternal(ControllableContai
LightBlockModel::onControllableFeedbackUpdateInternal(cc, c);
if (c == sequence->identityMode)
{
providerListeners.call(&ProviderListener::providerPlaybackControlUpdate, SHOW_ID, sequence->identityMode->boolValue());
providerListeners.call(&ColorProviderListener::providerPlaybackControlUpdate, SHOW_ID, sequence->identityMode->boolValue());
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ void StreamingScriptBlock::getColorsInternal(Array<Colour>* result, Prop* p, dou

void StreamingScriptBlock::onControllableFeedbackUpdateInternal(ControllableContainer* cc, Controllable* c)
{
if (cc == &script && script.state == Script::SCRIPT_LOADED) providerListeners.call(&ProviderListener::providerParameterValueUpdated, this, dynamic_cast<Parameter*>(c));
if (cc == &script && script.state == Script::SCRIPT_LOADED) providerListeners.call(&ColorProviderListener::providerParameterValueUpdated, this, dynamic_cast<Parameter*>(c));
}

void StreamingScriptBlock::childStructureChanged(ControllableContainer* cc)
{
if (cc == &script && script.state == Script::SCRIPT_LOADED) providerListeners.call(&ProviderListener::providerParametersChanged, this);
if (cc == &script && script.state == Script::SCRIPT_LOADED) providerListeners.call(&ColorProviderListener::providerParametersChanged, this);
}

void StreamingScriptBlock::handleEnterExit(bool enter, Array<Prop *> props)
Expand Down Expand Up @@ -112,7 +112,7 @@ void StreamingScriptBlock::newMessage(const Script::ScriptEvent& e)
setCustomThumbnail(script.filePath->getFile().withFileExtension("png").getFullPathName());
setNiceName(script.niceName);

if (script.state == Script::SCRIPT_LOADED) providerListeners.call(&ProviderListener::providerParametersChanged, this);
if (script.state == Script::SCRIPT_LOADED) providerListeners.call(&ColorProviderListener::providerParametersChanged, this);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/LightBlock/model/preset/LightBlockModelPreset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void LightBlockModelPreset::childStructureChanged(ControllableContainer * cc)

void LightBlockModelPreset::onControllableFeedbackUpdateInternal(ControllableContainer * cc, Controllable * c)
{
if(cc == &paramsContainer) providerListeners.call(&ProviderListener::providerParameterValueUpdated, this, dynamic_cast<Parameter *>(c));
if(cc == &paramsContainer) providerListeners.call(&ColorProviderListener::providerParameterValueUpdated, this, dynamic_cast<Parameter *>(c));
}

var LightBlockModelPreset::getJSONData()
Expand Down
1 change: 0 additions & 1 deletion Source/MainComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
MainComponent::MainComponent() :
OrganicMainContentComponent()
{
getCommandManager().registerAllCommandsForTarget(this);
SharedTextureManager::getInstance(); //create the main instance
}

Expand Down
44 changes: 21 additions & 23 deletions Source/Node/Node.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
==============================================================================
Node.h
Created: 14 Apr 2018 2:11:31am
Author: Ben
Node.h
Created: 14 Apr 2018 2:11:31am
Author: Ben
==============================================================================
*/
Expand All @@ -20,26 +20,26 @@ class Node :
public NodeConnectionSlot::SlotListener
{
public:
Node(const String &name = "Node", var params = var());
Node(const String& name = "Node", var params = var());
virtual ~Node();

OwnedArray<NodeConnectionSlot, CriticalSection> inSlots;
OwnedArray<NodeConnectionSlot, CriticalSection> outSlots;

ParameterSlot * addParameterSlot(bool isInput, Parameter * p);
ColorSlot * addColorSlot(bool isInput, const String &name);
void removeSlot(bool isInput, const String &name);
void removeSlot(bool isInput, NodeConnectionSlot * s);
ParameterSlot* addParameterSlot(bool isInput, Parameter* p);
ColorSlot* addColorSlot(bool isInput, const String& name);
void removeSlot(bool isInput, const String& name);
void removeSlot(bool isInput, NodeConnectionSlot* s);

NodeConnectionSlot * getSlotWithName(bool isInput, const String &name);
Array<NodeConnectionSlot *> getSlotsWithType(bool isInput, ConnectionType type);
ParameterSlot * getParameterSlot(Parameter * p, bool isInput);
NodeConnectionSlot* getSlotWithName(bool isInput, const String& name);
Array<NodeConnectionSlot*> getSlotsWithType(bool isInput, ConnectionType type);
ParameterSlot* getParameterSlot(Parameter* p, bool isInput);

var getParameterValue(Parameter * p, var params, var localParams);
var getParameterValue(Parameter* p, var params, var localParams);

var getLocalParams(var params);
virtual NodeViewUI * createUI();

virtual NodeViewUI* createUI();


//Listener
Expand All @@ -48,13 +48,11 @@ class Node :
public:
/** Destructor. */
virtual ~NodeListener() {}
virtual void slotAdded(Node *, NodeConnectionSlot *, bool /*isInput*/) {}
virtual void slotRemoved(Node *, NodeConnectionSlot *, bool /*isInput*/) {}
virtual void slotAdded(Node*, NodeConnectionSlot*, bool /*isInput*/) {}
virtual void slotRemoved(Node*, NodeConnectionSlot*, bool /*isInput*/) {}
};

ListenerList<NodeListener> nodeListeners;
void addNodeListener(NodeListener* newListener) { nodeListeners.add(newListener); }
void removeNodeListener(NodeListener* listener) { nodeListeners.remove(listener); }
DECLARE_INSPECTACLE_CRITICAL_LISTENER(Node, node);


// ASYNC
Expand All @@ -63,12 +61,12 @@ class Node :
public:
enum Type { INSLOT_ADDED, OUTSLOT_ADDED, INSLOT_REMOVED, OUTSLOT_REMOVED };

NodeEvent(Type t, Node * n, NodeConnectionSlot * slot, var params = var()) :
NodeEvent(Type t, Node* n, NodeConnectionSlot* slot, var params = var()) :
type(t), node(n), slot(slot), params(params) {}

Type type;
Node * node;
NodeConnectionSlot * slot;
Node* node;
NodeConnectionSlot* slot;
var params;
};

Expand All @@ -77,7 +75,7 @@ class Node :

void addAsynNodeListener(AsyncListener* newListener) { nodeNotifier.addListener(newListener); }
void addAsyncCoalescedNodeListener(AsyncListener* newListener) { nodeNotifier.addAsyncCoalescedListener(newListener); }
void removeAsyncNodeListener(AsyncListener* listener) { nodeNotifier.removeListener(listener); }
void removeAsyncNodeListener(AsyncListener* listener) { if (!isClearing && !isBeingDestroyed) nodeNotifier.removeListener(listener); }

private:
WeakReference<Node>::Master masterReference;
Expand Down
4 changes: 1 addition & 3 deletions Source/Node/NodeConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ class NodeConnection :
};


ListenerList<ConnectionListener> connectionListeners;
void addConnectionListener(ConnectionListener* newListener) { connectionListeners.add(newListener); }
void removeConnectionListener(ConnectionListener* listener) { connectionListeners.remove(listener); }
DECLARE_INSPECTACLE_CRITICAL_LISTENER(Connection, connection);


var getJSONData() override;
Expand Down
7 changes: 2 additions & 5 deletions Source/ParameterLink/ParameterLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@ ParameterLink::ParameterLink(WeakReference<Parameter> p) :
linkType(NONE),
parameter(p),
isLinkable(true),
//replacementHasMappingInputToken(false),
isLinkBeingDestroyed(false),
paramLinkNotifier(5)
{

}

ParameterLink::~ParameterLink()
{
//if (list != nullptr && !listRef.wasObjectDeleted())
//{
// list->removeListListener(this);
//}
isLinkBeingDestroyed = true;
}

void ParameterLink::setLinkType(LinkType type)
Expand Down
6 changes: 3 additions & 3 deletions Source/ParameterLink/ParameterLink.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#pragma once

#include "JuceHeader.h"
#include "Prop/PropIncludes.h"

class ParameterLink :
Expand All @@ -26,6 +25,7 @@ class ParameterLink :
WeakReference<Parameter> parameter;

bool isLinkable;
bool isLinkBeingDestroyed;

//links
WeakReference<Parameter> linkedCustomParam; //from ObjectManger custom params
Expand Down Expand Up @@ -61,9 +61,9 @@ class ParameterLink :

ListenerList<ParameterLinkListener> parameterLinkListeners;
void addParameterLinkListener(ParameterLinkListener* newListener) { parameterLinkListeners.add(newListener); }
void removeParameterLinkListener(ParameterLinkListener* listener) { parameterLinkListeners.remove(listener); }
void removeParameterLinkListener(ParameterLinkListener* listener) { if(!isLinkBeingDestroyed) parameterLinkListeners.remove(listener); }

DECLARE_ASYNC_EVENT(ParameterLink, ParameterLink, paramLink, ENUM_LIST(LINK_UPDATED, PREVIEW_UPDATED))
DECLARE_ASYNC_EVENT(ParameterLink, ParameterLink, paramLink, ENUM_LIST(LINK_UPDATED, PREVIEW_UPDATED), !isLinkBeingDestroyed )
};

class ParamLinkContainer :
Expand Down
10 changes: 5 additions & 5 deletions Source/Prop/Prop.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Prop :
public BaseItem,
public Inspectable::InspectableListener,
public Thread,
public LightBlockColorProvider::ProviderListener
public LightBlockColorProvider::ColorProviderListener
{
public:
enum Shape { CLUB, BALL, POI, HOOP, RING, BUGGENG, BOX, CUSTOM };
Expand Down Expand Up @@ -123,6 +123,8 @@ class Prop :
virtual void uploadFileQueue();
virtual void uploadFile(FileToUpload f);

virtual void deleteAllFiles() {}

virtual void updatePlaybackModeOnProp();
virtual void setPlaybackEnabled(bool value) {}
virtual void setStreamingEnabled(bool value) {}
Expand Down Expand Up @@ -156,9 +158,7 @@ class Prop :
virtual void colorsUpdated(Prop*) {}
};

ListenerList<PropListener> propListeners;
void addPropListener(PropListener* newListener) { propListeners.add(newListener); }
void removePropListener(PropListener* listener) { propListeners.remove(listener); }
DECLARE_INSPECTACLE_CRITICAL_LISTENER(Prop, prop);

// ASYNC
class PropEvent
Expand All @@ -179,7 +179,7 @@ class Prop :

void addAsyncPropListener(AsyncListener* newListener) { propNotifier.addListener(newListener); }
void addAsyncCoalescedPropListener(AsyncListener* newListener) { propNotifier.addAsyncCoalescedListener(newListener); }
void removeAsyncPropListener(AsyncListener* listener) { propNotifier.removeListener(listener); }
void removeAsyncPropListener(AsyncListener* listener) { if(!isClearing && !isBeingDestroyed) propNotifier.removeListener(listener); }

virtual void run() override;

Expand Down
Loading

0 comments on commit 6e64c5d

Please sign in to comment.