Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "pbd/error.h"
-#include <sigc++/retype.h>
-#include <sigc++/retype_return.h>
-#include <sigc++/bind.h>
#include "pbd/enumwriter.h"
+#include "pbd/convert.h"
#include "midi++/events.h"
#include "evoral/midi_util.h"
#include "ardour/processor.h"
#include "ardour/route_group_specialized.h"
#include "ardour/session.h"
+#include "ardour/session_playlists.h"
#include "ardour/utils.h"
#include "i18n.h"
_mode = mode;
}
-MidiTrack::MidiTrack (Session& sess, const XMLNode& node, int version)
- : Track (sess, node, version, DataType::MIDI)
+MidiTrack::MidiTrack (Session& sess, const XMLNode& node, int /*version*/)
+ : Track (sess, node, DataType::MIDI)
, _immediate_events(1024) // FIXME: size?
, _step_edit_ring_buffer(64) // FIXME: size?
, _note_mode(Sustained)
, _default_channel (0)
, _midi_thru (true)
{
- _set_state (node, version, false);
+ _set_state (node, Stateful::loading_state_version, false);
}
MidiTrack::~MidiTrack ()
_diskstream->set_record_enabled (false);
//_diskstream->monitor_input (false);
- ic_connection.disconnect();
- ic_connection = _input->changed.connect (mem_fun (*_diskstream, &MidiDiskstream::handle_input_change));
-
DiskstreamChanged (); /* EMIT SIGNAL */
return 0;
{
boost::shared_ptr<MidiDiskstream> dstream;
- cerr << "\n\n\nMIDI use diskstream\n";
-
if ((dstream = boost::dynamic_pointer_cast<MidiDiskstream>(_session.diskstream_by_name (name))) == 0) {
error << string_compose(_("MidiTrack: midi diskstream \"%1\" not known by session"), name) << endmsg;
return -1;
}
- cerr << "\n\n\nMIDI found DS\n";
return set_diskstream (dstream);
}
an old one.
*/
- cerr << "\n\n\n\n MIDI track " << name() << " found DS id " << id << endl;
-
if (id == zero) {
use_new_diskstream ();
} else if (use_diskstream (id)) {
child = *niter;
if (child->name() == X_("recenable")) {
- _rec_enable_control->set_state (*child);
+ _rec_enable_control->set_state (*child, version);
_session.add_controllable (_rec_enable_control);
}
}
pending_state = const_cast<XMLNode*> (&node);
if (_session.state_of_the_state() & Session::Loading) {
- _session.StateReady.connect (mem_fun (*this, &MidiTrack::set_state_part_two));
+ _session.StateReady.connect_same_thread (*this, boost::bind (&MidiTrack::set_state_part_two, this));
} else {
set_state_part_two ();
}
_freeze_record.processor_info.clear ();
if ((prop = fnode->property (X_("playlist"))) != 0) {
- boost::shared_ptr<Playlist> pl = _session.playlist_by_name (prop->value());
+ boost::shared_ptr<Playlist> pl = _session.playlists->by_name (prop->value());
if (pl) {
_freeze_record.playlist = boost::dynamic_pointer_cast<MidiPlaylist> (pl);
} else {
MidiTrack::write_out_of_band_data (BufferSet& bufs, sframes_t /*start*/, sframes_t /*end*/, nframes_t nframes)
{
// Append immediate events
-
MidiBuffer& buf (bufs.get_midi (0));
_immediate_events.read (buf, 0, 0, nframes - 1); // all stamps = 0
- /* MIDI thru: send incoming data "through" output */
- if (_midi_thru && _input->n_ports().n_midi()) {
+ // MIDI thru: send incoming data "through" output
+ if (_midi_thru && _session.transport_speed() != 0.0f && _input->n_ports().n_midi()) {
buf.merge_in_place (_input->midi(0)->get_midi_buffer(nframes));
}
}
-
int
MidiTrack::export_stuff (BufferSet& /*bufs*/, nframes_t /*nframes*/, sframes_t /*end_frame*/)
{
}
void
-MidiTrack::freeze (InterThreadInfo& /*itt*/)
+MidiTrack::freeze_me (InterThreadInfo& /*itt*/)
{
}
}
assert(val <= _list->parameter().max());
- size_t size = 3;
-
if ( ! automation_playback()) {
+ size_t size = 3;
uint8_t ev[3] = { _list->parameter().channel(), int(val), 0 };
switch(_list->parameter().type()) {
case MidiCCAutomation: