MuseScore  3.4
Music composition and notation
alsamidi.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Linux Music Score Editor
4 //
5 // Copyright (C) 2009 Werner Schweer and others
6 //
7 // AlsaDriver based on code from Fons Adriaensen (clalsadr.cc)
8 // Copyright (C) 2003 Fons Adriaensen
9 // partly based on original work from Paul Davis
10 //
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License version 2.
13 //
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 //=============================================================================
23 
24 #ifndef __ALSAMIDI_H__
25 #define __ALSAMIDI_H__
26 
27 #include "mididriver.h"
28 
29 namespace Ms {
30 
31 struct PortName {
33  QString name;
34  };
35 
36 //---------------------------------------------------------
37 // AlsaMidiDriver
38 //---------------------------------------------------------
39 
40 class AlsaMidiDriver : public MidiDriver {
41  snd_seq_t* alsaSeq;
42 
43  bool putEvent(snd_seq_event_t* event);
44  QList<PortName> outputPorts();
45  QList<PortName> inputPorts();
46  bool connect(Port src, Port dst);
47 
48  public:
49  AlsaMidiDriver(Seq* s);
50  virtual ~AlsaMidiDriver() {}
51  virtual bool init();
52  virtual Port registerOutPort(const QString& name);
53  virtual Port registerInPort(const QString& name);
54  virtual void getInputPollFd(struct pollfd**, int* n);
55  virtual void getOutputPollFd(struct pollfd**, int* n);
56  virtual void read();
57  virtual void write(const Event&);
58  virtual void updateInPortCount(int);
59  };
60 
61 }
62 #endif
63 
QString name
Definition: alsamidi.h:33
Port port
Definition: alsamidi.h:32
Definition: mididriver.h:68
Definition: seq.h:104
Definition: aeolus.cpp:26
Definition: event.h:264
Definition: alsamidi.h:31
snd_seq_t * alsaSeq
Definition: alsamidi.h:41
virtual ~AlsaMidiDriver()
Definition: alsamidi.h:50
Definition: mididriver.h:43
Definition: alsamidi.h:40