openlp/openlp/plugins/media/mediaplugin.py

60 lines
2.8 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
2009-12-31 12:52:01 +00:00
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
2009-10-08 05:02:39 +00:00
import logging
from openlp.core.lib import Plugin, build_icon
2009-12-05 09:44:44 +00:00
from openlp.plugins.media.lib import MediaMediaItem
2009-09-21 19:23:51 +00:00
2009-05-15 05:15:53 +00:00
class MediaPlugin(Plugin):
2009-10-08 05:02:39 +00:00
global log
log = logging.getLogger(u'MediaPlugin')
log.info(u'Media Plugin loaded')
def __init__(self, plugin_helpers):
2009-05-15 05:15:53 +00:00
Plugin.__init__(self, u'Media', u'1.9.0', plugin_helpers)
self.weight = -6
self.icon = build_icon(u':/media/media_video.png')
# passed with drag and drop messages
self.dnd_id = u'Media'
2009-10-08 05:02:39 +00:00
def initialise(self):
log.info(u'Plugin Initialising')
Plugin.initialise(self)
2009-10-30 20:34:11 +00:00
self.insert_toolbox_item()
2009-10-08 05:02:39 +00:00
def finalise(self):
log.info(u'Plugin Finalise')
self.remove_toolbox_item()
def get_media_manager_item(self):
# Create the MediaManagerItem object
2009-10-30 17:44:16 +00:00
return MediaMediaItem(self, self.icon, self.name)
2009-10-01 16:56:42 +00:00
def about(self):
about_text = self.trUtf8('<b>Media Plugin</b><br>This plugin '
'allows the playing of audio and video media')
return about_text