README.rst 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. ******************
  2. Mopidy-Touchscreen
  3. ******************
  4. .. image:: https://img.shields.io/pypi/v/Mopidy-Touchscreen.svg?style=flat
  5. :target: https://pypi.python.org/pypi/Mopidy-Touchscreen/
  6. :alt: Latest PyPI version
  7. .. image:: https://img.shields.io/pypi/dm/Mopidy-Touchscreen.svg?style=flat
  8. :target: https://pypi.python.org/pypi/Mopidy-Touchscreen/
  9. :alt: Number of PyPI downloads
  10. .. image:: https://img.shields.io/travis/9and3r/mopidy-touchscreen/develop.svg?style=flat
  11. :target: https://travis-ci.org/9and3r/mopidy-touchscreen
  12. :alt: Travis CI build status
  13. .. image:: https://img.shields.io/coveralls/9and3r/mopidy-touchscreen/develop.svg?style=flat
  14. :target: https://coveralls.io/r/9and3r/mopidy-touchscreen?branch=develop
  15. :alt: Test coverage
  16. Extension for displaying track info and controlling Mopidy from a touch screen
  17. using `PyGame <http://www.pygame.org/>`_/SDL.
  18. Cover images are downloaded from `last.fm <http://www.last.fm/api>`_
  19. Dependencies
  20. ============
  21. - ``Mopidy`` >= 1.0
  22. - ``Pykka`` >= 1.1
  23. - ``pygame``
  24. Installation
  25. ============
  26. Install by running::
  27. pip install Mopidy-Touchscreen
  28. Or, if available, install the Debian/Ubuntu package from `apt.mopidy.com
  29. <http://apt.mopidy.com/>`_.
  30. Basic Configuration
  31. ===================
  32. Before starting Mopidy, you must add configuration for
  33. Mopidy-Touchscreen to your Mopidy configuration file::
  34. [touchscreen]
  35. enabled = true
  36. screen_width = 320
  37. screen_height = 240
  38. resolution_factor = 8
  39. cursor = True
  40. fullscreen = False
  41. cache_dir = $XDG_CACHE_DIR/mopidy/touchscreen
  42. The following configuration values are available:
  43. - ``touchscreen/enabled``: If the Touchscreen extension should be enabled or
  44. not.
  45. - ``touchscreen/screen_width``: The width of the resolution you want to use in
  46. pixels.
  47. - ``touchscreen/screen_height``: The width of the resolution you want to use in
  48. pixels.
  49. - ``touchscreen/resolutin_factor``: This value sets how big content is shown. Smaller values will make content bigger and less content will be displayed at once.
  50. - ``touchscreen/cursor``: If the mouse cursor should be shown. (If you use a
  51. touchscreen it should be false)
  52. - ``touchscreen/fullscreen``: If you want to be shown as a window or in
  53. fullscreen.
  54. - ``touchscreen/cache_dir``: The folder to be used as cache. Defaults to
  55. ``$XDG_CACHE_DIR/mopidy/touchscreen``, which usually means
  56. ``~/.cache/mopidy/touchscreen``
  57. How to Setup
  58. ============
  59. Use the basic configuration to setup as most standard screens works fine without further configuration.
  60. Raspberry Pi
  61. ------------
  62. If you are using this on a raspberry pi you have to run mopidy with root privileges:
  63. Run Mopidy with root privileges
  64. ```````````````````````````````
  65. You can use ``sudo mopidy``.
  66. In case you are using musicbox edit ``/etc/init.d/mopidy`` file. Change ``DAEMON_USER=mopidy`` to ``DAEMON_USER=root``
  67. Do not forget that this is a workaround and that mopidy will run with root privileges.
  68. LCD Shields
  69. ```````````
  70. If you are using a LCD Shield in Raspberry Pi you need to config your LCD:
  71. Configure your LCD Shield
  72. '''''''''''''''''''''''''
  73. Add to the config the next variables::
  74. [touchscreen]
  75. sdl_fbdev = /dev/fb1
  76. sdl_mousdrv = TSLIB
  77. sdl_mousedev = event0
  78. This is just an example. It may work but each LCD Shield seems to have its own configuration.
  79. To find your values find an example of using pygame with your LCD Shield and it should be something like this in the code::
  80. os.environ["SDL_FBDEV"] = "/dev/fb1"
  81. os.environ["SDL_MOUSEDRV"] = "TSLIB"
  82. os.environ["SDL_MOUSEDEV"] = "event0"
  83. GPIO Buttons
  84. ````````````
  85. You can use GPIO buttons to controll mopidy touchscreen. To do that set the configuration::
  86. [touchscreen]
  87. gpio = True
  88. gpio_left = 4
  89. gpio_right = 27
  90. gpio_up = 22
  91. gpio_down = 23
  92. gpio_enter = 24
  93. You can choose what pins to use:
  94. - ``touchscreen/gpio``: If you want to use gpio buttons. If this is set to false other gpio configuration values will be ignored.
  95. - ``touchscreen/gpio_left``: Pin used to simulate left key press.
  96. - ``touchscreen/gpio_right``: Pin used to simulate right key press.
  97. - ``touchscreen/gpio_up``: Pin used to simulate up key press.
  98. - ``touchscreen/gpio_down``: Pin used to simulate down key press.
  99. - ``touchscreen/gpio_enter``: Pin used to simulate enter key press.
  100. All pins numbers are in BCM mode. You can check `here <http://raspberrypi.stackexchange.com/a/12967>`_ to see the numbers for your board.
  101. The buttons must be connected to GROUND.
  102. Pin - Button - Ground
  103. How To Use
  104. ==========
  105. You can use it with a touchscreen or mouse clicking on the icons.
  106. In case you are using a keyboard use arrow keys to navigate and enter to select.
  107. The GPIO buttons simulate keyboard keys so the use is exactly the same as using a keyboard.
  108. Help
  109. ====
  110. You can use `mopidy discuss <https://discuss.mopidy.com/>`_
  111. or send an email to `9and3r@gmail.com <mailto:9and3r@gmail.com>`_
  112. Features
  113. ========
  114. * See track info (track name, album, artist, cover image)
  115. * Seek Track
  116. * Play/Pause
  117. * Mute/Unmute
  118. * Change volume
  119. * Next/Previous track
  120. * Library
  121. * Menu (exit mopidy, restart...)
  122. * Shuffle on/off
  123. * Repeat one/on/off
  124. * Playback list and song selection
  125. * Playlists
  126. * Use keyboard or GPIO buttons instead of touchscreen
  127. Screenshots
  128. ===========
  129. .. image:: http://oi57.tinypic.com/29yjgwo.jpg
  130. Video
  131. =====
  132. `Example video running the extension <https://www.youtube.com/watch?v=KuYoIb8Q2LI>`_
  133. Project resources
  134. =================
  135. - `Source code <https://github.com/9and3r/mopidy-touchscreen>`_
  136. - `Issue tracker <https://github.com/9and3r/mopidy-touchscreen/issues>`_
  137. - `Download development snapshot <https://github.com/9and3r/mopidy-touchscreen/archive/master.tar.gz#egg=Mopidy-Touchscreen-dev>`_
  138. Changelog
  139. =========
  140. v1.0.0 (2015-05-26)
  141. -------------------
  142. - Require Mopidy v1.0
  143. - Update to work with changed core playback API in Mopidy 1.0
  144. - Search working
  145. - GPIO and Keyboard support
  146. - Resolution factor to adapt the interface for different screen sizes (Thanks to `Syco54645 <https://github.com/Syco54645>`_)
  147. - Background image
  148. - Lower CPU usage (Update screen only when needed)
  149. - Bug Fixes
  150. v0.3.2 (2015-01-09)
  151. -------------------
  152. - Bug Fixes
  153. - UI changes
  154. - Smoth text scrolling
  155. - Search albums, artist or songs (Not fully implemented. Basic functionality)
  156. v0.2.1 (2014-08-02)
  157. -------------------
  158. - Font will be included on installation
  159. v0.2.0 (2014-08-02)
  160. -------------------
  161. - First working version