This repository has been archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChannelStrip.h
80 lines (60 loc) · 1.92 KB
/
ChannelStrip.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
71
72
73
74
75
76
77
78
79
80
#ifndef FADER_H
#define FADER_H
#include <QObject>
#include <QString>
#include <jack/jack.h>
class QStringList;
namespace Mixr {
class ChannelStrip : public QObject
{
Q_OBJECT
public:
ChannelStrip(jack_client_t *j_client, const QString& name);
~ChannelStrip();
public slots:
jack_port_t* getInputPort1();
jack_port_t* getInputPort2();
jack_port_t* getOutputPort1();
jack_port_t* getOutputPort2();
float getPeakL() const;
void setPeakL(const float peak);
float getPeakR() const;
void setPeakR(const float peak);
float getVolumeL() const;
float getVolumeR() const;
bool isMuted() const;
void isMuted(const bool isMute);
float getPan() const;
void setPan(const float panValue);
void connectFrom(const QString& portName);
int connectFrom(const QString& portName, const int side);
int disconnectFrom(const QString& portName, const int side);
void connectTo(const QString& portName);
int connectTo(const QString& portName, const int side);
int disconnectTo(const QString& portName, const int side);
void setVolume(const float volumeValue);
QStringList getJackInputPorts();
QStringList getJackOutputPorts();
private:
jack_port_t* registerPort(const QString& name, const JackPortFlags portFlags) const;
QStringList getJackPorts(JackPortFlags jackPortFlags);
void setPortVolumes();
bool hasSuffixOne(const QString& portName) const;
QString ChangeSuffixToTwo(const QString& portName) const;
jack_client_t *client{nullptr};
jack_port_t *input_port_1{nullptr};
jack_port_t *input_port_2{nullptr};
jack_port_t *output_port_1{nullptr};
jack_port_t *output_port_2{nullptr};
QString name;
QStringList port_names{};
bool mute{false};
float volume{1.0f};
float pan{0.5f};
float volL{1.0f};
float volR{1.0f};
float peakL{0.0f};
float peakR{0.0f};
};
} // namespace Mixr
#endif // FADER_H