2006-09-03 10:39:10 +03:00
|
|
|
/*
|
|
|
|
Copyright (C) 2003 Paul Davis
|
2008-02-01 21:46:45 +02:00
|
|
|
Copyright (C) 2004-2008 Grame
|
2006-09-03 10:39:10 +03:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
2008-04-06 15:25:50 +03:00
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
2006-09-03 10:39:10 +03:00
|
|
|
(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
|
2008-04-06 15:25:50 +03:00
|
|
|
GNU Lesser General Public License for more details.
|
2006-09-03 10:39:10 +03:00
|
|
|
|
2008-04-06 15:25:50 +03:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2011-03-10 11:36:25 +02:00
|
|
|
along with this program; if not, write to the Free Software
|
2008-04-06 15:25:50 +03:00
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
2006-09-03 10:39:10 +03:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __JackClientControl__
|
|
|
|
#define __JackClientControl__
|
|
|
|
|
|
|
|
#include "JackShmMem.h"
|
|
|
|
#include "JackPort.h"
|
|
|
|
#include "JackSynchro.h"
|
2007-06-08 23:03:15 +03:00
|
|
|
#include "JackNotification.h"
|
2011-04-05 18:35:16 +03:00
|
|
|
#include "JackSession.h"
|
2010-04-17 09:53:11 +03:00
|
|
|
|
2006-09-03 10:39:10 +03:00
|
|
|
namespace Jack
|
|
|
|
{
|
|
|
|
|
|
|
|
/*!
|
2008-06-13 17:32:26 +03:00
|
|
|
\brief Client control possibly in shared memory.
|
2006-09-03 10:39:10 +03:00
|
|
|
*/
|
|
|
|
|
2011-10-28 12:33:24 +03:00
|
|
|
PRE_PACKED_STRUCTURE
|
2008-06-13 17:32:26 +03:00
|
|
|
struct JackClientControl : public JackShmMemAble
|
2006-09-03 10:39:10 +03:00
|
|
|
{
|
|
|
|
char fName[JACK_CLIENT_NAME_SIZE + 1];
|
2008-03-05 18:39:51 +02:00
|
|
|
bool fCallback[kMaxNotification];
|
|
|
|
volatile jack_transport_state_t fTransportState;
|
2008-03-20 18:56:34 +02:00
|
|
|
volatile bool fTransportSync; /* Will be true when slow-sync cb has to be called */
|
|
|
|
volatile bool fTransportTimebase; /* Will be true when timebase cb is called with new_pos on */
|
2008-03-05 18:39:51 +02:00
|
|
|
int fRefNum;
|
2008-05-21 12:05:57 +03:00
|
|
|
int fPID;
|
2008-03-05 18:39:51 +02:00
|
|
|
bool fActive;
|
2006-09-03 10:39:10 +03:00
|
|
|
|
2019-03-18 09:33:50 +02:00
|
|
|
jack_uuid_t fSessionID;
|
2010-04-20 07:40:04 +03:00
|
|
|
char fSessionCommand[JACK_SESSION_COMMAND_SIZE];
|
2010-04-17 09:53:11 +03:00
|
|
|
jack_session_flags_t fSessionFlags;
|
|
|
|
|
2019-03-18 09:33:50 +02:00
|
|
|
JackClientControl(const char* name, int pid, int refnum, jack_uuid_t uuid)
|
2006-09-03 10:39:10 +03:00
|
|
|
{
|
2010-04-19 08:23:33 +03:00
|
|
|
Init(name, pid, refnum, uuid);
|
2006-09-03 10:39:10 +03:00
|
|
|
}
|
|
|
|
|
2019-03-18 09:33:50 +02:00
|
|
|
JackClientControl(const char* name, jack_uuid_t uuid)
|
2006-09-03 10:39:10 +03:00
|
|
|
{
|
2019-03-18 09:33:50 +02:00
|
|
|
Init(name, 0, -1, uuid);
|
2006-09-03 10:39:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
JackClientControl()
|
|
|
|
{
|
2019-03-18 09:33:50 +02:00
|
|
|
Init("", 0, -1, JACK_UUID_EMPTY_INITIALIZER);
|
2006-09-03 10:39:10 +03:00
|
|
|
}
|
|
|
|
|
2019-03-18 09:33:50 +02:00
|
|
|
void Init(const char* name, int pid, int refnum, jack_uuid_t uuid)
|
2006-09-03 10:39:10 +03:00
|
|
|
{
|
|
|
|
strcpy(fName, name);
|
2013-01-25 00:54:56 +02:00
|
|
|
for (int i = 0; i < kMaxNotification; i++) {
|
2008-03-05 18:39:51 +02:00
|
|
|
fCallback[i] = false;
|
2013-01-25 00:54:56 +02:00
|
|
|
}
|
2008-03-05 18:39:51 +02:00
|
|
|
// Always activated
|
|
|
|
fCallback[kAddClient] = true;
|
|
|
|
fCallback[kRemoveClient] = true;
|
|
|
|
fCallback[kActivateClient] = true;
|
2011-03-10 11:36:25 +02:00
|
|
|
fCallback[kLatencyCallback] = true;
|
2008-03-05 18:39:51 +02:00
|
|
|
// So that driver synchro are correctly setup in "flush" or "normal" mode
|
|
|
|
fCallback[kStartFreewheelCallback] = true;
|
|
|
|
fCallback[kStopFreewheelCallback] = true;
|
|
|
|
fRefNum = refnum;
|
2008-05-21 12:05:57 +03:00
|
|
|
fPID = pid;
|
2006-09-03 10:39:10 +03:00
|
|
|
fTransportState = JackTransportStopped;
|
2008-03-20 18:56:34 +02:00
|
|
|
fTransportSync = false;
|
|
|
|
fTransportTimebase = false;
|
2006-09-03 10:39:10 +03:00
|
|
|
fActive = false;
|
2010-04-17 09:53:11 +03:00
|
|
|
|
2010-04-19 23:01:55 +03:00
|
|
|
fSessionID = uuid;
|
2006-09-03 10:39:10 +03:00
|
|
|
}
|
|
|
|
|
2009-03-24 12:32:42 +02:00
|
|
|
} POST_PACKED_STRUCTURE;
|
2006-09-03 10:39:10 +03:00
|
|
|
|
|
|
|
} // end of namespace
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|