gramods
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
gramods::gmSound::OpenALContext Class Reference

The instantiation of this class will attempt to open a (specified) playback device and create a context for it. More...

#include <OpenALContext.hh>

Inheritance diagram for gramods::gmSound::OpenALContext:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmSound::OpenALContext:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Member Functions

void setDeviceName (std::string name)
 Sets the name of the playback device to open a context for. More...
 
bool isOpen ()
 
void makeCurrent ()
 Makes this context the current for subsequent calls. More...
 
std::string getDefaultKey () override
 Returns the default key for the Object when automatically instantiated in a Configuration, i.e. More...
 
void initialize () override
 Called to initialize the Object. More...
 
- Public Member Functions inherited from gramods::gmCore::Object
 Object ()
 Initializes internal data. More...
 
virtual ~Object ()
 Cleaning up internal data. More...
 
virtual void accept (Visitor *visitor)
 Calls the visitors apply method with this as argument. More...
 
virtual void traverse (Visitor *visitor)
 Calls the child Object's accept method, if such exist. More...
 
bool isInitialized ()
 Returns true if the Object is initialized. More...
 

Static Public Member Functions

static std::vector< std::string > getDeviceNames ()
 

Static Public Attributes

static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 

Detailed Description

The instantiation of this class will attempt to open a (specified) playback device and create a context for it.

Member Function Documentation

◆ getDefaultKey()

std::string gramods::gmSound::OpenALContext::getDefaultKey ( )
inlineoverridevirtual

Returns the default key for the Object when automatically instantiated in a Configuration, i.e.

where it ends up in a parent Object. Default is "object", but this should be overriden by sub classes and can also be overridden in XML by using the attribute KEY, as in KEY="view".

The key can also be used to extract a specific object from a Configuration instance:

gmCore::Configuration config(argc, argv);
std::shared_ptr<MyClass> my_object;
if (! config.getObjectByKey("view", my_object)) {
GM_ERR("MyCode", "Cannot run without MyClass instance");
exit(-1);
}

Reimplemented from gramods::gmCore::Object.

◆ initialize()

void gramods::gmSound::OpenALContext::initialize ( )
overridevirtual

Called to initialize the Object.

This should be called once only!

Sub classes should override this method to make use of set parameter data. They should also always call its base class' implementation as well.

Reimplemented from gramods::gmCore::Object.

◆ makeCurrent()

void gramods::gmSound::OpenALContext::makeCurrent ( )

Makes this context the current for subsequent calls.

◆ setDeviceName()

void gramods::gmSound::OpenALContext::setDeviceName ( std::string  name)

Sets the name of the playback device to open a context for.

XML-attribute: deviceName


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