fplayer
C99 Falcon Sequence (fseq) file player for Light-O-Rama hardware (like xLights)
|
Player utility functions implementation. More...
#include "putil.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "tinyfseq.h"
#include "tinylor.h"
#include "audio.h"
#include "cell.h"
#include "fseq/seq.h"
#include "serial.h"
#include "std2/errcode.h"
#include <time.h>
Functions | |
int | PU_wait (struct serialdev_s *sdev, const 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 (const 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. | |
Player utility functions implementation.
int PU_lightsOff | ( | struct serialdev_s * | sdev | ) |
Turns off all lights by sending a set off effect to all LOR units.
sdev | serial device to write the command to |
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.
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 |
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.
frame | current frame in the sequence |
seq | sequence header for playback configuration |
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.
sdev | serial device to write the heartbeat messages to |
seconds | number of seconds to wait |
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.
sdev | serial device to write the effect to |
group | channel group state to encode |
accum | optional accumulator to store the number of bytes written |
int PU_writeHeartbeat | ( | struct serialdev_s * | sdev | ) |
Encodes and writes a LOR heartbeat message to the serial port.
sdev | serial device to write the heartbeat message to |