Players
start_audio_output(port, path, args, media, uuid, timeout=5.0)
Starts an audio output
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port
|
int
|
The port to use for the audio output |
required |
path
|
str
|
The path to the audio player executable |
required |
args
|
list[str]
|
The arguments to pass to the audio player |
required |
media
|
str
|
The media to play |
required |
uuid
|
str
|
The uuid of the audio output |
required |
timeout
|
float
|
Maximum time to wait for player to start (seconds) |
5.0
|
Returns:
| Type | Description |
|---|---|
tuple[AudioPlayer, AudioClient]
|
A tuple containing the audio player and client |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If player fails to start within timeout or thread dies |
Source code in src/cuemsengine/players/AudioPlayer.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
AudioMixer
Bases: Player
JACK audio mixer using jack-volume controlled via OSC.
This class manages a jack-volume process which provides volume control for multiple audio channels. It connects to JACK and exposes OSC control.
OSC address format: /audiomixer/
Source code in src/cuemsengine/players/AudioMixer.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
__init__(audio_outputs, port, mixer_id, path=None, args=None)
Initialize the AudioMixer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
audio_outputs
|
List of audio output configurations |
required | |
port
|
OSC port for jack-volume communication |
required | |
mixer_id
|
str
|
Unique identifier for this mixer |
required |
path
|
Optional path to jack-volume binary (defaults to JACK_VOLUME_PATH) |
None
|
Source code in src/cuemsengine/players/AudioMixer.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
connect_player_to_mixer(player_name, player_output_prefix='output', mixer_channel=0, max_retries=30, retry_delay=0.5)
Connect a player's output to a specific mixer input channel.
First disconnects any existing connections from the player's outputs, then connects them to the mixer inputs. Will retry if ports are not immediately available (race condition with player startup).
Handles both mono and stereo players: - Mono: output_0 → input_1 (single channel) - Stereo: output_0 → input_1, output_1 → input_2
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_name
|
str
|
Name of the player JACK client to connect |
required |
player_output_prefix
|
str
|
Prefix for player's output ports (e.g., 'output') |
'output'
|
mixer_channel
|
int
|
Mixer input channel number (0-indexed) |
0
|
max_retries
|
int
|
Maximum number of connection attempts (default 10) |
30
|
retry_delay
|
float
|
Delay between retries in seconds (default 0.2) |
0.5
|
Source code in src/cuemsengine/players/AudioMixer.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
connect_player_to_outputs(player_name, player_output_prefix='outport', selected_outputs=None, max_retries=30, retry_delay=0.5)
Connect a player to specific system outputs based on cue configuration.
Maps selected output port names to mixer inputs: - system:playback_1 → mixer input_1 - system:playback_2 → mixer input_2
For stereo audio with a single output selected, both player channels are summed to that output. For both outputs, normal stereo routing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_name
|
str
|
Name of the player JACK client to connect |
required |
player_output_prefix
|
str
|
Prefix for player's output ports (e.g., 'outport') |
'outport'
|
selected_outputs
|
list
|
List of output port names (e.g., ['system:playback_1']) |
None
|
max_retries
|
int
|
Maximum number of connection attempts |
30
|
retry_delay
|
float
|
Delay between retries in seconds |
0.5
|
Source code in src/cuemsengine/players/AudioMixer.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
connect_to_jack(max_retries=10, retry_delay=0.5)
Connect mixer outputs to the configured playback ports.
Retries if ports are not yet registered (race with jack-volume startup).
Source code in src/cuemsengine/players/AudioMixer.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |
disconnect_player(player_name, player_output_prefix='outport')
Disconnect a player's outputs from the mixer.
Must be called BEFORE the player's JACK client is destroyed (i.e. before sending /quit), otherwise JACK receives disconnect requests for ports that no longer exist, which can corrupt its shared memory registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_name
|
str
|
Name of the player JACK client |
required |
player_output_prefix
|
str
|
Prefix for player's output ports |
'outport'
|
Source code in src/cuemsengine/players/AudioMixer.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
player_connections_correct(player_name, player_output_prefix='outport', selected_outputs=None)
Verify the player's outputs are wired exactly as connect_player_to_outputs would wire them.
Mirrors the routing in connect_player_to_outputs: same output_to_input mapping (built from audio_outputs), same alternating L/R fan-out walk, same mono branch (outport 0 → both pair members when channel_1 absent).
Returns False if any expected edge is missing, points elsewhere, or if outport 0 itself does not exist (subprocess gone). Caller decides whether to repair via connect_player_to_outputs or abort the cue.
Source code in src/cuemsengine/players/AudioMixer.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | |
run()
Start the jack-volume subprocess.
Source code in src/cuemsengine/players/AudioMixer.py
57 58 59 60 61 62 63 64 65 | |
MixerClient
Bases: PlayerClient
OSC Client for controlling the AudioMixer via jack-volume.
Provides methods to control volume for individual channels and master volume.
Uses OSC addresses: /audiomixer/
Source code in src/cuemsengine/players/AudioMixer.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
__init__(player_port, channel_number, mixer_id)
Initialize the MixerClient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_port
|
int
|
OSC port where jack-volume is listening |
required |
channel_number
|
int
|
Number of audio channels in the mixer |
required |
mixer_id
|
str
|
Unique identifier for this mixer |
required |
Source code in src/cuemsengine/players/AudioMixer.py
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
add_to_oscquery_server(oscquery_server)
Add this mixer's OSC routes to a local OSCQuery server.
This allows the mixer controls to be visible and controllable through the OSCQuery server interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
oscquery_server
|
OssiaServer instance to add endpoints to |
required |
Source code in src/cuemsengine/players/AudioMixer.py
494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
mute_channel(channel)
Mute a specific channel by setting its volume to 0.0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
int
|
Channel number (0-indexed) |
required |
Source code in src/cuemsengine/players/AudioMixer.py
461 462 463 464 465 466 467 468 | |
mute_master()
Mute master volume.
Source code in src/cuemsengine/players/AudioMixer.py
480 481 482 483 | |
reset_volumes()
Reset all volumes to maximum (1.0).
Call this when loading a project or starting playback to ensure consistent volume levels.
Source code in src/cuemsengine/players/AudioMixer.py
450 451 452 453 454 455 456 457 458 459 | |
set_all_channels_volume(gain)
Set volume for all channels (excluding master).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gain
|
float
|
Volume gain (0.0 to 1.0) |
required |
Source code in src/cuemsengine/players/AudioMixer.py
440 441 442 443 444 445 446 447 448 | |
set_channel_volume(channel, gain)
Set volume for a specific channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
int
|
Channel number (0-indexed) |
required |
gain
|
float
|
Volume gain (0.0 to 1.0) |
required |
Source code in src/cuemsengine/players/AudioMixer.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | |
set_master_volume(gain)
Set the master volume gain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gain
|
float
|
Volume gain (0.0 to 1.0) |
required |
Source code in src/cuemsengine/players/AudioMixer.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 | |
unmute_channel(channel, gain=1.0)
Unmute a specific channel by setting its volume.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
int
|
Channel number (0-indexed) |
required |
gain
|
float
|
Volume gain to restore (0.0 to 1.0), defaults to 1.0 |
1.0
|
Source code in src/cuemsengine/players/AudioMixer.py
470 471 472 473 474 475 476 477 478 | |
unmute_master(gain=1.0)
Unmute master volume.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gain
|
float
|
Volume gain to restore (0.0 to 1.0), defaults to 1.0 |
1.0
|
Source code in src/cuemsengine/players/AudioMixer.py
485 486 487 488 489 490 491 492 | |
build_mixer_osc_endpoints(client_name, channel_number)
Build OSC endpoint configuration for audio mixer.
Creates OSC addresses in the format expected by jack-volume (audiomixer_routes branch): /audiomixer/{client_name}/master /audiomixer/{client_name}/0 /audiomixer/{client_name}/1 etc.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client_name
|
str
|
Name of the mixer client instance (JACK client name) |
required |
channel_number
|
int
|
Number of audio channels in the mixer |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary of OSC endpoints with their configuration |
Source code in src/cuemsengine/players/AudioMixer.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | |
get_mixer_client_name(mixer_id)
Get the client name for the mixer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mixer_id
|
str
|
Unique identifier for this mixer |
required |
Returns:
| Type | Description |
|---|---|
str
|
Client name for the mixer |
Source code in src/cuemsengine/players/AudioMixer.py
583 584 585 586 587 588 589 590 591 592 | |
start_audio_mixer(audio_outputs, port, mixer_id, path=None, args=None, timeout=5.0)
Start an audio mixer and its OSC client.
This function creates and starts a jack-volume mixer process and sets up an OSC client to control it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
audio_outputs
|
list
|
List of audio output configurations |
required |
port
|
int
|
OSC port for jack-volume communication |
required |
mixer_id
|
str
|
Unique identifier for this mixer |
required |
path
|
str
|
Optional path to jack-volume binary |
None
|
args
|
str | None
|
Additional arguments for jack-volume |
None
|
timeout
|
float
|
Maximum time to wait for mixer to start (seconds) |
5.0
|
Returns:
| Type | Description |
|---|---|
tuple[AudioMixer, MixerClient]
|
Tuple containing the AudioMixer and MixerClient instances |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If mixer fails to start within timeout or thread dies |
Source code in src/cuemsengine/players/AudioMixer.py
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 | |
DmxClient
Bases: PlayerClient
Source code in src/cuemsengine/players/DmxPlayer.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
__init__(player_port, client_name, host='127.0.0.1')
Initialize the DMX client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_port
|
int
|
OSC port for communication |
required |
client_name
|
str
|
Name for this client instance |
required |
host
|
str
|
Host IP address of the dmxplayer |
'127.0.0.1'
|
Source code in src/cuemsengine/players/DmxPlayer.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
disable_mtcfollow()
Disable MTC following so the dmxplayer stops advancing its playhead.
Source code in src/cuemsengine/players/DmxPlayer.py
82 83 84 85 | |
enable_mtcfollow()
Enable MTC following so the dmxplayer tracks timecode.
Source code in src/cuemsengine/players/DmxPlayer.py
77 78 79 80 | |
send_blackout(universe_ids=(0, 1))
Send blackout: clear dmxplayer fades + direct OLA backup.
Sends /blackout to the dmxplayer which clears all queued scenes, active fades, and writes zeros to OLA. The direct ola_set_dmx backup covers the case where the dmxplayer hasn't processed the command yet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
universe_ids
|
int | tuple[int, ...]
|
DMX universe(s) to black out. |
(0, 1)
|
Source code in src/cuemsengine/players/DmxPlayer.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
send_dmx_scene(universe_frames, mtc_time, fade_time=0.0)
Send a complete DMX scene as an OSC bundle via pyossia.
Constructs an OSC bundle containing: - /frame messages: universe_id followed by channel/value pairs - /mtc_time or /start_offset: timing information - /fade_time: fade duration
Source code in src/cuemsengine/players/DmxPlayer.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
DmxPlayer
Bases: Player
DMX player process wrapper.
Manages a single cuems-dmxplayer process per node and exposes OSC control.
Source code in src/cuemsengine/players/DmxPlayer.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
__init__(port, node_uuid, path=None, args=None)
Initialize the DmxPlayer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port
|
OSC port for dmxplayer communication |
required | |
node_uuid
|
Unique identifier for this player node |
required | |
path
|
Path to cuems-dmxplayer binary |
None
|
Source code in src/cuemsengine/players/DmxPlayer.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
run()
Call cuems-dmxplayer in a subprocess
Source code in src/cuemsengine/players/DmxPlayer.py
35 36 37 38 39 40 41 42 43 44 45 | |
start_dmx_player(port, node_uuid, path, args=None, timeout=5.0)
Start a DMX player and its OSC client.
This function creates and starts a cuems-dmxplayer process and sets up an OSC client to control it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port
|
int
|
OSC port for dmxplayer communication |
required |
node_uuid
|
str
|
Unique identifier for this player node |
required |
path
|
str
|
Path to cuems-dmxplayer binary |
required |
args
|
str | None
|
Additional arguments for cuems-dmxplayer |
None
|
timeout
|
float
|
Maximum time to wait for player to start (seconds) |
5.0
|
Returns:
| Type | Description |
|---|---|
tuple[DmxPlayer, DmxClient]
|
Tuple containing the DmxPlayer and DmxClient instances |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If player fails to start within timeout or thread dies |
Source code in src/cuemsengine/players/DmxPlayer.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
VideoClient
Bases: PlayerClient
Source code in src/cuemsengine/players/VideoPlayer.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
create_layer_endpoints(layer_id)
Register per-layer OSC endpoints for the given layer_id.
Source code in src/cuemsengine/players/VideoPlayer.py
40 41 42 43 44 45 46 | |
remove_layer_endpoints(layer_id)
Remove per-layer OSC endpoints for the given layer_id.
Source code in src/cuemsengine/players/VideoPlayer.py
48 49 50 51 52 53 54 55 | |
VideoOutput
Source code in src/cuemsengine/players/VideoPlayer.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
apply_config(video_client)
No-op: videocomposer reads display config from display.conf at startup.
/run/cuems/display.conf is the shared contract between engine and videocomposer for canvas geometry. cuems-generate-display-conf (videocomposer's ExecStartPre) writes it from default_mappings.xml; both VC and the engine (via cuemsengine.display_conf.read_display_conf) read it independently. The engine must NOT send /display/region or resolution_mode here because that caused the MultiOutputRenderer to reconfigure (and sometimes switch to native 4K resolution, corrupting the canvas layout). Phase 2 will gate runtime tweaks behind explicit edit-mode OSC handlers.
Source code in src/cuemsengine/players/VideoPlayer.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
get_layer_placement()
Returns (x, y) offset from canvas center to this output's center.
The videocomposer uses center-relative coordinates: (0, 0) = canvas center. The renderer negates Y (glTranslatef(x, -y, 0)) because OpenGL Y points up while screen Y points down. The canvas FBO also has Y=0 at the bottom, so we negate Y here to compensate — positive Y in the returned value means "below canvas center" in screen coords, which maps to the correct FBO position after the renderer's negation.
Source code in src/cuemsengine/players/VideoPlayer.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
get_layer_scale()
Returns (scaleX, scaleY) to fit the video layer within this output's region.
The videocomposer renders layers at full canvas size with letterboxing. For typical setups (ultra-wide canvas, 16:9 video), the video fills the canvas height and is letterboxed horizontally. The height ratio therefore determines the correct uniform scale to fit the output region.
Source code in src/cuemsengine/players/VideoPlayer.py
89 90 91 92 93 94 95 96 97 98 | |
VideoPlayer
Bases: Player
Video player systemd service wrapper.
This class restarts the videocomposer service.
IMPORTANT: This class should not be used, since videocomposer is a systemd service and not a subprocess.
Source code in src/cuemsengine/players/VideoPlayer.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
Player
Bases: Thread
Base class for all players in the system. Holds the common methods and attributes for all players. Extends the Thread class. Can call a subprocess, kill it and start the Thread.
IMPORTANT: The run method must be implemented in the child classes.
Source code in src/cuemsengine/players/Player.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
__init__(daemon=True)
Initializes the Player object and a Thread object with the daemon attribute set to True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
daemon
|
bool
|
Sets the daemon attribute of the Thread object. Defaults to True. |
True
|
Source code in src/cuemsengine/players/Player.py
21 22 23 24 25 26 27 28 29 30 31 32 33 | |
call_subprocess(call_args)
Calls a subprocess with the given arguments.
Automatically handles exceptions and updates status/error attributes. Sets status to 'running' on success, 'failed' on error.
Source code in src/cuemsengine/players/Player.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
kill()
Kills the subprocess.
Source code in src/cuemsengine/players/Player.py
66 67 68 69 70 71 | |
start(timeout=5.0)
Starts the player and waits for it to initialize.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
float
|
Maximum time to wait for player to start (seconds) |
5.0
|
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If player fails to start within timeout or thread dies |
Source code in src/cuemsengine/players/Player.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
PlayerHandler
This class is responsible for handling and generating player objects.
It is a singleton class, so it will only be instantiated once.
Holds a list of armed cues and provides methods to use them.
Source code in src/cuemsengine/players/PlayerHandler.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 | |
node_uuid
property
Public read-only accessor for the node uuid.
__new__(*args, **kwargs)
Singleton pattern: Ensure only one instance is created
Source code in src/cuemsengine/players/PlayerHandler.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
add_media_folder(path)
Adds a media folder to the player handler
Source code in src/cuemsengine/players/PlayerHandler.py
764 765 766 767 768 769 770 771 | |
add_node_uuid(uuid)
Adds a node uuid to the player handler
Source code in src/cuemsengine/players/PlayerHandler.py
777 778 779 | |
cleanup_zombie_jack_clients()
Scan for JACK Audio_Player clients whose processes have died.
Enumerates all JACK ports matching Audio_Player-* and cross-references with tracked players in _audio_players_by_id. Unmatched ports are zombies left by crashed processes — disconnect them from the mixer.
Called on project load to clear stale state from previous runs.
Returns:
| Type | Description |
|---|---|
int
|
Number of zombie clients found and cleaned up. |
Source code in src/cuemsengine/players/PlayerHandler.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | |
deregister_layer(layer_id)
Remove a layer from active tracking.
Source code in src/cuemsengine/players/PlayerHandler.py
647 648 649 650 | |
get_all_cue_output_names(cue)
Get all output names for a given cue from the outputs map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cue
|
Cue
|
The cue to get the output names for |
required |
Returns:
| Type | Description |
|---|---|
list
|
List of output names for the given cue, or empty list if not found |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If the outputs map is not set |
Source code in src/cuemsengine/players/PlayerHandler.py
742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 | |
get_audio_mixer()
Returns the audio mixer instance.
Source code in src/cuemsengine/players/PlayerHandler.py
175 176 177 | |
get_audio_mixer_client()
Returns the audio mixer client instance.
Source code in src/cuemsengine/players/PlayerHandler.py
179 180 181 | |
get_cue_output_name(cue)
Get the output name for a given cue from the outputs map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cue
|
Cue
|
The cue to get the output name for |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The output name for the given cue or None if the cue is not found in the outputs map |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If the outputs map is not set |
Source code in src/cuemsengine/players/PlayerHandler.py
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 | |
get_cue_player(cue)
Gets a cue player
Source code in src/cuemsengine/players/PlayerHandler.py
89 90 91 92 | |
get_dmx_player()
Returns the DMX player instance.
Source code in src/cuemsengine/players/PlayerHandler.py
474 475 476 | |
get_dmx_player_client()
Returns the DMX player client instance.
Source code in src/cuemsengine/players/PlayerHandler.py
478 479 480 | |
get_gradient_client()
Returns the GradientClient instance, or None if not yet initialised.
Source code in src/cuemsengine/players/PlayerHandler.py
521 522 523 | |
get_video_client()
Returns the video client instance.
Source code in src/cuemsengine/players/PlayerHandler.py
512 513 514 | |
get_video_output(output_name)
Returns the VideoOutput object for a given output name.
Source code in src/cuemsengine/players/PlayerHandler.py
580 581 582 | |
kill_all_audio_players()
Kill ALL tracked audio players - used during project cleanup
Source code in src/cuemsengine/players/PlayerHandler.py
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
kill_orphaned_audio_processes()
Kill cuems-audioplayer OS processes not tracked by this engine.
On engine restart, previously spawned audioplayer processes survive because they are independent subprocesses. The new engine has no reference to them, so they steal JACK client names and cause silence.
Source code in src/cuemsengine/players/PlayerHandler.py
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |
make_custom_video_output(cue_output)
Build a VideoOutput for a per-cue custom region.
cue_output is a dict-like VideoCueOutput with a canvas_region holding normalized floats in [0, 1]. Converts to pixel integers so VideoOutput.get_layer_placement / get_layer_scale work the same way they do for alias outputs.
Source code in src/cuemsengine/players/PlayerHandler.py
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | |
media_path(file_name)
Returns the media path for a given file name
Source code in src/cuemsengine/players/PlayerHandler.py
773 774 775 | |
new_audio_output(cue)
Creates a new audio output for the given cue
The player is stored in the player handler and the osc client is assigned to the cue. After creating the player, it will be automatically connected to the audio mixer if one exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cue
|
AudioCue
|
The cue to create the audio output for |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in src/cuemsengine/players/PlayerHandler.py
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 | |
quit_videocomposer()
Quits the videocomposer process.
Source code in src/cuemsengine/players/PlayerHandler.py
685 686 687 688 689 690 691 692 693 694 695 696 | |
register_layer(layer_id)
Track a layer as active in the videocomposer.
Source code in src/cuemsengine/players/PlayerHandler.py
642 643 644 645 | |
remove_cue_player(cue)
Removes a cue player
Source code in src/cuemsengine/players/PlayerHandler.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
reset_all()
Complete reset of PlayerHandler for testing
Source code in src/cuemsengine/players/PlayerHandler.py
122 123 124 125 126 127 128 129 130 | |
reset_video_layers()
Unload all tracked video layers (video blackout). Legacy per-layer method.
Source code in src/cuemsengine/players/PlayerHandler.py
670 671 672 673 674 675 676 677 678 679 680 681 682 683 | |
reset_videocomposer()
Send atomic reset to videocomposer (removes all layers + resets master).
Source code in src/cuemsengine/players/PlayerHandler.py
652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 | |
resolve_audio_port(output_id)
Resolve an output
Source code in src/cuemsengine/players/PlayerHandler.py
146 147 148 149 150 151 | |
resolve_video_output_for_cue(cue, output_name)
Resolve an output_name suffix to a VideoOutput.
For alias suffixes (
Source code in src/cuemsengine/players/PlayerHandler.py
624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 | |
set_audio_output_generator(path, args)
Sets the audio player generator
Source code in src/cuemsengine/players/PlayerHandler.py
137 138 139 140 | |
set_audio_outputs(audio_outputs)
Store audio output configs keyed by
Source code in src/cuemsengine/players/PlayerHandler.py
142 143 144 | |
set_gradient_client(port, node_uuid)
Construct (or replace) the GradientClient for this node.
Safe to call multiple times: any new call replaces the prior client. PyOscClient is fire-and-forget UDP with no held resources, so no teardown of the prior client is needed.
Source code in src/cuemsengine/players/PlayerHandler.py
525 526 527 528 529 530 531 532 533 534 535 536 537 538 | |
set_outputs_map(outputs_map)
Set the outputs map for the player handler
Source code in src/cuemsengine/players/PlayerHandler.py
717 718 719 | |
set_player_endpoints(cue)
Sets the player endpoints for a given cue
Source code in src/cuemsengine/players/PlayerHandler.py
708 709 710 711 712 713 714 715 | |
set_player_endpoints_generator(func, *args, **kwargs)
Sets the player endpoints generator
Source code in src/cuemsengine/players/PlayerHandler.py
703 704 705 706 | |
set_video_client(port)
Sets the video client for this node.
Source code in src/cuemsengine/players/PlayerHandler.py
516 517 518 519 | |
start_audio_mixer(audio_outputs, port, mixer_id, path=None, args=None)
Starts the audio mixer for this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
audio_outputs
|
list
|
List of audio output configurations |
required |
port
|
int
|
OSC port for jack-volume communication |
required |
node_uuid
|
Unique identifier for this mixer node |
required | |
path
|
str
|
Optional path to jack-volume binary |
None
|
Returns:
| Type | Description |
|---|---|
tuple[AudioMixer, MixerClient]
|
Tuple containing the AudioMixer and MixerClient instances |
Source code in src/cuemsengine/players/PlayerHandler.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
start_dmx_player(port, node_uuid, path, args=None)
Starts the DMX player for this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port
|
int
|
OSC port for dmxplayer communication |
required |
node_uuid
|
str
|
Unique identifier for this player node |
required |
path
|
str
|
Path to cuems-dmxplayer binary |
required |
Returns:
| Type | Description |
|---|---|
tuple[DmxPlayer, DmxClient]
|
Tuple containing the DmxPlayer and DmxClient instances |
Source code in src/cuemsengine/players/PlayerHandler.py
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | |
start_video_outputs(output_names, canvas_override=None)
Ensures that the all the required video output exist.
canvas_override is an optional (width, height) carrying the
engine reader's authoritative canvas size — set when display.conf
has a canvas_size= global key. When provided, it must be >=
the per-region bounding box (we validate as defense in depth — the
reader already validates, but a stale caller could pass garbage).
When None, fall back to bbox computed from the output regions.
Source code in src/cuemsengine/players/PlayerHandler.py
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 | |
store_cue_player(cue, player)
Stores a cue player
Source code in src/cuemsengine/players/PlayerHandler.py
84 85 86 87 | |
Fire-and-forget UDP OSC client for gradient-motiond v0.3.0.
GradientClient
Fire-and-forget UDP OSC client for gradient-motiond v0.3.0.
Holds node_uuid at construction and injects it as node_name on every send_fade — callers do not pass it. Safe to construct multiple times; each new instance replaces the prior one in PlayerHandler.
Source code in src/cuemsengine/players/GradientClient.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
JACK Connection Manager
This module provides a simple interface for managing JACK audio connections using the python-jack (JACK-Client) library.
JackConnectionManager
Manager for JACK audio connections.
Uses the python-jack (JACK-Client) library to manage JACK port connections. Creates a lightweight client just for querying and connection management.
Source code in src/cuemsengine/players/JackConnectionManager.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | |
client
property
Get the JACK client, reinitializing if necessary.
__del__()
Cleanup JACK client on deletion.
Source code in src/cuemsengine/players/JackConnectionManager.py
243 244 245 246 247 248 249 250 | |
__init__(client_name='cuems_connection_manager')
Initialize the JACK connection manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client_name
|
str
|
Name for the JACK client (default: 'cuems_connection_manager') |
'cuems_connection_manager'
|
Source code in src/cuemsengine/players/JackConnectionManager.py
27 28 29 30 31 32 33 34 35 | |
connect_by_name(source_port, destination_port)
Connect two JACK ports by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_port
|
str
|
Name of the source port (output) |
required |
destination_port
|
str
|
Name of the destination port (input) |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if connection successful, False otherwise |
Source code in src/cuemsengine/players/JackConnectionManager.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
disconnect_by_name(source_port, destination_port)
Disconnect two JACK ports by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_port
|
str
|
Name of the source port (output) |
required |
destination_port
|
str
|
Name of the destination port (input) |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if disconnection successful, False otherwise |
Source code in src/cuemsengine/players/JackConnectionManager.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
get_connections(port_name)
Get all connections for a given port.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port_name
|
str
|
Name of the port to query |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
List of connected port names |
Source code in src/cuemsengine/players/JackConnectionManager.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | |
get_ports(pattern=None, is_audio=True, is_output=None, is_input=None)
Get list of JACK ports.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern
|
str
|
Optional regex pattern to filter port names |
None
|
is_audio
|
bool
|
Filter for audio ports (default: True) |
True
|
is_output
|
bool
|
Filter for output ports (default: None = all) |
None
|
is_input
|
bool
|
Filter for input ports (default: None = all) |
None
|
Returns:
| Type | Description |
|---|---|
list[str]
|
List of port names |
Source code in src/cuemsengine/players/JackConnectionManager.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
is_connected(source_port, destination_port)
Check if two ports are connected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_port
|
str
|
Name of the source port |
required |
destination_port
|
str
|
Name of the destination port |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if connected, False otherwise |
Source code in src/cuemsengine/players/JackConnectionManager.py
229 230 231 232 233 234 235 236 237 238 239 240 241 | |
port_exists(port_name)
Check if a JACK port exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port_name
|
str
|
Full name of the port (e.g., 'client_name:port_name') |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the port exists, False otherwise |
Source code in src/cuemsengine/players/JackConnectionManager.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |