diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..d2b1cf6 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,289 @@ +# -*- coding: utf-8 -*- +# +# Mopidy Touchscreen documentation build configuration file, created by +# sphinx-quickstart on Tue May 19 21:55:21 2015. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.coverage', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'Mopidy Touchscreen' +copyright = u'2015, 9and3r' +author = u'9and3r' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '4.0.0' +# The full version, including alpha/beta/rc tags. +release = '4.0.0' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'alabaster' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +#html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +#html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +#html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'MopidyTouchscreendoc' + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', + +# Latex figure (float) alignment +#'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'MopidyTouchscreen.tex', u'Mopidy Touchscreen Documentation', + u'9and3r', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'mopidytouchscreen', u'Mopidy Touchscreen Documentation', + [author], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'MopidyTouchscreen', u'Mopidy Touchscreen Documentation', + author, 'MopidyTouchscreen', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False + +os.path.abspath('../mopidy-touchscreen') diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..b80b82e --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,213 @@ +****************** +Mopidy-Touchscreen +****************** + +.. image:: https://img.shields.io/pypi/v/Mopidy-Touchscreen.svg?style=flat + :target: https://pypi.python.org/pypi/Mopidy-Touchscreen/ + :alt: Latest PyPI version + +.. image:: https://img.shields.io/pypi/dm/Mopidy-Touchscreen.svg?style=flat + :target: https://pypi.python.org/pypi/Mopidy-Touchscreen/ + :alt: Number of PyPI downloads + +.. image:: https://img.shields.io/travis/9and3r/mopidy-touchscreen/develop.svg?style=flat + :target: https://travis-ci.org/9and3r/mopidy-touchscreen + :alt: Travis CI build status + +.. image:: https://img.shields.io/coveralls/9and3r/mopidy-touchscreen/develop.svg?style=flat + :target: https://coveralls.io/r/9and3r/mopidy-touchscreen?branch=develop + :alt: Test coverage + +Extension for displaying track info and controlling Mopidy from a touch screen +using `PyGame `_/SDL. + +Cover images are downloaded from `last.fm `_ + + +Dependencies +============ + +- ``Mopidy`` >= 1.0 +- ``Pykka`` >= 1.1 +- ``pygame`` + + +Installation +============ + +Install by running:: + + pip install Mopidy-Touchscreen + +Or, if available, install the Debian/Ubuntu package from `apt.mopidy.com +`_. + + +Basic Configuration +=================== + +Before starting Mopidy, you must add configuration for +Mopidy-Touchscreen to your Mopidy configuration file:: + + [touchscreen] + enabled = true + screen_width = 320 + screen_height = 240 + cursor = True + fullscreen = False + cache_dir = $XDG_CACHE_DIR/mopidy/touchscreen + +The following configuration values are available: + +- ``touchscreen/enabled``: If the Touchscreen extension should be enabled or + not. + +- ``touchscreen/screen_width``: The width of the resolution you want to use in + pixels. + +- ``touchscreen/screen_height``: The width of the resolution you want to use in + pixels. + +- ``touchscreen/cursor``: If the mouse cursor should be shown. (If you use a + touchscreen it should be false) + +- ``touchscreen/fullscreen``: If you want to be shown as a window or in + fullscreen. + +- ``touchscreen/screen_width``: The folder to be used as cache. Defaults to + ``$XDG_CACHE_DIR/mopidy/touchscreen``, which usually means + ``~/.cache/mopidy/touchscreen`` + + +How to Setup +============ + +Use the basic configuration to setup as most standard screens works fine without further configuration. + +Raspberry Pi and LCD Shields +---------------------------- + +If you are using a LCD Shield in Raspberry Pi you need to config your LCD and run mopidy with root privileges: + +Configure your LCD Shield +````````````````````````` + +Add to the config the next variables:: + + [touchscreen] + sdl_fbdev = /dev/fb1 + sdl_mousdrv = TSLIB + sdl_mousedev = event0 + +This is just an example. It may work but each LCD Shield seems to have its own configuration. +To find your values find an example of using pygame with your LCD Shield and it should be something like this in the code:: + + os.environ["SDL_FBDEV"] = "/dev/fb1" + os.environ["SDL_MOUSEDRV"] = "TSLIB" + os.environ["SDL_MOUSEDEV"] = "event0" + +Run Mopidy with root privileges +``````````````````````````````` + +You can use ``sudo mopidy``. + +In case you are using musicbox edit ``/etc/init.d/mopidy`` file. Change ``DAEMON_USER=mopidy`` to ``DAEMON_USER=root`` + +Do not forget that this is a workaround and that mopidy will run with root privileges. + + +Help +==== + +You can use `mopidy discuss `_ +or send an email to `9and3r@gmail.com `_ + + +Features +======== + +Working +------- + +* See track info (track name, album, artist, cover image) +* Seek Track +* Play/Pause +* Mute/Unmute +* Change volume +* Next/Previous track +* Library +* Menu (exit mopidy, restart...) +* Shuffle on/off +* Repeat one/on/off +* Playback list and song selection +* Playlists + +Planned +------- + +* Use keyboard or GPIO buttons instead of touchscreen + + +Screenshots +=========== + +.. image:: http://i60.tinypic.com/qqsait.jpg + + +Video +===== + +`Example video running the extension `_ + + +Project resources +================= + +- `Source code `_ +- `Issue tracker `_ +- `Download development snapshot `_ + + +Changelog +========= + +v0.4.0 (UNRELEASED) +------------------- + +- Require Mopidy v1.0 +- Update to work with changed core playback API in Mopidy 1.0 + +v0.3.2 (2015-01-09) +------------------- + +- Bug Fixes +- UI changes +- Smoth text scrolling +- Search albums, artist or songs (Not fully implemented. Basic functionality) + +v0.2.1 (2014-08-02) +------------------- + +- Font will be included on installation + +v0.2.0 (2014-08-02) +------------------- + +- First working version + +Contents: + +.. toctree:: + :maxdepth: 2 + +.. automodule:: screens + +.. autoclass:: BaseScreen + :members: + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/source/modules.rst b/docs/source/modules.rst new file mode 100644 index 0000000..7d85217 --- /dev/null +++ b/docs/source/modules.rst @@ -0,0 +1,7 @@ +. += + +.. toctree:: + :maxdepth: 4 + + mopidy_touchscreen diff --git a/docs/source/mopidy_touchscreen.graphic_utils.rst b/docs/source/mopidy_touchscreen.graphic_utils.rst new file mode 100644 index 0000000..b4c8e61 --- /dev/null +++ b/docs/source/mopidy_touchscreen.graphic_utils.rst @@ -0,0 +1,38 @@ +mopidy_touchscreen.graphic_utils package +======================================== + +Submodules +---------- + +mopidy_touchscreen.graphic_utils.background_manager module +---------------------------------------------------------- + +.. automodule:: mopidy_touchscreen.graphic_utils.background_manager + :members: + :undoc-members: + :show-inheritance: + +mopidy_touchscreen.graphic_utils.list_view module +------------------------------------------------- + +.. automodule:: mopidy_touchscreen.graphic_utils.list_view + :members: + :undoc-members: + :show-inheritance: + +mopidy_touchscreen.graphic_utils.screen_objects module +------------------------------------------------------ + +.. automodule:: mopidy_touchscreen.graphic_utils.screen_objects + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: mopidy_touchscreen.graphic_utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/mopidy_touchscreen.input.rst b/docs/source/mopidy_touchscreen.input.rst new file mode 100644 index 0000000..4ffd7e4 --- /dev/null +++ b/docs/source/mopidy_touchscreen.input.rst @@ -0,0 +1,30 @@ +mopidy_touchscreen.input package +================================ + +Submodules +---------- + +mopidy_touchscreen.input.gpio_inpput_manager module +--------------------------------------------------- + +.. automodule:: mopidy_touchscreen.input.gpio_inpput_manager + :members: + :undoc-members: + :show-inheritance: + +mopidy_touchscreen.input.input_manager module +--------------------------------------------- + +.. automodule:: mopidy_touchscreen.input.input_manager + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: mopidy_touchscreen.input + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/mopidy_touchscreen.rst b/docs/source/mopidy_touchscreen.rst new file mode 100644 index 0000000..e60f9cc --- /dev/null +++ b/docs/source/mopidy_touchscreen.rst @@ -0,0 +1,39 @@ +mopidy_touchscreen package +========================== + +Subpackages +----------- + +.. toctree:: + + mopidy_touchscreen.graphic_utils + mopidy_touchscreen.input + mopidy_touchscreen.screens + +Submodules +---------- + +mopidy_touchscreen.screen_manager module +---------------------------------------- + +.. automodule:: mopidy_touchscreen.screen_manager + :members: + :undoc-members: + :show-inheritance: + +mopidy_touchscreen.touch_screen module +-------------------------------------- + +.. automodule:: mopidy_touchscreen.touch_screen + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: mopidy_touchscreen + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/mopidy_touchscreen.screens.rst b/docs/source/mopidy_touchscreen.screens.rst new file mode 100644 index 0000000..53426ab --- /dev/null +++ b/docs/source/mopidy_touchscreen.screens.rst @@ -0,0 +1,78 @@ +mopidy_touchscreen.screens package +================================== + +Submodules +---------- + +mopidy_touchscreen.screens.base_screen module +--------------------------------------------- + +.. automodule:: mopidy_touchscreen.screens.base_screen + :members: + :undoc-members: + :show-inheritance: + +mopidy_touchscreen.screens.keyboard_screen module +------------------------------------------------- + +.. automodule:: mopidy_touchscreen.screens.keyboard_screen + :members: + :undoc-members: + :show-inheritance: + +mopidy_touchscreen.screens.library_screen module +------------------------------------------------ + +.. automodule:: mopidy_touchscreen.screens.library_screen + :members: + :undoc-members: + :show-inheritance: + +mopidy_touchscreen.screens.main_screen module +--------------------------------------------- + +.. automodule:: mopidy_touchscreen.screens.main_screen + :members: + :undoc-members: + :show-inheritance: + +mopidy_touchscreen.screens.menu_screen module +--------------------------------------------- + +.. automodule:: mopidy_touchscreen.screens.menu_screen + :members: + :undoc-members: + :show-inheritance: + +mopidy_touchscreen.screens.playlist_screen module +------------------------------------------------- + +.. automodule:: mopidy_touchscreen.screens.playlist_screen + :members: + :undoc-members: + :show-inheritance: + +mopidy_touchscreen.screens.search_screen module +----------------------------------------------- + +.. automodule:: mopidy_touchscreen.screens.search_screen + :members: + :undoc-members: + :show-inheritance: + +mopidy_touchscreen.screens.tracklist module +------------------------------------------- + +.. automodule:: mopidy_touchscreen.screens.tracklist + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: mopidy_touchscreen.screens + :members: + :undoc-members: + :show-inheritance: