Browse Source

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
tags/0.71
sletz 17 years ago
parent
commit
682a6b50b7
4 changed files with 35 additions and 5 deletions
  1. +1
    -0
      ChangeLog
  2. +28
    -4
      common/JackDriver.h
  3. +5
    -0
      common/JackThreadedDriver.cpp
  4. +1
    -1
      common/JackThreadedDriver.h

+ 1
- 0
ChangeLog View File

@@ -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>


+ 28
- 4
common/JackDriver.h View File

@@ -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


+ 5
- 0
common/JackThreadedDriver.cpp View File

@@ -89,4 +89,9 @@ bool JackThreadedDriver::Execute()
return (Process() == 0);
}

bool JackThreadedDriver::Init()
{
return fDriver->Init();
}

} // end of namespace

+ 1
- 1
common/JackThreadedDriver.h View File

@@ -143,8 +143,8 @@ class JackThreadedDriver : public JackDriverClientInterface, public JackRunnable
}

// JackRunnableInterface interface

virtual bool Execute();
virtual bool Init();

};



Loading…
Cancel
Save