openlp/openlp/core/lib/remote/remotecontroller.py

57 lines
2.7 KiB
Python
Raw Normal View History

2016-06-04 10:50:43 +00:00
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2016 OpenLP Developers #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
2016-06-05 16:20:39 +00:00
import logging
2016-06-05 05:49:27 +00:00
from openlp.core.common import OpenLPMixin, Registry, RegistryMixin, RegistryProperties
2016-06-05 14:56:01 +00:00
from openlp.core.lib.remote import OpenWSServer, OpenLPPoll
2016-06-04 10:50:43 +00:00
2016-06-05 16:20:39 +00:00
log = logging.getLogger(__name__)
2016-06-04 10:50:43 +00:00
2016-06-05 05:49:27 +00:00
class RemoteController(RegistryMixin, OpenLPMixin, RegistryProperties):
"""
The implementation of the Media Controller. The Media Controller adds an own class for every Player.
Currently these are QtWebkit, Phonon and Vlc. display_controllers are an array of controllers keyed on the
slidecontroller or plugin which built them.
2016-06-04 10:50:43 +00:00
2016-06-05 05:49:27 +00:00
ControllerType is the class containing the key values.
2016-06-04 10:50:43 +00:00
2016-06-05 05:49:27 +00:00
media_players are an array of media players keyed on player name.
2016-06-04 10:50:43 +00:00
2016-06-05 05:49:27 +00:00
current_media_players is an array of player instances keyed on ControllerType.
2016-06-04 10:50:43 +00:00
2016-06-05 05:49:27 +00:00
"""
def __init__(self, parent=None):
2016-06-04 10:50:43 +00:00
"""
2016-06-05 05:49:27 +00:00
Constructor
2016-06-04 10:50:43 +00:00
"""
2016-06-05 05:49:27 +00:00
super(RemoteController, self).__init__(parent)
# Registry().register_function('playbackPlay', self.media_play_msg)
def bootstrap_post_set_up(self):
2016-06-04 19:32:50 +00:00
"""
2016-06-05 05:49:27 +00:00
process the bootstrap post setup request
2016-06-04 19:32:50 +00:00
"""
2016-06-05 14:56:01 +00:00
self.poll = OpenLPPoll()
Registry().register('OpenLPPoll', self.poll)
2016-06-05 05:49:27 +00:00
self.wsserver = OpenWSServer()