本文整理汇总了Java中org.tritonus.share.TDebug.TraceAllExceptions方法的典型用法代码示例。如果您正苦于以下问题:Java TDebug.TraceAllExceptions方法的具体用法?Java TDebug.TraceAllExceptions怎么用?Java TDebug.TraceAllExceptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tritonus.share.TDebug
的用法示例。
在下文中一共展示了TDebug.TraceAllExceptions方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEncoderVersion
import org.tritonus.share.TDebug; //导入方法依赖的package包/类
public String getEncoderVersion() {
byte[] string=new byte[300];
int res=nGetEncoderVersion(string);
if (res<0) {
if (res==-1) {
throw new RuntimeException("Unexpected error in Lame.getEncoderVersion()");
}
handleNativeException(res);
}
String sRes="";
if (res>0) {
try {
sRes=new String(string, 0, res, "ISO-8859-1");
} catch (UnsupportedEncodingException uee) {
if (TDebug.TraceAllExceptions) {
TDebug.out(uee);
}
sRes=new String(string, 0, res);
}
}
return sRes;
}
示例2: readParameters
import org.tritonus.share.TDebug; //导入方法依赖的package包/类
/**
* workaround for missing paramtrization possibilities
* for FormatConversionProviders
*/
private void readParameters() {
String v=getStringProperty("quality", quality2string(DEFAULT_QUALITY));
DEFAULT_QUALITY=string2quality(v.toLowerCase(), DEFAULT_QUALITY);
DEFAULT_BITRATE=getIntProperty("bitrate", DEFAULT_BITRATE);
v=getStringProperty("chmode", chmode2string(DEFAULT_CHANNEL_MODE));
DEFAULT_CHANNEL_MODE=string2chmode(v.toLowerCase(), DEFAULT_CHANNEL_MODE);
DEFAULT_VBR = getBooleanProperty("vbr", DEFAULT_VBR);
// set the parameters back so that user program can verify them
try {
System.setProperty(PROPERTY_PREFIX + "quality", quality2string(DEFAULT_QUALITY));
System.setProperty(PROPERTY_PREFIX + "bitrate", String.valueOf(DEFAULT_BITRATE));
System.setProperty(PROPERTY_PREFIX + "chmode", chmode2string(DEFAULT_CHANNEL_MODE));
System.setProperty(PROPERTY_PREFIX + "vbr", String.valueOf(DEFAULT_VBR));
}
catch (Throwable t)
{
if (TDebug.TraceAllExceptions)
{
TDebug.out(t);
}
}
}
示例3: getIntProperty
import org.tritonus.share.TDebug; //导入方法依赖的package包/类
private static int getIntProperty(String strName, int def) {
String strPropertyName = PROPERTY_PREFIX + strName;
int value = def;
try {
String strValue = System.getProperty(strPropertyName, String.valueOf(def));
value=new Integer(strValue).intValue();
}
catch (Throwable e)
{
if (TDebug.TraceAllExceptions)
{
TDebug.out(e);
}
}
return value;
}
示例4: closePhysicalStream
import org.tritonus.share.TDebug; //导入方法依赖的package包/类
private void closePhysicalStream()
{
if (TDebug.TraceAudioConverter) TDebug.out("DecodedJorbisAudioInputStream.closePhysicalStream(): begin");
m_oggSyncState.clear();
try
{
if (m_oggBitStream != null)
{
m_oggBitStream.close();
}
getCircularBuffer().close();
}
catch (Exception e)
{
if (TDebug.TraceAllExceptions) { TDebug.out(e); }
}
if (TDebug.TraceAudioConverter) TDebug.out("DecodedJorbisAudioInputStream.closePhysicalStream(): end");
}
示例5: getBooleanProperty
import org.tritonus.share.TDebug; //导入方法依赖的package包/类
private static boolean getBooleanProperty(String strName, boolean def) {
String strPropertyName = PROPERTY_PREFIX + strName;
String strValue = def ? "true":"false";
try {
strValue = System.getProperty(strPropertyName, strValue);
}
catch (Throwable t)
{
if (TDebug.TraceAllExceptions)
{
TDebug.out(t);
}
}
strValue=strValue.toLowerCase();
boolean bValue=false;
if (strValue.length()>0) {
if (def) {
bValue=(strValue.charAt(0)!='f') // false
&& (strValue.charAt(0)!='n') // no
&& (!strValue.equals("off"));
} else {
bValue=(strValue.charAt(0)=='t') // true
|| (strValue.charAt(0)=='y') // yes
|| (strValue.equals("on"));
}
}
return bValue;
}
示例6: getStringProperty
import org.tritonus.share.TDebug; //导入方法依赖的package包/类
private static String getStringProperty(String strName, String def) {
String strPropertyName = PROPERTY_PREFIX + strName;
String strValue = def;
try {
strValue = System.getProperty(strPropertyName, def);
}
catch (Throwable t)
{
if (TDebug.TraceAllExceptions)
{
TDebug.out(t);
}
}
return strValue;
}
示例7: read
import org.tritonus.share.TDebug; //导入方法依赖的package包/类
public int read(byte[] abData, int nOffset, int nLength)
{
if (TDebug.TraceCircularBuffer)
{
TDebug.out(">TCircularBuffer.read(): called.");
dumpInternalState();
}
if (! isOpen())
{
if (availableRead() > 0)
{
nLength = Math.min(nLength, availableRead());
if (TDebug.TraceCircularBuffer) { TDebug.out("reading rest in closed buffer, length: " + nLength); }
}
else
{
if (TDebug.TraceCircularBuffer) { TDebug.out("< not open. returning -1."); }
return -1;
}
}
synchronized (this)
{
if (m_trigger != null && availableRead() < nLength)
{
if (TDebug.TraceCircularBuffer) { TDebug.out("executing trigger."); }
m_trigger.execute();
}
if (!m_bBlockingRead)
{
nLength = Math.min(availableRead(), nLength);
}
int nRemainingBytes = nLength;
while (nRemainingBytes > 0)
{
while (availableRead() == 0)
{
try
{
wait();
}
catch (InterruptedException e)
{
if (TDebug.TraceAllExceptions)
{
TDebug.out(e);
}
}
}
int nAvailable = Math.min(availableRead(), nRemainingBytes);
while (nAvailable > 0)
{
int nToRead = Math.min(nAvailable, m_nSize - getReadPos());
System.arraycopy(m_abData, getReadPos(), abData, nOffset, nToRead);
m_lReadPos += nToRead;
nOffset += nToRead;
nAvailable -= nToRead;
nRemainingBytes -= nToRead;
}
notifyAll();
}
if (TDebug.TraceCircularBuffer)
{
TDebug.out("After read:");
dumpInternalState();
TDebug.out("< completed. Read " + nLength + " bytes");
}
return nLength;
}
}
示例8: write
import org.tritonus.share.TDebug; //导入方法依赖的package包/类
public int write(byte[] abData, int nOffset, int nLength)
{
if (TDebug.TraceCircularBuffer)
{
TDebug.out(">TCircularBuffer.write(): called; nLength: " + nLength);
dumpInternalState();
}
synchronized (this)
{
if (TDebug.TraceCircularBuffer) { TDebug.out("entered synchronized block."); }
if (!m_bBlockingWrite)
{
nLength = Math.min(availableWrite(), nLength);
}
int nRemainingBytes = nLength;
while (nRemainingBytes > 0)
{
while (availableWrite() == 0)
{
try
{
wait();
}
catch (InterruptedException e)
{
if (TDebug.TraceAllExceptions)
{
TDebug.out(e);
}
}
}
int nAvailable = Math.min(availableWrite(), nRemainingBytes);
while (nAvailable > 0)
{
int nToWrite = Math.min(nAvailable, m_nSize - getWritePos());
//TDebug.out("src buf size= " + abData.length + ", offset = " + nOffset + ", dst buf size=" + m_abData.length + " write pos=" + getWritePos() + " len=" + nToWrite);
System.arraycopy(abData, nOffset, m_abData, getWritePos(), nToWrite);
m_lWritePos += nToWrite;
nOffset += nToWrite;
nAvailable -= nToWrite;
nRemainingBytes -= nToWrite;
}
notifyAll();
}
if (TDebug.TraceCircularBuffer)
{
TDebug.out("After write:");
dumpInternalState();
TDebug.out("< completed. Wrote "+nLength+" bytes");
}
return nLength;
}
}
示例9: read
import org.tritonus.share.TDebug; //导入方法依赖的package包/类
public int read(byte[] abData, int nOffset, int nLength)
{
if (TDebug.TraceCircularBuffer)
{
TDebug.out(">TCircularBuffer.read(): called.");
dumpInternalState();
}
if (! isOpen())
{
if (availableRead() > 0)
{
nLength = Math.min(nLength, availableRead());
if (TDebug.TraceCircularBuffer) { TDebug.out("reading rest in closed buffer, length: " + nLength); }
}
else
{
if (TDebug.TraceCircularBuffer) { TDebug.out("< not open. returning -1."); }
return -1;
}
}
synchronized (this)
{
if (m_trigger != null && availableRead() < nLength)
{
if (TDebug.TraceCircularBuffer) { TDebug.out("executing trigger."); }
m_trigger.execute();
}
if (!m_bBlockingRead)
{
nLength = Math.min(availableRead(), nLength);
}
int nRemainingBytes = nLength;
while (nRemainingBytes > 0)
{
while (availableRead() == 0)
{
try
{
wait();
}
catch (InterruptedException e)
{
if (TDebug.TraceAllExceptions)
{
TDebug.out(e);
}
}
}
int nAvailable = Math.min(availableRead(), nRemainingBytes);
while (nAvailable > 0)
{
int nToRead = Math.min(nAvailable, m_nSize - getReadPos());
System.arraycopy(m_abData, getReadPos(), abData, nOffset, nToRead);
m_nReadPos += nToRead;
nOffset += nToRead;
nAvailable -= nToRead;
nRemainingBytes -= nToRead;
}
notifyAll();
}
if (TDebug.TraceCircularBuffer)
{
TDebug.out("After read:");
dumpInternalState();
TDebug.out("< completed. Read " + nLength + " bytes");
}
return nLength;
}
}
示例10: write
import org.tritonus.share.TDebug; //导入方法依赖的package包/类
public int write(byte[] abData, int nOffset, int nLength)
{
if (TDebug.TraceCircularBuffer)
{
TDebug.out(">TCircularBuffer.write(): called; nLength: " + nLength);
dumpInternalState();
}
synchronized (this)
{
if (TDebug.TraceCircularBuffer) { TDebug.out("entered synchronized block."); }
if (!m_bBlockingWrite)
{
nLength = Math.min(availableWrite(), nLength);
}
int nRemainingBytes = nLength;
while (nRemainingBytes > 0)
{
while (availableWrite() == 0)
{
try
{
wait();
}
catch (InterruptedException e)
{
if (TDebug.TraceAllExceptions)
{
TDebug.out(e);
}
}
}
int nAvailable = Math.min(availableWrite(), nRemainingBytes);
while (nAvailable > 0)
{
int nToWrite = Math.min(nAvailable, m_nSize - getWritePos());
//TDebug.out("src buf size= " + abData.length + ", offset = " + nOffset + ", dst buf size=" + m_abData.length + " write pos=" + getWritePos() + " len=" + nToWrite);
System.arraycopy(abData, nOffset, m_abData, getWritePos(), nToWrite);
m_nWritePos += nToWrite;
nOffset += nToWrite;
nAvailable -= nToWrite;
nRemainingBytes -= nToWrite;
}
notifyAll();
}
if (TDebug.TraceCircularBuffer)
{
TDebug.out("After write:");
dumpInternalState();
TDebug.out("< completed. Wrote "+nLength+" bytes");
}
return nLength;
}
}
示例11: initParams
import org.tritonus.share.TDebug; //导入方法依赖的package包/类
private void initParams(AudioFormat sourceFormat, int bitRate, int channelMode, int quality, boolean VBR) {
// simple check that bitrate is not too high for MPEG2 and MPEG2.5
// todo: exception ?
if (sourceFormat.getSampleRate()<32000 && bitRate>160) {
bitRate=160;
}
if (TDebug.TraceAudioConverter) {
TDebug.out("LAME parameters: channels="+sourceFormat.getChannels()
+" sample rate="+((int) Math.round(sourceFormat.getSampleRate())+"Hz")
+" bitrate="+bitRate+"KBit/s");
TDebug.out(" channelMode="+chmode2string(channelMode)
+" quality="+quality2string(quality)
+" VBR="+VBR+" bigEndian="+sourceFormat.isBigEndian());
}
int result=nInitParams(sourceFormat.getChannels(), (int) Math.round(sourceFormat.getSampleRate()),
bitRate, channelMode, quality,
VBR, sourceFormat.isBigEndian());
if (result<0) {
handleNativeException(result);
throw new IllegalArgumentException(
"parameters not supported by LAME (returned "+result+")");
}
// provide effective parameters to user-space
try {
System.setProperty(PROPERTY_PREFIX + "effective.quality",
quality2string(getEffectiveQuality()));
System.setProperty(PROPERTY_PREFIX + "effective.bitrate",
String.valueOf(getEffectiveBitRate()));
System.setProperty(PROPERTY_PREFIX + "effective.chmode",
chmode2string(getEffectiveChannelMode()));
System.setProperty(PROPERTY_PREFIX + "effective.vbr",
String.valueOf(getEffectiveVBR()));
System.setProperty(PROPERTY_PREFIX + "effective.samplerate",
String.valueOf(getEffectiveSampleRate()));
System.setProperty(PROPERTY_PREFIX + "effective.encoding",
getEffectiveEncoding().toString());
System.setProperty(PROPERTY_PREFIX + "encoder.version",
getEncoderVersion());
}
catch (Throwable t)
{
if (TDebug.TraceAllExceptions)
{
TDebug.out(t);
}
}
}