webatem 2.6.0__tar.gz → 2.6.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. {webatem-2.6.0 → webatem-2.6.2}/PKG-INFO +6 -1
  2. {webatem-2.6.0 → webatem-2.6.2}/README.md +5 -0
  3. {webatem-2.6.0 → webatem-2.6.2}/atem_control/control/consumer.py +18 -3
  4. {webatem-2.6.0 → webatem-2.6.2}/atem_control/hooks.py +3 -2
  5. {webatem-2.6.0 → webatem-2.6.2}/atem_control/profile/dialog.py +2 -2
  6. {webatem-2.6.0 → webatem-2.6.2}/atem_control/profile/views.py +7 -2
  7. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/js/atem_control.js +28 -1
  8. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/js/atem_profile.js +1 -1
  9. {webatem-2.6.0 → webatem-2.6.2}/atem_control/tally.py +1 -1
  10. {webatem-2.6.0 → webatem-2.6.2}/atem_control/uploader.py +40 -22
  11. {webatem-2.6.0 → webatem-2.6.2}/pyproject.toml +1 -1
  12. {webatem-2.6.0 → webatem-2.6.2}/webatem.egg-info/PKG-INFO +6 -1
  13. {webatem-2.6.0 → webatem-2.6.2}/LICENSE +0 -0
  14. {webatem-2.6.0 → webatem-2.6.2}/atem_control/__init__.py +0 -0
  15. {webatem-2.6.0 → webatem-2.6.2}/atem_control/activity.py +0 -0
  16. {webatem-2.6.0 → webatem-2.6.2}/atem_control/apps.py +0 -0
  17. {webatem-2.6.0 → webatem-2.6.2}/atem_control/control/__init__.py +0 -0
  18. {webatem-2.6.0 → webatem-2.6.2}/atem_control/control/activity.py +0 -0
  19. {webatem-2.6.0 → webatem-2.6.2}/atem_control/control/commands.py +0 -0
  20. {webatem-2.6.0 → webatem-2.6.2}/atem_control/control/device_api.py +0 -0
  21. {webatem-2.6.0 → webatem-2.6.2}/atem_control/control/logging.py +0 -0
  22. {webatem-2.6.0 → webatem-2.6.2}/atem_control/control/views.py +0 -0
  23. {webatem-2.6.0 → webatem-2.6.2}/atem_control/discovery.py +0 -0
  24. {webatem-2.6.0 → webatem-2.6.2}/atem_control/hyperdeck/__init__.py +0 -0
  25. {webatem-2.6.0 → webatem-2.6.2}/atem_control/hyperdeck/connection.py +0 -0
  26. {webatem-2.6.0 → webatem-2.6.2}/atem_control/hyperdeck/views.py +0 -0
  27. {webatem-2.6.0 → webatem-2.6.2}/atem_control/ip_upload_lock.py +0 -0
  28. {webatem-2.6.0 → webatem-2.6.2}/atem_control/media_pool/__init__.py +0 -0
  29. {webatem-2.6.0 → webatem-2.6.2}/atem_control/media_pool/broadcast.py +0 -0
  30. {webatem-2.6.0 → webatem-2.6.2}/atem_control/media_pool/still_cache.py +0 -0
  31. {webatem-2.6.0 → webatem-2.6.2}/atem_control/media_pool/views.py +0 -0
  32. {webatem-2.6.0 → webatem-2.6.2}/atem_control/media_pool/watcher.py +0 -0
  33. {webatem-2.6.0 → webatem-2.6.2}/atem_control/migrations/0001_initial.py +0 -0
  34. {webatem-2.6.0 → webatem-2.6.2}/atem_control/migrations/0002_legacy_log.py +0 -0
  35. {webatem-2.6.0 → webatem-2.6.2}/atem_control/migrations/__init__.py +0 -0
  36. {webatem-2.6.0 → webatem-2.6.2}/atem_control/models.py +0 -0
  37. {webatem-2.6.0 → webatem-2.6.2}/atem_control/netutil.py +0 -0
  38. {webatem-2.6.0 → webatem-2.6.2}/atem_control/profile/__init__.py +0 -0
  39. {webatem-2.6.0 → webatem-2.6.2}/atem_control/profile/export.py +0 -0
  40. {webatem-2.6.0 → webatem-2.6.2}/atem_control/routing.py +0 -0
  41. {webatem-2.6.0 → webatem-2.6.2}/atem_control/sightings.py +0 -0
  42. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/apple-touch-icon.png +0 -0
  43. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/brand.css +0 -0
  44. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/favicon-32.png +0 -0
  45. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/favicon.ico +0 -0
  46. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/Archivo-400-latin-ext.woff2 +0 -0
  47. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/Archivo-400-latin.woff2 +0 -0
  48. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/Archivo-500-latin-ext.woff2 +0 -0
  49. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/Archivo-500-latin.woff2 +0 -0
  50. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/Archivo-600-latin-ext.woff2 +0 -0
  51. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/Archivo-600-latin.woff2 +0 -0
  52. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/Archivo-800-latin-ext.woff2 +0 -0
  53. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/Archivo-800-latin.woff2 +0 -0
  54. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  55. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  56. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  57. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  58. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/IBMPlexMono-600-latin-ext.woff2 +0 -0
  59. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/IBMPlexMono-600-latin.woff2 +0 -0
  60. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/OFL-Archivo.txt +0 -0
  61. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/fonts/OFL-IBMPlexMono.txt +0 -0
  62. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/icon-192.png +0 -0
  63. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/icon-512.png +0 -0
  64. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/icon-maskable-512.png +0 -0
  65. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/manifest.webmanifest +0 -0
  66. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/mark.svg +0 -0
  67. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/tray/linux-24.png +0 -0
  68. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/tray/mac-22.png +0 -0
  69. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/tray/mac-44.png +0 -0
  70. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/tray/win-16.png +0 -0
  71. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/brand/tray/win-32.png +0 -0
  72. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/css/atem_connect.css +0 -0
  73. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/css/atem_control.css +0 -0
  74. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/icon.png +0 -0
  75. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/js/atem_connect.js +0 -0
  76. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/js/atem_control_page.js +0 -0
  77. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/js/atem_discovery.js +0 -0
  78. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/js/atem_hyperdeck.js +0 -0
  79. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/js/atem_realtime_slider.js +0 -0
  80. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/js/custom-scrollbar.js +0 -0
  81. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/js/recent_label.js +0 -0
  82. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/js/wa-select.js +0 -0
  83. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/vendor/README.md +0 -0
  84. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/vendor/alpine.min.js +0 -0
  85. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/vendor/alpinejs-collapse-3.14.3.min.js +0 -0
  86. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/vendor/bootstrap-icons/bootstrap-icons.min.css +0 -0
  87. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/vendor/bootstrap-icons/fonts/bootstrap-icons.woff +0 -0
  88. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/vendor/bootstrap-icons/fonts/bootstrap-icons.woff2 +0 -0
  89. {webatem-2.6.0 → webatem-2.6.2}/atem_control/static/vendor/webatem.css +0 -0
  90. {webatem-2.6.0 → webatem-2.6.2}/atem_control/storage.py +0 -0
  91. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/connect.html +0 -0
  92. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_atem_info.html +0 -0
  93. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_fade_to_black.html +0 -0
  94. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_fairlight.html +0 -0
  95. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_header.html +0 -0
  96. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_hyperdeck_panel.html +0 -0
  97. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_macros.html +0 -0
  98. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_media_pool.html +0 -0
  99. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_profile_modal.html +0 -0
  100. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_settings_dsk.html +0 -0
  101. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_settings_transition.html +0 -0
  102. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_settings_usk.html +0 -0
  103. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_slider.html +0 -0
  104. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_transition_controls.html +0 -0
  105. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_transition_style.html +0 -0
  106. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_usk_fly.html +0 -0
  107. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_usk_keyframe.html +0 -0
  108. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_usk_mask.html +0 -0
  109. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control/_usk_slider.html +0 -0
  110. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templates/control.html +0 -0
  111. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templatetags/__init__.py +0 -0
  112. {webatem-2.6.0 → webatem-2.6.2}/atem_control/templatetags/static_v.py +0 -0
  113. {webatem-2.6.0 → webatem-2.6.2}/atem_control/urls.py +0 -0
  114. {webatem-2.6.0 → webatem-2.6.2}/setup.cfg +0 -0
  115. {webatem-2.6.0 → webatem-2.6.2}/webatem/__init__.py +0 -0
  116. {webatem-2.6.0 → webatem-2.6.2}/webatem/__main__.py +0 -0
  117. {webatem-2.6.0 → webatem-2.6.2}/webatem/applog.py +0 -0
  118. {webatem-2.6.0 → webatem-2.6.2}/webatem/asgi.py +0 -0
  119. {webatem-2.6.0 → webatem-2.6.2}/webatem/context.py +0 -0
  120. {webatem-2.6.0 → webatem-2.6.2}/webatem/launcher.py +0 -0
  121. {webatem-2.6.0 → webatem-2.6.2}/webatem/server.py +0 -0
  122. {webatem-2.6.0 → webatem-2.6.2}/webatem/settings.py +0 -0
  123. {webatem-2.6.0 → webatem-2.6.2}/webatem/templates/base.html +0 -0
  124. {webatem-2.6.0 → webatem-2.6.2}/webatem/templates/brand/_mark.svg +0 -0
  125. {webatem-2.6.0 → webatem-2.6.2}/webatem/templates/launcher.html +0 -0
  126. {webatem-2.6.0 → webatem-2.6.2}/webatem/uninstall.py +0 -0
  127. {webatem-2.6.0 → webatem-2.6.2}/webatem/updates.py +0 -0
  128. {webatem-2.6.0 → webatem-2.6.2}/webatem/urls.py +0 -0
  129. {webatem-2.6.0 → webatem-2.6.2}/webatem/views.py +0 -0
  130. {webatem-2.6.0 → webatem-2.6.2}/webatem/websocket.py +0 -0
  131. {webatem-2.6.0 → webatem-2.6.2}/webatem.egg-info/SOURCES.txt +0 -0
  132. {webatem-2.6.0 → webatem-2.6.2}/webatem.egg-info/dependency_links.txt +0 -0
  133. {webatem-2.6.0 → webatem-2.6.2}/webatem.egg-info/entry_points.txt +0 -0
  134. {webatem-2.6.0 → webatem-2.6.2}/webatem.egg-info/requires.txt +0 -0
  135. {webatem-2.6.0 → webatem-2.6.2}/webatem.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webatem
3
- Version: 2.6.0
3
+ Version: 2.6.2
4
4
  Summary: Browser-based control for Blackmagic ATEM switchers: run it, open the browser, your switchers are there
5
5
  Author: Lucas Romanenko
6
6
  License: MIT
@@ -389,6 +389,11 @@ media-pool thumbnail cache, LAN discovery identity, WebSocket origin checks)
389
389
  runs against fake protocol layers. CI runs it on every push. The protocol
390
390
  libraries carry their own suites in [bmdwire](https://github.com/lucas-romanenko/bmdwire).
391
391
 
392
+ Two bench scripts in `tools/` run the real thing against a live switcher:
393
+ `python tools/mediapool_smoke.py <ip>` (media-pool watcher and thumbnails,
394
+ read-only) and `python tools/upload_service_smoke.py <ip> <image> [slot]`
395
+ (one still upload, so a test switcher only).
396
+
392
397
  `python manage.py runserver` works too for plain Django development. The
393
398
  per-OS downloads are built by the **Desktop builds** workflow
394
399
  (`pyinstaller build/desktop/webatem.spec`).
@@ -359,6 +359,11 @@ media-pool thumbnail cache, LAN discovery identity, WebSocket origin checks)
359
359
  runs against fake protocol layers. CI runs it on every push. The protocol
