Skip to main content

TimeScrollBar

TimeScrollBar

#include <TimeScrollBar.hpp>

Inherits from QWidget

Public Signals

Name
void timeChanged(TimePosition position)
Emitted when user scrubs the timeline (includes TimeFrame pointer).
void timeChanged(int x)
Deprecated signal for backward compatibility.

Public Functions

Name
TimeScrollBar(std::shared_ptr< DataManager > data_manager, std::shared_ptr< TimeScrollBarState > state, QWidget * parent =[nullptr])
Construct TimeScrollBar with EditorState support.
TimeScrollBar(QWidget * parent =[nullptr])
Legacy constructor without state (backward compatible).
~TimeScrollBar() override
void setDataManager(std::shared_ptr< DataManager > data_manager)
Set the DataManager and register for notifications.
void updateScrollBarNewMax(int new_max)
void changeScrollBarValue(int new_value, bool relative =false)
int getFrameJumpValue() const
void PlayButton()
void setEditorRegistry(EditorRegistry * registry)
Set the EditorRegistry for time synchronization.
void setKeymapManager(KeymapSystem::KeymapManager * manager)
Set the KeymapManager and register the adapter for timeline actions.
void setTimeFrame(std::shared_ptr< TimeFrame > const & tf, TimeKey display_key =TimeKey(“time”))
Set which TimeFrame this scrollbar controls.
void setFrameFilter(std::unique_ptr< FrameFilter > filter)
Install a frame filter for skip-frame-during-playback behaviour.

Public Signals Documentation

signal timeChanged

void timeChanged(
    TimePosition position
)

Emitted when user scrubs the timeline (includes TimeFrame pointer).

This is the preferred signal for time changes. It includes the TimePosition which contains both the index and the TimeFrame pointer for clock identity.

signal timeChanged

void timeChanged(
    int x
)

Deprecated signal for backward compatibility.

Deprecated:

Use timeChanged(TimePosition) instead

Public Functions Documentation

function TimeScrollBar

explicit TimeScrollBar(
    std::shared_ptr< DataManager > data_manager,
    std::shared_ptr< TimeScrollBarState > state,
    QWidget * parent =nullptr
)

Construct TimeScrollBar with EditorState support.

Parameters:

TimeScrollBar constructor with EditorState support.

This is the preferred constructor when using EditorRegistry. The state manages serializable configuration and enables workspace save/restore.

function TimeScrollBar

explicit TimeScrollBar(
    QWidget * parent =nullptr
)

Legacy constructor without state (backward compatible).

Deprecated:

Use the constructor with TimeScrollBarState instead

Legacy TimeScrollBar constructor (backward compatible).

function ~TimeScrollBar

~TimeScrollBar() override

function setDataManager

void setDataManager(
    std::shared_ptr< DataManager > data_manager
)

Set the DataManager and register for notifications.

Parameters:

When a DataManager is set, TimeScrollBar will listen for notifications and automatically update its timeframe when data changes.

function updateScrollBarNewMax

void updateScrollBarNewMax(
    int new_max
)

function changeScrollBarValue

void changeScrollBarValue(
    int new_value,
    bool relative =false
)

function getFrameJumpValue

int getFrameJumpValue() const

function PlayButton

void PlayButton()

function setEditorRegistry

void setEditorRegistry(
    EditorRegistry * registry
)

Set the EditorRegistry for time synchronization.

Parameters:

TimeScrollBar will call EditorRegistry::setCurrentTime() when the user scrubs the timeline, ensuring all widgets stay synchronized.

function setKeymapManager

void setKeymapManager(
    KeymapSystem::KeymapManager * manager
)

Set the KeymapManager and register the adapter for timeline actions.

Parameters:

  • manager The KeymapManager to register with (must outlive TimeScrollBar)

Creates a KeyActionAdapter that handles play_pause, next_frame, prev_frame, jump_forward, and jump_backward actions dispatched by the KeymapSystem.

function setTimeFrame

void setTimeFrame(
    std::shared_ptr< TimeFrame > const & tf,
    TimeKey display_key =TimeKey("time")
)

Set which TimeFrame this scrollbar controls.

Parameters:

  • tf The TimeFrame to control (can be nullptr)
  • display_key The TimeKey for UI display (defaults to “time”)

Updates the scrollbar to control the specified TimeFrame. The display_key is used for UI labels (e.g., “Camera Time”, “Ephys Clock”).

function setFrameFilter

void setFrameFilter(
    std::unique_ptr< FrameFilter > filter
)

Install a frame filter for skip-frame-during-playback behaviour.

Parameters:

  • filter Owning pointer to the new filter, or nullptr to clear.

Replaces any previously installed filter. Pass nullptr to disable filtering. The filter’s TimeFrame is automatically updated when the scrollbar’s own TimeFrame changes.


Updated on 2026-11-13 at 20:25:39 +0000