MuseScore  3.4
Music composition and notation
pa.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Linux Music Score Editor
4 //
5 // Copyright (C) 2002-2009 Werner Schweer and others
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __PORTAUDIO_H__
21 #define __PORTAUDIO_H__
22 
23 #include "config.h"
24 
25 namespace Ms {
26 
27 class Synth;
28 class Seq;
29 class MidiDriver;
30 class NPlayEvent;
31 enum class Transport : char;
32 
33 //---------------------------------------------------------
34 // Portaudio
35 //---------------------------------------------------------
36 
37 class Portaudio : public Driver {
40 
42  bool seekflag;
43  unsigned pos;
44  double startTime;
45 
47 
48  public:
49  Portaudio(Seq*);
50  virtual ~Portaudio();
51  virtual bool init(bool hot = false);
52  virtual bool start(bool hotPlug = false);
53  virtual bool stop();
54  virtual void startTransport();
55  virtual void stopTransport();
56  virtual Transport getState() override;
57  virtual int sampleRate() const { return _sampleRate; }
58  virtual void midiRead();
59 #ifdef USE_PORTMIDI
60  virtual void putEvent(const NPlayEvent&, unsigned framePos);
61 #endif
62 
63  int framePos() const;
64  float* getLBuffer(long n);
65  float* getRBuffer(long n);
66  virtual bool isRealtime() const { return false; }
67 
68  QStringList apiList() const;
69  QStringList deviceList(int apiIdx);
70  int deviceIndex(int apiIdx, int apiDevIdx);
71  int currentApi() const;
72  int currentDevice() const;
73  MidiDriver* mididriver() { return midiDriver; }
74  };
75 
76 
77 } // namespace Ms
78 #endif
79 
80 
Definition: pa.h:37
virtual bool isRealtime() const
Definition: pa.h:66
Definition: driver.h:33
Definition: mididriver.h:68
Transport
Definition: seq.h:92
Definition: seq.h:104
bool initialized
Definition: pa.h:38
Transport state
Definition: pa.h:41
Definition: aeolus.cpp:26
MidiDriver * mididriver()
Definition: pa.h:73
Definition: event.h:238
int _sampleRate
Definition: pa.h:39
unsigned pos
Definition: pa.h:43
virtual int sampleRate() const
Definition: pa.h:57
MidiDriver * midiDriver
Definition: pa.h:46
double startTime
Definition: pa.h:44
bool seekflag
Definition: pa.h:42