MuseScore  3.4
Music composition and notation
driver.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 __DRIVER_H__
21 #define __DRIVER_H__
22 
23 namespace Ms {
24 
25 class Seq;
26 class NPlayEvent;
27 enum class Transport : char;
28 
29 //---------------------------------------------------------
30 // Driver
31 //---------------------------------------------------------
32 
33 class Driver {
34 
35  protected:
36  Seq* seq;
37 
38  public:
39  Driver(Seq* s) { seq = s; }
40  virtual ~Driver() {}
41  virtual bool init(bool hot = false) = 0;
42  virtual bool start(bool hotPlug = false) = 0;
43  virtual bool stop() = 0;
44  virtual void stopTransport() = 0;
45  virtual void startTransport() = 0;
46  virtual Transport getState() = 0;
47  virtual void seekTransport(int) {}
48  virtual int sampleRate() const = 0;
49  virtual void putEvent(const NPlayEvent&, unsigned /*framePos*/) {}
50  virtual void midiRead() {}
51  virtual void handleTimeSigTempoChanged() {}
52  virtual void checkTransportSeek(int, int, bool) {}
53  virtual int bufferSize() {return 0;}
54  virtual void updateOutPortCount(int) {}
55  };
56 
58 
59 } // namespace Ms
60 #endif
61 
virtual int bufferSize()
Definition: driver.h:53
virtual void handleTimeSigTempoChanged()
Definition: driver.h:51
virtual void putEvent(const NPlayEvent &, unsigned)
Definition: driver.h:49
bool alsaIsUsed
Definition: driver.cpp:42
Definition: driver.h:33
Transport
Definition: seq.h:92
Definition: seq.h:104
virtual void seekTransport(int)
Definition: driver.h:47
virtual ~Driver()
Definition: driver.h:40
Definition: aeolus.cpp:26
Definition: event.h:238
virtual void checkTransportSeek(int, int, bool)
Definition: driver.h:52
bool portAudioIsUsed
Definition: driver.cpp:42
bool pulseAudioIsUsed
Definition: driver.cpp:42
Driver(Seq *s)
Definition: driver.h:39
virtual void midiRead()
Definition: driver.h:50
virtual void updateOutPortCount(int)
Definition: driver.h:54
bool jackIsUsed
Definition: driver.cpp:42
Seq * seq
Definition: driver.h:36