summaryrefslogtreecommitdiff
path: root/libs/ardour/audioengine.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/audioengine.cc')
-rw-r--r--libs/ardour/audioengine.cc72
1 files changed, 36 insertions, 36 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index d6d3b45d18..64f4481c6c 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -171,7 +171,7 @@ AudioEngine::set_jack_callbacks ()
} else {
jack_on_shutdown (_priv_jack, halted, this);
}
-
+
jack_set_thread_init_callback (_priv_jack, _thread_init_callback, this);
jack_set_process_thread (_priv_jack, _process_thread, this);
jack_set_sample_rate_callback (_priv_jack, _sample_rate_callback, this);
@@ -187,7 +187,7 @@ AudioEngine::set_jack_callbacks ()
jack_set_timebase_callback (_priv_jack, 0, _jack_timebase_callback, this);
}
-#ifdef HAVE_JACK_SESSION
+#ifdef HAVE_JACK_SESSION
if( jack_set_session_callback)
jack_set_session_callback (_priv_jack, _session_callback, this);
#endif
@@ -231,7 +231,7 @@ AudioEngine::start ()
* this is reliable, but not clean.
*/
- if (!jack_port_type_get_buffer_size) {
+ if (!jack_port_type_get_buffer_size) {
jack_bufsize_callback (blocksize);
}
@@ -426,7 +426,7 @@ AudioEngine::_connect_callback (jack_port_id_t id_a, jack_port_id_t id_b, int co
}
++i;
}
-
+
ae->PortConnectedOrDisconnected (port_a, port_b, conn == 0 ? false : true); /* EMIT SIGNAL */
}
@@ -449,7 +449,7 @@ AudioEngine::split_cycle (pframes_t offset)
void*
AudioEngine::process_thread ()
{
- /* JACK doesn't do this for us when we use the wait API
+ /* JACK doesn't do this for us when we use the wait API
*/
_thread_init_callback (0);
@@ -528,7 +528,7 @@ AudioEngine::process_callback (pframes_t nframes)
if (_freewheeling && !Freewheel.empty()) {
- /* emit the Freewheel signal and stop freewheeling in the event of trouble
+ /* emit the Freewheel signal and stop freewheeling in the event of trouble
*/
boost::optional<int> r = Freewheel (nframes);
if (r.get_value_or (0)) {
@@ -656,25 +656,25 @@ AudioEngine::jack_bufsize_callback (pframes_t nframes)
} else {
/* Old version of JACK.
-
+
These crude guesses, see below where we try to get the right answers.
-
+
Note that our guess for MIDI deliberatey tries to overestimate
by a little. It would be nicer if we could get the actual
- size from a port, but we have to use this estimate in the
+ size from a port, but we have to use this estimate in the
event that there are no MIDI ports currently. If there are
the value will be adjusted below.
*/
-
+
_raw_buffer_sizes[DataType::AUDIO] = nframes * sizeof (Sample);
_raw_buffer_sizes[DataType::MIDI] = nframes * 4 - (nframes/2);
}
- {
+ {
Glib::Mutex::Lock lm (_process_lock);
-
+
boost::shared_ptr<Ports> p = ports.reader();
-
+
for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
(*i)->reset();
}
@@ -725,25 +725,25 @@ void
AudioEngine::set_session (Session *s)
{
Glib::Mutex::Lock pl (_process_lock);
-
+
SessionHandlePtr::set_session (s);
if (_session) {
start_metering_thread ();
-
+
pframes_t blocksize = jack_get_buffer_size (_jack);
-
+
/* page in as much of the session process code as we
can before we really start running.
*/
-
+
boost::shared_ptr<Ports> p = ports.reader();
-
+
for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
(*i)->cycle_start (blocksize);
}
-
+
_session->process (blocksize);
_session->process (blocksize);
_session->process (blocksize);
@@ -752,12 +752,12 @@ AudioEngine::set_session (Session *s)
_session->process (blocksize);
_session->process (blocksize);
_session->process (blocksize);
-
+
for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
(*i)->cycle_end (blocksize);
}
}
-}
+}
void
AudioEngine::remove_session ()
@@ -1047,17 +1047,17 @@ void
AudioEngine::halted_info (jack_status_t code, const char* reason, void *arg)
{
/* called from jack shutdown handler */
-
+
AudioEngine* ae = static_cast<AudioEngine *> (arg);
bool was_running = ae->_running;
-
+
ae->stop_metering_thread ();
-
+
ae->_running = false;
ae->_buffer_size = 0;
ae->_frame_rate = 0;
ae->_jack = 0;
-
+
if (was_running) {
#ifdef HAVE_JACK_ON_INFO_SHUTDOWN
switch (code) {
@@ -1128,7 +1128,7 @@ ChanCount
AudioEngine::n_physical (unsigned long flags) const
{
ChanCount c;
-
+
GET_PRIVATE_JACK_POINTER_RET (_jack, c);
const char ** ports = jack_get_ports (_priv_jack, NULL, NULL, JackPortIsPhysical | flags);
@@ -1249,7 +1249,7 @@ AudioEngine::freewheel (bool onoff)
if (onoff != _freewheeling) {
return jack_set_freewheel (_priv_jack, onoff);
-
+
} else {
/* already doing what has been asked for */
return 0;
@@ -1262,7 +1262,7 @@ AudioEngine::remove_all_ports ()
/* make sure that JACK callbacks that will be invoked as we cleanup
* ports know that they have nothing to do.
*/
-
+
port_remove_in_progress = true;
/* process lock MUST be held by caller
@@ -1394,7 +1394,7 @@ AudioEngine::reconnect_to_jack ()
GET_PRIVATE_JACK_POINTER_RET (_jack,-1);
MIDI::Manager::instance()->reestablish (_priv_jack);
-
+
if (_session) {
_session->reset_jack_connection (_priv_jack);
jack_bufsize_callback (jack_get_buffer_size (_priv_jack));
@@ -1402,7 +1402,7 @@ AudioEngine::reconnect_to_jack ()
}
last_monitor_check = 0;
-
+
set_jack_callbacks ();
if (jack_activate (_priv_jack) == 0) {
@@ -1435,7 +1435,7 @@ AudioEngine::request_buffer_size (pframes_t nframes)
if (nframes == jack_get_buffer_size (_priv_jack)) {
return 0;
}
-
+
return jack_set_buffer_size (_priv_jack, nframes);
}
@@ -1507,10 +1507,10 @@ AudioEngine::create_process_thread (boost::function<void()> f, pthread_t* thread
GET_PRIVATE_JACK_POINTER_RET (_jack, 0);
ThreadData* td = new ThreadData (this, f, stacksize);
- if (jack_client_create_thread (_priv_jack, thread, jack_client_real_time_priority (_priv_jack),
+ if (jack_client_create_thread (_priv_jack, thread, jack_client_real_time_priority (_priv_jack),
jack_is_realtime (_priv_jack), _start_process_thread, td)) {
return -1;
- }
+ }
return 0;
}
@@ -1527,7 +1527,7 @@ AudioEngine::_start_process_thread (void* arg)
return 0;
}
-bool
+bool
AudioEngine::port_is_physical (const std::string& portname) const
{
GET_PRIVATE_JACK_POINTER_RET(_jack, false);
@@ -1537,11 +1537,11 @@ AudioEngine::port_is_physical (const std::string& portname) const
if (!port) {
return false;
}
-
+
return jack_port_flags (port) & JackPortIsPhysical;
}
-void
+void
AudioEngine::ensure_monitor_input (const std::string& portname, bool yn) const
{
GET_PRIVATE_JACK_POINTER(_jack);