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 | |
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
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 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 | |
__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 |
None
|
Source code in src/cuemsengine/players/AudioMixer.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 56 57 58 59 60 61 62 63 64 65 66 67 | |
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'
|
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
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 | |
connect_player_to_outputs(player_name, player_output_prefix='outport', selected_outputs=None, max_retries=30, retry_delay=0.5, should_abort=None, ready=None)
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'
|
selected_outputs
|
list
|
List of output port names (e.g., |
None
|
['system
|
playback_1']) |
required | |
max_retries
|
int
|
Maximum number of connection attempts |
30
|
retry_delay
|
float
|
Delay between retries in seconds |
0.5
|
should_abort
|
optional predicate, checked on every attempt the |
None
|
|
caller passes "the player process has exited"
|
its ports can |
required | |
ready
|
optional threading.Event the player sets once it reports |
None
|
|
given, the wiring waits for it before looking at the ports
|
the |
required | |
auto-connects them to system
|
playback only when its stream starts. |
required |
KNOWN LIMIT (869fbyjzx): this makes an audio arm correct and as fast as the player allows, about 0.47 s cold (0.35 s warm), most of it the player's own start-up. A GO that reaches a cue less than that after its arm started still waits for the arm and fires LATE by the difference. On test2 (a node audio cue behind another node's pause, second GO after the hand-off): 0.3 s -> ~0.2 s late; 0.5 s and later -> on time. Only arming BEFORE the hand-off removes it. PLAN B, not built because no real show hits it today (sala1's node segments are video only; the cost is players and layers held for the whole pause): arm the first local segment at load even behind another node's pause, and the next one after each GO ("Part B", Plans/2026-10-01-engine-prearm-past- pauses-and-inventory.md; measured cost ~15 MB per held audio player, ~40 MB GPU per held 1080p video layer). A cheaper variant is to pre-launch players. Revisit if a venue reports a late node audio cue after a fast double GO.
Returns:
| Type | Description |
|---|---|
|
True if every required player→mixer connection was made, False if |
|
|
the player ports never registered, no mixer inputs resolved, or any |
|
|
connection failed (caller should treat False as a silent cue). |
Source code in src/cuemsengine/players/AudioMixer.py
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 | |
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
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 | |
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
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 | |
player_connection_diff(player_name, player_output_prefix='outport', selected_outputs=None)
Compare a player's outport edges with the expected wiring.
Returns (missing, stray), two lists of (source, destination) edges: missing = expected edges that are not connected; stray = edges on the player's outports that are not expected (e.g. RtAudio's own auto-connect to system:playback, 869fcvz85). An edge is never in both. Returns None when the graph cannot be wired at all: outport 0 does not exist (the subprocess is gone) or no mixer input resolves — callers must treat None as a silent cue, never as "correct".
One get_connections per outport (outport 1 only on a stereo player): this runs on the GO path before /offset.
Source code in src/cuemsengine/players/AudioMixer.py
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 | |
player_connections_correct(player_name, player_output_prefix='outport', selected_outputs=None)
True when the player is wired exactly as connect_player_to_outputs wires it: every expected edge present and nothing else on its outports. False on a missing edge, a stray edge, a missing outport 0 (subprocess gone) or no mixer input. See player_connection_diff.
Source code in src/cuemsengine/players/AudioMixer.py
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | |
repair_player_connections(missing, stray)
Fix a player's wiring edge by edge, never by a full rewire.
A GO can reach this while the cue is audible (a fresh GO or a 'play' action on a playing cue), so a working mixer edge is never disconnected: strays are disconnected one by one, missing edges connected one by one (869fbyjzx).
Each stray is re-checked just before its disconnect: one already gone (a stale diff, a re-arm wiring the same player) is skipped, because a failed disconnect resets the SHARED JACK client under any arm wiring at the same moment (JackConnectionManager.disconnect_by_name).
Returns (connected_ok, strays_left): whether every missing edge got connected, and the strays whose disconnect failed.
Source code in src/cuemsengine/players/AudioMixer.py
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 | |
run()
Start the jack-volume subprocess.
Source code in src/cuemsengine/players/AudioMixer.py
73 74 75 76 77 78 79 80 81 | |
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
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 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 | |
__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
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 | |
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
849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 | |
apply_volume(channel, gain)
Send a volume to jack-volume AND record it in _gain_state.
The typed setters (set_master_volume / set_channel_volume, hence reset_volumes) route through here, so a reset populates _gain_state with the values it commanded. The node snapshots that state to the controller right after each reset, letting the UI read back the true (post-reset) mixer gain — jack-volume itself is write-only.
(Live per-cue UI writes stay on the raw set_value path and are shadowed controller-side; they are not recorded here because the node snapshots only on reset, never per write — a per-write report would race the controller's optimistic populate.)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
"master" or a 0-indexed channel (int or numeric string) |
required | |
gain
|
float
|
Volume gain (0.0 to 1.0) |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if applied; False if gain/channel was invalid (no OSC sent, |
bool
|
no state change) — same reject-and-no-op semantics the typed |
bool
|
setters have always had. |
Source code in src/cuemsengine/players/AudioMixer.py
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 | |
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
816 817 818 819 820 821 822 823 | |
mute_master()
Mute master volume.
Source code in src/cuemsengine/players/AudioMixer.py
835 836 837 838 | |
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
805 806 807 808 809 810 811 812 813 814 | |
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
795 796 797 798 799 800 801 802 803 | |
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
785 786 787 788 789 790 791 792 793 | |
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
776 777 778 779 780 781 782 783 | |
snapshot()
Return a copy of the authoritative gain state for reporting.
Shape: {"master": gain, "0": gain, "1": gain, …}.
Source code in src/cuemsengine/players/AudioMixer.py
769 770 771 772 773 774 | |
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
825 826 827 828 829 830 831 832 833 | |
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
840 841 842 843 844 845 846 847 | |
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
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 | |
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
944 945 946 947 948 949 950 951 952 953 | |
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
886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 | |
DmxClient
Bases: PlayerClient
Source code in src/cuemsengine/players/DmxPlayer.py
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 | |
__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
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
disable_mtcfollow()
Disable MTC following so the dmxplayer stops advancing its playhead.
Source code in src/cuemsengine/players/DmxPlayer.py
95 96 97 98 99 100 | |
enable_mtcfollow()
Enable MTC following so the dmxplayer tracks timecode.
Source code in src/cuemsengine/players/DmxPlayer.py
90 91 92 93 | |
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
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 | |
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
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 | |
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
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 | |
__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
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
run()
Call cuems-dmxplayer in a subprocess
Source code in src/cuemsengine/players/DmxPlayer.py
36 37 38 39 40 41 42 43 44 45 46 | |
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
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 | |
VideoClient
Bases: PlayerClient
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 31 | |
create_layer_endpoints(layer_id)
Register per-layer OSC endpoints for the given layer_id.
Source code in src/cuemsengine/players/VideoPlayer.py
17 18 19 20 21 22 | |
remove_layer_endpoints(layer_id)
Remove per-layer OSC endpoints for the given layer_id.
Source code in src/cuemsengine/players/VideoPlayer.py
24 25 26 27 28 29 30 31 | |
VideoOutput
Source code in src/cuemsengine/players/VideoPlayer.py
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 | |
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
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
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
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
get_layer_scale(media_w=None, media_h=None)
Returns a uniform (s, s) that renders the media at its NATIVE pixel size, clamped so the layer never exceeds this output's region.
The videocomposer base-renders each layer letterboxed against the whole canvas (fills canvas height) and applies scale as quad geometry sampling the source texture, so s = media_h/canvas_h reproduces the media 1:1 (no resample, no stretch). The two clamp terms keep an oversized / wider- aspect media inside this region instead of bleeding onto neighbouring outputs: - (region_w * media_h) / (media_w * canvas_h): clamp width to region - region_h / canvas_h: clamp height to region The min() is ESSENTIAL — for oversized media the media_h/canvas_h term alone could be > 1 and scale the layer UP, causing bleed. Do not remove it.
Falls back to the legacy region-height ratio when media dims are unknown (ffprobe failed / non-video media). NOTE: that fallback reproduces the original overflow for an output whose aspect != media aspect, so it is logged at WARNING to make a silent re-bleed visible.
Source code in src/cuemsengine/players/VideoPlayer.py
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 | |
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
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 | |
__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 |
True
|
Source code in src/cuemsengine/players/Player.py
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 | |
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
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 | |
kill()
Kills the subprocess.
Source code in src/cuemsengine/players/Player.py
93 94 95 96 97 98 | |
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 |
Source code in src/cuemsengine/players/Player.py
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 | |
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
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 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 | |
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
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 | |
add_media_folder(path)
Adds a media folder to the player handler
Source code in src/cuemsengine/players/PlayerHandler.py
1109 1110 1111 1112 1113 1114 1115 1116 | |
add_node_uuid(uuid)
Adds a node uuid to the player handler
Source code in src/cuemsengine/players/PlayerHandler.py
1228 1229 1230 | |
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. Like the orphan sweeps it is hygiene, so it never raises into the load (869evtdf7): a JACK error skips the cleanup with a warning, and audio cues then fail loudly at their own arm.
Returns:
| Type | Description |
|---|---|
int
|
Number of zombie clients found and cleaned up. |
Source code in src/cuemsengine/players/PlayerHandler.py
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 | |
cue_media_dimensions(cue)
(width, height) px of a video cue's media, as stored in the project.
The editor stores pixel_width / pixel_height and the file's
file_size in the cue's Media when the file is uploaded, as it
stores the duration, so arming a video cue needs no ffprobe: a
cue selection arms the selected chain under the command lock, and a
GO sent right after it waited for the probes (869fat84r).
Falls back to :meth:media_dimensions (the probe), warning once per
file, when the values are missing or invalid (a project saved before
they existed, or by an older editor), or when file_size differs
from this node's copy of the file (replaced under the same name).
Read with .get(): projects are parsed without Media's
setters, and an older cuemsutils has none for these keys.
Source code in src/cuemsengine/players/PlayerHandler.py
1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 | |
deregister_layer(layer_id)
Remove a layer from active tracking.
Source code in src/cuemsengine/players/PlayerHandler.py
984 985 986 987 | |
driven_video_outputs()
The outputs this node drives, as id=connector, for log lines.
Source code in src/cuemsengine/players/PlayerHandler.py
947 948 949 950 951 952 | |
first_unrouted_report(cue_id, output_name)
True the first time a (cue, output) is reported unrouted in this load, so the arm logs it at ERROR once and every re-arm (STOP, loop, enable, go() fallback) at DEBUG.
Source code in src/cuemsengine/players/PlayerHandler.py
954 955 956 957 958 959 960 961 962 963 | |
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
1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 | |
get_audio_mixer()
Returns the audio mixer instance.
Source code in src/cuemsengine/players/PlayerHandler.py
354 355 356 | |
get_audio_mixer_client()
Returns the audio mixer client instance.
Source code in src/cuemsengine/players/PlayerHandler.py
358 359 360 | |
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 |
str | None
|
in the outputs map |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If the outputs map is not set |
Source code in src/cuemsengine/players/PlayerHandler.py
1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 | |
get_cue_player(cue)
Gets a cue player
Source code in src/cuemsengine/players/PlayerHandler.py
253 254 255 256 | |
get_dmx_player()
Returns the DMX player instance.
Source code in src/cuemsengine/players/PlayerHandler.py
733 734 735 | |
get_dmx_player_client()
Returns the DMX player client instance.
Source code in src/cuemsengine/players/PlayerHandler.py
737 738 739 | |
get_gradient_client()
Returns the GradientClient instance, or None if not yet initialised.
Source code in src/cuemsengine/players/PlayerHandler.py
780 781 782 783 784 | |
get_video_client()
Returns the video client instance.
Source code in src/cuemsengine/players/PlayerHandler.py
771 772 773 | |
get_video_output(output_name)
Returns the VideoOutput object for a given output name.
Source code in src/cuemsengine/players/PlayerHandler.py
847 848 849 | |
is_layer_registered(layer_id)
True while the layer is tracked as loaded in the videocomposer.
reset_videocomposer / reset_video_layers / quit_videocomposer clear the tracking together with the layers' endpoints.
Source code in src/cuemsengine/players/PlayerHandler.py
975 976 977 978 979 980 981 982 | |
kill_all_audio_players()
Kill ALL tracked audio players - used during project cleanup
Source code in src/cuemsengine/players/PlayerHandler.py
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 | |
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.
Runs in the middle of a project load, so it never raises (869evtdf7).
Source code in src/cuemsengine/players/PlayerHandler.py
529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 | |
kill_orphaned_mixer_processes()
Kill jack-volume mixer processes not tracked by this engine.
Mirrors kill_orphaned_audio_processes for the mixer. On a node-engine restart the previous jack-volume survives as an independent subprocess and keeps the "0_mixer" JACK client name; a freshly spawned jack-volume then hits JackNameNotUnique and is renamed by JACK, ending up a disconnected zombie while the engine still addresses "0_mixer" (the orphan) — every restart also leaks another zombie. Kill any survivor first so the new mixer binds "0_mixer" cleanly.
Match "jack-volume -c" (the binary invoked with its client-name flag)
rather than the bare word, so an operator's tail -f .../jack-volume.log
or a grep isn't caught and killed. Covers both the plain and
"cuems-jack-volume" install names.
Never raises (869evtdf7): an orphan it cannot kill used to stop the mixer from starting, leaving every audio cue on the node silent.
Source code in src/cuemsengine/players/PlayerHandler.py
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 | |
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
866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 | |
media_dimensions(file_name)
Return (width, height) px of the media's first video stream via ffprobe, cached by (path, st_mtime). Returns (None, None) on any failure (ffprobe missing/error/timeout, non-video media, file gone), in which case callers fall back to the legacy region-ratio scale.
Source code in src/cuemsengine/players/PlayerHandler.py
1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 | |
media_path(file_name)
Returns the media path for a given file name
Source code in src/cuemsengine/players/PlayerHandler.py
1118 1119 1120 | |
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
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 | |
partition_cue_outputs(cue, output_names)
Split a video cue's outputs into the ones this node drives and the ones it doesn't (869fgq3xv).
Returns (routed, unrouted): routed holds (index, output_name,
VideoOutput) with the output's position in output_names (layer
ids are built from it), unrouted holds (output_name, reason).
An output is unrouted when it does not resolve: an alias this node dropped at start (no region in display.conf, DISPLAY_MISMATCH), a custom region with no VideoCueOutput, no canvas at all. Anything else the resolver raises (a malformed custom region, cue.outputs None) is unrouted too, with its traceback: with no resolved output there is no right place to paint the layer, and the videocomposer's default placement is the whole canvas, i.e. the other screens.
The one function behind both the arm and the load-time preflight, so the two can never disagree. Never raises.
Source code in src/cuemsengine/players/PlayerHandler.py
909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 | |
quit_videocomposer()
Quits the videocomposer process.
Source code in src/cuemsengine/players/PlayerHandler.py
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 | |
register_layer(layer_id)
Track a layer as active in the videocomposer.
Source code in src/cuemsengine/players/PlayerHandler.py
970 971 972 973 | |
remove_cue_player(cue)
Removes a cue player
Source code in src/cuemsengine/players/PlayerHandler.py
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 | |
reset_all()
Complete reset of PlayerHandler for testing
Source code in src/cuemsengine/players/PlayerHandler.py
286 287 288 289 290 291 292 293 294 295 296 297 | |
reset_unrouted_warnings()
Forget which unrouted outputs were reported (called at each load).
Source code in src/cuemsengine/players/PlayerHandler.py
965 966 967 968 | |
reset_video_layers()
Unload all tracked video layers (video blackout). Legacy per-layer method.
Source code in src/cuemsengine/players/PlayerHandler.py
1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 | |
reset_videocomposer()
Send atomic reset to videocomposer (removes all layers + resets master).
Source code in src/cuemsengine/players/PlayerHandler.py
989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | |
resolve_audio_port(output_id)
Resolve an output
Source code in src/cuemsengine/players/PlayerHandler.py
314 315 316 317 318 319 | |
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
891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 | |
set_audio_output_generator(path, args)
Sets the audio player generator
Source code in src/cuemsengine/players/PlayerHandler.py
303 304 305 306 307 308 | |
set_audio_outputs(audio_outputs)
Store audio output configs keyed by
Source code in src/cuemsengine/players/PlayerHandler.py
310 311 312 | |
set_gradient_client(port, node_name)
Construct (or replace) the GradientClient for this node.
node_name must match gradient-motiond's own --node-name (defaults to the OS hostname; see node-identity-contract.md in cuems-common) — NOT the node's UUID, which the daemon's node_name filter will never match, silently dropping every message.
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
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 | |
set_outputs_map(outputs_map)
Set the outputs map for the player handler
Source code in src/cuemsengine/players/PlayerHandler.py
1061 1062 1063 | |
set_player_endpoints(cue)
Sets the player endpoints for a given cue
Source code in src/cuemsengine/players/PlayerHandler.py
1052 1053 1054 1055 1056 1057 1058 1059 | |
set_player_endpoints_generator(func, *args, **kwargs)
Sets the player endpoints generator
Source code in src/cuemsengine/players/PlayerHandler.py
1047 1048 1049 1050 | |
set_video_client(port)
Sets the video client for this node.
Source code in src/cuemsengine/players/PlayerHandler.py
775 776 777 778 | |
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
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 | |
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
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 | |
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
805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 | |
store_cue_player(cue, player)
Stores a cue player
Source code in src/cuemsengine/players/PlayerHandler.py
248 249 250 251 | |
check_orphan_binary_names(node_conf)
Warn about configured player binaries the orphan cleanups cannot see.
Returns the settings keys whose path basename is not a known name. A missing key is skipped: not every node configures every player.
Source code in src/cuemsengine/players/PlayerHandler.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
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_name 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.
node_name MUST match the value gradient-motiond filters on (its --node-name CLI flag, defaulting to the OS hostname — see node-identity-contract.md in cuems-common). It is NOT the node's UUID: the daemon's OscServer drops any message whose node_name field doesn't match byte-for-byte, silently (DEBUG-only log), so a UUID never matches and every send is a no-op.
Source code in src/cuemsengine/players/GradientClient.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 | |
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 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 | |
client
property
Get the JACK client, reinitializing if necessary.
__del__()
Cleanup JACK client on deletion.
Source code in src/cuemsengine/players/JackConnectionManager.py
267 268 269 270 271 272 273 274 275 276 | |
__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'
|
Source code in src/cuemsengine/players/JackConnectionManager.py
27 28 29 30 31 32 33 34 35 36 | |
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
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 | |
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
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 | |
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
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 | |
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
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 | |
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
253 254 255 256 257 258 259 260 261 262 263 264 265 | |
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
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |