Ejemplo n.º 1
0
import ctypes

#Import handy globals
from _spotify import LibSpotifyInterface, callback, bool_type


#Callbacks
albumbrowse_complete_cb = callback(None, ctypes.c_void_p, ctypes.c_void_p)



class AlbumBrowseInterface(LibSpotifyInterface):
    def __init__(self):
        LibSpotifyInterface.__init__(self)


    def create(self, *args):
        return self._get_func(
            'sp_albumbrowse_create',
            ctypes.c_void_p,
            ctypes.c_void_p, ctypes.c_void_p, albumbrowse_complete_cb, ctypes.c_void_p
        )(*args)


    def is_loaded(self, *args):
        return self._get_func(
            'sp_albumbrowse_is_loaded',
            bool_type,
            ctypes.c_void_p
        )(*args)
Ejemplo n.º 2
0
from _spotify import LibSpotifyInterface, callback, bool_type, is_linux


#Structure definitions
class callbacks(ctypes.Structure):
    pass

class config(ctypes.Structure):
    pass

class offline_sync_status(ctypes.Structure):
    pass


#Callbacks
cb_logged_in = callback(None, ctypes.c_void_p, ctypes.c_int)
cb_logged_out = callback(None, ctypes.c_void_p)
cb_metadata_updated = callback(None, ctypes.c_void_p)
cb_connection_error = callback(None, ctypes.c_void_p, ctypes.c_int)
cb_message_to_user = callback(None, ctypes.c_void_p, ctypes.c_char_p)
cb_notify_main_thread = callback(None, ctypes.c_void_p)

cb_music_delivery = callback(
    ctypes.c_int,
    ctypes.c_void_p, ctypes.POINTER(_spotify.audioformat),
    ctypes.c_void_p, ctypes.c_int
)

cb_play_token_lost = callback(None, ctypes.c_void_p)
cb_log_message = callback(None, ctypes.c_void_p, ctypes.c_char_p)
cb_end_of_track = callback(None, ctypes.c_void_p)
import ctypes

# Import handy globals
from _spotify import LibSpotifyInterface, callback, bool_type


# Structure definitions
class callbacks(ctypes.Structure):
    pass


# Callbacks
cb_playlist_added = callback(None, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p)

cb_playlist_removed = callback(None, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p)

cb_playlist_moved = callback(None, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_int, ctypes.c_void_p)

cb_container_loaded = callback(None, ctypes.c_void_p, ctypes.c_void_p)


# Completion of structure defs
callbacks._fields_ = [
    ("playlist_added", cb_playlist_added),
    ("playlist_removed", cb_playlist_removed),
    ("playlist_moved", cb_playlist_moved),
    ("container_loaded", cb_container_loaded),
]


class PlaylistContainerInterface(LibSpotifyInterface):
Ejemplo n.º 4
0
import ctypes

#Import handy globals
from _spotify import LibSpotifyInterface, callback, bool_type


#Callbacks
search_complete_cb = callback(None, ctypes.c_void_p, ctypes.c_void_p)



class SearchInterface(LibSpotifyInterface):
    def __init__(self):
        LibSpotifyInterface.__init__(self)


    def create(self, *args):
        return self._get_func(
            'sp_search_create',
            ctypes.c_void_p,
            ctypes.c_void_p, ctypes.c_char_p,
            ctypes.c_int, ctypes.c_int, ctypes.c_int,
            ctypes.c_int, ctypes.c_int, ctypes.c_int,
            ctypes.c_int, ctypes.c_int, ctypes.c_int,
            search_complete_cb, ctypes.c_void_p
        )(*args)


    def is_loaded(self, *args):
        return self._get_func(
            'sp_search_is_loaded',
Ejemplo n.º 5
0
import ctypes

#Import handy globals
from _spotify import LibSpotifyInterface, callback, bool_type


#Callbacks
image_loaded_cb = callback(None, ctypes.c_void_p, ctypes.c_void_p)



class ImageInterface(LibSpotifyInterface):
    def __init__(self):
        LibSpotifyInterface.__init__(self)


    def create(self, *args):
        return self._get_func(
            'sp_image_create',
            ctypes.c_void_p,
            ctypes.c_void_p, ctypes.c_char * 20
        )(*args)


    def create_from_link(self, *args):
        return self._get_func(
            'sp_image_create_from_link',
            ctypes.c_void_p,
            ctypes.c_void_p, ctypes.c_void_p
        )(*args)
Ejemplo n.º 6
0
import ctypes

#Import handy globals
from _spotify import LibSpotifyInterface, callback

#Callbacks
inboxpost_complete_cb = callback(None, ctypes.c_void_p, ctypes.c_void_p)


class InboxInterface(LibSpotifyInterface):
    def __init__(self):
        LibSpotifyInterface.__init__(self)

    def post_tracks(self, *args):
        return self._get_func('sp_inbox_post_tracks', ctypes.c_void_p,
                              ctypes.c_void_p, ctypes.c_char_p,
                              ctypes.POINTER(ctypes.c_void_p), ctypes.c_int,
                              ctypes.c_char_p, inboxpost_complete_cb,
                              ctypes.c_void_p)(*args)

    def error(self, *args):
        return self._get_func('sp_inbox_error', ctypes.c_int,
                              ctypes.c_void_p)(*args)

    def add_ref(self, *args):
        return self._get_func('sp_inbox_add_ref', ctypes.c_int,
                              ctypes.c_void_p)(*args)

    def release(self, *args):
        return self._get_func('sp_inbox_release', ctypes.c_int,
                              ctypes.c_void_p)(*args)
Ejemplo n.º 7
0
import ctypes

#Import handy globals
from _spotify import LibSpotifyInterface, callback, bool_type


#Structure definitions
class callbacks(ctypes.Structure):
    pass


#Callbacks
cb_playlist_added = callback(None, ctypes.c_void_p, ctypes.c_void_p,
                             ctypes.c_int, ctypes.c_void_p)

cb_playlist_removed = callback(None, ctypes.c_void_p, ctypes.c_void_p,
                               ctypes.c_int, ctypes.c_void_p)

cb_playlist_moved = callback(None, ctypes.c_void_p, ctypes.c_void_p,
                             ctypes.c_int, ctypes.c_int, ctypes.c_void_p)

cb_container_loaded = callback(None, ctypes.c_void_p, ctypes.c_void_p)

#Completion of structure defs
callbacks._fields_ = [
    ("playlist_added", cb_playlist_added),
    ("playlist_removed", cb_playlist_removed),
    ("playlist_moved", cb_playlist_moved),
    ("container_loaded", cb_container_loaded),
]
Ejemplo n.º 8
0
import ctypes

#Import handy globals
from _spotify import LibSpotifyInterface, callback, bool_type

#Callbacks
search_complete_cb = callback(None, ctypes.c_void_p, ctypes.c_void_p)


class SearchInterface(LibSpotifyInterface):
    def __init__(self):
        LibSpotifyInterface.__init__(self)

    def create(self, *args):
        return self._get_func('sp_search_create', ctypes.c_void_p,
                              ctypes.c_void_p, ctypes.c_char_p, ctypes.c_int,
                              ctypes.c_int, ctypes.c_int, ctypes.c_int,
                              ctypes.c_int, ctypes.c_int, ctypes.c_int,
                              ctypes.c_int, ctypes.c_int, search_complete_cb,
                              ctypes.c_void_p)(*args)

    def is_loaded(self, *args):
        return self._get_func('sp_search_is_loaded', bool_type,
                              ctypes.c_void_p)(*args)

    def error(self, *args):
        return self._get_func('sp_search_error', ctypes.c_int,
                              ctypes.c_void_p)(*args)

    def num_tracks(self, *args):
        return self._get_func('sp_search_num_tracks', ctypes.c_int,
Ejemplo n.º 9
0
import ctypes

#Import handy globals
from _spotify import LibSpotifyInterface, callback, subscribers as _subscribers, bool_type


#Structure definitions
class callbacks(ctypes.Structure):
    pass


#Callbacks
cb_tracks_added = callback(None, ctypes.c_void_p, ctypes.c_void_p,
                           ctypes.c_int, ctypes.c_int, ctypes.c_void_p)

cb_tracks_removed = callback(None, ctypes.c_void_p,
                             ctypes.POINTER(ctypes.c_int), ctypes.c_int,
                             ctypes.c_void_p)

cb_tracks_moved = callback(None, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int),
                           ctypes.c_int, ctypes.c_int, ctypes.c_void_p)

cb_playlist_renamed = callback(None, ctypes.c_void_p, ctypes.c_void_p)
cb_playlist_state_changed = callback(None, ctypes.c_void_p, ctypes.c_void_p)

cb_playlist_update_in_progress = callback(None, ctypes.c_void_p, bool_type,
                                          ctypes.c_void_p)

cb_playlist_metadata_updated = callback(None, ctypes.c_void_p, ctypes.c_void_p)

cb_track_created_changed = callback(None, ctypes.c_void_p, ctypes.c_int,
Ejemplo n.º 10
0
import ctypes

#Import handy globals
from _spotify import LibSpotifyInterface, callback, bool_type

#Callbacks
toplistbrowse_complete_cb = callback(None, ctypes.c_void_p, ctypes.c_void_p)


class ToplistBrowseInterface(LibSpotifyInterface):
    def __init__(self):
        LibSpotifyInterface.__init__(self)

    def create(self, *args):
        return self._get_func('sp_toplistbrowse_create', ctypes.c_void_p,
                              ctypes.c_void_p, ctypes.c_int, ctypes.c_int,
                              ctypes.c_char_p, toplistbrowse_complete_cb,
                              ctypes.c_void_p)(*args)

    def is_loaded(self, *args):
        return self._get_func('sp_toplistbrowse_is_loaded', bool_type,
                              ctypes.c_void_p)(*args)

    def error(self, *args):
        return self._get_func('sp_toplistbrowse_error', ctypes.c_int,
                              ctypes.c_void_p)(*args)

    def add_ref(self, *args):
        return self._get_func('sp_toplistbrowse_add_ref', ctypes.c_int,
                              ctypes.c_void_p)(*args)
Ejemplo n.º 11
0
import ctypes

# Import handy globals
from _spotify import LibSpotifyInterface, callback, subscribers as _subscribers, bool_type


# Structure definitions
class callbacks(ctypes.Structure):
    pass


# Callbacks
cb_tracks_added = callback(None, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_int, ctypes.c_void_p)

cb_tracks_removed = callback(None, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int), ctypes.c_int, ctypes.c_void_p)

cb_tracks_moved = callback(
    None, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int), ctypes.c_int, ctypes.c_int, ctypes.c_void_p
)

cb_playlist_renamed = callback(None, ctypes.c_void_p, ctypes.c_void_p)
cb_playlist_state_changed = callback(None, ctypes.c_void_p, ctypes.c_void_p)

cb_playlist_update_in_progress = callback(None, ctypes.c_void_p, bool_type, ctypes.c_void_p)

cb_playlist_metadata_updated = callback(None, ctypes.c_void_p, ctypes.c_void_p)

cb_track_created_changed = callback(None, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p)

cb_track_seen_changed = callback(None, ctypes.c_void_p, ctypes.c_int, bool_type, ctypes.c_void_p)
Ejemplo n.º 12
0
import ctypes

#Import handy globals
from _spotify import LibSpotifyInterface, callback


#Callbacks
inboxpost_complete_cb = callback(None, ctypes.c_void_p, ctypes.c_void_p)



class InboxInterface(LibSpotifyInterface):
    def __init__(self):
        LibSpotifyInterface.__init__(self)


    def post_tracks(self, *args):
        return self._get_func(
            'sp_inbox_post_tracks',
            ctypes.c_void_p,
            ctypes.c_void_p, ctypes.c_char_p,
            ctypes.POINTER(ctypes.c_void_p), ctypes.c_int, ctypes.c_char_p,
            inboxpost_complete_cb, ctypes.c_void_p
        )(*args)


    def error(self, *args):
        return self._get_func(
            'sp_inbox_error',
            ctypes.c_int,
            ctypes.c_void_p