LMMS
Loading...
Searching...
No Matches
rtosc Namespace Reference

Classes

struct  AutomationMapping
struct  Automation
struct  AutomationSlot
class  AutomationMgr
class  MidiTable_Impl
class  Port_Matcher
struct  internal_ringbuffer_t
class  UndoHistoryImpl
class  MidiMapperStorage
struct  MidiBijection
class  MidiMappernRT
class  MidiMapperRT
struct  MidiAddr
class  MidiTable
struct  RtData
 data object for the dispatch routine More...
struct  Port
struct  Ports
struct  ClonePort
struct  ClonePorts
struct  MergePorts
class  savefile_dispatcher_t
struct  OscDocFormatter
struct  match_exact
struct  match_partial
class  rtMsg
class  rtMsg<>
struct  advance_size
struct  advance_size< irqus::typestring< C... > >
class  rtMsg< This, Rest... >
struct  osc_element
struct  osc_element< 0, rtMsg< This, Rest... > >
struct  osc_element< Index, rtMsg< This, Rest... > >
class  UndoHistory

Typedefs

typedef internal_ringbuffer_t ringbuffer_t
typedef const char * msg_t
typedef void(* port_walker_t) (const Port *, const char *, const char *, const Ports &, void *, void *)

Functions

static size_t ring_read_size (ringbuffer_t *ring)
static size_t ring_write_size (ringbuffer_t *ring)
static void ring_write (ringbuffer_t *ring, const char *data, size_t len)
static void ring_read (ringbuffer_t *ring, char *data, size_t len)
static void ring_read_vector (ringbuffer_t *ring, ring_t *r)
const char * getUndoAddress (const char *msg)
const char * get_default_value (const char *port_name, const Ports &ports, void *runtime, const Port *port_hint=NULL, int32_t idx=-1, int recursive=1)
int get_default_value (const char *port_name, const char *port_args, const Ports &ports, void *runtime, const Port *port_hint, int32_t idx, size_t n, rtosc_arg_val_t *res, char *strbuf, size_t strbufsize)
std::string get_changed_values (const Ports &ports, void *runtime)
int dispatch_printed_messages (const char *messages, const Ports &ports, void *runtime, savefile_dispatcher_t *dispatcher=NULL)
std::string save_to_file (const Ports &ports, void *runtime, const char *appname, rtosc_version appver)
int load_from_file (const char *file_content, const Ports &ports, void *runtime, const char *appname, rtosc_version appver, savefile_dispatcher_t *dispatcher=NULL)
int canonicalize_arg_vals (rtosc_arg_val_t *av, size_t n, const char *port_args, Port::MetaContainer meta)
void map_arg_vals (rtosc_arg_val_t *av, size_t n, Port::MetaContainer meta)
void walk_ports (const Ports *base, char *name_buffer, size_t buffer_size, void *data, port_walker_t walker, void *runtime=NULL)
int enum_key (Port::MetaContainer meta, const char *value)
std::ostream & operator<< (std::ostream &o, OscDocFormatter &formatter)
template<class T>
bool valid_char (char)
template<>
bool valid_char< const char * > (char c)
template<>
bool valid_char< int32_t > (char c)
template<>
bool valid_char< float > (char c)
template<int i>
bool validate (const char *arg)
template<class T>
bool match_path (std::false_type, const char *arg)
template<class T>
bool match_path (std::true_type, const char *)
template<int i, class This, class... Rest>
bool validate (const char *arg)
template<class T>
rt_get_impl (const char *msg, size_t i)
template<>
const char * rt_get_impl (const char *msg, size_t i)
template<>
int32_t rt_get_impl (const char *msg, size_t i)
template<size_t Index, class... Types>
osc_element< Index, rtMsg< Types... > >::type get (rtMsg< Types... > &Tuple)
template<class... Types>
osc_element< 0, rtMsg< Types... > >::type first (rtMsg< Types... > &Tuple)
template<class... Types>
osc_element< 1, rtMsg< Types... > >::type second (rtMsg< Types... > &Tuple)

