Vuo  2.0.0
Macros | Functions | Variables
VuoOscDevices.cc File Reference

Description

VuoOscDevices implementation.

Definition in file VuoOscDevices.cc.

Go to the source code of this file.

Macros

#define setRealizedDevice(newDevice)
 Helper for VuoOscInputDevice_realize. More...
 

Functions

VuoList_VuoOscInputDevice VuoOsc_getInputDeviceList (void)
 Returns a list of the currently-avaialble OSC input devices. More...
 
VuoList_VuoOscOutputDevice VuoOsc_getOutputDeviceList (void)
 Returns a list of the currently-avaialble OSC output devices. More...
 
void VuoOsc_clientCallback (CFNetServiceRef service, CFStreamError *error, void *info)
 Called when service details have been resolved. More...
 
void VuoOsc_deviceCallback (CFNetServiceBrowserRef browser, CFOptionFlags flags, CFTypeRef domainOrService, CFStreamError *error, void *info)
 Called when a new domain or service appears. More...
 
void VuoOsc_use (void)
 Indicates that the caller needs to get notifications about OSC devices. More...
 
void VuoOsc_disuse (void)
 Indicates that the caller no longer needs notifications about OSC devices. More...
 
void VuoOsc_addDevicesChangedTriggers (VuoOutputTrigger(inputDevices, VuoList_VuoOscInputDevice), VuoOutputTrigger(outputDevices, VuoList_VuoOscOutputDevice))
 Adds a trigger callback, to be invoked whenever the list of known OSC devices changes. More...
 
void VuoOsc_removeDevicesChangedTriggers (VuoOutputTrigger(inputDevices, VuoList_VuoOscInputDevice), VuoOutputTrigger(outputDevices, VuoList_VuoOscOutputDevice))
 Removes a trigger callback previously added by VuoOsc_addDevicesChangedTriggers. More...
 
bool VuoOscInputDevice_realize (VuoOscInputDevice device, VuoOscInputDevice *realizedDevice)
 If any of device's properties are unknown: More...
 
bool VuoOscOutputDevice_realize (VuoOscOutputDevice device, VuoOscOutputDevice *realizedDevice)
 If any of device's properties are unknown: More...
 

Variables

static dispatch_queue_t VuoOsc_deviceQueue
 Serializes access to the below device lists. More...
 
static VuoList_VuoOscInputDevice VuoOsc_inputDevices
 All known input devices. More...
 
static VuoList_VuoOscOutputDevice VuoOsc_outputDevices
 All known output devices. More...
 
static VuoTriggerSet< VuoList_VuoOscInputDeviceVuoOsc_inputDeviceCallbacks
 Trigger functions to call when the list of devices changes. More...
 
static VuoTriggerSet< VuoList_VuoOscOutputDeviceVuoOsc_outputDeviceCallbacks
 Trigger functions to call when the list of devices changes. More...
 
unsigned int VuoOsc_useCount = 0
 Process-wide count of callers (typically node instances) interested in notifications about OSC devices. More...
 
CFNetServiceBrowserRef VuoOsc_browser
 Manages notifications about OSC devices. More...
 

Macro Definition Documentation

◆ setRealizedDevice

#define setRealizedDevice (   newDevice)
Value:
realizedDevice->name = VuoText_make(newDevice.name); \
realizedDevice->ipAddress = VuoText_make(newDevice.ipAddress); \
realizedDevice->port = newDevice.port;

Helper for VuoOscInputDevice_realize.

Definition at line 382 of file VuoOscDevices.cc.

Function Documentation

◆ VuoOsc_addDevicesChangedTriggers()

