1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: package remuco</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>remuco</strong></big></big> (version 0.9.6)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"></font></td></tr></table>
<p><tt>Remuco player adapter module.<br>
<br>
The module 'remuco' provides classes and constants for Remuco player adapters.<br>
<br>
Class <a href="#PlayerAdapter">PlayerAdapter</a>:<br>
Base class for player adapters (start reading here).<br>
<br>
Class <a href="#MPRISAdapter">MPRISAdapter</a>:<br>
Base class for player adapters for MPRIS players.<br>
<br>
Classes <a href="#ItemAction">ItemAction</a> and <a href="#ListAction">ListAction</a>:<br>
Classes to define actions clients may execute in their media browser. <br>
<br>
Class <a href="#ListReply">ListReply</a>:<br>
Used by player adapters to reply requests for playlists and other lists.<br>
<br>
Class <a href="#Manager">Manager</a>:<br>
Helper class for managing the life cycle of a player adapter.<br>
<br>
Constants:<br>
The constants starting with 'INFO' are keys to be used for the dictionary<br>
describing an item (a playable <a href="api.html#object">object</a>: song, video, slide, picture, ...).<br>
<br>
The constants starting with 'PLAYBACK' are the values used by Remuco to<br>
describe a playback state.<br>
<br>
Logging:<br>
It is recommended to use the remuco logging system within player adapters.<br>
To do so, import the module 'remuco.log' and use the functions<br>
<br>
* remuco.log.debug(),<br>
* remuco.log.info(),<br>
* remuco.log.warning() and<br>
* remuco.log.error().<br>
<br>
Then all messages of the player adapter will be written into the same file<br>
as used internally by the remuco module - that makes debugging a lot easier.<br>
<br>
Internally Remuco uses the module 'logging' for all its logging messages.<br>
Messages go into a player specific log file (usually<br>
~/.cache/remuco/PLAYER/log). The log level is defined in a player specific<br>
configuration file (usually ~/.config/remuco/PLAYER/conf).</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="api.html">adapter</a><br>
<a href="api.html">art</a><br>
<a href="api.html">config</a><br>
<a href="api.html">data</a><br>
<a href="api.html">defs</a><br>
</td><td width="25%" valign=top><a href="api.html">dictool</a><br>
<a href="api.html">features</a><br>
<a href="api.html">files</a><br>
<a href="api.html">log</a><br>
<a href="api.html">manager</a><br>
</td><td width="25%" valign=top><a href="api.html">message</a><br>
<a href="api.html">mpris</a><br>
<a href="api.html">net</a><br>
<a href="api.html">remos</a><br>
<a href="api.html">report</a><br>
</td><td width="25%" valign=top><a href="api.html">serial</a><br>
<a href="api.html">testshell</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="api.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="api.html#ItemAction">remuco.adapter.ItemAction</a>
</font></dt><dt><font face="helvetica, arial"><a href="api.html#ListAction">remuco.adapter.ListAction</a>
</font></dt><dt><font face="helvetica, arial"><a href="api.html#ListReply">remuco.adapter.ListReply</a>
</font></dt><dt><font face="helvetica, arial"><a href="api.html#PlayerAdapter">remuco.adapter.PlayerAdapter</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="api.html#MPRISAdapter">remuco.mpris.MPRISAdapter</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="api.html#Config">remuco.config.Config</a>
</font></dt><dt><font face="helvetica, arial"><a href="api.html#Manager">remuco.manager.Manager</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Config">class <strong>Config</strong></a>(<a href="api.html#object">__builtin__.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Class for getting and setting player adapter specific configurations.<br>
<br>
An instance of <a href="#Config">Config</a> mirrors the configuration of a specific player<br>
adapter (usually ~/.config/remuco/PLAYER/conf).<br>
<br>
Player adapters are not supposed to create instances of <a href="#Config">Config</a>. Instead<br>
use the 'config' attribute of a <a href="#PlayerAdapter">PlayerAdapter</a> instance to access the<br>
currently used <a href="#Config">Config</a> instance.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Config-__getattribute__"><strong>__getattribute__</strong></a>(self, attr)</dt><dd><tt>Attribute-style access to standard options.</tt></dd></dl>
<dl><dt><a name="Config-__init__"><strong>__init__</strong></a>(self, player_name)</dt><dd><tt>Create a new instance for the given player (adapter).</tt></dd></dl>
<dl><dt><a name="Config-getx"><strong>getx</strong></a>(self, key, default, converter<font color="#909090">=None</font>, save<font color="#909090">=True</font>)</dt><dd><tt>Get the value of a non-standard, player specific option.<br>
<br>
@param key:<br>
config option name<br>
@param default:<br>
default value (as string!)<br>
@keyword converter:<br>
value converter function, e.g. `int`<br>
@keyword save:<br>
save default value in config file if not yet set<br>
@return:<br>
option value, optionally converted</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="ItemAction">class <strong>ItemAction</strong></a>(<a href="api.html#object">__builtin__.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Item related action for a client's media browser.<br>
<br>
An item action defines an action a client may apply to a file from the<br>
local file system, to an item from the playlist, to an item from the play<br>
queue or to an item from the player's media library.<br>
<br>
If possible, player adapters should define item actions and send them to<br>
clients by setting the keyword 'file_actions' in <a href="#PlayerAdapter">PlayerAdapter</a>.<a href="#ItemAction-__init__">__init__</a>(),<br>
via <a href="#PlayerAdapter">PlayerAdapter</a>.reply_playlist_request(), via<br>
<a href="#PlayerAdapter">PlayerAdapter</a>.reply_queue_request() or via<br>
<a href="#PlayerAdapter">PlayerAdapter</a>.reply_mlib_request(). Clients may then use these actions<br>
which results in a call to <a href="#PlayerAdapter">PlayerAdapter</a>.action_files(),<br>
<a href="#PlayerAdapter">PlayerAdapter</a>.action_playlist_item(), <a href="#PlayerAdapter">PlayerAdapter</a>.action_queue_item() or<br>
<a href="#PlayerAdapter">PlayerAdapter</a>.action_mlib_item().<br>
<br>
@see: <a href="#PlayerAdapter">PlayerAdapter</a>.action_files()<br>
@see: <a href="#PlayerAdapter">PlayerAdapter</a>.action_playlist()<br>
@see: <a href="#PlayerAdapter">PlayerAdapter</a>.action_queue()<br>
@see: <a href="#PlayerAdapter">PlayerAdapter</a>.action_mlib_item()<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ItemAction-__init__"><strong>__init__</strong></a>(self, label, multiple<font color="#909090">=False</font>)</dt><dd><tt>Create a new action for items or files.<br>
<br>
@param label:<br>
label of the action (keep short, ideally this is just a single word<br>
like 'Enqueue', 'Play', ..)<br>
@keyword multiple:<br>
if the action may be applied to multiple items/files or only to a<br>
single item/file</tt></dd></dl>
<dl><dt><a name="ItemAction-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<dl><dt><strong>id</strong></dt>
<dd><tt>ID of the action (auto-generated, read only)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="ListAction">class <strong>ListAction</strong></a>(<a href="api.html#object">__builtin__.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>List related action for a client's media browser.<br>
<br>
A list action defines an action a client may apply to a list from the<br>
player's media library. If possible, player adapters may define list<br>
actions and send them to clients via <a href="#PlayerAdapter">PlayerAdapter</a>.replay_mlib_request()<br>
Clients may then use these actions which results in a call to<br>
<a href="#PlayerAdapter">PlayerAdapter</a>.action_mlib_list().<br>
<br>
@see: <a href="#PlayerAdapter">PlayerAdapter</a>.action_mlib_list()<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ListAction-__init__"><strong>__init__</strong></a>(self, label)</dt><dd><tt>Create a new action for lists from a player's media library.<br>
<br>
@param label:<br>
label of the action (keep short, ideally this is just a single word<br>
like 'Load', ..)</tt></dd></dl>
<dl><dt><a name="ListAction-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<dl><dt><strong>id</strong></dt>
<dd><tt>ID of the action (auto-generated, read only)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="ListReply">class <strong>ListReply</strong></a>(<a href="api.html#object">__builtin__.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Reply <a href="api.html#object">object</a> for an item list request.<br>
<br>
A <a href="#ListReply">ListReply</a> is the first parameter of the request methods<br>
<a href="#PlayerAdapter">PlayerAdapter</a>.request_playlist(), <a href="#PlayerAdapter">PlayerAdapter</a>.request_queue(),<br>
<a href="#PlayerAdapter">PlayerAdapter</a>.request_mlib() and <a href="#PlayerAdapter">PlayerAdapter</a>.request_search().<br>
<br>
Player adapters are supposed to use the list reply <a href="api.html#object">object</a> to set the<br>
reply data (using properties 'ids', 'names', 'item_actions' and<br>
'nested', 'list_actions') and to send the reply to clients (using <a href="#ListReply-send">send</a>()).<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ListReply-__init__"><strong>__init__</strong></a>(self, client, request_id, reply_msg_id, page, path<font color="#909090">=None</font>)</dt><dd><tt>Create a new list reply.<br>
<br>
Used internally, not needed within player adapters.<br>
<br>
@param client: the client to send the reply to<br>
@param request_id: the request's ID<br>
@param reply_msg_id: the message ID of the client's request<br>
@param page: page of the requested list<br>
<br>
@keyword path: path of the requested list, if there is one</tt></dd></dl>
<dl><dt><a name="ListReply-send"><strong>send</strong></a>(self)</dt><dd><tt>Send the requested item list to the requesting client.</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<dl><dt><strong>ids</strong></dt>
<dd><tt>IDs of the items contained in a list.<br>
<br>
Player adapters should set this to a list of IDs of the items contained<br>
in the requested list.</tt></dd>
</dl>
<dl><dt><strong>item_actions</strong></dt>
<dd><tt>A list of actions clients can apply to items in the list.<br>
<br>
The list must contain ItemAction objects.</tt></dd>
</dl>
<dl><dt><strong>list_actions</strong></dt>
<dd><tt>A list of actions clients can apply to nested lists in the list.<br>
<br>
The list must contain ListAction objects.</tt></dd>
</dl>
<dl><dt><strong>names</strong></dt>
<dd><tt>Names of the items contained in a list.<br>
<br>
Player adapters should set this to a list of names of the items<br>
contained in the requested list. Good choice for a name is combination<br>
of artist and title.</tt></dd>
</dl>
<dl><dt><strong>nested</strong></dt>
<dd><tt>Names of nested lists contained in a list.<br>
<br>
Player adapters should set this to a list of names of the nested lists<br>
contained in the requested list. To be used only for mlib requests (see<br>
PlayerAdapter.request_mlib()).</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="MPRISAdapter">class <strong>MPRISAdapter</strong></a>(<a href="api.html#PlayerAdapter">remuco.adapter.PlayerAdapter</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="api.html#MPRISAdapter">MPRISAdapter</a></dd>
<dd><a href="api.html#PlayerAdapter">remuco.adapter.PlayerAdapter</a></dd>
<dd><a href="api.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="MPRISAdapter-__init__"><strong>__init__</strong></a>(self, name, display_name<font color="#909090">=None</font>, poll<font color="#909090">=2.5</font>, mime_types<font color="#909090">=None</font>, rating<font color="#909090">=False</font>, extra_file_actions<font color="#909090">=None</font>, extra_playlist_actions<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="MPRISAdapter-action_files"><strong>action_files</strong></a>(self, action_id, files, uris)</dt></dl>
<dl><dt><a name="MPRISAdapter-action_playlist_item"><strong>action_playlist_item</strong></a>(self, action_id, positions, ids)</dt></dl>
<dl><dt><a name="MPRISAdapter-ctrl_next"><strong>ctrl_next</strong></a>(self)</dt></dl>
<dl><dt><a name="MPRISAdapter-ctrl_previous"><strong>ctrl_previous</strong></a>(self)</dt></dl>
<dl><dt><a name="MPRISAdapter-ctrl_seek"><strong>ctrl_seek</strong></a>(self, direction)</dt></dl>
<dl><dt><a name="MPRISAdapter-ctrl_toggle_playing"><strong>ctrl_toggle_playing</strong></a>(self)</dt></dl>
<dl><dt><a name="MPRISAdapter-ctrl_toggle_repeat"><strong>ctrl_toggle_repeat</strong></a>(self)</dt></dl>
<dl><dt><a name="MPRISAdapter-ctrl_toggle_shuffle"><strong>ctrl_toggle_shuffle</strong></a>(self)</dt></dl>
<dl><dt><a name="MPRISAdapter-ctrl_volume"><strong>ctrl_volume</strong></a>(self, direction)</dt></dl>
<dl><dt><a name="MPRISAdapter-poll"><strong>poll</strong></a>(self)</dt></dl>
<dl><dt><a name="MPRISAdapter-request_playlist"><strong>request_playlist</strong></a>(self, reply)</dt></dl>
<dl><dt><a name="MPRISAdapter-start"><strong>start</strong></a>(self)</dt></dl>
<dl><dt><a name="MPRISAdapter-stop"><strong>stop</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="api.html#PlayerAdapter">remuco.adapter.PlayerAdapter</a>:<br>
<dl><dt><a name="MPRISAdapter-action_mlib_item"><strong>action_mlib_item</strong></a>(self, action_id, path, positions, ids)</dt><dd><tt>Do an action on one or more items from the player's media library.<br>
<br>
The items are specified redundantly by 'positions' and 'ids' - use<br>
whatever fits better. If the specified action is not applicable to<br>
multiple items, then 'positions' and 'ids' are one element lists. <br>
<br>
@param action_id:<br>
ID of the action to do - this specifies one of the actions passed<br>
previously to reply_mlib_request() by the keyword 'item_actions'<br>
@param path:<br>
the library path that contains the items<br>
@param positions:<br>
list of positions to apply the action to <br>
@param ids:<br>
list of IDs to apply the action to<br>
<br>
@note: Override if item actions gets passed to reply_mlib_request().</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-action_mlib_list"><strong>action_mlib_list</strong></a>(self, action_id, path)</dt><dd><tt>Do an action on a list from the player's media library.<br>
<br>
@param action_id:<br>
ID of the action to do - this specifies one of the actions passed<br>
previously to reply_mlib_request() by the keyword 'list_actions'<br>
@param path:<br>
path specifying the list to apply the action to<br>
<br>
@note: Override if list actions gets passed to reply_mlib_request().</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-action_queue_item"><strong>action_queue_item</strong></a>(self, action_id, positions, ids)</dt><dd><tt>Do an action on one or more items from the play queue.<br>
<br>
The items are specified redundantly by 'positions' and 'ids' - use<br>
whatever fits better. If the specified action is not applicable to<br>
multiple items, then 'positions' and 'ids' are one element lists. <br>
<br>
@param action_id:<br>
ID of the action to do - this specifies one of the actions passed<br>
previously to reply_queue_request() by the keyword 'item_actions'<br>
@param positions:<br>
list of positions to apply the action to <br>
@param ids:<br>
list of IDs to apply the action to<br>
<br>
@note: Override if item actions gets passed to reply_queue_request().</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-action_search_item"><strong>action_search_item</strong></a>(self, action_id, positions, ids)</dt><dd><tt>Do an action on one or more items from a search result.<br>
<br>
@param action_id:<br>
ID of the action to do - this specifies one of the actions passed<br>
previously to reply_search_request() by the keyword 'item_actions'<br>
@param positions:<br>
list of positions to apply the action to <br>
@param ids:<br>
list of IDs to apply the action to<br>
<br>
@note: Override if list actions gets passed to reply_search_request().</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-ctrl_navigate"><strong>ctrl_navigate</strong></a>(self, action)</dt><dd><tt>Navigate through menus (typically DVD menus).<br>
<br>
@param action:<br>
A number selecting one of these actions: UP, DOWN, LEFT, RIGHT,<br>
SELECT, RETURN, TOPMENU (e.g. 0 is UP and 6 is TOPMENU).<br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-ctrl_rate"><strong>ctrl_rate</strong></a>(self, rating)</dt><dd><tt>Rate the currently played item. <br>
<br>
@param rating:<br>
rating value (int)<br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-ctrl_tag"><strong>ctrl_tag</strong></a>(self, id, tags)</dt><dd><tt>Attach some tags to an item.<br>
<br>
@param id:<br>
ID of the item to attach the tags to<br>
@param tags:<br>
a list of tags<br>
<br>
@note: Tags does not mean ID3 tags or similar. It means the general<br>
idea of tags (e.g. like used at last.fm). <br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-ctrl_toggle_fullscreen"><strong>ctrl_toggle_fullscreen</strong></a>(self)</dt><dd><tt>Toggle full screen mode. <br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-find_image"><strong>find_image</strong></a>(self, resource)</dt><dd><tt>Find a local art image file related to a resource.<br>
<br>
This method first looks in the resource' folder for typical art image<br>
files (e.g. 'cover.png', 'front.jpg', ...). If there is no such file it<br>
then looks into the user's thumbnail directory (~/.thumbnails).<br>
<br>
@param resource:<br>
resource to find an art image for (may be a file name or URI)<br>
@keyword prefer_thumbnail:<br>
True means first search in thumbnails, False means first search in<br>
the resource' folder<br>
<br>
@return: an image file name (which can be used for <a href="#MPRISAdapter-update_item">update_item</a>()) or<br>
None if no image file has been found or if 'resource' is not local</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-request_mlib"><strong>request_mlib</strong></a>(self, reply, path)</dt><dd><tt>Request the content of a playlist from the player's media library.<br>
<br>
@param reply:<br>
a <a href="#ListReply">ListReply</a> <a href="api.html#object">object</a><br>
@param path: <br>
a path within a player's media library<br>
<br>
If path is an empty list, the root of the library (all top level<br>
playlists) are requested. Otherwise path is set as illustrated in this<br>
example:<br>
<br>
Consider a player with a media library structure like this:<br>
<br>
|- Radio<br>
|- Genres<br>
|- Jazz<br>
|- ...<br>
|- Dynamic<br>
|- Never played<br>
|- Played recently<br>
|- ...<br>
|- Playlists<br>
|- Party<br>
|- Sue's b-day<br>
|- ...<br>
|- ...<br>
<br>
If path is the empty list, all top level playlists are requests, e.g.<br>
['Radio', 'Genres', 'Dynamic', 'Playlists', ...]. Otherwise path may<br>
specify a specific level in the library tree, e.g. [ 'Radio' ] or<br>
[ 'Playlists', 'Party', 'Sue's b-day' ] or etc.<br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-request_queue"><strong>request_queue</strong></a>(self, reply)</dt><dd><tt>Request the content of the play queue.<br>
<br>
@param reply:<br>
a <a href="#ListReply">ListReply</a> <a href="api.html#object">object</a><br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-request_search"><strong>request_search</strong></a>(self, reply, query)</dt><dd><tt>Request a list of items matching a search query.<br>
<br>
@param reply:<br>
a <a href="#ListReply">ListReply</a> <a href="api.html#object">object</a><br>
@param query:<br>
a list of search query values corresponding with the search mask<br>
specified with keyword 'search_mask' in <a href="#PlayerAdapter">PlayerAdapter</a>.<a href="#MPRISAdapter-__init__">__init__</a>()<br>
<br>
Example: If search mask was [ 'Artist', 'Title', 'Album' ], then<br>
a query may look like this: [ 'Blondie', '', 'Best' ]. It is up to<br>
player adapters how to interpret these values. However, good practice<br>
is to interpret them as case insensitive, and-connected, non exact<br>
matching search values. The given example would then reply a list<br>
with all items where 'Blondie' is contained in the artist field and<br>
'Best' is contained in the Album field.<br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-update_item"><strong>update_item</strong></a>(self, id, info, img)</dt><dd><tt>Set currently played item.<br>
<br>
@param id:<br>
item ID (str)<br>
@param info:<br>
meta information (dict)<br>
@param img:<br>
image / cover art (either a file name or URI or an instance of<br>
Image.Image)<br>
<br>
@note: Call to synchronize player state with remote clients.<br>
<br>
@see: <a href="#MPRISAdapter-find_image">find_image</a>() for finding image files for an item.<br>
<br>
@see: remuco.INFO_... for keys to use for 'info'</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-update_playback"><strong>update_playback</strong></a>(self, playback)</dt><dd><tt>Set the current playback state.<br>
<br>
@param playback:<br>
playback mode<br>
<br>
@see: remuco.PLAYBACK_...<br>
<br>
@note: Call to synchronize player state with remote clients.</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-update_position"><strong>update_position</strong></a>(self, position, queue<font color="#909090">=False</font>)</dt><dd><tt>Set the current item's position in the playlist or queue. <br>
<br>
@param position:<br>
position of the currently played item (starting at 0)<br>
@keyword queue:<br>
True if currently played item is from the queue, False if it is<br>
from the currently active playlist<br>
<br>
@note: Call to synchronize player state with remote clients.</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-update_progress"><strong>update_progress</strong></a>(self, progress, length)</dt><dd><tt>Set the current playback progress.<br>
<br>
@param progress:<br>
number of currently elapsed seconds<br>
@keyword length:<br>
item length in seconds (maximum possible progress value)<br>
<br>
@note: Call to synchronize player state with remote clients.</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-update_repeat"><strong>update_repeat</strong></a>(self, repeat)</dt><dd><tt>Set the current repeat mode. <br>
<br>
@param repeat: True means play indefinitely, False means stop after the<br>
last playlist item<br>
<br>
@note: Call to synchronize player state with remote clients.</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-update_shuffle"><strong>update_shuffle</strong></a>(self, shuffle)</dt><dd><tt>Set the current shuffle mode. <br>
<br>
@param shuffle: True means play in non-linear order, False means play<br>
in linear order<br>
<br>
@note: Call to synchronize player state with remote clients.</tt></dd></dl>
<dl><dt><a name="MPRISAdapter-update_volume"><strong>update_volume</strong></a>(self, volume)</dt><dd><tt>Set the current volume.<br>
<br>
@param volume: the volume in percent<br>
<br>
@note: Call to synchronize player state with remote clients.</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="api.html#PlayerAdapter">remuco.adapter.PlayerAdapter</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="api.html#PlayerAdapter">remuco.adapter.PlayerAdapter</a>:<br>
<dl><dt><strong>manager</strong> = <remuco.manager.NoManager object></dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Manager">class <strong>Manager</strong></a>(<a href="api.html#object">__builtin__.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Life cycle manager for a stand-alone player adapter.<br>
<br>
A manager cares about calling a <a href="#PlayerAdapter">PlayerAdapter</a>'s start and stop methods.<br>
Additionally, because Remuco needs a GLib main loop to run, it sets up and<br>
manages such a loop.<br>
<br>
It is intended for player adapters running stand-alone, outside the players<br>
they adapt. A manager is not needed for player adapters realized as a<br>
plugin for a media player. In that case the player's plugin interface<br>
should care about the life cycle of a player adapter (see the Rhythmbox<br>
player adapter as an example).<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Manager-__init__"><strong>__init__</strong></a>(self, pa, dbus_name<font color="#909090">=None</font>, poll_fn<font color="#909090">=None</font>)</dt><dd><tt>Create a new manager.<br>
<br>
@param pa:<br>
the <a href="#PlayerAdapter">PlayerAdapter</a> to manage<br>
@keyword dbus_name:<br>
if the player adapter uses DBus to communicate with its player set<br>
this to the player's well known bus name (see <a href="#Manager-run">run</a>() for more<br>
information)<br>
@keyword poll_fn:<br>
if DBus is not used, this function may be set for periodic checks<br>
if the player is running, used to automatically start and stop the<br>
player adapter<br>
<br>
When neither `dbus_name` nor `poll_fn` is given, the adapter is started<br>
immediately, assuming the player is running and the adapter is ready to<br>
work.</tt></dd></dl>
<dl><dt><a name="Manager-run"><strong>run</strong></a>(self)</dt><dd><tt>Activate the manager.<br>
<br>
This method starts the player adapter, runs a main loop (GLib) and<br>
blocks until SIGINT or SIGTERM arrives or until <a href="#Manager-stop">stop</a>() gets called. If<br>
this happens the player adapter gets stopped and this method returns.<br>
<br>
If `player_dbus_name` or `poll_fn` has been passed to <a href="#Manager-__init__">__init__</a>(), then<br>
the player adapter does not get started until the player is running<br>
(according to checks based on the DBus name or poll function). Also the<br>
adapter gets stopped automatically if the player is not running<br>
anymore. However, the manager keeps running, i.e. the player adapter<br>
may get started and stopped multiple times while this method is<br>
running.</tt></dd></dl>
<dl><dt><a name="Manager-stop"><strong>stop</strong></a>(self)</dt><dd><tt>Shut down the manager.<br>
<br>
Stops the manager's main loop and player adapter. As a result a<br>
previous call to <a href="#Manager-run">run</a>() will return now. This should be used by player<br>
adapters when there is a crucial error and restarting the adapter won't<br>
fix this.</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="PlayerAdapter">class <strong>PlayerAdapter</strong></a>(<a href="api.html#object">__builtin__.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Base class for Remuco player adapters.<br>
<br>
Remuco player adapters must subclass this class and override certain<br>
methods to implement player specific behavior. Additionally <a href="#PlayerAdapter">PlayerAdapter</a><br>
provides methods to interact with Remuco clients. Following is a summary<br>
of all relevant methods, grouped by functionality. <br>
<br>
===========================================================================<br>
Methods to extend to manage life cycle<br>
===========================================================================<br>
<br>
* <a href="#PlayerAdapter-start">start</a>()<br>
* <a href="#PlayerAdapter-stop">stop</a>()<br>
<br>
A <a href="#PlayerAdapter">PlayerAdapter</a> can be started and stopped with <a href="#PlayerAdapter-start">start</a>() and <a href="#PlayerAdapter-stop">stop</a>().<br>
The same instance of a <a href="#PlayerAdapter">PlayerAdapter</a> should be startable and stoppable<br>
multiple times.<br>
<br>
Subclasses of <a href="#PlayerAdapter">PlayerAdapter</a> may override these methods as needed but<br>
must always call the super class implementations too!<br>
<br>
===========================================================================<br>
Methods to override to control the media player:<br>
===========================================================================<br>
<br>
* <a href="#PlayerAdapter-ctrl_toggle_playing">ctrl_toggle_playing</a>()<br>
* <a href="#PlayerAdapter-ctrl_toggle_repeat">ctrl_toggle_repeat</a>()<br>
* <a href="#PlayerAdapter-ctrl_toggle_shuffle">ctrl_toggle_shuffle</a>()<br>
* <a href="#PlayerAdapter-ctrl_toggle_fullscreen">ctrl_toggle_fullscreen</a>()<br>
* <a href="#PlayerAdapter-ctrl_next">ctrl_next</a>()<br>
* <a href="#PlayerAdapter-ctrl_previous">ctrl_previous</a>()<br>
* <a href="#PlayerAdapter-ctrl_seek">ctrl_seek</a>()<br>
* <a href="#PlayerAdapter-ctrl_volume">ctrl_volume</a>()<br>
* <a href="#PlayerAdapter-ctrl_rate">ctrl_rate</a>()<br>
* <a href="#PlayerAdapter-ctrl_tag">ctrl_tag</a>()<br>
* <a href="#PlayerAdapter-ctrl_navigate">ctrl_navigate</a>()<br>
<br>
* <a href="#PlayerAdapter-action_files">action_files</a>()<br>
* <a href="#PlayerAdapter-action_playlist_item">action_playlist_item</a>()<br>
* <a href="#PlayerAdapter-action_queue_item">action_queue_item</a>()<br>
* <a href="#PlayerAdapter-action_mlib_item">action_mlib_item</a>()<br>
* <a href="#PlayerAdapter-action_mlib_list">action_mlib_list</a>()<br>
* <a href="#PlayerAdapter-action_search_item">action_search_item</a>()<br>
<br>
Player adapters only need to implement only a *subset* of these<br>
methods - depending on what is possible and what makes sense.<br>
<br>
Remuco checks which methods have been overridden and uses this<br>
information to notify Remuco clients about capabilities of player<br>
adapters. <br>
<br>
===========================================================================<br>
Methods to override to provide information from the media player:<br>
===========================================================================<br>
<br>
* <a href="#PlayerAdapter-request_playlist">request_playlist</a>()<br>
* <a href="#PlayerAdapter-request_queue">request_queue</a>()<br>
* <a href="#PlayerAdapter-request_mlib">request_mlib</a>()<br>
* <a href="#PlayerAdapter-request_search">request_search</a>()<br>
<br>
As above, only override the methods which make sense for the<br>
corresponding media player.<br>
<br>
===========================================================================<br>
Methods to call to synchronize media player state information with clients:<br>
===========================================================================<br>
<br>
* <a href="#PlayerAdapter-update_playback">update_playback</a>()<br>
* <a href="#PlayerAdapter-update_repeat">update_repeat</a>()<br>
* <a href="#PlayerAdapter-update_shuffle">update_shuffle</a>()<br>
* <a href="#PlayerAdapter-update_item">update_item</a>()<br>
* <a href="#PlayerAdapter-update_position">update_position</a>()<br>
* <a href="#PlayerAdapter-update_progress">update_progress</a>()<br>
<br>
These methods should be called whenever the corresponding information<br>
has changed in the media player (it is safe to call these methods also<br>
if there actually is no change, internally a change check is done<br>
before sending any data to clients).<br>
<br>
Subclasses of <a href="#PlayerAdapter">PlayerAdapter</a> may override the method <a href="#PlayerAdapter-poll">poll</a>() to<br>
periodically check a player's state.<br>
<br>
===========================================================================<br>
Finally some utility methods:<br>
===========================================================================<br>
<br>
* <a href="#PlayerAdapter-find_image">find_image</a>()<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="PlayerAdapter-__init__"><strong>__init__</strong></a>(self, name, playback_known<font color="#909090">=False</font>, volume_known<font color="#909090">=False</font>, repeat_known<font color="#909090">=False</font>, shuffle_known<font color="#909090">=False</font>, progress_known<font color="#909090">=False</font>, max_rating<font color="#909090">=0</font>, poll<font color="#909090">=2.5</font>, file_actions<font color="#909090">=None</font>, mime_types<font color="#909090">=None</font>, search_mask<font color="#909090">=None</font>)</dt><dd><tt>Create a new player adapter and configure its capabilities.<br>
<br>
Just does some early initializations. Real job starts with <a href="#PlayerAdapter-start">start</a>().<br>
<br>
@param name:<br>
name of the media player<br>
@keyword playback_known:<br>
indicates if the player's playback state can be provided (see<br>
<a href="#PlayerAdapter-update_playback">update_playback</a>())<br>
@keyword volume_known:<br>
indicates if the player's volume can be provided (see<br>
<a href="#PlayerAdapter-update_volume">update_volume</a>())<br>
@keyword repeat_known:<br>
indicates if the player's repeat mode can be provided (see<br>
<a href="#PlayerAdapter-update_repeat">update_repeat</a>())<br>
@keyword shuffle_known:<br>
indicates if the player's shuffle mode can be provided (see<br>
<a href="#PlayerAdapter-update_shuffle">update_shuffle</a>())<br>
@keyword progress_known:<br>
indicates if the player's playback progress can be provided (see<br>
<a href="#PlayerAdapter-update_progress">update_progress</a>())<br>
@keyword max_rating:<br>
maximum possible rating value for items<br>
@keyword poll:<br>
interval in seconds to call <a href="#PlayerAdapter-poll">poll</a>()<br>
@keyword file_actions:<br>
list of <a href="#ItemAction">ItemAction</a> which can be applied to files from the local<br>
file system (actions like play a file or append files to the<br>
playlist) - this keyword is only relevant if the method<br>
<a href="#PlayerAdapter-action_files">action_files</a>() gets overridden<br>
@keyword mime_types:<br>
list of mime types specifying the files to which the actions given<br>
by the keyword 'file_actions' can be applied, this may be general<br>
types like 'audio' or 'video' but also specific types like<br>
'audio/mp3' or 'video/quicktime' (setting this to None means all<br>
mime types are supported) - this keyword is only relevant if the<br>
method <a href="#PlayerAdapter-action_files">action_files</a>() gets overridden<br>
@keyword search_mask:<br>
list of fields to search the players library for (e.g. artist,<br>
genre, any, ...) - if set method <a href="#PlayerAdapter-request_search">request_search</a>() should be<br>
overridden<br>
<br>
@attention: When overriding, call super class implementation first!</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-action_files"><strong>action_files</strong></a>(self, action_id, files, uris)</dt><dd><tt>Do an action on one or more files.<br>
<br>
The files are specified redundantly by 'files' and 'uris' - use<br>
whatever fits better. If the specified action is not applicable to<br>
multiple files, then 'files' and 'uris' are one element lists.<br>
<br>
The files in 'files' and 'uris' may be any files from the local file<br>
system that have one of the mime types specified by the keyword<br>
'mime_types' in <a href="#PlayerAdapter-__init__">__init__</a>().<br>
<br>
@param action_id:<br>
ID of the action to do - this specifies one of the actions passed<br>
previously to <a href="#PlayerAdapter-__init__">__init__</a>() by the keyword 'file_actions'<br>
@param files:<br>
list of files to apply the action to (regular path names) <br>
@param uris:<br>
list of files to apply the action to (URI notation) <br>
<br>
@note: Override if file item actions gets passed to <a href="#PlayerAdapter-__init__">__init__</a>().</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-action_mlib_item"><strong>action_mlib_item</strong></a>(self, action_id, path, positions, ids)</dt><dd><tt>Do an action on one or more items from the player's media library.<br>
<br>
The items are specified redundantly by 'positions' and 'ids' - use<br>
whatever fits better. If the specified action is not applicable to<br>
multiple items, then 'positions' and 'ids' are one element lists. <br>
<br>
@param action_id:<br>
ID of the action to do - this specifies one of the actions passed<br>
previously to reply_mlib_request() by the keyword 'item_actions'<br>
@param path:<br>
the library path that contains the items<br>
@param positions:<br>
list of positions to apply the action to <br>
@param ids:<br>
list of IDs to apply the action to<br>
<br>
@note: Override if item actions gets passed to reply_mlib_request().</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-action_mlib_list"><strong>action_mlib_list</strong></a>(self, action_id, path)</dt><dd><tt>Do an action on a list from the player's media library.<br>
<br>
@param action_id:<br>
ID of the action to do - this specifies one of the actions passed<br>
previously to reply_mlib_request() by the keyword 'list_actions'<br>
@param path:<br>
path specifying the list to apply the action to<br>
<br>
@note: Override if list actions gets passed to reply_mlib_request().</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-action_playlist_item"><strong>action_playlist_item</strong></a>(self, action_id, positions, ids)</dt><dd><tt>Do an action on one or more items from the playlist.<br>
<br>
The items are specified redundantly by 'positions' and 'ids' - use<br>
whatever fits better. If the specified action is not applicable to<br>
multiple items, then 'positions' and 'ids' are one element lists. <br>
<br>
@param action_id:<br>
ID of the action to do - this specifies one of the actions passed<br>
previously to reply_playlist_request() by the keyword 'item_actions'<br>
@param positions:<br>
list of positions to apply the action to<br>
@param ids:<br>
list of IDs to apply the action to<br>
<br>
@note: Override if item actions gets passed to reply_playlist_request().</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-action_queue_item"><strong>action_queue_item</strong></a>(self, action_id, positions, ids)</dt><dd><tt>Do an action on one or more items from the play queue.<br>
<br>
The items are specified redundantly by 'positions' and 'ids' - use<br>
whatever fits better. If the specified action is not applicable to<br>
multiple items, then 'positions' and 'ids' are one element lists. <br>
<br>
@param action_id:<br>
ID of the action to do - this specifies one of the actions passed<br>
previously to reply_queue_request() by the keyword 'item_actions'<br>
@param positions:<br>
list of positions to apply the action to <br>
@param ids:<br>
list of IDs to apply the action to<br>
<br>
@note: Override if item actions gets passed to reply_queue_request().</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-action_search_item"><strong>action_search_item</strong></a>(self, action_id, positions, ids)</dt><dd><tt>Do an action on one or more items from a search result.<br>
<br>
@param action_id:<br>
ID of the action to do - this specifies one of the actions passed<br>
previously to reply_search_request() by the keyword 'item_actions'<br>
@param positions:<br>
list of positions to apply the action to <br>
@param ids:<br>
list of IDs to apply the action to<br>
<br>
@note: Override if list actions gets passed to reply_search_request().</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-ctrl_navigate"><strong>ctrl_navigate</strong></a>(self, action)</dt><dd><tt>Navigate through menus (typically DVD menus).<br>
<br>
@param action:<br>
A number selecting one of these actions: UP, DOWN, LEFT, RIGHT,<br>
SELECT, RETURN, TOPMENU (e.g. 0 is UP and 6 is TOPMENU).<br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-ctrl_next"><strong>ctrl_next</strong></a>(self)</dt><dd><tt>Play the next item. <br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-ctrl_previous"><strong>ctrl_previous</strong></a>(self)</dt><dd><tt>Play the previous item. <br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-ctrl_rate"><strong>ctrl_rate</strong></a>(self, rating)</dt><dd><tt>Rate the currently played item. <br>
<br>
@param rating:<br>
rating value (int)<br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-ctrl_seek"><strong>ctrl_seek</strong></a>(self, direction)</dt><dd><tt>Seek forward or backward some seconds. <br>
<br>
The number of seconds to seek should be reasonable for the current<br>
item's length (if known).<br>
<br>
If the progress of the current item is known, it should get<br>
synchronized immediately with clients by calling <a href="#PlayerAdapter-update_progress">update_progress</a>().<br>
<br>
@param direction:<br>
* -1: seek backward <br>
* +1: seek forward<br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-ctrl_tag"><strong>ctrl_tag</strong></a>(self, id, tags)</dt><dd><tt>Attach some tags to an item.<br>
<br>
@param id:<br>
ID of the item to attach the tags to<br>
@param tags:<br>
a list of tags<br>
<br>
@note: Tags does not mean ID3 tags or similar. It means the general<br>
idea of tags (e.g. like used at last.fm). <br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-ctrl_toggle_fullscreen"><strong>ctrl_toggle_fullscreen</strong></a>(self)</dt><dd><tt>Toggle full screen mode. <br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-ctrl_toggle_playing"><strong>ctrl_toggle_playing</strong></a>(self)</dt><dd><tt>Toggle play and pause. <br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-ctrl_toggle_repeat"><strong>ctrl_toggle_repeat</strong></a>(self)</dt><dd><tt>Toggle repeat mode. <br>
<br>
@note: Override if it is possible and makes sense.<br>
<br>
@see: <a href="#PlayerAdapter-update_repeat">update_repeat</a>()</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-ctrl_toggle_shuffle"><strong>ctrl_toggle_shuffle</strong></a>(self)</dt><dd><tt>Toggle shuffle mode. <br>
<br>
@note: Override if it is possible and makes sense.<br>
<br>
@see: <a href="#PlayerAdapter-update_shuffle">update_shuffle</a>()</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-ctrl_volume"><strong>ctrl_volume</strong></a>(self, direction)</dt><dd><tt>Adjust volume. <br>
<br>
@param volume:<br>
* -1: decrease by some percent (5 is a good value)<br>
* 0: mute volume<br>
* +1: increase by some percent (5 is a good value)<br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-find_image"><strong>find_image</strong></a>(self, resource)</dt><dd><tt>Find a local art image file related to a resource.<br>
<br>
This method first looks in the resource' folder for typical art image<br>
files (e.g. 'cover.png', 'front.jpg', ...). If there is no such file it<br>
then looks into the user's thumbnail directory (~/.thumbnails).<br>
<br>
@param resource:<br>
resource to find an art image for (may be a file name or URI)<br>
@keyword prefer_thumbnail:<br>
True means first search in thumbnails, False means first search in<br>
the resource' folder<br>
<br>
@return: an image file name (which can be used for <a href="#PlayerAdapter-update_item">update_item</a>()) or<br>
None if no image file has been found or if 'resource' is not local</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-poll"><strong>poll</strong></a>(self)</dt><dd><tt>Does nothing by default.<br>
<br>
If player adapters override this method, it gets called periodically<br>
in the interval specified by the keyword 'poll' in <a href="#PlayerAdapter-__init__">__init__</a>().<br>
<br>
A typical use case of this method is to detect the playback progress of<br>
the current item and then call <a href="#PlayerAdapter-update_progress">update_progress</a>(). It can also be used<br>
to poll any other player state information when a player does not<br>
provide signals for all or certain state information changes.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-request_mlib"><strong>request_mlib</strong></a>(self, reply, path)</dt><dd><tt>Request the content of a playlist from the player's media library.<br>
<br>
@param reply:<br>
a <a href="#ListReply">ListReply</a> <a href="api.html#object">object</a><br>
@param path: <br>
a path within a player's media library<br>
<br>
If path is an empty list, the root of the library (all top level<br>
playlists) are requested. Otherwise path is set as illustrated in this<br>
example:<br>
<br>
Consider a player with a media library structure like this:<br>
<br>
|- Radio<br>
|- Genres<br>
|- Jazz<br>
|- ...<br>
|- Dynamic<br>
|- Never played<br>
|- Played recently<br>
|- ...<br>
|- Playlists<br>
|- Party<br>
|- Sue's b-day<br>
|- ...<br>
|- ...<br>
<br>
If path is the empty list, all top level playlists are requests, e.g.<br>
['Radio', 'Genres', 'Dynamic', 'Playlists', ...]. Otherwise path may<br>
specify a specific level in the library tree, e.g. [ 'Radio' ] or<br>
[ 'Playlists', 'Party', 'Sue's b-day' ] or etc.<br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-request_playlist"><strong>request_playlist</strong></a>(self, reply)</dt><dd><tt>Request the content of the currently active playlist.<br>
<br>
@param reply:<br>
a <a href="#ListReply">ListReply</a> <a href="api.html#object">object</a><br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-request_queue"><strong>request_queue</strong></a>(self, reply)</dt><dd><tt>Request the content of the play queue.<br>
<br>
@param reply:<br>
a <a href="#ListReply">ListReply</a> <a href="api.html#object">object</a><br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-request_search"><strong>request_search</strong></a>(self, reply, query)</dt><dd><tt>Request a list of items matching a search query.<br>
<br>
@param reply:<br>
a <a href="#ListReply">ListReply</a> <a href="api.html#object">object</a><br>
@param query:<br>
a list of search query values corresponding with the search mask<br>
specified with keyword 'search_mask' in <a href="#PlayerAdapter">PlayerAdapter</a>.<a href="#PlayerAdapter-__init__">__init__</a>()<br>
<br>
Example: If search mask was [ 'Artist', 'Title', 'Album' ], then<br>
a query may look like this: [ 'Blondie', '', 'Best' ]. It is up to<br>
player adapters how to interpret these values. However, good practice<br>
is to interpret them as case insensitive, and-connected, non exact<br>
matching search values. The given example would then reply a list<br>
with all items where 'Blondie' is contained in the artist field and<br>
'Best' is contained in the Album field.<br>
<br>
@note: Override if it is possible and makes sense.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-start"><strong>start</strong></a>(self)</dt><dd><tt>Start the player adapter.<br>
<br>
@attention: When overriding, call super class implementation first!</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-stop"><strong>stop</strong></a>(self)</dt><dd><tt>Shutdown the player adapter.<br>
<br>
Disconnects all clients and shuts down the Bluetooth and WiFi server.<br>
Also ignores any subsequent calls to an update or reply method (e.g.<br>
<a href="#PlayerAdapter-update_volume">update_volume</a>(), ..., reply_playlist_request(), ...). <br>
<br>
@note: The same player adapter instance can be started again with<br>
<a href="#PlayerAdapter-start">start</a>().<br>
<br>
@attention: When overriding, call super class implementation first!</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-update_item"><strong>update_item</strong></a>(self, id, info, img)</dt><dd><tt>Set currently played item.<br>
<br>
@param id:<br>
item ID (str)<br>
@param info:<br>
meta information (dict)<br>
@param img:<br>
image / cover art (either a file name or URI or an instance of<br>
Image.Image)<br>
<br>
@note: Call to synchronize player state with remote clients.<br>
<br>
@see: <a href="#PlayerAdapter-find_image">find_image</a>() for finding image files for an item.<br>
<br>
@see: remuco.INFO_... for keys to use for 'info'</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-update_playback"><strong>update_playback</strong></a>(self, playback)</dt><dd><tt>Set the current playback state.<br>
<br>
@param playback:<br>
playback mode<br>
<br>
@see: remuco.PLAYBACK_...<br>
<br>
@note: Call to synchronize player state with remote clients.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-update_position"><strong>update_position</strong></a>(self, position, queue<font color="#909090">=False</font>)</dt><dd><tt>Set the current item's position in the playlist or queue. <br>
<br>
@param position:<br>
position of the currently played item (starting at 0)<br>
@keyword queue:<br>
True if currently played item is from the queue, False if it is<br>
from the currently active playlist<br>
<br>
@note: Call to synchronize player state with remote clients.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-update_progress"><strong>update_progress</strong></a>(self, progress, length)</dt><dd><tt>Set the current playback progress.<br>
<br>
@param progress:<br>
number of currently elapsed seconds<br>
@keyword length:<br>
item length in seconds (maximum possible progress value)<br>
<br>
@note: Call to synchronize player state with remote clients.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-update_repeat"><strong>update_repeat</strong></a>(self, repeat)</dt><dd><tt>Set the current repeat mode. <br>
<br>
@param repeat: True means play indefinitely, False means stop after the<br>
last playlist item<br>
<br>
@note: Call to synchronize player state with remote clients.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-update_shuffle"><strong>update_shuffle</strong></a>(self, shuffle)</dt><dd><tt>Set the current shuffle mode. <br>
<br>
@param shuffle: True means play in non-linear order, False means play<br>
in linear order<br>
<br>
@note: Call to synchronize player state with remote clients.</tt></dd></dl>
<dl><dt><a name="PlayerAdapter-update_volume"><strong>update_volume</strong></a>(self, volume)</dt><dd><tt>Set the current volume.<br>
<br>
@param volume: the volume in percent<br>
<br>
@note: Call to synchronize player state with remote clients.</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>manager</strong> = <remuco.manager.NoManager object></dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>INFO_ALBUM</strong> = 'album'<br>
<strong>INFO_ARTIST</strong> = 'artist'<br>
<strong>INFO_GENRE</strong> = 'genre'<br>
<strong>INFO_LENGTH</strong> = 'length'<br>
<strong>INFO_RATING</strong> = 'rating'<br>
<strong>INFO_TAGS</strong> = 'tags'<br>
<strong>INFO_TITLE</strong> = 'title'<br>
<strong>INFO_YEAR</strong> = 'year'<br>
<strong>MIMETYPES_AUDIO</strong> = ('audio', 'application/ogg')<br>
<strong>MIMETYPES_AV</strong> = ('audio', 'application/ogg', 'video')<br>
<strong>MIMETYPES_VIDEO</strong> = ('video',)<br>
<strong>PLAYBACK_PAUSE</strong> = 1<br>
<strong>PLAYBACK_PLAY</strong> = 2<br>
<strong>PLAYBACK_STOP</strong> = 0<br>
<strong>__all__</strong> = ['PlayerAdapter', 'ListReply', 'MPRISAdapter', 'ItemAction', 'ListAction', 'Manager', 'Config', 'INFO_ALBUM', 'INFO_ARTIST', 'INFO_GENRE', 'INFO_LENGTH', 'INFO_RATING', 'INFO_TAGS', 'INFO_TITLE', 'INFO_YEAR', 'PLAYBACK_PAUSE', 'PLAYBACK_PLAY', 'PLAYBACK_STOP', 'MIMETYPES_AUDIO', 'MIMETYPES_VIDEO', ...]<br>
<strong>__version__</strong> = '0.9.6'</td></tr></table>
</body></html>
|