Commit 682a6b50 authored by sletz's avatar sletz
Browse files

Add an Init method for blocking drivers to be decorated using JackThreadedDriver class.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2098 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 24ed91b2
......@@ -23,6 +23,7 @@ Fernando Lopez-Lezcano
2008-03-28 Stephane Letz <letz@grame.fr>
* Correct PortRegister, port name checking must be done on server side.
* Add an Init method for blocking drivers to be decorated using JackThreadedDriver class.
2008-03-27 Stephane Letz <letz@grame.fr>
......
......@@ -75,7 +75,7 @@ class EXPORT JackDriverInterface
virtual int SetSampleRate(jack_nframes_t sample_rate) = 0;
virtual int Process() = 0;
virtual void SetMaster(bool onoff) = 0;
virtual bool GetMaster() = 0;
virtual void AddSlave(JackDriverInterface* slave) = 0;
......@@ -85,19 +85,38 @@ class EXPORT JackDriverInterface
virtual bool IsRealTime() = 0;
};
/*
\brief The base interface for blocking drivers.
*/
class EXPORT JackBlockingInterface
{
public:
JackBlockingInterface()
{}
virtual ~JackBlockingInterface()
{}
virtual bool Init() = 0; /* To be called by the wrapping thread Init method when the driver is a "blocking" one */
};
/*!
\brief The base interface for drivers clients.
*/
class EXPORT JackDriverClientInterface : public JackDriverInterface, public JackClientInterface
{};
{};
/*!
\brief The base class for drivers clients.
*/
class EXPORT JackDriverClient : public JackDriverClientInterface
class EXPORT JackDriverClient : public JackDriverClientInterface, public JackBlockingInterface
{
private:
std::list<JackDriverInterface*> fSlaveList;
......@@ -208,7 +227,12 @@ class EXPORT JackDriver : public JackDriverClient
int ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2);
void SetupDriverSync(int ref, bool freewheel);
virtual bool Init()
{
return true;
}
};
} // end of namespace
......
......@@ -89,4 +89,9 @@ bool JackThreadedDriver::Execute()
return (Process() == 0);
}
bool JackThreadedDriver::Init()
{
return fDriver->Init();
}
} // end of namespace
......@@ -143,8 +143,8 @@ class JackThreadedDriver : public JackDriverClientInterface, public JackRunnable
}
// JackRunnableInterface interface
virtual bool Execute();
virtual bool Init();
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment