/
jackaudio.h
71 lines (59 loc) · 2.23 KB
/
jackaudio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//=============================================================================
// MuseScore
// Linux Music Score Editor
// $Id: jackaudio.h 4147 2011-04-07 14:39:44Z wschweer $
//
// Copyright (C) 2002-2009 Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//=============================================================================
#ifndef __JACKAUDIO_H__
#define __JACKAUDIO_H__
#include "config.h"
#include "driver.h"
#include <jack/jack.h>
class Synth;
class Seq;
class MidiDriver;
//---------------------------------------------------------
// JackAudio
//---------------------------------------------------------
class JackAudio : public Driver {
unsigned _segmentSize;
jack_client_t* client;
char _jackName[8];
QList<jack_port_t*> ports;
QList<jack_port_t*> midiOutputPorts;
QList<jack_port_t*> midiInputPorts;
static int processAudio(jack_nframes_t, void*);
public:
JackAudio(Seq*);
virtual ~JackAudio();
virtual bool init();
virtual QList<QString> inputPorts();
virtual bool start();
virtual bool stop();
int framePos() const;
void connect(void*, void*);
void disconnect(void* src, void* dst);
virtual bool isRealtime() const { return jack_is_realtime(client); }
virtual void startTransport();
virtual void stopTransport();
virtual int getState();
virtual int sampleRate() const { return jack_get_sample_rate(client); }
virtual void putEvent(const Event&, unsigned framePos);
virtual void midiRead();
virtual void registerPort(const QString& name, bool input, bool midi);
virtual void unregisterPort(int);
};
#endif