megaopus commit: (1) add __STD_(LIMIT|FORMAT)_MACROS to command line flags for cc...
[ardour.git] / libs / surfaces / mackie / mackie_control_protocol.cc
index 2e4f2ba21440cd450796872608104c9feea7b489..6dda801ad69829e2512976a1e1226c78424de700 100644 (file)
@@ -24,7 +24,6 @@
 #include <vector>
 #include <iomanip>
 
-#define __STDC_FORMAT_MACROS
 #include <inttypes.h>
 #include <float.h>
 #include <sys/time.h>
@@ -83,6 +82,8 @@ MackieControlProtocol::MackieControlProtocol (Session& session)
        , _surface (0)
        , _jog_wheel (*this)
        , _timecode_type (ARDOUR::AnyTime::BBT)
+       , _input_bundle (new ARDOUR::Bundle (_("Mackie Control In"), true))
+       , _output_bundle (new ARDOUR::Bundle (_("Mackie Control Out"), false))
 {
        DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::MackieControlProtocol\n");
 }
@@ -575,6 +576,18 @@ MackieControlProtocol::add_port (MIDI::Port & midi_input_port, MIDI::Port & midi
        sport->init_event.connect_same_thread (port_connections, boost::bind (&MackieControlProtocol::handle_port_init, this, sport));
        sport->active_event.connect_same_thread (port_connections, boost::bind (&MackieControlProtocol::handle_port_active, this, sport));
        sport->inactive_event.connect_same_thread (port_connections, boost::bind (&MackieControlProtocol::handle_port_inactive, this, sport));
+
+       _input_bundle->add_channel (
+               midi_input_port.name(),
+               ARDOUR::DataType::MIDI,
+               session->engine().make_port_name_non_relative (midi_input_port.name())
+               );
+       
+       _output_bundle->add_channel (
+               midi_output_port.name(),
+               ARDOUR::DataType::MIDI,
+               session->engine().make_port_name_non_relative (midi_output_port.name())
+               );
 }
 
 void 
@@ -1587,7 +1600,7 @@ MackieControlProtocol::marker_press (Button &)
        string markername;
        nframes_t where = session->audible_frame();
        session->locations()->next_available_name(markername,"mcu");
-       Location *location = new Location (where, where, markername, Location::IsMark);
+       Location *location = new Location (*session, where, where, markername, Location::IsMark);
        session->begin_reversible_command (_("add marker"));
        XMLNode &before = session->locations()->get_state();
        session->locations()->add (location, true);
@@ -1707,3 +1720,11 @@ MackieControlProtocol::timecode_beats_release (Button &)
        return off;
 }
 
+list<boost::shared_ptr<ARDOUR::Bundle> >
+MackieControlProtocol::bundles ()
+{
+       list<boost::shared_ptr<ARDOUR::Bundle> > b;
+       b.push_back (_input_bundle);
+       b.push_back (_output_bundle);
+       return b;
+}