2008-12-14 16:19:28 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
|
|
|
|
2009-09-08 19:58:05 +00:00
|
|
|
###############################################################################
|
|
|
|
# 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 #
|
2009-11-30 20:29:26 +00:00
|
|
|
# Gorven, Scott Guerrieri, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
|
|
|
# Carsten Tinggaard #
|
2009-09-08 19:58:05 +00:00
|
|
|
# --------------------------------------------------------------------------- #
|
|
|
|
# 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 #
|
|
|
|
###############################################################################
|
2008-12-14 16:19:28 +00:00
|
|
|
|
2009-10-08 05:02:39 +00:00
|
|
|
import logging
|
|
|
|
|
2009-11-30 20:29:26 +00:00
|
|
|
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')
|
2009-03-02 22:12:14 +00:00
|
|
|
|
2009-03-22 07:13:34 +00:00
|
|
|
def __init__(self, plugin_helpers):
|
2009-05-15 05:15:53 +00:00
|
|
|
Plugin.__init__(self, u'Media', u'1.9.0', plugin_helpers)
|
2008-12-14 19:50:17 +00:00
|
|
|
self.weight = -6
|
2009-11-30 20:29:26 +00:00
|
|
|
self.icon = build_icon(u':/media/media_video.png')
|
2009-06-26 17:51:43 +00:00
|
|
|
# passed with drag and drop messages
|
2009-09-29 02:54:32 +00:00
|
|
|
self.dnd_id = u'Media'
|
2009-02-28 23:19:45 +00:00
|
|
|
|
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()
|
|
|
|
|
2008-12-14 19:50:17 +00:00
|
|
|
def get_media_manager_item(self):
|
2008-12-14 16:19:28 +00:00
|
|
|
# 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):
|
2009-11-26 18:43:49 +00:00
|
|
|
about_text = self.trUtf8('<b>Media Plugin</b><br>This plugin '
|
|
|
|
'allows the playing of audio and video media')
|
2010-02-03 17:23:33 +00:00
|
|
|
return about_text
|