当前位置: 首页>>代码示例>>Java>>正文


Java TDebug.TraceAllExceptions方法代码示例

本文整理汇总了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;
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:23,代码来源:Lame.java

示例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);
		}
	}
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:27,代码来源:Lame.java

示例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;
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:17,代码来源:Lame.java

示例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");
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:19,代码来源:JorbisFormatConversionProvider.java

示例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;
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:29,代码来源:Lame.java

示例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;
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:16,代码来源:Lame.java

示例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;
	}
}
 
开发者ID:petersalomonsen,项目名称:frinika,代码行数:70,代码来源:TCircularBuffer.java

示例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;
	}
}
 
开发者ID:petersalomonsen,项目名称:frinika,代码行数:54,代码来源:TCircularBuffer.java

示例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;
	}
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:70,代码来源:TCircularBuffer.java

示例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;
	}
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:54,代码来源:TCircularBuffer.java

示例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);
		}
	}
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:48,代码来源:Lame.java


注:本文中的org.tritonus.share.TDebug.TraceAllExceptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。