unreal.MagicLeapMusicServiceFunctionLibrary

class unreal.MagicLeapMusicServiceFunctionLibrary(outer=None, name='None')

Bases: unreal.BlueprintFunctionLibrary

Provides music playback control of a Music Service Provider

C++ Source:

  • Plugin: MagicLeapMusicService

  • Module: MagicLeapMusicService

  • File: MagicLeapMusicServiceFunctionLibrary.h

classmethod connect(name)bool

Connects to a music service provider

Parameters

name (str) – Name of the music service provider to connect to.

Returns

True if successfully connected to the music provider with name ‘Name’, false otherwise

Return type

bool

classmethod disconnect()bool

Disconnects from the currently connected service provider.

Returns

True if successfully disconnected to the currently connected music provider, false otherwise

Return type

bool

classmethod get_current_position()Timespan or None

Gets the current playback position of the currently selected track

Returns

True if retrieving the current track position succeeded

position (Timespan): Position of playback of the current track

Return type

Timespan or None

classmethod get_current_track_metadata()MagicLeapMusicServiceTrackMetadata or None

Gets the currently selected track’s metadata

Returns

True if retrieving the current track metadata succeeded

metadata (MagicLeapMusicServiceTrackMetadata): Metadata of the currently selected track

Return type

MagicLeapMusicServiceTrackMetadata or None

classmethod get_playback_repeat_state()MagicLeapMusicServicePlaybackRepeatState or None

Gets the current repeat state of the music service provider

Returns

True if retrieving the repeat state succeeds

repeat_state (MagicLeapMusicServicePlaybackRepeatState): The repeat state the music service provider is currently set to

Return type

MagicLeapMusicServicePlaybackRepeatState or None

classmethod get_playback_shuffle_state()MagicLeapMusicServicePlaybackShuffleState or None

Gets the current playback shuffle state

Returns

True if retrieving the shuffle state succeeded

shuffle_state (MagicLeapMusicServicePlaybackShuffleState): The current playback shuffle state the music provider is set to.

Return type

MagicLeapMusicServicePlaybackShuffleState or None

classmethod get_playback_state()MagicLeapMusicServicePlaybackState or None

Gets the current playback state of the music service provider

Returns

True if retreiving the playback state succeeded

playback_state (MagicLeapMusicServicePlaybackState):

Return type

MagicLeapMusicServicePlaybackState or None

classmethod get_playback_volume()float or None

Gets the volume of playback the music service provider is currently set to

Returns

True if the playback volume has sucessfully been retrieved

volume (float): Volume of current playback

Return type

float or None

classmethod get_service_provider_error()(error_type=MagicLeapMusicServiceProviderError, error_code=int32) or None

Gets the current error status of the music service provider. If no error has occurred then this will return the error type ‘None’

Returns

True if retreiving the providers error has succeeded

error_type (MagicLeapMusicServiceProviderError):

error_code (int32):

Return type

tuple or None

classmethod get_service_status()MagicLeapMusicServiceStatus or None

Gets the current service status of the music service provider

Returns

True if retrieving the service status of the current music service provider succeeded

status (MagicLeapMusicServiceStatus): Current service status of the music service provider

Return type

MagicLeapMusicServiceStatus or None

classmethod get_track_length()Timespan or None

Gets the length of the currently selected track

Returns

True if the length of the current track has been sucessfully retrieved

length (Timespan): Length of the currently selected track

Return type

Timespan or None

classmethod next_track()bool

Advances to the next track on the music service provider’s playlist.

Returns

True if advancing to the next track succeded

Return type

bool

classmethod pause_playback()bool

Pauses playback of the currently selected track.

Returns

True if playback paused successfully

Return type

bool

classmethod previous_track()bool

Rewinds to the previous track on the music provider’s playlist

Returns

True if rewind to the previous track succeded

Return type

bool

classmethod resume_playback()bool

Resumes playback of the currently selected track.

Returns

True if playback resumed successfully

Return type

bool

classmethod seek_to(position)bool

Seeks to a position on the currently selected track.

Parameters

position (Timespan) – Position on the current track to seek to.

Returns

True if the seeking ‘Position’ succeeded

Return type

bool

classmethod set_authentication_string(authentication_string)bool

Sets the authentication string used to connect to the music service provider

Parameters

authentication_string (str) – String used to connect to the music service provider

Returns

True if successfully set the authentication string, false otherwise

Return type

bool

classmethod set_callbacks(callbacks)bool

Sets callbacks the music service provider will utilize.

Parameters

callbacks (MagicLeapMusicServiceCallbacks) –

Returns

True if successful in setting the music service callbacks, false otherwise

Return type

bool

classmethod set_playback_repeat_state(repeat_state)bool

Sets the repeat state of the music service provider

Parameters

repeat_state (MagicLeapMusicServicePlaybackRepeatState) – Repeat state to set the music service provider to

Returns

True if setting the repeat state to ‘RepeatState’ succeeded

Return type

bool

classmethod set_playback_shuffle_state(shuffle_state)bool

Sets the current playback shuffle state

Parameters

shuffle_state (MagicLeapMusicServicePlaybackShuffleState) – The shuffle type to set the current shuffle state to.

Returns

True if setting the shuffle state to ‘ShuffleState’ succeeds

Return type

bool

classmethod set_playback_url(playback_url)bool

Sets the URL to playback using the music service provider

Parameters

playback_url (str) – URL to play via the music service provider

Returns

True if successfully set the playback URL, false otherwise

Return type

bool

classmethod set_playback_volume(volume)bool

Sets the volume of playback by the music service provider

Parameters

volume (float) – Volume to set playback to, should range between 0.0 and 1.0

Returns

True if playback volume has successfully been changed to ‘Volume’

Return type

bool

classmethod set_playlist(playlist)bool

Sets the playlist for the music service provider

Parameters

playlist (Array(str)) – Array of track names to be played by the music service provider

Returns

True if successfully set the playlist

Return type

bool

classmethod start_playback()bool

Starts playback of the currently selected track.

Returns

True if playback started successfully

Return type

bool

classmethod stop_playback()bool

Stops playback of the currently selected track.

Returns

True if playback stopped successfully

Return type

bool