__init__.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. from __future__ import unicode_literals
  2. import logging
  3. import os
  4. from mopidy import config, ext
  5. from .touch_screen import TouchScreen
  6. from .touch_screen_backend import TouchScreenBackend
  7. __version__ = '0.2.1'
  8. # TODO: If you need to log, use loggers named after the current Python module
  9. logger = logging.getLogger(__name__)
  10. class Extension(ext.Extension):
  11. dist_name = 'Mopidy-Touchscreen'
  12. ext_name = 'touchscreen'
  13. version = __version__
  14. def get_default_config(self):
  15. conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
  16. return config.read(conf_file)
  17. def get_config_schema(self):
  18. schema = super(Extension, self).get_config_schema()
  19. schema['screen_width'] = config.Integer(minimum=1)
  20. schema['screen_height'] = config.Integer(minimum=1)
  21. schema['cursor'] = config.Boolean()
  22. schema['fullscreen'] = config.Boolean()
  23. schema['cache_dir'] = config.Path()
  24. return schema
  25. def setup(self, registry):
  26. registry.add('frontend', TouchScreen)
  27. # Backend used for controling volume
  28. registry.add('backend', TouchScreenBackend)