SPIN Framework
Public Member Functions | Static Public Member Functions | Public Attributes

spin::spinApp Class Reference

A singleton class to facilitate communication with SPIN. More...

#include <spinApp.h>

List of all members.

Public Member Functions

void setContext (spinBaseContext *c)
spinBaseContextgetContext ()
void createScene ()
void destroyScene ()
void registerUser ()
void InfoMessage (const std::string &OSCpath, const char *types,...)
void InfoMessage (const std::string &OSCpath, const char *types, va_list ap)
void InfoMessage (const std::string &OSCpath, lo_message msg)
void SceneMessage (const char *types,...)
void SceneMessage (const char *types, va_list ap)
void SceneMessage (lo_message msg)
void NodeMessage (const char *nodeId, const char *types,...)
void NodeMessage (const char *nodeId, const char *types, va_list ap)
void NodeMessage (const char *nodeId, lo_message msg)
void NodeBundle (std::string nodeId, std::vector< lo_message > msgs, lo_address addr=0)
void SceneBundle (std::vector< lo_message > msgs, lo_address addr=0)
void setSceneID (const std::string &s)
std::string getSceneID () const
void setSyncStart (osg::Timer_t t)
osg::Timer_t getSyncStart () const
bool initPython ()
bool execPython (const std::string &cmd)
std::string getCurrentPyException ()
void setUserID (const std::string &id)
std::string getUserID () const

Static Public Member Functions

static spinAppInstance ()

Public Attributes

boost::python::object _pyMainModule
boost::python::object _pyNamespace
bool _pyInitialized
osg::ref_ptr< UserNodeuserNode
spatosc::Scene * audioScene
bool hasAudioRenderer
SceneManagersceneManager_

Detailed Description

A singleton class to facilitate communication with SPIN.

By instantiating this class, we load the OSG nodekit for SPIN -- otherwise known as libSPIN, and create


Member Function Documentation

bool spin::spinApp::execPython ( const std::string &  cmd)

Runs some Python code and returns its success or not.

std::string spin::spinApp::getCurrentPyException ( )

Returns a string containing the most recent Python exception, if any.

void spin::spinApp::InfoMessage ( const std::string &  OSCpath,
const char *  types,
  ... 
)

This sends a variable length message.

IMPORTANT: the list must be terminated with SPIN_ARGS_END, or this call will fail. This is used to do simple error checking on the sizes of parameters passed.

bool spin::spinApp::initPython ( )

initializes the embedded python interpreter

exec("sys.path.append('/home/lwi')", _pyNamespace, _pyNamespace); exec("sys.path.append('/usr/local/share/spinFramework/scripts')", _pyNamespace, _pyNamespace);

spinApp & spin::spinApp::Instance ( ) [static]

Meyers Singleton design pattern

FIXME: Do we really need this?

void spin::spinApp::registerUser ( )

This method should be used to register a user for a listener-style SPIN client. The user is definitively created and stored in the current application context, even if a server is not running.

void spin::spinApp::setContext ( spinBaseContext c)

The first thing that any app must do is set the context for the spinApp singleton. This will provide the singleton with access to the liblo addresses so messages can be sent from anywhere.


Member Data Documentation

A spinApp instance may or may not have an embedded audio renderer using SpatOSC. For instance, there may be a renderer on the server side or viewer side, but probably not both.


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