forked from openlp/openlp
Added repeating of the background audio track list.
Migrated the songs plugin configuration tab to use the proper camelCase names.
This commit is contained in:
parent
5cf9a83657
commit
d14a316309
@ -175,6 +175,9 @@ class GeneralTab(SettingsTab):
|
|||||||
self.startPausedCheckBox = QtGui.QCheckBox(self.audioGroupBox)
|
self.startPausedCheckBox = QtGui.QCheckBox(self.audioGroupBox)
|
||||||
self.startPausedCheckBox.setObjectName(u'startPausedCheckBox')
|
self.startPausedCheckBox.setObjectName(u'startPausedCheckBox')
|
||||||
self.audioLayout.addWidget(self.startPausedCheckBox)
|
self.audioLayout.addWidget(self.startPausedCheckBox)
|
||||||
|
self.repeatListCheckBox = QtGui.QCheckBox(self.audioGroupBox)
|
||||||
|
self.repeatListCheckBox.setObjectName(u'repeatListCheckBox')
|
||||||
|
self.audioLayout.addWidget(self.repeatListCheckBox)
|
||||||
self.rightLayout.addWidget(self.audioGroupBox)
|
self.rightLayout.addWidget(self.audioGroupBox)
|
||||||
self.rightLayout.addStretch()
|
self.rightLayout.addStretch()
|
||||||
# Signals and slots
|
# Signals and slots
|
||||||
@ -251,6 +254,8 @@ class GeneralTab(SettingsTab):
|
|||||||
translate('OpenLP.GeneralTab', 'Background Audio'))
|
translate('OpenLP.GeneralTab', 'Background Audio'))
|
||||||
self.startPausedCheckBox.setText(
|
self.startPausedCheckBox.setText(
|
||||||
translate('OpenLP.GeneralTab', 'Start background audio paused'))
|
translate('OpenLP.GeneralTab', 'Start background audio paused'))
|
||||||
|
self.repeatListCheckBox.setText(
|
||||||
|
translate('OpenLP.GeneralTab', 'Repeat track list'))
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
"""
|
"""
|
||||||
@ -298,6 +303,8 @@ class GeneralTab(SettingsTab):
|
|||||||
QtCore.QVariant(self.screens.current[u'size'].width())).toInt()[0])
|
QtCore.QVariant(self.screens.current[u'size'].width())).toInt()[0])
|
||||||
self.startPausedCheckBox.setChecked(settings.value(
|
self.startPausedCheckBox.setChecked(settings.value(
|
||||||
u'audio start paused', QtCore.QVariant(True)).toBool())
|
u'audio start paused', QtCore.QVariant(True)).toBool())
|
||||||
|
self.repeatListCheckBox.setChecked(settings.value(
|
||||||
|
u'audio repeat list', QtCore.QVariant(False)).toBool())
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
||||||
self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
||||||
@ -350,7 +357,9 @@ class GeneralTab(SettingsTab):
|
|||||||
QtCore.QVariant(self.overrideCheckBox.isChecked()))
|
QtCore.QVariant(self.overrideCheckBox.isChecked()))
|
||||||
settings.setValue(u'audio start paused',
|
settings.setValue(u'audio start paused',
|
||||||
QtCore.QVariant(self.startPausedCheckBox.isChecked()))
|
QtCore.QVariant(self.startPausedCheckBox.isChecked()))
|
||||||
settings.endGroup()
|
settings.setValue(u'audio repeat list',
|
||||||
|
QtCore.QVariant(self.repeatListCheckBox.isChecked()))
|
||||||
|
settings.endGroup()
|
||||||
# On save update the screens as well
|
# On save update the screens as well
|
||||||
self.postSetUp(True)
|
self.postSetUp(True)
|
||||||
|
|
||||||
|
@ -493,11 +493,14 @@ class AudioPlayer(QtCore.QObject):
|
|||||||
QtCore.QObject.__init__(self, parent)
|
QtCore.QObject.__init__(self, parent)
|
||||||
self.currentIndex = -1
|
self.currentIndex = -1
|
||||||
self.playlist = []
|
self.playlist = []
|
||||||
|
self.repeat = False
|
||||||
self.mediaObject = Phonon.MediaObject()
|
self.mediaObject = Phonon.MediaObject()
|
||||||
self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory)
|
self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory)
|
||||||
Phonon.createPath(self.mediaObject, self.audioObject)
|
Phonon.createPath(self.mediaObject, self.audioObject)
|
||||||
QtCore.QObject.connect(self.mediaObject,
|
QtCore.QObject.connect(self.mediaObject,
|
||||||
QtCore.SIGNAL(u'aboutToFinish()'), self.onAboutToFinish)
|
QtCore.SIGNAL(u'aboutToFinish()'), self.onAboutToFinish)
|
||||||
|
QtCore.QObject.connect(self.mediaObject,
|
||||||
|
QtCore.SIGNAL(u'finished()'), self.onFinished)
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
"""
|
"""
|
||||||
@ -516,6 +519,14 @@ class AudioPlayer(QtCore.QObject):
|
|||||||
if len(self.playlist) > self.currentIndex:
|
if len(self.playlist) > self.currentIndex:
|
||||||
self.mediaObject.enqueue(self.playlist[self.currentIndex])
|
self.mediaObject.enqueue(self.playlist[self.currentIndex])
|
||||||
|
|
||||||
|
def onFinished(self):
|
||||||
|
if self.repeat:
|
||||||
|
log.debug(u'Repeat is enabled... here we go again!')
|
||||||
|
self.mediaObject.clearQueue()
|
||||||
|
self.mediaObject.clear()
|
||||||
|
self.currentIndex = -1
|
||||||
|
self.play()
|
||||||
|
|
||||||
def connectVolumeSlider(self, slider):
|
def connectVolumeSlider(self, slider):
|
||||||
slider.setAudioOutput(self.audioObject)
|
slider.setAudioOutput(self.audioObject)
|
||||||
|
|
||||||
@ -562,4 +573,3 @@ class AudioPlayer(QtCore.QObject):
|
|||||||
filenames = [filenames]
|
filenames = [filenames]
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
self.playlist.append(Phonon.MediaSource(filename))
|
self.playlist.append(Phonon.MediaSource(filename))
|
||||||
|
|
||||||
|
@ -279,11 +279,26 @@ class SlideController(Controller):
|
|||||||
translate('OpenLP.SlideController', 'Go To'), self.toolbar))
|
translate('OpenLP.SlideController', 'Go To'), self.toolbar))
|
||||||
self.toolbar.makeWidgetsInvisible([u'Song Menu'])
|
self.toolbar.makeWidgetsInvisible([u'Song Menu'])
|
||||||
# Stuff for items with background audio.
|
# Stuff for items with background audio.
|
||||||
self.audioPauseItem = self.toolbar.addToolbarButton(
|
self.audioPauseItem = QtGui.QToolButton(self.toolbar)
|
||||||
u'Pause Audio', u':/slides/media_playback_pause.png',
|
self.audioPauseItem.setIcon(QtGui.QIcon(u':/slides/media_playback_pause.png'))
|
||||||
translate('OpenLP.SlideController', 'Pause audio.'),
|
#u'Pause Audio', ,
|
||||||
self.onAudioPauseClicked, True)
|
self.audioPauseItem.setText(translate('OpenLP.SlideController',
|
||||||
|
'Pause audio.'))
|
||||||
|
self.audioPauseItem.setCheckable(True)
|
||||||
|
self.toolbar.addToolbarWidget(u'Pause Audio', self.audioPauseItem)
|
||||||
|
QtCore.QObject.connect(self.audioPauseItem,
|
||||||
|
QtCore.SIGNAL(u'clicked(bool)'), self.onAudioPauseClicked)
|
||||||
self.audioPauseItem.setVisible(False)
|
self.audioPauseItem.setVisible(False)
|
||||||
|
audioMenu = QtGui.QMenu(
|
||||||
|
translate('OpenLP.SlideController', 'Background Audio'),
|
||||||
|
self.toolbar)
|
||||||
|
trackMenu = audioMenu.addMenu(
|
||||||
|
translate('OpenLP.SlideController', 'Tracks'))
|
||||||
|
trackMenu.addAction('first song')
|
||||||
|
trackMenu.addAction('second song')
|
||||||
|
trackMenu.addAction('third song')
|
||||||
|
self.audioPauseItem.setPopupMode(QtGui.QToolButton.MenuButtonPopup)
|
||||||
|
self.audioPauseItem.setMenu(audioMenu)
|
||||||
# Screen preview area
|
# Screen preview area
|
||||||
self.previewFrame = QtGui.QFrame(self.splitter)
|
self.previewFrame = QtGui.QFrame(self.splitter)
|
||||||
self.previewFrame.setGeometry(QtCore.QRect(0, 0, 300, 300 * self.ratio))
|
self.previewFrame.setGeometry(QtCore.QRect(0, 0, 300, 300 * self.ratio))
|
||||||
@ -715,7 +730,7 @@ class SlideController(Controller):
|
|||||||
Adjusts the value of the ``delaySpinBox`` to the given one.
|
Adjusts the value of the ``delaySpinBox`` to the given one.
|
||||||
"""
|
"""
|
||||||
self.delaySpinBox.setValue(int(value))
|
self.delaySpinBox.setValue(int(value))
|
||||||
|
|
||||||
def updateSlideLimits(self):
|
def updateSlideLimits(self):
|
||||||
"""
|
"""
|
||||||
Updates the Slide Limits variable from the settings.
|
Updates the Slide Limits variable from the settings.
|
||||||
@ -860,10 +875,15 @@ class SlideController(Controller):
|
|||||||
self.display.audioPlayer.reset()
|
self.display.audioPlayer.reset()
|
||||||
self.setAudioItemsVisibility(False)
|
self.setAudioItemsVisibility(False)
|
||||||
self.audioPauseItem.setChecked(False)
|
self.audioPauseItem.setChecked(False)
|
||||||
|
# If the current item has background audio
|
||||||
if self.serviceItem.is_capable(ItemCapabilities.HasBackgroundAudio):
|
if self.serviceItem.is_capable(ItemCapabilities.HasBackgroundAudio):
|
||||||
log.debug(u'Starting to play...')
|
log.debug(u'Starting to play...')
|
||||||
self.display.audioPlayer.addToPlaylist(
|
self.display.audioPlayer.addToPlaylist(
|
||||||
self.serviceItem.background_audio)
|
self.serviceItem.background_audio)
|
||||||
|
self.display.audioPlayer.repeat = QtCore.QSettings().value(
|
||||||
|
self.parent().generalSettingsSection + \
|
||||||
|
u'/audio repeat list',
|
||||||
|
QtCore.QVariant(False)).toBool()
|
||||||
if QtCore.QSettings().value(
|
if QtCore.QSettings().value(
|
||||||
self.parent().generalSettingsSection + \
|
self.parent().generalSettingsSection + \
|
||||||
u'/audio start paused',
|
u'/audio start paused',
|
||||||
|
@ -33,56 +33,56 @@ class SongsTab(SettingsTab):
|
|||||||
"""
|
"""
|
||||||
SongsTab is the Songs settings tab in the settings dialog.
|
SongsTab is the Songs settings tab in the settings dialog.
|
||||||
"""
|
"""
|
||||||
def __init__(self, parent, title, visible_title, icon_path):
|
|
||||||
SettingsTab.__init__(self, parent, title, visible_title, icon_path)
|
|
||||||
|
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
|
"""
|
||||||
|
Set up the configuration tab UI.
|
||||||
|
"""
|
||||||
self.setObjectName(u'SongsTab')
|
self.setObjectName(u'SongsTab')
|
||||||
SettingsTab.setupUi(self)
|
SettingsTab.setupUi(self)
|
||||||
self.SongsModeGroupBox = QtGui.QGroupBox(self.leftColumn)
|
self.modeGroupBox = QtGui.QGroupBox(self.leftColumn)
|
||||||
self.SongsModeGroupBox.setObjectName(u'SongsModeGroupBox')
|
self.modeGroupBox.setObjectName(u'modeGroupBox')
|
||||||
self.SongsModeLayout = QtGui.QVBoxLayout(self.SongsModeGroupBox)
|
self.modeLayout = QtGui.QVBoxLayout(self.modeGroupBox)
|
||||||
self.SongsModeLayout.setObjectName(u'SongsModeLayout')
|
self.modeLayout.setObjectName(u'modeLayout')
|
||||||
self.SearchAsTypeCheckBox = QtGui.QCheckBox(self.SongsModeGroupBox)
|
self.searchAsTypeCheckBox = QtGui.QCheckBox(self.modeGroupBox)
|
||||||
self.SearchAsTypeCheckBox.setObjectName(u'SearchAsTypeCheckBox')
|
self.searchAsTypeCheckBox.setObjectName(u'SearchAsTypeCheckBox')
|
||||||
self.SongsModeLayout.addWidget(self.SearchAsTypeCheckBox)
|
self.modeLayout.addWidget(self.searchAsTypeCheckBox)
|
||||||
self.SongBarActiveCheckBox = QtGui.QCheckBox(self.SongsModeGroupBox)
|
self.toolBarActiveCheckBox = QtGui.QCheckBox(self.modeGroupBox)
|
||||||
self.SongBarActiveCheckBox.setObjectName(u'SongBarActiveCheckBox')
|
self.toolBarActiveCheckBox.setObjectName(u'toolBarActiveCheckBox')
|
||||||
self.SongsModeLayout.addWidget(self.SongBarActiveCheckBox)
|
self.modeLayout.addWidget(self.toolBarActiveCheckBox)
|
||||||
self.SongUpdateOnEditCheckBox = QtGui.QCheckBox(self.SongsModeGroupBox)
|
self.updateOnEditCheckBox = QtGui.QCheckBox(self.modeGroupBox)
|
||||||
self.SongUpdateOnEditCheckBox.setObjectName(u'SongUpdateOnEditCheckBox')
|
self.updateOnEditCheckBox.setObjectName(u'updateOnEditCheckBox')
|
||||||
self.SongsModeLayout.addWidget(self.SongUpdateOnEditCheckBox)
|
self.modeLayout.addWidget(self.updateOnEditCheckBox)
|
||||||
self.SongAddFromServiceCheckBox = QtGui.QCheckBox(
|
self.addFromServiceCheckBox = QtGui.QCheckBox(
|
||||||
self.SongsModeGroupBox)
|
self.modeGroupBox)
|
||||||
self.SongAddFromServiceCheckBox.setObjectName(
|
self.addFromServiceCheckBox.setObjectName(
|
||||||
u'SongAddFromServiceCheckBox')
|
u'addFromServiceCheckBox')
|
||||||
self.SongsModeLayout.addWidget(self.SongAddFromServiceCheckBox)
|
self.modeLayout.addWidget(self.addFromServiceCheckBox)
|
||||||
self.leftLayout.addWidget(self.SongsModeGroupBox)
|
self.leftLayout.addWidget(self.modeGroupBox)
|
||||||
self.leftLayout.addStretch()
|
self.leftLayout.addStretch()
|
||||||
self.rightLayout.addStretch()
|
self.rightLayout.addStretch()
|
||||||
QtCore.QObject.connect(self.SearchAsTypeCheckBox,
|
QtCore.QObject.connect(self.searchAsTypeCheckBox,
|
||||||
QtCore.SIGNAL(u'stateChanged(int)'),
|
QtCore.SIGNAL(u'stateChanged(int)'),
|
||||||
self.onSearchAsTypeCheckBoxChanged)
|
self.onSearchAsTypeCheckBoxChanged)
|
||||||
QtCore.QObject.connect(self.SongBarActiveCheckBox,
|
QtCore.QObject.connect(self.toolBarActiveCheckBox,
|
||||||
QtCore.SIGNAL(u'stateChanged(int)'),
|
QtCore.SIGNAL(u'stateChanged(int)'),
|
||||||
self.onSongBarActiveCheckBoxChanged)
|
self.onToolBarActiveCheckBoxChanged)
|
||||||
QtCore.QObject.connect(self.SongUpdateOnEditCheckBox,
|
QtCore.QObject.connect(self.updateOnEditCheckBox,
|
||||||
QtCore.SIGNAL(u'stateChanged(int)'),
|
QtCore.SIGNAL(u'stateChanged(int)'),
|
||||||
self.onSongUpdateOnEditCheckBoxChanged)
|
self.onUpdateOnEditCheckBoxChanged)
|
||||||
QtCore.QObject.connect(self.SongAddFromServiceCheckBox,
|
QtCore.QObject.connect(self.addFromServiceCheckBox,
|
||||||
QtCore.SIGNAL(u'stateChanged(int)'),
|
QtCore.SIGNAL(u'stateChanged(int)'),
|
||||||
self.onSongAddFromServiceCheckBoxChanged)
|
self.onAddFromServiceCheckBoxChanged)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
self.SongsModeGroupBox.setTitle(
|
self.modeGroupBox.setTitle(
|
||||||
translate('SongsPlugin.SongsTab', 'Songs Mode'))
|
translate('SongsPlugin.SongsTab', 'Songs Mode'))
|
||||||
self.SearchAsTypeCheckBox.setText(
|
self.searchAsTypeCheckBox.setText(
|
||||||
translate('SongsPlugin.SongsTab', 'Enable search as you type'))
|
translate('SongsPlugin.SongsTab', 'Enable search as you type'))
|
||||||
self.SongBarActiveCheckBox.setText(translate('SongsPlugin.SongsTab',
|
self.toolBarActiveCheckBox.setText(translate('SongsPlugin.SongsTab',
|
||||||
'Display verses on live tool bar'))
|
'Display verses on live tool bar'))
|
||||||
self.SongUpdateOnEditCheckBox.setText(
|
self.updateOnEditCheckBox.setText(
|
||||||
translate('SongsPlugin.SongsTab', 'Update service from song edit'))
|
translate('SongsPlugin.SongsTab', 'Update service from song edit'))
|
||||||
self.SongAddFromServiceCheckBox.setText(
|
self.addFromServiceCheckBox.setText(
|
||||||
translate('SongsPlugin.SongsTab',
|
translate('SongsPlugin.SongsTab',
|
||||||
'Add missing songs when opening service'))
|
'Add missing songs when opening service'))
|
||||||
|
|
||||||
@ -92,19 +92,19 @@ class SongsTab(SettingsTab):
|
|||||||
if check_state == QtCore.Qt.Checked:
|
if check_state == QtCore.Qt.Checked:
|
||||||
self.song_search = True
|
self.song_search = True
|
||||||
|
|
||||||
def onSongBarActiveCheckBoxChanged(self, check_state):
|
def onToolBarActiveCheckBoxChanged(self, check_state):
|
||||||
self.song_bar = False
|
self.tool_bar = False
|
||||||
# we have a set value convert to True/False
|
# we have a set value convert to True/False
|
||||||
if check_state == QtCore.Qt.Checked:
|
if check_state == QtCore.Qt.Checked:
|
||||||
self.song_bar = True
|
self.tool_bar = True
|
||||||
|
|
||||||
def onSongUpdateOnEditCheckBoxChanged(self, check_state):
|
def onUpdateOnEditCheckBoxChanged(self, check_state):
|
||||||
self.update_edit = False
|
self.update_edit = False
|
||||||
# we have a set value convert to True/False
|
# we have a set value convert to True/False
|
||||||
if check_state == QtCore.Qt.Checked:
|
if check_state == QtCore.Qt.Checked:
|
||||||
self.update_edit = True
|
self.update_edit = True
|
||||||
|
|
||||||
def onSongAddFromServiceCheckBoxChanged(self, check_state):
|
def onAddFromServiceCheckBoxChanged(self, check_state):
|
||||||
self.update_load = False
|
self.update_load = False
|
||||||
# we have a set value convert to True/False
|
# we have a set value convert to True/False
|
||||||
if check_state == QtCore.Qt.Checked:
|
if check_state == QtCore.Qt.Checked:
|
||||||
@ -115,23 +115,23 @@ class SongsTab(SettingsTab):
|
|||||||
settings.beginGroup(self.settingsSection)
|
settings.beginGroup(self.settingsSection)
|
||||||
self.song_search = settings.value(
|
self.song_search = settings.value(
|
||||||
u'search as type', QtCore.QVariant(False)).toBool()
|
u'search as type', QtCore.QVariant(False)).toBool()
|
||||||
self.song_bar = settings.value(
|
self.tool_bar = settings.value(
|
||||||
u'display songbar', QtCore.QVariant(True)).toBool()
|
u'display songbar', QtCore.QVariant(True)).toBool()
|
||||||
self.update_edit = settings.value(
|
self.update_edit = settings.value(
|
||||||
u'update service on edit', QtCore.QVariant(False)).toBool()
|
u'update service on edit', QtCore.QVariant(False)).toBool()
|
||||||
self.update_load = settings.value(
|
self.update_load = settings.value(
|
||||||
u'add song from service', QtCore.QVariant(True)).toBool()
|
u'add song from service', QtCore.QVariant(True)).toBool()
|
||||||
self.SearchAsTypeCheckBox.setChecked(self.song_search)
|
self.searchAsTypeCheckBox.setChecked(self.song_search)
|
||||||
self.SongBarActiveCheckBox.setChecked(self.song_bar)
|
self.toolBarActiveCheckBox.setChecked(self.tool_bar)
|
||||||
self.SongUpdateOnEditCheckBox.setChecked(self.update_edit)
|
self.updateOnEditCheckBox.setChecked(self.update_edit)
|
||||||
self.SongAddFromServiceCheckBox.setChecked(self.update_load)
|
self.addFromServiceCheckBox.setChecked(self.update_load)
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settingsSection)
|
settings.beginGroup(self.settingsSection)
|
||||||
settings.setValue(u'search as type', QtCore.QVariant(self.song_search))
|
settings.setValue(u'search as type', QtCore.QVariant(self.song_search))
|
||||||
settings.setValue(u'display songbar', QtCore.QVariant(self.song_bar))
|
settings.setValue(u'display songbar', QtCore.QVariant(self.tool_bar))
|
||||||
settings.setValue(u'update service on edit',
|
settings.setValue(u'update service on edit',
|
||||||
QtCore.QVariant(self.update_edit))
|
QtCore.QVariant(self.update_edit))
|
||||||
settings.setValue(u'add song from service',
|
settings.setValue(u'add song from service',
|
||||||
|
Loading…
Reference in New Issue
Block a user