2 Copyright (C) 2004 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "ardour/audioengine.h"
24 #include "ardour/audio_backend.h"
25 #include "ardour/session.h"
26 #include "ardour/transport_master.h"
31 using namespace ARDOUR;
33 Engine_TransportMaster::Engine_TransportMaster (AudioEngine& e)
34 : TransportMaster (Engine, X_("JACK"))
41 Engine_TransportMaster::~Engine_TransportMaster ()
46 Engine_TransportMaster::init ()
51 Engine_TransportMaster::check_backend()
53 if (AudioEngine::instance()->current_backend_name() == X_("JACK")) {
61 Engine_TransportMaster::reset (bool)
67 Engine_TransportMaster::locked() const
73 Engine_TransportMaster::ok() const
79 Engine_TransportMaster::pre_process (pframes_t, samplepos_t, boost::optional<samplepos_t>)
85 Engine_TransportMaster::speed_and_position (double& sp, samplepos_t& position, samplepos_t& lp, samplepos_t & when, samplepos_t now)
87 boost::shared_ptr<AudioBackend> backend = engine.current_backend();
89 /* 3rd argument (now) doesn't matter here because we're always being
90 * called synchronously with the engine.
93 if (backend && backend->speed_and_position (sp, position)) {
106 Engine_TransportMaster::position_string () const
109 return PBD::to_string (_session->audible_sample());
112 return std::string();
116 Engine_TransportMaster::delta_string () const
122 Engine_TransportMaster::allow_request (TransportRequestSource src, TransportRequestType type) const
125 if (_session->config.get_jack_time_master()) {
136 Engine_TransportMaster::update_interval () const
138 return AudioEngine::instance()->samples_per_cycle();