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

FSEQ sequence file loading implementation. More...

#include "seq.h"
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include "tinyfseq.h"
#include "fseq/writer.h"
#include "std2/errcode.h"
#include "std2/fc.h"
#include "comblock.h"
Include dependency graph for seq.c:

Macros

#define VARHEADER_SIZE   4
 Size of a FSEQ file format variable header in bytes.
 

Functions

int Seq_open (struct FC *fc, struct tf_header_t **seq)
 Reads a FSEQ header and initializes the header struct with the sequence's metadata. The caller is responsible for freeing the header.
 
static int Seq_readVar (uint8_t **head, const int remaining, struct fseq_var_s *var)
 Reads a variable from the variable table and populates the provided var struct with the variable id, size, and value. The variable value is allocated and must be freed by the caller.
 
int Seq_getMediaFile (struct FC *fc, const struct tf_header_t *seq, char **value)
 Retrieves the audio file path from the sequence for playback by searching the FSEQ's variable table for the mf (media file) variable.
 

Detailed Description

FSEQ sequence file loading implementation.

Macro Definition Documentation

◆ VARHEADER_SIZE

#define VARHEADER_SIZE   4

Size of a FSEQ file format variable header in bytes.

Function Documentation

◆ Seq_getMediaFile()

int Seq_getMediaFile ( struct FC * fc,
const struct tf_header_t * seq,
char ** value )

Retrieves the audio file path from the sequence for playback by searching the FSEQ's variable table for the mf (media file) variable.

Parameters
fctarget file controller instance
seqsequence header for file layout information
valuethe value of the mf variable if found, otherwise set to NULL
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:

◆ Seq_open()

int Seq_open ( struct FC * fc,
struct tf_header_t ** seq )

Reads a FSEQ header and initializes the header struct with the sequence's metadata. The caller is responsible for freeing the header.

Parameters
fctarget file controller instance
seqthe sequence header to populate with the FSEQ metadata
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:

◆ Seq_readVar()

static int Seq_readVar ( uint8_t ** head,
const int remaining,
struct fseq_var_s * var )
static

Reads a variable from the variable table and populates the provided var struct with the variable id, size, and value. The variable value is allocated and must be freed by the caller.

Parameters
headpointer to the current variable table position, updated to the next variable position on return
remainingthe number of bytes remaining in the variable table
varthe variable struct to populate with the read variable
Returns
0 on success, a negative error code on failure
Here is the caller graph for this function: