mediaclipselectorform

class openlp.plugins.media.forms.mediaclipselectorform.MediaClipSelectorForm(media_item, parent, manager)[source]

Bases: PyQt5.QtWidgets.QDialog, openlp.plugins.media.forms.mediaclipselectordialog.Ui_MediaClipSelector, openlp.core.common.registryproperties.RegistryProperties

Class to manage the clip selection

accept()[source]

Saves the current media and trackinfo as a clip to the mediamanager

detect_audio_cd(path)[source]

Detects is the given path is an audio CD

Parameters:path – Path to the device to be tested.
Returns:True if it was an audio CD else False.
disable_all()[source]

Disable all elements in the dialog

exec()[source]

Start dialog

find_optical_devices()[source]

Attempt to autodetect optical devices on the computer, and add them to the media-dropdown :return:

media_state_wait(media_state)[source]

Wait for the video to change its state Wait no longer than 15 seconds. (loading an optical disc takes some time)

Parameters:media_state – VLC media state to wait for.
Returns:True if state was reached within 15 seconds, False if not or error occurred.
on_audio_tracks_combobox_currentIndexChanged(index)[source]

When a new audio track is chosen update audio track bing played by VLC

Parameters:index – The index of the newly chosen audio track.
on_end_timeedit_timeChanged(new_time)[source]

Called when end_timeedit is changed manually

Parameters:new_time – The new time
on_jump_end_button_clicked(clicked)[source]

Set the player position to the position stored in end_timeedit

Parameters:clicked – Given from signal, not used.
on_jump_start_button_clicked(clicked)[source]

Set the player position to the position stored in start_position_edit

Parameters:clicked – Given from signal, not used.
on_load_disc_button_clicked(clicked)[source]

Load the media when the load-button has been clicked

Parameters:clicked – Given from signal, not used.
on_play_button_clicked(clicked)[source]

Toggle the playback

Parameters:clicked – Given from signal, not used.
on_position_slider_sliderMoved(position)[source]

Set player position according to new slider position.

Parameters:position – Position to seek to.
on_set_end_button_clicked(clicked)[source]

Copy the current player position to end_timeedit

Parameters:clicked – Given from signal, not used.
on_set_start_button_clicked(clicked)[source]

Copy the current player position to start_position_edit

Parameters:clicked – Given from signal, not used.
on_start_timeedit_timeChanged(new_time)[source]

Called when start_position_edit is changed manually

Parameters:new_time – The new time
on_subtitle_tracks_combobox_currentIndexChanged(index)[source]

When a new subtitle track is chosen update subtitle track bing played by VLC

Parameters:index – The index of the newly chosen subtitle.
on_titles_combo_box_currentIndexChanged(index)[source]

When a new title is chosen, it is loaded by VLC and info about audio and subtitle tracks is reloaded

Parameters:index – The index of the newly chosen title track.
reject()[source]

Exit Dialog and do not save

reset_ui()[source]

Reset the UI to default values

setup_vlc()[source]

Setup VLC instance and mediaplayer

toggle_disable_load_media(action)[source]

Enable/disable load media combobox and button.

Parameters:action – If True elements are disabled, if False they are enabled.
toggle_disable_player(action)[source]

Enable/disable player elements.

Parameters:action – If True elements are disabled, if False they are enabled.
update_position()[source]

Update slider position and displayed time according to VLC player position.