예제 #1
0
    def track(self, index):
        track_struct = self.__toplistbrowse_interface.track(
            self.__toplistbrowse_struct, index)

        if track_struct is not None:
            ti = _track.TrackInterface()
            ti.add_ref(track_struct)
            return track.Track(track_struct)
예제 #2
0
 def track(self, index):
     #Increment the refcount so it doesn't get stolen from us
     track_struct = self.__albumbrowse_interface.track(self.__albumbrowse_struct, index)
     
     if track_struct is not None:
         ti = _track.TrackInterface()
         ti.add_ref(track_struct)
         return track.Track(track_struct)
예제 #3
0
    def get_unseen_tracks(self, playlist):
        max_tracks = 100
        track_arr = (ctypes.c_void_p * len(max_tracks))()
        num_tracks = self.__container_interface.get_unseen_tracks(
            self.__container_struct, playlist.get_struct(), track_arr,
            max_tracks)

        #Build the track object array from the struct
        out_tracks = []

        if num_tracks > 0:
            for index in range(num_tracks):
                out_tracks.append(track.Track(track_arr[index]))

        return out_tracks
예제 #4
0
def create(artist, title, album, length):
    lti = _localtrack.LocalTrackInterface()
    return track.Track(
        lti.create(artist, title, album, length)
    )