openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #22667
[Merge] lp:~tomasgroth/openlp/dvd into lp:openlp
Tomas Groth has proposed merging lp:~tomasgroth/openlp/dvd into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~tomasgroth/openlp/dvd/+merge/209347
Support for optical devices using VLC. It is possible to select a specific clip to play.
--
https://code.launchpad.net/~tomasgroth/openlp/dvd/+merge/209347
Your team OpenLP Core is requested to review the proposed merge of lp:~tomasgroth/openlp/dvd into lp:openlp.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2014-02-25 20:11:48 +0000
+++ openlp/core/lib/serviceitem.py 2014-03-04 22:53:38 +0000
@@ -108,6 +108,8 @@
``CanAutoStartForLive``
The capability to ignore the do not play if display blank flag.
+ ``IsOptical``
+ .Determines is the service_item is based on an optical device
"""
CanPreview = 1
CanEdit = 2
@@ -125,6 +127,7 @@
CanWordSplit = 14
HasBackgroundAudio = 15
CanAutoStartForLive = 16
+ IsOptical = 17
class ServiceItem(object):
@@ -572,7 +575,7 @@
frame = self._raw_frames[row]
except IndexError:
return ''
- if self.is_image():
+ if self.is_image() or self.is_capable(ItemCapabilities.IsOptical):
path_from = frame['path']
else:
path_from = os.path.join(frame['path'], frame['title'])
=== modified file 'openlp/core/ui/media/__init__.py'
--- openlp/core/ui/media/__init__.py 2014-01-11 21:29:01 +0000
+++ openlp/core/ui/media/__init__.py 2014-03-04 22:53:38 +0000
@@ -72,6 +72,9 @@
length = 0
start_time = 0
end_time = 0
+ title_track = 0
+ audio_track = 0
+ subtitle_track = 0
media_type = MediaType()
=== modified file 'openlp/core/ui/media/mediacontroller.py'
--- openlp/core/ui/media/mediacontroller.py 2013-12-31 20:29:03 +0000
+++ openlp/core/ui/media/mediacontroller.py 2014-03-04 22:53:38 +0000
@@ -36,7 +36,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.common import Registry, RegistryMixin, Settings, UiStrings, translate
-from openlp.core.lib import OpenLPToolbar
+from openlp.core.lib import OpenLPToolbar, ItemCapabilities
from openlp.core.lib.ui import critical_error_message_box
from openlp.core.ui.media import MediaState, MediaInfo, MediaType, get_media_players, set_media_players
from openlp.core.ui.media.mediaplayer import MediaPlayer
@@ -393,7 +393,15 @@
controller.media_info.file_info = QtCore.QFileInfo(service_item.get_frame_path())
display = self._define_display(controller)
if controller.is_live:
- is_valid = self._check_file_type(controller, display, service_item)
+ # if this is an optical device use special handling
+ if service_item.is_capable(ItemCapabilities.IsOptical):
+ log.debug('video is optical and live')
+ path = service_item.get_frame_path()
+ (name, title, audio_track, subtitle_track, start, end) = self.parse_optical_path(path)
+ is_valid = self.media_setup_optical(name, title, audio_track, subtitle_track, start, end, display, controller)
+ else :
+ log.debug('video is not optical and live')
+ is_valid = self._check_file_type(controller, display, service_item)
display.override['theme'] = ''
display.override['video'] = True
if controller.media_info.is_background:
@@ -404,12 +412,20 @@
controller.media_info.start_time = service_item.start_time
controller.media_info.end_time = service_item.end_time
elif controller.preview_display:
- is_valid = self._check_file_type(controller, display, service_item)
+ if service_item.is_capable(ItemCapabilities.IsOptical):
+ log.debug('video is optical and preview')
+ path = service_item.get_frame_path()
+ (name, title, audio_track, subtitle_track, start, end) = self.parse_optical_path(path)
+ is_valid = self.media_setup_optical(name, title, audio_track, subtitle_track, start, end, display, controller)
+ else :
+ log.debug('video is not optical and preview')
+ is_valid = self._check_file_type(controller, display, service_item)
if not is_valid:
# Media could not be loaded correctly
critical_error_message_box(translate('MediaPlugin.MediaItem', 'Unsupported File'),
translate('MediaPlugin.MediaItem', 'Unsupported File'))
return False
+ log.debug('video mediatype: ' +str(controller.media_info.media_type))
# dont care about actual theme, set a black background
if controller.is_live and not controller.media_info.is_background:
display.frame.evaluateJavaScript('show_video( "setBackBoard", null, null, null,"visible");')
@@ -462,6 +478,44 @@
log.debug('use %s controller' % self.current_media_players[controller.controller_type])
return True
+ def media_setup_optical(self, filename, title, audio_track, subtitle_track, start, end, display, controller):
+ log.debug('media_setup_optical')
+ if controller is None:
+ controller = self.display_controllers[DisplayControllerType.Plugin]
+ # stop running videos
+ self.media_reset(controller)
+ # Setup media info
+ controller.media_info = MediaInfo()
+ #controller.media_info.volume = 0
+ controller.media_info.file_info = QtCore.QFileInfo(filename)
+ controller.media_info.media_type = MediaType.DVD
+ controller.media_info.start_time = start/1000
+ controller.media_info.end_time = end/1000
+ controller.media_info.length = (end - start)/1000
+ controller.media_info.title_track = title
+ controller.media_info.audio_track = audio_track
+ controller.media_info.subtitle_track = subtitle_track
+ # When called from mediaitem display is None
+ if display is None:
+ display = controller.preview_display
+ # Find vlc player
+ used_players = get_media_players()[0]
+ vlc_player = None
+ for title in used_players:
+ player = self.media_players[title]
+ if player.name == 'vlc':
+ vlc_player = player
+ if vlc_player is None:
+ critical_error_message_box(translate('MediaPlugin.MediaItem', 'VLC player required'),
+ translate('MediaPlugin.MediaItem', 'VLC player required for playback of optical devices'))
+ return False
+ vlc_player.load(display)
+ self.resize(display, vlc_player)
+ self.current_media_players[controller.controller_type] = vlc_player
+ controller.media_info.media_type = MediaType.DVD
+ return True
+
+
def _check_file_type(self, controller, display, service_item):
"""
Select the correct media Player type from the prioritized Player list
@@ -764,3 +818,17 @@
return self._live_controller
live_controller = property(_get_live_controller)
+
+ @staticmethod
+ def parse_optical_path(input):
+ # split the clip info
+ clip_info = input.split(sep=':')
+ title = int(clip_info[1])
+ audio_track = int(clip_info[2])
+ subtitle_track = int(clip_info[3])
+ start = float(clip_info[4])
+ end = float(clip_info[5])
+ filename = clip_info[6]
+ if len(clip_info) > 7:
+ filename += clip_info[7]
+ return filename, title, audio_track, subtitle_track, start, end
=== modified file 'openlp/core/ui/media/vlcplayer.py'
--- openlp/core/ui/media/vlcplayer.py 2013-12-31 20:29:03 +0000
+++ openlp/core/ui/media/vlcplayer.py 2014-03-04 22:53:38 +0000
@@ -39,7 +39,7 @@
from openlp.core.common import Settings
from openlp.core.lib import translate
-from openlp.core.ui.media import MediaState
+from openlp.core.ui.media import MediaState, MediaType
from openlp.core.ui.media.mediaplayer import MediaPlayer
log = logging.getLogger(__name__)
@@ -205,14 +205,35 @@
"""
controller = display.controller
start_time = 0
- if self.state != MediaState.Paused and controller.media_info.start_time > 0:
- start_time = controller.media_info.start_time
+ log.debug('vlc play')
display.vlc_media_player.play()
if not self.media_state_wait(display, vlc.State.Playing):
return False
+ if self.state != MediaState.Paused and controller.media_info.start_time > 0:
+ log.debug('vlc play, starttime set')
+ start_time = controller.media_info.start_time
+ log.debug('mediatype: ' +str(controller.media_info.media_type))
+ # Set tracks for the optical device
+ if controller.media_info.media_type == MediaType.DVD:
+ log.debug('vlc play, playing started')
+ if controller.media_info.title_track > 0:
+ log.debug('vlc play, title_track set: ' + str(controller.media_info.title_track))
+ display.vlc_media_player.set_title(controller.media_info.title_track)
+ display.vlc_media_player.play()
+ if not self.media_state_wait(display, vlc.State.Playing):
+ return False
+ if controller.media_info.audio_track > 0:
+ display.vlc_media_player.audio_set_track(controller.media_info.audio_track)
+ log.debug('vlc play, audio_track set: ' + str(controller.media_info.audio_track))
+ if controller.media_info.subtitle_track > 0:
+ display.vlc_media_player.video_set_spu(controller.media_info.subtitle_track)
+ log.debug('vlc play, subtitle_track set: ' + str(controller.media_info.subtitle_track))
+ if controller.media_info.start_time > 0:
+ log.debug('vlc play, starttime set: ' + str(controller.media_info.start_time))
+ start_time = controller.media_info.start_time
self.volume(display, controller.media_info.volume)
if start_time > 0:
- self.seek(display, controller.media_info.start_time * 1000)
+ self.seek(display, int(start_time * 1000))
controller.media_info.length = int(display.vlc_media_player.get_media().get_duration() / 1000)
controller.seek_slider.setMaximum(controller.media_info.length * 1000)
self.state = MediaState.Playing
=== added directory 'openlp/plugins/media/forms'
=== added file 'openlp/plugins/media/forms/mediaclipselectordialog.py'
--- openlp/plugins/media/forms/mediaclipselectordialog.py 1970-01-01 00:00:00 +0000
+++ openlp/plugins/media/forms/mediaclipselectordialog.py 2014-03-04 22:53:38 +0000
@@ -0,0 +1,190 @@
+from PyQt4 import QtCore, QtGui
+from openlp.core.common import translate
+
+class Ui_MediaClipSelector(object):
+ def setupUi(self, MediaClipSelector):
+ MediaClipSelector.setObjectName("MediaClipSelector")
+ MediaClipSelector.resize(683, 739)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(MediaClipSelector.sizePolicy().hasHeightForWidth())
+ MediaClipSelector.setSizePolicy(sizePolicy)
+ MediaClipSelector.setMinimumSize(QtCore.QSize(683, 686))
+ MediaClipSelector.setFocusPolicy(QtCore.Qt.NoFocus)
+ MediaClipSelector.setAutoFillBackground(False)
+ MediaClipSelector.setInputMethodHints(QtCore.Qt.ImhNone)
+ self.centralwidget = QtGui.QWidget(MediaClipSelector)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
+ self.centralwidget.setSizePolicy(sizePolicy)
+ self.centralwidget.setObjectName("centralwidget")
+ self.gridLayout = QtGui.QGridLayout(self.centralwidget)
+ self.gridLayout.setObjectName("gridLayout")
+ self.close_pushbutton = QtGui.QPushButton(self.centralwidget)
+ self.close_pushbutton.setEnabled(True)
+ self.close_pushbutton.setObjectName("close_pushbutton")
+ self.gridLayout.addWidget(self.close_pushbutton, 10, 4, 1, 1)
+ self.pause_pushbutton = QtGui.QPushButton(self.centralwidget)
+ self.pause_pushbutton.setEnabled(True)
+ self.pause_pushbutton.setText("")
+ icon = QtGui.QIcon()
+ icon.addPixmap(QtGui.QPixmap(":/slides/media_playback_pause.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pause_pushbutton.setIcon(icon)
+ self.pause_pushbutton.setObjectName("pause_pushbutton")
+ self.gridLayout.addWidget(self.pause_pushbutton, 6, 1, 1, 1)
+ self.play_pushbutton = QtGui.QPushButton(self.centralwidget)
+ self.play_pushbutton.setEnabled(True)
+ self.play_pushbutton.setText("")
+ icon1 = QtGui.QIcon()
+ icon1.addPixmap(QtGui.QPixmap(":/slides/media_playback_start.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.play_pushbutton.setIcon(icon1)
+ self.play_pushbutton.setObjectName("play_pushbutton")
+ self.gridLayout.addWidget(self.play_pushbutton, 6, 0, 1, 1)
+ self.media_path_label = QtGui.QLabel(self.centralwidget)
+ self.media_path_label.setEnabled(True)
+ self.media_path_label.setObjectName("media_path_label")
+ self.gridLayout.addWidget(self.media_path_label, 0, 0, 1, 2)
+ self.preview_pushbutton = QtGui.QPushButton(self.centralwidget)
+ self.preview_pushbutton.setEnabled(True)
+ self.preview_pushbutton.setObjectName("preview_pushbutton")
+ self.gridLayout.addWidget(self.preview_pushbutton, 10, 2, 1, 1)
+ self.start_point_label = QtGui.QLabel(self.centralwidget)
+ self.start_point_label.setEnabled(True)
+ self.start_point_label.setObjectName("start_point_label")
+ self.gridLayout.addWidget(self.start_point_label, 7, 0, 1, 2)
+ spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
+ self.gridLayout.addItem(spacerItem, 9, 3, 1, 1)
+ self.start_timeedit = QtGui.QTimeEdit(self.centralwidget)
+ self.start_timeedit.setEnabled(True)
+ self.start_timeedit.setObjectName("start_timeedit")
+ self.gridLayout.addWidget(self.start_timeedit, 7, 2, 1, 1)
+ self.jump_end_pushbutton = QtGui.QPushButton(self.centralwidget)
+ self.jump_end_pushbutton.setEnabled(True)
+ self.jump_end_pushbutton.setObjectName("jump_end_pushbutton")
+ self.gridLayout.addWidget(self.jump_end_pushbutton, 8, 4, 1, 1)
+ self.subtitle_track_label = QtGui.QLabel(self.centralwidget)
+ self.subtitle_track_label.setEnabled(True)
+ self.subtitle_track_label.setObjectName("subtitle_track_label")
+ self.gridLayout.addWidget(self.subtitle_track_label, 4, 0, 1, 2)
+ self.set_end_pushbutton = QtGui.QPushButton(self.centralwidget)
+ self.set_end_pushbutton.setEnabled(True)
+ self.set_end_pushbutton.setObjectName("set_end_pushbutton")
+ self.gridLayout.addWidget(self.set_end_pushbutton, 8, 3, 1, 1)
+ self.set_start_pushbutton = QtGui.QPushButton(self.centralwidget)
+ self.set_start_pushbutton.setEnabled(True)
+ self.set_start_pushbutton.setObjectName("set_start_pushbutton")
+ self.gridLayout.addWidget(self.set_start_pushbutton, 7, 3, 1, 1)
+ self.audio_track_label = QtGui.QLabel(self.centralwidget)
+ self.audio_track_label.setEnabled(True)
+ self.audio_track_label.setObjectName("audio_track_label")
+ self.gridLayout.addWidget(self.audio_track_label, 3, 0, 1, 2)
+ self.load_disc_pushbutton = QtGui.QPushButton(self.centralwidget)
+ self.load_disc_pushbutton.setEnabled(True)
+ self.load_disc_pushbutton.setObjectName("load_disc_pushbutton")
+ self.gridLayout.addWidget(self.load_disc_pushbutton, 0, 4, 1, 1)
+ self.media_position_timeedit = QtGui.QTimeEdit(self.centralwidget)
+ self.media_position_timeedit.setEnabled(True)
+ self.media_position_timeedit.setObjectName("media_position_timeedit")
+ self.gridLayout.addWidget(self.media_position_timeedit, 6, 4, 1, 1)
+ self.end_point_label = QtGui.QLabel(self.centralwidget)
+ self.end_point_label.setEnabled(True)
+ self.end_point_label.setObjectName("end_point_label")
+ self.gridLayout.addWidget(self.end_point_label, 8, 0, 1, 1)
+ self.jump_start_pushbutton = QtGui.QPushButton(self.centralwidget)
+ self.jump_start_pushbutton.setEnabled(True)
+ self.jump_start_pushbutton.setObjectName("jump_start_pushbutton")
+ self.gridLayout.addWidget(self.jump_start_pushbutton, 7, 4, 1, 1)
+ self.end_timeedit = QtGui.QTimeEdit(self.centralwidget)
+ self.end_timeedit.setEnabled(True)
+ self.end_timeedit.setObjectName("end_timeedit")
+ self.gridLayout.addWidget(self.end_timeedit, 8, 2, 1, 1)
+ self.title_label = QtGui.QLabel(self.centralwidget)
+ self.title_label.setEnabled(True)
+ self.title_label.setObjectName("title_label")
+ self.gridLayout.addWidget(self.title_label, 2, 0, 1, 1)
+ self.save_pushbutton = QtGui.QPushButton(self.centralwidget)
+ self.save_pushbutton.setEnabled(True)
+ self.save_pushbutton.setObjectName("save_pushbutton")
+ self.gridLayout.addWidget(self.save_pushbutton, 10, 3, 1, 1)
+ self.media_path_combobox = QtGui.QComboBox(self.centralwidget)
+ self.media_path_combobox.setEnabled(True)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.media_path_combobox.sizePolicy().hasHeightForWidth())
+ self.media_path_combobox.setSizePolicy(sizePolicy)
+ self.media_path_combobox.setEditable(True)
+ self.media_path_combobox.setObjectName("media_path_combobox")
+ self.gridLayout.addWidget(self.media_path_combobox, 0, 2, 1, 2)
+ self.position_horizontalslider = QtGui.QSlider(self.centralwidget)
+ self.position_horizontalslider.setEnabled(True)
+ self.position_horizontalslider.setTracking(False)
+ self.position_horizontalslider.setOrientation(QtCore.Qt.Horizontal)
+ self.position_horizontalslider.setInvertedAppearance(False)
+ self.position_horizontalslider.setObjectName("position_horizontalslider")
+ self.gridLayout.addWidget(self.position_horizontalslider, 6, 2, 1, 2)
+ self.title_combo_box = QtGui.QComboBox(self.centralwidget)
+ self.title_combo_box.setEnabled(True)
+ self.title_combo_box.setProperty("currentText", "")
+ self.title_combo_box.setObjectName("title_combo_box")
+ self.gridLayout.addWidget(self.title_combo_box, 2, 2, 1, 2)
+ self.audio_tracks_combobox = QtGui.QComboBox(self.centralwidget)
+ self.audio_tracks_combobox.setEnabled(True)
+ self.audio_tracks_combobox.setObjectName("audio_tracks_combobox")
+ self.gridLayout.addWidget(self.audio_tracks_combobox, 3, 2, 1, 2)
+ self.subtitle_tracks_combobox = QtGui.QComboBox(self.centralwidget)
+ self.subtitle_tracks_combobox.setEnabled(True)
+ self.subtitle_tracks_combobox.setObjectName("subtitle_tracks_combobox")
+ self.gridLayout.addWidget(self.subtitle_tracks_combobox, 4, 2, 1, 2)
+ self.media_view_frame = QtGui.QFrame(self.centralwidget)
+ self.media_view_frame.setMinimumSize(QtCore.QSize(665, 375))
+ self.media_view_frame.setStyleSheet("background-color:black;")
+ self.media_view_frame.setFrameShape(QtGui.QFrame.StyledPanel)
+ self.media_view_frame.setFrameShadow(QtGui.QFrame.Raised)
+ self.media_view_frame.setObjectName("media_view_frame")
+ self.gridLayout.addWidget(self.media_view_frame, 5, 0, 1, 5)
+ #MediaClipSelector.setCentralWidget(self.centralwidget)
+
+ self.retranslateUi(MediaClipSelector)
+ QtCore.QMetaObject.connectSlotsByName(MediaClipSelector)
+ MediaClipSelector.setTabOrder(self.media_path_combobox, self.load_disc_pushbutton)
+ MediaClipSelector.setTabOrder(self.load_disc_pushbutton, self.title_combo_box)
+ MediaClipSelector.setTabOrder(self.title_combo_box, self.audio_tracks_combobox)
+ MediaClipSelector.setTabOrder(self.audio_tracks_combobox, self.subtitle_tracks_combobox)
+ MediaClipSelector.setTabOrder(self.subtitle_tracks_combobox, self.play_pushbutton)
+ MediaClipSelector.setTabOrder(self.play_pushbutton, self.pause_pushbutton)
+ MediaClipSelector.setTabOrder(self.pause_pushbutton, self.position_horizontalslider)
+ MediaClipSelector.setTabOrder(self.position_horizontalslider, self.media_position_timeedit)
+ MediaClipSelector.setTabOrder(self.media_position_timeedit, self.start_timeedit)
+ MediaClipSelector.setTabOrder(self.start_timeedit, self.set_start_pushbutton)
+ MediaClipSelector.setTabOrder(self.set_start_pushbutton, self.jump_start_pushbutton)
+ MediaClipSelector.setTabOrder(self.jump_start_pushbutton, self.end_timeedit)
+ MediaClipSelector.setTabOrder(self.end_timeedit, self.set_end_pushbutton)
+ MediaClipSelector.setTabOrder(self.set_end_pushbutton, self.jump_end_pushbutton)
+ MediaClipSelector.setTabOrder(self.jump_end_pushbutton, self.preview_pushbutton)
+ MediaClipSelector.setTabOrder(self.preview_pushbutton, self.save_pushbutton)
+ MediaClipSelector.setTabOrder(self.save_pushbutton, self.close_pushbutton)
+
+ def retranslateUi(self, MediaClipSelector):
+ MediaClipSelector.setWindowTitle(translate("MediaPlugin.MediaClipSelector", "Select media clip", None))
+ self.close_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Close", None))
+ self.media_path_label.setText(translate("MediaPlugin.MediaClipSelector", "Media path", None))
+ self.preview_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Preview current clip", None))
+ self.start_point_label.setText(translate("MediaPlugin.MediaClipSelector", "Start point", None))
+ self.start_timeedit.setDisplayFormat(translate("MediaPlugin.MediaClipSelector", "HH:mm:ss.z", None))
+ self.jump_end_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Jump to end point", None))
+ self.subtitle_track_label.setText(translate("MediaPlugin.MediaClipSelector", "Subtitle track", None))
+ self.set_end_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Set current position as end point", None))
+ self.set_start_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Set current position as start point", None))
+ self.audio_track_label.setText(translate("MediaPlugin.MediaClipSelector", "Audio track", None))
+ self.load_disc_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Load disc", None))
+ self.media_position_timeedit.setDisplayFormat(translate("MediaPlugin.MediaClipSelector", "HH:mm:ss.z", None))
+ self.end_point_label.setText(translate("MediaPlugin.MediaClipSelector", "End point", None))
+ self.jump_start_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Jump to start point", None))
+ self.end_timeedit.setDisplayFormat(translate("MediaPlugin.MediaClipSelector", "HH:mm:ss.z", None))
+ self.title_label.setText(translate("MediaPlugin.MediaClipSelector", "Title", None))
+ self.save_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Save current clip", None))
+
=== added file 'openlp/plugins/media/forms/mediaclipselectorform.py'
--- openlp/plugins/media/forms/mediaclipselectorform.py 1970-01-01 00:00:00 +0000
+++ openlp/plugins/media/forms/mediaclipselectorform.py 2014-03-04 22:53:38 +0000
@@ -0,0 +1,379 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
+
+###############################################################################
+# OpenLP - Open Source Lyrics Projection #
+# --------------------------------------------------------------------------- #
+# Copyright (c) 2008-2014 Raoul Snyman #
+# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
+# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
+# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
+# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
+# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
+# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, #
+# Frode Woldsund, Martin Zibricky, Patrick Zimmermann #
+# --------------------------------------------------------------------------- #
+# 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 #
+###############################################################################
+
+import os
+import sys
+import logging
+import time
+from datetime import datetime
+
+
+from PyQt4 import QtCore, QtGui
+
+from openlp.plugins.media.forms.mediaclipselectordialog import Ui_MediaClipSelector
+from openlp.core.lib.ui import critical_error_message_box
+from openlp.core.ui.media.vendor import vlc
+
+log = logging.getLogger(__name__)
+
+
+class MediaClipSelectorForm(QtGui.QDialog, Ui_MediaClipSelector):
+ """
+ Class to manage the clip selection
+ """
+ log.info('%s MediaClipSelectorForm loaded', __name__)
+
+ def __init__(self, media_item, parent, manager):
+ """
+ Constructor
+ """
+ super(MediaClipSelectorForm, self).__init__(parent)
+ self.media_item = media_item
+ self.setupUi(self)
+ self.playback_length = 0
+ self.position_horizontalslider.setMinimum(0)
+ self.disable_all()
+ self.toggle_disable_load_media(False)
+ # most actions auto-connect due to the functions name, so only a few left to do
+ self.close_pushbutton.clicked.connect(self.reject)
+
+ def reject(self):
+ """
+ Exit Dialog and do not save
+ """
+ log.debug ('MediaClipSelectorForm.reject')
+ self.vlc_media_player.stop()
+ QtGui.QDialog.reject(self)
+
+ def exec_(self):
+ """
+ Start dialog
+ """
+ self.setup_vlc()
+ return QtGui.QDialog.exec_(self)
+
+ def setup_vlc(self):
+ """
+ Setup VLC instance and mediaplayer
+ """
+ self.vlc_instance = vlc.Instance()
+ # creating an empty vlc media player
+ self.vlc_media_player = self.vlc_instance.media_player_new()
+ # The media player has to be 'connected' to the QFrame.
+ # (otherwise a video would be displayed in it's own window)
+ # This is platform specific!
+ # You have to give the id of the QFrame (or similar object)
+ # to vlc, different platforms have different functions for this.
+ win_id = int(self.media_view_frame.winId())
+ if sys.platform == "win32":
+ self.vlc_media_player.set_hwnd(win_id)
+ elif sys.platform == "darwin":
+ # We have to use 'set_nsobject' since Qt4 on OSX uses Cocoa
+ # framework and not the old Carbon.
+ self.vlc_media_player.set_nsobject(win_id)
+ else:
+ # for Linux using the X Server
+ self.vlc_media_player.set_xwindow(win_id)
+ self.vlc_media = None
+ # Setup timer every 100 ms to update position
+ self.timer = QtCore.QTimer(self)
+ self.timer.timeout.connect(self.update_position)
+ self.timer.start(100)
+
+ @QtCore.pyqtSlot(bool)
+ def on_load_disc_pushbutton_clicked(self, clicked):
+ """
+ Load the media when the load-button has been clicked
+ """
+ self.disable_all()
+ path = self.media_path_combobox.currentText()
+ if path == '':
+ log.debug('no given path')
+ critical_error_message_box('Error', 'No path was given')
+ self.toggle_disable_load_media(False)
+ return
+ self.vlc_media = self.vlc_instance.media_new_path(path)
+ if not self.vlc_media:
+ log.debug('vlc media player is none')
+ critical_error_message_box('Error', 'An error happened during initialization of VLC player')
+ self.toggle_disable_load_media(False)
+ return
+ # put the media in the media player
+ self.vlc_media_player.set_media(self.vlc_media)
+ self.vlc_media_player.audio_set_mute(True)
+ # start playback to get vlc to parse the media
+ if self.vlc_media_player.play() < 0:
+ log.debug('vlc play returned error')
+ critical_error_message_box('Error', 'An error happen when starting VLC player')
+ self.toggle_disable_load_media(False)
+ return
+ self.vlc_media_player.audio_set_mute(True)
+ #while self.vlc_media_player.get_time() == 0:
+ # if self.vlc_media_player.get_state() == vlc.State.Error:
+ # log.debug('player in error state')
+ # self.toggle_disable_load_media(False)
+ # return
+ # time.sleep(0.1)
+ if not self.media_state_wait(vlc.State.Playing):
+ return
+ self.vlc_media_player.pause()
+ self.vlc_media_player.set_time(0)
+ # Get titles, insert in combobox
+ titles = self.vlc_media_player.video_get_title_description()
+ self.title_combo_box.clear()
+ for title in titles:
+ self.title_combo_box.addItem(title[1].decode(), title[0])
+ # Main title is usually title #1
+ if len(titles) > 1:
+ self.title_combo_box.setCurrentIndex(1)
+ else:
+ self.title_combo_box.setCurrentIndex(0)
+ # Enable audio track combobox if anything is in it
+ if len(titles) > 0:
+ self.title_combo_box.setDisabled(False)
+ self.toggle_disable_load_media(False)
+
+ @QtCore.pyqtSlot(bool)
+ def on_pause_pushbutton_clicked(self, clicked):
+ """
+ Pause the playback
+ """
+ self.vlc_media_player.pause()
+
+ @QtCore.pyqtSlot(bool)
+ def on_play_pushbutton_clicked(self, clicked):
+ """
+ Start the playback
+ """
+ self.vlc_media_player.play()
+
+ @QtCore.pyqtSlot(bool)
+ def on_set_start_pushbutton_clicked(self, clicked):
+ """
+ Copy the current player position to start_timeedit
+ """
+ vlc_ms_pos = self.vlc_media_player.get_time()
+ time = QtCore.QTime()
+ new_pos_time = time.addMSecs(vlc_ms_pos)
+ self.start_timeedit.setTime(new_pos_time)
+
+ @QtCore.pyqtSlot(bool)
+ def on_set_end_pushbutton_clicked(self, clicked):
+ """
+ Copy the current player position to end_timeedit
+ """
+ vlc_ms_pos = self.vlc_media_player.get_time()
+ time = QtCore.QTime()
+ new_pos_time = time.addMSecs(vlc_ms_pos)
+ self.end_timeedit.setTime(new_pos_time)
+
+ @QtCore.pyqtSlot(bool)
+ def on_jump_end_pushbutton_clicked(self, clicked):
+ """
+ Set the player position to the position stored in end_timeedit
+ """
+ end_time = self.end_timeedit.time()
+ end_time_ms = end_time.hour() * 60 * 60 * 1000 + \
+ end_time.minute() * 60 * 1000 + \
+ end_time.second() * 1000 + \
+ end_time.msec()
+ self.vlc_media_player.set_time(end_time_ms)
+
+ @QtCore.pyqtSlot(bool)
+ def on_jump_start_pushbutton_clicked(self, clicked):
+ """
+ Set the player position to the position stored in start_timeedit
+ """
+ start_time = self.start_timeedit.time()
+ start_time_ms = start_time.hour() * 60 * 60 * 1000 + \
+ start_time.minute() * 60 * 1000 + \
+ start_time.second() * 1000 + \
+ start_time.msec()
+ self.vlc_media_player.set_time(start_time_ms)
+
+ @QtCore.pyqtSlot(int)
+ def on_title_combo_box_currentIndexChanged(self, index):
+ """
+ When a new title is chosen, it is loaded by VLC and info about audio and subtitle tracks is reloaded
+ """
+ log.debug('in on_title_combo_box_changed, index: ', str(index))
+ self.vlc_media_player.set_title(index)
+ self.vlc_media_player.set_time(0)
+ self.vlc_media_player.play()
+ self.vlc_media_player.audio_set_mute(True)
+ #while self.vlc_media_player.get_time() == 0:
+ # if self.vlc_media_player.get_state() == vlc.State.Error:
+ # log.debug('player in error state')
+ # return
+ # time.sleep(0.1)
+ if not self.media_state_wait(vlc.State.Playing):
+ return
+ # pause
+ self.vlc_media_player.pause()
+ self.vlc_media_player.set_time(0)
+ # Get audio tracks, insert in combobox
+ audio_tracks = self.vlc_media_player.audio_get_track_description()
+ self.audio_tracks_combobox.clear()
+ for audio_track in audio_tracks:
+ self.audio_tracks_combobox.addItem(audio_track[1].decode(),audio_track[0])
+ # Enable audio track combobox if anything is in it
+ if len(audio_tracks) > 0:
+ self.audio_tracks_combobox.setDisabled(False)
+ # First track is "deactivated", so set to next if it exists
+ if len(audio_tracks) > 1:
+ self.audio_tracks_combobox.setCurrentIndex(1)
+ # Get subtitle tracks, insert in combobox
+ subtitles_tracks = self.vlc_media_player.video_get_spu_description()
+ self.subtitle_tracks_combobox.clear()
+ for subtitle_track in subtitles_tracks:
+ self.subtitle_tracks_combobox.addItem(subtitle_track[1].decode(), subtitle_track[0])
+ # Enable subtitle track combobox is anything in it
+ if len(subtitles_tracks) > 0:
+ self.subtitle_tracks_combobox.setDisabled(False)
+ # First track is "deactivated", so set to next if it exists
+ if len(subtitles_tracks) > 1:
+ self.subtitle_tracks_combobox.setCurrentIndex(1)
+ self.vlc_media_player.audio_set_mute(False)
+ self.playback_length = self.vlc_media_player.get_length()
+ self.position_horizontalslider.setMaximum(self.playback_length)
+ # If a title or audio track is available the player is enabled
+ if self.title_combo_box.count() > 0 or len(audio_tracks) > 0:
+ self.toggle_disable_player(False)
+
+ @QtCore.pyqtSlot(int)
+ def on_audio_tracks_combobox_currentIndexChanged(self, index):
+ """
+ When a new audio track is chosen update audio track bing played by VLC
+ """
+ audio_track = self.audio_tracks_combobox.itemData(index)
+ log.debug('in on_audio_tracks_combobox_currentIndexChanged, index: ', str(index), ' audio_track: ', audio_track)
+ if audio_track and int(audio_track) > 0:
+ self.vlc_media_player.audio_set_track(int(audio_track))
+
+ @QtCore.pyqtSlot(int)
+ def on_subtitle_tracks_combobox_currentIndexChanged(self, index):
+ """
+ When a new subtitle track is chosen update subtitle track bing played by VLC
+ """
+ subtitle_track = self.subtitle_tracks_combobox.itemData(index)
+ log.debug('in on_subtitle_tracks_combobox_currentIndexChanged, index: ', str(index), ' subtitle_track: ', subtitle_track)
+ if subtitle_track:
+ self.vlc_media_player.video_set_spu(int(subtitle_track))
+
+ def on_position_horizontalslider_sliderMoved(self, position):
+ """
+ Set player position according to new slider position.
+ """
+ self.vlc_media_player.set_time(position)
+
+ def update_position(self):
+ """
+ Update slider position and displayed time according to VLC player position.
+ """
+ if self.vlc_media_player:
+ vlc_ms_pos = self.vlc_media_player.get_time()
+ rounded_vlc_ms_pos = int(round(vlc_ms_pos / 100.0) * 100.0)
+ time = QtCore.QTime()
+ new_pos_time = time.addMSecs(rounded_vlc_ms_pos)
+ self.media_position_timeedit.setTime(new_pos_time)
+ self.position_horizontalslider.setSliderPosition(vlc_ms_pos)
+
+ def disable_all(self):
+ """
+ Disable all elements in the dialog
+ """
+ self.toggle_disable_load_media(True)
+ self.title_combo_box.setDisabled(True)
+ self.audio_tracks_combobox.setDisabled(True)
+ self.subtitle_tracks_combobox.setDisabled(True)
+ self.toggle_disable_player(True)
+
+ def toggle_disable_load_media(self, action):
+ """
+ Enable/disable load media combobox and button.
+
+ @param action: If True elements are disabled, if False they are enabled.
+ """
+ self.media_path_combobox.setDisabled(action)
+ self.load_disc_pushbutton.setDisabled(action)
+
+ def toggle_disable_player(self, action):
+ """
+ Enable/disable player elementa.
+
+ @param action: If True elements are disabled, if False they are enabled.
+ """
+ self.play_pushbutton.setDisabled(action)
+ self.pause_pushbutton.setDisabled(action)
+ self.position_horizontalslider.setDisabled(action)
+ self.media_position_timeedit.setDisabled(action)
+ self.start_timeedit.setDisabled(action)
+ self.set_start_pushbutton.setDisabled(action)
+ self.jump_start_pushbutton.setDisabled(action)
+ self.end_timeedit.setDisabled(action)
+ self.set_end_pushbutton.setDisabled(action)
+ self.jump_end_pushbutton.setDisabled(action)
+ self.preview_pushbutton.setDisabled(action)
+ self.save_pushbutton.setDisabled(action)
+
+ @QtCore.pyqtSlot(bool)
+ def on_save_pushbutton_clicked(self, checked):
+ """
+ Saves the current media and trackinfo as a clip to the mediamanager
+ """
+ log.debug('in on_save_pushbutton_clicked')
+ start_time = self.start_timeedit.time()
+ start_time_ms = start_time.hour() * 60 * 60 * 1000 + \
+ start_time.minute() * 60 * 1000 + \
+ start_time.second() * 1000 + \
+ start_time.msec()
+ end_time = self.end_timeedit.time()
+ end_time_ms = end_time.hour() * 60 * 60 * 1000 + \
+ end_time.minute() * 60 * 1000 + \
+ end_time.second() * 1000 + \
+ end_time.msec()
+ title = self.title_combo_box.itemData(self.title_combo_box.currentIndex())
+ audio_track = self.audio_tracks_combobox.itemData(self.audio_tracks_combobox.currentIndex())
+ subtitle_track = self.subtitle_tracks_combobox.itemData(self.subtitle_tracks_combobox.currentIndex())
+ path = self.media_path_combobox.currentText()
+ optical = 'optical:' + str(title) + ':' + str(audio_track) + ':' + str(subtitle_track) + ':' + str(start_time_ms) + ':' + str(end_time_ms) + ':' + path
+ self.media_item.add_optical_clip(optical)
+
+ def media_state_wait(self, media_state):
+ """
+ Wait for the video to change its state
+ Wait no longer than 15 seconds. (loading an iso file needs a long time)
+ """
+ start = datetime.now()
+ while not media_state == self.vlc_media.get_state():
+ if self.vlc_media.get_state() == vlc.State.Error:
+ return False
+ if (datetime.now() - start).seconds > 15:
+ return False
+ return True
=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py 2014-01-11 17:52:01 +0000
+++ openlp/plugins/media/lib/mediaitem.py 2014-03-04 22:53:38 +0000
@@ -33,12 +33,14 @@
from PyQt4 import QtCore, QtGui
from openlp.core.common import Registry, AppLocation, Settings, check_directory_exists, UiStrings, translate
-from openlp.core.lib import ItemCapabilities, MediaManagerItem,MediaType, ServiceItem, ServiceItemContext, \
+from openlp.core.lib import ItemCapabilities, MediaManagerItem, MediaType, ServiceItem, ServiceItemContext, \
build_icon, check_item_selected
from openlp.core.lib.ui import critical_error_message_box, create_horizontal_adjusting_combo_box
from openlp.core.ui import DisplayController, Display, DisplayControllerType
from openlp.core.ui.media import get_media_players, set_media_players
from openlp.core.utils import get_locale_key
+from openlp.plugins.media.forms.mediaclipselectorform import MediaClipSelectorForm
+from openlp.core.ui.media.vlcplayer import VLC_AVAILABLE
log = logging.getLogger(__name__)
@@ -47,7 +49,7 @@
CLAPPERBOARD = ':/media/slidecontroller_multimedia.png'
VIDEO_ICON = build_icon(':/media/media_video.png')
AUDIO_ICON = build_icon(':/media/media_audio.png')
-DVD_ICON = build_icon(':/media/media_video.png')
+OPTICAL_ICON = build_icon(':/media/media_optical.png')
ERROR_ICON = build_icon(':/general/general_delete.png')
@@ -109,6 +111,12 @@
MediaManagerItem.add_list_view_to_toolbar(self)
self.list_view.addAction(self.replace_action)
+ def add_start_header_bar(self):
+ self.load_optical = self.toolbar.add_toolbar_action('load_optical', icon=OPTICAL_ICON, text='Load optical disc',
+ tooltip='Load optical disc', triggers=self.on_load_optical)
+ if not VLC_AVAILABLE:
+ self.load_optical.setDisabled(True)
+
def add_end_header_bar(self):
# Replace backgrounds do not work at present so remove functionality.
self.replace_action = self.toolbar.add_toolbar_action('replace_action', icon=':/slides/slide_blank.png',
@@ -187,22 +195,45 @@
if item is None:
return False
filename = item.data(QtCore.Qt.UserRole)
- if not os.path.exists(filename):
- if not remote:
- # File is no longer present
- critical_error_message_box(
- translate('MediaPlugin.MediaItem', 'Missing Media File'),
- translate('MediaPlugin.MediaItem', 'The file %s no longer exists.') % filename)
- return False
- (path, name) = os.path.split(filename)
- service_item.title = name
- service_item.processor = self.display_type_combo_box.currentText()
- service_item.add_from_command(path, name, CLAPPERBOARD)
- # Only get start and end times if going to a service
- if context == ServiceItemContext.Service:
- # Start media and obtain the length
- if not self.media_controller.media_length(service_item):
- return False
+ log.debug('generate_slide_data, filename: ' + filename)
+ if filename.startswith('optical:'):
+ (name, title, audio_track, subtitle_track, start, end) = self.parse_optical_path(filename)
+ log.debug('generate_slide_data, optical name: ' + name)
+ if not os.path.exists(name):
+ if not remote:
+ # Optical disc is no longer present
+ critical_error_message_box(
+ translate('MediaPlugin.MediaItem', 'Missing Media File'),
+ translate('MediaPlugin.MediaItem', 'The optical disc %s is no longer available.') % name)
+ return False
+ service_item.title = name
+ service_item.processor = self.display_type_combo_box.currentText()
+ service_item.add_from_command(filename, name, OPTICAL_ICON)
+ # Only set start and end times if going to a service
+ #if context == ServiceItemContext.Service:
+ # Set the length
+ self.media_controller.media_setup_optical(name, title, audio_track, subtitle_track, start, end, None, None)
+ service_item.set_media_length((end - start)/1000)
+ service_item.start_time = start/1000
+ service_item.end_time = end/1000
+ service_item.add_capability(ItemCapabilities.IsOptical)
+ else:
+ if not os.path.exists(filename):
+ if not remote:
+ # File is no longer present
+ critical_error_message_box(
+ translate('MediaPlugin.MediaItem', 'Missing Media File'),
+ translate('MediaPlugin.MediaItem', 'The file %s no longer exists.') % filename)
+ return False
+ (path, name) = os.path.split(filename)
+ service_item.title = name
+ service_item.processor = self.display_type_combo_box.currentText()
+ service_item.add_from_command(path, name, CLAPPERBOARD)
+ # Only get start and end times if going to a service
+ if context == ServiceItemContext.Service:
+ # Start media and obtain the length
+ if not self.media_controller.media_length(service_item):
+ return False
service_item.add_capability(ItemCapabilities.CanAutoStartForLive)
service_item.add_capability(ItemCapabilities.RequiresMedia)
if Settings().value(self.settings_section + '/media auto start') == QtCore.Qt.Checked:
@@ -218,6 +249,7 @@
check_directory_exists(self.service_path)
self.load_list(Settings().value(self.settings_section + '/media files'))
self.populate_display_types()
+ self.media_clip_selector_form = MediaClipSelectorForm(self, self.main_window, None)
def rebuild_players(self):
"""
@@ -272,11 +304,19 @@
media.sort(key=lambda file_name: get_locale_key(os.path.split(str(file_name))[1]))
for track in media:
track_info = QtCore.QFileInfo(track)
- if not os.path.exists(track):
+ if track.startswith('optical:'):
+ (file_name, title, audio_track, subtitle_track, start, end) = self.parse_optical_path(track)
+ optical = file_name + '@' + str(title) + ':' + str(start) + '-' + str(end)
+ item_name = QtGui.QListWidgetItem(optical)
+ item_name.setIcon(build_icon(OPTICAL_ICON))
+ item_name.setData(QtCore.Qt.UserRole, track)
+ item_name.setToolTip(optical)
+ elif not os.path.exists(track):
file_name = os.path.split(str(track))[1]
item_name = QtGui.QListWidgetItem(file_name)
item_name.setIcon(ERROR_ICON)
item_name.setData(QtCore.Qt.UserRole, track)
+ item_name.setToolTip(track)
elif track_info.isFile():
file_name = os.path.split(str(track))[1]
item_name = QtGui.QListWidgetItem(file_name)
@@ -285,12 +325,7 @@
else:
item_name.setIcon(VIDEO_ICON)
item_name.setData(QtCore.Qt.UserRole, track)
- else:
- file_name = os.path.split(str(track))[1]
- item_name = QtGui.QListWidgetItem(file_name)
- item_name.setIcon(build_icon(DVD_ICON))
- item_name.setData(QtCore.Qt.UserRole, track)
- item_name.setToolTip(track)
+ item_name.setToolTip(track)
self.list_view.addItem(item_name)
def get_list(self, type=MediaType.Audio):
@@ -314,3 +349,27 @@
if filename.lower().find(string) > -1:
results.append([file, filename])
return results
+
+ def on_load_optical(self):
+ log.debug('in on_load_optical')
+ self.media_clip_selector_form.exec_()
+
+ def add_optical_clip(self, optical):
+ full_list = self.get_file_list()
+ full_list.append(optical)
+ self.load_list([optical])
+ Settings().setValue(self.settings_section + '/media files', self.get_file_list())
+
+ @staticmethod
+ def parse_optical_path(input):
+ # split the clip info
+ clip_info = input.split(sep=':')
+ title = int(clip_info[1])
+ audio_track = int(clip_info[2])
+ subtitle_track = int(clip_info[3])
+ start = float(clip_info[4])
+ end = float(clip_info[5])
+ filename = clip_info[6]
+ if len(clip_info) > 7:
+ filename += clip_info[7]
+ return filename, title, audio_track, subtitle_track, start, end
=== added file 'resources/forms/mediaclipselector.ui'
--- resources/forms/mediaclipselector.ui 1970-01-01 00:00:00 +0000
+++ resources/forms/mediaclipselector.ui 2014-03-04 22:53:38 +0000
@@ -0,0 +1,359 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MediaClipSelector</class>
+ <widget class="QMainWindow" name="MediaClipSelector">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>683</width>
+ <height>739</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>683</width>
+ <height>686</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
+ <property name="windowTitle">
+ <string>Select media clip</string>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="inputMethodHints">
+ <set>Qt::ImhNone</set>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="10" column="4">
+ <widget class="QPushButton" name="close_pushbutton">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Close</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
+ <widget class="QPushButton" name="pause_pushbutton">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>../images/media_playback_pause.png</normaloff>../images/media_playback_pause.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0">
+ <widget class="QPushButton" name="play_pushbutton">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>../images/media_playback_start.png</normaloff>../images/media_playback_start.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" colspan="2">
+ <widget class="QLabel" name="media_path_label">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Media path</string>
+ </property>
+ </widget>
+ </item>
+ <item row="10" column="2">
+ <widget class="QPushButton" name="preview_pushbutton">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Preview current clip</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0" colspan="2">
+ <widget class="QLabel" name="start_point_label">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Start point</string>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="3">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Minimum</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="7" column="2">
+ <widget class="QTimeEdit" name="start_timeedit">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="displayFormat">
+ <string>HH:mm:ss.z</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="4">
+ <widget class="QPushButton" name="jump_end_pushbutton">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Jump to end point</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" colspan="2">
+ <widget class="QLabel" name="subtitle_track_label">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Subtitle track</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="3">
+ <widget class="QPushButton" name="set_end_pushbutton">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Set current position as end point</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="3">
+ <widget class="QPushButton" name="set_start_pushbutton">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Set current position as start point</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" colspan="2">
+ <widget class="QLabel" name="audio_track_label">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Audio track</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4">
+ <widget class="QPushButton" name="load_disc_pushbutton">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Load disc</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="4">
+ <widget class="QTimeEdit" name="media_position_timeedit">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="displayFormat">
+ <string>HH:mm:ss.z</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="0">
+ <widget class="QLabel" name="end_point_label">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>End point</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="4">
+ <widget class="QPushButton" name="jump_start_pushbutton">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Jump to start point</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="2">
+ <widget class="QTimeEdit" name="end_timeedit">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="displayFormat">
+ <string>HH:mm:ss.z</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="title_label">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Title</string>
+ </property>
+ </widget>
+ </item>
+ <item row="10" column="3">
+ <widget class="QPushButton" name="save_pushbutton">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Save current clip</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" colspan="2">
+ <widget class="QComboBox" name="media_path_combobox">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="2" colspan="2">
+ <widget class="QSlider" name="position_horizontalslider">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="tracking">
+ <bool>false</bool>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="invertedAppearance">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" colspan="2">
+ <widget class="QComboBox" name="title_combo_box">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="currentText" stdset="0">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2" colspan="2">
+ <widget class="QComboBox" name="audio_tracks_combobox">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="2" colspan="2">
+ <widget class="QComboBox" name="subtitle_tracks_combobox">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" colspan="5">
+ <widget class="QFrame" name="media_view_frame">
+ <property name="minimumSize">
+ <size>
+ <width>665</width>
+ <height>375</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background-color:black;</string>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <tabstops>
+ <tabstop>media_path_combobox</tabstop>
+ <tabstop>load_disc_pushbutton</tabstop>
+ <tabstop>title_combo_box</tabstop>
+ <tabstop>audio_tracks_combobox</tabstop>
+ <tabstop>subtitle_tracks_combobox</tabstop>
+ <tabstop>play_pushbutton</tabstop>
+ <tabstop>pause_pushbutton</tabstop>
+ <tabstop>position_horizontalslider</tabstop>
+ <tabstop>media_position_timeedit</tabstop>
+ <tabstop>start_timeedit</tabstop>
+ <tabstop>set_start_pushbutton</tabstop>
+ <tabstop>jump_start_pushbutton</tabstop>
+ <tabstop>end_timeedit</tabstop>
+ <tabstop>set_end_pushbutton</tabstop>
+ <tabstop>jump_end_pushbutton</tabstop>
+ <tabstop>preview_pushbutton</tabstop>
+ <tabstop>save_pushbutton</tabstop>
+ <tabstop>close_pushbutton</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
=== added file 'resources/images/media_optical.png'
Binary files resources/images/media_optical.png 1970-01-01 00:00:00 +0000 and resources/images/media_optical.png 2014-03-04 22:53:38 +0000 differ
=== modified file 'resources/images/openlp-2.qrc'
--- resources/images/openlp-2.qrc 2013-04-06 10:20:17 +0000
+++ resources/images/openlp-2.qrc 2014-03-04 22:53:38 +0000
@@ -137,6 +137,7 @@
<file>media_stop.png</file>
<file>media_audio.png</file>
<file>media_video.png</file>
+ <file>media_optical.png</file>
<file>slidecontroller_multimedia.png</file>
<file>auto-start_active.png</file>
<file>auto-start_inactive.png</file>
Follow ups