ginga 1.0
The Ginga iTV middleware
All Classes Files Functions Variables Enumerations Enumerator Pages
Formatter.cpp File Reference

The Formatter class. More...

#include "aux-ginga.h"
#include "aux-gl.h"
#include "Formatter.h"
#include "Context.h"
#include "Media.h"
#include "MediaSettings.h"
#include "Object.h"
#include "Switch.h"
#include "Parser.h"
#include "PlayerText.h"
#include "WebServices.h"
Include dependency graph for Formatter.cpp:

Classes

struct  ginga::GingaOptionData
 

Macros

#define OPTS_ENTRY(name, type, func)
 
#define UPDATE_IF_HAVE(PROP)
 
#define _GINGA_CHECK_EOS(ginga)
 
#define OPT_ERR_UNKNOWN(name)   ERROR ("unknown GingaOption '%s'", (name))
 
#define OPT_ERR_BAD_TYPE(name, typename)    ERROR ("GingaOption '%s' is of type '%s'", (name), (typename))
 
#define OPT_GETSET_DEFN(Name, Type, GType)
 

Typedefs

typedef struct ginga::GingaOptionData ginga::OptionTab
 

Detailed Description

The Formatter class.

Macro Definition Documentation

◆ _GINGA_CHECK_EOS

#define _GINGA_CHECK_EOS ( ginga)
Value:
G_STMT_START \
{ \
Context *root; \
root = _doc->getRoot (); \
g_assert_nonnull (root); \
if (root->isSleeping ()) \
{ \
(ginga)->setEOS (true); \
} \
if ((ginga)->getEOS ()) \
{ \
g_assert ((ginga)->_state == GINGA_STATE_PLAYING); \
(ginga)->setEOS (false); \
g_assert ((ginga)->stop ()); \
g_assert ((ginga)->_state == GINGA_STATE_STOPPED); \
} \
} \
G_STMT_END
Definition Context.h:27
@ GINGA_STATE_STOPPED
Ginga is stopped.
Definition ginga.h:75
@ GINGA_STATE_PLAYING
Ginga is playing.
Definition ginga.h:74

◆ OPT_GETSET_DEFN

#define OPT_GETSET_DEFN ( Name,
Type,
GType )
Value:
Type Formatter::getOption##Name (const string &name) \
{ \
if (unlikely (!opts_table_index (name, &opt))) \
OPT_ERR_UNKNOWN (name.c_str ()); \
if (unlikely (opt->type != (GType))) \
OPT_ERR_BAD_TYPE (name.c_str (), G_STRINGIFY (Type)); \
return *((Type *) (((ptrdiff_t) &_opts) + opt->offset)); \
} \
void Formatter::setOption##Name (const string &name, Type value) \
{ \
if (unlikely (!opts_table_index (name, &opt))) \
OPT_ERR_UNKNOWN (name.c_str ()); \
if (unlikely (opt->type != (GType))) \
OPT_ERR_BAD_TYPE (name.c_str (), G_STRINGIFY (Type)); \
*((Type *) (((ptrdiff_t) &_opts) + opt->offset)) = value; \
if (opt->func) \
{ \
((void (*) (Formatter *, const string &, Type)) opt->func) ( \
this, name, value); \
} \
}
Interface between libginga and the external world.
Definition Formatter.h:39
Definition Formatter.cpp:45

◆ OPTS_ENTRY

#define OPTS_ENTRY ( name,
type,
func )
Value:
{ \
G_STRINGIFY (name), \
{ \
(type), offsetof (GingaOptions, name), \
pointerof (G_PASTE (Formatter::setOption, func)) \
} \
}
Ginga control options.
Definition ginga.h:45

◆ UPDATE_IF_HAVE

#define UPDATE_IF_HAVE ( PROP)
Value:
{ \
string s = media->getProperty (PROP); \
if (s != "") \
media->setProperty (PROP, s); \
}