fplayer
C99 Falcon Sequence (fseq) file player for Light-O-Rama hardware (like xLights)
Loading...
Searching...
No Matches
putil.h File Reference

Playback utility functions. More...

#include <stdint.h>
Include dependency graph for putil.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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.
 

Detailed Description

Playback utility functions.

Function Documentation

◆ PU_lightsOff()

int PU_lightsOff ( struct serialdev_s * sdev)

Turns off all lights by sending a set off effect to all LOR units.

Parameters
sdevserial device to write the command to
Returns
0 on success, a negative error code on failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
audiofpsuggested audio file path to play, or NULL to lookup from fc
fcfile controller to read a fallback audio file from
seqsequence header for file layout information
Returns
0 on success, a negative error code on failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
framecurrent frame in the sequence
seqsequence header for playback configuration
Returns
seconds remaining in the sequence, or 0 if the sequence is complete
Here is the caller graph for this function:

◆ 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
sdevserial device to write the heartbeat messages to
secondsnumber of seconds to wait
Returns
0 on success, a negative error code on failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PU_writeEffect()

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.

Parameters
sdevserial device to write the effect to
groupchannel group state to encode
accumoptional accumulator to store the number of bytes written
Returns
0 on success, a negative error code on failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PU_writeHeartbeat()

int PU_writeHeartbeat ( struct serialdev_s * sdev)

Encodes and writes a LOR heartbeat message to the serial port.

Parameters
sdevserial device to write the heartbeat message to
Returns
0 on success, a negative error code on failure
Here is the call graph for this function:
Here is the caller graph for this function: