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 authored and tim-janik committed Mar 3, 2024
1 parent e617d9a commit 715b400
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 @@ -701,12 +701,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 715b400

Please sign in to comment.