return -1;
}
+int
+AlsaAudioBackend::set_port_property (PortHandle port, const std::string& key, const std::string& value, const std::string& type)
+{
+ if (!valid_port (port)) {
+ PBD::warning << _("AlsaBackend::set_port_property: Invalid Port(s)") << endmsg;
+ return -1;
+ }
+ if (key == "http://jackaudio.org/metadata/pretty-name" && type.empty ()) {
+ static_cast<AlsaPort*>(port)->set_pretty_name (value);
+ return 0;
+ }
+ return -1;
+}
+
PortEngine::PortHandle
AlsaAudioBackend::get_port_by_name (const std::string& name) const
{
int set_port_name (PortHandle, const std::string&);
std::string get_port_name (PortHandle) const;
PortHandle get_port_by_name (const std::string&) const;
+
int get_port_property (PortHandle, const std::string& key, std::string& value, std::string& type) const;
+ int set_port_property (PortHandle, const std::string& key, const std::string& value, const std::string& type);
int get_ports (const std::string& port_name_pattern, DataType type, PortFlags flags, std::vector<std::string>&) const;
return static_cast<DummyPort*>(port)->name ();
}
+int
+DummyAudioBackend::get_port_property (PortHandle port, const std::string& key, std::string& value, std::string& type) const
+{
+ if (!valid_port (port)) {
+ PBD::warning << _("DummyBackend::get_port_property: Invalid Port(s)") << endmsg;
+ return -1;
+ }
+ if (key == "http://jackaudio.org/metadata/pretty-name") {
+ type = "";
+ value = static_cast<DummyPort*>(port)->pretty_name ();
+ if (!value.empty()) {
+ return 0;
+ }
+ }
+ return -1;
+}
+
+int
+DummyAudioBackend::set_port_property (PortHandle port, const std::string& key, const std::string& value, const std::string& type)
+{
+ if (!valid_port (port)) {
+ PBD::warning << _("DummyBackend::set_port_property: Invalid Port(s)") << endmsg;
+ return -1;
+ }
+ if (key == "http://jackaudio.org/metadata/pretty-name" && type.empty ()) {
+ static_cast<DummyPort*>(port)->set_pretty_name (value);
+ return 0;
+ }
+ return -1;
+}
+
+
PortEngine::PortHandle
DummyAudioBackend::get_port_by_name (const std::string& name) const
{
_system_midi_in.push_back (static_cast<DummyMidiPort*>(p));
if (_midi_mode == MidiGenerator) {
static_cast<DummyMidiPort*>(p)->setup_generator (i % NUM_MIDI_EVENT_GENERATORS, _samplerate);
+ static_cast<DummyMidiPort*>(p)->set_pretty_name (DummyMidiData::sequence_names[i % NUM_MIDI_EVENT_GENERATORS]);
}
}
if (!p) return -1;
set_latency_range (p, true, lr);
_system_midi_out.push_back (static_cast<DummyMidiPort*>(p));
+
+ if (_device == _("Loopback") && _midi_mode == MidiToAudio) {
+ std::stringstream ss;
+ ss << "Midi2Audio";
+ for (int apc = 0; apc < (int)_system_inputs.size(); ++apc) {
+ if ((apc % m_out) + 1 == i) {
+ ss << " >" << (apc + 1);
+ }
+ }
+ static_cast<DummyMidiPort*>(p)->set_pretty_name (ss.str());
+ }
}
return 0;
}
virtual ~DummyPort ();
const std::string& name () const { return _name; }
+ const std::string& pretty_name () const { return _pretty_name; }
PortFlags flags () const { return _flags; }
int set_name (const std::string &name) { _name = name; return 0; }
+ int set_pretty_name (const std::string &name) { _pretty_name = name; return 0; }
virtual DataType type () const = 0;
private:
DummyAudioBackend &_dummy_backend;
std::string _name;
+ std::string _pretty_name;
const PortFlags _flags;
LatencyRange _capture_latency_range;
LatencyRange _playback_latency_range;
std::string get_port_name (PortHandle) const;
PortHandle get_port_by_name (const std::string&) const;
+ int get_port_property (PortHandle, const std::string& key, std::string& value, std::string& type) const;
+ int set_port_property (PortHandle, const std::string& key, const std::string& value, const std::string& type);
+
int get_ports (const std::string& port_name_pattern, DataType type, PortFlags flags, std::vector<std::string>&) const;
DataType port_data_type (PortHandle) const;
s0, s1, s2, s3, s4, s5, s6
};
+static const char *sequence_names[] = {
+ "Short Sequence",
+ "Cmaj7, all channels",
+ "Note Sweep, chan 1",
+ "Velocity Sweep, chan 1",
+ "Sustain Pedal Test",
+ "CCs only",
+ "Nonsense, Dups"
+};
+
}} // namespace
#define NUM_MIDI_EVENT_GENERATORS (sizeof (ARDOUR::DummyMidiData::sequences) / sizeof(ARDOUR::DummyMidiData::MIDISequence*))