Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
Mema::PluginParameterValueMessage Class Reference

Carries a single normalised plugin parameter value from Mema.Re to Mema. More...

#include <MemaMessages.h>

+ Inheritance diagram for Mema::PluginParameterValueMessage:
+ Collaboration diagram for Mema::PluginParameterValueMessage:

Public Member Functions

 PluginParameterValueMessage ()=default
 
 PluginParameterValueMessage (std::uint16_t parameterIndex, const juce::String &parameterId, float value)
 
 PluginParameterValueMessage (const juce::MemoryBlock &blob)
 
 ~PluginParameterValueMessage ()=default
 
std::uint16_t getParameterIndex () const
 Returns the zero-based parameter index within the plugin's parameter list.
 
const juce::String & getParameterId () const
 Returns the stable string identifier of the parameter (used for cross-session safety).
 
float getCurrentValue () const
 Returns the normalised parameter value in [0, 1].
 
- Public Member Functions inherited from Mema::SerializableMessage
 SerializableMessage ()=default
 
virtual ~SerializableMessage ()=default
 
void setId (int id)
 Tags the message with a connection-id used for echo-suppression on the server.
 
int getId () const
 Returns the connection-id tag, or -1 if not set.
 
bool hasUserId () const
 Returns true when a non-default connection-id has been assigned.
 
const SerializableMessageType getType () const
 Returns the concrete message type discriminator.
 
juce::MemoryBlock getSerializedMessage () const
 Serialises the message to a MemoryBlock ready to send over the socket.
 

Protected Member Functions

juce::MemoryBlock createSerializedContent (size_t &contentSize) const override
 Subclass hook — produces the type-specific payload bytes (everything after the type discriminator).
 
- Protected Member Functions inherited from Mema::SerializableMessage
std::uint32_t ReadUint32 (const char *buffer)
 Reads a big-endian uint32 from buffer.
 
std::uint16_t ReadUint16 (const char *buffer)
 Reads a big-endian uint16 from buffer.
 

Additional Inherited Members

- Public Types inherited from Mema::SerializableMessage
enum  SerializableMessageType {
  None = 0 ,
  EnvironmentParameters ,
  AnalyzerParameters ,
  ReinitIOCount ,
  AudioInputBuffer ,
  AudioOutputBuffer ,
  DataTrafficTypeSelection ,
  ControlParameters ,
  PluginParameterInfos ,
  PluginParameterValue
}
 
- Static Public Member Functions inherited from Mema::SerializableMessage
static SerializableMessageinitFromMemoryBlock (const juce::MemoryBlock &blob)
 Deserialises a raw TCP frame into the correct concrete SerializableMessage subclass.
 
static void freeMessageData (SerializableMessage *message)
 Type-correctly destroys a SerializableMessage* returned by initFromMemoryBlock().
 
- Protected Attributes inherited from Mema::SerializableMessage
SerializableMessageType m_type = SerializableMessageType::None
 Type discriminator stored in the first 4 bytes of every serialised frame.
 
int m_userId = -1
 Optional connection-id tag for echo-suppression (-1 = not set).
 

Detailed Description

Carries a single normalised plugin parameter value from Mema.Re to Mema.

Sent by PluginControlComponent (Mema.Re side) whenever the user adjusts a plugin parameter widget. On receipt, MemaProcessor::handleMessage() calls setPluginParameterValue() which forwards the value to the hosted AudioPluginInstance. The parameter is identified by both its index and its stable string ID to guard against index drift if the plugin reports parameters in a different order across sessions.

Wire payload: parameterIndex (uint16) + id (uint16 len + UTF-8) + currentValue (float).

Note
Values are normalised to [0, 1] as required by JUCE's AudioProcessorParameter::setValue().
See also
MemaProcessor::setPluginParameterValue()

Definition at line 1057 of file MemaMessages.h.

Constructor & Destructor Documentation

◆ PluginParameterValueMessage() [1/3]

Mema::PluginParameterValueMessage::PluginParameterValueMessage ( )
default

◆ PluginParameterValueMessage() [2/3]

Mema::PluginParameterValueMessage::PluginParameterValueMessage ( std::uint16_t  parameterIndex,
const juce::String &  parameterId,
float  value 
)
inline

◆ PluginParameterValueMessage() [3/3]

Mema::PluginParameterValueMessage::PluginParameterValueMessage ( const juce::MemoryBlock &  blob)
inline

◆ ~PluginParameterValueMessage()

Mema::PluginParameterValueMessage::~PluginParameterValueMessage ( )
default

Member Function Documentation

◆ createSerializedContent()

juce::MemoryBlock Mema::PluginParameterValueMessage::createSerializedContent ( size_t &  contentSize) const
inlineoverrideprotectedvirtual

Subclass hook — produces the type-specific payload bytes (everything after the type discriminator).

Parameters
contentSizeSet by the implementation to the byte count of the returned block.
Returns
A MemoryBlock containing only the payload (no type prefix).

Implements Mema::SerializableMessage.

Definition at line 1103 of file MemaMessages.h.

◆ getCurrentValue()

float Mema::PluginParameterValueMessage::getCurrentValue ( ) const
inline

Returns the normalised parameter value in [0, 1].

Definition at line 1100 of file MemaMessages.h.

◆ getParameterId()

const juce::String & Mema::PluginParameterValueMessage::getParameterId ( ) const
inline

Returns the stable string identifier of the parameter (used for cross-session safety).

Definition at line 1098 of file MemaMessages.h.

◆ getParameterIndex()

std::uint16_t Mema::PluginParameterValueMessage::getParameterIndex ( ) const
inline

Returns the zero-based parameter index within the plugin's parameter list.

Definition at line 1096 of file MemaMessages.h.


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