_running = false;
_has_run = false;
last_monitor_check = 0;
- monitor_check_interval = max_frames;
+ monitor_check_interval = INT32_MAX;
_processed_frames = 0;
_usecs_per_cycle = 0;
_jack = 0;
/* handle wrap around of total frames counter */
- if (max_frames - _processed_frames < nframes) {
- next_processed_frames = nframes - (max_frames - _processed_frames);
+ if (max_framepos - _processed_frames < nframes) {
+ next_processed_frames = nframes - (max_framepos - _processed_frames);
} else {
next_processed_frames = _processed_frames + nframes;
}
int
AudioEngine::connect (const string& source, const string& destination)
{
- /* caller must hold process lock */
-
int ret;
if (!_running) {
string d = make_port_name_non_relative (destination);
- Port* src = get_port_by_name_locked (s);
- Port* dst = get_port_by_name_locked (d);
+ Port* src = get_port_by_name (s);
+ Port* dst = get_port_by_name (d);
if (src) {
ret = src->connect (d);
int
AudioEngine::disconnect (const string& source, const string& destination)
{
- /* caller must hold process lock */
-
int ret;
if (!_running) {
string s = make_port_name_non_relative (source);
string d = make_port_name_non_relative (destination);
- Port* src = get_port_by_name_locked (s);
- Port* dst = get_port_by_name_locked (d);
+ Port* src = get_port_by_name (s);
+ Port* dst = get_port_by_name (d);
if (src) {
ret = src->disconnect (d);
AudioEngine::get_port_by_name (const string& portname)
{
string s;
- if (portname.find_first_of (':') == string::npos) {
- s = make_port_name_non_relative (portname);
- } else {
- s = portname;
- }
-
- Glib::Mutex::Lock lm (_process_lock);
- return get_port_by_name_locked (s);
-}
-
-Port *
-AudioEngine::get_port_by_name_locked (const string& portname)
-{
- /* caller must hold process lock */
if (!_running) {
if (!_has_run) {
- fatal << _("get_port_by_name_locked() called before engine was started") << endmsg;
+ fatal << _("get_port_by_name() called before engine was started") << endmsg;
/*NOTREACHED*/
} else {
return 0;
}
}
+ if (portname.find_first_of (':') == string::npos) {
+ s = make_port_name_non_relative (portname);
+ } else {
+ s = portname;
+ }
+
if (portname.substr (0, jack_client_name.length ()) != jack_client_name) {
/* not an ardour: port */
return 0;
return jack_is_realtime (_priv_jack);
}
-pthread_t
-AudioEngine::create_process_thread (boost::function<void()> f, size_t stacksize)
+int
+AudioEngine::create_process_thread (boost::function<void()> f, pthread_t* thread, size_t stacksize)
{
GET_PRIVATE_JACK_POINTER_RET (_jack, 0);
- pthread_t thread;
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 thread;
+ return 0;
}
void*