40 virtual const char*
what()
const throw() {
return "illegal BBT time (bars or beats were zero, or ticks was too large)"; }
59 bool is_bar()
const {
return beats == 1 && ticks == 0; }
60 bool is_beat()
const {
return ticks == 0; }
62 BBT_Time () : bars (1), beats (1), ticks (0) {}
63 BBT_Time (int32_t ba, uint32_t be, uint32_t t) : bars (ba), beats (be), ticks (t) {
64 if (!bars || !beats) {
70 return bars < other.
bars ||
71 (bars == other.
bars && beats < other.
beats) ||
72 (bars == other.
bars && beats == other.
beats && ticks < other.
ticks);
75 bool operator<= (
const BBT_Time& other)
const {
76 return bars < other.
bars ||
77 (bars <= other.
bars && beats < other.
beats) ||
78 (bars <= other.
bars && beats <= other.
beats && ticks <= other.
ticks);
82 return bars > other.
bars ||
83 (bars == other.
bars && beats > other.
beats) ||
84 (bars == other.
bars && beats == other.
beats && ticks > other.
ticks);
87 bool operator>= (
const BBT_Time& other)
const {
88 return bars > other.
bars ||
89 (bars >= other.
bars && beats > other.
beats) ||
90 (bars >= other.
bars && beats >= other.
beats && ticks >= other.
ticks);
94 return bars == other.
bars && beats == other.
beats && ticks == other.
ticks;
97 bool operator!= (
const BBT_Time& other)
const {
98 return bars != other.
bars || beats != other.
beats || ticks != other.
ticks;
101 bool operator< (
const BBT_Offset& other)
const;
102 bool operator<= (
const BBT_Offset& other)
const;
103 bool operator> (
const BBT_Offset& other)
const;
104 bool operator>= (
const BBT_Offset& other)
const;
106 bool operator!= (
const BBT_Offset& other)
const;
127 o << std::setfill (
'0') << std::right
128 << std::setw (3) << bars <<
"|"
129 << std::setw (2) << beats <<
"|"
130 << std::setw (4) << ticks;
133 std::string
str ()
const {
134 std::ostringstream os;
135 os << bars <<
'|' << beats <<
'|' << ticks;
153 BBT_Offset (int32_t ba, uint32_t be, uint32_t t) : bars (ba), beats (be), ticks (t) {}
177 beats += other.
beats;
178 ticks += other.
ticks;
184 beats -= other.
beats;
185 ticks -= other.
ticks;
197 bars = (int32_t) lrint (bars * factor);
198 beats = (int32_t) lrint (beats * factor);
199 ticks = (int32_t) lrint (ticks * factor);
211 bars = (int32_t) lrint (bars / factor);
212 beats = (int32_t) lrint (beats / factor);
213 ticks = (int32_t) lrint (ticks / factor);
218 return bars < other.
bars ||
219 (bars == other.
bars && beats < other.
beats) ||
220 (bars == other.
bars && beats == other.
beats && ticks < other.
ticks);
224 return bars < other.
bars ||
225 (bars <= other.
bars && beats <= other.
beats) ||
226 (bars <= other.
bars && beats <= other.
beats && ticks <= other.
ticks);
230 return bars > other.
bars ||
231 (bars == other.
bars && beats > other.
beats) ||
232 (bars == other.
bars && beats == other.
beats && ticks > other.
ticks);
236 return bars > other.
bars ||
237 (bars >= other.
bars && beats >= other.
beats) ||
238 (bars >= other.
bars && beats >= other.
beats && ticks >= other.
ticks);
242 return bars == other.
bars && beats == other.
beats && ticks == other.
ticks;
246 return bars != other.
bars || beats != other.
beats || ticks != other.
ticks;
249 operator bool()
const {
250 return bars == 0 && beats == 0 && ticks == 0;
253 std::string
str ()
const {
254 std::ostringstream os;
255 os << bars <<
'|' << beats <<
'|' << ticks;
328 std::numeric_limits<int32_t>::max(),
329 std::numeric_limits<int32_t>::max());
345 std::numeric_limits<int32_t>::max(),
346 std::numeric_limits<int32_t>::max());
358 std::ostringstream ostr;
367 std::ostringstream ostr;
375 std::istringstream istr (str);
391 std::ostringstream ostr;
400 std::ostringstream ostr;
408 std::istringstream istr (str);
bool to_string(ARDOUR::AnyTime const &at, std::string &str)
bool string_to(std::string const &str, ARDOUR::AnyTime &at)
bool operator==(const ProcessorSelection &a, const ProcessorSelection &b)
BBT_Offset operator+(const BBT_Offset &other) const
BBT_Offset & operator/=(double factor)
BBT_Offset & operator*=(double factor)
BBT_Offset & operator/=(int factor)
BBT_Offset(int32_t ba, uint32_t be, uint32_t t)
BBT_Offset & operator+=(const BBT_Offset &other)
BBT_Offset operator-(const BBT_Offset &other) const
BBT_Offset operator-() const
BBT_Offset & operator*=(int factor)
BBT_Offset(BBT_Time const &bbt)
BBT_Offset & operator-=(const BBT_Offset &other)
void print_padded(std::ostream &o) const
int64_t as_integer() const
BBT_Time(int32_t ba, uint32_t be, uint32_t t)
BBT_Time round_down_to_beat() const
bool operator<(const BBT_Time &other) const
BBT_Time round_down_to_bar() const
static BBT_Time from_integer(int64_t)
bool operator<=(const BBT_Time &other) const
BBT_Time prev_bar() const
bool operator==(const BBT_Time &other) const
bool operator>(const BBT_Time &other) const
bool operator>=(const BBT_Time &other) const
bool operator!=(const BBT_Time &other) const
BBT_Time next_bar() const
virtual const char * what() const
static Temporal::BBT_Offset min()
static Temporal::BBT_Time max()
static Temporal::BBT_Offset lowest()
static Temporal::BBT_Time min()
static Temporal::BBT_Time max()
static Temporal::BBT_Time lowest()