def insert(self, index, gfile, gain=1.0, peak=1.0): # TODO: handle index error like list does next_obj = self[index]._obj lib.groove_playlist_insert(self._obj, gfile._obj, gain, peak, next_obj)
def append(self, gfile, gain=1.0, peak=1.0): # TODO: better error handling new_item = lib.groove_playlist_insert(self._obj, gfile._obj, gain, peak, ffi.NULL) assert new_item != ffi.NULL, "Out of Memory"
def __setitem__(self, index, value): remove_obj = self[index]._obj lib.groove_playlist_insert(self._obj, value._obj, 1.0, 1.0, remove_obj) lib.groove_playlist_remove(self._obj, remove_obj)