libIntegra
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
integra_api::CIntegraSession Class Reference

Top-level entry point for libIntegraApi. More...

#include "api/integra_session.h"

Public Member Functions

CError start_session (const CServerStartupInfo &startup_info)
 Start an integra session. More...
 
CError end_session ()
 End an integra session. More...
 
CServerLock get_server ()
 Obtain a server lock in order to interact with the server. More...
 

Detailed Description

Top-level entry point for libIntegraApi.

Users of the libIntegra api must create an CIntegraSession instance in order to use libIntegra.

Note
There's nothing in libIntegra to prevent you from simultaneously creating more than one CIntegraSession instance. However, some of the audio SDKs supported by portaudio (such as ASIO) cannot be used by more than one client at a time.

Member Function Documentation

CError integra_api::CIntegraSession::end_session ( )

End an integra session.

Stops processing audio, frees all system resources

Returns
error is session not started
CServerLock integra_api::CIntegraSession::get_server ( )

Obtain a server lock in order to interact with the server.

Blocks the calling thread until no instances of CServerLock exist, then locks the server and returns an instance of CServer lock. The server will remain locked until the CServerLock instance falls out of scope. This method is thread-safe - it can be called from many different threads simultaneously. However it mustn't be called by the same thread which has already locked the server, or else deadlock will occur. In particular, during callbacks via INotificationSink, the server is already locked, so implementations of INotificationSink::on_set_command must not attempt to lock the server again. Additionally, it is the callers responsibility to ensure that this method is only used when a session is running, ie after a successful call to CIntegraSession::start_session and before a call to CIntegraSession::end_session

Returns
a CServerLock instance with which to interact with the server
CError integra_api::CIntegraSession::start_session ( const CServerStartupInfo startup_info)

Start an integra session.

Creates all data structures and internal state, audio, midi and dsp engine etc for an integra session.

Parameters
startup_infoa structure containing some configuration info for the integra session
Returns
success if session started ok, an error code if the session is already started or configuration info is missing

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