Skip to content

Commit

Permalink
ase/project.cc: set transport tempo when starting playback
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Westerfeld <stefan@space.twc.de>
  • Loading branch information
swesterfeld committed Feb 16, 2024
1 parent 36b7748 commit a7f6dc8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ase/project.cc
Original file line number Diff line number Diff line change
Expand Up @@ -697,12 +697,14 @@ ProjectImpl::start_playback (double autostop)
std::shared_ptr<CallbackS> queuep = std::make_shared<CallbackS>();
for (auto track : tracks_)
track->queue_cmd (*queuep, track->START);
auto job = [proc, queuep, autostop] () {
const TickSignature tsig (tick_sig_);
auto job = [proc, queuep, tsig, autostop] () {
AudioEngine &engine = proc->engine();
const double udmax = 18446744073709549568.0; // max double exactly matching an uint64_t
const uint64_t s = autostop > udmax ? udmax : autostop * engine.sample_rate();
engine.set_autostop (s);
AudioTransport &transport = const_cast<AudioTransport&> (engine.transport());
transport.tempo (tsig);
transport.running (true);
for (const auto &cmd : *queuep)
cmd();
Expand Down

0 comments on commit a7f6dc8

Please sign in to comment.