2 * Copyright (C) 2007-2015 Paul Davis <paul@linuxaudiosystems.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "pbd/error.h"
23 #include "pbd/textreceiver.h"
25 Transmitter error (Transmitter::Error);
26 Transmitter info (Transmitter::Info);
27 Transmitter warning (Transmitter::Warning);
28 Transmitter fatal (Transmitter::Fatal);
29 TextReceiver text_receiver ("mmctest");
31 #include "midi++/port.h"
32 #include "midi++/manager.h"
37 PortRequest midi_device;
43 midi_device.devname = "/dev/snd/midiC0D0";
44 midi_device.tagname = "trident";
45 midi_device.mode = O_RDWR;
46 midi_device.type = Port::ALSA_RawMidi;
48 if ((port = MIDI::Manager::instance()->add_port (midi_device)) == 0) {
49 info << "MIDI port is not valid" << endmsg;
56 main (int argc, char *argv[])
61 text_receiver.listen_to (error);
62 text_receiver.listen_to (info);
63 text_receiver.listen_to (fatal);
64 text_receiver.listen_to (warning);
70 port->input()->trace (true, &cout);
73 if (port->read (buf, 1) < 0) {
74 error << "cannot read byte"