forked from openlp/openlp
r1410
This commit is contained in:
commit
9279ab8052
@ -4,6 +4,7 @@ recursive-include openlp *.csv
|
|||||||
recursive-include openlp *.html
|
recursive-include openlp *.html
|
||||||
recursive-include openlp *.js
|
recursive-include openlp *.js
|
||||||
recursive-include openlp *.css
|
recursive-include openlp *.css
|
||||||
|
recursive-include openlp *.png
|
||||||
recursive-include documentation *
|
recursive-include documentation *
|
||||||
recursive-include resources *
|
recursive-include resources *
|
||||||
recursive-include scripts *
|
recursive-include scripts *
|
||||||
|
@ -183,8 +183,9 @@ class ServiceItem(object):
|
|||||||
else:
|
else:
|
||||||
log.error(u'Invalid value renderer :%s' % self.service_item_type)
|
log.error(u'Invalid value renderer :%s' % self.service_item_type)
|
||||||
self.title = clean_tags(self.title)
|
self.title = clean_tags(self.title)
|
||||||
# The footer should never be None, but to be compatible with older
|
# The footer should never be None, but to be compatible with a few
|
||||||
# release of OpenLP, we have to correct this to avoid tracebacks.
|
# nightly builds between 1.9.4 and 1.9.5, we have to correct this to
|
||||||
|
# avoid tracebacks.
|
||||||
if self.raw_footer is None:
|
if self.raw_footer is None:
|
||||||
self.raw_footer = []
|
self.raw_footer = []
|
||||||
self.foot_text = \
|
self.foot_text = \
|
||||||
@ -448,3 +449,4 @@ class ServiceItem(object):
|
|||||||
return end
|
return end
|
||||||
else:
|
else:
|
||||||
return u'%s : %s' % (start, end)
|
return u'%s : %s' % (start, end)
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
Phonon.createPath(self.mediaObject, self.audio)
|
Phonon.createPath(self.mediaObject, self.audio)
|
||||||
QtCore.QObject.connect(self.mediaObject,
|
QtCore.QObject.connect(self.mediaObject,
|
||||||
QtCore.SIGNAL(u'stateChanged(Phonon::State, Phonon::State)'),
|
QtCore.SIGNAL(u'stateChanged(Phonon::State, Phonon::State)'),
|
||||||
self.videoStart)
|
self.videoState)
|
||||||
QtCore.QObject.connect(self.mediaObject,
|
QtCore.QObject.connect(self.mediaObject,
|
||||||
QtCore.SIGNAL(u'finished()'),
|
QtCore.SIGNAL(u'finished()'),
|
||||||
self.videoFinished)
|
self.videoFinished)
|
||||||
@ -378,11 +378,13 @@ class MainDisplay(DisplayWidget):
|
|||||||
Receiver.send_message(u'maindisplay_active')
|
Receiver.send_message(u'maindisplay_active')
|
||||||
return self.preview()
|
return self.preview()
|
||||||
|
|
||||||
def videoStart(self, newState, oldState):
|
def videoState(self, newState, oldState):
|
||||||
"""
|
"""
|
||||||
Start the video at a predetermined point.
|
Start the video at a predetermined point.
|
||||||
"""
|
"""
|
||||||
if newState == Phonon.PlayingState:
|
if newState == Phonon.PlayingState \
|
||||||
|
and oldState != Phonon.PausedState \
|
||||||
|
and self.serviceItem.start_time > 0:
|
||||||
# set start time in milliseconds
|
# set start time in milliseconds
|
||||||
self.mediaObject.seek(self.serviceItem.start_time * 1000)
|
self.mediaObject.seek(self.serviceItem.start_time * 1000)
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@ class SlideList(QtGui.QTableWidget):
|
|||||||
QtGui.QTableWidget.__init__(self, parent.controller)
|
QtGui.QTableWidget.__init__(self, parent.controller)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
|
||||||
|
|
||||||
class SlideController(QtGui.QWidget):
|
class SlideController(QtGui.QWidget):
|
||||||
"""
|
"""
|
||||||
SlideController is the slide controller widget. This widget is what the
|
SlideController is the slide controller widget. This widget is what the
|
||||||
@ -858,6 +857,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.serviceItem.bg_image_bytes = None
|
self.serviceItem.bg_image_bytes = None
|
||||||
self.slidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
self.slidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||||
self.selectedRow = row
|
self.selectedRow = row
|
||||||
|
self.__checkUpdateSelectedSlide(row)
|
||||||
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
|
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
|
||||||
row)
|
row)
|
||||||
|
|
||||||
|
@ -54,9 +54,6 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'video_background_replaced'),
|
QtCore.SIGNAL(u'video_background_replaced'),
|
||||||
self.videobackgroundReplaced)
|
self.videobackgroundReplaced)
|
||||||
QtCore.QObject.connect(self.mediaObject,
|
|
||||||
QtCore.SIGNAL(u'stateChanged(Phonon::State, Phonon::State)'),
|
|
||||||
self.videoStart)
|
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media')
|
self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media')
|
||||||
@ -125,40 +122,66 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
if item is None:
|
if item is None:
|
||||||
return False
|
return False
|
||||||
filename = unicode(item.data(QtCore.Qt.UserRole).toString())
|
filename = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||||
if os.path.exists(filename):
|
if not os.path.exists(filename):
|
||||||
self.mediaState = None
|
|
||||||
self.mediaObject.stop()
|
|
||||||
self.mediaObject.clearQueue()
|
|
||||||
self.mediaObject.setCurrentSource(Phonon.MediaSource(filename))
|
|
||||||
self.mediaObject.play()
|
|
||||||
service_item.title = unicode(self.plugin.nameStrings[u'singular'])
|
|
||||||
service_item.add_capability(ItemCapabilities.RequiresMedia)
|
|
||||||
# force a nonexistent theme
|
|
||||||
service_item.theme = -1
|
|
||||||
frame = u':/media/image_clapperboard.png'
|
|
||||||
(path, name) = os.path.split(filename)
|
|
||||||
file_size = os.path.getsize(filename)
|
|
||||||
# File too big for processing
|
|
||||||
if file_size <= 52428800: # 50MiB
|
|
||||||
start = datetime.now()
|
|
||||||
while not self.mediaState:
|
|
||||||
Receiver.send_message(u'openlp_process_events')
|
|
||||||
tme = datetime.now() - start
|
|
||||||
if tme.seconds > 5:
|
|
||||||
break
|
|
||||||
if self.mediaState:
|
|
||||||
service_item.media_length = self.mediaLength
|
|
||||||
service_item.add_capability(
|
|
||||||
ItemCapabilities.AllowsVariableStartTime)
|
|
||||||
service_item.add_from_command(path, name, frame)
|
|
||||||
return True
|
|
||||||
else:
|
|
||||||
# File is no longer present
|
# File is no longer present
|
||||||
critical_error_message_box(
|
critical_error_message_box(
|
||||||
translate('MediaPlugin.MediaItem', 'Missing Media File'),
|
translate('MediaPlugin.MediaItem', 'Missing Media File'),
|
||||||
unicode(translate('MediaPlugin.MediaItem',
|
unicode(translate('MediaPlugin.MediaItem',
|
||||||
'The file %s no longer exists.')) % filename)
|
'The file %s no longer exists.')) % filename)
|
||||||
return False
|
return False
|
||||||
|
self.mediaObject.stop()
|
||||||
|
self.mediaObject.clearQueue()
|
||||||
|
self.mediaObject.setCurrentSource(Phonon.MediaSource(filename))
|
||||||
|
if not self.mediaStateWait(Phonon.StoppedState):
|
||||||
|
# Due to string freeze, borrow a message from presentations
|
||||||
|
# This will be corrected in 1.9.6
|
||||||
|
critical_error_message_box(
|
||||||
|
translate('PresentationPlugin.MediaItem', 'Unsupported File'),
|
||||||
|
unicode(translate('PresentationPlugin.MediaItem',
|
||||||
|
'Unsupported File')))
|
||||||
|
return False
|
||||||
|
# File too big for processing
|
||||||
|
if os.path.getsize(filename) <= 52428800: # 50MiB
|
||||||
|
self.mediaObject.play()
|
||||||
|
if not self.mediaStateWait(Phonon.PlayingState) \
|
||||||
|
or self.mediaObject.currentSource().type() \
|
||||||
|
== Phonon.MediaSource.Invalid:
|
||||||
|
# Due to string freeze, borrow a message from presentations
|
||||||
|
# This will be corrected in 1.9.6
|
||||||
|
self.mediaObject.stop()
|
||||||
|
critical_error_message_box(
|
||||||
|
translate('PresentationPlugin.MediaItem',
|
||||||
|
'Unsupported File'),
|
||||||
|
unicode(translate('PresentationPlugin.MediaItem',
|
||||||
|
'Unsupported File')))
|
||||||
|
return False
|
||||||
|
self.mediaLength = self.mediaObject.totalTime() / 1000
|
||||||
|
self.mediaObject.stop()
|
||||||
|
service_item.media_length = self.mediaLength
|
||||||
|
service_item.add_capability(
|
||||||
|
ItemCapabilities.AllowsVariableStartTime)
|
||||||
|
service_item.title = unicode(self.plugin.nameStrings[u'singular'])
|
||||||
|
service_item.add_capability(ItemCapabilities.RequiresMedia)
|
||||||
|
# force a non-existent theme
|
||||||
|
service_item.theme = -1
|
||||||
|
frame = u':/media/image_clapperboard.png'
|
||||||
|
(path, name) = os.path.split(filename)
|
||||||
|
service_item.add_from_command(path, name, frame)
|
||||||
|
return True
|
||||||
|
|
||||||
|
def mediaStateWait(self, mediaState):
|
||||||
|
"""
|
||||||
|
Wait for the video to change its state
|
||||||
|
Wait no longer than 5 seconds.
|
||||||
|
"""
|
||||||
|
start = datetime.now()
|
||||||
|
while self.mediaObject.state() != mediaState:
|
||||||
|
if self.mediaObject.state() == Phonon.ErrorState:
|
||||||
|
return False
|
||||||
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
if (datetime.now() - start).seconds > 5:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def initialise(self):
|
def initialise(self):
|
||||||
self.listView.clear()
|
self.listView.clear()
|
||||||
@ -187,12 +210,3 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
item_name.setIcon(build_icon(img))
|
item_name.setIcon(build_icon(img))
|
||||||
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file))
|
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file))
|
||||||
self.listView.addItem(item_name)
|
self.listView.addItem(item_name)
|
||||||
|
|
||||||
def videoStart(self, newState, oldState):
|
|
||||||
"""
|
|
||||||
Start the video at a predetermined point.
|
|
||||||
"""
|
|
||||||
if newState == Phonon.PlayingState:
|
|
||||||
self.mediaState = newState
|
|
||||||
self.mediaLength = self.mediaObject.totalTime()/1000
|
|
||||||
self.mediaObject.stop()
|
|
||||||
|
@ -275,14 +275,33 @@ def clean_song(manager, song):
|
|||||||
sxml = SongXML()
|
sxml = SongXML()
|
||||||
# Rebuild the song's verses, to remove any wrong verse names (for example
|
# Rebuild the song's verses, to remove any wrong verse names (for example
|
||||||
# translated ones), which might have been added prior to 1.9.5.
|
# translated ones), which might have been added prior to 1.9.5.
|
||||||
|
# List for later comparison.
|
||||||
|
compare_order = []
|
||||||
for verse in verses:
|
for verse in verses:
|
||||||
|
type = VerseType.Tags[VerseType.from_loose_input(verse[0][u'type'])]
|
||||||
sxml.add_verse_to_lyrics(
|
sxml.add_verse_to_lyrics(
|
||||||
VerseType.Tags[VerseType.from_loose_input(verse[0][u'type'])],
|
type,
|
||||||
verse[0][u'label'],
|
verse[0][u'label'],
|
||||||
verse[1],
|
verse[1],
|
||||||
verse[0][u'lang'] if verse[0].has_key(u'lang') else None
|
verse[0][u'lang'] if verse[0].has_key(u'lang') else None
|
||||||
)
|
)
|
||||||
|
compare_order.append((u'%s%s' % (type, verse[0][u'label'])).upper())
|
||||||
song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
|
song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
|
||||||
|
# Rebuild the verse order, to convert translated verse tags, which might
|
||||||
|
# have been added prior to 1.9.5.
|
||||||
|
order = song.verse_order.strip().split()
|
||||||
|
new_order = []
|
||||||
|
for verse_def in order:
|
||||||
|
new_order.append((u'%s%s' % (
|
||||||
|
VerseType.Tags[VerseType.from_loose_input(verse_def[0])],
|
||||||
|
verse_def[1:])).upper()
|
||||||
|
)
|
||||||
|
song.verse_order = u' '.join(new_order)
|
||||||
|
# Check if the verse order contains tags for verses which do not exist.
|
||||||
|
for order in new_order:
|
||||||
|
if order not in compare_order:
|
||||||
|
song.verse_order = u''
|
||||||
|
break
|
||||||
# The song does not have any author, add one.
|
# The song does not have any author, add one.
|
||||||
if not song.authors:
|
if not song.authors:
|
||||||
name = SongStrings.AuthorUnknown
|
name = SongStrings.AuthorUnknown
|
||||||
|
36
setup.py
36
setup.py
@ -62,7 +62,41 @@ setup(
|
|||||||
description="Open source Church presentation and lyrics projection application.",
|
description="Open source Church presentation and lyrics projection application.",
|
||||||
long_description="""\
|
long_description="""\
|
||||||
OpenLP (previously openlp.org) is free church presentation software, or lyrics projection software, used to display slides of songs, Bible verses, videos, images, and even presentations (if PowerPoint is installed) for church worship using a computer and a data projector.""",
|
OpenLP (previously openlp.org) is free church presentation software, or lyrics projection software, used to display slides of songs, Bible verses, videos, images, and even presentations (if PowerPoint is installed) for church worship using a computer and a data projector.""",
|
||||||
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
|
classifiers=[
|
||||||
|
'Development Status :: 4 - Beta',
|
||||||
|
'Environment :: MacOS X',
|
||||||
|
'Environment :: Win32 (MS Windows)',
|
||||||
|
'Environment :: X11 Applications',
|
||||||
|
'Environment :: X11 Applications :: Qt',
|
||||||
|
'Intended Audience :: End Users/Desktop',
|
||||||
|
'Intended Audience :: Religion',
|
||||||
|
'License :: OSI Approved :: GNU General Public License (GPL)',
|
||||||
|
'Natural Language :: Afrikaans',
|
||||||
|
'Natural Language :: Dutch',
|
||||||
|
'Natural Language :: English',
|
||||||
|
'Natural Language :: French',
|
||||||
|
'Natural Language :: German',
|
||||||
|
'Natural Language :: Hungarian',
|
||||||
|
'Natural Language :: Indonesian',
|
||||||
|
'Natural Language :: Japanese',
|
||||||
|
'Natural Language :: Norwegian',
|
||||||
|
'Natural Language :: Portuguese (Brazilian)',
|
||||||
|
'Natural Language :: Russian',
|
||||||
|
'Natural Language :: Swedish',
|
||||||
|
'Operating System :: MacOS :: MacOS X',
|
||||||
|
'Operating System :: Microsoft :: Windows',
|
||||||
|
'Operating System :: POSIX :: BSD :: FreeBSD',
|
||||||
|
'Operating System :: POSIX :: Linux',
|
||||||
|
'Programming Language :: Python',
|
||||||
|
'Programming Language :: Python :: 2',
|
||||||
|
'Topic :: Desktop Environment :: Gnome',
|
||||||
|
'Topic :: Desktop Environment :: K Desktop Environment (KDE)',
|
||||||
|
'Topic :: Multimedia',
|
||||||
|
'Topic :: Multimedia :: Graphics :: Presentation',
|
||||||
|
'Topic :: Multimedia :: Sound/Audio',
|
||||||
|
'Topic :: Multimedia :: Video',
|
||||||
|
'Topic :: Religion'
|
||||||
|
], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||||
keywords='open source church presentation lyrics projection song bible display project',
|
keywords='open source church presentation lyrics projection song bible display project',
|
||||||
author='Raoul Snyman',
|
author='Raoul Snyman',
|
||||||
author_email='raoulsnyman@openlp.org',
|
author_email='raoulsnyman@openlp.org',
|
||||||
|
Loading…
Reference in New Issue
Block a user