~ubuntu-branches/ubuntu/wily/xmms2/wily

« back to all changes in this revision

Viewing changes to src/clients/lib/python/xmmsapi.pyx

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2008-05-29 10:14:25 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080529101425-ycw1nbd980uhvzfp
Tags: 0.4DrKosmos-4ubuntu1
* Merge from debian unstable (LP: #178477), remaining changes:
  - debian/control: Update Maintainer field
  - debian/control: add lpia to xmms2-plugin-alsa supported architectures
* This version reads AAC files (LP: #156359)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
        void Py_DECREF(object)
15
15
 
16
16
cdef extern from "string.h":
17
 
        int strcmp(signed char *s1, signed char *s2)
 
17
        int strcmp(char *s1, char *s2)
18
18
        char *strdup(char *str)
19
19
 
20
20
cdef extern from "xmmsc/xmmsc_idnumbers.h":
68
68
                XMMS_PLAYLIST_CHANGED_REMOVE,
69
69
                XMMS_PLAYLIST_CHANGED_CLEAR,
70
70
                XMMS_PLAYLIST_CHANGED_MOVE,
71
 
                XMMS_PLAYLIST_CHANGED_SORT
 
71
                XMMS_PLAYLIST_CHANGED_SORT,
 
72
                XMMS_PLAYLIST_CHANGED_UPDATE
72
73
 
73
74
        ctypedef enum xmms_plugin_type_t:
74
75
                XMMS_PLUGIN_TYPE_ALL,
94
95
PLAYLIST_CHANGED_CLEAR = XMMS_PLAYLIST_CHANGED_CLEAR
95
96
PLAYLIST_CHANGED_MOVE = XMMS_PLAYLIST_CHANGED_MOVE
96
97
PLAYLIST_CHANGED_SORT = XMMS_PLAYLIST_CHANGED_SORT
 
98
PLAYLIST_CHANGED_UPDATE = XMMS_PLAYLIST_CHANGED_UPDATE
97
99
 
98
100
PLUGIN_TYPE_ALL = XMMS_PLUGIN_TYPE_ALL
99
101
PLUGIN_TYPE_XFORM = XMMS_PLUGIN_TYPE_XFORM
129
131
        void xmmsc_result_unref(xmmsc_result_t *res)
130
132
        void xmmsc_result_notifier_set_full(xmmsc_result_t *res, xmmsc_result_notifier_t func, void *user_data, xmmsc_user_data_free_func_t free_func)
131
133
        void xmmsc_result_wait(xmmsc_result_t *res)
132
 
        signed int xmmsc_result_iserror(xmmsc_result_t *res)
133
 
        signed char *xmmsc_result_get_error(xmmsc_result_t *res)
 
134
        int xmmsc_result_iserror(xmmsc_result_t *res)
 
135
        char *xmmsc_result_get_error(xmmsc_result_t *res)
134
136
        xmmsc_result_value_type_t xmmsc_result_get_type(xmmsc_result_t *res)
135
137
        xmmsc_result_type_t xmmsc_result_get_class(xmmsc_result_t *res)
136
138
 
137
 
        signed int xmmsc_result_get_int(xmmsc_result_t *res, int *r)
138
 
        signed int xmmsc_result_get_uint(xmmsc_result_t *res, unsigned int *r)
139
 
        signed int xmmsc_result_get_string(xmmsc_result_t *res, signed char **r)
140
 
        signed int xmmsc_result_get_bin(xmmsc_result_t *res, unsigned char **r, unsigned int *rlen)
141
 
        signed int xmmsc_result_get_playlist_change(xmmsc_result_t *res, unsigned int *change, unsigned int *id, unsigned int *argument)
142
 
        signed int xmmsc_result_get_collection (xmmsc_result_t *conn, xmmsc_coll_t **coll)
 
139
        int xmmsc_result_get_int(xmmsc_result_t *res, int *r)
 
140
        int xmmsc_result_get_uint(xmmsc_result_t *res, unsigned int *r)
 
141
        int xmmsc_result_get_string(xmmsc_result_t *res, char **r)
 
142
        int xmmsc_result_get_bin(xmmsc_result_t *res, unsigned char **r, unsigned int *rlen)
 
143
        int xmmsc_result_get_playlist_change(xmmsc_result_t *res, unsigned int *change, unsigned int *id, unsigned int *argument)
 
144
        int xmmsc_result_get_collection (xmmsc_result_t *conn, xmmsc_coll_t **coll)
143
145
 
144
146
        ctypedef void(*xmmsc_dict_foreach_func)(void *key, xmmsc_result_value_type_t type, void *value, void *user_data)
145
147
        ctypedef void(*xmmsc_propdict_foreach_func)(void *key, xmmsc_result_value_type_t type, void *value, char *source, void *user_data)
155
157
 
156
158
        xmmsc_connection_t *xmmsc_init(char *clientname)
157
159
        void xmmsc_disconnect_callback_set(xmmsc_connection_t *c, object(*callback)(object), object userdata)
158
 
        signed int xmmsc_connect(xmmsc_connection_t *c, signed char *p)
 
160
        int xmmsc_connect(xmmsc_connection_t *c, char *p)
159
161
        void xmmsc_unref(xmmsc_connection_t *c)
160
162
        xmmsc_result_t *xmmsc_quit(xmmsc_connection_t *conn)
161
163
        xmmsc_result_t *xmmsc_plugin_list (xmmsc_connection_t *c, unsigned int type)
162
164
 
163
165
        void xmmsc_result_disconnect(xmmsc_result_t *res)
164
166
 
 
167
        int xmmsc_coll_parse (char *pattern, xmmsc_coll_t **coll)
 
168
 
165
169
        xmmsc_result_t *xmmsc_playlist_list(xmmsc_connection_t *)
166
170
        xmmsc_result_t *xmmsc_playlist_shuffle(xmmsc_connection_t *, char *playlist)
167
171
        xmmsc_result_t *xmmsc_playlist_add_args(xmmsc_connection_t *, char *playlist, char *, int, char **)
175
179
        xmmsc_result_t *xmmsc_playlist_list_entries(xmmsc_connection_t *, char *playlist)
176
180
        xmmsc_result_t *xmmsc_playlist_sort(xmmsc_connection_t *, char *playlist, char **properties)
177
181
        xmmsc_result_t *xmmsc_playlist_set_next(xmmsc_connection_t *, int pos)
178
 
        xmmsc_result_t *xmmsc_playlist_set_next_rel(xmmsc_connection_t *, signed int)
179
 
        xmmsc_result_t *xmmsc_playlist_move_entry(xmmsc_connection_t *, char *playlist, unsigned int id, signed int movement)
 
182
        xmmsc_result_t *xmmsc_playlist_set_next_rel(xmmsc_connection_t *, int)
 
183
        xmmsc_result_t *xmmsc_playlist_move_entry(xmmsc_connection_t *, char *playlist, unsigned int id, int movement)
180
184
        xmmsc_result_t *xmmsc_playlist_current_pos(xmmsc_connection_t *, char *playlist)
181
185
        xmmsc_result_t *xmmsc_playlist_current_active(xmmsc_connection_t *)
182
186
        xmmsc_result_t *xmmsc_playlist_insert_args(xmmsc_connection_t *, char *playlist, int pos, char *url, int numargs, char **args)
188
192
        xmmsc_result_t *xmmsc_playlist_radd_encoded(xmmsc_connection_t *c, char *, char *path)
189
193
 
190
194
        xmmsc_result_t *xmmsc_playlist_load(xmmsc_connection_t *, char *playlist)
191
 
        xmmsc_result_t *xmmsc_playlist_move(xmmsc_connection_t *c, unsigned int id, signed int movement)
 
195
        xmmsc_result_t *xmmsc_playlist_move(xmmsc_connection_t *c, unsigned int id, int movement)
192
196
        xmmsc_result_t *xmmsc_playlist_create(xmmsc_connection_t *c, char *playlist)
193
197
 
194
198
        xmmsc_result_t *xmmsc_broadcast_playlist_changed(xmmsc_connection_t *c)
225
229
 
226
230
        xmmsc_result_t *xmmsc_medialib_playlist_load(xmmsc_connection_t *conn, char *name)
227
231
        xmmsc_result_t *xmmsc_medialib_add_entry(xmmsc_connection_t *conn, char *url)
 
232
        xmmsc_result_t *xmmsc_medialib_remove_entry(xmmsc_connection_t *conn, unsigned int id)
228
233
        xmmsc_result_t *xmmsc_medialib_add_entry_encoded(xmmsc_connection_t *conn, char *url)
229
234
        xmmsc_result_t *xmmsc_medialib_get_info(xmmsc_connection_t *, unsigned int id)
230
235
        xmmsc_result_t *xmmsc_medialib_path_import (xmmsc_connection_t *c, char *path)
357
362
                        i = i + 1
358
363
                free(self.lst) 
359
364
 
360
 
cdef foreach_source_hash(signed char *key, xmmsc_result_value_type_t typ, void *value, char *source, udata):
 
365
cdef foreach_source_hash(char *key, xmmsc_result_value_type_t typ, void *value, char *source, udata):
361
366
        if typ == XMMSC_RESULT_VALUE_TYPE_STRING:
362
367
                v = to_unicode(<char *>value)
363
368
        elif typ == XMMSC_RESULT_VALUE_TYPE_UINT32:
367
372
 
368
373
        udata[(source,key)]=v
369
374
 
370
 
cdef foreach_hash(signed char *key, xmmsc_result_value_type_t typ, void *value, udata):
 
375
cdef foreach_hash(char *key, xmmsc_result_value_type_t typ, void *value, udata):
371
376
        if typ == XMMSC_RESULT_VALUE_TYPE_STRING:
372
377
                v = to_unicode(<char *>value)
373
378
        elif typ == XMMSC_RESULT_VALUE_TYPE_UINT32:
428
433
 
429
434
        def __repr__(self):
430
435
                atr = []
431
 
                for k,v in self.attributes:
 
436
                for k,v in self.attributes.iteritems():
432
437
                        atr.append("%s=%s" % (k, repr(v)))
433
438
                return "%s(%s)" % (self.__class__.__name__,",".join(atr))
434
439
 
519
524
                if self.coll != NULL:
520
525
                        xmmsc_coll_unref(self.coll)
521
526
                self.coll = NULL
 
527
        def __repr__(self):
 
528
                return repr(self.pylist)
 
529
        def __str__(self):
 
530
                return str(self.pylist)
522
531
        def __len__(self):
523
532
                return len(self.pylist)
524
533
        def __getitem__(self, i):
538
547
        
539
548
cdef class CollectionAttributes:
540
549
        cdef xmmsc_coll_t *coll
 
550
        cdef object pydict
541
551
 
542
552
        def __new__(self):
543
553
                self.coll = NULL
 
554
 
544
555
        def __dealloc__(self):
545
556
                if self.coll != NULL:
546
557
                        xmmsc_coll_unref(self.coll)
547
558
                self.coll = NULL
548
559
 
 
560
        def _py_dict(self):
 
561
                cdef char *x
 
562
                cdef char *y
 
563
                dct = {}
 
564
                xmmsc_coll_attribute_list_first(self.coll)
 
565
                while xmmsc_coll_attribute_list_valid(self.coll):
 
566
                        xmmsc_coll_attribute_list_entry(self.coll, &x, &y)
 
567
                        dct[x] = y
 
568
                        xmmsc_coll_attribute_list_next(self.coll)
 
569
                return dct
 
570
 
 
571
        def __repr__(self):
 
572
                return repr(self._py_dict())
 
573
 
 
574
        def __str__(self):
 
575
                return str(self._py_dict())
 
576
 
549
577
        def __getitem__(self, name):
550
 
                cdef char *val
551
 
                if not xmmsc_coll_attribute_get(self.coll, name, &val):
552
 
                        raise KeyError("No such attribute")
553
 
                ret = val
 
578
                ret = self._py_dict()[name]
554
579
                return ret
555
580
 
556
581
        def get(self, name, default=None):
563
588
                xmmsc_coll_attribute_set(self.coll, name, val)
564
589
 
565
590
        def items(self):
566
 
                cdef char *x
567
 
                cdef char *y
568
 
                lst = []
569
 
                xmmsc_coll_attribute_list_first(self.coll)
570
 
                while xmmsc_coll_attribute_list_valid(self.coll):
571
 
                        xmmsc_coll_attribute_list_entry(self.coll, &x, &y)
572
 
                        lst.append((x,y))
573
 
                        xmmsc_coll_attribute_list_next(self.coll)
574
 
                return lst
 
591
                return self._py_dict().items()
575
592
        
 
593
        def iteritems(self):
 
594
                return self._py_dict().iteritems()
 
595
 
 
596
        def keys(self):
 
597
                return self._py_dict().keys()
 
598
 
 
599
        def iterkeys(self):
 
600
                return self._py_dict().iterkeys()
 
601
 
 
602
        def values(self):
 
603
                return self._py_dict().values()
 
604
 
 
605
        def itervalues(self):
 
606
                return self._py_dict().itervalues()
 
607
 
576
608
        def __iter__(self):
577
 
                return iter(self.items())
578
 
        def __repr__(self):
579
 
                return repr(self.items())
 
609
                return iter(self._py_dict())
580
610
 
581
611
 
582
612
# Create a dummy object that can't be accessed
761
791
        xmmsc_coll_operand_list_first(coll)
762
792
        while xmmsc_coll_operand_list_valid(coll):
763
793
                xmmsc_coll_operand_list_entry(coll, &ocoll)
 
794
                xmmsc_coll_ref(ocoll)
764
795
                opr.pylist.append(create_coll(ocoll))
765
796
                xmmsc_coll_operand_list_next(coll)
766
797
        xmmsc_coll_ref(coll)
768
799
        
769
800
        return c
770
801
 
 
802
def coll_parse(pattern):
 
803
        cdef xmmsc_coll_t *coll
 
804
 
 
805
        ptrn = from_unicode(pattern)
 
806
        if not xmmsc_coll_parse(ptrn, &coll):
 
807
                raise ValueError('unable to parse pattern')
 
808
        return create_coll(coll)
 
809
 
771
810
cdef class XMMSResult:
772
811
        """
773
812
        Class containing the results of some operation
786
825
 
787
826
        def more_init(self, broadcast = 0):
788
827
                self.broadcast = broadcast
789
 
                Py_INCREF(self)
790
 
                xmmsc_result_notifier_set_full(self.res, ResultNotifier, <void *>self, ResultFreeer)
 
828
                if self.callback:
 
829
                        Py_INCREF(self)
 
830
                        xmmsc_result_notifier_set_full(self.res, ResultNotifier, <void *>self, ResultFreeer)
 
831
                        xmmsc_result_unref(self.res)
791
832
 
792
833
        def _cb(self):
793
834
                cdef xmmsc_result_t *r
874
915
                Get data from the result structure as an int.
875
916
                @rtype: int
876
917
                """
877
 
                cdef signed int ret
 
918
                cdef int ret
878
919
                self._check()
879
920
                if xmmsc_result_get_int(self.res, &ret):
880
921
                        return ret
898
939
                Get data from the result structure as a string.
899
940
                @rtype: string
900
941
                """
901
 
                cdef signed char *ret
 
942
                cdef char *ret
902
943
 
903
944
                self._check()
904
945
                if xmmsc_result_get_string(self.res, &ret):
1060
1101
                        self.disconnect_fun(self)
1061
1102
 
1062
1103
        def exit_loop(self):
1063
 
                """ Exits from the L{loop} call """
 
1104
                """
 
1105
                exit_loop()
 
1106
 
 
1107
                Exits from the L{loop} call
 
1108
        """
1064
1109
                self.do_loop = False
1065
1110
                write(self.wakeup, "42")
1066
1111
 
1067
1112
        def loop(self):
1068
1113
                """
 
1114
                loop()
 
1115
 
1069
1116
                Main client loop for most python clients. Call this to run the
1070
1117
                client once everything has been set up. This function blocks
1071
1118
                until L{exit_loop} is called.
1095
1142
 
1096
1143
        def ioin(self):
1097
1144
                """
 
1145
                ioin() -> bool
 
1146
 
1098
1147
                Read data from the daemon, when available. Note: This is a low
1099
1148
                level function that should only be used in certain
1100
1149
                circumstances. e.g. a custom event loop
1103
1152
 
1104
1153
        def ioout(self):
1105
1154
                """
 
1155
                ioout() -> bool
 
1156
 
1106
1157
                Write data out to the daemon, when available. Note: This is a
1107
1158
                low level function that should only be used in certain
1108
1159
                circumstances. e.g. a custom event loop
1110
1161
                return xmmsc_io_out_handle(self.conn)
1111
1162
 
1112
1163
        def want_ioout(self):
 
1164
                """
 
1165
                want_ioout() -> bool
 
1166
                """
1113
1167
                return xmmsc_io_want_out(self.conn)
1114
1168
 
1115
1169
        def set_need_out_fun(self, fun):
 
1170
                """
 
1171
                set_need_out_fun(fun)
 
1172
                """
1116
1173
                xmmsc_io_need_out_callback_set(self.conn, python_need_out_fun, self)
1117
1174
                self.needout_fun = fun
1118
1175
                
1119
1176
        def get_fd(self):
1120
1177
                """
 
1178
                get_fd() -> int
 
1179
 
1121
1180
                Get the underlying file descriptor used for communication with
1122
1181
                the XMMS2 daemon. You can use this in a client to ensure that
1123
1182
                the IPC link is still active and safe to use.(e.g by calling
1129
1188
 
1130
1189
        def connect(self, path = None, disconnect_func = None):
1131
1190
                """
 
1191
                connect([path], [disconnect_func])
 
1192
 
1132
1193
                Connect to the appropriate IPC path, for communication with the
1133
1194
                XMMS2 daemon. This path defaults to /tmp/xmms-ipc-<username> if
1134
1195
                not specified. Call this once you have instantiated the object:
1161
1222
 
1162
1223
        def quit(self, cb = None):
1163
1224
                """
 
1225
                quit([cb]) -> XMMSResult
 
1226
 
1164
1227
                Tell the XMMS2 daemon to quit.
1165
1228
                @rtype: L{XMMSResult}
1166
1229
                @return: The result of the operation.
1177
1240
 
1178
1241
        def plugin_list(self, typ, cb = None):
1179
1242
                """
 
1243
                plugin_list(typ, [cb]) -> XMMSResult
 
1244
 
1180
1245
                Get a list of loaded plugins from the server
1181
1246
                @rtype: L{XMMSResult}
1182
1247
                @return: The result of the operation.
1192
1257
 
1193
1258
        def playback_start(self, cb = None):
1194
1259
                """
 
1260
                playback_start([cb]) -> XMMSResult
 
1261
 
1195
1262
                Instruct the XMMS2 daemon to start playing the currently
1196
1263
                selected file from the playlist.
1197
1264
                @rtype: L{XMMSResult}
1208
1275
 
1209
1276
        def playback_stop(self, cb = None):
1210
1277
                """
 
1278
                playback_stop([cb]) -> XMMSResult
 
1279
 
1211
1280
                Instruct the XMMS2 daemon to stop playing the file
1212
1281
                currently being played.
1213
1282
                @rtype: L{XMMSResult}
1224
1293
 
1225
1294
        def playback_tickle(self, cb = None):
1226
1295
                """
 
1296
                playback_tickle([cb]) -> XMMSResult
 
1297
 
1227
1298
                Instruct the XMMS2 daemon to move on to the next playlist item.
1228
1299
                @rtype: L{XMMSResult}
1229
1300
                @return: The result of the operation.
1239
1310
 
1240
1311
        def playback_pause(self, cb = None):
1241
1312
                """
 
1313
                playback_pause([cb]) -> XMMSResult
 
1314
 
1242
1315
                Instruct the XMMS2 daemon to pause playback.
1243
1316
                @rtype: L{XMMSResult}
1244
1317
                @return: The result of the operation.
1255
1328
 
1256
1329
        def playback_current_id(self, cb = None):
1257
1330
                """
 
1331
                playback_current_id([cb]) -> XMMSResult
 
1332
 
1258
1333
                @rtype: L{XMMSResult}(UInt)
1259
1334
                @return: The medialib id of the item currently selected.
1260
1335
                """
1270
1345
 
1271
1346
        def playback_seek_ms(self, ms, cb = None):
1272
1347
                """
 
1348
                playback_seek_ms(ms, [cb]) -> XMMSResult
 
1349
 
1273
1350
                Seek to an absolute time position in the current file or
1274
1351
                stream in playback.
1275
1352
                @rtype: L{XMMSResult}
1287
1364
 
1288
1365
        def playback_seek_ms_rel(self, ms, cb = None):
1289
1366
                """
 
1367
                playback_seek_ms_rel(ms, [cb]) -> XMMSResult
 
1368
 
1290
1369
                Seek to a time position by the given offset in the current file or
1291
1370
                stream in playback.
1292
1371
                @rtype: L{XMMSResult}
1304
1383
 
1305
1384
        def playback_seek_samples(self, samples, cb = None):
1306
1385
                """
 
1386
                playback_seek_samples(samples, [cb]) -> XMMSResult
 
1387
 
1307
1388
                Seek to an absolute number of samples in the current file or
1308
1389
                stream in playback.
1309
1390
                @rtype: L{XMMSResult}
1321
1402
 
1322
1403
        def playback_seek_samples_rel(self, samples, cb = None):
1323
1404
                """
 
1405
                playback_seek_samples_rel(samples, [cb]) -> XMMSResult
 
1406
 
1324
1407
                Seek to a number of samples by the given offset in the
1325
1408
                current file or stream in playback.
1326
1409
                @rtype: L{XMMSResult}
1337
1420
                return ret
1338
1421
 
1339
1422
        def playback_status(self, cb = None):
1340
 
                """Get current playback status from XMMS2 daemon. This is
 
1423
                """
 
1424
                playback_status([cb]) -> XMMSResult
 
1425
 
 
1426
                Get current playback status from XMMS2 daemon. This is
1341
1427
                essentially the more direct version of
1342
1428
                L{broadcast_playback_status}. Possible return values are:
1343
1429
                L{PLAYBACK_STATUS_STOP}, L{PLAYBACK_STATUS_PLAY},
1354
1440
 
1355
1441
        def broadcast_playback_status(self, cb = None):
1356
1442
                """
 
1443
                broadcast_playback_status([cb]) -> XMMSResult
 
1444
 
1357
1445
                Set a method to handle the playback status broadcast from the
1358
1446
                XMMS2 daemon.
1359
1447
                @rtype: L{XMMSResult}(UInt)
1370
1458
 
1371
1459
        def broadcast_playback_current_id(self, cb = None):
1372
1460
                """
 
1461
                broadcast_playback_current_id([cb]) -> XMMSResult
 
1462
 
1373
1463
                Set a method to handle the playback id broadcast from the
1374
1464
                XMMS2 daemon.
1375
1465
                @rtype: L{XMMSResult}(UInt)
1386
1476
 
1387
1477
        def playback_playtime(self, cb = None):
1388
1478
                """
 
1479
                playback_playtime([cb]) -> XMMSResult
 
1480
 
1389
1481
                Return playtime on current file/stream. This is essentially a
1390
1482
                more direct version of L{signal_playback_playtime}
1391
1483
                @rtype: L{XMMSResult}(UInt)
1403
1495
 
1404
1496
        def signal_playback_playtime(self, cb = None):
1405
1497
                """
 
1498
                signal_playback_playtime([cb]) -> XMMSResult
 
1499
 
1406
1500
                Set a method to handle the playback playtime signal from the
1407
1501
                XMMS2 daemon.
1408
1502
                @rtype: L{XMMSResult}(UInt)
1419
1513
 
1420
1514
        def playback_volume_set(self, channel, volume, cb = None):
1421
1515
                """
 
1516
                playback_volume_set(channel, volume, [cb]) -> XMMSResult
 
1517
 
1422
1518
                Set the playback volume for specified channel
1423
1519
                @rtype: L{XMMSResult}(UInt)
1424
1520
                """
1434
1530
 
1435
1531
        def playback_volume_get(self, cb = None):
1436
1532
                """
 
1533
                playback_volume_get([cb]) -> XMMSResult
 
1534
 
1437
1535
                Get the playback for all channels
1438
1536
                @rtype: L{XMMSResult}(UInt)
1439
1537
                """
1449
1547
 
1450
1548
        def broadcast_playback_volume_changed(self, cb = None):
1451
1549
                """
 
1550
                broadcast_playback_volume_changed([cb]) -> XMMSResult
 
1551
 
1452
1552
                Set a broadcast callback for volume updates
1453
1553
                @rtype: L{XMMSResult}(UInt)
1454
1554
                """
1464
1564
 
1465
1565
        def broadcast_playlist_loaded(self, cb = None):
1466
1566
                """
 
1567
                broadcast_playlist_loaded([cb]) -> XMMSResult
 
1568
 
1467
1569
                Set a broadcast callback for loaded playlist event
1468
1570
                @rtype: L{XMMSResult}(UInt)
1469
1571
                """
1479
1581
 
1480
1582
        def playlist_load(self, playlist = None, cb = None):
1481
1583
                """
 
1584
                playlist_load([playlist], [cb]) -> XMMSResult
 
1585
 
1482
1586
                Load the playlist as current playlist
1483
1587
                @rtype: L{XMMSResult}
1484
1588
                @return: The result of the operation.
1501
1605
 
1502
1606
        def playlist_list(self, cb = None):
1503
1607
                """
 
1608
                playlist_list([cb]) -> XMMSResult
 
1609
 
1504
1610
                Lists the playlists
1505
1611
                @rtype: L{XMMSResult}
1506
1612
                @return: The result of the operation.
1518
1624
 
1519
1625
        def playlist_remove(self, playlist = None, cb = None):
1520
1626
                """
 
1627
                playlist_remove([playlist], [cb]) -> XMMSResult
 
1628
 
1521
1629
                Remove the playlist from the server
1522
1630
                @rtype: L{XMMSResult}
1523
1631
                @return: The result of the operation.
1539
1647
 
1540
1648
        def playlist_shuffle(self, playlist = None, cb = None):
1541
1649
                """
 
1650
                playlist_shuffle([playlist], [cb]) -> XMMSResult
 
1651
 
1542
1652
                Instruct the XMMS2 daemon to shuffle the playlist.
1543
1653
                @rtype: L{XMMSResult}
1544
1654
                @return: The result of the operation.
1560
1670
 
1561
1671
        def playlist_insert_url(self, pos, url, playlist = None, cb = None):
1562
1672
                """
 
1673
                playlist_insert_url(pos, url, [playlist], [cb]) -> XMMSResult
 
1674
 
1563
1675
                Insert a path or URL to a playable media item to the playlist.
1564
1676
                Playable media items may be files or streams.
1565
1677
                Requires an int 'pos' and a string 'url' as argument.
1585
1697
 
1586
1698
        def playlist_insert_encoded(self, pos, url, playlist = None, cb = None):
1587
1699
                """
 
1700
                playlist_insert_encoded(pos, url, [playlist], [cb]) -> XMMSResult
 
1701
 
1588
1702
                Insert a path or URL to a playable media item to the playlist.
1589
1703
                Playable media items may be files or streams.
1590
1704
                Requires an int 'pos' and a string 'url' as argument.
1613
1727
 
1614
1728
        def playlist_insert_id(self, pos, id, playlist = None, cb = None):
1615
1729
                """
 
1730
                playlist_insert_id(pos, id, [playlist], [cb]) -> XMMSResult
 
1731
 
1616
1732
                Insert a medialib to the playlist.
1617
1733
                Requires an int 'pos' and an int 'id' as argument.
1618
1734
                @rtype: L{XMMSResult}
1633
1749
                
1634
1750
                return ret
1635
1751
 
 
1752
 
 
1753
        def playlist_insert_collection(self, pos, coll, order = None, playlist = None, cb = None):
 
1754
                """
 
1755
                playlist_insert_collection(pos, coll, [order], [playlist], [cb]) -> XMMSResult
 
1756
 
 
1757
                Insert the content of a collection to the playlist.
 
1758
                Requires an int 'pos' and an int 'id' as argument.
 
1759
                @rtype: L{XMMSResult}
 
1760
                @return: The result of the operation.
 
1761
                """
 
1762
                cdef XMMSResult ret
 
1763
                cdef Collection c
 
1764
                cdef _ListConverter orderflds
 
1765
 
 
1766
                if order is None:
 
1767
                        order = []
 
1768
 
 
1769
                orderflds = _ListConverter(order)
 
1770
 
 
1771
                c = <Collection> coll
 
1772
                ret = XMMSResult(self)
 
1773
                ret.callback = cb
 
1774
 
 
1775
                if playlist is not None:
 
1776
                        pl = from_unicode(playlist)
 
1777
                        ret.res = xmmsc_playlist_insert_collection(self.conn, pl, pos, c.coll, orderflds.lst)
 
1778
                else:
 
1779
                        ret.res = xmmsc_playlist_insert_collection(self.conn, NULL, pos, c.coll, orderflds.lst)
 
1780
 
 
1781
                ret.more_init()
 
1782
 
 
1783
                return ret
 
1784
 
1636
1785
        def playlist_radd(self, url, playlist = None, cb = None):
1637
1786
                """
 
1787
                playlist_radd(url, [playlist], [cb]) -> XMMSResult
 
1788
 
1638
1789
                Add a directory to the playlist.
1639
1790
                Requires a string 'url' as argument.
1640
1791
                @rtype: L{XMMSResult}
1658
1809
 
1659
1810
        def playlist_radd_encoded(self, url, playlist = None, cb = None):
1660
1811
                """
 
1812
                playlist_radd_encoded(url, [playlist], [cb]) -> XMMSResult
 
1813
 
1661
1814
                Add a directory to the playlist.
1662
1815
                Requires a string 'url' as argument.
1663
1816
                'url' argument has to be medialib encoded.
1682
1835
 
1683
1836
        def playlist_add_url(self, url, playlist = None, cb = None):
1684
1837
                """
 
1838
                playlist_add_url(url, [playlist], [cb]) -> XMMSResult
 
1839
 
1685
1840
                Add a path or URL to a playable media item to the playlist.
1686
1841
                Playable media items may be files or streams.
1687
1842
                Requires a string 'url' as argument.
1706
1861
 
1707
1862
        def playlist_add_encoded(self, url, playlist = None, cb = None):
1708
1863
                """
 
1864
                playlist_add_encoded(url, [playlist], [cb]) -> XMMSResult
 
1865
 
1709
1866
                Add a path or URL to a playable media item to the playlist.
1710
1867
                Playable media items may be files or streams.
1711
1868
                The 'url' has to be medialib encoded.
1732
1889
 
1733
1890
        def playlist_add_id(self, id, playlist = None, cb = None):
1734
1891
                """
 
1892
                playlist_add_id(id, [playlist], [cb]) -> XMMSResult
 
1893
 
1735
1894
                Add a medialib id to the playlist.
1736
1895
                @rtype: L{XMMSResult}
1737
1896
                @return: The result of the operation.
1752
1911
                return ret
1753
1912
 
1754
1913
 
 
1914
        def playlist_add_collection(self, coll, order = None, playlist = None, cb = None):
 
1915
                """
 
1916
                playlist_add_collection(coll, [order], [playlist], [cb]) -> XMMSResult
 
1917
 
 
1918
                Add the content of a collection to the playlist.
 
1919
                @rtype: L{XMMSResult}
 
1920
                @return: The result of the operation.
 
1921
                """
 
1922
                cdef XMMSResult ret
 
1923
                cdef Collection c
 
1924
                cdef _ListConverter orderflds
 
1925
 
 
1926
                if order is None:
 
1927
                        order = []
 
1928
 
 
1929
                orderflds = _ListConverter(order)
 
1930
 
 
1931
                c = <Collection> coll
 
1932
                ret = XMMSResult(self)
 
1933
                ret.callback = cb
 
1934
 
 
1935
                if playlist is not None:
 
1936
                        pl = from_unicode(playlist)
 
1937
                        ret.res = xmmsc_playlist_add_collection(self.conn, pl, c.coll, orderflds.lst)
 
1938
                else:
 
1939
                        ret.res = xmmsc_playlist_add_collection(self.conn, NULL, c.coll, orderflds.lst)
 
1940
 
 
1941
                ret.more_init()
 
1942
 
 
1943
                return ret
 
1944
 
 
1945
 
1755
1946
        def playlist_remove_entry(self, id, playlist = None, cb = None):
1756
1947
                """
 
1948
                playlist_remove_entry(id, [playlist], [cb]) -> XMMSResult
 
1949
 
1757
1950
                Remove a certain media item from the playlist.
1758
1951
                Requires a number 'id' as argument.
1759
1952
                @rtype: L{XMMSResult}
1776
1969
 
1777
1970
        def playlist_clear(self, playlist = None, cb = None):
1778
1971
                """
 
1972
                playlist_clear([playlist], [cb]) -> XMMSResult
 
1973
 
1779
1974
                Clear the playlist.
1780
1975
                @rtype: L{XMMSResult}
1781
1976
                @return: The result of the operation.
1796
1991
 
1797
1992
        def playlist_list_entries(self, playlist = None, cb = None):
1798
1993
                """
 
1994
                playlist_list_entries([playlist], [cb]) -> XMMSResult
 
1995
 
1799
1996
                Get the current playlist. This function returns a list of IDs
1800
1997
                of the files/streams currently in the playlist. Use
1801
1998
                L{medialib_get_info} to retrieve more specific information.
1820
2017
 
1821
2018
        def playlist_sort(self, props, playlist = None, cb = None):
1822
2019
                """
 
2020
                playlist_sort(props, [playlist], [cb]) -> XMMSResult
 
2021
 
1823
2022
                Sorts the playlist according to the properties specified.
1824
2023
                @rtype: L{XMMSResult}
1825
2024
                @return: The result of the operation.
1843
2042
 
1844
2043
        def playlist_set_next_rel(self, position, cb = None):
1845
2044
                """
 
2045
                playlist_set_next_rel(position, [cb]) -> XMMSResult
 
2046
 
1846
2047
                Sets the position in the playlist. Same as L{playlist_set_next}
1847
2048
                but sets the next position relative to the current position.
1848
2049
                You can do set_next_rel(-1) to move backwards for example.
1861
2062
 
1862
2063
        def playlist_set_next(self, position, cb = None):
1863
2064
                """
 
2065
                playlist_set_next(position, [cb]) -> XMMSResult
 
2066
 
1864
2067
                Sets the position to move to, next, in the playlist. Calling
1865
2068
                L{playback_tickle} will perform the jump to that position.
1866
2069
                @rtype: L{XMMSResult}
1877
2080
 
1878
2081
        def playlist_move(self, cur_pos, new_pos, playlist = None, cb = None):
1879
2082
                """
 
2083
                playlist_move(cur_pos, new_pos, [playlist], [cb]) -> XMMSResult
 
2084
 
1880
2085
                Moves a playlist entry to a new position.
1881
2086
                @rtype: L{XMMSResult}
1882
2087
                @return: The result of the operation.
1898
2103
 
1899
2104
        def playlist_create(self, playlist, cb = None):
1900
2105
                """
 
2106
                playlist_create(playlist, [cb]) -> XMMSResult
 
2107
 
1901
2108
                Create a new playlist.
1902
2109
                @rtype: L{XMMSResult}
1903
2110
                @return: The result of the operation.
1916
2123
 
1917
2124
        def playlist_current_pos(self, playlist = None, cb = None):
1918
2125
                """
 
2126
                playlist_current_pos([playlist], [cb]) -> XMMSResult
 
2127
 
1919
2128
                Returns the current position in the playlist. This value will
1920
2129
                always be equal to, or larger than 0. The first entry in the
1921
2130
                list is 0.
1937
2146
 
1938
2147
        def playlist_current_active(self, cb = None):
1939
2148
                """
 
2149
                playlist_current_active([cb]) -> XMMSResult
 
2150
 
1940
2151
                Returns the name of the current active playlist
1941
2152
                @rtype: L{XMMSResult}
1942
2153
                """
1952
2163
 
1953
2164
        def broadcast_playlist_current_pos(self, cb = None):
1954
2165
                """
 
2166
                broadcast_playlist_current_pos([cb]) -> XMMSResult
 
2167
 
1955
2168
                Set a method to handle the playlist current position updates
1956
2169
                from the XMMS2 daemon. This is triggered whenever the daemon
1957
2170
                jumps from one playlist position to another. (not when moving
1970
2183
 
1971
2184
        def broadcast_playlist_changed(self, cb = None):
1972
2185
                """
 
2186
                broadcast_playlist_changed([cb]) -> XMMSResult
 
2187
 
1973
2188
                Set a method to handle the playlist changed broadcast from the
1974
2189
                XMMS2 daemon. Updated data is sent whenever the daemon's
1975
2190
                playlist changes.
1987
2202
 
1988
2203
        def broadcast_configval_changed(self, cb = None):
1989
2204
                """
 
2205
                broadcast_configval_changed([cb]) -> XMMSResult
 
2206
 
1990
2207
                Set a method to handle the config value changed broadcast
1991
2208
                from the XMMS2 daemon.(i.e. some configuration value has
1992
2209
                been modified) Updated data is sent whenever a config
2005
2222
 
2006
2223
        def configval_set(self, key, val, cb = None):
2007
2224
                """
 
2225
                configval_set(key, val, [cb]) -> XMMSResult
 
2226
 
2008
2227
                Set a configuration value on the daemon, given a key.
2009
2228
                @rtype: L{XMMSResult}
2010
2229
                @return: The result of the operation.
2023
2242
 
2024
2243
        def configval_get(self, key, cb = None):
2025
2244
                """
 
2245
                configval_get(key, [cb]) -> XMMSResult
 
2246
 
2026
2247
                Get the configuration value of a given key, from the daemon.
2027
2248
                @rtype: L{XMMSResult}(String)
2028
2249
                @return: The result of the operation.
2040
2261
 
2041
2262
        def configval_list(self, cb = None):
2042
2263
                """
 
2264
                configval_list([cb]) -> XMMSResult
 
2265
 
2043
2266
                Get list of configuration keys on the daemon. Use
2044
2267
                L{configval_get} to retrieve the values corresponding to the
2045
2268
                configuration keys.
2057
2280
 
2058
2281
        def configval_register(self, valuename, defaultvalue, cb = None):
2059
2282
                """
 
2283
                configval_register(valuename, defaultvalue, [cb]) -> XMMSResult
 
2284
 
2060
2285
                Register a new configvalue.
2061
2286
                This should be called in the initcode as XMMS2 won't allow
2062
2287
                set/get on values that haven't been registered.
2077
2302
 
2078
2303
        def medialib_add_entry(self, file, cb = None):
2079
2304
                """
 
2305
                medialib_add_entry(file, [cb]) -> XMMSResult
 
2306
 
2080
2307
                Add an entry to the MediaLib.
2081
2308
                @rtype: L{XMMSResult}
2082
2309
                @return: The result of the operation.
2094
2321
 
2095
2322
        def medialib_add_entry_encoded(self, file, cb = None):
2096
2323
                """
 
2324
                medialib_add_entry_encoded(file, [cb]) -> XMMSResult
 
2325
 
2097
2326
                Add an entry to the MediaLib.
2098
2327
                Exactly the same as #medialib_add_entry but takes
2099
2328
                a encoded url instead.
2111
2340
                ret.more_init()
2112
2341
                return ret
2113
2342
 
 
2343
        def medialib_remove_entry(self, id, cb=None):
 
2344
                """
 
2345
                medialib_remove_entry(id, [cb]) -> XMMSResult
 
2346
 
 
2347
                Remove an entry from the medialib.
 
2348
                @rtype: L{XMMSResult}
 
2349
                @return: The result of the operation.
 
2350
                """
 
2351
                cdef XMMSResult ret
 
2352
 
 
2353
                ret = XMMSResult(self)
 
2354
                ret.callback = cb
 
2355
 
 
2356
                ret.res = xmmsc_medialib_remove_entry(self.conn, id)
 
2357
                ret.more_init()
 
2358
                return ret
 
2359
 
2114
2360
        def medialib_get_info(self, id, cb = None):
2115
2361
                """
 
2362
                medialib_get_info(id, [cb]) -> XMMSResult
 
2363
 
2116
2364
                @rtype: L{XMMSResult}(HashTable)
2117
2365
                @return: Information about the medialib entry position
2118
2366
                specified.
2129
2377
 
2130
2378
        def medialib_rehash(self, id = 0, cb = None):
2131
2379
                """
 
2380
                medialib_rehash([id], [cb]) -> XMMSResult
 
2381
 
2132
2382
                Force the medialib to check that metadata stored is up to
2133
2383
                date.
2134
2384
                @rtype: L{XMMSResult}
2146
2396
 
2147
2397
        def medialib_get_id(self, url, cb = None):
2148
2398
                """
 
2399
                medialib_get_id(url, [cb]) -> XMMSResult
 
2400
 
2149
2401
                Search for an entry (URL) in the medialib and return its ID
2150
2402
                number.
2151
2403
                @rtype: L{XMMSResult}
2163
2415
 
2164
2416
        def medialib_path_import(self, path, cb = None):
2165
2417
                """
 
2418
                medialib_path_import(path, [cb]) -> XMMSResult
 
2419
 
2166
2420
                Import metadata from all files recursively from the directory
2167
2421
                passed as argument.
2168
2422
                @rtype: L{XMMSResult}
2182
2436
 
2183
2437
        def medialib_path_import_encoded(self, path, cb = None):
2184
2438
                """
 
2439
                medialib_path_import_encoded(path, [cb]) -> XMMSResult
 
2440
 
2185
2441
                Import metadata from all files recursively from the directory
2186
2442
                passed as argument. The 'path' argument has to be medialib encoded.
2187
2443
                @rtype: L{XMMSResult}
2202
2458
 
2203
2459
        def medialib_property_set(self, id, key, value, source=None, cb=None):
2204
2460
                """
 
2461
                medialib_property_set(id, key, value, [source], [cb]) -> XMMSResult
 
2462
 
2205
2463
                Associate a value with a medialib entry. Source is optional.
2206
2464
                @rtype: L{XMMSResult}
2207
2465
                @return: The result of the operation.
2231
2489
 
2232
2490
        def medialib_property_remove(self, id, key, source=None, cb=None):
2233
2491
                """
 
2492
                medialib_property_remove(id, key, [source], [cb]) -> XMMSResult
 
2493
 
2234
2494
                Remove a value from a medialib entry. Source is optional.
2235
2495
                @rtype: L{XMMSResult}
2236
2496
                @return: The result of the operation.
2253
2513
 
2254
2514
        def broadcast_medialib_entry_added(self, cb = None):
2255
2515
                """
 
2516
                broadcast_medialib_entry_added([cb]) -> XMMSResult
 
2517
 
2256
2518
                Set a method to handle the medialib entry added broadcast
2257
2519
                from the XMMS2 daemon. (i.e. a new entry has been added)
2258
2520
                @rtype: L{XMMSResult}
2269
2531
 
2270
2532
        def broadcast_medialib_entry_changed(self, cb = None):
2271
2533
                """
 
2534
                broadcast_medialib_entry_changed([cb]) -> XMMSResult
 
2535
 
2272
2536
                Set a method to handle the medialib entry changed broadcast
2273
2537
                from the XMMS2 daemon.
2274
2538
                Updated data is sent when the metadata for a song is updated
2287
2551
 
2288
2552
        def signal_visualisation_data(self, cb = None):
2289
2553
                """
 
2554
                signal_visualisation_data([cb]) -> XMMSResult
 
2555
 
2290
2556
                Tell daemon to send you visualisation data updates for drawing
2291
2557
                peak analyzer.
2292
2558
                @rtype: L{XMMSResult}
2302
2568
 
2303
2569
        def signal_mediainfo_reader_unindexed(self, cb = None):
2304
2570
                """
 
2571
                signal_mediainfo_reader_unindexed([cb]) -> XMMSResult
 
2572
 
2305
2573
                Tell daemon to send you the number of unindexed files in the mlib
2306
2574
                @rtype: L{XMMSResult}
2307
2575
                @return: The result of the operation.
2316
2584
 
2317
2585
        def broadcast_mediainfo_reader_status(self, cb = None):
2318
2586
                """
 
2587
                broadcast_mediainfo_reader_status([cb]) -> XMMSResult
 
2588
 
2319
2589
                Tell daemon to send you the status of the mediainfo reader
2320
2590
                @rtype: L{XMMSResult}
2321
2591
                @return: The result of the operation.
2330
2600
 
2331
2601
        def xform_media_browse(self, url, cb=None):
2332
2602
                """
 
2603
                xform_media_browse(url, [cb]) -> XMMSResult
 
2604
 
2333
2605
                Browse files from xform plugins.
2334
2606
                @rtype: L{XMMSResult}
2335
2607
                @return: The result of the operation.
2348
2620
 
2349
2621
        def coll_get(self, name, ns, cb=None):
2350
2622
                """
 
2623
                coll_get(name, ns, [cb]) -> XMMSResult
 
2624
 
2351
2625
                Retrieve a Collection
2352
2626
                @rtype: L{XMMSResult}
2353
2627
                @return: The result of the operation.
2360
2634
                        n = XMMS_COLLECTION_NS_PLAYLISTS
2361
2635
                else:
2362
2636
                        raise ValueError("Bad namespace")
 
2637
 
 
2638
                nam = from_unicode(name)
2363
2639
                
2364
2640
                ret = XMMSResult(self)
2365
2641
                ret.callback = cb
2366
 
                ret.res = xmmsc_coll_get(self.conn, name, n)
 
2642
                ret.res = xmmsc_coll_get(self.conn, nam, n)
2367
2643
 
2368
2644
                ret.more_init()
2369
2645
                return ret
2370
2646
 
2371
2647
        def coll_list(self, ns="*", cb=None):
2372
2648
                """
 
2649
                coll_list(name, [ns], [cb]) -> XMMSResult
 
2650
 
2373
2651
                List collections
2374
2652
                @rtype: L{XMMSResult}
2375
2653
                @return: The result of the operation.
2393
2671
 
2394
2672
        def coll_save(self, Collection coll, name, ns, cb=None):
2395
2673
                """
 
2674
                coll_save(coll, name, ns, [cb]) -> XMMSResult
 
2675
 
2396
2676
                Save a collection on server.
2397
2677
                @rtype: L{XMMSResult}
2398
2678
                @return: The result of the operation.
2406
2686
                else:
2407
2687
                        raise ValueError("Bad namespace")
2408
2688
 
 
2689
                nam = from_unicode(name)
 
2690
                
2409
2691
                ret = XMMSResult(self)
2410
2692
                ret.callback = cb
2411
 
                ret.res = xmmsc_coll_save(self.conn, coll.coll, name, n)
 
2693
                ret.res = xmmsc_coll_save(self.conn, coll.coll, nam, n)
2412
2694
                ret.more_init()
2413
2695
                return ret
2414
2696
 
2415
2697
        def coll_remove(self, name, ns, cb=None):
2416
2698
                """
 
2699
                coll_remove(name, ns, [cb]) -> XMMSResult
 
2700
 
2417
2701
                Remove a collection on server.
2418
2702
                @rtype: L{XMMSResult}
2419
2703
                @return: The result of the operation.
2427
2711
                else:
2428
2712
                        raise ValueError("Bad namespace")
2429
2713
                
 
2714
                nam = from_unicode(name)
 
2715
                
2430
2716
                ret = XMMSResult(self)
2431
2717
                ret.callback = cb
2432
 
                ret.res = xmmsc_coll_remove(self.conn, name, n)
 
2718
                ret.res = xmmsc_coll_remove(self.conn, nam, n)
2433
2719
 
2434
2720
                ret.more_init()
2435
2721
                return ret
2437
2723
 
2438
2724
        def coll_rename(self, oldname, newname, ns, cb=None):
2439
2725
                """
 
2726
                coll_rename(oldname, newname, ns, [cb]) -> XMMSResult
 
2727
 
2440
2728
                Change the name of a Collection.
2441
2729
                @rtype: L{XMMSResult}
2442
2730
                @return: The result of the operation.
2450
2738
                else:
2451
2739
                        raise ValueError("Bad namespace")
2452
2740
                
 
2741
                oldnam = from_unicode(oldname)
 
2742
                newnam = from_unicode(newname)
 
2743
                
2453
2744
                ret = XMMSResult(self)
2454
2745
                ret.callback = cb
2455
 
                ret.res = xmmsc_coll_rename(self.conn, oldname, newname, n)
 
2746
                ret.res = xmmsc_coll_rename(self.conn, oldnam, newnam, n)
2456
2747
 
2457
2748
                ret.more_init()
2458
2749
                return ret
2459
2750
 
2460
2751
        def coll_query_ids(self, coll, start=0, leng=0, order=None, cb=None):
2461
2752
                """
 
2753
                coll_query_ids(coll, [start], [leng], [order], [cb]) -> XMMSResult
 
2754
 
2462
2755
                Retrive a list of ids of the media matching the collection
2463
2756
                @rtype: L{XMMSResult}
2464
2757
                @return: The result of the operation.
2483
2776
 
2484
2777
        def coll_query_infos(self, coll, fields, start=0, leng=0, order=None, groupby=None, cb=None):
2485
2778
                """
 
2779
                coll_query_infos(coll, fields, [start], [leng], [order], [groupby], [cb]) -> XMMSResult
 
2780
 
2486
2781
                Retrive a list of mediainfo of the media matching the collection
2487
2782
                @rtype: L{XMMSResult}
2488
2783
                @return: The result of the operation.
2515
2810
 
2516
2811
        def bindata_add(self, data, cb=None):
2517
2812
                """
 
2813
                bindata_add(data, [cb]) -> XMMSResult
 
2814
 
2518
2815
                Add a datafile to the server
2519
2816
                @rtype: L{XMMSResult}
2520
2817
                @return: The result of the operation.
2531
2828
 
2532
2829
        def bindata_retrieve(self, hash, cb=None):
2533
2830
                """
 
2831
                bindata_retrieve(hash, [cb]) -> XMMSResult
 
2832
 
2534
2833
                Retrieve a datafile from the server
2535
2834
                @rtype: L{XMMSResult}
2536
2835
                @return: The result of the operation.
2547
2846
 
2548
2847
        def bindata_remove(self, hash, cb=None):
2549
2848
                """
 
2849
                bindata_remove(hash, [cb]) -> XMMSResult
 
2850
 
2550
2851
                Remove a datafile from the server
2551
2852
                @rtype: L{XMMSResult}
2552
2853
                @return: The result of the operation.