#include <fcntl.h>
#include <map>
-#include "control_protocol/timecode.h"
+#include "timecode/time.h"
+#include "timecode/bbt_time.h"
+
#include "pbd/error.h"
+
#include "midi++/mmc.h"
#include "midi++/port.h"
#include "midi++/parser.h"
-#include "midi++/manager.h"
using namespace std;
using namespace MIDI;
using namespace PBD;
+/**
+ * As libtimecode is linked statically to libmidi++ this
+ * is necessary to pull in all the symbols from libtimecode
+ * so they are exported for other users of libtimecode.
+ */
+double tmp = Timecode::BBT_Time::ticks_per_beat;
+
static std::map<int,string> mmc_cmd_map;
static void build_mmc_cmd_map ()
{
mmc_cmd_map.insert (newpair);
}
-
-MachineControl::MachineControl (jack_client_t* jack)
+MachineControl::MachineControl ()
{
build_mmc_cmd_map ();
- _receive_device_id = 0;
+ _receive_device_id = 0x7f;
_send_device_id = 0x7f;
+}
+
+void
+MachineControl::set_ports (MIDI::Port* ip, MIDI::Port* op)
+{
+ port_connections.drop_connections ();
- _input_port = Manager::instance()->add_port (new Port ("MMC in", Port::IsInput, jack));
- _output_port = Manager::instance()->add_port (new Port ("MMC out", Port::IsOutput, jack));
+ _input_port = ip;
+ _output_port = op;
_input_port->parser()->mmc.connect_same_thread (port_connections, boost::bind (&MachineControl::process_mmc_message, this, _1, _2, _3));
- _input_port->parser()->start.connect_same_thread (port_connections, boost::bind (&MachineControl::spp_start, this, _1, _2));
- _input_port->parser()->contineu.connect_same_thread (port_connections, boost::bind (&MachineControl::spp_continue, this, _1, _2));
- _input_port->parser()->stop.connect_same_thread (port_connections, boost::bind (&MachineControl::spp_stop, this, _1, _2));
+ _input_port->parser()->start.connect_same_thread (port_connections, boost::bind (&MachineControl::spp_start, this));
+ _input_port->parser()->contineu.connect_same_thread (port_connections, boost::bind (&MachineControl::spp_continue, this));
+ _input_port->parser()->stop.connect_same_thread (port_connections, boost::bind (&MachineControl::spp_stop, this));
}
void
}
void
-MachineControl::spp_start (Parser& parser, nframes_t timestamp)
+MachineControl::spp_start ()
{
- SPPStart (parser, timestamp); /* EMIT SIGNAL */
+ SPPStart (); /* EMIT SIGNAL */
}
void
-MachineControl::spp_continue (Parser& parser, nframes_t timestamp)
+MachineControl::spp_continue ()
{
- SPPContinue (parser, timestamp); /* EMIT SIGNAL */
+ SPPContinue (); /* EMIT SIGNAL */
}
void
-MachineControl::spp_stop (Parser& parser, nframes_t timestamp)
+MachineControl::spp_stop ()
{
- SPPStop (parser, timestamp); /* EMIT SIGNAL */
+ SPPStop (); /* EMIT SIGNAL */
}
MachineControlCommand::MachineControlCommand (MachineControl::Command c)