Playback utility functions.
More...
#include <stdint.h>
Go to the source code of this file.
|
int | PU_wait (struct serialdev_s *sdev, unsigned int seconds) |
| Waits for the given number of seconds by blocking the current thread. LOR heartbeat messages will intentionally be sent during this time. This function is used to ensure the LOR hardware is connected to the player before sending playback commands.
|
|
int | PU_lightsOff (struct serialdev_s *sdev) |
| Turns off all lights by sending a set off effect to all LOR units.
|
|
long | PU_secondsRemaining (uint32_t frame, const struct tf_header_t *seq) |
| Returns the seconds remaining in the sequence based on the current frame and sequence configuration provided by the caller.
|
|
int | PU_writeHeartbeat (struct serialdev_s *sdev) |
| Encodes and writes a LOR heartbeat message to the serial port.
|
|
int | PU_writeEffect (struct serialdev_s *sdev, const struct ctgroup_s *group, uint32_t *accum) |
| Encodes the given channel group state update to the provided message buffer as a LOR effect. The number of bytes written to the message buffer will be added to the optional accumulator parameter.
|
|
int | PU_playFirstAudio (const char *audiofp, struct FC *fc, const struct tf_header_t *seq) |
| If audiofp is not NULL, this function will attempt to play the audio file at the given path. If audiofp is NULL, this function will attempt to lookup the mf (media file) variable within the file controller and play the audio file at the path stored in the variable.
|
|
Playback utility functions.
◆ PU_lightsOff()
Turns off all lights by sending a set off effect to all LOR units.
- Parameters
-
sdev | serial device to write the command to |
- Returns
- 0 on success, a negative error code on failure
◆ PU_playFirstAudio()
int PU_playFirstAudio |
( |
const char * | audiofp, |
|
|
struct FC * | fc, |
|
|
const struct tf_header_t * | seq ) |
If audiofp is not NULL, this function will attempt to play the audio file at the given path. If audiofp is NULL, this function will attempt to lookup the mf
(media file) variable within the file controller and play the audio file at the path stored in the variable.
- Parameters
-
audiofp | suggested audio file path to play, or NULL to lookup from fc |
fc | file controller to read a fallback audio file from |
seq | sequence header for file layout information |
- Returns
- 0 on success, a negative error code on failure
◆ PU_secondsRemaining()
long PU_secondsRemaining |
( |
uint32_t | frame, |
|
|
const struct tf_header_t * | seq ) |
Returns the seconds remaining in the sequence based on the current frame and sequence configuration provided by the caller.
- Parameters
-
frame | current frame in the sequence |
seq | sequence header for playback configuration |
- Returns
- seconds remaining in the sequence, or 0 if the sequence is complete
◆ PU_wait()
int PU_wait |
( |
struct serialdev_s * | sdev, |
|
|
unsigned int | seconds ) |
Waits for the given number of seconds by blocking the current thread. LOR heartbeat messages will intentionally be sent during this time. This function is used to ensure the LOR hardware is connected to the player before sending playback commands.
- Parameters
-
sdev | serial device to write the heartbeat messages to |
seconds | number of seconds to wait |
- Returns
- 0 on success, a negative error code on failure
◆ PU_writeEffect()
Encodes the given channel group state update to the provided message buffer as a LOR effect. The number of bytes written to the message buffer will be added to the optional accumulator parameter.
- Parameters
-
sdev | serial device to write the effect to |
group | channel group state to encode |
accum | optional accumulator to store the number of bytes written |
- Returns
- 0 on success, a negative error code on failure
◆ PU_writeHeartbeat()
Encodes and writes a LOR heartbeat message to the serial port.
- Parameters
-
sdev | serial device to write the heartbeat message to |
- Returns
- 0 on success, a negative error code on failure