JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_OSCArgument.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29//==============================================================================
40class JUCE_API OSCArgument
41{
42public:
44 OSCArgument (int32 value);
45
47 OSCArgument (float value);
48
50 OSCArgument (const String& value);
51
59
61 OSCArgument (OSCColour colour);
62
66 OSCType getType() const noexcept { return type; }
67
69 bool isInt32() const noexcept { return type == OSCTypes::int32; }
70
72 bool isFloat32() const noexcept { return type == OSCTypes::float32; }
73
75 bool isString() const noexcept { return type == OSCTypes::string; }
76
78 bool isBlob() const noexcept { return type == OSCTypes::blob; }
79
81 bool isColour() const noexcept { return type == OSCTypes::colour; }
82
86 int32 getInt32() const noexcept;
87
91 float getFloat32() const noexcept;
92
96 String getString() const noexcept;
97
103 const MemoryBlock& getBlob() const noexcept;
104
108 OSCColour getColour() const noexcept;
109
110private:
111 //==============================================================================
112 OSCType type;
113
114 union
115 {
116 int32 intValue;
117 float floatValue;
118 };
119
120 String stringValue;
121 MemoryBlock blob;
122};
123
124} // namespace juce
A class to hold a resizable block of raw data.
An OSC argument.
bool isFloat32() const noexcept
Returns whether the type of the OSCArgument is float.
bool isBlob() const noexcept
Returns whether the type of the OSCArgument is blob.
bool isColour() const noexcept
Returns whether the type of the OSCArgument is colour.
OSCType getType() const noexcept
Returns the type of the OSCArgument as an OSCType.
bool isInt32() const noexcept
Returns whether the type of the OSCArgument is int32.
bool isString() const noexcept
Returns whether the type of the OSCArgument is string.
The JUCE String class!
Definition juce_String.h:53
JUCE Namespace.
signed int int32
A platform-independent 32-bit signed integer type.
char OSCType
The type used for OSC type tags.
Holds a 32-bit RGBA colour for passing to and from an OSCArgument.