Loading...
Searching...
No Matches
juce::OSCMessage Class Reference

## Detailed Description

An OSC Message.

An OSCMessage consists of an OSCAddressPattern and zero or more OSCArguments.

OSC messages are the elementary objects that are used to exchange any data via OSC. An OSCSender can send OSCMessage objects to an OSCReceiver.

The documentation for this class was generated from the following file:

- juce_osc/osc/juce_OSCMessage.h

## Public Member Functions

| OSCMessage (const OSCAddressPattern &ap) noexcept
| Constructs an OSCMessage object with the given address pattern and no arguments.
template<typename Arg1, typename... Args>
| OSCMessage (const OSCAddressPattern &ap, Arg1 &&arg1, Args &&... args)
| Constructs an OSCMessage object with the given address pattern and list of arguments.
void | setAddressPattern (const OSCAddressPattern &ap) noexcept
| Sets the address pattern of the OSCMessage.
OSCAddressPattern | getAddressPattern () const noexcept
| Returns the address pattern of the OSCMessage.
int | size () const noexcept
| Returns the number of OSCArgument objects that belong to this OSCMessage.
bool | isEmpty () const noexcept
| Returns true if the OSCMessage contains no OSCArgument objects; false otherwise.
OSCArgument & | operator[] (int i) noexcept
| Returns a reference to the OSCArgument at index i in the OSCMessage object.
const OSCArgument & | operator[] (int i) const noexcept
OSCArgument * | begin () noexcept
| Returns a pointer to the first OSCArgument in the OSCMessage object.
const OSCArgument * | begin () const noexcept
| Returns a pointer to the first OSCArgument in the OSCMessage object.
OSCArgument * | end () noexcept
| Returns a pointer to the last OSCArgument in the OSCMessage object.
const OSCArgument * | end () const noexcept
| Returns a pointer to the last OSCArgument in the OSCMessage object.
void | clear ()
| Removes all arguments from the OSCMessage.
void | addInt32 (int32 value)
| Creates a new OSCArgument of type int32 with the given value, and adds it to the OSCMessage object.
void | addFloat32 (float value)
| Creates a new OSCArgument of type float32 with the given value, and adds it to the OSCMessage object.
void | addString (const String &value)
| Creates a new OSCArgument of type string with the given value, and adds it to the OSCMessage object.
void | addBlob (MemoryBlock blob)
| Creates a new OSCArgument of type blob with binary data content copied from the given MemoryBlock.
void | addColour (OSCColour colour)
| Creates a new OSCArgument of type colour with the given value, and adds it to the OSCMessage object.
void | addArgument (OSCArgument argument)
| Adds the OSCArgument argument to the OSCMessage object.

## Constructors and Destructors

## OSCMessage() [1/2]

juce::OSCMessage::OSCMessage | ( | const OSCAddressPattern & | ap | ) |

noexcept

Constructs an OSCMessage object with the given address pattern and no arguments.

Parameters

  ap | the address pattern of the message. This must be a valid OSC address (starting with a forward slash) and may contain OSC wildcard expressions. You can pass in a string literal or a juce String (they will be converted to an OSCAddressPattern automatically).

References OSCMessage().

Referenced by OSCMessage().

## OSCMessage() [2/2]

template<typename Arg1, typename... Args>

juce::OSCMessage::OSCMessage | ( | const OSCAddressPattern & | ap,
|  | Arg1 && | arg1,
|  | Args &&... | args )

Constructs an OSCMessage object with the given address pattern and list of arguments.

Parameters

  ap | the address pattern of the message. This must be a valid OSC address (starting with a forward slash) and may contain OSC wildcard expressions. You can pass in a string literal or a juce String (they will be converted to an OSCAddressPattern automatically).
  arg1 | the first argument of the message.
  args | an optional list of further arguments to add to the message.

## Member Functions

## setAddressPattern()

void juce::OSCMessage::setAddressPattern | ( | const OSCAddressPattern & | ap | ) |

noexcept

Sets the address pattern of the OSCMessage.

