API Reference eSDK 3.209.360

Main


Back to top of page

_10
#include "spotify_embedded.h"

macros and constants


main -> macros and constants
SP_MAX_METADATA_KEY_LENGTH32
SP_MAX_METADATA_VALUE_LENGTH64

data structures


main -> data structures
SpPlayerModeDisallowReasonsThis struct stores a Mode value and the restriction disallow reasons associated with it.
SpPlayerModeRestrictionsthis struct stores a Mode key and the list of restricted values.
SpPlaybackRestrictionsPlayback restrictions.
SpFormatMapping of which media formats are supported in which DRM.
SpMetadataTrack metadata.
SpAdMetadataKey value pair for Ad-related metadata.
SpZeroConfDeviceAliasZeroConf DeviceAlias.
SpZeroConfVarsZeroConf variables.
SpSampleFormatSample format of the audio data.
SpPlaybackCallbacksCallbacks to be registered with SpRegisterPlaybackCallbacks()
SpDebugCallbacksCallbacks to be registered with SpRegisterDebugCallbacks()
SpConnectionCallbacksCallbacks to be registered with SpRegisterConnectionCallbacks()
SpDeviceAliasDevice alias definition.
SpConfigConfiguration.
SpDeviceAliasCallbacksCallbacks to be registered with SpRegisterDeviceAliasCallbacks()

enumerations


main -> enumerations
SpDrmFormatDRM formats.

SP_MAX_METADATA_KEY_LENGTH


main -> macros and constants -> SP_MAX_METADATA_KEY_LENGTH

_10
#define SP_MAX_METADATA_KEY_LENGTH 32

Maximum number of characters in the key of a SpAdMetadata struct, not counting the terminating NULL.

See also

SP_MAX_METADATA_VALUE_LENGTH


main -> macros and constants -> SP_MAX_METADATA_VALUE_LENGTH

_10
#define SP_MAX_METADATA_VALUE_LENGTH 64

Maximum number of characters in the value of a SpAdMetadata struct, not counting the terminating NULL.

See also

SpPlayerModeDisallowReasons


main -> data structures -> SpPlayerModeDisallowReasons

_10
struct SpPlayerModeDisallowReasons {
_10
char value;
_10
uint32_t disallow_reasons;
_10
};

This struct stores a Mode value and the restriction disallow reasons associated with it.

char valueA null-terminated string to represent the value of the restricted Player Mode.
uint32_t disallow_reasonsBitfield of reasons for disallowing setting the mode value.

SpPlayerModeRestrictions


main -> data structures -> SpPlayerModeRestrictions

_10
struct SpPlayerModeRestrictions {
_10
char key;
_10
struct SpPlayerModeDisallowReasons reasons;
_10
};

this struct stores a Mode key and the list of restricted values.

char keyA null-terminated string to represent the key of the Player Mode that is restricted.
struct SpPlayerModeDisallowReasons reasonsthe list of restricted values and the disallow reasons.

SpPlaybackRestrictions


main -> data structures -> SpPlaybackRestrictions

_12
struct SpPlaybackRestrictions {
_12
uint32_t disallow_pausing_reasons;
_12
uint32_t disallow_resuming_reasons;
_12
uint32_t disallow_seeking_reasons;
_12
uint32_t disallow_peeking_prev_reasons;
_12
uint32_t disallow_peeking_next_reasons;
_12
uint32_t disallow_skipping_prev_reasons;
_12
uint32_t disallow_skipping_next_reasons;
_12
uint32_t disallow_toggling_repeat_context_reasons;
_12
uint32_t disallow_toggling_repeat_track_reasons;
_12
uint32_t disallow_toggling_shuffle_reasons;
_12
};

Playback restrictions.

uint32_t disallow_pausing_reasonsBitfield of reasons the pause action is not allowed.
uint32_t disallow_resuming_reasonsBitfield of reasons the resume action is not allowed.
uint32_t disallow_seeking_reasonsBitfield of reasons seeking is not allowed.
uint32_t disallow_peeking_prev_reasonsBitfield of reasons peeking on the previous track is not allowed.
uint32_t disallow_peeking_next_reasonsBitfield of reasons peeking on the next track is not allowed.
uint32_t disallow_skipping_prev_reasonsBitfield of reasons skipping to the previous track is not allowed.
uint32_t disallow_skipping_next_reasonsBitfield of reasons skipping to the next track is not allowed.
uint32_t disallow_toggling_repeat_context_reasonsBitfield of reasons setting repeat context is not allowed.
uint32_t disallow_toggling_repeat_track_reasonsBitfield of reasons setting repeat track is not allowed.
uint32_t disallow_toggling_shuffle_reasonsBitfield of reasons toggling shuffle is not allowed.

SpFormat


main -> data structures -> SpFormat

_10
struct SpFormat {
_10
enum SpDrmFormat drm;
_10
uint64_t media;
_10
};

Mapping of which media formats are supported in which DRM.

See also
enum SpDrmFormat drmDRM format which the integration supports.
uint64_t mediaSupported media formats for a DRM.

SpMetadata


main -> data structures -> SpMetadata

_22
struct SpMetadata {
_22
char playback_source;
_22
char playback_source_uri;
_22
char track;
_22
char track_uri;
_22
char artist;
_22
char artist_uri;
_22
char album;
_22
char album_uri;
_22
char album_cover_uri;
_22
char original_track_uri;
_22
uint32_t duration_ms;
_22
int32_t index;
_22
char track_uid;
_22
uint32_t original_index;
_22
uint32_t bitrate;
_22
struct SpPlaybackRestrictions playback_restrictions;
_22
char playback_id;
_22
enum SpContent content_type;
_22
enum SpMediaType media_type;
_22
enum SpAudioQuality audio_quality;
_22
};

Track metadata.

See also
char playback_sourceDisplay name of the playback source. E.g., the name of the playlist from which playback was initiated (UTF-8-encoded)
char playback_source_uriSpotify URI of the playback source (in the form "spotify:xxxxxx:xxxxxxx...")
char trackDisplay name of the track (UTF-8-encoded)
char track_uriSpotify URI of the track (in the form "spotify:track:xxxxxxx...")
char artistDisplay name of the artist of the track (UTF-8-encoded)
char artist_uriSpotify URI of the artist of the track (in the form "spotify:artist:xxxxxxx...")
char albumDisplay name of the track's album (UTF-8-encoded)
char album_uriSpotify URI of the track's album (in the form "spotify:album:xxxxxxx...")
char album_cover_uriSpotify URI of the album's cover art image (in the form "spotify:image:xxxxxxx...")
char original_track_uriSpotify URI of the original track before relinking (in the form "spotify:track:xxxxxxx...")
uint32_t duration_msPlayback duration of the track in milliseconds.
int32_t indexIndex of the track in the currently playing context.
char track_uidTrack UID of the track in the currently playing context.
uint32_t original_indexIndex of the track in the original (unchanged) playing context.
uint32_t bitrateThe bitrate of the track in kbps. 0 means "unplayable".
struct SpPlaybackRestrictions playback_restrictionsRestrictions that apply to playback and transitions related to this track.
char playback_idPlayback-id of this playback of this specific track.
enum SpContent content_typeContent type of this track.
enum SpMediaType media_typeMedia type of this track.
enum SpAudioQuality audio_qualityAudio quality of this track.

SpAdMetadata


main -> data structures -> SpAdMetadata

_10
struct SpAdMetadata {
_10
char key;
_10
char value;
_10
};

Key value pair for Ad-related metadata.

char keyKey.
char valueValue.

SpZeroConfDeviceAlias


main -> data structures -> SpZeroConfDeviceAlias

_10
struct SpZeroConfDeviceAlias {
_10
uint32_t id;
_10
int is_group;
_10
char display_name;
_10
};

ZeroConf DeviceAlias.

This structure contains information about a single device alias, as returned by SpZeroConfGetVars().

See also
uint32_t idString to be sent in the "id" field of the alias in the "getInfo" response.
int is_groupBoolean (0 = "false", 1 = "true") to be sent in the "isGroup" field of the alias in the "getInfo" response.
char display_nameString to be sent in the "name" field of the alias in the "getInfo" response.

SpZeroConfVars


main -> data structures -> SpZeroConfVars

_20
struct SpZeroConfVars {
_20
char public_key;
_20
char response_source;
_20
char device_id;
_20
char remote_name;
_20
char device_type;
_20
char library_version;
_20
int resolver_version;
_20
char group_status;
_20
int webserver_current_port;
_20
char token_type;
_20
char client_id;
_20
char scope;
_20
char availability;
_20
uint32_t product_id;
_20
struct SpZeroConfDeviceAlias aliases;
_20
uint32_t alias_count;
_20
struct SpFormat supported_drm_media_formats;
_20
uint64_t supported_capabilities;
_20
};

ZeroConf variables.

This structure contains the fields that the application needs for ZeroConf, mainly what to send in the response to the "getInfo" request. See the ZeroConf manual for more information.

See also
char public_keyString to be sent in the "publicKey" field of the "getInfo" response[*].
char response_sourceString to be sent in the "responseSource" field of the "getInfo" response[*].
char device_idString to be sent in the "deviceID" field of the "getInfo" response[*].
char remote_nameString to be sent in the "remoteName" field of the "getInfo" response[*].
char device_typeString to be sent in the "deviceType" field of the "getInfo" response[*].
char library_versionString to be sent in the "libraryVersion" field of the "getInfo" response[*].
int resolver_versionInteger to be sent as string in the "resolverVersion" field of the "getInfo" response[*].
char group_statusString to be sent in the "groupStatus" field of the "getInfo" response[*].
int webserver_current_portCurrent internal ZeroConf webserver port number. To be used when running an external mDNS server together with an internal webserver.
char token_typeString to be sent in the "tokenType" field of the "getInfo" response[*].
char client_idString to be sent in the "clientID" field of the "getInfo" response[*].
char scopeString to be sent in the "scope" field of the "getInfo" response[*].
char availabilityString to be sent in the "availability" field of the "getInfo" response[*].
uint32_t product_idInteger to be sent in the "productID" field of the "getInfo" response[*].
struct SpZeroConfDeviceAlias aliasesArray of SpZeroConfDeviceAlias to be sent in the "aliases" field of the "getInfo" response[*].
uint32_t alias_countNumber of valid items in aliases array.
struct SpFormat supported_drm_media_formatsArray of SpFormat to be sent in the "supported_drm_media_formats" field of the "getInfo" response[*].
uint64_t supported_capabilitiesInteger representing a bitmask to be sent in the "supported_capabilities" field of the "getInfo" response[*].

SpSampleFormat


main -> data structures -> SpSampleFormat

_10
struct SpSampleFormat {
_10
int channels;
_10
int sample_rate;
_10
int bits_per_sample;
_10
};

Sample format of the audio data.

int channelsNumber of channels (1 = mono, 2 = stereo)
int sample_rateSample rate in Hz (such as 22050, 44100 or 48000)
int bits_per_sampleBits per sample (16 or 24)

SpPlaybackCallbacks


main -> data structures -> SpPlaybackCallbacks

_10
struct SpPlaybackCallbacks {
_10
SpCallbackPlaybackNotify on_notify;
_10
SpCallbackPlaybackSeek on_seek;
_10
SpCallbackPlaybackApplyVolume on_apply_volume;
_10
};

Callbacks to be registered with SpRegisterPlaybackCallbacks()

Any of the pointers may be NULL. See the documentation of the callback typedefs for information about the individual callbacks.

SpCallbackPlaybackNotify on_notifyNotification callback.
SpCallbackPlaybackSeek on_seekSeek position callback.
SpCallbackPlaybackApplyVolume on_apply_volumeApply volume callback.

SpDebugCallbacks


main -> data structures -> SpDebugCallbacks

_10
struct SpDebugCallbacks {
_10
SpCallbackDebugMessage on_message;
_10
};

Callbacks to be registered with SpRegisterDebugCallbacks()

Any of the pointers may be NULL. See the documentation of the callback typedefs for information about the individual callbacks.

SpCallbackDebugMessage on_messageDebug message callback.

SpConnectionCallbacks


main -> data structures -> SpConnectionCallbacks

_10
struct SpConnectionCallbacks {
_10
SpCallbackConnectionNotify on_notify;
_10
SpCallbackConnectionNewCredentials on_new_credentials;
_10
SpCallbackConnectionMessage on_message;
_10
};

Callbacks to be registered with SpRegisterConnectionCallbacks()

Any of the pointers may be NULL. See the documentation of the callback typedefs for information about the individual callbacks.

SpCallbackConnectionNotify on_notifyNotification callback.
SpCallbackConnectionNewCredentials on_new_credentialsCredentials blob callback.
SpCallbackConnectionMessage on_messageConnection message callback.

SpDeviceAlias


main -> data structures -> SpDeviceAlias

_10
struct SpDeviceAlias {
_10
const char *display_name;
_10
uint32_t attributes;
_10
};

Device alias definition.

This struct is used to define (optional) device aliases. It's a part of the SpConfig struct which will be passed to SpInit() to initialize the eSDK.

const char * display_nameA UTF-8 encoded display name for an alias of the application/device.
uint32_t attributesAttributes for this device alias.

SpConfig


main -> data structures -> SpConfig

_28
struct SpConfig {
_28
int api_version;
_28
void *memory_block;
_28
uint32_t memory_block_size;
_28
const char *unique_id;
_28
const char *display_name;
_28
uint32_t global_attributes;
_28
struct SpDeviceAlias device_aliases;
_28
const char *brand_name;
_28
const char *brand_display_name;
_28
const char *model_name;
_28
const char *model_display_name;
_28
const char *platform_name;
_28
const char *client_id;
_28
uint32_t product_id;
_28
const char *scope;
_28
const char *os_version;
_28
enum SpDeviceType device_type;
_28
enum SpPlaybackBitrate max_bitrate;
_28
SpCallbackError error_callback;
_28
void *error_callback_context;
_28
int zeroconf_serve;
_28
const char *host_name;
_28
int zeroconf_port;
_28
int zeroconf_port_range;
_28
struct SpFormat supported_drm_media_formats;
_28
struct SpAdMetadata ad_metadata;
_28
};

Configuration.

See also
int api_versionThe version of the API contained in this header file. Must be set to SP_API_VERSION.
void * memory_blockPointer to a memory block to be used by the library.
uint32_t memory_block_sizeSize of the memory_block buffer in bytes.
const char * unique_idA NULL-terminated character string that uniquely identifies the device (such as a MAC address)
const char * display_nameA UTF-8-encoded display name for the application/device.
uint32_t global_attributesThe global attributes is a bitfield where each attribute is OR:ed together and stored in this integer.
struct SpDeviceAlias device_aliasesDevice alias definitions. These are optional, if you don't want to define aliases this array must be zeroed.
const char * brand_nameA NULL-terminated string containing the brand name of the hardware device (for hardware integrations)
const char * brand_display_nameA UTF-8-encoded brand name of the hardware device (for hardware integrations). Should be very similar to brand_name.
const char * model_nameA NULL-terminated string containing the model name of the hardware device (for hardware integrations)
const char * model_display_nameA UTF-8-encoded model name of the hardware device (for hardware integrations)
const char * platform_nameA NULL-terminated string containing the platform identifier.
const char * client_idA NULL-terminated string containing the client id of the application.
uint32_t product_idAn integer enumerating the product for this partner.
const char * scopeA NULL-terminated string containing the OAuth scope requested when authenticating with the Spotify backend.
const char * os_versionA NULL-terminated string containing the os version running on the hardware.
enum SpDeviceType device_typeThe device type that best describes this product.
enum SpPlaybackBitrate max_bitrateThe maximum bitrate to use for playback.
SpCallbackError error_callbackPointer to a callback function that will receive error notifications.
void * error_callback_contextApplication-defined pointer that will be passed unchanged as the context argument to the error_callback callback.
int zeroconf_serveNot applicable in this eSDK configuration.
const char * host_nameNot applicable in this eSDK configuration.
int zeroconf_portNot applicable in this eSDK configuration.
int zeroconf_port_rangeNot applicable in this eSDK configuration.
struct SpFormat supported_drm_media_formats
struct SpAdMetadata ad_metadataFor clients that need to register ad-relasted metadata.

SpDeviceAliasCallbacks


main -> data structures -> SpDeviceAliasCallbacks

_10
struct SpDeviceAliasCallbacks {
_10
SpCallbackSelectedDeviceAliasChanged on_selected_device_alias_changed;
_10
SpCallbackDeviceAliasesUpdateDone on_device_aliases_update_done;
_10
};

Callbacks to be registered with SpRegisterDeviceAliasCallbacks()

Any of the pointers may be NULL. See the documentation of the callback typedefs for information about the individual callbacks.

SpCallbackSelectedDeviceAliasChanged on_selected_device_alias_changedSelected device alias updated callback.
SpCallbackDeviceAliasesUpdateDone on_device_aliases_update_doneDevice alias list updated.

SpDrmFormat


main -> enumerations -> SpDrmFormat

_10
enum SpDrmFormat {
_10
kSpDrmFormatUnknown,
_10
kSpDrmFormatUnencrypted,
_10
kSpDrmFormatFairPlay,
_10
kSpDrmFormatWidevine,
_10
kSpDrmFormatPlayReady,
_10
_10
};

DRM formats.

kSpDrmFormatUnknownUnknown DRM.
kSpDrmFormatUnencryptedNo DRM, unencrypted.
kSpDrmFormatFairPlayFairPlay.
kSpDrmFormatWidevineWidevine.
kSpDrmFormatPlayReadyPlayReady.

Content


Back to top of page

_10
#include "spotify_embedded_content.h"

data structures


content -> data structures
SpContentCallbacksCallbacks to be registered with SpRegisterContentCallbacks()

SpContentCallbacks


content -> data structures -> SpContentCallbacks

_10
struct SpContentCallbacks {
_10
SpCallbackTrackCacheState track_state_callback;
_10
SpCallbackStorageKeyContentMapping store_key_map_callback;
_10
SpCallbackTrackRelinked track_relink_callback;
_10
SpCallbackTrackRemoved track_removed_callback;
_10
SpCallbackOnAvailableContainer on_available_container;
_10
};

Callbacks to be registered with SpRegisterContentCallbacks()

Any of the pointers may be NULL.

Notes:
  • See the documentation of the callback typedefs for information about the individual callbacks.
SpCallbackTrackCacheState track_state_callbackTrack cached state callback.
SpCallbackStorageKeyContentMapping store_key_map_callbackContent mapping callback.
SpCallbackTrackRelinked track_relink_callbackNotify about track relink during prefetch/offline.
SpCallbackTrackRemoved track_removed_callbackNotify about track removal.
SpCallbackOnAvailableContainer on_available_containerNotify about an available container item.

Hal


Back to top of page

_10
#include "spotify_embedded_hal.h"

data structures


hal -> data structures
SpSockaddrStruct contains resolved hostname IP address and its family.
SpDnsHALCallbacksCallbacks to be registered with SpRegisterDnsHALCallbacks()
SpSocketHandleSocket handle type.
SpSocketHALCallbacksCallbacks to be registered with SpRegisterSocketHALCallbacks()

SpSockaddr


hal -> data structures -> SpSockaddr

_10
struct SpSockaddr {
_10
enum SpIPFamily family;
_10
uint8_t addr;
_10
int port;
_10
};

Struct contains resolved hostname IP address and its family.

enum SpIPFamily familyIP protocol family for which lookup is requested.
uint8_t addrIp address. Network byte order.
int portContains port value if applicable. Host byte order.

SpDnsHALCallbacks


hal -> data structures -> SpDnsHALCallbacks

_10
struct SpDnsHALCallbacks {
_10
SpCallbackPerformDNSLookup dns_lookup_callback;
_10
};

Callbacks to be registered with SpRegisterDnsHALCallbacks()

Any of the pointers may be NULL. To remove DNS callback at any time call SpRegisterDnsHALCallbacks() with SpDnsHALCallbacks::dns_lookup_callback set to NULL.

Notes:
  • See the documentation of the callback typedefs for information about the individual callbacks.
SpCallbackPerformDNSLookup dns_lookup_callbackDNS lookup callback. If NULL eSDK will use its internal DNS resolve mechanism.

SpSocketHandle


hal -> data structures -> SpSocketHandle

_10
struct SpSocketHandle {
_10
void *handle;
_10
void *tls;
_10
};

Socket handle type.

void * handlePlatform defined socket representation.
void * tlsCan be used by the TLS implementation to store connection specific state.

SpSocketHALCallbacks


hal -> data structures -> SpSocketHALCallbacks

_19
struct SpSocketHALCallbacks {
_19
SpCallbackSocketCreate socket_create;
_19
SpCallbackSocketSetOption socket_set_option;
_19
SpCallbackSocketClose socket_close;
_19
SpCallbackSocketBind socket_bind;
_19
SpCallbackSocketListen socket_listen;
_19
SpCallbackSocketConnect socket_connect;
_19
SpCallbackSocketAccept socket_accept;
_19
SpCallbackSocketRead socket_read;
_19
SpCallbackSocketWrite socket_write;
_19
SpCallbackSocketReadFrom socket_read_from;
_19
SpCallbackSocketWriteTo socket_write_to;
_19
SpCallbackSocketError socket_error;
_19
SpCallbackSocketReadable socket_readable;
_19
SpCallbackSocketWriteable socket_writable;
_19
SpCallbackLocalAddresses local_addresses;
_19
SpCallbackSocketAddress socket_address;
_19
SpCallbackPump on_pump;
_19
};

Callbacks to be registered with SpRegisterSocketHALCallbacks()

Any of the pointers may be NULL. See the documentation of the callback typedefs for information about the individual callbacks.

SpCallbackSocketCreate socket_createCallback to create socket instance.
SpCallbackSocketSetOption socket_set_optionCallback to set options on created socket.
SpCallbackSocketClose socket_closeCallback to close the socket.
SpCallbackSocketBind socket_bindCallback to bind to socket.
SpCallbackSocketListen socket_listenCallback to start listening the socket.
SpCallbackSocketConnect socket_connectCallback to connect to socket.
SpCallbackSocketAccept socket_acceptCallback to accept connection on socket.
SpCallbackSocketRead socket_readCallback to read data from socket.
SpCallbackSocketWrite socket_writeCallback to write data to socket.
SpCallbackSocketReadFrom socket_read_fromCallback to read data from socket pointed by address.
SpCallbackSocketWriteTo socket_write_toCallback to write data to socket pointed by address.
SpCallbackSocketError socket_errorCallback to get OS error on socket.
SpCallbackSocketReadable socket_readableCallback to get readable state on socket.
SpCallbackSocketWriteable socket_writableCallback to get writable state on socket.
SpCallbackLocalAddresses local_addressesCallback to get local interface addresses.
SpCallbackSocketAddress socket_addressCallback to platform address representation.
SpCallbackPump on_pumpCallback to pump network layer.

Log


Back to top of page

_10
#include "spotify_embedded_log.h"

macros and constants


log -> macros and constants
SP_FILE_NAMEFILE

data structures


log -> data structures
SpLogTraceObjectTrace object.

SP_FILE_NAME


log -> macros and constants -> SP_FILE_NAME

_10
#define SP_FILE_NAME __FILE__

Preferred macro to log the file name, you might redefine SP_FILE_NAME using basename() or use -ffile-prefix-map.

SpLogTraceObject


log -> data structures -> SpLogTraceObject

_10
struct SpLogTraceObject {
_10
SpLogLevel level;
_10
const char *name;
_10
};

Trace object.

The trace object is an abstraction of a specific trace message category and an associated log level. The level can be changed freely for individual trace objects.

SpLogLevel levelThe current debug level for this trace object.
const char * nameThe trace category name describing this trace object.

Media


Back to top of page

_10
#include "spotify_embedded_media.h"

data structures


media -> data structures
SpStreamInfoStream Parameters.
SpStreamCallbacksCallbacks to be registered with SpRegisterStreamCallbacks()

SpStreamInfo


media -> data structures -> SpStreamInfo

_10
struct SpStreamInfo {
_10
uint32_t size;
_10
int32_t gain_mdb;
_10
uint32_t start_position_ms;
_10
const char *track_uri;
_10
const char *resource;
_10
};

Stream Parameters.

uint32_t sizeSize of the stream in bytes. If the size is unknown, 0 is used.
int32_t gain_mdbAudio normalization gain (in mdB) to apply to the stream.
uint32_t start_position_msReserved for internal use.
const char * track_uriSpotify track URI.
const char * resourceReserved for internal use.

SpStreamCallbacks


media -> data structures -> SpStreamCallbacks

_10
struct SpStreamCallbacks {
_10
SpCallbackStreamStart on_start;
_10
SpCallbackStreamData on_data;
_10
SpCallbackStreamEnd on_end;
_10
SpCallbackStreamGetPosition on_get_position;
_10
SpCallbackStreamSeekToPosition on_seek_position;
_10
SpCallbackStreamFlush on_flush;
_10
};

Callbacks to be registered with SpRegisterStreamCallbacks()

SpCallbackStreamStart on_startStart of delivery callback.
SpCallbackStreamData on_dataData delivery callback.
SpCallbackStreamEnd on_endEnd of delivery callback.
SpCallbackStreamGetPosition on_get_positionCurrent playback position callback.
SpCallbackStreamSeekToPosition on_seek_positionSeek to position callback.
SpCallbackStreamFlush on_flushFlush callback.

Play


Back to top of page

_10
#include "spotify_embedded_play_api.h"

data structures


play -> data structures
SpSourceInfoMetadata for identifying where a playback request originated from.
SpPlayOptionsPlayOptions passed to SpPlayUriWithOptions(). Use SP_PLAYOPTIONS_INITIALIZER for initializing with default values.

SpSourceInfo


play -> data structures -> SpSourceInfo

_10
struct SpSourceInfo {
_10
char type;
_10
char uri;
_10
char expected_track_uri;
_10
char referrer;
_10
};

Metadata for identifying where a playback request originated from.

See also
char typeThe type of playlist/context/UI view that caused this playback to start. Note: If set, this MUST be one of the following strings (unless told otherwise):
char uriThe URI of the parent container, if there is one.
char expected_track_uriThe URI of the track that is expected to play.
char referrerThe view you were in prior to initiating playback.

SpPlayOptions


play -> data structures -> SpPlayOptions

_10
struct SpPlayOptions {
_10
int from_index;
_10
const char *from_uid;
_10
int offset_ms;
_10
int shuffle_context;
_10
int repeat_mode;
_10
const struct SpSourceInfo *source_info;
_10
};

PlayOptions passed to SpPlayUriWithOptions(). Use SP_PLAYOPTIONS_INITIALIZER for initializing with default values.

Example:

_10
struct SpPlayOptionsoptions= SP_PLAYOPTIONS_INITIALIZER;

