fplayer
C99 Falcon Sequence (fseq) file player for Light-O-Rama hardware (like xLights)
|
Playback execution function implementation. More...
#include "player.h"
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "tinyfseq.h"
#include "tinylor.h"
#include "audio.h"
#include "cell.h"
#include "crmap.h"
#include "fseq/seq.h"
#include "pump.h"
#include "putil.h"
#include "queue.h"
#include "serial.h"
#include "sleep.h"
#include "std2/errcode.h"
#include "std2/fc.h"
Data Structures | |
struct | player_rtd_s |
Player runtime data structure. More... | |
Functions | |
static void | Player_free (struct player_rtd_s *rtd) |
Frees dynamic allocated structures referenced by the player runtime data. rtd itself is not freed by this function. | |
static int | Player_init (struct FC *fc, struct cr_s *cmap, struct player_rtd_s *rtd) |
Populates the player runtime data with dynamically allocated structures before initializing each subsystem. | |
static void | Player_log (struct player_rtd_s *rtd) |
Prints a log message summarizing the player's current state. | |
static int | Player_writeFrame (struct player_rtd_s *rtd, struct serialdev_s *sdev) |
Increments the current frame index and writes the minified frame data to the serial output. This function drives the core functionality of the player. | |
static int | Player_loop (struct player_rtd_s *rtd, struct serialdev_s *sdev) |
Main loop of the player that drives the playback of the sequence. This function will block until the sequence is complete, writing frame data to the serial output and logging the player's current state. A heartbeat message is sent every ~500ms to ensure the connection is maintained. | |
int | Player_exec (struct qentry_s *req, struct serialdev_s *sdev) |
Initializes and starts playback of the given playback configuration. Execution will block until the sequence is complete, including audio playback; unless an error occurs. The caller is responsible for freeing the resources provided in the playback request. | |
Playback execution function implementation.
int Player_exec | ( | struct qentry_s * | req, |
struct serialdev_s * | sdev ) |
Initializes and starts playback of the given playback configuration. Execution will block until the sequence is complete, including audio playback; unless an error occurs. The caller is responsible for freeing the resources provided in the playback request.
req | play request to execute |
sdev | serial device to use for playback |
|
static |
Frees dynamic allocated structures referenced by the player runtime data. rtd
itself is not freed by this function.
rtd | player runtime data to free |
|
static |
Populates the player runtime data with dynamically allocated structures before initializing each subsystem.
fc | sequence file controller to read from |
cmap | channel map to use for index lookups |
rtd | player runtime data to populate |
|
static |
Prints a log message summarizing the player's current state.
rtd | player runtime data to log |
|
static |
Main loop of the player that drives the playback of the sequence. This function will block until the sequence is complete, writing frame data to the serial output and logging the player's current state. A heartbeat message is sent every ~500ms to ensure the connection is maintained.
rtd | initialized player runtime data |
sdev | serial device to write frame data to |
|
static |
Increments the current frame index and writes the minified frame data to the serial output. This function drives the core functionality of the player.
rtd | player runtime data to write the next frame from |
sdev | serial device to write the frame data to |