Real Time Open Sound Control librtosc
Loading...
Searching...
No Matches
Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
rtosc::savefile_dispatcher_t Class Reference

Class to modify and dispatch messages loaded from savefiles. More...

#include <savefile.h>

Protected Types

enum  proceed { abort = -2 , discard = -1 }
 
enum  dependency_t { no_dependencies , has_dependencies , not_specified }
 

Protected Member Functions

bool operator() (const char *msg)
 call this to dispatch a message
 

Static Protected Member Functions

static int default_response (size_t nargs, bool first_round, dependency_t dependency)
 

Protected Attributes

rtosc_version rtosc_filever
 rtosc versinon savefile was written with
 
rtosc_version rtosc_curver
 rtosc version of this library
 
rtosc_version app_filever
 app version savefile was written with
 
rtosc_version app_curver
 current app version
 

Friends

int dispatch_printed_messages (const char *messages, const struct Ports &ports, void *runtime, savefile_dispatcher_t *dispatcher)
 Scan OSC messages from human readable format and dispatch them.
 
int load_from_file (const char *file_content, const struct Ports &ports, void *runtime, const char *appname, rtosc_version appver, savefile_dispatcher_t *dispatcher)
 Read save file and dispatch contained parameters.
 

Detailed Description

Class to modify and dispatch messages loaded from savefiles.

Objects of this class shall be passed to savefile loading routines. You can inherit to change the behaviour, e.g. to modify or discard such messages.

Member Enumeration Documentation

◆ dependency_t

Enumerator
has_dependencies 

default values don't depend on others

not_specified 

default values do depend on others

it's not know which of the other enum values fit

◆ proceed

Enumerator
abort 

the message shall lead to abort the savefile loading

discard 

the message shall not be dispatched

Friends And Related Function Documentation

◆ dispatch_printed_messages

int dispatch_printed_messages ( const char *  messages,
const struct Ports ports,
void *  runtime,
savefile_dispatcher_t dispatcher 
)
friend

Scan OSC messages from human readable format and dispatch them.

Parameters
messagesThe OSC messages, whitespace-separated
portsThe static ports structure
runtimeThe runtime object
dispatcherObject to modify messages prior to dispatching, or NULL. You can overwrite its virtual functions, and you should specify any of the version structs if needed. All other members shall not be initialized.
Returns
The number of messages read, or, if there was a read error, or the dispatcher did refuse to dispatch, the number of bytes read until the read error occured minus one

◆ load_from_file

int load_from_file ( const char *  file_content,
const struct Ports ports,
void *  runtime,
const char *  appname,
rtosc_version  appver,
savefile_dispatcher_t dispatcher 
)
friend

Read save file and dispatch contained parameters.

Parameters
file_contentThe file as a C string
portsThe static ports structure
runtimeThe runtime object
appnameName of the application calling this function; must match the file's application name
appverVersion of the application calling this function
dispatcherModifier for the messages; NULL if no modifiers are needed
Returns
The number of messages read, or, if there was a read error, the negated number of bytes read until the read error occured minus one

The documentation for this class was generated from the following file: