38 int interactive_auth_get_short_code(
const char* clientId,
const char* clientSecret,
char* shortCode,
size_t* shortCodeLength,
char* shortCodeHandle,
size_t* shortCodeHandleLength);
53 int interactive_auth_wait_short_code(
const char* clientId,
const char* clientSecret,
const char* shortCodeHandle,
char* refreshToken,
size_t* refreshTokenLength);
66 int interactive_auth_refresh_token(
const char* clientId,
const char* clientSecret,
const char* staleToken,
char* refreshToken,
size_t* refreshTokenLength);
118 enum interactive_state
120 interactive_disconnected,
121 interactive_connecting,
122 interactive_connected,
141 enum interactive_throttle_type
145 throttle_participant_join,
146 throttle_participant_leave
184 const char* userName;
187 unsigned int experience;
189 const char* avatarUrl;
215 enum interactive_control_event
217 interactive_control_created,
218 interactive_control_updated,
219 interactive_control_deleted
223 #define CONTROL_PROP_DISABLED "disabled" 224 #define CONTROL_PROP_POSITION "position" 226 #define BUTTON_PROP_KEY_CODE "keyCode" 227 #define BUTTON_PROP_TEXT "text" 228 #define BUTTON_PROP_TOOLTIP "tooltip" 229 #define BUTTON_PROP_COST "cost" 230 #define BUTTON_PROP_PROGRESS "progress" 231 #define BUTTON_PROP_COOLDOWN "cooldown" 233 #define JOYSTICK_PROP_SAMPLE_RATE "sampleRate" 234 #define JOYSTICK_PROP_ANGLE "angle" 235 #define JOYSTICK_PROP_INTENSITY "intensity" 237 enum interactive_property_type
239 interactive_unknown_t,
243 interactive_string_t,
363 size_t sceneIdLength;
420 typedef void(*
on_error)(
void* context,
interactive_session session,
int errorCode,
const char* errorMessage,
size_t errorMessageLength);
433 enum interactive_input_type
441 enum interactive_button_action
443 interactive_button_action_up,
444 interactive_button_action_down
450 interactive_input_type type;
451 const char* participantId;
452 size_t participantIdLength;
453 const char* jsonData;
454 size_t jsonDataLength;
455 const char* transactionId;
456 size_t transactionIdLength;
459 interactive_button_action action;
476 const char* userName;
477 size_t usernameLength;
479 unsigned long long lastInputAtMs;
480 unsigned long long connectedAtMs;
483 size_t groupIdLength;
486 enum interactive_participant_action
605 typedef void(*on_method_reply)(
void* context,
interactive_session session,
const char* replyJson,
size_t replyJsonLength);
618 enum interactive_debug_level
620 interactive_debug_none = 0,
621 interactive_debug_error,
622 interactive_debug_warning,
623 interactive_debug_info,
624 interactive_debug_trace
630 typedef void(*
on_debug_msg)(
const interactive_debug_level dbgMsgType,
const char* dbgMsg,
size_t dbgMsgSize);
646 typedef enum mixer_result_code
651 MIXER_ERROR_AUTH_DENIED,
652 MIXER_ERROR_AUTH_INVALID_TOKEN,
653 MIXER_ERROR_BUFFER_SIZE,
654 MIXER_ERROR_CANCELLED,
657 MIXER_ERROR_INVALID_CALLBACK,
658 MIXER_ERROR_INVALID_CLIENT_ID,
659 MIXER_ERROR_INVALID_OPERATION,
660 MIXER_ERROR_INVALID_POINTER,
661 MIXER_ERROR_INVALID_PROPERTY_TYPE,
662 MIXER_ERROR_INVALID_VERSION_ID,
663 MIXER_ERROR_JSON_PARSE,
664 MIXER_ERROR_METHOD_CREATE,
666 MIXER_ERROR_NO_REPLY,
667 MIXER_ERROR_OBJECT_NOT_FOUND,
668 MIXER_ERROR_PROPERTY_NOT_FOUND,
669 MIXER_ERROR_TIMED_OUT,
670 MIXER_ERROR_UNKNOWN_METHOD,
671 MIXER_ERROR_UNRECOGNIZED_DATA_FORMAT,
672 MIXER_ERROR_WS_CLOSED,
673 MIXER_ERROR_WS_CONNECT_FAILED,
674 MIXER_ERROR_WS_DISCONNECT_FAILED,
675 MIXER_ERROR_WS_READ_FAILED,
676 MIXER_ERROR_WS_SEND_FAILED,
677 MIXER_ERROR_NOT_CONNECTED,
678 MIXER_ERROR_OBJECT_EXISTS,
679 MIXER_ERROR_INVALID_STATE
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.
int interactive_control_set_property_string(interactive_session session, const char *controlId, const char *key, char *property)
Set a char* property value by name.
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.
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 int...
void(* on_group_enumerate)(void *context, interactive_session session, const interactive_group *group)
Callback for interactive_get_groups.
Definition: interactivity.h:369
Definition: interactivity.h:209
int interactive_control_set_property_int(interactive_session session, const char *controlId, const char *key, int property)
Set an int property value by name.
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...
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.
int interactive_control_set_property_float(interactive_session session, const char *controlId, const char *key, float property)
Set a float property value by name.
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.
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...
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.
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.
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.
int interactive_get_groups(interactive_session session, on_group_enumerate onGroup)
Get the interactive groups for the specified session.
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 interac...
void(* on_scene_enumerate)(void *context, interactive_session session, const interactive_scene *scene)
Callback for interactive_get_scenes
Definition: interactivity.h:399
User data for the connected user. Call interactive_get_user after connecting.
Definition: interactivity.h:181
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 ta...
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.
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...
int interactive_participant_get_level(interactive_session session, const char *participantId, unsigned int *level)
Get the participant's level.
int interactive_participant_get_group(interactive_session session, const char *participantId, char *group, size_t *groupLength)
Get the participant's group name.
Definition: interactivity.h:392
int interactive_control_get_property_count(interactive_session session, const char *controlId, size_t *count)
Get the number of properties on the control.
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...
int interactive_scene_get_controls(interactive_session session, const char *sceneId, on_control_enumerate onControl)
Get a scene's controls for the specified session.
void * interactive_session
An opaque handle to an interactive session.
Definition: interactivity.h:80
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.
Definition: interactivity.h:501
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 ...
Definition: interactivity.h:511
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.
Definition: interactivity.h:431
int interactive_get_scenes(interactive_session session, on_scene_enumerate onScene)
Get all scenes for the specified session.
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.
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...
void(* on_debug_msg)(const interactive_debug_level dbgMsgType, const char *dbgMsg, size_t dbgMsgSize)
Callback whenever a debug event happens.
Definition: interactivity.h:630
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...
int interactive_auth_refresh_token(const char *clientId, const char *clientSecret, const char *staleToken, char *refreshToken, size_t *refreshTokenLength)
Refresh a stale refreshToken.
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.
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 fut...
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.
Definition: interactivity.h:506
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 sce...
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...
void(* on_participants_changed)(void *context, interactive_session session, interactive_participant_action action, const interactive_participant *participant)
Callback when an interactive participant changes.
Definition: interactivity.h:496
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.
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.
void interactive_close_session(interactive_session session)
Disconnect from an interactive session and clean up memory.
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 i...
void(* on_input)(void *context, interactive_session session, const interactive_input *input)
Callback when an interactive participant gives input during the session.
Definition: interactivity.h:471
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 manag...
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...
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.
Definition: interactivity.h:426
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.
int interactive_control_get_property_float(interactive_session session, const char *controlId, const char *key, float *property)
Get a float property value by name.
int interactive_get_state(interactive_session session, interactive_state *state)
Get the current interactive_state for the specified session.
int interactive_participant_is_disabled(interactive_session session, const char *participantId, bool *isDisabled)
Is the participant's input disabled?
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.
int interactive_control_set_property_bool(interactive_session session, const char *controlId, const char *key, bool property)
Set a bool property value by name.
int interactive_control_get_property_bool(interactive_session session, const char *controlId, const char *key, bool *property)
Get a bool property value by name.
Definition: interactivity.h:360
int interactive_control_get_property_int(interactive_session session, const char *controlId, const char *key, int *property)
Get an int property value by name.
Definition: interactivity.h:473
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.
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...
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 ...
int interactive_open_session(interactive_session *session)
Open an interactive_session. A pointer to an interactive_session that will be allocated internally...
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_sessio...
int interactive_participant_get_user_id(interactive_session session, const char *participantId, unsigned int *userId)
Get the participant's user id.
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.
int interactive_get_participants(interactive_session session, on_participant_enumerate onParticipant)
Get all participants (viewers) for the specified session.
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...
void interactive_config_debug_level(const interactive_debug_level dbgLevel)
Configure the debug verbosity for all interactive sessions in the current process.
Definition: interactivity.h:28
int interactive_participant_get_user_name(interactive_session session, const char *participantId, char *userName, size_t *userNameLength)
Get the participant's user name.
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 o...
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 c...
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.
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.
Definition: interactivity.h:195
int interactive_control_set_property_null(interactive_session session, const char *controlId, const char *key)
Set a control property to null.
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.