1 package net.sf.jack4j;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.EnumSet;
23
24
25
26
27
28
29
30 public class JackPort {
31
32 static {
33 JackBridge.initializeJackBridge();
34 }
35
36 private volatile long portHandle = 0;
37
38 JackPort(long portHandle) {
39 this.portHandle = portHandle;
40 }
41
42
43
44
45
46 public native String getPortShortName() throws JackException;
47
48
49
50
51 public native String getPortName() throws JackException;
52
53
54
55
56 public native String getPortType() throws JackException;
57
58
59
60
61 public boolean isInput() throws JackException {
62 return (getPortFlags() & JackPortFlag.IS_INPUT.intValue()) != 0;
63 }
64
65
66
67
68 public boolean isOutput() throws JackException {
69 return (getPortFlags() & JackPortFlag.IS_OUTPUT.intValue()) != 0;
70 }
71
72
73
74
75 public boolean isPhysical() throws JackException {
76 return (getPortFlags() & JackPortFlag.IS_PHYSICAL.intValue()) != 0;
77 }
78
79
80
81
82 public boolean isMonitorable() throws JackException {
83 return (getPortFlags() & JackPortFlag.CAN_MONITOR.intValue()) != 0;
84 }
85
86
87
88
89 public boolean isTerminal() throws JackException {
90 return (getPortFlags() & JackPortFlag.IS_TERMINAL.intValue()) != 0;
91 }
92
93
94
95
96
97 public long getPortHandle() {
98 return portHandle;
99 }
100
101
102
103
104 public EnumSet<JackPortFlag> getPortFlagSet() throws JackException {
105 return JackPortFlag.decode(getPortFlags());
106 }
107
108
109
110
111 public native int getPortFlags() throws JackException;
112
113
114
115
116 public native int getLatency() throws JackException;
117
118
119
120
121 public native void setLatency(int latency) throws JackException;
122
123
124
125
126 public native void requestMonitor(boolean on) throws JackException;
127
128
129
130
131
132
133 public native void ensureMonitor(boolean on) throws JackException;
134
135
136
137
138 public native boolean monitoringInput() throws JackException;
139 }