Variables

static char tmp [256]

Typedef Documentation

◆ msg_t

typedef const char * rtosc::msg_t

◆ port_walker_t

typedef void(* rtosc::port_walker_t) (const Port *, const char *, const char *, const Ports &, void *, void *)

Function pointer type for port walking.

accepts:

  • the currently walked port
  • the port's absolute location
  • the part of the location which makes up the port; this is usually the location's substring after the last slash, but it can also contain multiple slashes
  • the port's base, i.e. it's parent Ports struct
  • the custom data supplied to walk_ports
  • the runtime object (which may be NULL if not known)

◆ ringbuffer_t

Function Documentation

◆ canonicalize_arg_vals()

int rtosc::canonicalize_arg_vals ( rtosc_arg_val_t * av,
size_t n,
const char * port_args,
Port::MetaContainer meta )

Convert given argument values to their canonical representation.

The ports first (or-wise) argument types are defined as canonical. E.g. if passing two 'S' argument values, the port could be portname::ii:cc:SS or portname::ii:t.

Parameters
avThe input and output argument values
nThe size of av
port_argsThe port arguments string, e.g. ::i:c:s. The first non-colon letter sequence marks the canonical types
metaThe port's metadata container
Returns
The number of argument values that should have need conversion, but failed, e.g. because of values missing in rMap.

◆ dispatch_printed_messages()

int rtosc::dispatch_printed_messages ( const char * messages,
const Ports & ports,
void * runtime,
savefile_dispatcher_t * dispatcher = NULL )

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, the number of bytes read until the read error occured minus one

◆ enum_key()

int rtosc::enum_key ( Port::MetaContainer meta,
const char * value )

Return the index with value value from the metadata's enumeration.

Parameters
metaThe metadata
valueThe value to search the key for
Returns
The first key holding value, or std::numeric_limits<int>::min() if none was found

◆ first()

template<class... Types>
osc_element< 0, rtMsg< Types... > >::type rtosc::first ( rtMsg< Types... > & Tuple)
inline

◆ get()

template<size_t Index, class... Types>
osc_element< Index, rtMsg< Types... > >::type rtosc::get ( rtMsg< Types... > & Tuple)
inline

◆ get_changed_values()

std::string rtosc::get_changed_values ( const Ports & ports,
void * runtime )

Return a string list of all changed values

Return a human readable list of the value that changed corresponding to the rDefault macro

Parameters
portsThe static ports structure
runtimeThe runtime object
Returns
The list of ports and their changed values, linewise

◆ get_default_value() [1/2]

int rtosc::get_default_value ( const char * port_name,
const char * port_args,
const Ports & ports,
void * runtime,
const Port * port_hint,
int32_t idx,
size_t n,
rtosc_arg_val_t * res,
char * strbuf,
size_t strbufsize )

Return a port's default value

Returns the default value of a given port, if any exists, as an array of rtosc_arg_vals . The values in the resulting array are being canonicalized, i.e. mapped values are being converted to integers; see canonicalize_arg_vals() .

Parameters
port_namethe port's OSC path.
port_argsthe port's arguments, e.g. '::i:c:S'
portsthe ports where portname is to be searched
runtimeobject holding ports . Optional. Helps finding default values dependent on others, such as presets.
port_hintThe port itself corresponding to portname (including the args). If not specified, will be found using portname .
idxIf the port is an array (using the '#' notation), this specifies the index required for the default value
nSize of the output parameter @res . This size can not be known, so you should provide a large enough array.
resThe output parameter for the argument values.
strbufString buffer for storing pretty printed strings and blobs.
strbufsizeSize of strbuf
Returns
The actual number of aruments written to res (can be smaller than n) or -1 if there is no valid default annotation

◆ get_default_value() [2/2]

const char * rtosc::get_default_value ( const char * port_name,
const Ports & ports,
void * runtime,
const Port * port_hint = NULL,
int32_t idx = -1,
int recursive = 1 )

Return a port's default value

Returns the default value of a given port, if any exists, as a string. For the parameters, see the overloaded function.

Note
The recursive parameter should never be specified.
Returns
The default value(s), pretty-printed, or NULL if there is no valid default annotation

◆ getUndoAddress()

const char * rtosc::getUndoAddress ( const char * msg)

◆ load_from_file()

int rtosc::load_from_file ( const char * file_content,
const Ports & ports,
void * runtime,
const char * appname,
rtosc_version appver,
savefile_dispatcher_t * dispatcher = NULL )

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

◆ map_arg_vals()

void rtosc::map_arg_vals ( rtosc_arg_val_t * av,
size_t n,
Port::MetaContainer meta )

Convert each of the given arguments to their mapped symbol, if possible.

Parameters
avThe input and output argument values
nThe size of av
metaThe port's metadata container

◆ match_path() [1/2]

template<class T>
bool rtosc::match_path ( std::false_type ,
const char * arg )

◆ match_path() [2/2]

template<class T>
bool rtosc::match_path ( std::true_type ,
const char *  )

◆ operator<<()

std::ostream & rtosc::operator<< ( std::ostream & o,
rtosc::OscDocFormatter & formatter )

◆ ring_read()

void rtosc::ring_read ( ringbuffer_t * ring,
char * data,
size_t len )
static

◆ ring_read_size()

size_t rtosc::ring_read_size ( ringbuffer_t * ring)
static

◆ ring_read_vector()

void rtosc::ring_read_vector ( ringbuffer_t * ring,
ring_t * r )
static

◆ ring_write()

void rtosc::ring_write ( ringbuffer_t * ring,
const char * data,
size_t len )
static

◆ ring_write_size()

size_t rtosc::ring_write_size ( ringbuffer_t * ring)
static

◆ rt_get_impl() [1/3]

template<>
int32_t rtosc::rt_get_impl ( const char * msg,
size_t i )

◆ rt_get_impl() [2/3]

template<>
const char * rtosc::rt_get_impl ( const char * msg,
size_t i )

◆ rt_get_impl() [3/3]

template<class T>
T rtosc::rt_get_impl ( const char * msg,
size_t i )

◆ save_to_file()

std::string rtosc::save_to_file ( const Ports & ports,
void * runtime,
const char * appname,
rtosc_version appver )

Return a savefile containing all values that differ from the default values.

Parameters
portsThe static ports structure
runtimeThe runtime object
appnameName of the application calling this function
appverVersion of the application calling this function
Returns
The resulting savefile as an std::sting

◆ second()

template<class... Types>
osc_element< 1, rtMsg< Types... > >::type rtosc::second ( rtMsg< Types... > & Tuple)
inline

◆ valid_char()

template<class T>
bool rtosc::valid_char ( char )

◆ valid_char< const char * >()

template<>
bool rtosc::valid_char< const char * > ( char c)

◆ valid_char< float >()

template<>
bool rtosc::valid_char< float > ( char c)

◆ valid_char< int32_t >()

template<>
bool rtosc::valid_char< int32_t > ( char c)

◆ validate() [1/2]

template<int i, class This, class... Rest>
bool rtosc::validate ( const char * arg)

◆ validate() [2/2]

template<int i>
bool rtosc::validate ( const char * arg)

◆ walk_ports()

void rtosc::walk_ports ( const Ports * base,
char * name_buffer,
size_t buffer_size,
void * data,
port_walker_t walker,
void * runtime = NULL )

Call a function on all ports and subports.

Parameters
baseThe base port of traversing
name_bufferBuffer which will be filled with the port name; must be reset to zero over the full length!
buffer_sizeSize of name_buffer
dataData that should be available in the callback
walkerCallback function

Variable Documentation

◆ tmp

char rtosc::tmp[256]
static