control surfaces: fix BasicUI::jump_by_bars() to use tempo map correctly
This commit is contained in:
parent
b97c5f94c6
commit
9adc336d50
@ -548,19 +548,15 @@ BasicUI::jump_by_seconds (double secs, LocateTransportDisposition ltd)
|
|||||||
void
|
void
|
||||||
BasicUI::jump_by_bars (int bars, LocateTransportDisposition ltd)
|
BasicUI::jump_by_bars (int bars, LocateTransportDisposition ltd)
|
||||||
{
|
{
|
||||||
TempoMap::SharedPtr tmap (TempoMap::use());
|
TempoMap::SharedPtr tmap (TempoMap::fetch());
|
||||||
Temporal::BBT_Time bbt (tmap->bbt_at (timepos_t (session->transport_sample())));
|
Temporal::BBT_Time bbt (tmap->bbt_at (timepos_t (session->transport_sample())));
|
||||||
|
|
||||||
bars += bbt.bars;
|
bbt.bars += bbt.bars;
|
||||||
if (bars < 0) {
|
if (bbt.bars < 0) {
|
||||||
bars = 0;
|
bbt.bars = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
AnyTime any;
|
session->request_locate (tmap->sample_at (bbt, session->sample_rate()), ltd);
|
||||||
any.type = AnyTime::BBT;
|
|
||||||
any.bbt.bars = bars;
|
|
||||||
|
|
||||||
session->request_locate (session->convert_to_samples (any), ltd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user