diff --git a/modules/juce_blocks_basics/blocks/juce_Block.cpp b/modules/juce_blocks_basics/blocks/juce_Block.cpp index 034e708782..09f4d89fad 100644 --- a/modules/juce_blocks_basics/blocks/juce_Block.cpp +++ b/modules/juce_blocks_basics/blocks/juce_Block.cpp @@ -38,7 +38,7 @@ static Block::UID getBlockUIDFromSerialNumber (const BlocksProtocol::BlockSerial return getBlockUIDFromSerialNumber (serial.data); } -static Block::UID getBlockUIDFromSerialNumber (const juce::String& serial) noexcept +static Block::UID getBlockUIDFromSerialNumber (const String& serial) noexcept { if (serial.length() < int (BlocksProtocol::BlockSerialNumber::maxLength)) { @@ -49,12 +49,12 @@ static Block::UID getBlockUIDFromSerialNumber (const juce::String& serial) noexc return getBlockUIDFromSerialNumber ((const uint8*) serial.toRawUTF8()); } -Block::Block (const juce::String& serial) +Block::Block (const String& serial) : serialNumber (serial), uid (getBlockUIDFromSerialNumber (serial)) { } -Block::Block (const juce::String& serial, const juce::String& version, const juce::String& blockName) +Block::Block (const String& serial, const String& version, const String& blockName) : serialNumber (serial), versionNumber (version), name (blockName), uid (getBlockUIDFromSerialNumber (serial)) { } diff --git a/modules/juce_blocks_basics/blocks/juce_Block.h b/modules/juce_blocks_basics/blocks/juce_Block.h index 63da0c51f6..31448f4d41 100644 --- a/modules/juce_blocks_basics/blocks/juce_Block.h +++ b/modules/juce_blocks_basics/blocks/juce_Block.h @@ -28,7 +28,7 @@ namespace juce @tags{Blocks} */ -class Block : public juce::ReferenceCountedObject +class Block : public ReferenceCountedObject { public: //============================================================================== @@ -52,21 +52,21 @@ public: /** The Block class is reference-counted, so always use a Block::Ptr when you are keeping references to them. */ - using Ptr = juce::ReferenceCountedObjectPtr; + using Ptr = ReferenceCountedObjectPtr; /** The Block class is reference-counted, so Block::Array is useful when you are storing lists of them. */ - using Array = juce::ReferenceCountedArray; + using Array = ReferenceCountedArray; /** The Block's serial number. */ - const juce::String serialNumber; + const String serialNumber; /** The Block's version number */ - juce::String versionNumber; + String versionNumber; /** The Block's name */ - juce::String name; + String name; /** This type is used for the unique block identifier. */ using UID = uint64; @@ -95,7 +95,7 @@ public: static bool isControlBlock (Block::Type); /** Returns a human-readable description of this device type. */ - virtual juce::String getDeviceDescription() const = 0; + virtual String getDeviceDescription() const = 0; /** Returns the battery level in the range 0.0 to 1.0. */ virtual float getBatteryLevel() const = 0; @@ -229,10 +229,10 @@ public: virtual ~Program(); /** Returns the LittleFoot program to execute on the BLOCKS device. */ - virtual juce::String getLittleFootProgram() = 0; + virtual String getLittleFootProgram() = 0; /** Returns an array of search paths to use when resolving includes. **/ - virtual juce::Array getSearchPaths() { return {}; } + virtual juce::Array getSearchPaths() { return {}; } Block& block; }; @@ -242,7 +242,7 @@ public: The supplied Program's lifetime will be managed by this class, so do not use the Program in other places in your code. */ - virtual juce::Result setProgram (Program*) = 0; + virtual Result setProgram (Program*) = 0; /** Returns a pointer to the currently loaded program. */ virtual Program* getProgram() const = 0; @@ -324,7 +324,7 @@ public: // Constructor to work around VS2015 bugs... ConfigMetaData (uint32 itemIndex, int32 itemValue, - juce::Range rangeToUse, + Range rangeToUse, bool active, const char* itemName, ConfigType itemType, @@ -387,12 +387,12 @@ public: uint32 item = 0; int32 value = 0; - juce::Range range; + Range range; bool isActive = false; - juce::String name; + String name; ConfigType type = ConfigType::integer; - juce::String optionNames[numOptionNames] = {}; - juce::String group; + String optionNames[numOptionNames] = {}; + String group; }; /** Returns the maximum number of config items available */ @@ -432,7 +432,7 @@ public: virtual void blockReset() = 0; /** Set Block name */ - virtual bool setName (const juce::String& name) = 0; + virtual bool setName (const String& name) = 0; //============================================================================== /** Allows the user to provide a function that will receive log messages from the block. */ @@ -475,11 +475,11 @@ public: protected: //============================================================================== - Block (const juce::String& serialNumberToUse); - Block (const juce::String& serial, const juce::String& version, const juce::String& name); + Block (const String& serialNumberToUse); + Block (const String& serial, const String& version, const String& name); - juce::ListenerList dataInputPortListeners; - juce::ListenerList programEventListeners; + ListenerList dataInputPortListeners; + ListenerList programEventListeners; private: //============================================================================== diff --git a/modules/juce_blocks_basics/blocks/juce_BlockConfigManager.h b/modules/juce_blocks_basics/blocks/juce_BlockConfigManager.h index 7de8336bb3..0b288c6f25 100644 --- a/modules/juce_blocks_basics/blocks/juce_BlockConfigManager.h +++ b/modules/juce_blocks_basics/blocks/juce_BlockConfigManager.h @@ -237,7 +237,7 @@ struct BlockConfigManager // Send setConfigState message to Block } - juce::String getOptionName (ConfigItemId item, uint8 optionIndex) + String getOptionName (ConfigItemId item, uint8 optionIndex) { uint32 itemIndex; diff --git a/modules/juce_blocks_basics/blocks/juce_BlocksVersion.cpp b/modules/juce_blocks_basics/blocks/juce_BlocksVersion.cpp index e1968f3e80..c0af1b98d5 100644 --- a/modules/juce_blocks_basics/blocks/juce_BlocksVersion.cpp +++ b/modules/juce_blocks_basics/blocks/juce_BlocksVersion.cpp @@ -108,7 +108,7 @@ bool BlocksVersion::isGreaterThan (const BlocksVersion& other) const bool BlocksVersion::releaseTypeGreaterThan (const BlocksVersion& other) const { - auto getReleaseTypePriority = [](const juce::BlocksVersion& version) + auto getReleaseTypePriority = [](const BlocksVersion& version) { String releaseTypes[4] = { "alpha", "beta", "rc", {} }; diff --git a/modules/juce_blocks_basics/blocks/juce_BlocksVersion.h b/modules/juce_blocks_basics/blocks/juce_BlocksVersion.h index c621c7a42d..66f8bbf5b2 100644 --- a/modules/juce_blocks_basics/blocks/juce_BlocksVersion.h +++ b/modules/juce_blocks_basics/blocks/juce_BlocksVersion.h @@ -38,21 +38,21 @@ public: int patch = 0; /** The release tag for this version, such as "beta", "alpha", "rc", etc */ - juce::String releaseType; + String releaseType; /** A numberical value assosiated with the release tag, such as "beta 4" */ int releaseCount = 0; /** The assosiated git commit that generated this firmware version */ - juce::String commit; + String commit; /** Identify "forced" firmware builds **/ bool forced = false; - juce::String toString (bool extended = false) const; + String toString (bool extended = false) const; - /** Constructs a version number from an formatted juce::String */ - BlocksVersion (const juce::String&); + /** Constructs a version number from an formatted String */ + BlocksVersion (const String&); /** Constructs a version number from another BlocksVersion */ BlocksVersion (const BlocksVersion& other) = default; @@ -61,7 +61,7 @@ public: BlocksVersion() = default; /** Returns true if string format is valid */ - static bool isValidVersion (const juce::String& versionString); + static bool isValidVersion (const String& versionString); bool operator == (const BlocksVersion&) const; bool operator != (const BlocksVersion&) const; @@ -72,7 +72,7 @@ public: private: /** @internal */ - bool evaluate (const juce::String& versionString); + bool evaluate (const String& versionString); bool releaseTypeGreaterThan (const BlocksVersion& otherReleaseType) const; bool isGreaterThan (const BlocksVersion& other) const; diff --git a/modules/juce_blocks_basics/blocks/juce_ControlButton.h b/modules/juce_blocks_basics/blocks/juce_ControlButton.h index f65cec1ec7..426a14a217 100644 --- a/modules/juce_blocks_basics/blocks/juce_ControlButton.h +++ b/modules/juce_blocks_basics/blocks/juce_ControlButton.h @@ -91,7 +91,7 @@ public: virtual ButtonFunction getType() const = 0; /** Returns the button's description. */ - virtual juce::String getName() const = 0; + virtual String getName() const = 0; /** Returns the position of this button on the device, in device units. For buttons that are on the side of the device, this may want to return a value that @@ -133,7 +133,7 @@ public: Block& block; protected: - juce::ListenerList listeners; + ListenerList listeners; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ControlButton) }; diff --git a/modules/juce_blocks_basics/blocks/juce_LEDGrid.h b/modules/juce_blocks_basics/blocks/juce_LEDGrid.h index 7f9e219710..192383f634 100644 --- a/modules/juce_blocks_basics/blocks/juce_LEDGrid.h +++ b/modules/juce_blocks_basics/blocks/juce_LEDGrid.h @@ -73,7 +73,7 @@ public: //============================================================================== /** An interface to use for LEDGrid rendering. */ - struct Renderer : public juce::ReferenceCountedObject + struct Renderer : public ReferenceCountedObject { ~Renderer() override; virtual void renderLEDGrid (LEDGrid&) = 0; @@ -81,7 +81,7 @@ public: /** The Renderer class is reference-counted, so always use a Renderer::Ptr when you are keeping references to them. */ - using Ptr = juce::ReferenceCountedObjectPtr; + using Ptr = ReferenceCountedObjectPtr; }; /** Set the visualiser that will create visuals for this block (nullptr for none). diff --git a/modules/juce_blocks_basics/blocks/juce_StatusLight.h b/modules/juce_blocks_basics/blocks/juce_StatusLight.h index e644090593..c96307d737 100644 --- a/modules/juce_blocks_basics/blocks/juce_StatusLight.h +++ b/modules/juce_blocks_basics/blocks/juce_StatusLight.h @@ -38,7 +38,7 @@ public: //============================================================================== /** Returns a name to describe this light. */ - virtual juce::String getName() const = 0; + virtual String getName() const = 0; /** Changes the light's colour. */ virtual bool setColour (LEDColour newColour) = 0; diff --git a/modules/juce_blocks_basics/blocks/juce_TouchList.h b/modules/juce_blocks_basics/blocks/juce_TouchList.h index 858b97a375..2b99311d3a 100644 --- a/modules/juce_blocks_basics/blocks/juce_TouchList.h +++ b/modules/juce_blocks_basics/blocks/juce_TouchList.h @@ -144,7 +144,7 @@ private: return t1.index == t2.index && t1.blockUID == t2.blockUID; } - juce::Array touches; + Array touches; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TouchList) }; diff --git a/modules/juce_blocks_basics/blocks/juce_TouchSurface.h b/modules/juce_blocks_basics/blocks/juce_TouchSurface.h index 1b83f8f31b..c86b7499fc 100644 --- a/modules/juce_blocks_basics/blocks/juce_TouchSurface.h +++ b/modules/juce_blocks_basics/blocks/juce_TouchSurface.h @@ -130,7 +130,7 @@ public: protected: //============================================================================== - juce::ListenerList listeners; + ListenerList listeners; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TouchSurface) }; diff --git a/modules/juce_blocks_basics/littlefoot/juce_LittleFootCompiler.h b/modules/juce_blocks_basics/littlefoot/juce_LittleFootCompiler.h index 75fbbfae07..f771790da1 100644 --- a/modules/juce_blocks_basics/littlefoot/juce_LittleFootCompiler.h +++ b/modules/juce_blocks_basics/littlefoot/juce_LittleFootCompiler.h @@ -489,7 +489,7 @@ private: return; } - juce::File fileToInclude = resolveIncludePath (currentValue.toString()); + File fileToInclude = resolveIncludePath (currentValue.toString()); if (fileToInclude == File()) return; diff --git a/modules/juce_blocks_basics/littlefoot/juce_LittleFootRemoteHeap.h b/modules/juce_blocks_basics/littlefoot/juce_LittleFootRemoteHeap.h index beff6be463..c124ecd0f1 100644 --- a/modules/juce_blocks_basics/littlefoot/juce_LittleFootRemoteHeap.h +++ b/modules/juce_blocks_basics/littlefoot/juce_LittleFootRemoteHeap.h @@ -285,7 +285,7 @@ private: double proportionOK = ((int) blockSize - differences) / (double) blockSize; - juce::ignoreUnused (proportionOK); + ignoreUnused (proportionOK); DBG ("Heap: " << areas << " " << String (roundToInt (100 * proportionOK)) << "% " << (isProgramLoaded() ? "Ready" : "Loading")); diff --git a/modules/juce_blocks_basics/littlefoot/juce_LittleFootRunner.h b/modules/juce_blocks_basics/littlefoot/juce_LittleFootRunner.h index 8a6bf64ea7..2e412830c0 100644 --- a/modules/juce_blocks_basics/littlefoot/juce_LittleFootRunner.h +++ b/modules/juce_blocks_basics/littlefoot/juce_LittleFootRunner.h @@ -173,10 +173,10 @@ struct NativeFunction jassert (slash > 0); // The slash can't be the first character in this string! jassert (nameAndArgTypes[slash + 1] != 0); // The slash must be followed by a return type character - jassert (juce::String (nameAndArgTypes).substring (0, slash).containsOnly ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")); - jassert (! juce::String ("0123456789").containsChar (nameAndArgTypes[0])); - jassert (juce::String (nameAndArgTypes).substring (slash + 1).containsOnly ("vifb")); - jassert (juce::String (nameAndArgTypes).substring (slash + 2).containsOnly ("ifb")); // arguments must only be of these types + jassert (String (nameAndArgTypes).substring (0, slash).containsOnly ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")); + jassert (! String ("0123456789").containsChar (nameAndArgTypes[0])); + jassert (String (nameAndArgTypes).substring (slash + 1).containsOnly ("vifb")); + jassert (String (nameAndArgTypes).substring (slash + 2).containsOnly ("ifb")); // arguments must only be of these types uint32 hash = 0, i = 0; @@ -307,29 +307,29 @@ struct Program #if JUCE_DEBUG //============================================================================== /** Prints the assembly code for a given function. */ - void dumpFunctionDisassembly (juce::OutputStream& out, uint32 functionIndex) const + void dumpFunctionDisassembly (OutputStream& out, uint32 functionIndex) const { - out << juce::newLine << "Function #" << (int) functionIndex - << " (" << juce::String::toHexString (getFunctionID (functionIndex)) << ")" << juce::newLine; + out << newLine << "Function #" << (int) functionIndex + << " (" << String::toHexString (getFunctionID (functionIndex)) << ")" << newLine; if (auto codeStart = getFunctionStartAddress (functionIndex)) if (auto codeEnd = getFunctionEndAddress (functionIndex)) for (auto prog = codeStart; prog < codeEnd;) - out << getOpDisassembly (prog) << juce::newLine; + out << getOpDisassembly (prog) << newLine; } - juce::String getOpDisassembly (const uint8*& prog) const + String getOpDisassembly (const uint8*& prog) const { - juce::String s; - s << juce::String::toHexString ((int) (prog - programStart)).paddedLeft ('0', 4) << ": "; + String s; + s << String::toHexString ((int) (prog - programStart)).paddedLeft ('0', 4) << ": "; auto op = (OpCode) *prog++; switch (op) { #define LITTLEFOOT_OP(name) case OpCode::name: s << #name; break; - #define LITTLEFOOT_OP_INT8(name) case OpCode::name: s << #name << " " << juce::String::toHexString ((int) *prog++).paddedLeft ('0', 2); break; - #define LITTLEFOOT_OP_INT16(name) case OpCode::name: s << #name << " " << juce::String::toHexString ((int) readInt16 (prog)).paddedLeft ('0', 4); prog += 2; break; - #define LITTLEFOOT_OP_INT32(name) case OpCode::name: s << #name << " " << juce::String::toHexString ((int) readInt32 (prog)).paddedLeft ('0', 8); prog += 4; break; + #define LITTLEFOOT_OP_INT8(name) case OpCode::name: s << #name << " " << String::toHexString ((int) *prog++).paddedLeft ('0', 2); break; + #define LITTLEFOOT_OP_INT16(name) case OpCode::name: s << #name << " " << String::toHexString ((int) readInt16 (prog)).paddedLeft ('0', 4); prog += 2; break; + #define LITTLEFOOT_OP_INT32(name) case OpCode::name: s << #name << " " << String::toHexString ((int) readInt32 (prog)).paddedLeft ('0', 8); prog += 4; break; LITTLEFOOT_OPCODES (LITTLEFOOT_OP, LITTLEFOOT_OP_INT8, LITTLEFOOT_OP_INT16, LITTLEFOOT_OP_INT32) #undef LITTLEFOOT_OP #undef LITTLEFOOT_OP_INT8 @@ -343,7 +343,7 @@ struct Program } /** Calls dumpFunctionDisassembly() for all functions. */ - void dumpAllFunctions (juce::OutputStream& out) const + void dumpAllFunctions (OutputStream& out) const { if (programStart != nullptr) { @@ -813,13 +813,13 @@ struct Runner void dumpDebugTrace() const { #if LITTLEFOOT_DEBUG_TRACE // Dumps the program counter and stack, for debugging - juce::MemoryOutputStream dump; + MemoryOutputStream dump; auto progCopy = programCounter; - dump << juce::String (runner->program.getOpDisassembly (progCopy)).paddedRight (' ', 26) - << juce::String::toHexString (tos) << ' '; + dump << String (runner->program.getOpDisassembly (progCopy)).paddedRight (' ', 26) + << String::toHexString (tos) << ' '; for (auto s = stack; s < stackEnd; ++s) - dump << juce::String::toHexString (*s) << ' '; + dump << String::toHexString (*s) << ' '; DBG (dump.toString()); #endif @@ -859,7 +859,7 @@ private: globals[i] = 0; // clear globals #if LITTLEFOOT_DUMP_PROGRAM - juce::MemoryOutputStream m; + MemoryOutputStream m; program.dumpAllFunctions (m); DBG (m.toString()); #endif diff --git a/modules/juce_blocks_basics/protocol/juce_BlockModels.h b/modules/juce_blocks_basics/protocol/juce_BlockModels.h index 74cd935115..d22f505175 100644 --- a/modules/juce_blocks_basics/protocol/juce_BlockModels.h +++ b/modules/juce_blocks_basics/protocol/juce_BlockModels.h @@ -70,14 +70,14 @@ struct BlockDataSheet struct StatusLEDInfo { - juce::String name; + String name; float x, y; }; - juce::Array buttons; - juce::Array statusLEDs; - juce::Array ports; - juce::Array dials; + Array buttons; + Array statusLEDs; + Array ports; + Array dials; private: //============================================================================== diff --git a/modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h b/modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h index 4bc47f6e07..743128a500 100644 --- a/modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h +++ b/modules/juce_blocks_basics/protocol/juce_BlocksProtocolDefinitions.h @@ -141,9 +141,9 @@ struct BlockStringData return length > 0; } - juce::String asString() const + String asString() const { - return juce::String ((const char*) data, length); + return String ((const char*) data, length); } bool operator== (const BlockStringData& other) const diff --git a/modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h b/modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h index ac823854a5..f84a6d438b 100644 --- a/modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h +++ b/modules/juce_blocks_basics/protocol/juce_HostPacketBuilder.h @@ -294,7 +294,7 @@ struct HostPacketBuilder return true; } - bool addSetBlockName (const juce::String& name) + bool addSetBlockName (const String& name) { if (name.length() > 32 || ! data.hasCapacity (MessageType::bits + 7 + (7 * name.length()))) return false; diff --git a/modules/juce_blocks_basics/topology/internal/juce_BandwidthStatsLogger.cpp b/modules/juce_blocks_basics/topology/internal/juce_BandwidthStatsLogger.cpp index eec2903558..41e2401564 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_BandwidthStatsLogger.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_BandwidthStatsLogger.cpp @@ -42,17 +42,17 @@ namespace { bytesPerSec = (int) (byteCount / elapsedSec); byteCount = 0; - juce::Logger::writeToLog (getString()); + Logger::writeToLog (getString()); } } - juce::String getString() const + String getString() const { - return juce::String (name) + ": " - + "count=" + juce::String (messageCount).paddedRight (' ', 7) - + "rate=" + (juce::String (bytesPerSec / 1024.0f, 1) + " Kb/sec").paddedRight (' ', 11) - + "largest=" + (juce::String (largestMessageBytes) + " bytes").paddedRight (' ', 11) - + "last=" + (juce::String (lastMessageBytes) + " bytes").paddedRight (' ', 11); + return String (name) + ": " + + "count=" + String (messageCount).paddedRight (' ', 7) + + "rate=" + (String (bytesPerSec / 1024.0f, 1) + " Kb/sec").paddedRight (' ', 11) + + "largest=" + (String (largestMessageBytes) + " bytes").paddedRight (' ', 11) + + "last=" + (String (lastMessageBytes) + " bytes").paddedRight (' ', 11); } void registerMessage (int numBytes) noexcept @@ -60,7 +60,7 @@ namespace byteCount += numBytes; ++messageCount; lastMessageBytes = numBytes; - largestMessageBytes = juce::jmax (largestMessageBytes, numBytes); + largestMessageBytes = jmax (largestMessageBytes, numBytes); } }; @@ -69,7 +69,7 @@ namespace static inline void resetOnSecondBoundary() { - auto now = juce::Time::getMillisecondCounter(); + auto now = Time::getMillisecondCounter(); double elapsedSec = (now - startTime) / 1000.0; if (elapsedSec >= 1.0) @@ -93,7 +93,7 @@ namespace } } -juce::String getMidiIOStats() +String getMidiIOStats() { return inputStats.getString() + " " + outputStats.getString(); } diff --git a/modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp b/modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp index 2599be24e2..4e327e486d 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp @@ -122,14 +122,14 @@ public: } Type getType() const override { return modelData.apiType; } - juce::String getDeviceDescription() const override { return modelData.description; } + String getDeviceDescription() const override { return modelData.description; } int getWidth() const override { return modelData.widthUnits; } int getHeight() const override { return modelData.heightUnits; } float getMillimetersPerUnit() const override { return 47.0f; } bool isHardwareBlock() const override { return true; } juce::Array getPorts() const override { return modelData.ports; } bool isConnected() const override { return detector && detector->isConnected (uid); } - juce::Time getConnectionTime() const override { return connectionTime; } + Time getConnectionTime() const override { return connectionTime; } bool isMasterBlock() const override { return isMaster; } Block::UID getConnectedMasterUID() const override { return masterUID; } int getRotation() const override { return rotation; } @@ -192,7 +192,7 @@ public: { if (detector != nullptr) { - lastMessageSendTime = juce::Time::getCurrentTime(); + lastMessageSendTime = Time::getCurrentTime(); return detector->sendMessageToDevice (uid, builder); } @@ -241,12 +241,12 @@ public: } //============================================================================== - juce::Result setProgram (Program* newProgram) override + Result setProgram (Program* newProgram) override { if (newProgram != nullptr && program.get() == newProgram) { jassertfalse; - return juce::Result::ok(); + return Result::ok(); } stopTimer(); @@ -257,7 +257,7 @@ public: if (program != nullptr && newProgram != nullptr && program->getLittleFootProgram() == newProgram->getLittleFootProgram()) - return juce::Result::ok(); + return Result::ok(); std::swap (program, p); } @@ -268,7 +268,7 @@ public: if (program == nullptr) { remoteHeap.clear(); - return juce::Result::ok(); + return Result::ok(); } littlefoot::Compiler compiler; @@ -303,10 +303,10 @@ public: startTimer (20); - return juce::Result::ok(); + return Result::ok(); } - Program* getProgram() const override { return program.get(); } + Program* getProgram() const override { return program.get(); } void sendProgramEvent (const ProgramEventMessage& message) override { @@ -419,7 +419,7 @@ public: void pingFromDevice() { - lastMessageReceiveTime = juce::Time::getCurrentTime(); + lastMessageReceiveTime = Time::getCurrentTime(); } void addDataInputPortListener (DataInputPortListener* listener) override @@ -444,7 +444,7 @@ public: remoteHeap.sendChanges (*this, false); - if (lastMessageSendTime < juce::Time::getCurrentTime() - juce::RelativeTime::milliseconds (pingIntervalMs)) + if (lastMessageSendTime < Time::getCurrentTime() - RelativeTime::milliseconds (pingIntervalMs)) sendCommandMessage (BlocksProtocol::ping); } @@ -518,7 +518,7 @@ public: programLoadedCallback = std::move (programLoaded); } - bool setName (const juce::String& newName) override + bool setName (const String& newName) override { return buildAndSendPacket<128> ([&newName] (BlocksProtocol::HostPacketBuilder<128>& p) { return p.addSetBlockName (newName); }); @@ -547,10 +547,10 @@ public: //============================================================================== std::unique_ptr touchSurface; - juce::OwnedArray controlButtons; + OwnedArray controlButtons; std::unique_ptr ledGrid; std::unique_ptr ledRow; - juce::OwnedArray statusLights; + OwnedArray statusLights; BlocksProtocol::BlockDataSheet modelData; @@ -568,7 +568,7 @@ public: RemoteHeapType remoteHeap; WeakReference detector; - juce::Time lastMessageSendTime, lastMessageReceiveTime; + Time lastMessageSendTime, lastMessageReceiveTime; BlockConfigManager config; std::function configChangedCallback; @@ -605,7 +605,7 @@ private: config.setDeviceComms (listenerToMidiConnection); } - const juce::MidiInput* getMidiInput() const + const MidiInput* getMidiInput() const { if (detector != nullptr) if (auto c = dynamic_cast (detector->getDeviceConnectionFor (*this))) @@ -615,12 +615,12 @@ private: return nullptr; } - juce::MidiInput* getMidiInput() + MidiInput* getMidiInput() { - return const_cast (static_cast(*this).getMidiInput()); + return const_cast (static_cast(*this).getMidiInput()); } - const juce::MidiOutput* getMidiOutput() const + const MidiOutput* getMidiOutput() const { if (detector != nullptr) if (auto c = dynamic_cast (detector->getDeviceConnectionFor (*this))) @@ -630,12 +630,12 @@ private: return nullptr; } - juce::MidiOutput* getMidiOutput() + MidiOutput* getMidiOutput() { - return const_cast (static_cast(*this).getMidiOutput()); + return const_cast (static_cast(*this).getMidiOutput()); } - void handleIncomingMidiMessage (const juce::MidiMessage& message) override + void handleIncomingMidiMessage (const MidiMessage& message) override { dataInputPortListeners.call ([&] (DataInputPortListener& l) { l.handleIncomingDataPortMessage (*this, message.getRawData(), (size_t) message.getRawDataSize()); }); @@ -644,7 +644,7 @@ private: void connectionBeingDeleted (const MIDIDeviceConnection& c) override { jassert (listenerToMidiConnection == &c); - juce::ignoreUnused (c); + ignoreUnused (c); listenerToMidiConnection->removeListener (this); listenerToMidiConnection = nullptr; config.setDeviceComms (nullptr); @@ -679,7 +679,7 @@ private: public: //============================================================================== struct TouchSurfaceImplementation : public TouchSurface, - private juce::Timer + private Timer { TouchSurfaceImplementation (BlockImplementation& b) : TouchSurface (b), blockImpl (b) { @@ -712,7 +712,7 @@ public: // Fake a touch end if we receive a duplicate touch-start with no preceding touch-end (ie: comms error) if (touchEvent.isTouchStart && status.isActive) - killTouch (touchEvent, status, juce::Time::getMillisecondCounter()); + killTouch (touchEvent, status, Time::getMillisecondCounter()); // Fake a touch start if we receive an unexpected event with no matching start event. (ie: comms error) if (! touchEvent.isTouchStart && ! status.isActive) @@ -729,7 +729,7 @@ public: } // Normal handling: - status.lastEventTime = juce::Time::getMillisecondCounter(); + status.lastEventTime = Time::getMillisecondCounter(); status.isActive = ! touchEvent.isTouchEnd; if (touchEvent.isTouchStart) @@ -746,7 +746,7 @@ public: for (auto& t : touches) { auto& status = t.value; - auto now = juce::Time::getMillisecondCounter(); + auto now = Time::getMillisecondCounter(); if (status.isActive && now > status.lastEventTime + touchTimeOutMs) killTouch (t.touch, status, now); @@ -781,7 +781,7 @@ public: void cancelAllActiveTouches() noexcept override { - const auto now = juce::Time::getMillisecondCounter(); + const auto now = Time::getMillisecondCounter(); for (auto& t : touches) if (t.value.isActive) @@ -808,12 +808,12 @@ public: { } - ButtonFunction getType() const override { return buttonInfo.type; } - juce::String getName() const override { return BlocksProtocol::getButtonNameForFunction (buttonInfo.type); } - float getPositionX() const override { return buttonInfo.x; } - float getPositionY() const override { return buttonInfo.y; } + ButtonFunction getType() const override { return buttonInfo.type; } + String getName() const override { return BlocksProtocol::getButtonNameForFunction (buttonInfo.type); } + float getPositionX() const override { return buttonInfo.x; } + float getPositionY() const override { return buttonInfo.y; } - bool hasLight() const override { return blockImpl.isControlBlock(); } + bool hasLight() const override { return blockImpl.isControlBlock(); } bool setLightColour (LEDColour colour) override { @@ -865,12 +865,12 @@ public: { } - juce::String getName() const override { return info.name; } + String getName() const override { return info.name; } bool setColour (LEDColour newColour) override { // XXX TODO! - juce::ignoreUnused (newColour); + ignoreUnused (newColour); return false; } @@ -979,7 +979,7 @@ public: { DefaultLEDGridProgram (Block& b) : Block::Program (b) {} - juce::String getLittleFootProgram() override + String getLittleFootProgram() override { /* Data format: diff --git a/modules/juce_blocks_basics/topology/internal/juce_ConnectedDeviceGroup.cpp b/modules/juce_blocks_basics/topology/internal/juce_ConnectedDeviceGroup.cpp index 5dbbf2817b..1b0be1c8cb 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_ConnectedDeviceGroup.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_ConnectedDeviceGroup.cpp @@ -32,18 +32,18 @@ namespace } template -struct ConnectedDeviceGroup : private juce::AsyncUpdater, - private juce::Timer +struct ConnectedDeviceGroup : private AsyncUpdater, + private Timer { //============================================================================== - ConnectedDeviceGroup (Detector& d, const juce::String& name, PhysicalTopologySource::DeviceConnection* connection) + ConnectedDeviceGroup (Detector& d, const String& name, PhysicalTopologySource::DeviceConnection* connection) : detector (d), deviceName (name), deviceConnection (connection) { if (auto midiDeviceConnection = static_cast (deviceConnection.get())) { depreciatedVersionReader = std::make_unique (*midiDeviceConnection); - juce::ScopedLock lock (midiDeviceConnection->criticalSecton); + ScopedLock lock (midiDeviceConnection->criticalSecton); setMidiMessageCallback(); } else @@ -61,7 +61,7 @@ struct ConnectedDeviceGroup : private juce::AsyncUpdater, detector.handleDeviceRemoved (device); } - bool isStillConnected (const juce::StringArray& detectedDevices) const noexcept + bool isStillConnected (const StringArray& detectedDevices) const noexcept { return detectedDevices.contains (deviceName) && ! failedToGetTopology(); } @@ -104,7 +104,7 @@ struct ConnectedDeviceGroup : private juce::AsyncUpdater, void endTopology() { - lastTopologyReceiveTime = juce::Time::getCurrentTime(); + lastTopologyReceiveTime = Time::getCurrentTime(); if (incomingTopologyDevices.isEmpty() || incomingTopologyConnections.size() < incomingTopologyDevices.size() - 1) @@ -268,9 +268,9 @@ struct ConnectedDeviceGroup : private juce::AsyncUpdater, return deviceConnection.get(); } - juce::Array getCurrentDeviceConnections() + Array getCurrentDeviceConnections() { - juce::Array connections; + Array connections; for (const auto& connection : currentDeviceConnections) if (isApiConnected (getDeviceIDFromIndex (connection.device1)) && isApiConnected (getDeviceIDFromIndex (connection.device2))) @@ -280,20 +280,20 @@ struct ConnectedDeviceGroup : private juce::AsyncUpdater, } Detector& detector; - juce::String deviceName; + String deviceName; static constexpr double pingTimeoutSeconds = 6.0; private: //============================================================================== - juce::Array currentDeviceInfo; - juce::Array incomingTopologyDevices; - juce::Array incomingTopologyConnections, currentDeviceConnections; + Array currentDeviceInfo; + Array incomingTopologyDevices; + Array incomingTopologyConnections, currentDeviceConnections; std::unique_ptr deviceConnection; - juce::CriticalSection incomingPacketLock; - juce::Array incomingPackets; + CriticalSection incomingPacketLock; + Array incomingPackets; std::unique_ptr depreciatedVersionReader; @@ -305,10 +305,10 @@ private: //============================================================================== void timerCallback() override { - const auto now = juce::Time::getCurrentTime(); + const auto now = Time::getCurrentTime(); - if ((now > lastTopologyReceiveTime + juce::RelativeTime::seconds (30.0)) - && now > lastTopologyRequestTime + juce::RelativeTime::seconds (1.0) + if ((now > lastTopologyReceiveTime + RelativeTime::seconds (30.0)) + && now > lastTopologyRequestTime + RelativeTime::seconds (1.0) && numTopologyRequestsSent < 4) sendTopologyRequest(); @@ -328,10 +328,10 @@ private: void handleIncomingMessage (const void* data, size_t dataSize) { - juce::MemoryBlock mb (data, dataSize); + MemoryBlock mb (data, dataSize); { - const juce::ScopedLock sl (incomingPacketLock); + const ScopedLock sl (incomingPacketLock); incomingPackets.add (std::move (mb)); } @@ -344,11 +344,11 @@ private: void handleAsyncUpdate() override { - juce::Array packets; + Array packets; packets.ensureStorageAllocated (32); { - const juce::ScopedLock sl (incomingPacketLock); + const ScopedLock sl (incomingPacketLock); incomingPackets.swapWith (packets); } @@ -371,27 +371,27 @@ private: } //============================================================================== - juce::Time lastTopologyRequestTime, lastTopologyReceiveTime; + Time lastTopologyRequestTime, lastTopologyReceiveTime; int numTopologyRequestsSent = 0; void scheduleNewTopologyRequest() { LOG_CONNECTIVITY ("Topology Request Scheduled"); numTopologyRequestsSent = 0; - lastTopologyReceiveTime = juce::Time(); - lastTopologyRequestTime = juce::Time::getCurrentTime(); + lastTopologyReceiveTime = Time(); + lastTopologyRequestTime = Time::getCurrentTime(); } void sendTopologyRequest() { ++numTopologyRequestsSent; - lastTopologyRequestTime = juce::Time::getCurrentTime(); + lastTopologyRequestTime = Time::getCurrentTime(); sendCommandMessage (0, BlocksProtocol::requestTopologyMessage); } bool failedToGetTopology() const noexcept { - return numTopologyRequestsSent >= 4 && lastTopologyReceiveTime == juce::Time(); + return numTopologyRequestsSent >= 4 && lastTopologyReceiveTime == Time(); } //============================================================================== @@ -435,11 +435,11 @@ private: struct BlockPingTime { Block::UID blockUID; - juce::Time lastPing; - juce::Time connected; + Time lastPing; + Time connected; }; - juce::Array blockPings; + Array blockPings; BlockPingTime* getPing (Block::UID uid) { @@ -468,7 +468,7 @@ private: void updateApiPing (Block::UID uid) { - const auto now = juce::Time::getCurrentTime(); + const auto now = Time::getCurrentTime(); if (auto* ping = getPing (uid)) { @@ -503,13 +503,13 @@ private: scheduleNewTopologyRequest(); } - void checkApiTimeouts (juce::Time now) + void checkApiTimeouts (Time now) { Array toRemove; for (const auto& ping : blockPings) { - if (ping.lastPing < now - juce::RelativeTime::seconds (pingTimeoutSeconds)) + if (ping.lastPing < now - RelativeTime::seconds (pingTimeoutSeconds)) { LOG_CONNECTIVITY ("Ping timeout: " << ping.blockUID); toRemove.add (ping.blockUID); diff --git a/modules/juce_blocks_basics/topology/internal/juce_DepreciatedVersionReader.cpp b/modules/juce_blocks_basics/topology/internal/juce_DepreciatedVersionReader.cpp index f63a28b4e2..6d24d70ffb 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_DepreciatedVersionReader.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_DepreciatedVersionReader.cpp @@ -70,7 +70,7 @@ private: static constexpr size_t numFirmwareApps = 3; BlocksProtocol::VersionNumber result[numFirmwareApps]; MIDIDeviceConnection& deviceConnection; - juce::Atomic currentRequest = 0; + Atomic currentRequest = 0; //============================================================================== bool allRequestsComplete() const { return currentRequest.get() >= numFirmwareApps; } diff --git a/modules/juce_blocks_basics/topology/internal/juce_Detector.cpp b/modules/juce_blocks_basics/topology/internal/juce_Detector.cpp index 94b97989cf..7a5867c01d 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_Detector.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_Detector.cpp @@ -25,9 +25,9 @@ namespace juce //============================================================================== /** This is the main singleton object that keeps track of connected blocks */ -struct Detector : public juce::ReferenceCountedObject, - private juce::Timer, - private juce::AsyncUpdater +struct Detector : public ReferenceCountedObject, + private Timer, + private AsyncUpdater { using BlockImpl = BlockImplementation; @@ -46,7 +46,7 @@ struct Detector : public juce::ReferenceCountedObject, jassert (activeTopologySources.isEmpty()); } - using Ptr = juce::ReferenceCountedObjectPtr; + using Ptr = ReferenceCountedObjectPtr; static Detector::Ptr getDefaultDetector() { @@ -370,7 +370,7 @@ struct Detector : public juce::ReferenceCountedObject, std::unique_ptr defaultDetector; PhysicalTopologySource::DeviceDetector& deviceDetector; - juce::Array activeTopologySources; + Array activeTopologySources; BlockTopology currentTopology; @@ -387,7 +387,7 @@ private: handleDevicesAdded (detectedDevices); } - bool containsBlockWithUID (const juce::Block::Array& blocks, juce::Block::UID uid) + bool containsBlockWithUID (const Block::Array& blocks, Block::UID uid) { for (const auto block : blocks) if (block->uid == uid) @@ -396,14 +396,14 @@ private: return false; } - void handleDevicesRemoved (const juce::StringArray& detectedDevices) + void handleDevicesRemoved (const StringArray& detectedDevices) { for (int i = connectedDeviceGroups.size(); --i >= 0;) if (! connectedDeviceGroups.getUnchecked(i)->isStillConnected (detectedDevices)) connectedDeviceGroups.remove (i); } - void handleDevicesAdded (const juce::StringArray& detectedDevices) + void handleDevicesAdded (const StringArray& detectedDevices) { for (const auto& devName : detectedDevices) { @@ -417,7 +417,7 @@ private: } } - bool hasDeviceFor (const juce::String& devName) const + bool hasDeviceFor (const String& devName) const { for (auto d : connectedDeviceGroups) if (d->deviceName == devName) @@ -434,7 +434,7 @@ private: return nullptr; } - juce::OwnedArray> connectedDeviceGroups; + OwnedArray> connectedDeviceGroups; //============================================================================== /** This is a friend of the BlocksImplementation that will scan and set the @@ -447,7 +447,7 @@ private: static Block::Array updateBlocks (const BlockTopology& topology) { Block::Array updated; - juce::Array visited; + Array visited; for (auto& block : topology.blocks) { @@ -513,7 +513,7 @@ private: static void layoutNeighbours (const Block::Ptr block, const BlockTopology& topology, - juce::Array& visited, + Array& visited, Block::Array& updated) { visited.add (block->uid); @@ -588,7 +588,7 @@ private: //============================================================================== #if DUMP_TOPOLOGY - static juce::String idToSerialNum (const BlockTopology& topology, Block::UID uid) + static String idToSerialNum (const BlockTopology& topology, Block::UID uid) { for (auto* b : topology.blocks) if (b->uid == uid) @@ -597,7 +597,7 @@ private: return "???"; } - static juce::String portEdgeToString (Block::ConnectionPort port) + static String portEdgeToString (Block::ConnectionPort port) { switch (port.edge) { @@ -610,9 +610,9 @@ private: return {}; } - static juce::String portToString (Block::ConnectionPort port) + static String portToString (Block::ConnectionPort port) { - return portEdgeToString (port) + "_" + juce::String (port.index); + return portEdgeToString (port) + "_" + String (port.index); } static void dumpTopology (const BlockTopology& topology) @@ -635,8 +635,8 @@ private: if (auto bi = BlockImplementation::getFrom (*block)) m << " Short address: " << (int) bi->getDeviceIndex() << newLine; - m << " Battery level: " + juce::String (juce::roundToInt (100.0f * block->getBatteryLevel())) + "%" << newLine - << " Battery charging: " + juce::String (block->isBatteryCharging() ? "y" : "n") << newLine + m << " Battery level: " + String (roundToInt (100.0f * block->getBatteryLevel())) + "%" << newLine + << " Battery charging: " + String (block->isBatteryCharging() ? "y" : "n") << newLine << " Width: " << block->getWidth() << newLine << " Height: " << block->getHeight() << newLine << " Millimeters per unit: " << block->getMillimetersPerUnit() << newLine diff --git a/modules/juce_blocks_basics/topology/internal/juce_DetectorHolder.cpp b/modules/juce_blocks_basics/topology/internal/juce_DetectorHolder.cpp index eb41618215..b2297cef04 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_DetectorHolder.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_DetectorHolder.cpp @@ -23,7 +23,7 @@ namespace juce { -struct PhysicalTopologySource::DetectorHolder : private juce::Timer +struct PhysicalTopologySource::DetectorHolder : private Timer { DetectorHolder (PhysicalTopologySource& pts) : topologySource (pts), diff --git a/modules/juce_blocks_basics/topology/internal/juce_MIDIDeviceDetector.cpp b/modules/juce_blocks_basics/topology/internal/juce_MIDIDeviceDetector.cpp index f257692803..0f54329acb 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_MIDIDeviceDetector.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_MIDIDeviceDetector.cpp @@ -27,9 +27,9 @@ struct MIDIDeviceDetector : public PhysicalTopologySource::DeviceDetector { MIDIDeviceDetector() {} - juce::StringArray scanForDevices() override + StringArray scanForDevices() override { - juce::StringArray result; + StringArray result; for (auto& pair : findDevices()) result.add (pair.inputName + " & " + pair.outputName); @@ -49,8 +49,8 @@ struct MIDIDeviceDetector : public PhysicalTopologySource::DeviceDetector { lockedFromOutside = false; - dev->midiInput.reset (juce::MidiInput::openDevice (pair.inputIndex, dev.get())); - dev->midiOutput.reset (juce::MidiOutput::openDevice (pair.outputIndex)); + dev->midiInput.reset (MidiInput::openDevice (pair.inputIndex, dev.get())); + dev->midiOutput.reset (MidiOutput::openDevice (pair.outputIndex)); if (dev->midiInput != nullptr) { @@ -72,12 +72,12 @@ struct MIDIDeviceDetector : public PhysicalTopologySource::DeviceDetector return lockedFromOutside && ! findDevices().isEmpty(); } - static bool isBlocksMidiDeviceName (const juce::String& name) + static bool isBlocksMidiDeviceName (const String& name) { return name.indexOf (" BLOCK") > 0 || name.indexOf (" Block") > 0; } - static String cleanBlocksDeviceName (juce::String name) + static String cleanBlocksDeviceName (String name) { name = name.trim(); @@ -96,16 +96,16 @@ struct MIDIDeviceDetector : public PhysicalTopologySource::DeviceDetector struct MidiInputOutputPair { - juce::String outputName, inputName; + String outputName, inputName; int outputIndex = -1, inputIndex = -1; }; - static juce::Array findDevices() + static Array findDevices() { - juce::Array result; + Array result; - auto midiInputs = juce::MidiInput::getDevices(); - auto midiOutputs = juce::MidiOutput::getDevices(); + auto midiInputs = MidiInput::getDevices(); + auto midiOutputs = MidiOutput::getDevices(); for (int j = 0; j < midiInputs.size(); ++j) { diff --git a/modules/juce_blocks_basics/topology/internal/juce_MidiDeviceConnection.cpp b/modules/juce_blocks_basics/topology/internal/juce_MidiDeviceConnection.cpp index 17b34d7b0b..cb936743e6 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_MidiDeviceConnection.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_MidiDeviceConnection.cpp @@ -24,7 +24,7 @@ namespace juce { struct MIDIDeviceConnection : public PhysicalTopologySource::DeviceConnection, - public juce::MidiInputCallback + public MidiInputCallback { MIDIDeviceConnection() {} @@ -43,9 +43,9 @@ struct MIDIDeviceConnection : public PhysicalTopologySource::DeviceConnection, bool lockAgainstOtherProcesses (const String& midiInName, const String& midiOutName) { - interprocessLock.reset (new juce::InterProcessLock ("blocks_sdk_" - + File::createLegalFileName (midiInName) - + "_" + File::createLegalFileName (midiOutName))); + interprocessLock.reset (new InterProcessLock ("blocks_sdk_" + + File::createLegalFileName (midiInName) + + "_" + File::createLegalFileName (midiOutName))); if (interprocessLock->enter (500)) return true; @@ -57,19 +57,19 @@ struct MIDIDeviceConnection : public PhysicalTopologySource::DeviceConnection, { virtual ~Listener() {} - virtual void handleIncomingMidiMessage (const juce::MidiMessage& message) = 0; + virtual void handleIncomingMidiMessage (const MidiMessage& message) = 0; virtual void connectionBeingDeleted (const MIDIDeviceConnection&) = 0; }; void addListener (Listener* l) { - juce::ScopedLock scopedLock (criticalSecton); + ScopedLock scopedLock (criticalSecton); listeners.add (l); } void removeListener (Listener* l) { - juce::ScopedLock scopedLock (criticalSecton); + ScopedLock scopedLock (criticalSecton); listeners.remove (l); } @@ -83,16 +83,16 @@ struct MIDIDeviceConnection : public PhysicalTopologySource::DeviceConnection, if (midiOutput != nullptr) { - midiOutput->sendMessageNow (juce::MidiMessage (data, (int) dataSize)); + midiOutput->sendMessageNow (MidiMessage (data, (int) dataSize)); return true; } return false; } - void handleIncomingMidiMessage (juce::MidiInput*, const juce::MidiMessage& message) override + void handleIncomingMidiMessage (MidiInput*, const MidiMessage& message) override { - juce::ScopedTryLock lock (criticalSecton); + ScopedTryLock lock (criticalSecton); if (lock.isLocked()) { @@ -108,14 +108,14 @@ struct MIDIDeviceConnection : public PhysicalTopologySource::DeviceConnection, } } - std::unique_ptr midiInput; - std::unique_ptr midiOutput; + std::unique_ptr midiInput; + std::unique_ptr midiOutput; - juce::CriticalSection criticalSecton; + CriticalSection criticalSecton; private: - juce::ListenerList listeners; - std::unique_ptr interprocessLock; + ListenerList listeners; + std::unique_ptr interprocessLock; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MIDIDeviceConnection) }; diff --git a/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.h b/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.h index 2ce88c2e37..47079d9f2e 100644 --- a/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.h +++ b/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.h @@ -71,7 +71,7 @@ public: DeviceDetector(); virtual ~DeviceDetector(); - virtual juce::StringArray scanForDevices() = 0; + virtual StringArray scanForDevices() = 0; virtual DeviceConnection* openDevice (int index) = 0; virtual bool isLockedFromOutside() const { return false; } }; diff --git a/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp b/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp index 088db2090b..25c8dff0a5 100644 --- a/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp +++ b/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp @@ -24,7 +24,7 @@ namespace juce { struct RuleBasedTopologySource::Internal : public TopologySource::Listener, - private juce::AsyncUpdater + private AsyncUpdater { Internal (RuleBasedTopologySource& da, TopologySource& bd) : owner (da), detector (bd) { @@ -93,7 +93,7 @@ struct RuleBasedTopologySource::Internal : public TopologySource::Listener, TopologySource& detector; BlockTopology topology; - juce::OwnedArray rules; + OwnedArray rules; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Internal) }; diff --git a/modules/juce_blocks_basics/topology/juce_Topology.h b/modules/juce_blocks_basics/topology/juce_Topology.h index 36e86f1817..3fcebbc67f 100644 --- a/modules/juce_blocks_basics/topology/juce_Topology.h +++ b/modules/juce_blocks_basics/topology/juce_Topology.h @@ -44,7 +44,7 @@ struct BlockDeviceConnection struct BlockTopology { Block::Array blocks; - juce::Array connections; + Array connections; bool operator== (const BlockTopology&) const noexcept; bool operator!= (const BlockTopology&) const noexcept; diff --git a/modules/juce_blocks_basics/topology/juce_TopologySource.h b/modules/juce_blocks_basics/topology/juce_TopologySource.h index 5b95c7b400..b12edfd031 100644 --- a/modules/juce_blocks_basics/topology/juce_TopologySource.h +++ b/modules/juce_blocks_basics/topology/juce_TopologySource.h @@ -72,7 +72,7 @@ public: protected: //========================================================================== - juce::ListenerList listeners; + ListenerList listeners; }; } // namespace juce diff --git a/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.cpp b/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.cpp index e2df561f27..5700018fb4 100644 --- a/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.cpp +++ b/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.cpp @@ -52,7 +52,7 @@ void BitmapLEDProgram::setLED (uint32 x, uint32 y, LEDColour colour) } } -juce::String BitmapLEDProgram::getLittleFootProgram() +String BitmapLEDProgram::getLittleFootProgram() { String program (R"littlefoot( @@ -77,8 +77,8 @@ juce::String BitmapLEDProgram::getLittleFootProgram() )littlefoot"); if (auto ledGrid = block.getLEDGrid()) - return program.replace ("NUM_COLUMNS", juce::String (ledGrid->getNumColumns())) - .replace ("NUM_ROWS", juce::String (ledGrid->getNumRows())); + return program.replace ("NUM_COLUMNS", String (ledGrid->getNumColumns())) + .replace ("NUM_ROWS", String (ledGrid->getNumRows())); jassertfalse; return {}; diff --git a/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.h b/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.h index 9256b1548b..c2aa4d1823 100644 --- a/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.h +++ b/modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.h @@ -36,7 +36,7 @@ struct BitmapLEDProgram : public Block::Program void setLED (uint32 x, uint32 y, LEDColour); private: - juce::String getLittleFootProgram() override; + String getLittleFootProgram() override; }; } // namespace juce diff --git a/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.cpp b/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.cpp index 9c095408fa..bf6f9dab3b 100644 --- a/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.cpp +++ b/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.cpp @@ -27,8 +27,8 @@ DrumPadGridProgram::DrumPadGridProgram (Block& b) : Program (b) {} int DrumPadGridProgram::getPadIndex (float posX, float posY) const { - posX = juce::jmin (0.99f, posX / block.getWidth()); - posY = juce::jmin (0.99f, posY / block.getHeight()); + posX = jmin (0.99f, posX / block.getWidth()); + posY = jmin (0.99f, posY / block.getHeight()); const uint32 offset = block.getDataByte (visiblePads_byte) ? numColumns1_byte : numColumns0_byte; const int numColumns = block.getDataByte (offset + numColumns0_byte); @@ -65,9 +65,9 @@ void DrumPadGridProgram::sendTouch (float x, float y, float z, LEDColour colour) Block::ProgramEventMessage e; e.values[0] = 0x20000000 - + (juce::jlimit (0, 255, juce::roundToInt (x * (255.0f / block.getWidth()))) << 16) - + (juce::jlimit (0, 255, juce::roundToInt (y * (255.0f / block.getHeight()))) << 8) - + juce::jlimit (0, 255, juce::roundToInt (z * 255.0f)); + + (jlimit (0, 255, roundToInt (x * (255.0f / block.getWidth()))) << 16) + + (jlimit (0, 255, roundToInt (y * (255.0f / block.getHeight()))) << 8) + + jlimit (0, 255, roundToInt (z * 255.0f)); e.values[1] = (int32) colour.getARGB(); @@ -75,14 +75,14 @@ void DrumPadGridProgram::sendTouch (float x, float y, float z, LEDColour colour) } //============================================================================== -void DrumPadGridProgram::setGridFills (int numColumns, int numRows, const juce::Array& fills) +void DrumPadGridProgram::setGridFills (int numColumns, int numRows, const Array& fills) { uint8 visiblePads = block.getDataByte (visiblePads_byte); setGridFills (numColumns, numRows, fills, visiblePads * numColumns1_byte); } -void DrumPadGridProgram::setGridFills (int numColumns, int numRows, const juce::Array& fills, uint32 byteOffset) +void DrumPadGridProgram::setGridFills (int numColumns, int numRows, const Array& fills, uint32 byteOffset) { jassert (numColumns * numRows == fills.size()); @@ -113,7 +113,7 @@ void DrumPadGridProgram::setGridFills (int numColumns, int numRows, const juce:: } void DrumPadGridProgram::triggerSlideTransition (int newNumColumns, int newNumRows, - const juce::Array& newFills, SlideDirection direction) + const Array& newFills, SlideDirection direction) { uint8 newVisible = block.getDataByte (visiblePads_byte) ? 0 : 1; @@ -132,8 +132,8 @@ void DrumPadGridProgram::setPadAnimationState (uint32 padIdx, double loopTimeSec // Compensate for bluetooth latency & led resolution, tweaked by eye for POS app. currentProgress = std::fmod (currentProgress + 0.1, 1.0); - uint16 aniValue = uint16 (juce::roundToInt ((255 << 8) * currentProgress)); - uint16 aniIncrement = loopTimeSecs > 0.0 ? uint16 (juce::roundToInt (((255 << 8) / 25.0) / loopTimeSecs)) : 0; + uint16 aniValue = uint16 (roundToInt ((255 << 8) * currentProgress)); + uint16 aniIncrement = loopTimeSecs > 0.0 ? uint16 (roundToInt (((255 << 8) / 25.0) / loopTimeSecs)) : 0; uint32 offset = 8 * animationTimers_byte + 32 * padIdx; @@ -160,7 +160,7 @@ void DrumPadGridProgram::resumeAnimations() } //============================================================================== -juce::String DrumPadGridProgram::getLittleFootProgram() +String DrumPadGridProgram::getLittleFootProgram() { if (block.versionNumber.isEmpty() || block.versionNumber.compare ("0.2.5") < 0) return getLittleFootProgramPre25(); @@ -168,7 +168,7 @@ juce::String DrumPadGridProgram::getLittleFootProgram() return getLittleFootProgramPost25(); } -juce::String DrumPadGridProgram::getLittleFootProgramPre25() const +String DrumPadGridProgram::getLittleFootProgramPre25() const { // Uses its own heatmap, not the one provided in newer firmware // Also can't use blocks config, introduced in 2.5. @@ -553,7 +553,7 @@ juce::String DrumPadGridProgram::getLittleFootProgramPre25() const )littlefoot"; } -juce::String DrumPadGridProgram::getLittleFootProgramPost25() const +String DrumPadGridProgram::getLittleFootProgramPost25() const { // Uses heatmap provided in firmware (so the program's smaller) // Initialises config items introduced in firmware 2.5 diff --git a/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.h b/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.h index e3821791b2..481b6213ff 100644 --- a/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.h +++ b/modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.h @@ -75,7 +75,7 @@ struct DrumPadGridProgram : public Block::Program }; void setGridFills (int numColumns, int numRows, - const juce::Array&); + const Array&); /** Set up a new pad layout, with a slide animation from the old to the new. */ enum SlideDirection : uint8 @@ -89,7 +89,7 @@ struct DrumPadGridProgram : public Block::Program }; void triggerSlideTransition (int newNumColumns, int newNumRows, - const juce::Array& newFills, SlideDirection); + const Array& newFills, SlideDirection); private: //============================================================================== @@ -116,11 +116,11 @@ private: static constexpr uint32 colourSizeBytes = 2; int getPadIndex (float posX, float posY) const; - void setGridFills (int numColumns, int numRows, const juce::Array& fills, uint32 byteOffset); + void setGridFills (int numColumns, int numRows, const Array& fills, uint32 byteOffset); - juce::String getLittleFootProgram() override; - juce::String getLittleFootProgramPre25() const; - juce::String getLittleFootProgramPost25() const; + String getLittleFootProgram() override; + String getLittleFootProgramPre25() const; + String getLittleFootProgramPost25() const; }; } // namespace juce