Main window of the application¶
Interface of the main window¶
Work with video and subtitles¶
- class player_content.PlayerContentMixin[source]¶
Interaction with video and subtitles.
- _seconds_to_readable(src)[source]¶
Converts an interval in seconds into a human readable interval value.
Parameters: src (int or float) – Value of time interval in seconds Returns: Human readable interval value Return type: unicode
- _total_subtitle_fragments()[source]¶
Calculates the total number of subtitle.
Returns: Number of subtitles Return type: int
- edit_answer(output)[source]¶
Prints content of an answer after verification and ephasizes its words with appropriate colors.
Parameters: output (list of tuples) – Result of verification. List of pairs where first value is a symbol and second is an estimation of its correctness
- find_subtitle(first=False)[source]¶
Find an actual subtitle.
Method searches for a subtitle which is appropriate to a current position in the video stream. If there isn’t such subtitle, None will be returned.
Parameters: first (bool) – If True first subtitle will be returned Returns: An actual subtitle or None if there isn’t subtitles Return type: pysrt.srtitem.SubRipItem
- get_statistics()[source]¶
Calculates a part of generic statistical values.
This values are used with values received from verificator.Verificator.get_statistics() to show lesson statistics for user at the end of a lesson.
Returns: Several statistical values Return type: dict
- load_subtitles(event)[source]¶
Loads subtitles file.
Parameters: event (events.LoadSubtitles) – Event that contains path to subtitles file
- load_video(event)[source]¶
Loads video file.
Parameters: event (events.LoadVideo) – Event that contains path to video file
Work with user settings of the interface¶
- class player_settings.PlayerSettingsMixin[source]¶
Settings of the application graphical interface.
- _accept_args(pargs)[source]¶
Handles command line arguments on application start.
Parameters: pargs (argparse.Namespace) – Arguments
- _get_video_slot_size()[source]¶
Calculates sizes available for video widget on the frame.
Returns: Pair of values where first is available width and seconds is available height Return type: tuple
- apply_color_settings()[source]¶
Applies color settings for widgets of player frame: text colors, background colors.
- apply_frame_settings()[source]¶
Applies common and window settings for player frame: languages, window size, window position.
- apply_playback_settings()[source]¶
Applies playback settings for player frame: real time translation, volume level, subtitles shift.
- correct_highlighting()[source]¶
Returns a highlighting color for a correct part of user’s answer.
Returns: Highlighting color for correct text Return type: wx.Colour
Changes the availability of menu items in the playback menu.
Default values of every keyword argument is None, i.e. availability of menu item will remain the same if you will not pass argument for it.
Parameters: - play (bool) – Availability of “Play” menu item.
- pause (bool) – Availability of “Pause” menu item.
- stop (bool) – Availability of “stop” menu item.
- hint (bool) – Availability of “hint” menu item.
- repeat (bool) – Availability of “repeat” menu item.
- get_filters(copy=False)[source]¶
Returns actual regex filters.
Parameters: copy (bool) – To copy dictionary with filters or not Returns: Regex filters Return type: dict
- incorrect_highlighting()[source]¶
Returns a highlighting color for an incorrect part of user’s answer.
Returns: Highlighting color for incorrect text Return type: wx.Colour
- is_learning()[source]¶
Clarifies current working mode of the application.
Returns: True if application works in “learning” mode else False Return type: bool
- learning_language()[source]¶
Returns a code of the language which is studied by user.
Returns: Language code from defaults.Defaults.LANGUAGES Return type: unicode