Parameters

  ap | the address pattern of the message. This must be a valid OSC address (starting with a forward slash) and may contain OSC wildcard expressions. You can pass in a string literal or a juce String (they will be converted to an OSCAddressPattern automatically).

## getAddressPattern()

OSCAddressPattern juce::OSCMessage::getAddressPattern | ( |  | ) | const

noexcept

Returns the address pattern of the OSCMessage.

## size()

int juce::OSCMessage::size | ( |  | ) | const

noexcept

Returns the number of OSCArgument objects that belong to this OSCMessage.

References size().

Referenced by size().

## isEmpty()

bool juce::OSCMessage::isEmpty | ( |  | ) | const

noexcept

Returns true if the OSCMessage contains no OSCArgument objects; false otherwise.

References isEmpty().

Referenced by isEmpty().

## operator[]() [1/2]

OSCArgument & juce::OSCMessage::operator[] | ( | int | i | ) |

noexcept

Returns a reference to the OSCArgument at index i in the OSCMessage object.

This method does not check the range and results in undefined behaviour in case i < 0 or i >= size().

## operator[]() [2/2]

const OSCArgument & juce::OSCMessage::operator[] | ( | int | i | ) | const

noexcept

## begin() [1/2]

OSCArgument * juce::OSCMessage::begin | ( |  | ) |

noexcept

Returns a pointer to the first OSCArgument in the OSCMessage object.

This method is provided for compatibility with standard C++ iteration mechanisms.

References begin().

Referenced by begin(), and begin().

## begin() [2/2]

const OSCArgument * juce::OSCMessage::begin | ( |  | ) | const

noexcept

Returns a pointer to the first OSCArgument in the OSCMessage object.

This method is provided for compatibility with standard C++ iteration mechanisms.

References begin().

## end() [1/2]

OSCArgument * juce::OSCMessage::end | ( |  | ) |

noexcept

Returns a pointer to the last OSCArgument in the OSCMessage object.

This method is provided for compatibility with standard C++ iteration mechanisms.

References end().

Referenced by end(), and end().

## end() [2/2]

const OSCArgument * juce::OSCMessage::end | ( |  | ) | const

noexcept

Returns a pointer to the last OSCArgument in the OSCMessage object.

This method is provided for compatibility with standard C++ iteration mechanisms.

References end().

## clear()

void juce::OSCMessage::clear | ( |  | ) |

Removes all arguments from the OSCMessage.

References clear().

Referenced by clear().

## addInt32()

void juce::OSCMessage::addInt32 | ( | int32 | value | ) |

Creates a new OSCArgument of type int32 with the given value, and adds it to the OSCMessage object.

References addInt32().

Referenced by addInt32().

## addFloat32()

void juce::OSCMessage::addFloat32 | ( | float | value | ) |

Creates a new OSCArgument of type float32 with the given value, and adds it to the OSCMessage object.

References addFloat32().

Referenced by addFloat32().

## addString()

void juce::OSCMessage::addString | ( | const String & | value | ) |

Creates a new OSCArgument of type string with the given value, and adds it to the OSCMessage object.

References addString().

Referenced by addString().

## addBlob()

void juce::OSCMessage::addBlob | ( | MemoryBlock | blob | ) |

Creates a new OSCArgument of type blob with binary data content copied from the given MemoryBlock.

Note: If the argument passed is an lvalue, this may copy the binary data.

References addBlob().

Referenced by addBlob().

## addColour()

void juce::OSCMessage::addColour | ( | OSCColour | colour | ) |

Creates a new OSCArgument of type colour with the given value, and adds it to the OSCMessage object.

References addColour().

Referenced by addColour().

## addArgument()

void juce::OSCMessage::addArgument | ( | OSCArgument | argument | ) |

Adds the OSCArgument argument to the OSCMessage object.

Note: This method will result in a copy of the OSCArgument object if it is passed as an lvalue. If the OSCArgument is of type blob, this will also copy the underlying binary data. In general, you should use addInt32, addFloat32, etc. instead.

References addArgument().

Referenced by addArgument().

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited