Main Page   Modules   Data Structures   Data Fields   Related Pages  

Context and Codec Options


Data Structures

union  rte_option_value
union  rte_option_value_ptr
struct  rte_option_info

Enumerations

enum  rte_option_type {
  RTE_OPTION_BOOL = 1,
  RTE_OPTION_INT,
  RTE_OPTION_REAL,
  RTE_OPTION_STRING,
  RTE_OPTION_MENU
}

Functions

rte_option_inforte_context_option_info_enum (rte_context *context, unsigned int index)
rte_option_inforte_context_option_info_by_keyword (rte_context *context, const char *keyword)
rte_bool rte_context_option_get (rte_context *context, const char *keyword, rte_option_value *value)
rte_bool rte_context_option_set (rte_context *context, const char *keyword,...)
char * rte_context_option_print (rte_context *context, const char *keyword,...)
rte_bool rte_context_option_menu_get (rte_context *context, const char *keyword, unsigned int *entry)
rte_bool rte_context_option_menu_set (rte_context *context, const char *keyword, unsigned int entry)
rte_bool rte_context_options_reset (rte_context *context)

Enumeration Type Documentation

enum rte_option_type
 

Option type.

Enumeration values:
RTE_OPTION_BOOL  A boolean value, either TRUE (1) or FALSE (0).
Type:int
Default:def.num
Bounds:min.num (0) ... max.num (1), step.num (1)
Menu:NULL
RTE_OPTION_INT  A signed integer value. When only a few discrete values rather than a range are permitted menu points to a vector of integers. Note the option is still set by value, not by menu index. Setting the value may fail, or it may be replaced by the closest possible.
Type:int
Default:def.num or menu.num[def.num]
Bounds:min.num ... max.num, step.num or menu
Menu:NULL or menu.num[min.num ... max.num], step.num (1)
RTE_OPTION_REAL  A real value, optional a vector of suggested values.
Type:double
Default:def.dbl or menu.dbl[def.num]
Bounds:min.dbl ... max.dbl, step.dbl or menu
Menu:NULL or menu.dbl[min.num ... max.num], step.num (1)
RTE_OPTION_STRING  A null terminated string. Note the menu version differs from RTE_OPTION_MENU in its argument, which is the string itself. For example:
 menu.str[0] = "red"
 menu.str[1] = "blue"
 ... and the option may accept other color strings not explicitely listed
Type:char *
Default:def.str or menu.str[def.num]
Bounds:not applicable
Menu:NULL or menu.str[min.num ... max.num], step.num (1)
RTE_OPTION_MENU  Choice between a number of named options. For example:
 menu.str[0] = "up"
 menu.str[1] = "down"
 menu.str[2] = "strange"
Type:int
Default:def.num
Bounds:min.num (0) ... max.num, step.num (1)
Menu:menu.str[min.num ... max.num], step.num (1). The menu strings are nationalized N_("text"), client applications are encouraged to localize with dgettext("rte", menu.str[n]). For details see info gettext.


Function Documentation

rte_option_info* rte_context_option_info_enum rte_context   context,
unsigned int    index
 

Parameters:
context  Initialized rte_context as returned by rte_context_new().
index  Index into the option table.
Enumerates the options available of the given context. You should start at index 0, incrementing by one.

Returns:
Static pointer, data not to be freed, to a rte_option_info structure. NULL if the index is out of bounds.

rte_option_info* rte_context_option_info_by_keyword rte_context   context,
const char *    keyword
 

Parameters:
context  Initialized rte_context as returned by rte_context_new().
keyword  Keyword identifying the option as in rte_option_info.
Similar to rte_context_option_info_enum() but this function tries to find the option info by keyword.

Returns:
Static pointer to a rte_option_info structure, NULL if the keyword was not found.

rte_bool rte_context_option_get rte_context   context,
const char *    keyword,
rte_option_value   value
 

Parameters:
context  Initialized rte_context as returned by rte_context_new().
keyword  Keyword identifying the option as in rte_option_info.
value  A place to store the option value.
This function queries the current value of the option. When the option is a string, you must free() value.str when no longer needed.

Returns:
TRUE on success, otherwise value remained unchanged.

rte_bool rte_context_option_set rte_context   context,
const char *    keyword,
...   
 

Parameters:
context  Initialized rte_context as returned by rte_context_new().
keyword  Keyword identifying the option as in rte_option_info.
Varargs  New value to set.
Sets the value of the option. Make sure you are casting the value to the correct type (int, double, char *).

Typical usage is:

 rte_context_option_set (context, "frame_rate", (double) 3.141592);

Returns:
TRUE on success.

char* rte_context_option_print rte_context   context,
const char *    keyword,
...   
 

Parameters:
context  Initialized rte_context as returned by rte_context_new().
keyword  Keyword identifying the option as in rte_option_info.
Varargs  Option value.
Return a string representation of the option value. When for example the option is a memory size, a value of 2048 may result in a string "2 KB". Make sure you are casting the value to the correct type (int, double, char *). You must free() the returned string when no longer needed.

Returns:
String pointer or NULL on failure.

rte_bool rte_context_option_menu_get rte_context   context,
const char *    keyword,
unsigned int *    entry
 

Parameters:
context  Initialized rte_context as returned by rte_context_new().
keyword  Keyword identifying the option as in rte_option_info.
entry  A place to store the current menu entry.
Similar to rte_context_option_get() this function queries the current value of the named option, but returns this value as number of the corresponding menu entry. Naturally this must be an option with menu or the function will fail.

Returns:
TRUE on success, otherwise value remained unchanged.

rte_bool rte_context_option_menu_set rte_context   context,
const char *    keyword,
unsigned int    entry
 

Parameters:
context  Initialized rte_context as returned by rte_context_new().
keyword  Keyword identifying the option as in rte_option_info.
entry  Menu entry to be selected.
Similar to rte_context_option_set() this function sets the value of the named option, however it does so by number of the corresponding menu entry. Naturally this must be an option with menu, or the function will fail.

Returns:
TRUE on success, otherwise the option is not changed.

rte_bool rte_context_options_reset rte_context   context
 

Parameters:
context  Initialized rte_context as returned by rte_context_new().
Resets all options of the context to their respective default, that is the value they have after calling rte_context_new().

Returns:
TRUE on success, on failure some options may be reset and some not.


Generated on Fri Feb 28 09:23:38 2003 for RTE Library by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002