diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index 4f4400f81..a17e48ea9 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -106,8 +106,8 @@ class MediaController(RegistryBase, LogMixin, RegistryProperties): else: State().missing_text('media_live', translate('OpenLP.SlideController', 'VLC or pymediainfo are missing, so you are unable to play any media')) - self.service_manager.supported_suffixes(ext[2:] for ext in AUDIO_EXT) - self.service_manager.supported_suffixes(ext[2:] for ext in VIDEO_EXT) + self.service_manager.supported_suffixes(AUDIO_EXT) + self.service_manager.supported_suffixes(VIDEO_EXT) return True def bootstrap_post_set_up(self): diff --git a/openlp/core/ui/media/mediaplayer.py b/openlp/core/ui/media/mediaplayer.py index 3c0b7e873..be88ab549 100644 --- a/openlp/core/ui/media/mediaplayer.py +++ b/openlp/core/ui/media/mediaplayer.py @@ -163,12 +163,6 @@ class MediaPlayer(RegistryProperties): """ return '' - def get_info(self): - """ - Returns Information about the player - """ - return '' - def get_live_state(self): """ Get the state of the live player diff --git a/openlp/core/ui/media/vlcplayer.py b/openlp/core/ui/media/vlcplayer.py index 3f7deac75..da4036bda 100644 --- a/openlp/core/ui/media/vlcplayer.py +++ b/openlp/core/ui/media/vlcplayer.py @@ -42,20 +42,18 @@ from openlp.core.ui.media.mediaplayer import MediaPlayer log = logging.getLogger(__name__) # Audio and video extensions copied from 'include/vlc_interface.h' from vlc 2.2.0 source -AUDIO_EXT = ['*.3ga', '*.669', '*.a52', '*.aac', '*.ac3', '*.adt', '*.adts', '*.aif', '*.aifc', '*.aiff', '*.amr', - '*.aob', '*.ape', '*.awb', '*.caf', '*.dts', '*.flac', '*.it', '*.kar', '*.m4a', '*.m4b', '*.m4p', '*.m5p', - '*.mid', '*.mka', '*.mlp', '*.mod', '*.mpa', '*.mp1', '*.mp2', '*.mp3', '*.mpc', '*.mpga', '*.mus', - '*.oga', '*.ogg', '*.oma', '*.opus', '*.qcp', '*.ra', '*.rmi', '*.s3m', '*.sid', '*.spx', '*.thd', '*.tta', - '*.voc', '*.vqf', '*.w64', '*.wav', '*.wma', '*.wv', '*.xa', '*.xm'] +AUDIO_EXT = ('3ga', '669', 'a52', 'aac', 'ac3', 'adt', 'adts', 'aif', 'aifc', 'aiff', 'amr', 'aob', 'ape', 'awb', 'caf', + 'dts', 'flac', 'it', 'kar', 'm4a', 'm4b', 'm4p', 'm5p', 'mid', 'mka', 'mlp', 'mod', 'mpa', 'mp1', 'mp2', + 'mp3', 'mpc', 'mpga', 'mus', 'oga', 'ogg', 'oma', 'opus', 'qcp', 'ra', 'rmi', 's3m', 'sid', 'spx', 'thd', + 'tta', 'voc', 'vqf', 'w64', 'wav', 'wma', 'wv', 'xa', 'xm') -VIDEO_EXT = ['*.3g2', '*.3gp', '*.3gp2', '*.3gpp', '*.amv', '*.asf', '*.avi', '*.bik', '*.divx', '*.drc', '*.dv', - '*.f4v', '*.flv', '*.gvi', '*.gxf', '*.iso', '*.m1v', '*.m2v', '*.m2t', '*.m2ts', '*.m4v', '*.mkv', - '*.mov', '*.mp2', '*.mp2v', '*.mp4', '*.mp4v', '*.mpe', '*.mpeg', '*.mpeg1', '*.mpeg2', '*.mpeg4', '*.mpg', - '*.mpv2', '*.mts', '*.mtv', '*.mxf', '*.mxg', '*.nsv', '*.nuv', '*.ogg', '*.ogm', '*.ogv', '*.ogx', '*.ps', - '*.rec', '*.rm', '*.rmvb', '*.rpl', '*.thp', '*.tod', '*.ts', '*.tts', '*.txd', '*.vob', '*.vro', '*.webm', - '*.wm', '*.wmv', '*.wtv', '*.xesc', +VIDEO_EXT = ('3g2', '3gp', '3gp2', '3gpp', 'amv', 'asf', 'avi', 'bik', 'divx', 'drc', 'dv', 'f4v', 'flv', 'gvi', 'gxf', + 'iso', 'm1v', 'm2v', 'm2t', 'm2ts', 'm4v', 'mkv', 'mov', 'mp2', 'mp2v', 'mp4', 'mp4v', 'mpe', 'mpeg', + 'mpeg1', 'mpeg2', 'mpeg4', 'mpg', 'mpv2', 'mts', 'mtv', 'mxf', 'mxg', 'nsv', 'nuv', 'ogg', 'ogm', 'ogv', + 'ogx', 'ps', 'rec', 'rm', 'rmvb', 'rpl', 'thp', 'tod', 'ts', 'tts', 'txd', 'vob', 'vro', 'webm', 'wm', + 'wmv', 'wtv', 'xesc', # These extensions was not in the official list, added manually. - '*.nut', '*.rv', '*.xvid'] + 'nut', 'rv', 'xvid') def get_vlc(): @@ -372,14 +370,3 @@ class VlcPlayer(MediaPlayer): else: controller.seek_slider.setSliderPosition(output_display.vlc_media_player.get_time()) controller.seek_slider.blockSignals(False) - - def get_info(self): - """ - Return some information about this player - """ - return(translate('Media.player', 'VLC is an external player which ' - 'supports a number of different formats.') + - '
' + translate('Media.player', 'Audio') + - '
' + str(AUDIO_EXT) + '
' + - translate('Media.player', 'Video') + '
' + - str(VIDEO_EXT) + '
') diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 7394409fa..f165d32dc 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -75,9 +75,8 @@ class ThemeForm(QtWidgets.QWizard, Ui_ThemeWizard, RegistryProperties): self.image_path_edit.filters = \ '{name};;{text} (*)'.format(name=get_images_filter(), text=UiStrings().AllFiles) self.image_path_edit.pathChanged.connect(self.on_image_path_edit_path_changed) - # TODO: Should work - visible_formats = '({name})'.format(name='; '.join(VIDEO_EXT)) - actual_formats = '({name})'.format(name=' '.join(VIDEO_EXT)) + visible_formats = '(*.{name})'.format(name='; *.'.join(VIDEO_EXT)) + actual_formats = '(*.{name})'.format(name=' *.'.join(VIDEO_EXT)) video_filter = '{trans} {visible} {actual}'.format(trans=translate('OpenLP', 'Video Files'), visible=visible_formats, actual=actual_formats) self.video_path_edit.filters = '{video};;{ui} (*)'.format(video=video_filter, ui=UiStrings().AllFiles) diff --git a/tests/functional/openlp_core/ui/media/test_vlcplayer.py b/tests/functional/openlp_core/ui/media/test_vlcplayer.py index 75828de8d..ace896066 100644 --- a/tests/functional/openlp_core/ui/media/test_vlcplayer.py +++ b/tests/functional/openlp_core/ui/media/test_vlcplayer.py @@ -956,20 +956,3 @@ class TestVLCPlayer(TestCase, TestMixin): mocked_controller.seek_slider.setSliderPosition.assert_called_with(300) expected_calls = [call(True), call(False)] assert expected_calls == mocked_controller.seek_slider.blockSignals.call_args_list - - @patch('openlp.core.ui.media.vlcplayer.translate') - def test_get_info(self, mocked_translate): - """ - Test that get_info() returns some information about the VLC player - """ - # GIVEN: A VlcPlayer - mocked_translate.side_effect = lambda *x: x[1] - vlc_player = VlcPlayer(None) - - # WHEN: get_info() is run - info = vlc_player.get_info() - - # THEN: The information should be correct - assert 'VLC is an external player which supports a number of different formats.
' \ - 'Audio
' + str(AUDIO_EXT) + '
Video
' + \ - str(VIDEO_EXT) + '
' == info