mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Normalised some divider comments
This commit is contained in:
parent
c64fcd72e9
commit
b5907fa90d
56 changed files with 233 additions and 233 deletions
|
|
@ -29,7 +29,7 @@
|
|||
#include "../juce_events/juce_events.h"
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//==============================================================================
|
||||
namespace juce
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -24,14 +24,14 @@
|
|||
|
||||
namespace
|
||||
{
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
template <typename CharPointerType>
|
||||
class OSCPatternMatcherImpl
|
||||
{
|
||||
typedef CharPointerType CharPtr;
|
||||
|
||||
public:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
static bool match (CharPtr pattern, CharPtr patternEnd, CharPtr target, CharPtr targetEnd)
|
||||
{
|
||||
if (pattern == patternEnd)
|
||||
|
|
@ -50,13 +50,13 @@ namespace
|
|||
}
|
||||
|
||||
private:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
static bool matchTerminator (CharPtr target, CharPtr targetEnd)
|
||||
{
|
||||
return target == targetEnd;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
static bool matchChar (juce_wchar c, CharPtr pattern, CharPtr patternEnd, CharPtr target, CharPtr targetEnd)
|
||||
{
|
||||
if (target == targetEnd || c != target.getAndAdvance())
|
||||
|
|
@ -65,7 +65,7 @@ namespace
|
|||
return match (pattern, patternEnd, target, targetEnd);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
static bool matchAnyChar (CharPtr pattern, CharPtr patternEnd, CharPtr target, CharPtr targetEnd)
|
||||
{
|
||||
if (target == targetEnd)
|
||||
|
|
@ -74,7 +74,7 @@ namespace
|
|||
return match (pattern, patternEnd, ++target, targetEnd);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
static bool matchAnyOrNoChars (CharPtr pattern, CharPtr patternEnd, CharPtr target, CharPtr targetEnd)
|
||||
{
|
||||
if (target == targetEnd)
|
||||
|
|
@ -86,7 +86,7 @@ namespace
|
|||
return matchAnyOrNoChars (pattern, patternEnd, ++target, targetEnd);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
static bool matchInsideStringSet (CharPtr pattern, CharPtr patternEnd, CharPtr target, CharPtr targetEnd)
|
||||
{
|
||||
if (pattern == patternEnd)
|
||||
|
|
@ -123,7 +123,7 @@ namespace
|
|||
return false;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
static bool matchStringSet (const StringArray& set, CharPtr pattern,
|
||||
CharPtr patternEnd, CharPtr target, CharPtr targetEnd)
|
||||
{
|
||||
|
|
@ -138,7 +138,7 @@ namespace
|
|||
return false;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
static bool matchInsideCharSet (CharPtr pattern, CharPtr patternEnd,
|
||||
CharPtr target, CharPtr targetEnd)
|
||||
{
|
||||
|
|
@ -180,7 +180,7 @@ namespace
|
|||
return false;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
static bool matchCharSet (const Array<juce_wchar>& set, bool setIsNegated,
|
||||
CharPtr pattern, CharPtr patternEnd, CharPtr target, CharPtr targetEnd)
|
||||
{
|
||||
|
|
@ -194,7 +194,7 @@ namespace
|
|||
: matchCharSetNotNegated (set, pattern, patternEnd, target, targetEnd);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
static bool matchCharSetNegated (const Array<juce_wchar>& set, CharPtr pattern,
|
||||
CharPtr patternEnd, CharPtr target, CharPtr targetEnd)
|
||||
{
|
||||
|
|
@ -205,7 +205,7 @@ namespace
|
|||
return match (pattern, patternEnd, target + 1, targetEnd);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
static bool matchCharSetNotNegated (const Array<juce_wchar>& set, CharPtr pattern,
|
||||
CharPtr patternEnd, CharPtr target, CharPtr targetEnd)
|
||||
{
|
||||
|
|
@ -217,7 +217,7 @@ namespace
|
|||
return false;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
static bool addCharRangeToSet (Array<juce_wchar>& set, CharPtr pattern,
|
||||
CharPtr /*patternEnd*/, CharPtr target, CharPtr targetEnd)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
class JUCE_API OSCAddress
|
||||
{
|
||||
public:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Constructs a new OSCAddress from a String.
|
||||
@throw OSCFormatError if the string is not a valid OSC address.
|
||||
*/
|
||||
|
|
@ -95,7 +95,7 @@ private:
|
|||
class JUCE_API OSCAddressPattern
|
||||
{
|
||||
public:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Constructs a new OSCAddressPattern from a String.
|
||||
@throw OSCFormatError if the string is not a valid OSC address pattern.
|
||||
*/
|
||||
|
|
@ -140,7 +140,7 @@ public:
|
|||
|
||||
|
||||
private:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
StringArray oscSymbols;
|
||||
String asString;
|
||||
bool wasInitialisedWithWildcards;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public:
|
|||
class Element
|
||||
{
|
||||
public:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Constructs an OSCBundle Element from an OSCMessage. */
|
||||
Element (OSCMessage message);
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ public:
|
|||
const OSCBundle& getBundle() const;
|
||||
|
||||
private:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
ScopedPointer<OSCMessage> message;
|
||||
ScopedPointer<OSCBundle> bundle;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ private:
|
|||
};
|
||||
|
||||
|
||||
//==================================================================================
|
||||
//==============================================================================
|
||||
#if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES && JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
|
||||
template <typename Arg1, typename... Args>
|
||||
OSCMessage::OSCMessage (const OSCAddressPattern& ap, Arg1&& arg1, Args&&... args)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
namespace
|
||||
{
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Allows a block of data to be accessed as a stream of OSC data.
|
||||
|
||||
The memory is shared and will be neither copied nor owned by the OSCInputStream.
|
||||
|
|
@ -47,7 +47,7 @@ namespace
|
|||
: input (sourceData, sourceDataSize, false)
|
||||
{}
|
||||
|
||||
//======================================================================
|
||||
//==============================================================================
|
||||
/** Returns a pointer to the source data block from which this stream is reading. */
|
||||
const void* getData() const noexcept { return input.getData(); }
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ namespace
|
|||
/** Returns true if the stream has no more data to read. */
|
||||
bool isExhausted() { return input.isExhausted(); }
|
||||
|
||||
//======================================================================
|
||||
//==============================================================================
|
||||
int32 readInt32()
|
||||
{
|
||||
if (input.getNumBytesRemaining() < 4)
|
||||
|
|
@ -145,7 +145,7 @@ namespace
|
|||
return OSCAddressPattern (readString());
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
//==============================================================================
|
||||
OSCTypeList readTypeTagString()
|
||||
{
|
||||
OSCTypeList typeList;
|
||||
|
|
@ -178,7 +178,7 @@ namespace
|
|||
return typeList;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
OSCArgument readArgument (OSCType type)
|
||||
{
|
||||
switch (type)
|
||||
|
|
@ -195,7 +195,7 @@ namespace
|
|||
}
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
//==============================================================================
|
||||
OSCMessage readMessage()
|
||||
{
|
||||
OSCAddressPattern ap = readAddressPattern();
|
||||
|
|
@ -209,7 +209,7 @@ namespace
|
|||
return msg;
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
//==============================================================================
|
||||
OSCBundle readBundle()
|
||||
{
|
||||
if (input.getNumBytesRemaining() < 16)
|
||||
|
|
@ -226,7 +226,7 @@ namespace
|
|||
return bundle;
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
//==============================================================================
|
||||
OSCBundle::Element readElement()
|
||||
{
|
||||
if (input.getNumBytesRemaining() < 4)
|
||||
|
|
@ -240,7 +240,7 @@ namespace
|
|||
return readElementWithKnownSize (elementSize);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
//==============================================================================
|
||||
OSCBundle::Element readElementWithKnownSize (size_t elementSize)
|
||||
{
|
||||
if ((uint64) input.getNumBytesRemaining() < elementSize)
|
||||
|
|
@ -257,7 +257,7 @@ namespace
|
|||
private:
|
||||
MemoryInputStream input;
|
||||
|
||||
//======================================================================
|
||||
//==============================================================================
|
||||
void readPaddingZeros (size_t bytesRead)
|
||||
{
|
||||
size_t numZeros = ~(bytesRead - 1) & 0x03;
|
||||
|
|
@ -312,7 +312,7 @@ struct OSCReceiver::Pimpl : private Thread,
|
|||
disconnect();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
bool connectToPort (int portNum)
|
||||
{
|
||||
if (! disconnect())
|
||||
|
|
@ -340,7 +340,7 @@ struct OSCReceiver::Pimpl : private Thread,
|
|||
return true;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
void addListener (Listener<MessageLoopCallback>* listenerToAdd)
|
||||
{
|
||||
listeners.add (listenerToAdd);
|
||||
|
|
@ -383,7 +383,7 @@ struct OSCReceiver::Pimpl : private Thread,
|
|||
removeListenerWithAddress (listenerToRemove, realtimeListenersWithAddress);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
struct CallbackMessage : public Message
|
||||
{
|
||||
CallbackMessage (OSCBundle::Element oscElement) : content (oscElement) {}
|
||||
|
|
@ -392,7 +392,7 @@ struct OSCReceiver::Pimpl : private Thread,
|
|||
OSCBundle::Element content;
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
void handleBuffer (const char* data, size_t dataSize)
|
||||
{
|
||||
OSCInputStream inStream (data, dataSize);
|
||||
|
|
@ -420,14 +420,14 @@ struct OSCReceiver::Pimpl : private Thread,
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
void registerFormatErrorHandler (OSCReceiver::FormatErrorHandler handler)
|
||||
{
|
||||
formatErrorHandler = handler;
|
||||
}
|
||||
|
||||
private:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
void run() override
|
||||
{
|
||||
while (! threadShouldExit())
|
||||
|
|
@ -446,7 +446,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
template <typename ListenerType>
|
||||
void addListenerWithAddress (ListenerType* listenerToAdd,
|
||||
OSCAddress address,
|
||||
|
|
@ -459,7 +459,7 @@ private:
|
|||
array.add (std::make_pair (address, listenerToAdd));
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
template <typename ListenerType>
|
||||
void removeListenerWithAddress (ListenerType* listenerToRemove,
|
||||
Array<std::pair<OSCAddress, ListenerType*> >& array)
|
||||
|
|
@ -478,7 +478,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
void handleMessage (const Message& msg) override
|
||||
{
|
||||
if (const CallbackMessage* callbackMessage = dynamic_cast<const CallbackMessage*> (&msg))
|
||||
|
|
@ -492,7 +492,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
void callListeners (const OSCBundle::Element& content)
|
||||
{
|
||||
typedef OSCReceiver::Listener<OSCReceiver::MessageLoopCallback> Listener;
|
||||
|
|
@ -513,7 +513,7 @@ private:
|
|||
realtimeListeners.call (&Listener::oscBundleReceived, content.getBundle());
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
void callListenersWithAddress (const OSCMessage& message)
|
||||
{
|
||||
typedef OSCReceiver::ListenerWithOSCAddress<OSCReceiver::MessageLoopCallback> Listener;
|
||||
|
|
@ -542,7 +542,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
ListenerList<OSCReceiver::Listener<OSCReceiver::MessageLoopCallback> > listeners;
|
||||
ListenerList<OSCReceiver::Listener<OSCReceiver::RealtimeCallback> > realtimeListeners;
|
||||
|
||||
|
|
|
|||
|
|
@ -37,14 +37,14 @@
|
|||
class JUCE_API OSCReceiver
|
||||
{
|
||||
public:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Constructs a new OSCReceiver. */
|
||||
OSCReceiver();
|
||||
|
||||
/** Destructor. */
|
||||
~OSCReceiver();
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Connects to the specified UDP port using a datagram socket,
|
||||
and starts listening to OSC packets arriving on this port.
|
||||
|
||||
|
|
@ -52,14 +52,14 @@ public:
|
|||
*/
|
||||
bool connect (int portNumber);
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Disconnects from the currently used UDP port.
|
||||
@returns true if the disconnection was successful; false otherwise.
|
||||
*/
|
||||
bool disconnect();
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Use this struct as the template parameter for Listener and
|
||||
ListenerWithOSCAddress to receive incoming OSC data on the message thread.
|
||||
This should be used by OSC callbacks that are not realtime-critical, but
|
||||
|
|
@ -79,7 +79,7 @@ public:
|
|||
*/
|
||||
struct JUCE_API RealtimeCallback {};
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** A class for receiving OSC data from an OSCReceiver.
|
||||
|
||||
The template argument CallbackType determines how the callback will be called
|
||||
|
|
@ -109,7 +109,7 @@ public:
|
|||
virtual void oscBundleReceived (const OSCBundle& /*bundle*/) {}
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** A class for receiving only those OSC messages from an OSCReceiver that match a
|
||||
given OSC address.
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ public:
|
|||
virtual void oscMessageReceived (const OSCMessage& message) = 0;
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Adds a listener that listens to OSC messages and bundles.
|
||||
This listener will be called on the application's message loop.
|
||||
*/
|
||||
|
|
@ -203,7 +203,7 @@ public:
|
|||
void registerFormatErrorHandler (FormatErrorHandler handler);
|
||||
|
||||
private:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
struct Pimpl;
|
||||
friend struct Pimpl;
|
||||
friend struct ContainerDeletePolicy<Pimpl>;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ namespace
|
|||
/** Returns the number of bytes of data that have been written to the stream. */
|
||||
size_t getDataSize() const noexcept { return output.getDataSize(); }
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
bool writeInt32 (int32 value)
|
||||
{
|
||||
return output.writeIntBigEndian (value);
|
||||
|
|
@ -126,7 +126,7 @@ namespace
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
bool writeMessage (const OSCMessage& msg)
|
||||
{
|
||||
if (! writeAddressPattern (msg.getAddressPattern()))
|
||||
|
|
@ -162,7 +162,7 @@ namespace
|
|||
return true;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
bool writeBundleElement (const OSCBundle::Element& element)
|
||||
{
|
||||
const int64 startPos = output.getPosition();
|
||||
|
|
@ -204,7 +204,7 @@ struct OSCSender::Pimpl
|
|||
Pimpl() noexcept : targetPortNumber (0) {}
|
||||
~Pimpl() noexcept { disconnect(); }
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
bool connect (const String& newTargetHost, int newTargetPort)
|
||||
{
|
||||
if (! disconnect())
|
||||
|
|
@ -227,7 +227,7 @@ struct OSCSender::Pimpl
|
|||
return true;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
bool send (const OSCMessage& message, const String& hostName, int portNumber)
|
||||
{
|
||||
OSCOutputStream outStream;
|
||||
|
|
@ -246,7 +246,7 @@ struct OSCSender::Pimpl
|
|||
bool send (const OSCBundle& bundle) { return send (bundle, targetHostName, targetPortNumber); }
|
||||
|
||||
private:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
bool sendOutputStream (OSCOutputStream& outStream, const String& hostName, int portNumber)
|
||||
{
|
||||
if (socket != nullptr)
|
||||
|
|
@ -265,7 +265,7 @@ private:
|
|||
return false;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
ScopedPointer<DatagramSocket> socket;
|
||||
String targetHostName;
|
||||
int targetPortNumber;
|
||||
|
|
|
|||
|
|
@ -36,14 +36,14 @@
|
|||
class JUCE_API OSCSender
|
||||
{
|
||||
public:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Constructs a new OSCSender. */
|
||||
OSCSender();
|
||||
|
||||
/** Destructor. */
|
||||
~OSCSender();
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Connects to a datagram socket and prepares the socket for sending OSC
|
||||
packets to the specified target.
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ public:
|
|||
*/
|
||||
bool connect (const String& targetHostName, int targetPortNumber);
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Disconnects from the currently used UDP port.
|
||||
@returns true if the disconnection was successful; false otherwise.
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ public:
|
|||
*/
|
||||
bool disconnect();
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
/** Sends an OSC message to the target.
|
||||
@param message The OSC message to send.
|
||||
@returns true if the operation was successful.
|
||||
|
|
@ -127,7 +127,7 @@ public:
|
|||
#endif
|
||||
|
||||
private:
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
struct Pimpl;
|
||||
friend struct Pimpl;
|
||||
friend struct ContainerDeletePolicy<Pimpl>;
|
||||
|
|
@ -137,7 +137,7 @@ private:
|
|||
};
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//==============================================================================
|
||||
#if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES && JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
|
||||
template <typename... Args>
|
||||
bool OSCSender::send (const OSCAddressPattern& address, Args&&... args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue