Mixer Interactive C++ SDK
Classes
Mixer Interactive C++ SDK

Classes

struct  interactive_object
 
struct  interactive_user
 User data for the connected user. Call interactive_get_user after connecting. More...
 
struct  interactive_control
 
struct  interactive_group
 
struct  interactive_scene
 
struct  interactive_input
 
struct  interactive_participant
 

Authorization

int interactive_auth_get_short_code (const char *clientId, const char *clientSecret, char *shortCode, size_t *shortCodeLength, char *shortCodeHandle, size_t *shortCodeHandleLength)
 Get a short code that can be used to obtain an OAuth token from https://www.mixer.com/go?code=SHORTCODE. More...
 
int interactive_auth_wait_short_code (const char *clientId, const char *clientSecret, const char *shortCodeHandle, char *refreshToken, size_t *refreshTokenLength)
 Wait for a shortCode to be authorized or rejected after presenting the OAuth short code web page. The resulting refreshToken should be securely serialized and linked to the current user. More...
 
int interactive_auth_is_token_stale (const char *token, bool *isStale)
 Determine if a refreshToken returned by interactive_auth_wait_short_code is stale. A token is stale if it has exceeded its half-life. More...
 
int interactive_auth_refresh_token (const char *clientId, const char *clientSecret, const char *staleToken, char *refreshToken, size_t *refreshTokenLength)
 Refresh a stale refreshToken. More...
 
int interactive_auth_parse_refresh_token (const char *token, char *authorization, size_t *authorizationLength)
 Parse a refreshToken to get the authorization header that should be passed to interactive_open_session(). More...
 

Session

enum  interactive_state { interactive_disconnected, interactive_connecting, interactive_connected, interactive_ready }
 
enum  interactive_throttle_type { throttle_global, throttle_input, throttle_participant_join, throttle_participant_leave }
 
typedef void * interactive_session
 An opaque handle to an interactive session. More...
 
int interactive_open_session (interactive_session *session)
 Open an interactive_session.

Parameters
sessionA pointer to an interactive_session that will be allocated internally.
More...
 
int interactive_connect (interactive_session session, const char *auth, const char *versionId, const char *shareCode, bool setReady)
 Asynchronously connect an interactive session. Call interactive_run to bootstrap the connection and call interactive_set_state_changed_handler to respond to connection state changes. More...
 
int interactive_set_ready (interactive_session session, bool isReady)
 Set the ready state for specified session. No participants will be able to see interactive scenes or give input until the interactive session is ready. More...
 
int interactive_run (interactive_session session, unsigned int maxEventsToProcess)
 This function processes the specified number of events from the interactive service and calls back on registered event handlers. More...
 
int interactive_get_state (interactive_session session, interactive_state *state)
 Get the current interactive_state for the specified session. More...
 
int interactive_set_session_context (interactive_session session, void *context)
 Set a session context that will be passed to every event callback. This context pointer is not read or written by this library, it's purely to enable your code to track state between calls and callbacks if necessary. More...
 
int interactive_get_session_context (interactive_session session, void **context)
 Get the previously set session context. Context will be nullptr on return if no context has been set. More...
 
int interactive_set_bandwidth_throttle (interactive_session session, interactive_throttle_type throttleType, unsigned int maxBytes, unsigned int bytesPerSecond)
 Set a throttle for server to client messages on this interactive session. More...
 
int interactive_capture_transaction (interactive_session session, const char *transactionId)
 Capture a transaction to charge a participant the input's spark cost. This should be called before taking further action on input as the participant may not have enough sparks or the transaction may have expired. Register an on_transaction_complete handler to execute actions on the participant's behalf. More...
 
void interactive_close_session (interactive_session session)
 Disconnect from an interactive session and clean up memory. More...
 

User

typedef void(* on_interactive_user) (void *context, interactive_session session, const interactive_user *user)
 Callback for interactive_get_user when the user's data is ready. More...
 
int interactive_get_user (interactive_session session, on_interactive_user onUser)
 Get the current authenticated user's data. onUser will be called when the request completes. More...
 

Controls

enum  interactive_control_event { interactive_control_created, interactive_control_updated, interactive_control_deleted }
 
enum  interactive_property_type {
  interactive_unknown_t, interactive_int_t, interactive_bool_t, interactive_float_t,
  interactive_string_t, interactive_array_t, interactive_object_t
}
 
typedef void(* on_control_enumerate) (void *context, interactive_session session, const interactive_control *control)
 
int interactive_control_trigger_cooldown (interactive_session session, const char *controlId, const unsigned long long cooldownMs)
 Trigger a cooldown on a control for the specified number of milliseconds. More...
 
int interactive_control_get_property_count (interactive_session session, const char *controlId, size_t *count)
 Get the number of properties on the control. More...
 
int interactive_control_get_property_data (interactive_session session, const char *controlId, size_t index, char *propName, size_t *propNameLength, interactive_property_type *type)
 Get the name and type of the property at the given index. More...
 
int interactive_control_get_meta_property_count (interactive_session session, const char *controlId, size_t *count)
 Get the number of meta properties on the control. More...
 
int interactive_control_get_meta_property_data (interactive_session session, const char *controlId, size_t index, char *propName, size_t *propNameLength, interactive_property_type *type)
 Get the name and type of the meta property at the given index. More...
 
int interactive_control_get_property_int (interactive_session session, const char *controlId, const char *key, int *property)
 Get an int property value by name. More...
 
int interactive_control_get_property_int64 (interactive_session session, const char *controlId, const char *key, long long *property)
 Get a long long property value by name. More...
 
int interactive_control_get_property_bool (interactive_session session, const char *controlId, const char *key, bool *property)
 Get a bool property value by name. More...
 
int interactive_control_get_property_float (interactive_session session, const char *controlId, const char *key, float *property)
 Get a float property value by name. More...
 
int interactive_control_get_property_string (interactive_session session, const char *controlId, const char *key, char *property, size_t *propertyLength)
 Get a char* property value by name. More...
 
int interactive_control_set_property_null (interactive_session session, const char *controlId, const char *key)
 Set a control property to null. More...
 
int interactive_control_set_property_int (interactive_session session, const char *controlId, const char *key, int property)
 Set an int property value by name. More...
 
int interactive_control_set_property_int64 (interactive_session session, const char *controlId, const char *key, long long property)
 Set a long long property value by name. More...
 
int interactive_control_set_property_bool (interactive_session session, const char *controlId, const char *key, bool property)
 Set a bool property value by name. More...
 
int interactive_control_set_property_float (interactive_session session, const char *controlId, const char *key, float property)
 Set a float property value by name. More...
 
int interactive_control_set_property_string (interactive_session session, const char *controlId, const char *key, char *property)
 Set a char* property value by name. More...
 
int interactive_control_get_meta_property_int (interactive_session session, const char *controlId, const char *key, int *property)
 Get an int meta property value by name. More...
 
int interactive_control_get_meta_property_int64 (interactive_session session, const char *controlId, const char *key, long long *property)
 Get a long long meta property value by name. More...
 
int interactive_control_get_meta_property_bool (interactive_session session, const char *controlId, const char *key, bool *property)
 Get a bool meta property value by name. More...
 
int interactive_control_get_meta_property_float (interactive_session session, const char *controlId, const char *key, float *property)
 Get a float meta property value by name. More...
 
int interactive_control_get_meta_property_string (interactive_session session, const char *controlId, const char *key, char *property, size_t *propertyLength)
 Get a char* meta property value by name. More...
 
#define CONTROL_PROP_DISABLED   "disabled"
 
#define CONTROL_PROP_POSITION   "position"
 
#define BUTTON_PROP_KEY_CODE   "keyCode"
 
#define BUTTON_PROP_TEXT   "text"
 
#define BUTTON_PROP_TOOLTIP   "tooltip"
 
#define BUTTON_PROP_COST   "cost"
 
#define BUTTON_PROP_PROGRESS   "progress"
 
#define BUTTON_PROP_COOLDOWN   "cooldown"
 
#define JOYSTICK_PROP_SAMPLE_RATE   "sampleRate"
 
#define JOYSTICK_PROP_ANGLE   "angle"
 
#define JOYSTICK_PROP_INTENSITY   "intensity"
 

Groups

typedef void(* on_group_enumerate) (void *context, interactive_session session, const interactive_group *group)
 Callback for interactive_get_groups. More...
 
int interactive_get_groups (interactive_session session, on_group_enumerate onGroup)
 Get the interactive groups for the specified session. More...
 
int interactive_create_group (interactive_session session, const char *groupId, const char *sceneId)
 Create a new group for the specified session with the specified scene for participants in this group. If no scene is specified it will be set to the default scene. More...
 
int interactive_group_set_scene (interactive_session session, const char *groupId, const char *sceneId)
 Set a group's scene for the specified session. Use this and interative_set_participant_group to manage which scenes participants see. More...
 

Scenes

typedef void(* on_scene_enumerate) (void *context, interactive_session session, const interactive_scene *scene)
 Callback for interactive_get_scenes More...
 
int interactive_get_scenes (interactive_session session, on_scene_enumerate onScene)
 Get all scenes for the specified session. More...
 
int interactive_scene_get_groups (interactive_session session, const char *sceneId, on_group_enumerate onGroup)
 Get each group that this scene belongs to for the specified session. More...
 
int interactive_scene_get_controls (interactive_session session, const char *sceneId, on_control_enumerate onControl)
 Get a scene's controls for the specified session. More...
 

Events and Handlers

enum  interactive_input_type { input_type_key, input_type_click, input_type_move, input_type_custom }
 
enum  interactive_button_action { interactive_button_action_up, interactive_button_action_down }
 
enum  interactive_participant_action { participant_join, participant_leave, participant_update }
 
typedef void(* on_error) (void *context, interactive_session session, int errorCode, const char *errorMessage, size_t errorMessageLength)
 Callback for any errors that may occur during the session. More...
 
typedef void(* on_state_changed) (void *context, interactive_session session, interactive_state previousState, interactive_state newState)
 Callback when the interactive state changes between disconnected, ready, and not ready. More...
 
typedef void(* on_input) (void *context, interactive_session session, const interactive_input *input)
 Callback when an interactive participant gives input during the session. More...
 
typedef void(* on_participants_changed) (void *context, interactive_session session, interactive_participant_action action, const interactive_participant *participant)
 Callback when an interactive participant changes. More...
 
typedef void(* on_transaction_complete) (void *context, interactive_session session, const char *transactionId, size_t transactionIdLength, unsigned int error, const char *errorMessage, size_t errorMessageLength)
 Callback when a transaction completes. More...
 
typedef void(* on_control_changed) (void *context, interactive_session session, interactive_control_event eventType, const interactive_control *control)
 Callback when a control is created, added, or deleted. More...
 
typedef void(* on_unhandled_method) (void *context, interactive_session session, const char *methodJson, size_t methodJsonLength)
 Callback when any method is called that is not handled by the existing callbacks. This may be useful for more advanced scenarios or future protocol changes that may not have existed in this version of the library. More...
 
int interactive_set_error_handler (interactive_session session, on_error onError)
 Set the handler function for errors. This function may be called by a background thread so be careful when updating UI. More...
 
int interactive_set_state_changed_handler (interactive_session session, on_state_changed onStateChanged)
 Set the handler function for state changes. This function is called by your own thread during interactive_run More...
 
int interactive_set_input_handler (interactive_session session, on_input onInput)
 Set the handler function for interactive input. This function is called by your own thread during interactive_run More...
 
int interactive_set_participants_changed_handler (interactive_session session, on_participants_changed onParticipantsChanged)
 Set the handler function for participants changing. This function is called by your own thread during interactive_run More...
 
int interactive_set_transaction_complete_handler (interactive_session session, on_transaction_complete onTransactionComplete)
 Set the handler function for spark transaction completion. This function is called by your own thread during interactive_run More...
 
int interactive_set_control_changed_handler (interactive_session session, on_control_changed onControlChanged)
 Set the handler function for changes to controls. This function is called by your own thread during interactive_run More...
 
int interactive_set_unhandled_method_handler (interactive_session session, on_unhandled_method onUnhandledMethod)
 Set the handler function for unhandled methods. This may be useful for more advanced scenarios or future protocol changes that may not have existed in this version of the library. This function is called by your own thread during interactive_run More...
 

Participants

typedef void(* on_participant_enumerate) (void *context, interactive_session session, const interactive_participant *participant)
 
int interactive_get_participants (interactive_session session, on_participant_enumerate onParticipant)
 Get all participants (viewers) for the specified session. More...
 
int interactive_participant_set_group (interactive_session session, const char *participantId, const char *groupId)
 Change the participant's group Use this along with interactive_group_set_scene to configure which scene a participant sees. All participants join the 'default' (case sensitive) group when joining a session. More...
 
int interactive_participant_get_user_id (interactive_session session, const char *participantId, unsigned int *userId)
 Get the participant's user id. More...
 
int interactive_participant_get_user_name (interactive_session session, const char *participantId, char *userName, size_t *userNameLength)
 Get the participant's user name. More...
 
int interactive_participant_get_level (interactive_session session, const char *participantId, unsigned int *level)
 Get the participant's level. More...
 
int interactive_participant_get_last_input_at (interactive_session session, const char *participantId, unsigned long long *lastInputAt)
 Get the participant's last input time as a unix millisecond timestamp. More...
 
int interactive_participant_get_connected_at (interactive_session session, const char *participantId, unsigned long long *connectedAt)
 Get the participant's unix millisecond timestamp when they connected to the session. More...
 
int interactive_participant_is_disabled (interactive_session session, const char *participantId, bool *isDisabled)
 Is the participant's input disabled? More...
 
int interactive_participant_get_group (interactive_session session, const char *participantId, char *group, size_t *groupLength)
 Get the participant's group name. More...
 

Manual Protocol Integration

typedef void(* on_method_reply) (void *context, interactive_session session, const char *replyJson, size_t replyJsonLength)
 
int interactive_queue_method (interactive_session session, const char *method, const char *paramsJson, const on_method_reply onReply)
 Send a method to the interactive session. This may be used to interface with the interactive protocol directly and implement functionality that this SDK does not provide. More...
 

Debugging

enum  interactive_debug_level {
  interactive_debug_none = 0, interactive_debug_error, interactive_debug_warning, interactive_debug_info,
  interactive_debug_trace
}
 
typedef void(* on_debug_msg) (const interactive_debug_level dbgMsgType, const char *dbgMsg, size_t dbgMsgSize)
 Callback whenever a debug event happens. More...
 
void interactive_config_debug_level (const interactive_debug_level dbgLevel)
 Configure the debug verbosity for all interactive sessions in the current process. More...
 
void interactive_config_debug (const interactive_debug_level dbgLevel, on_debug_msg dbgCallback)
 Configure the debug verbosity and set the debug callback function for all interactive sessions in the current process. More...
 

Error Codes

enum  mixer_result_code {
  MIXER_OK, MIXER_ERROR, MIXER_ERROR_AUTH, MIXER_ERROR_AUTH_DENIED,
  MIXER_ERROR_AUTH_INVALID_TOKEN, MIXER_ERROR_BUFFER_SIZE, MIXER_ERROR_CANCELLED, MIXER_ERROR_HTTP,
  MIXER_ERROR_INIT, MIXER_ERROR_INVALID_CALLBACK, MIXER_ERROR_INVALID_CLIENT_ID, MIXER_ERROR_INVALID_OPERATION,
  MIXER_ERROR_INVALID_POINTER, MIXER_ERROR_INVALID_PROPERTY_TYPE, MIXER_ERROR_INVALID_VERSION_ID, MIXER_ERROR_JSON_PARSE,
  MIXER_ERROR_METHOD_CREATE, MIXER_ERROR_NO_HOST, MIXER_ERROR_NO_REPLY, MIXER_ERROR_OBJECT_NOT_FOUND,
  MIXER_ERROR_PROPERTY_NOT_FOUND, MIXER_ERROR_TIMED_OUT, MIXER_ERROR_UNKNOWN_METHOD, MIXER_ERROR_UNRECOGNIZED_DATA_FORMAT,
  MIXER_ERROR_WS_CLOSED, MIXER_ERROR_WS_CONNECT_FAILED, MIXER_ERROR_WS_DISCONNECT_FAILED, MIXER_ERROR_WS_READ_FAILED,
  MIXER_ERROR_WS_SEND_FAILED, MIXER_ERROR_NOT_CONNECTED, MIXER_ERROR_OBJECT_EXISTS, MIXER_ERROR_INVALID_STATE
}
 
typedef enum mixer_result_code mixer_result_code
 

Detailed Description

Typedef Documentation

◆ interactive_session

typedef void* interactive_session

An opaque handle to an interactive session.

◆ on_control_changed

typedef void(* on_control_changed) (void *context, interactive_session session, interactive_control_event eventType, const interactive_control *control)

Callback when a control is created, added, or deleted.

◆ on_debug_msg

typedef void(* on_debug_msg) (const interactive_debug_level dbgMsgType, const char *dbgMsg, size_t dbgMsgSize)

Callback whenever a debug event happens.

◆ on_error

typedef void(* on_error) (void *context, interactive_session session, int errorCode, const char *errorMessage, size_t errorMessageLength)

Callback for any errors that may occur during the session.

This is the only callback function that may be called from a thread other than the thread that calls interactive_run.

◆ on_group_enumerate

typedef void(* on_group_enumerate) (void *context, interactive_session session, const interactive_group *group)

Callback for interactive_get_groups.

◆ on_input

typedef void(* on_input) (void *context, interactive_session session, const interactive_input *input)

Callback when an interactive participant gives input during the session.

◆ on_interactive_user

typedef void(* on_interactive_user) (void *context, interactive_session session, const interactive_user *user)

Callback for interactive_get_user when the user's data is ready.

◆ on_participants_changed

typedef void(* on_participants_changed) (void *context, interactive_session session, interactive_participant_action action, const interactive_participant *participant)

Callback when an interactive participant changes.

◆ on_scene_enumerate

typedef void(* on_scene_enumerate) (void *context, interactive_session session, const interactive_scene *scene)

Callback for interactive_get_scenes

◆ on_state_changed

typedef void(* on_state_changed) (void *context, interactive_session session, interactive_state previousState, interactive_state newState)

Callback when the interactive state changes between disconnected, ready, and not ready.

◆ on_transaction_complete

typedef void(* on_transaction_complete) (void *context, interactive_session session, const char *transactionId, size_t transactionIdLength, unsigned int error, const char *errorMessage, size_t errorMessageLength)

Callback when a transaction completes.

◆ on_unhandled_method

typedef void(* on_unhandled_method) (void *context, interactive_session session, const char *methodJson, size_t methodJsonLength)

Callback when any method is called that is not handled by the existing callbacks. This may be useful for more advanced scenarios or future protocol changes that may not have existed in this version of the library.

Function Documentation

◆ interactive_auth_get_short_code()

int interactive_auth_get_short_code ( const char *  clientId,
const char *  clientSecret,
char *  shortCode,
size_t *  shortCodeLength,
char *  shortCodeHandle,
size_t *  shortCodeHandleLength 
)

Get a short code that can be used to obtain an OAuth token from https://www.mixer.com/go?code=SHORTCODE.

This is a blocking function that waits on network IO.

◆ interactive_auth_is_token_stale()

int interactive_auth_is_token_stale ( const char *  token,
bool *  isStale 
)

Determine if a refreshToken returned by interactive_auth_wait_short_code is stale. A token is stale if it has exceeded its half-life.

◆ interactive_auth_parse_refresh_token()

int interactive_auth_parse_refresh_token ( const char *  token,
char *  authorization,
size_t *  authorizationLength 
)

Parse a refreshToken to get the authorization header that should be passed to interactive_open_session().

◆ interactive_auth_refresh_token()

int interactive_auth_refresh_token ( const char *  clientId,
const char *  clientSecret,
const char *  staleToken,
char *  refreshToken,
size_t *  refreshTokenLength 
)

Refresh a stale refreshToken.

This is a blocking function that waits on network IO.

◆ interactive_auth_wait_short_code()

int interactive_auth_wait_short_code ( const char *  clientId,
const char *  clientSecret,
const char *  shortCodeHandle,
char *  refreshToken,
size_t *  refreshTokenLength 
)

Wait for a shortCode to be authorized or rejected after presenting the OAuth short code web page. The resulting refreshToken should be securely serialized and linked to the current user.

This is a blocking function that waits on network IO.

◆ interactive_capture_transaction()

int interactive_capture_transaction ( interactive_session  session,
const char *  transactionId 
)

Capture a transaction to charge a participant the input's spark cost. This should be called before taking further action on input as the participant may not have enough sparks or the transaction may have expired. Register an on_transaction_complete handler to execute actions on the participant's behalf.

◆ interactive_close_session()

void interactive_close_session ( interactive_session  session)

Disconnect from an interactive session and clean up memory.

This must not be called from inside an event handler as the lifetime of registered event handlers are assumed to outlive the session. Only call this when there is no thread processing events via interactive_run

This is a blocking function that waits on outstanding network IO, ensuring all operations are completed before returning. It is not recommended to call this function from the UI thread.

◆ interactive_config_debug()

void interactive_config_debug ( const interactive_debug_level  dbgLevel,
on_debug_msg  dbgCallback 
)

Configure the debug verbosity and set the debug callback function for all interactive sessions in the current process.

◆ interactive_config_debug_level()

void interactive_config_debug_level ( const interactive_debug_level  dbgLevel)

Configure the debug verbosity for all interactive sessions in the current process.

◆ interactive_connect()

int interactive_connect ( interactive_session  session,
const char *  auth,
const char *  versionId,
const char *  shareCode,
bool  setReady 
)

Asynchronously connect an interactive session. Call interactive_run to bootstrap the connection and call interactive_set_state_changed_handler to respond to connection state changes.

Parameters
sessionAn interactive session handle opened with interactive_open_session.
authThe authorization header that is passed to the service. This should either be a OAuth Bearer token or an XToken.
versionIdThe id of the interative project that should be started.
shareCodeAn optional parameter that is used when starting an interactive project that the user does not have implicit access to. This is usually required unless a project has been published.
setReadySpecifies if the session should set the interactive ready state during connection. If false, this can be manually toggled later with interactive_set_ready

◆ interactive_control_get_meta_property_bool()

int interactive_control_get_meta_property_bool ( interactive_session  session,
const char *  controlId,
const char *  key,
bool *  property 
)

Get a bool meta property value by name.

◆ interactive_control_get_meta_property_count()

int interactive_control_get_meta_property_count ( interactive_session  session,
const char *  controlId,
size_t *  count 
)

Get the number of meta properties on the control.

◆ interactive_control_get_meta_property_data()

int interactive_control_get_meta_property_data ( interactive_session  session,
const char *  controlId,
size_t  index,
char *  propName,
size_t *  propNameLength,
interactive_property_type *  type 
)

Get the name and type of the meta property at the given index.

◆ interactive_control_get_meta_property_float()

int interactive_control_get_meta_property_float ( interactive_session  session,
const char *  controlId,
const char *  key,
float *  property 
)

Get a float meta property value by name.

◆ interactive_control_get_meta_property_int()

int interactive_control_get_meta_property_int ( interactive_session  session,
const char *  controlId,
const char *  key,
int *  property 
)

Get an int meta property value by name.

◆ interactive_control_get_meta_property_int64()

int interactive_control_get_meta_property_int64 ( interactive_session  session,
const char *  controlId,
const char *  key,
long long *  property 
)

Get a long long meta property value by name.

◆ interactive_control_get_meta_property_string()

int interactive_control_get_meta_property_string ( interactive_session  session,
const char *  controlId,
const char *  key,
char *  property,
size_t *  propertyLength 
)

Get a char* meta property value by name.

◆ interactive_control_get_property_bool()

int interactive_control_get_property_bool ( interactive_session  session,
const char *  controlId,
const char *  key,
bool *  property 
)

Get a bool property value by name.

◆ interactive_control_get_property_count()

int interactive_control_get_property_count ( interactive_session  session,
const char *  controlId,
size_t *  count 
)

Get the number of properties on the control.

◆ interactive_control_get_property_data()

int interactive_control_get_property_data ( interactive_session  session,
const char *  controlId,
size_t  index,
char *  propName,
size_t *  propNameLength,
interactive_property_type *  type 
)

Get the name and type of the property at the given index.

◆ interactive_control_get_property_float()

int interactive_control_get_property_float ( interactive_session  session,
const char *  controlId,
const char *  key,
float *  property 
)

Get a float property value by name.

◆ interactive_control_get_property_int()

int interactive_control_get_property_int ( interactive_session  session,
const char *  controlId,
const char *  key,
int *  property 
)

Get an int property value by name.

◆ interactive_control_get_property_int64()

int interactive_control_get_property_int64 ( interactive_session  session,
const char *  controlId,
const char *  key,
long long *  property 
)

Get a long long property value by name.

◆ interactive_control_get_property_string()

int interactive_control_get_property_string ( interactive_session  session,
const char *  controlId,
const char *  key,
char *  property,
size_t *  propertyLength 
)

Get a char* property value by name.

◆ interactive_control_set_property_bool()

int interactive_control_set_property_bool ( interactive_session  session,
const char *  controlId,
const char *  key,
bool  property 
)

Set a bool property value by name.

◆ interactive_control_set_property_float()

int interactive_control_set_property_float ( interactive_session  session,
const char *  controlId,
const char *  key,
float  property 
)

Set a float property value by name.

◆ interactive_control_set_property_int()

int interactive_control_set_property_int ( interactive_session  session,
const char *  controlId,
const char *  key,
int  property 
)

Set an int property value by name.

◆ interactive_control_set_property_int64()

int interactive_control_set_property_int64 ( interactive_session  session,
const char *  controlId,
const char *  key,
long long  property 
)

Set a long long property value by name.

◆ interactive_control_set_property_null()

int interactive_control_set_property_null ( interactive_session  session,
const char *  controlId,
const char *  key 
)

Set a control property to null.

◆ interactive_control_set_property_string()

int interactive_control_set_property_string ( interactive_session  session,
const char *  controlId,
const char *  key,
char *  property 
)

Set a char* property value by name.

◆ interactive_control_trigger_cooldown()

int interactive_control_trigger_cooldown ( interactive_session  session,
const char *  controlId,
const unsigned long long  cooldownMs 
)

Trigger a cooldown on a control for the specified number of milliseconds.

◆ interactive_create_group()

int interactive_create_group ( interactive_session  session,
const char *  groupId,
const char *  sceneId 
)

Create a new group for the specified session with the specified scene for participants in this group. If no scene is specified it will be set to the default scene.

◆ interactive_get_groups()

int interactive_get_groups ( interactive_session  session,
on_group_enumerate  onGroup 
)

Get the interactive groups for the specified session.

◆ interactive_get_participants()

int interactive_get_participants ( interactive_session  session,
on_participant_enumerate  onParticipant 
)

Get all participants (viewers) for the specified session.

◆ interactive_get_scenes()

int interactive_get_scenes ( interactive_session  session,
on_scene_enumerate  onScene 
)

Get all scenes for the specified session.

◆ interactive_get_session_context()

int interactive_get_session_context ( interactive_session  session,
void **  context 
)

Get the previously set session context. Context will be nullptr on return if no context has been set.

◆ interactive_get_state()

int interactive_get_state ( interactive_session  session,
interactive_state *  state 
)

Get the current interactive_state for the specified session.

◆ interactive_get_user()

int interactive_get_user ( interactive_session  session,
on_interactive_user  onUser 
)

Get the current authenticated user's data. onUser will be called when the request completes.

This is a blocking function that waits on network IO. Do not call this from the UI thread.

◆ interactive_group_set_scene()

int interactive_group_set_scene ( interactive_session  session,
const char *  groupId,
const char *  sceneId 
)

Set a group's scene for the specified session. Use this and interative_set_participant_group to manage which scenes participants see.

◆ interactive_open_session()

int interactive_open_session ( interactive_session session)

Open an interactive_session.

Parameters
sessionA pointer to an interactive_session that will be allocated internally.

All calls to interactive_open_session must eventually be followed by a call to interactive_close_session to free the handle.

◆ interactive_participant_get_connected_at()

int interactive_participant_get_connected_at ( interactive_session  session,
const char *  participantId,
unsigned long long *  connectedAt 
)

Get the participant's unix millisecond timestamp when they connected to the session.

◆ interactive_participant_get_group()

int interactive_participant_get_group ( interactive_session  session,
const char *  participantId,
char *  group,
size_t *  groupLength 
)

Get the participant's group name.

◆ interactive_participant_get_last_input_at()

int interactive_participant_get_last_input_at ( interactive_session  session,
const char *  participantId,
unsigned long long *  lastInputAt 
)

Get the participant's last input time as a unix millisecond timestamp.

◆ interactive_participant_get_level()

int interactive_participant_get_level ( interactive_session  session,
const char *  participantId,
unsigned int *  level 
)

Get the participant's level.

◆ interactive_participant_get_user_id()

int interactive_participant_get_user_id ( interactive_session  session,
const char *  participantId,
unsigned int *  userId 
)

Get the participant's user id.

◆ interactive_participant_get_user_name()

int interactive_participant_get_user_name ( interactive_session  session,
const char *  participantId,
char *  userName,
size_t *  userNameLength 
)

Get the participant's user name.

◆ interactive_participant_is_disabled()

int interactive_participant_is_disabled ( interactive_session  session,
const char *  participantId,
bool *  isDisabled 
)

Is the participant's input disabled?

◆ interactive_participant_set_group()

int interactive_participant_set_group ( interactive_session  session,
const char *  participantId,
const char *  groupId 
)

Change the participant's group Use this along with interactive_group_set_scene to configure which scene a participant sees. All participants join the 'default' (case sensitive) group when joining a session.

◆ interactive_queue_method()

int interactive_queue_method ( interactive_session  session,
const char *  method,
const char *  paramsJson,
const on_method_reply  onReply 
)

Send a method to the interactive session. This may be used to interface with the interactive protocol directly and implement functionality that this SDK does not provide.

◆ interactive_run()

int interactive_run ( interactive_session  session,
unsigned int  maxEventsToProcess 
)

This function processes the specified number of events from the interactive service and calls back on registered event handlers.

This should be called often, at least once per frame, so that interactive input is processed in a timely manner.

◆ interactive_scene_get_controls()

int interactive_scene_get_controls ( interactive_session  session,
const char *  sceneId,
on_control_enumerate  onControl 
)

Get a scene's controls for the specified session.

◆ interactive_scene_get_groups()

int interactive_scene_get_groups ( interactive_session  session,
const char *  sceneId,
on_group_enumerate  onGroup 
)

Get each group that this scene belongs to for the specified session.

◆ interactive_set_bandwidth_throttle()

int interactive_set_bandwidth_throttle ( interactive_session  session,
interactive_throttle_type  throttleType,
unsigned int  maxBytes,
unsigned int  bytesPerSecond 
)

Set a throttle for server to client messages on this interactive session.

There is a global throttle on all interactive sessions of 30 megabits and 10 megabits per second by default.

◆ interactive_set_control_changed_handler()

int interactive_set_control_changed_handler ( interactive_session  session,
on_control_changed  onControlChanged 
)

Set the handler function for changes to controls. This function is called by your own thread during interactive_run

◆ interactive_set_error_handler()

int interactive_set_error_handler ( interactive_session  session,
on_error  onError 
)

Set the handler function for errors. This function may be called by a background thread so be careful when updating UI.

◆ interactive_set_input_handler()

int interactive_set_input_handler ( interactive_session  session,
on_input  onInput 
)

Set the handler function for interactive input. This function is called by your own thread during interactive_run

◆ interactive_set_participants_changed_handler()

int interactive_set_participants_changed_handler ( interactive_session  session,
on_participants_changed  onParticipantsChanged 
)

Set the handler function for participants changing. This function is called by your own thread during interactive_run

◆ interactive_set_ready()

int interactive_set_ready ( interactive_session  session,
bool  isReady 
)

Set the ready state for specified session. No participants will be able to see interactive scenes or give input until the interactive session is ready.

This is a blocking function that waits on network IO.

◆ interactive_set_session_context()

int interactive_set_session_context ( interactive_session  session,
void *  context 
)

Set a session context that will be passed to every event callback. This context pointer is not read or written by this library, it's purely to enable your code to track state between calls and callbacks if necessary.

◆ interactive_set_state_changed_handler()

int interactive_set_state_changed_handler ( interactive_session  session,
on_state_changed  onStateChanged 
)

Set the handler function for state changes. This function is called by your own thread during interactive_run

◆ interactive_set_transaction_complete_handler()

int interactive_set_transaction_complete_handler ( interactive_session  session,
on_transaction_complete  onTransactionComplete 
)

Set the handler function for spark transaction completion. This function is called by your own thread during interactive_run

◆ interactive_set_unhandled_method_handler()

int interactive_set_unhandled_method_handler ( interactive_session  session,
on_unhandled_method  onUnhandledMethod 
)

Set the handler function for unhandled methods. This may be useful for more advanced scenarios or future protocol changes that may not have existed in this version of the library. This function is called by your own thread during interactive_run