void VuoOsc_addDevicesChangedTriggers ( VuoOutputTrigger(inputDevices, VuoList_VuoOscInputDevice ,
VuoOutputTrigger(outputDevices, VuoList_VuoOscOutputDevice  
)

Adds a trigger callback, to be invoked whenever the list of known OSC devices changes.

Call VuoOsc_use() before calling this.

This function may be called from any thread.

Definition at line 345 of file VuoOscDevices.cc.

◆ VuoOsc_clientCallback()

void VuoOsc_clientCallback ( CFNetServiceRef  service,
CFStreamError *  error,
void *  info 
)

Called when service details have been resolved.

Definition at line 69 of file VuoOscDevices.cc.

◆ VuoOsc_deviceCallback()

void VuoOsc_deviceCallback ( CFNetServiceBrowserRef  browser,
CFOptionFlags  flags,
CFTypeRef  domainOrService,
CFStreamError *  error,
void *  info 
)

Called when a new domain or service appears.

Definition at line 159 of file VuoOscDevices.cc.

◆ VuoOsc_disuse()

void VuoOsc_disuse ( void  )

Indicates that the caller no longer needs notifications about OSC devices.

This function may be called from any thread.

Definition at line 309 of file VuoOscDevices.cc.

◆ VuoOsc_getInputDeviceList()

VuoList_VuoOscInputDevice VuoOsc_getInputDeviceList ( void  )

Returns a list of the currently-avaialble OSC input devices.

Definition at line 45 of file VuoOscDevices.cc.

◆ VuoOsc_getOutputDeviceList()

VuoList_VuoOscOutputDevice VuoOsc_getOutputDeviceList ( void  )

Returns a list of the currently-avaialble OSC output devices.

Definition at line 57 of file VuoOscDevices.cc.

◆ VuoOsc_removeDevicesChangedTriggers()

void VuoOsc_removeDevicesChangedTriggers ( VuoOutputTrigger(inputDevices, VuoList_VuoOscInputDevice ,
VuoOutputTrigger(outputDevices, VuoList_VuoOscOutputDevice  
)

Removes a trigger callback previously added by VuoOsc_addDevicesChangedTriggers.

This function may be called from any thread.

Definition at line 369 of file VuoOscDevices.cc.

◆ VuoOsc_use()

void VuoOsc_use ( void  )

Indicates that the caller needs to get notifications about OSC devices.

This function may be called from any thread.

Definition at line 267 of file VuoOscDevices.cc.

◆ VuoOscInputDevice_realize()

bool VuoOscInputDevice_realize ( VuoOscInputDevice  device,
VuoOscInputDevice realizedDevice 
)

If any of device's properties are unknown:

  • If a matching device is present, sets realizedDevice to that device, and returns true.
  • If no matching device is present, returns false, leaving realizedDevice unset.

If all of device's properties are already known, sets realizedDevice to a copy of device, and returns true. (Doesn't bother checking whether the device is currently present.)

Call VuoOsc_use() before calling this.

This function may be called from any thread.

Definition at line 400 of file VuoOscDevices.cc.

◆ VuoOscOutputDevice_realize()

bool VuoOscOutputDevice_realize ( VuoOscOutputDevice  device,
VuoOscOutputDevice realizedDevice 
)

If any of device's properties are unknown:

  • If a matching device is present, sets realizedDevice to that device, and returns true.
  • If no matching device is present, returns false, leaving realizedDevice unset.

If all of device's properties are already known, sets realizedDevice to a copy of device, and returns true. (Doesn't bother checking whether the device is currently present.)

Call VuoOsc_use() before calling this.

This function may be called from any thread.

Definition at line 461 of file VuoOscDevices.cc.

Variable Documentation

◆ VuoOsc_browser

CFNetServiceBrowserRef VuoOsc_browser

Manages notifications about OSC devices.

Definition at line 260 of file VuoOscDevices.cc.

◆ VuoOsc_deviceQueue

dispatch_queue_t VuoOsc_deviceQueue
static

Serializes access to the below device lists.

Definition at line 36 of file VuoOscDevices.cc.

◆ VuoOsc_inputDeviceCallbacks

VuoTriggerSet<VuoList_VuoOscInputDevice> VuoOsc_inputDeviceCallbacks
static

Trigger functions to call when the list of devices changes.

Definition at line 39 of file VuoOscDevices.cc.

◆ VuoOsc_inputDevices

VuoList_VuoOscInputDevice VuoOsc_inputDevices
static

All known input devices.

Definition at line 37 of file VuoOscDevices.cc.

◆ VuoOsc_outputDeviceCallbacks

VuoTriggerSet<VuoList_VuoOscOutputDevice> VuoOsc_outputDeviceCallbacks
static

Trigger functions to call when the list of devices changes.

Definition at line 40 of file VuoOscDevices.cc.

◆ VuoOsc_outputDevices

VuoList_VuoOscOutputDevice VuoOsc_outputDevices
static

All known output devices.

Definition at line 38 of file VuoOscDevices.cc.

◆ VuoOsc_useCount

unsigned int VuoOsc_useCount = 0

Process-wide count of callers (typically node instances) interested in notifications about OSC devices.

Definition at line 259 of file VuoOscDevices.cc.