2 Copyright (C) 2012 Paul Davis
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
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "pbd/error.h"
24 #include "pbd/textreceiver.h"
26 Transmitter error (Transmitter::Error);
27 Transmitter info (Transmitter::Info);
28 Transmitter warning (Transmitter::Warning);
29 Transmitter fatal (Transmitter::Fatal);
30 TextReceiver text_receiver ("mmctest");
32 #include "midi++/port.h"
33 #include "midi++/manager.h"
38 PortRequest midi_device;
44 midi_device.devname = "/dev/snd/midiC0D0";
45 midi_device.tagname = "trident";
46 midi_device.mode = O_RDWR;
47 midi_device.type = Port::ALSA_RawMidi;
49 if ((port = MIDI::Manager::instance()->add_port (midi_device)) == 0) {
50 info << "MIDI port is not valid" << endmsg;
57 main (int argc, char *argv[])
62 text_receiver.listen_to (error);
63 text_receiver.listen_to (info);
64 text_receiver.listen_to (fatal);
65 text_receiver.listen_to (warning);
71 port->input()->trace (true, &cout);
74 if (port->read (buf, 1) < 0) {
75 error << "cannot read byte"