Umsci
Upmix Spatial Control Interface — OCA/OCP.1 spatial audio utility
Loading...
Searching...
No Matches
OscController Class Reference

Owns the OSC receiver and maps incoming OSC float messages to upmix parameter domain values. More...

#include <OscController.h>

+ Inheritance diagram for OscController:
+ Collaboration diagram for OscController:

Public Member Functions

 OscController ()
 
 ~OscController () override
 
void openPort (int port)
 
int getPort () const
 
void setAddress (UmsciExternalControlComponent::UpmixMidiParam param, const juce::String &address)
 
juce::String getAddress (UmsciExternalControlComponent::UpmixMidiParam param) const
 

Public Attributes

std::function< void(UmsciExternalControlComponent::UpmixMidiParam, float)> onParamValueChanged
 

Detailed Description

Owns the OSC receiver and maps incoming OSC float messages to upmix parameter domain values.

Inherits juce::OSCReceiver::Listener<MessageLoopCallback> so that oscMessageReceived() is called on the message thread directly. Incoming float values are clamped to the natural parameter range defined in UmsciExternalControlComponent::s_paramRanges before being forwarded via onParamValueChanged.

Usage

  1. Call openPort() to start listening on a UDP port (0 = stop listening).
  2. Call setAddress() for each UpmixMidiParam to configure the OSC address pattern that drives that parameter.
  3. Assign onParamValueChanged to receive (param, domainValue) pairs.

Definition at line 43 of file OscController.h.

Constructor & Destructor Documentation

◆ OscController()

OscController::OscController ( )

◆ ~OscController()

OscController::~OscController ( )
override

Definition at line 30 of file OscController.cpp.

Member Function Documentation

◆ getAddress()

juce::String OscController::getAddress ( UmsciExternalControlComponent::UpmixMidiParam  param) const

Returns the current OSC address for a given upmix parameter.

Definition at line 54 of file OscController.cpp.

◆ getPort()

int OscController::getPort ( ) const
inline

Returns the currently open OSC listen port (0 = not listening).

Definition at line 55 of file OscController.h.

◆ openPort()

void OscController::openPort ( int  port)

Opens (or re-opens) the OSC UDP listen port. Pass 0 to stop listening without reopening.

Definition at line 36 of file OscController.cpp.

◆ setAddress()

void OscController::setAddress ( UmsciExternalControlComponent::UpmixMidiParam  param,
const juce::String &  address 
)

Sets the OSC address pattern for a given upmix parameter.

Definition at line 48 of file OscController.cpp.

Member Data Documentation

◆ onParamValueChanged

std::function<void(UmsciExternalControlComponent::UpmixMidiParam, float)> OscController::onParamValueChanged

Fired on the message thread when an incoming OSC float message matches a configured address. The float is the received value clamped to the parameter's natural domain using UmsciExternalControlComponent::s_paramRanges.

Definition at line 69 of file OscController.h.


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