19#ifndef TIMERULERWIDGET_H
20#define TIMERULERWIDGET_H
36class QContextMenuEvent;
120 void setEvents(
const QVector<TimeRulerEventMark>& events);
128 void setReferenceMarkers(
const QVector<TimeRulerReferenceMark>& markers);
134 void toggleTimeFormat();
142 void setClockTimeFormat(
bool useClock);
145 return m_useClockTime;
155 void setScrollSample(
float sample);
163 void setSamplesPerPixel(
float spp);
197 static double niceTickInterval(
double visibleSeconds,
int targetTicks = 7);
206 static QString formatTime(
double seconds);
215 int sampleAtX(
int x)
const;
225 int nearestReferenceMarkerIndex(
int sample,
int tolerancePixels = 8)
const;
227 double m_sfreq = 1.0;
228 int m_firstFileSample = 0;
229 float m_scrollSample = 0.f;
231 bool m_useClockTime =
false;
233 QVector<TimeRulerEventMark> m_events;
234 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