5 #ifndef CNOID_BASE_TIME_BAR_H
6 #define CNOID_BASE_TIME_BAR_H
8 #include <cnoid/ToolBar>
9 #include "exportdecl.h"
13 class ExtensionManager;
29 SignalProxy<void(
double time)> sigPlaybackStarted();
33 SignalProxy<void(
double time,
bool isStoppedManually)> sigPlaybackStopped();
35 inline double time()
const {
return time_; }
37 bool setTime(
double time);
39 double realPlaybackTime()
const;
41 double minTime()
const;
42 double maxTime()
const;
44 void setTimeRange(
double min,
double max);
46 inline double frameRate()
const {
return frameRate_; }
47 void setFrameRate(
double rate);
49 inline double timeStep()
const {
return 1.0 / frameRate_; }
53 inline double tempo()
const {
return tempo_; }
54 double timeOfBeatLocation(
double beatLocation)
const;
55 double beatLocationOfTime(
double time)
const;
59 double playbackSpeedScale()
const;
60 void setPlaybackSpeedScale(
double scale);
62 double playbackFrameRate()
const;
63 void setPlaybackFrameRate(
double rate);
65 void setRepeatMode(
bool on);
68 void startPlayback(
double time);
69 void stopPlayback(
bool isStoppedManually =
false);
70 bool isDoingPlayback();
72 int startOngoingTimeUpdate(
double time = 0.0);
73 void updateOngoingTime(
int id,
double time);
74 void stopOngoingTimeUpdate(
int id);
75 void setOngoingTimeSyncEnabled(
bool on);
88 virtual int stretchableDefaultWidth()
const;
92 virtual bool storeState(
Archive& archive);
93 virtual bool restoreState(
const Archive& archive);
106 int beatDenominator_;