mne_videobrowser.browsers.SyncableBrowser#

class mne_videobrowser.browsers.SyncableBrowser[source]#

Bases: object

Abstract base interface for browser widgets that can be synchronized.

Defines methods that must be implemented by subclasses. Required signals are defined in two helper classes SyncableBrowserObject and SyncableBrowserWidget below. Actual subclass should inherit from one of these!

NOTE: This class does not inherit from abc.ABC to prevent metaclass conflicts with Qt widgets. Instead, it uses __init_subclass__ to enforce implementation of required methods in subclasses.

Methods

get_current_position(media_idx)

Return the current position index of the specified media.

jump_to_end(media_idx[, signal])

Display the last frame/sample of the specified media.

jump_to_start(media_idx[, signal])

Display the first frame/sample of the specified media.

pause_playback()

Pause playback of the currently playing media.

set_position(position_idx, media_idx[, signal])

Set the current position (frame/sample) for the specified media.

set_sync_status(status, media_idx)

Set the synchronization status for the specified media.

start_playback(media_idx)

Start playing the specified media.

Attributes

is_playing

Return whether the media is currently playing.

set_position(position_idx: int, media_idx: int, signal: bool = True) bool[source]#

Set the current position (frame/sample) for the specified media.

Parameters:
  • position_idx (int) – The position index to display (frame index for video, sample index for audio).

  • media_idx (int) – Index of the media to update.

  • signal (bool, optional) – Whether to emit sigPositionChanged signal, by default True.

Returns:

True if the position was set successfully, False if the position index is out of bounds.

Return type:

bool

jump_to_end(media_idx: int, signal: bool = True) None[source]#

Display the last frame/sample of the specified media.

Parameters:
  • media_idx (int) – Index of the media to jump to the end.

  • signal (bool, optional) – Whether to emit sigPositionChanged signal, by default True.

jump_to_start(media_idx: int, signal: bool = True) None[source]#

Display the first frame/sample of the specified media.

Parameters:
  • media_idx (int) – Index of the media to jump to the start.

  • signal (bool, optional) – Whether to emit sigPositionChanged signal, by default True.

set_sync_status(status: SyncStatus, media_idx: int) None[source]#

Set the synchronization status for the specified media.

Parameters:
  • status (SyncStatus) – The synchronization status to set.

  • media_idx (int) – Index of the media to update.

start_playback(media_idx: int) None[source]#

Start playing the specified media.

Parameters:

media_idx (int) – Index of the media to start playing.

pause_playback() None[source]#

Pause playback of the currently playing media.

get_current_position(media_idx: int) int[source]#

Return the current position index of the specified media.

property is_playing: bool#

Return whether the media is currently playing.