int from_indexTrack index in the Context from which playback should start. Use SP_NO_INDEX if no specific index is required. In case of non-shuffled context this will result in the first track of the context being played whereas in shuffled context this will result in a random track being played.
const char * from_uidThe UID to identify a unique track in the context.
int offset_msThe time offset to start playing specified track from.
int shuffle_contextSet to enable or disable shuffle mode for the requested playback command.
int repeat_modeSet to enable or disable repeat mode for the requested playback command.
const struct SpSourceInfo * source_infoMetadata about what user action caused this playback event, and the expected result.

Storage


Back to top of page

_10
#include "spotify_embedded_storage.h"

data structures


storage -> data structures
SpDiskStorageCallbacksCallbacks to be registered with SpRegisterStorageCallbacks()

SpDiskStorageCallbacks


storage -> data structures -> SpDiskStorageCallbacks

_10
struct SpDiskStorageCallbacks {
_10
SpCallbackStorageAlloc alloc_storage;
_10
SpCallbackStorageWrite write_storage;
_10
SpCallbackStorageRead read_storage;
_10
SpCallbackStorageClose close_storage;
_10
SpCallbackStorageDelete delete_storage;
_10
SpCallbackThrottleRequest throttle_request;
_10
};

Callbacks to be registered with SpRegisterStorageCallbacks()

Storage callbacks must be either all NULLs or all valid pointers. Throttle callback may be NULL regardless of storage callbacks. See the documentation of the callback typedefs for information about the individual callbacks.

SpCallbackStorageAlloc alloc_storageAlloc storage record callback.
SpCallbackStorageWrite write_storageWrite storage data callback.
SpCallbackStorageRead read_storageRead storage data callback.
SpCallbackStorageClose close_storageClose storage record callback.
SpCallbackStorageDelete delete_storageDelete storage record callback.
SpCallbackThrottleRequest throttle_requestAsks the client if disk writes need to be throttled.

Tls


Back to top of page

_10
#include "spotify_embedded_tls.h"

data structures


tls -> data structures
SpTLSCallbacksCallbacks to be registered with SpRegisterTLSCallbacks()

SpTLSCallbacks


tls -> data structures -> SpTLSCallbacks

_10
struct SpTLSCallbacks {
_10
SpCallbackTLSInit init;
_10
SpCallbackTLSDeinit deinit;
_10
SpCallbackTLSCreate create;
_10
SpCallbackTLSHandshake handshake;
_10
SpCallbackTLSRead read;
_10
SpCallbackTLSWrite write;
_10
SpCallbackTLSClose close;
_10
SpCallbackTLSGetError get_error;
_10
};

Callbacks to be registered with SpRegisterTLSCallbacks()

None of the pointers may be NULL. See the documentation of the callback typedefs for information about the individual callbacks.

SpCallbackTLSInit initCallback that performs one-time initialization.
SpCallbackTLSDeinit deinitCallback that performs release of resources allocated during init.
SpCallbackTLSCreate createCallback invoked once per connection to initialize TLS context.
SpCallbackTLSHandshake handshakeCallback invoked repeatedly to perform the TLS handshake.
SpCallbackTLSRead readCallback for reading from the TLS data stream.
SpCallbackTLSWrite writeCallback for writing to the TLS data stream.
SpCallbackTLSClose closeCallback invoked to cleanup any TLS context before closing the socket.
SpCallbackTLSGetError get_errorCallback invoked to get an error message for the last error.

Token


Back to top of page

_10
#include "spotify_embedded_token.h"

data structures


token -> data structures
SpTokenCallbacksCallbacks to be registered with SpRegisterTokenCallbacks()

SpTokenCallbacks


token -> data structures -> SpTokenCallbacks

_10
struct SpTokenCallbacks {
_10
SpCallbackConnectionReceiveAccessToken on_access_token;
_10
SpCallbackConnectionReceiveAuthCode on_auth_code;
_10
};

Callbacks to be registered with SpRegisterTokenCallbacks()

Any of the pointers may be NULL. See the documentation of the callback typedefs for information about the individual callbacks.

SpCallbackConnectionReceiveAccessToken on_access_tokenAccess token event callbacks.
SpCallbackConnectionReceiveAuthCode on_auth_codeAuthorization code event callbacks.