360
360
  libraries carry their own suites in [bmdwire](https://github.com/lucas-romanenko/bmdwire).
361
361
 
362
+ Two bench scripts in `tools/` run the real thing against a live switcher:
363
+ `python tools/mediapool_smoke.py <ip>` (media-pool watcher and thumbnails,
364
+ read-only) and `python tools/upload_service_smoke.py <ip> <image> [slot]`
365
+ (one still upload, so a test switcher only).
366
+
362
367
  `python manage.py runserver` works too for plain Django development. The
363
368
  per-OS downloads are built by the **Desktop builds** workflow
364
369
  (`pyinstaller build/desktop/webatem.spec`).
@@ -64,6 +64,19 @@ CONNECT_PROGRESS_EVERY = 0.5 # s between "Connecting…" updates to the page
64
64
  NO_FREE_CONNECTION_MESSAGE = ('No free connection on this switcher (ATEM Software Control, '
65
65
  'panels or other clients are using all its slots)')
66
66
 
67
+ # What the page sends on its own: the session's verbs and panel/tab
68
+ # housekeeping (the audio-meter subscribe follows tab visibility, the media
69
+ # pool refreshes when it opens). None of it says the operator is there, so
70
+ # none of it holds the idle disconnect off. Every control command does, and
71
+ # so does the page's ``activity`` ping, sent on real input (pointer, touch,
72
+ # keys) — which also covers what goes over HTTP or stays in the browser.
73
+ # State coming back from the switcher never counts: another controller may
74
+ # be driving it around the clock.
75
+ PASSIVE_VERBS = frozenset({
76
+ 'connect', 'disconnect', 'refresh',
77
+ 'subscribe_audio_meters', 'unsubscribe_audio_meters', 'media_pool_refresh',
78
+ })
79
+
67
80
 
68
81
  class ATEMConsumer(ATEMConnectionLoggingMixin, ATEMStateMixin, AsyncWebsocketConsumer):
69
82
  """
@@ -314,11 +327,13 @@ class ATEMConsumer(ATEMConnectionLoggingMixin, ATEMStateMixin, AsyncWebsocketCon
314
327
  data = json.loads(text_data)
315
328
  command = data.get('command')
316
329
 
317
- # Reset inactivity timer for control commands
318
- if command and command not in ['connect', 'disconnect', 'refresh']:
330
+ # The operator is using the page (see PASSIVE_VERBS).
331
+ if command and command not in PASSIVE_VERBS:
319
332
  self.last_command_time = asyncio.get_event_loop().time()
320
333
 
321
- if command == 'connect':
334
+ if command == 'activity':
335
+ pass # the stamp above is the whole point
336
+ elif command == 'connect':
322
337
  await self.handle_connect(data, is_test_connection=data.get('test_connection', False))
323
338
  elif command == 'disconnect':
324
339
  await self.handle_disconnect()
@@ -113,8 +113,9 @@ class Hooks:
113
113
  return {}
114
114
 
115
115
  def idle_disconnect_seconds(self):
116
- """Drop a control session after this many seconds with no command
117
- from the operator, or None for never. Default: NEVER — WebATEM is
116
+ """Drop a control session after this many seconds in which nobody
117
+ used the page (a control command, or any click, touch or key on it;
118
+ never state from the switcher), or None for never. Default: NEVER — WebATEM is
118
119
  somebody's switcher panel and a panel does not log itself out
119
120
  (Lucas, 2026-09-14). A platform whose operators share switchers can
120
121
  return a number and get the old five-minute behaviour."""
@@ -20,7 +20,7 @@ ids (``me<N>_program`` … ``me<N>_usk_<k>``, ``me_tab: N`` 0-based);
20
20
  ``me_options_from_sections`` below is the single place that parses the
21
21
  namespacing back into ``mes[N]`` ``MixEffectOptions`` for the two
22
22
  submission-mapping functions (``export.build_save_options`` /
23
- ``views._build_apply_options``) — the ids never travel past them.
23
+ ``views.build_apply_options``) — the ids never travel past them.
24
24
  Global section ids stay flat and match the ``SaveOptions`` /
