Merge branch 'master' into cairocanvas

This commit is contained in:
Paul Davis 2013-11-27 16:19:01 -05:00
commit 680c64246e
11 changed files with 41 additions and 32 deletions

View file

@ -282,17 +282,7 @@ class AudioBackend : public PortEngine {
virtual std::string midi_option () const = 0;
/* State Control */
/* non-virtual method to avoid possible overrides of default
* parameters. See Scott Meyers or other books on C++ to
* understand this pattern, or possibly just this:
*
* http://stackoverflow.com/questions/12139786/good-pratice-default-arguments-for-pure-virtual-method
*/
int start (bool for_latency_measurement=false) {
return _start (for_latency_measurement);
}
/** Start using the device named in the most recent call
* to set_device(), with the parameters set by various
* the most recent calls to set_sample_rate() etc. etc.
@ -308,8 +298,24 @@ class AudioBackend : public PortEngine {
* any existing systemic latency settings.
*
* Return zero if successful, negative values otherwise.
*/
virtual int _start (bool for_latency_measurement) = 0;
*
*
*
*
* Why is this non-virtual but ::_start() is virtual ?
* Virtual methods with default parameters create possible ambiguity
* because a derived class may implement the same method with a different
* type or value of default parameter.
*
* So we make this non-virtual method to avoid possible overrides of
* default parameters. See Scott Meyers or other books on C++ to understand
* this pattern, or possibly just this:
*
* http://stackoverflow.com/questions/12139786/good-pratice-default-arguments-for-pure-virtual-method
*/
int start (bool for_latency_measurement=false) {
return _start (for_latency_measurement);
}
/** Stop using the device currently in use.
*
@ -481,6 +487,8 @@ class AudioBackend : public PortEngine {
protected:
AudioEngine& engine;
virtual int _start (bool for_latency_measurement) = 0;
};
struct AudioBackendInfo {

View file

@ -547,8 +547,11 @@ JACKAudioBackend::_start (bool for_latency_measurement)
/* Now that we have buffer size and sample rate established, the engine
can go ahead and do its stuff
*/
engine.reestablish_ports ();
if (engine.reestablish_ports ()) {
error << _("Could not re-establish ports after connecting to JACK") << endmsg;
return -1;
}
if (!jack_port_type_get_buffer_size) {
warning << _("This version of JACK is old - you should upgrade to a newer version that supports jack_port_type_get_buffer_size()") << endmsg;

View file

@ -89,7 +89,6 @@ class JACKAudioBackend : public AudioBackend {
std::string control_app_name () const;
void launch_control_app ();
int _start (bool for_latency_measurement);
int stop ();
int freewheel (bool);
@ -272,6 +271,9 @@ class JACKAudioBackend : public AudioBackend {
*/
JACKSession* _session;
protected:
int _start (bool for_latency_measurement);
};
} // namespace

View file

@ -143,7 +143,12 @@ JackConnection::close ()
if (_priv_jack) {
int ret = jack_client_close (_priv_jack);
_jack = 0;
/* If we started JACK, it will be closing down */
usleep (500000);
Disconnected (""); /* EMIT SIGNAL */
return ret;
}

View file

@ -36,9 +36,6 @@ typedef int socklen_t;
inline void closesocket(int s) { ::close(s); }
#endif
#include <jack/jack.h>
#include <jack/midiport.h>
#include "pbd/xml++.h"
#include "pbd/error.h"
#include "pbd/failed_constructor.h"

View file

@ -41,8 +41,6 @@
#include <glibmm/threads.h>
#include <jack/types.h>
#include "pbd/xml++.h"
#include "pbd/crossthread.h"
#include "pbd/signals.h"

View file

@ -20,7 +20,6 @@
#ifndef __midipp_mmc_h_h__
#define __midipp_mmc_h_h__
#include <jack/types.h>
#include "timecode/time.h"
#include "pbd/signals.h"

View file

@ -22,7 +22,9 @@
#include <string>
#include <iostream>
#include <jack/types.h>
#include <jack/types.h> /* XXX ... desirable to get rid of this but needed for
* now due to use of JackPortIsXXXX
*/
#include "pbd/xml++.h"
#include "pbd/crossthread.h"

View file

@ -20,7 +20,6 @@
#ifndef __midi_types_h__
#define __midi_types_h__
#include <jack/jack.h>
#include <inttypes.h>
namespace MIDI {
@ -32,8 +31,8 @@ namespace MIDI {
typedef uint32_t timestamp_t;
/** XXX: dupes from libardour */
typedef int64_t framecnt_t;
typedef jack_nframes_t pframes_t;
typedef int64_t framecnt_t;
typedef uint32_t pframes_t;
enum eventType {
none = 0x0,

View file

@ -22,9 +22,6 @@
#include <fcntl.h>
#include <errno.h>
#include <jack/jack.h>
#include <jack/midiport.h>
#include "pbd/xml++.h"
#include "pbd/error.h"
#include "pbd/failed_constructor.h"

View file

@ -50,7 +50,6 @@ def configure(conf):
'midipp', MAJOR, MINOR, MICRO)
autowaf.configure(conf)
autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.118.2')
autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
@ -64,13 +63,13 @@ def build(bld):
obj = bld.shlib(features = 'cxx cxxshlib', source=libmidi_sources)
else:
obj = bld.stlib(features = 'cxx cxxstlib', source=libmidi_sources)
obj.cxxflags = [ '-fPIC', '-DWITH_JACK_MIDI' ]
obj.cxxflags = [ '-fPIC' ]
# everybody loves JACK
obj.export_includes = ['.']
obj.includes = ['.', '../surfaces/control_protocol', '../ardour' ]
obj.name = 'libmidipp'
obj.target = 'midipp'
obj.uselib = 'GLIBMM SIGCPP XML JACK OSX'
obj.uselib = 'GLIBMM SIGCPP XML OSX'
obj.use = 'libpbd libevoral libtimecode'
obj.vnum = LIBMIDIPP_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')