56 lines
1.5 KiB
Java
56 lines
1.5 KiB
Java
package org.webrtc;
|
|
public class DtmfSender {
|
|
private long nativeDtmfSender;
|
|
|
|
public DtmfSender(long j) {
|
|
this.nativeDtmfSender = j;
|
|
}
|
|
|
|
private void checkDtmfSenderExists() {
|
|
if (this.nativeDtmfSender == 0) {
|
|
throw new IllegalStateException("DtmfSender has been disposed.");
|
|
}
|
|
}
|
|
|
|
private static native boolean nativeCanInsertDtmf(long j);
|
|
|
|
private static native int nativeDuration(long j);
|
|
|
|
private static native boolean nativeInsertDtmf(long j, String str, int i, int i2);
|
|
|
|
private static native int nativeInterToneGap(long j);
|
|
|
|
private static native String nativeTones(long j);
|
|
|
|
public boolean canInsertDtmf() {
|
|
checkDtmfSenderExists();
|
|
return nativeCanInsertDtmf(this.nativeDtmfSender);
|
|
}
|
|
|
|
public void dispose() {
|
|
checkDtmfSenderExists();
|
|
JniCommon.nativeReleaseRef(this.nativeDtmfSender);
|
|
this.nativeDtmfSender = 0;
|
|
}
|
|
|
|
public int duration() {
|
|
checkDtmfSenderExists();
|
|
return nativeDuration(this.nativeDtmfSender);
|
|
}
|
|
|
|
public boolean insertDtmf(String str, int i, int i2) {
|
|
checkDtmfSenderExists();
|
|
return nativeInsertDtmf(this.nativeDtmfSender, str, i, i2);
|
|
}
|
|
|
|
public int interToneGap() {
|
|
checkDtmfSenderExists();
|
|
return nativeInterToneGap(this.nativeDtmfSender);
|
|
}
|
|
|
|
public String tones() {
|
|
checkDtmfSenderExists();
|
|
return nativeTones(this.nativeDtmfSender);
|
|
}
|
|
}
|