25
25
  ``ApplyOptions`` field names so the mapping needs no translation table.
26
26
  """
@@ -99,7 +99,7 @@ def me_options_from_sections(sections: dict, *, program_default: bool,
99
99
 
100
100
  This is the single place the ``me<N>_`` transport namespacing is
101
101
  parsed; the two submission-mapping functions
102
- (``export.build_save_options`` / ``views._build_apply_options``)
102
+ (``export.build_save_options`` / ``views.build_apply_options``)
103
103
  call it and nothing else sees the namespaced ids.
104
104
 
105
105
  The list is sized to the highest submitted M/E index + 1. The
@@ -82,7 +82,7 @@ def _read_profile_upload(upload):
82
82
  {'error': 'profile must be UTF-8 XML'}, status=400)
83
83
 
84
84
 
85
- def _build_apply_options(sections: dict) -> ApplyOptions:
85
+ def build_apply_options(sections: dict) -> ApplyOptions:
86
86
  """Translate load-side section-selection JSON → ApplyOptions.
87
87
 
88
88
  Per-M/E cells arrive me-namespaced (``me<N>_program`` …
@@ -361,7 +361,7 @@ def profile_load(request):
361
361
  except Exception:
362
362
  return JsonResponse({'error': 'malformed sections JSON'}, status=400)
363
363
 
364
- options = _build_apply_options(sections)
364
+ options = build_apply_options(sections)
365
365
 
366
366
  # Apply XML config first.
367
367
  try:
@@ -474,3 +474,8 @@ def profile_load(request):
474
474
  'video_mode': profile.video_mode,
475
475
  'images': image_report,
476
476
  })
477
+
478
+
479
+ # Public since 2.6.2 (a host copying a profile onto a switcher builds its
480
+ # options the same way); the old name stays for hosts built against 2.6.1.
481
+ _build_apply_options = build_apply_options
@@ -891,8 +891,11 @@
891
891
  "refresh",
892
892
  "subscribe_audio_meters",
893
893
  "unsubscribe_audio_meters",
894
- "media_pool_refresh"
894
+ "media_pool_refresh",
895
+ "activity"
895
896
  ]);
897
+ var ACTIVITY_EVENTS = ["pointerdown", "keydown", "touchstart"];
898
+ var ACTIVITY_PING_MS = 3e4;
896
899
  window.ATEMControl = {
897
900
  ws: null,
898
901
  // ---- Declared-state-keys guard ------------------------------------
@@ -1233,10 +1236,34 @@
1233
1236
  }
1234
1237
  },
1235
1238
  // Initialize system
1239
+ // ---- Operator activity (see ACTIVITY_EVENTS) ------------------------
1240
+ _lastActivityPing: 0,
1241
+ _activityTimer: null,
1242
+ trackActivity() {
1243
+ const note = (e) => {
1244
+ if (!e.isTrusted) return;
1245
+ const wait = this._lastActivityPing + ACTIVITY_PING_MS - Date.now();
1246
+ if (wait <= 0) {
1247
+ this.pingActivity();
1248
+ } else if (!this._activityTimer) {
1249
+ this._activityTimer = setTimeout(() => this.pingActivity(), wait);
1250
+ }
1251
+ };
1252
+ ACTIVITY_EVENTS.forEach((ev) => window.addEventListener(ev, note, { capture: true, passive: true }));
1253
+ },
1254
+ pingActivity() {
1255
+ clearTimeout(this._activityTimer);
1256
+ this._activityTimer = null;
1257
+ if (!this.ws || this.ws.readyState !== WebSocket.OPEN) return;
1258
+ if (!Alpine.store("atem")?.connected) return;
1259
+ this._lastActivityPing = Date.now();
1260
+ this.cmd("activity");
1261
+ },
1236
1262
  init() {
1237
1263
  console.log("🎛️ ATEM Control System Initializing");
1238
1264
  setTimeout(() => this.initializeTBar(), 100);
1239
1265
  this.addButtonFeedback();
1266
+ this.trackActivity();
1240
1267
  document.addEventListener("keydown", (e) => {
1241
1268
  if (e.key !== "Shift" || e.repeat) return;
1242
1269
  if (e.target?.matches?.("input, textarea, select")) return;
@@ -126,7 +126,7 @@
126
126
 
127
127
  function selectionsForBackend(descriptor, sel) {
128
128
  // Translate the dialog's selection map (per-section ids) into the
129
- // shape the backend's _build_save_options / _build_apply_options
129
+ // shape the backend's _build_save_options / build_apply_options
130
130
  // expect. 1:1 passthrough — the descriptor is flat.
131
131
  const out = {};
132
132
  for (const s of flatSections(descriptor)) {
@@ -65,7 +65,7 @@ def ticked_pump(protocol, idle_sleep: float = 0.0) -> None:
65
65
 
66
66
 
67
67
  def _pooled(conn) -> bool:
68
- """A pooled ``ATEMConnection`` (how a host calls ``_is_slot_safe``), not
68
+ """A pooled ``ATEMConnection`` (how a host calls ``is_slot_safe``), not
69
69
  a bare ``AtemProtocol``: its worker thread pumps the loop and tracks the
70
70
  session, so it is asked rather than pumped."""
71
71
  return hasattr(conn, 'is_connected')
@@ -35,6 +35,14 @@ Public API:
35
35
  check_cancelled: Callable[[], bool] | None = None,
36
36
  log_append: Callable[[str], None] | None = None,
37
37
  ) -> list[ItemResult]
38
+
39
+ Also public, for a host that runs its own upload or capture worker around
40
+ this module (AV Server does): ``is_slot_safe`` and ``StateNotReady`` (is a
41
+ media-pool slot off air), ``media_player_source_ids``, ``apply_macro_xml``
42
+ (the macro pool of a profile over an open session), ``close_protocol``
43
+ (lock release, goodbye and socket close in that order) and
44
+ ``OwnershipLost``. They had a leading underscore until 2.6.1; the old
45
+ names stay as aliases at the bottom of this module.
38
46
  """
39
47
 
40
48
  import hashlib
@@ -119,7 +127,7 @@ class ItemResult:
119
127
  # Cancellation helper
120
128
  # ---------------------------------------------------------------------------
121
129
 
122
- class _OwnershipLost(BaseException):
130
+ class OwnershipLost(BaseException):
123
131
  """Raised by the cancel/ownership check when it can no longer confirm this
124
132
  replica still owns the row it is uploading (e.g. its DB session — and with
125
133
  it the session-level advisory lane lock — died mid-upload). It is a
@@ -143,7 +151,7 @@ class _Canceller:
143
151
  try:
144
152
  if self._check():
145
153
  return True
146
- # _OwnershipLost is a BaseException, so it is NOT caught here — it
154
+ # OwnershipLost is a BaseException, so it is NOT caught here — it
147
155
  # propagates to abort the upload (see the class docstring). Only a
148
156
  # genuine bug in the check is swallowed as "not cancelled".
149
157
  except Exception:
@@ -155,7 +163,7 @@ class _Canceller:
155
163
  # Tally safety (cycle-wait — ports Mediaupload.exe's WaitForSafeUploadWindow)
156
164
  # ---------------------------------------------------------------------------
157
165
 
158
- def _media_player_source_ids(mp_idx) -> set:
166
+ def media_player_source_ids(mp_idx) -> set:
159
167
  """The program-bus source IDs a media player presents, BMD convention:
160
168
  MP1 fill=3010 / key=3011, MP2=3020/3021, MP3=3030/3031, … (0-indexed)."""
161
169
  fill = 3010 + int(mp_idx) * 10
@@ -220,7 +228,7 @@ def _source_on_air(mixerstate, ids: set) -> bool:
220
228
  return False
221
229
 
222
230
 
223
- class _StateNotReady(Exception):
231
+ class StateNotReady(Exception):
224
232
  """The switcher's state did not come back within STATE_READY_TIMEOUT, so
225
233
  nothing can say the slot is off air. ``_upload_one`` refuses the item."""
226
234
 
@@ -244,8 +252,8 @@ def _await_state(conn, timeout: float,
244
252
  return True
245
253
 
246
254
 
247
- def _is_slot_safe(protocol, slot_0_indexed: int,
248
- is_cancelled: Optional[Callable[[], bool]] = None) -> bool:
255
+ def is_slot_safe(protocol, slot_0_indexed: int,
256
+ is_cancelled: Optional[Callable[[], bool]] = None) -> bool:
249
257
  """Safe to overwrite a media-pool slot when no media player currently
250
258
  showing that slot (as a still) is live on PROGRAM output.
251
259
 
@@ -264,14 +272,14 @@ def _is_slot_safe(protocol, slot_0_indexed: int,
264
272
  session reconnecting) or a dump still arriving has no media players and no
265
273
  tally in it, which reads as "nothing on air"; until 2.0.4 that let an
266
274
  upload through into a live slot. So the check first waits up to
267
- STATE_READY_TIMEOUT for the state and raises ``_StateNotReady`` if it does
275
+ STATE_READY_TIMEOUT for the state and raises ``StateNotReady`` if it does
268
276
  not come back. A cancel ends that wait the same way; the caller checks for
269
277
  the cancel first. It raises rather than answering False because "cannot
270
278
  tell" means different things to different callers: to an upload it is a
271
279
  refusal, to a host watching for a slot to go on air it is "not live".
272
280
  """
273
281
  if not _await_state(protocol, STATE_READY_TIMEOUT, is_cancelled):
274
- raise _StateNotReady(
282
+ raise StateNotReady(
275
283
  f"switcher state not ready after {STATE_READY_TIMEOUT:.0f}s "
276
284
  f"(session reconnecting); cannot confirm slot {slot_0_indexed + 1} "
277
285
  f"is off air")
@@ -287,7 +295,7 @@ def _is_slot_safe(protocol, slot_0_indexed: int,
287
295
  for mp_idx, mp in mps.items():
288
296
  if getattr(mp, 'source_type', 0) == 1 \
289
297
  and getattr(mp, 'slot', -1) == slot_0_indexed:
290
- candidates |= _media_player_source_ids(mp_idx)
298
+ candidates |= media_player_source_ids(mp_idx)
291
299
  if not candidates:
292
300
  return True
293
301
 
@@ -312,7 +320,7 @@ def _wait_for_safe_upload_window(protocol, slot_0_indexed: int,
312
320
  """Cycle-wait for tally safety before overwriting a media-pool slot. Thin
313
321
  wrapper over the shared ``wait_for_safe_cycle`` (atem_control.tally) with
314
322
  the media-pool slot liveness predicate, so the cold->hot->cold loop is
315
- identical to the HyperDeck path. ``_StateNotReady`` from the predicate is
323
+ identical to the HyperDeck path. ``StateNotReady`` from the predicate is
316
324
  not caught here: it ends the cycle at once, a refusal rather than a wait
317
325
  that runs out the tally timeout as if the slot had stayed live. A state
318
326
  that does come back in time costs the cycle a fresh start, not the
@@ -329,8 +337,8 @@ def _wait_for_safe_upload_window(protocol, slot_0_indexed: int,
329
337
  log_append(f"slot {slot_user}: tally source {source}")
330
338
  return wait_for_safe_cycle(
331
339
  protocol,
332
- is_live=lambda: not _is_slot_safe(protocol, slot_0_indexed,
333
- is_cancelled=canceller.is_set),
340
+ is_live=lambda: not is_slot_safe(protocol, slot_0_indexed,
341
+ is_cancelled=canceller.is_set),
334
342
  is_cancelled=canceller.is_set,
335
343
  log=log_append,
336
344
  label=f'slot {slot_user}',
@@ -430,7 +438,7 @@ def _upload_one(protocol, slot: int, image_path: str, width: int, height: int,
430
438
  not_ready = None
431
439
  try:
432
440
  safe = _wait_for_safe_upload_window(protocol, slot, canceller, log_append)
433
- except _StateNotReady as e:
441
+ except StateNotReady as e:
434
442
  safe, not_ready = False, str(e)
435
443
  if not safe:
436
444
  if canceller.is_set():
@@ -603,8 +611,8 @@ def _upload_one(protocol, slot: int, image_path: str, width: int, height: int,
603
611
  # Public entry point
604
612
  # ---------------------------------------------------------------------------
605
613
 
606
- def _apply_macro_xml(protocol, macro_xml_path: str,
607
- log_append: Callable[[str], None]) -> Optional[ItemResult]:
614
+ def apply_macro_xml(protocol, macro_xml_path: str,
615
+ log_append: Callable[[str], None]) -> Optional[ItemResult]:
608
616
  """Apply only the <MacroPool> section of ``macro_xml_path`` over an
609
617
  already-connected ``AtemProtocol``.
610
618
 
@@ -743,12 +751,12 @@ def _run_for_single_ip(ip_address: str,
743
751
  protocol = candidate
744
752
  break
745
753
  except NoFreeConnection:
746
- _close_protocol(candidate)
754
+ close_protocol(candidate)
747
755
  log_append(f"{ip_address}: {NO_FREE_CONNECTION_ERROR}")
748
756
  refused = True
749
757
  break
750
758
  except TimeoutError:
751
- _close_protocol(candidate)
759
+ close_protocol(candidate)
752
760
  if attempt < CONNECT_ATTEMPTS:
753
761
  log_append(f"attempt {attempt} timed out — retrying in "
754
762
  f"{CONNECT_RETRY_DELAY:.0f}s")
@@ -758,7 +766,7 @@ def _run_for_single_ip(ip_address: str,
758
766
  # socket error, a bug) still closes the candidate: a session
759
767
  # that got as far as the handshake is on the switcher, and
760
768
  # without the goodbye it is abandoned there.
761
- _close_protocol(candidate)
769
+ close_protocol(candidate)
762
770
  raise
763
771
  if protocol is None:
764
772
  for slot, image_path in slot_paths:
@@ -810,13 +818,13 @@ def _run_for_single_ip(ip_address: str,
810
818
  out.append(item_result)
811
819
 
812
820
  # Macro apply runs on the same socket after the last image. Skipped on
813
- # cancel or partial-failure — see _apply_macro_xml docstring. The
821
+ # cancel or partial-failure — see apply_macro_xml docstring. The
814
822
  # ``all(...)`` check is vacuously True for an empty ``out`` (no images
815
823
  # attempted = macros-only Media Pool -> Hyperdeck submission), which
816
824
  # is exactly what we want — proceed to the macro apply.
817
825
  if macro_xml_path and not canceller.is_set():
818
826
  if all(r.success for r in out):
819
- macro_result = _apply_macro_xml(protocol, macro_xml_path, log_append)
827
+ macro_result = apply_macro_xml(protocol, macro_xml_path, log_append)
820
828
  if macro_result is not None:
821
829
  out.append(macro_result)
822
830
  else:
@@ -839,7 +847,7 @@ def _run_for_single_ip(ip_address: str,
839
847
  break
840
848
  finally:
841
849
  t_close = time.time()
842
- _close_protocol(protocol)
850
+ close_protocol(protocol)
843
851
  log_append(f"close took {time.time() - t_close:.2f}s")
844
852
 
845
853
  return out
@@ -945,7 +953,7 @@ def execute_upload(items: List[tuple],
945
953
  return ordered + extra_results
946
954
 
947
955
 
948
- def _close_protocol(protocol: AtemProtocol) -> None:
956
+ def close_protocol(protocol: AtemProtocol) -> None:
949
957
  # Give the media lock back BEFORE the goodbye. An upload holds the store
950
958
  # lock per frame and a failed or abandoned one can leave it held; a lock
951
959
  # still ours at teardown is kept by the switcher for the rest of the
@@ -973,3 +981,13 @@ def _close_protocol(protocol: AtemProtocol) -> None:
973
981
  protocol.transport.thread_queue.close()
974
982
  except Exception:
975
983
  pass
984
+
985
+
986
+ # The names above had a leading underscore until 2.6.1, and hosts imported
987
+ # them that way. Kept so a host built against 2.6.1 or earlier still imports.
988
+ _OwnershipLost = OwnershipLost
989
+ _StateNotReady = StateNotReady
990
+ _media_player_source_ids = media_player_source_ids
991
+ _is_slot_safe = is_slot_safe
992
+ _apply_macro_xml = apply_macro_xml
993
+ _close_protocol = close_protocol
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "webatem"
7
- version = "2.6.0"
7
+ version = "2.6.2"
8
8
  description = "Browser-based control for Blackmagic ATEM switchers: run it, open the browser, your switchers are there"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webatem
3
- Version: 2.6.0
3
+ Version: 2.6.2
4
4
  Summary: Browser-based control for Blackmagic ATEM switchers: run it, open the browser, your switchers are there
5
5
  Author: Lucas Romanenko
6
6
  License: MIT
@@ -389,6 +389,11 @@ media-pool thumbnail cache, LAN discovery identity, WebSocket origin checks)
389
389
  runs against fake protocol layers. CI runs it on every push. The protocol
390
390
  libraries carry their own suites in [bmdwire](https://github.com/lucas-romanenko/bmdwire).
391
391
 
392
+ Two bench scripts in `tools/` run the real thing against a live switcher:
393
+ `python tools/mediapool_smoke.py <ip>` (media-pool watcher and thumbnails,
394
+ read-only) and `python tools/upload_service_smoke.py <ip> <image> [slot]`
395
+ (one still upload, so a test switcher only).
396
+
392
397
  `python manage.py runserver` works too for plain Django development. The
393
398
  per-OS downloads are built by the **Desktop builds** workflow
394
399
  (`pyinstaller build/desktop/webatem.spec`).
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes