How bitfocus/companion-module-hopla-powerstudio works
This is a Bitfocus Companion control module for Power Studio. Operators use Companion actions or presets to control playout, carts, mix editing, recording, and playlist selection; the module sends REST commands and polls state, then exposes updated variables and feedbacks. The main runtime coordinates these flows, API-version capabilities, polling, and refreshes. The README documents the feature set; some subsystem wiring is therefore shown at the documented level because its implementation was not sampled.
Main entry points: main.ts Lifecycle and polling · client.ts REST client · variables.ts Trigger variables · feedbacks.ts State feedbacks
Components 15
Companion interaction
- Control actions
src/actions.ts - Control presets
src/presets.ts - State feedbacks
src/feedbacks.ts - Trigger variables
src/variables.ts
Module runtime
- Lifecycle and polling
src/main.ts - REST client
src/client.ts - Cart rack helpers
src/cart-rack.ts - Playlist window
src/playlist-window.ts
Power Studio API
- Power Studio REST API
Compatibility and state
- API capabilities
src/capabilities.ts - Version parsing
src/version.ts - State selectors
src/state-selectors.ts - Error mapping
src/errors.ts
Other components
- Operator
- Bitfocus Companion
Connections 23
- Operator → Bitfocus Companion: operates
- Bitfocus Companion → Control actions: invokes actions
- Bitfocus Companion → Control presets: offers presets
- Control actions → Lifecycle and polling: requests commands
- Lifecycle and polling → REST client: polls and dispatches
- REST client → Power Studio REST API: sends REST requests
- Power Studio REST API → REST client: returns status
- REST client → Lifecycle and polling: returns results
- Lifecycle and polling → API capabilities: builds capability map
- API capabilities → Version parsing: parses API version
- Lifecycle and polling → Playlist window: calculates window
- Control presets → Cart rack helpers: builds rack presets
- State feedbacks → Cart rack helpers: reads rack helpers
- Trigger variables → Cart rack helpers: reads rack helpers
- Trigger variables → Playlist window: formats playlist values
- State feedbacks → State selectors: evaluates state
- Trigger variables → State selectors: selects state
- Lifecycle and polling → Trigger variables: publishes values
- Lifecycle and polling → State feedbacks: refreshes feedbacks
- REST client → Error mapping: classifies failures
- Lifecycle and polling → Error mapping: maps request errors
- Bitfocus Companion → State feedbacks: displays feedbacks
- Bitfocus Companion → Trigger variables: exposes variables