add MIDI input control column to editor route list; tweak SVG for MIDI not DIN

git-svn-id: svn://localhost/ardour2/branches/3.0@9779 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis
2011-07-01 15:48:24 +00:00
parent 10e12dc287
commit 67e21fd82e
9 changed files with 169 additions and 56 deletions

View File

@@ -39,6 +39,8 @@ public:
MidiTrack (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal);
~MidiTrack ();
int init ();
int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
int declick, bool can_record, bool rec_monitors_input, bool& need_butler);
@@ -129,6 +131,7 @@ protected:
NoteMode _note_mode;
bool _step_editing;
bool _midi_thru;
bool _input_active;
int no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
bool state_changing, bool can_record, bool rec_monitors_input);
@@ -136,6 +139,9 @@ protected:
void diskstream_data_recorded (boost::shared_ptr<MidiBuffer>, boost::weak_ptr<MidiSource>);
PBD::ScopedConnection _diskstream_data_recorded_connection;
void track_input_active (IOChange, void*);
void map_input_active (bool);
};
} /* namespace ARDOUR*/

View File

@@ -582,6 +582,7 @@ LV2Plugin::add_state(XMLNode* root) const
if (_supports_persist) {
// Create state directory for this plugin instance
cerr << "Create statefile name from ID " << _insert_id << endl;
const std::string state_filename = _insert_id.to_s() + ".rdff";
const std::string state_path = Glib::build_filename(
_session.plugins_dir(), state_filename);

View File

@@ -57,6 +57,7 @@ MidiTrack::MidiTrack (Session& sess, string name, Route::Flag flag, TrackMode mo
, _note_mode(Sustained)
, _step_editing (false)
, _midi_thru (true)
, _input_active (true)
{
}
@@ -64,6 +65,18 @@ MidiTrack::~MidiTrack ()
{
}
int
MidiTrack::init ()
{
if (Track::init ()) {
return -1;
}
_input->changed.connect_same_thread (*this, boost::bind (&MidiTrack::track_input_active, this, _1, _2));
return 0;
}
void
MidiTrack::use_new_diskstream ()
{
@@ -146,7 +159,11 @@ MidiTrack::_set_state (const XMLNode& node, int version, bool call_base)
}
if ((prop = node.property ("midi-thru")) != 0) {
set_midi_thru (prop->value() == "yes");
set_midi_thru (string_is_affirmative (prop->value()));
}
if ((prop = node.property ("input-active")) != 0) {
set_input_active (string_is_affirmative (prop->value()));
}
XMLNodeList nlist;
@@ -222,6 +239,7 @@ MidiTrack::state(bool full_state)
root.add_property ("step-editing", (_step_editing ? "yes" : "no"));
root.add_property ("note-mode", enum_2_string (_note_mode));
root.add_property ("midi-thru", (_midi_thru ? "yes" : "no"));
root.add_property ("input-active", (_input_active ? "yes" : "no"));
return root;
}
@@ -677,8 +695,24 @@ MidiTrack::send_silence () const
return false;
}
bool
MidiTrack::input_active () const
{
return _input_active;
}
void
MidiTrack::set_input_active (bool yn)
{
if (yn != _input_active) {
_input_active = yn;
map_input_active (yn);
InputActiveChanged (); /* EMIT SIGNAL */
}
}
void
MidiTrack::map_input_active (bool yn)
{
bool changed = false;
@@ -695,27 +729,13 @@ MidiTrack::set_input_active (bool yn)
changed = true;
}
}
if (changed) {
InputActiveChanged (); /* EMIT SIGNAL */
}
}
bool
MidiTrack::input_active () const
void
MidiTrack::track_input_active (IOChange change, void* /* src */)
{
if (!_input) {
cerr << " no input\n";
return false;
}
if (_input->ports().count().n_midi() == 0) {
cerr << "no input MIDI ports, " << _input->ports().count() << endl;
return false;
if (change.type & IOChange::ConfigurationChanged) {
map_input_active (_input_active);
}
PortSet::iterator p = _input->ports().begin(DataType::MIDI);
MidiPort* mp = dynamic_cast<MidiPort*> (&*p);
cerr << "first port is active: " << mp->input_active() << endl;
return mp->input_active ();
}

View File

@@ -70,9 +70,7 @@ PluginInsert::PluginInsert (Session& s, boost::shared_ptr<Plugin> plug)
/* the first is the master */
if (plug) {
plug->set_insert_info (this);
_plugins.push_back (plug);
add_plugin (plug);
create_automatable_parameters ();
Glib::Mutex::Lock em (_session.engine().process_lock());
@@ -884,6 +882,17 @@ PluginInsert::set_state(const XMLNode& node, int version)
uint32_t count = 1;
#if 0
// Processor::set_state() will set this, but too late
// for it to be available when setting up plugin
// state. We can't call Processor::set_state() until
// the plugins themselves are created and added.
if ((prop = node.property ("id")) != 0) {
_id = prop->value();
}
#endif
if (_plugins.empty()) {
/* if we are adding the first plugin, we will need to set
up automatable controls.
@@ -903,6 +912,8 @@ PluginInsert::set_state(const XMLNode& node, int version)
}
}
Processor::set_state (node, version);
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
/* find the node with the type-specific node name ("lv2", "ladspa", etc)
@@ -921,8 +932,6 @@ PluginInsert::set_state(const XMLNode& node, int version)
}
}
Processor::set_state (node, version);
if (version < 3000) {
/* Only 2.X sessions need a call to set_parameter_state() - in 3.X and above