19#ifndef TIMERULERWIDGET_H
20#define TIMERULERWIDGET_H
36class QContextMenuEvent;
112 void setEvents(
const QVector<TimeRulerEventMark> &events);
120 void setReferenceMarkers(
const QVector<TimeRulerReferenceMark> &markers);
126 void toggleTimeFormat();
134 void setClockTimeFormat(
bool useClock);
144 void setScrollSample(
float sample);
152 void setSamplesPerPixel(
float spp);
186 static double niceTickInterval(
double visibleSeconds,
int targetTicks = 7);
195 static QString formatTime(
double seconds);
204 int sampleAtX(
int x)
const;
214 int nearestReferenceMarkerIndex(
int sample,
int tolerancePixels = 8)
const;
216 double m_sfreq = 1.0;
217 int m_firstFileSample = 0;
218 float m_scrollSample = 0.f;
220 bool m_useClockTime =
false;
222 QVector<TimeRulerEventMark> m_events;
223 QVector<TimeRulerReferenceMark> m_referenceMarkers;
Export macros and build-info hooks for the DISPLIB shared library.
#define DISPSHARED_EXPORT
2-D display widgets and visualisation helpers (charts, topography, colour maps).
Lightweight event mark passed to TimeRulerWidget for the stim lane.
QColor color
Display colour.
QString label
Short text (event type number).
int sample
Absolute sample index.
Lightweight reference/sample marker passed to TimeRulerWidget.
QString label
Short text identifier, e.g. M1.
int sample
Absolute sample index.
QColor color
Display colour.
static constexpr int kTotalH
Total widget height (px).
void setSfreq(double sfreq)
TimeRulerWidget(QWidget *parent=nullptr)
void contextMenuEvent(QContextMenuEvent *event) override
static constexpr int kTimeZoneH
Height of the time-tick zone (px).
bool clockTimeFormat() const
static constexpr int kStimZoneH
Height of the stimulus lane (px).
void setFirstFileSample(int firstFileSample)
void removeReferenceMarkerRequested(int sample)
QSize sizeHint() const override
void addReferenceMarkerRequested(int sample)
QSize minimumSizeHint() const override
void clearReferenceMarkersRequested()
void paintEvent(QPaintEvent *event) override