35#ifndef TIMERULERWIDGET_H
36#define TIMERULERWIDGET_H
52class QContextMenuEvent;
133 void setEvents(
const QVector<TimeRulerEventMark> &events);
141 void setReferenceMarkers(
const QVector<TimeRulerReferenceMark> &markers);
147 void toggleTimeFormat();
155 void setClockTimeFormat(
bool useClock);
165 void setScrollSample(
float sample);
173 void setSamplesPerPixel(
float spp);
207 static double niceTickInterval(
double visibleSeconds,
int targetTicks = 7);
216 static QString formatTime(
double seconds);
225 int sampleAtX(
int x)
const;
235 int nearestReferenceMarkerIndex(
int sample,
int tolerancePixels = 8)
const;
237 double m_sfreq = 1.0;
238 int m_firstFileSample = 0;
239 float m_scrollSample = 0.f;
241 bool m_useClockTime =
false;
243 QVector<TimeRulerEventMark> m_events;
244 QVector<TimeRulerReferenceMark> m_referenceMarkers;
disp library export/import macros.
#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