diff --git a/openlp/plugins/media/forms/mediaclipselectordialog.py b/openlp/plugins/media/forms/mediaclipselectordialog.py index a6718fbf2..921c68a8d 100644 --- a/openlp/plugins/media/forms/mediaclipselectordialog.py +++ b/openlp/plugins/media/forms/mediaclipselectordialog.py @@ -1,3 +1,31 @@ +# -*- 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 # +############################################################################### from PyQt4 import QtCore, QtGui from openlp.core.common import translate @@ -23,92 +51,6 @@ class Ui_MediaClipSelector(object): 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) @@ -119,26 +61,76 @@ class Ui_MediaClipSelector(object): 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.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.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.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.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) + spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) + self.gridLayout.addItem(spacerItem, 9, 3, 1, 1) + self.play_pushbutton = QtGui.QPushButton(self.centralwidget) + self.play_pushbutton.setEnabled(True) + self.play_pushbutton.setText("") + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(":/slides/media_playback_start.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.play_pushbutton.setIcon(icon) + self.play_pushbutton.setObjectName("play_pushbutton") + self.gridLayout.addWidget(self.play_pushbutton, 6, 0, 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.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.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.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.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.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.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.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) + 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.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.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.media_view_frame = QtGui.QFrame(self.centralwidget) self.media_view_frame.setMinimumSize(QtCore.QSize(665, 375)) self.media_view_frame.setStyleSheet("background-color:black;") @@ -146,6 +138,30 @@ class Ui_MediaClipSelector(object): 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) + 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.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.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.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.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, 1, 1, 3) #MediaClipSelector.setCentralWidget(self.centralwidget) self.retranslateUi(MediaClipSelector) @@ -155,8 +171,7 @@ class Ui_MediaClipSelector(object): 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.play_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) @@ -164,27 +179,25 @@ class Ui_MediaClipSelector(object): 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.jump_end_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.set_start_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Set current position as start point", None)) + self.load_disc_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Load disc", None)) + self.end_point_label.setText(translate("MediaPlugin.MediaClipSelector", "End point", None)) self.title_label.setText(translate("MediaPlugin.MediaClipSelector", "Title", None)) + self.set_end_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Set current position as end point", None)) self.save_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Save current clip", None)) + self.close_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Close", None)) + self.start_point_label.setText(translate("MediaPlugin.MediaClipSelector", "Start point", None)) + self.jump_start_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Jump to start point", None)) + self.audio_track_label.setText(translate("MediaPlugin.MediaClipSelector", "Audio track", None)) + self.media_position_timeedit.setDisplayFormat(translate("MediaPlugin.MediaClipSelector", "HH:mm:ss.z", None)) + self.subtitle_track_label.setText(translate("MediaPlugin.MediaClipSelector", "Subtitle track", None)) + self.jump_end_pushbutton.setText(translate("MediaPlugin.MediaClipSelector", "Jump to end point", None)) + self.media_path_label.setText(translate("MediaPlugin.MediaClipSelector", "Media path", None)) diff --git a/openlp/plugins/media/forms/mediaclipselectorform.py b/openlp/plugins/media/forms/mediaclipselectorform.py index 7e912ab05..6cda4a494 100644 --- a/openlp/plugins/media/forms/mediaclipselectorform.py +++ b/openlp/plugins/media/forms/mediaclipselectorform.py @@ -68,6 +68,11 @@ class MediaClipSelectorForm(QtGui.QDialog, Ui_MediaClipSelector): 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) + # setup play/pause icon + self.play_icon = QtGui.QIcon() + self.play_icon.addPixmap(QtGui.QPixmap(":/slides/media_playback_start.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.pause_icon = QtGui.QIcon() + self.pause_icon.addPixmap(QtGui.QPixmap(":/slides/media_playback_pause.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) def reject(self): """ @@ -174,23 +179,20 @@ class MediaClipSelectorForm(QtGui.QDialog, Ui_MediaClipSelector): 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 - - :param clicked: Given from signal, not used. - """ - self.vlc_media_player.pause() - @QtCore.pyqtSlot(bool) def on_play_pushbutton_clicked(self, clicked): """ - Start the playback + Toggle the playback :param clicked: Given from signal, not used. """ - self.vlc_media_player.play() + if self.vlc_media_player.get_state() == vlc.State.Playing: + self.vlc_media_player.pause() + self.play_pushbutton.setIcon(self.play_icon) + else: + self.vlc_media_player.play() + self.media_state_wait(vlc.State.Playing) + self.play_pushbutton.setIcon(self.pause_icon) @QtCore.pyqtSlot(bool) def on_set_start_pushbutton_clicked(self, clicked): @@ -394,7 +396,6 @@ class MediaClipSelectorForm(QtGui.QDialog, Ui_MediaClipSelector): :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) @@ -403,7 +404,6 @@ class MediaClipSelectorForm(QtGui.QDialog, Ui_MediaClipSelector): 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) diff --git a/resources/forms/mediaclipselector.ui b/resources/forms/mediaclipselector.ui index 4cd8f518d..754161eae 100644 --- a/resources/forms/mediaclipselector.ui +++ b/resources/forms/mediaclipselector.ui @@ -42,71 +42,59 @@ - - + + true - - Close + + + 0 + 0 + + + + true - - + + true - - - - - - ../images/media_playback_pause.png../images/media_playback_pause.png + + HH:mm:ss.z - - + + true - - - - - - ../images/media_playback_start.png../images/media_playback_start.png + + HH:mm:ss.z - - + + true - Media path + Set current position as start point - - + + true - Preview current clip - - - - - - - true - - - Start point + Load disc @@ -126,83 +114,17 @@ - - - - true - - - HH:mm:ss.z - - - - - + + true - Jump to end point + - - - - - - true - - - Subtitle track - - - - - - - true - - - Set current position as end point - - - - - - - true - - - Set current position as start point - - - - - - - true - - - Audio track - - - - - - - true - - - Load disc - - - - - - - true - - - HH:mm:ss.z + + + ../images/media_playback_start.png../images/media_playback_start.png @@ -216,24 +138,11 @@ - - + + true - - Jump to start point - - - - - - - true - - - HH:mm:ss.z - @@ -246,6 +155,23 @@ + + + + true + + + + + + + true + + + Set current position as end point + + + @@ -256,60 +182,54 @@ - - + + true - - - 0 - 0 - - - - true + + Close - - + + true - - false - - - Qt::Horizontal - - - false + + Start point - - + + true - - + + Jump to start point - - + + true + + Audio track + - - + + true + + HH:mm:ss.z + @@ -331,6 +251,62 @@ + + + + true + + + Subtitle track + + + + + + + true + + + Jump to end point + + + + + + + true + + + Media path + + + + + + + true + + + + + + + + + + true + + + false + + + Qt::Horizontal + + + false + + + @@ -341,7 +317,6 @@ audio_tracks_combobox subtitle_tracks_combobox play_pushbutton - pause_pushbutton position_horizontalslider media_position_timeedit start_timeedit @@ -350,7 +325,6 @@ end_timeedit set_end_pushbutton jump_end_pushbutton - preview_pushbutton save_pushbutton close_pushbutton diff --git a/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py b/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py index 16670232c..9484e92a7 100644 --- a/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py +++ b/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py @@ -130,6 +130,7 @@ class TestMediaClipSelectorForm(TestCase, TestMixin): # GIVEN: Mocked methods and some entries in the title combobox. with patch('PyQt4.QtGui.QDialog.exec_') as mocked_exec: self.form.exec_() + self.form.vlc_media_player.get_length.return_value = 1000 self.form.audio_tracks_combobox.itemData = MagicMock() self.form.subtitle_tracks_combobox.itemData = MagicMock() self.form.audio_tracks_combobox.itemData.return_value = None @@ -138,7 +139,7 @@ class TestMediaClipSelectorForm(TestCase, TestMixin): self.form.title_combo_box.insertItem(1, 'Test Title 1') # WHEN: There exists audio and subtitle tracks and the index is updated. - self.form.vlc_media_player.audio_get_track_description.return_value = [(-1, b'Disabled'), + self.form.vlc_media_player.audio_get_track_description.return_value = [(-1, b'Disabled'), (0, b'Audio Track 1')] self.form.vlc_media_player.video_get_spu_description.return_value = [(-1, b'Disabled'), (0, b'Subtitle Track 1')]