2008-06-02 17:41:35 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 1999-2002 Paul Davis
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <string>
|
|
|
|
#include <cmath>
|
|
|
|
#include <cerrno>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <poll.h>
|
|
|
|
|
|
|
|
#include <glibmm/thread.h>
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/error.h"
|
|
|
|
#include "pbd/pthread_utils.h"
|
|
|
|
#include "pbd/stacktrace.h"
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/audio_diskstream.h"
|
|
|
|
#include "ardour/audioengine.h"
|
2009-10-23 19:23:00 -04:00
|
|
|
#include "ardour/butler.h"
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/configuration.h"
|
|
|
|
#include "ardour/crossfade.h"
|
|
|
|
#include "ardour/io.h"
|
|
|
|
#include "ardour/midi_diskstream.h"
|
|
|
|
#include "ardour/session.h"
|
|
|
|
#include "ardour/timestamps.h"
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
#include "i18n.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace ARDOUR;
|
|
|
|
using namespace PBD;
|
|
|
|
|
|
|
|
static float _read_data_rate;
|
|
|
|
static float _write_data_rate;
|
|
|
|
|
|
|
|
/* XXX put this in the right place */
|
|
|
|
|
|
|
|
static inline uint32_t next_power_of_two (uint32_t n)
|
|
|
|
{
|
|
|
|
--n;
|
|
|
|
n |= n >> 16;
|
|
|
|
n |= n >> 8;
|
|
|
|
n |= n >> 4;
|
|
|
|
n |= n >> 2;
|
|
|
|
n |= n >> 1;
|
|
|
|
++n;
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------
|
2009-10-14 12:10:01 -04:00
|
|
|
BUTLER THREAD
|
2008-06-02 17:41:35 -04:00
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
int
|
|
|
|
Session::start_butler_thread ()
|
|
|
|
{
|
|
|
|
/* size is in Samples, not bytes */
|
|
|
|
audio_dstream_buffer_size = (uint32_t) floor (Config->get_audio_track_buffer_seconds() * (float) frame_rate());
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
/* size is in bytes
|
|
|
|
* XXX: Jack needs to tell us the MIDI buffer size
|
|
|
|
* (i.e. how many MIDI bytes we might see in a cycle)
|
|
|
|
*/
|
|
|
|
midi_dstream_buffer_size = (uint32_t) floor (Config->get_midi_track_buffer_seconds() * (float)frame_rate());
|
2009-05-01 13:32:48 -04:00
|
|
|
MidiDiskstream::set_readahead_frames ((nframes_t) (Config->get_midi_readahead() * (float) frame_rate()));
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
Crossfade::set_buffer_size (audio_dstream_buffer_size);
|
|
|
|
|
2009-10-23 19:23:00 -04:00
|
|
|
butler->should_run = false;
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2009-10-23 19:23:00 -04:00
|
|
|
if (pipe (butler->request_pipe)) {
|
2008-06-02 17:41:35 -04:00
|
|
|
error << string_compose(_("Cannot create transport request signal pipe (%1)"), strerror (errno)) << endmsg;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-10-23 19:23:00 -04:00
|
|
|
if (fcntl (butler->request_pipe[0], F_SETFL, O_NONBLOCK)) {
|
2008-06-02 17:41:35 -04:00
|
|
|
error << string_compose(_("UI: cannot set O_NONBLOCK on butler request pipe (%1)"), strerror (errno)) << endmsg;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-10-23 19:23:00 -04:00
|
|
|
if (fcntl (butler->request_pipe[1], F_SETFL, O_NONBLOCK)) {
|
2008-06-02 17:41:35 -04:00
|
|
|
error << string_compose(_("UI: cannot set O_NONBLOCK on butler request pipe (%1)"), strerror (errno)) << endmsg;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-10-23 19:23:00 -04:00
|
|
|
if (pthread_create_and_store ("disk butler", &butler->thread, 0, _butler_thread_work, this)) {
|
2008-06-02 17:41:35 -04:00
|
|
|
error << _("Session: could not create butler thread") << endmsg;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-10-23 19:23:00 -04:00
|
|
|
// pthread_detach (butler->thread);
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Session::terminate_butler_thread ()
|
|
|
|
{
|
2009-10-23 19:23:00 -04:00
|
|
|
if (butler->thread) {
|
2008-06-02 17:41:35 -04:00
|
|
|
void* status;
|
|
|
|
char c = ButlerRequest::Quit;
|
2009-10-23 19:23:00 -04:00
|
|
|
::write (butler->request_pipe[1], &c, 1);
|
|
|
|
pthread_join (butler->thread, &status);
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Session::schedule_butler_transport_work ()
|
|
|
|
{
|
2009-10-23 19:23:00 -04:00
|
|
|
g_atomic_int_inc (&butler->should_do_transport_work);
|
2008-06-02 17:41:35 -04:00
|
|
|
summon_butler ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Session::schedule_curve_reallocation ()
|
|
|
|
{
|
|
|
|
post_transport_work = PostTransportWork (post_transport_work | PostTransportCurveRealloc);
|
|
|
|
schedule_butler_transport_work ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Session::summon_butler ()
|
|
|
|
{
|
|
|
|
char c = ButlerRequest::Run;
|
2009-10-23 19:23:00 -04:00
|
|
|
::write (butler->request_pipe[1], &c, 1);
|
2008-06-02 17:41:35 -04:00
|
|
|
// PBD::stacktrace (cerr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Session::stop_butler ()
|
|
|
|
{
|
2009-10-23 19:23:00 -04:00
|
|
|
Glib::Mutex::Lock lm (butler->request_lock);
|
2008-06-02 17:41:35 -04:00
|
|
|
char c = ButlerRequest::Pause;
|
2009-10-23 19:23:00 -04:00
|
|
|
::write (butler->request_pipe[1], &c, 1);
|
|
|
|
butler->paused.wait(butler->request_lock);
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Session::wait_till_butler_finished ()
|
|
|
|
{
|
2009-10-23 19:23:00 -04:00
|
|
|
Glib::Mutex::Lock lm (butler->request_lock);
|
2008-06-02 17:41:35 -04:00
|
|
|
char c = ButlerRequest::Wake;
|
2009-10-23 19:23:00 -04:00
|
|
|
::write (butler->request_pipe[1], &c, 1);
|
|
|
|
butler->paused.wait(butler->request_lock);
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void *
|
|
|
|
Session::_butler_thread_work (void* arg)
|
|
|
|
{
|
2008-12-12 09:43:24 -05:00
|
|
|
PBD::notify_gui_about_thread_creation (pthread_self(), X_("Butler"));
|
2008-06-02 17:41:35 -04:00
|
|
|
return ((Session *) arg)->butler_thread_work ();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void *
|
|
|
|
Session::butler_thread_work ()
|
|
|
|
{
|
|
|
|
uint32_t err = 0;
|
|
|
|
int32_t bytes;
|
|
|
|
bool compute_io;
|
2008-09-10 11:03:30 -04:00
|
|
|
microseconds_t begin, end;
|
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
struct pollfd pfd[1];
|
|
|
|
bool disk_work_outstanding = false;
|
|
|
|
DiskstreamList::iterator i;
|
|
|
|
|
|
|
|
while (true) {
|
2009-10-23 19:23:00 -04:00
|
|
|
pfd[0].fd = butler->request_pipe[0];
|
2008-06-02 17:41:35 -04:00
|
|
|
pfd[0].events = POLLIN|POLLERR|POLLHUP;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
if (poll (pfd, 1, (disk_work_outstanding ? 0 : -1)) < 0) {
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
if (errno == EINTR) {
|
|
|
|
continue;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
error << string_compose (_("poll on butler request pipe failed (%1)"),
|
|
|
|
strerror (errno))
|
|
|
|
<< endmsg;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pfd[0].revents & ~POLLIN) {
|
|
|
|
error << string_compose (_("Error on butler thread request pipe: fd=%1 err=%2"), pfd[0].fd, pfd[0].revents) << endmsg;
|
|
|
|
break;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
if (pfd[0].revents & POLLIN) {
|
|
|
|
|
|
|
|
char req;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
/* empty the pipe of all current requests */
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
while (1) {
|
2009-10-23 19:23:00 -04:00
|
|
|
size_t nread = ::read (butler->request_pipe[0], &req, sizeof (req));
|
2008-06-02 17:41:35 -04:00
|
|
|
if (nread == 1) {
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
switch ((ButlerRequest::Type) req) {
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
case ButlerRequest::Wake:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ButlerRequest::Run:
|
2009-10-23 19:23:00 -04:00
|
|
|
butler->should_run = true;
|
2008-06-02 17:41:35 -04:00
|
|
|
break;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
case ButlerRequest::Pause:
|
2009-10-23 19:23:00 -04:00
|
|
|
butler->should_run = false;
|
2008-06-02 17:41:35 -04:00
|
|
|
break;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
case ButlerRequest::Quit:
|
|
|
|
pthread_exit_pbd (0);
|
|
|
|
/*NOTREACHED*/
|
|
|
|
break;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
} else if (nread == 0) {
|
|
|
|
break;
|
|
|
|
} else if (errno == EAGAIN) {
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
fatal << _("Error reading from butler request pipe") << endmsg;
|
|
|
|
/*NOTREACHED*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (transport_work_requested()) {
|
|
|
|
butler_transport_work ();
|
|
|
|
}
|
|
|
|
|
|
|
|
disk_work_outstanding = false;
|
|
|
|
bytes = 0;
|
|
|
|
compute_io = true;
|
|
|
|
|
2008-09-10 11:03:30 -04:00
|
|
|
begin = get_microseconds();
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader ();
|
|
|
|
|
|
|
|
// for (i = dsl->begin(); i != dsl->end(); ++i) {
|
|
|
|
// cerr << "BEFORE " << (*i)->name() << ": pb = " << (*i)->playback_buffer_load() << " cp = " << (*i)->capture_buffer_load() << endl;
|
|
|
|
// }
|
|
|
|
|
2009-10-23 19:23:00 -04:00
|
|
|
for (i = dsl->begin(); !transport_work_requested() && butler->should_run && i != dsl->end(); ++i) {
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
boost::shared_ptr<Diskstream> ds = *i;
|
|
|
|
|
|
|
|
/* don't read inactive tracks */
|
|
|
|
|
2009-06-26 13:56:35 -04:00
|
|
|
boost::shared_ptr<IO> io = ds->io();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
if (io && !io->active()) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (ds->do_refill ()) {
|
|
|
|
case 0:
|
|
|
|
bytes += ds->read_data_count();
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
bytes += ds->read_data_count();
|
|
|
|
disk_work_outstanding = true;
|
|
|
|
break;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
default:
|
|
|
|
compute_io = false;
|
|
|
|
error << string_compose(_("Butler read ahead failure on dstream %1"), (*i)->name()) << endmsg;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i != dsl->end()) {
|
|
|
|
/* we didn't get to all the streams */
|
|
|
|
disk_work_outstanding = true;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
if (!err && transport_work_requested()) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (compute_io) {
|
2009-10-14 12:10:01 -04:00
|
|
|
end = get_microseconds();
|
2008-09-10 11:03:30 -04:00
|
|
|
if(end-begin > 0) {
|
|
|
|
_read_data_rate = (float) bytes / (float) (end - begin);
|
|
|
|
} else { _read_data_rate = 0; // infinity better
|
|
|
|
}
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
bytes = 0;
|
|
|
|
compute_io = true;
|
2008-09-10 11:03:30 -04:00
|
|
|
begin = get_microseconds();
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2009-10-23 19:23:00 -04:00
|
|
|
for (i = dsl->begin(); !transport_work_requested() && butler->should_run && i != dsl->end(); ++i) {
|
2008-06-02 17:41:35 -04:00
|
|
|
// cerr << "write behind for " << (*i)->name () << endl;
|
|
|
|
|
|
|
|
/* note that we still try to flush diskstreams attached to inactive routes
|
|
|
|
*/
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-01-30 15:18:31 -05:00
|
|
|
switch ((*i)->do_flush (ButlerContext)) {
|
2008-06-02 17:41:35 -04:00
|
|
|
case 0:
|
|
|
|
bytes += (*i)->write_data_count();
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
bytes += (*i)->write_data_count();
|
|
|
|
disk_work_outstanding = true;
|
|
|
|
break;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
default:
|
|
|
|
err++;
|
|
|
|
compute_io = false;
|
|
|
|
error << string_compose(_("Butler write-behind failure on dstream %1"), (*i)->name()) << endmsg;
|
2009-10-14 12:10:01 -04:00
|
|
|
/* don't break - try to flush all streams in case they
|
2008-06-02 17:41:35 -04:00
|
|
|
are split across disks.
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (err && actively_recording()) {
|
|
|
|
/* stop the transport and try to catch as much possible
|
|
|
|
captured state as we can.
|
|
|
|
*/
|
|
|
|
request_stop ();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i != dsl->end()) {
|
|
|
|
/* we didn't get to all the streams */
|
|
|
|
disk_work_outstanding = true;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
if (!err && transport_work_requested()) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (compute_io) {
|
2008-09-10 11:03:30 -04:00
|
|
|
// there are no apparent users for this calculation?
|
|
|
|
end = get_microseconds();
|
|
|
|
if(end-begin > 0) {
|
|
|
|
_write_data_rate = (float) bytes / (float) (end - begin);
|
|
|
|
} else {
|
|
|
|
_write_data_rate = 0; // Well, infinity would be better
|
|
|
|
}
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
if (!disk_work_outstanding) {
|
|
|
|
refresh_disk_space ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
2009-10-23 19:23:00 -04:00
|
|
|
Glib::Mutex::Lock lm (butler->request_lock);
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2009-10-23 19:23:00 -04:00
|
|
|
if (butler->should_run && (disk_work_outstanding || transport_work_requested())) {
|
2008-06-02 17:41:35 -04:00
|
|
|
// for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
|
|
|
|
// cerr << "AFTER " << (*i)->name() << ": pb = " << (*i)->playback_buffer_load() << " cp = " << (*i)->capture_buffer_load() << endl;
|
|
|
|
// }
|
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2009-10-23 19:23:00 -04:00
|
|
|
butler->paused.signal();
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pthread_exit_pbd (0);
|
|
|
|
/*NOTREACHED*/
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
Session::request_overwrite_buffer (Diskstream* stream)
|
|
|
|
{
|
|
|
|
Event *ev = new Event (Event::Overwrite, Event::Add, Event::Immediate, 0, 0, 0.0);
|
|
|
|
ev->set_ptr (stream);
|
|
|
|
queue_event (ev);
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Process thread. */
|
|
|
|
void
|
|
|
|
Session::overwrite_some_buffers (Diskstream* ds)
|
|
|
|
{
|
|
|
|
if (actively_recording()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ds) {
|
|
|
|
|
|
|
|
ds->set_pending_overwrite (true);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
|
|
|
|
for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
|
|
|
|
(*i)->set_pending_overwrite (true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post_transport_work = PostTransportWork (post_transport_work | PostTransportOverWrite);
|
|
|
|
schedule_butler_transport_work ();
|
|
|
|
}
|
|
|
|
|
|
|
|
float
|
|
|
|
Session::read_data_rate () const
|
|
|
|
{
|
|
|
|
/* disk i/o in excess of 10000MB/sec indicate the buffer cache
|
|
|
|
in action. ignore it.
|
|
|
|
*/
|
2008-09-10 11:03:30 -04:00
|
|
|
return _read_data_rate > 10485.7600000f ? 0.0f : _read_data_rate;
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
float
|
|
|
|
Session::write_data_rate () const
|
|
|
|
{
|
|
|
|
/* disk i/o in excess of 10000MB/sec indicate the buffer cache
|
|
|
|
in action. ignore it.
|
|
|
|
*/
|
2008-09-10 11:03:30 -04:00
|
|
|
return _write_data_rate > 10485.7600000f ? 0.0f : _write_data_rate;
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
Session::playback_load ()
|
|
|
|
{
|
|
|
|
return (uint32_t) g_atomic_int_get (&_playback_load);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
Session::capture_load ()
|
|
|
|
{
|
|
|
|
return (uint32_t) g_atomic_int_get (&_capture_load);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
Session::playback_load_min ()
|
|
|
|
{
|
|
|
|
return (uint32_t) g_atomic_int_get (&_playback_load_min);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
Session::capture_load_min ()
|
|
|
|
{
|
|
|
|
return (uint32_t) g_atomic_int_get (&_capture_load_min);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Session::reset_capture_load_min ()
|
|
|
|
{
|
|
|
|
g_atomic_int_set (&_capture_load_min, 100);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Session::reset_playback_load_min ()
|
|
|
|
{
|
|
|
|
g_atomic_int_set (&_playback_load_min, 100);
|
|
|
|
}
|
2009-10-23 19:23:00 -04:00
|
|
|
|
|
|
|
bool
|
|
|
|
Session::transport_work_requested () const
|
|
|
|
{
|
|
|
|
return g_atomic_int_get(&butler->should_do_transport_work);
|
|
|
|
}
|