summaryrefslogtreecommitdiff
path: root/libs/midi++2
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-12-19 20:26:31 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-12-19 20:26:31 +0000
commitaae367b63c9b619db1e40f27dc334c6987219481 (patch)
tree142f6ffed6bb749e24a06343587cad6b966888bd /libs/midi++2
parent67460c2af45d0455e64623572480c064445c2e5b (diff)
use new syntax for connecting to backend signals that enforces explicit connection scope, plus a few other related matters
git-svn-id: svn://localhost/ardour2/branches/3.0@6376 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2')
-rw-r--r--libs/midi++2/channel.cc50
-rw-r--r--libs/midi++2/midi++/channel.h3
-rw-r--r--libs/midi++2/midi++/manager.h2
-rw-r--r--libs/midi++2/midi++/mmc.h17
-rw-r--r--libs/midi++2/midi++/parser.h28
-rw-r--r--libs/midi++2/midi++/port.h1
-rw-r--r--libs/midi++2/mmc.cc2
-rw-r--r--libs/midi++2/parser.cc2
8 files changed, 44 insertions, 61 deletions
diff --git a/libs/midi++2/channel.cc b/libs/midi++2/channel.cc
index 9e339654b4..bf71b0579c 100644
--- a/libs/midi++2/channel.cc
+++ b/libs/midi++2/channel.cc
@@ -35,44 +35,30 @@ Channel::Channel (byte channelnum, Port &p) : _port (p)
void
Channel::connect_input_signals ()
{
- add_connection (_port.input()->channel_pressure[_channel_number].connect
- (boost::bind (&Channel::process_chanpress, this, _1, _2)));
- add_connection (_port.input()->channel_note_on[_channel_number].connect
- (boost::bind (&Channel::process_note_on, this, _1, _2)));
- add_connection (_port.input()->channel_note_off[_channel_number].connect
- (boost::bind (&Channel::process_note_off, this, _1, _2)));
- add_connection (_port.input()->channel_poly_pressure[_channel_number].connect
- (boost::bind (&Channel::process_polypress, this, _1, _2)));
- add_connection (_port.input()->channel_program_change[_channel_number].connect
- (boost::bind (&Channel::process_program_change, this, _1, _2)));
- add_connection (_port.input()->channel_controller[_channel_number].connect
- (boost::bind (&Channel::process_controller, this, _1, _2)));
- add_connection (_port.input()->channel_pitchbend[_channel_number].connect
- (boost::bind (&Channel::process_pitchbend, this, _1, _2)));
-
- add_connection (_port.input()->reset.connect (boost::bind (&Channel::process_reset, this, _1)));
+ _port.input()->channel_pressure[_channel_number].connect (*this, boost::bind (&Channel::process_chanpress, this, _1, _2));
+ _port.input()->channel_note_on[_channel_number].connect (*this, boost::bind (&Channel::process_note_on, this, _1, _2));
+ _port.input()->channel_note_off[_channel_number].connect (*this, boost::bind (&Channel::process_note_off, this, _1, _2));
+ _port.input()->channel_poly_pressure[_channel_number].connect (*this, boost::bind (&Channel::process_polypress, this, _1, _2));
+ _port.input()->channel_program_change[_channel_number].connect (*this, boost::bind (&Channel::process_program_change, this, _1, _2));
+ _port.input()->channel_controller[_channel_number].connect (*this, boost::bind (&Channel::process_controller, this, _1, _2));
+ _port.input()->channel_pitchbend[_channel_number].connect (*this, boost::bind (&Channel::process_pitchbend, this, _1, _2));
+
+ _port.input()->reset.connect (*this, boost::bind (&Channel::process_reset, this, _1));
}
void
Channel::connect_output_signals ()
{
- add_connection (_port.output()->channel_pressure[_channel_number].connect
- (boost::bind (&Channel::process_chanpress, this, _1, _2)));
- add_connection (_port.output()->channel_note_on[_channel_number].connect
- (boost::bind (&Channel::process_note_on, this, _1, _2)));
- add_connection (_port.output()->channel_note_off[_channel_number].connect
- (boost::bind (&Channel::process_note_off, this, _1, _2)));
- add_connection (_port.output()->channel_poly_pressure[_channel_number].connect
- (boost::bind (&Channel::process_polypress, this, _1, _2)));
- add_connection (_port.output()->channel_program_change[_channel_number].connect
- (boost::bind (&Channel::process_program_change, this, _1, _2)));
- add_connection (_port.output()->channel_controller[_channel_number].connect
- (boost::bind (&Channel::process_controller, this, _1, _2)));
- add_connection (_port.output()->channel_pitchbend[_channel_number].connect
- (boost::bind (&Channel::process_pitchbend, this, _1, _2)));
-
- add_connection (_port.output()->reset.connect (boost::bind (&Channel::process_reset, this, _1)));
+ _port.output()->channel_pressure[_channel_number].connect (*this, boost::bind (&Channel::process_chanpress, this, _1, _2));
+ _port.output()->channel_note_on[_channel_number].connect (*this, boost::bind (&Channel::process_note_on, this, _1, _2));
+ _port.output()->channel_note_off[_channel_number].connect (*this, boost::bind (&Channel::process_note_off, this, _1, _2));
+ _port.output()->channel_poly_pressure[_channel_number].connect (*this, boost::bind (&Channel::process_polypress, this, _1, _2));
+ _port.output()->channel_program_change[_channel_number].connect (*this, boost::bind (&Channel::process_program_change, this, _1, _2));
+ _port.output()->channel_controller[_channel_number].connect (*this, boost::bind (&Channel::process_controller, this, _1, _2));
+ _port.output()->channel_pitchbend[_channel_number].connect (*this, boost::bind (&Channel::process_pitchbend, this, _1, _2));
+
+ _port.output()->reset.connect (*this, boost::bind (&Channel::process_reset, this, _1));
}
void
diff --git a/libs/midi++2/midi++/channel.h b/libs/midi++2/midi++/channel.h
index 617ae14430..470ccd447c 100644
--- a/libs/midi++2/midi++/channel.h
+++ b/libs/midi++2/midi++/channel.h
@@ -22,8 +22,7 @@
#include <queue>
-#include <boost/signals2.hpp>
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
#include "midi++/types.h"
#include "midi++/parser.h"
diff --git a/libs/midi++2/midi++/manager.h b/libs/midi++2/midi++/manager.h
index d451d234c8..90bdde3e70 100644
--- a/libs/midi++2/midi++/manager.h
+++ b/libs/midi++2/midi++/manager.h
@@ -83,7 +83,7 @@ class Manager {
int get_known_ports (std::vector<PortSet>&);
- boost::signals2::signal<void()> PortsChanged;
+ PBD::Signal0<void> PortsChanged;
private:
/* This is a SINGLETON pattern */
diff --git a/libs/midi++2/midi++/mmc.h b/libs/midi++2/midi++/mmc.h
index 0b06222438..687d0e14d8 100644
--- a/libs/midi++2/midi++/mmc.h
+++ b/libs/midi++2/midi++/mmc.h
@@ -20,8 +20,7 @@
#ifndef __midipp_mmc_h_h__
#define __midipp_mmc_h_h__
-#include <boost/signals2.hpp>
-
+#include "pbd/signals.h"
#include "midi++/types.h"
namespace MIDI {
@@ -32,7 +31,7 @@ class Parser;
class MachineControl
{
public:
- typedef boost::signals2::signal<void(MachineControl&)> MMCSignal;
+ typedef PBD::Signal1<void,MachineControl&> MMCSignal;
typedef byte CommandSignature[60];
typedef byte ResponseSignature[60];
@@ -144,20 +143,20 @@ class MachineControl
true if the direction is "forwards", false for "reverse"
*/
- boost::signals2::signal<void(MachineControl&,float,bool)> Shuttle;
+ PBD::Signal3<void,MachineControl&,float,bool> Shuttle;
/* The second argument specifies the desired track record enabled
status.
*/
- boost::signals2::signal<void(MachineControl &,size_t,bool)>
+ PBD::Signal3<void,MachineControl &,size_t,bool>
TrackRecordStatusChange;
/* The second argument specifies the desired track record enabled
status.
*/
- boost::signals2::signal<void(MachineControl &,size_t,bool)>
+ PBD::Signal3<void,MachineControl &,size_t,bool>
TrackMuteChange;
/* The second argument points to a byte array containing
@@ -165,11 +164,11 @@ class MachineControl
format (5 bytes, roughly: hrs/mins/secs/frames/subframes)
*/
- boost::signals2::signal<void(MachineControl &, const byte *)> Locate;
+ PBD::Signal2<void,MachineControl &, const byte *> Locate;
/* The second argument is the number of steps to jump */
- boost::signals2::signal<void(MachineControl &, int)> Step;
+ PBD::Signal2<void,MachineControl &, int> Step;
protected:
@@ -257,7 +256,7 @@ class MachineControl
MIDI::Port &_port;
void process_mmc_message (Parser &p, byte *, size_t len);
- boost::signals2::scoped_connection mmc_connection;
+ PBD::ScopedConnection mmc_connection;
int do_masked_write (byte *, size_t len);
int do_locate (byte *, size_t len);
diff --git a/libs/midi++2/midi++/parser.h b/libs/midi++2/midi++/parser.h
index 497a50abe8..43cf80c067 100644
--- a/libs/midi++2/midi++/parser.h
+++ b/libs/midi++2/midi++/parser.h
@@ -23,7 +23,7 @@
#include <string>
#include <iostream>
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
#include "midi++/types.h"
@@ -32,12 +32,12 @@ namespace MIDI {
class Port;
class Parser;
-typedef boost::signals2::signal<void(Parser&)> ZeroByteSignal;
-typedef boost::signals2::signal<void(Parser&,nframes_t)> TimestampedSignal;
-typedef boost::signals2::signal<void(Parser&, byte)> OneByteSignal;
-typedef boost::signals2::signal<void(Parser &, EventTwoBytes *)> TwoByteSignal;
-typedef boost::signals2::signal<void(Parser &, pitchbend_t)> PitchBendSignal;
-typedef boost::signals2::signal<void(Parser &, byte *, size_t)> Signal;
+typedef PBD::Signal1<void,Parser&> ZeroByteSignal;
+typedef PBD::Signal2<void,Parser&,nframes_t> TimestampedSignal;
+typedef PBD::Signal2<void,Parser&, byte> OneByteSignal;
+typedef PBD::Signal2<void,Parser &, EventTwoBytes *> TwoByteSignal;
+typedef PBD::Signal2<void,Parser &, pitchbend_t> PitchBendSignal;
+typedef PBD::Signal3<void,Parser &, byte *, size_t> Signal;
class Parser {
public:
@@ -109,9 +109,9 @@ class Parser {
void set_offline (bool);
bool offline() const { return _offline; }
- boost::signals2::signal<void()> OfflineStatusChanged;
+ PBD::Signal0<void> OfflineStatusChanged;
- boost::signals2::signal<int(byte *, size_t)> edit;
+ PBD::Signal2<int,byte *, size_t> edit;
void set_mmc_forwarding (bool yn) {
_mmc_forward = yn;
@@ -124,10 +124,10 @@ class Parser {
const byte *mtc_current() const { return _mtc_time; }
bool mtc_locked() const { return _mtc_locked; }
- boost::signals2::signal<void(Parser&,int,nframes_t)> mtc_qtr;
- boost::signals2::signal<void(const byte*,bool,nframes_t)> mtc_time;
- boost::signals2::signal<void(MTC_Status)> mtc_status;
- boost::signals2::signal<bool()> mtc_skipped;
+ PBD::Signal3<void,Parser&,int,nframes_t> mtc_qtr;
+ PBD::Signal3<void,const byte*,bool,nframes_t> mtc_time;
+ PBD::Signal1<void,MTC_Status> mtc_status;
+ PBD::Signal0<bool> mtc_skipped;
void set_mtc_forwarding (bool yn) {
_mtc_forward = yn;
@@ -142,7 +142,7 @@ class Parser {
std::ostream *trace_stream;
std::string trace_prefix;
void trace_event (Parser &p, byte *msg, size_t len);
- boost::signals2::scoped_connection trace_connection;
+ PBD::ScopedConnection trace_connection;
size_t message_counter[256];
diff --git a/libs/midi++2/midi++/port.h b/libs/midi++2/midi++/port.h
index 0c5fe4ae37..16db09f0e4 100644
--- a/libs/midi++2/midi++/port.h
+++ b/libs/midi++2/midi++/port.h
@@ -22,7 +22,6 @@
#include <string>
#include <iostream>
-#include <boost/signals2.hpp>
#include "pbd/xml++.h"
#include "midi++/types.h"
diff --git a/libs/midi++2/mmc.cc b/libs/midi++2/mmc.cc
index e496e37aa9..eb1c6cb5b0 100644
--- a/libs/midi++2/mmc.cc
+++ b/libs/midi++2/mmc.cc
@@ -206,7 +206,7 @@ MachineControl::MachineControl (Port &p, float /*version*/,
_send_device_id = 0x7f;
if ((parser = _port.input()) != 0) {
- mmc_connection = parser->mmc.connect (boost::bind (&MachineControl::process_mmc_message, this, _1, _2, _3));
+ parser->mmc.connect (mmc_connection, boost::bind (&MachineControl::process_mmc_message, this, _1, _2, _3));
} else {
warning << "MMC connected to a non-input port: useless!"
<< endmsg;
diff --git a/libs/midi++2/parser.cc b/libs/midi++2/parser.cc
index 4f19c40ebe..2efa77ae0b 100644
--- a/libs/midi++2/parser.cc
+++ b/libs/midi++2/parser.cc
@@ -316,7 +316,7 @@ Parser::trace (bool onoff, ostream *o, const string &prefix)
cerr << "enabling tracing for port " << _port.name() << endl;
trace_stream = o;
trace_prefix = prefix;
- trace_connection = any.connect (boost::bind (&Parser::trace_event, this, _1, _2, _3));
+ any.connect (trace_connection, boost::bind (&Parser::trace_event, this, _1, _2, _3));
} else {
trace_prefix = "";
trace_stream = 0;