udioFormat audioFormat = m_audioInputStream.getFormat();
trace(1,getClass().getName(), "AudioFormat : "+audioFormat);
m_line.open(audioFormat, m_line.getBufferSize());
}
}
/**
* Stops the playback.<br>
*
* Player Status = STOPPED.<br>
* Thread should free Audio ressources.
*/
protected void stopPlayback()
{
if ( (m_status == PLAYING) || (m_status == PAUSED) )
{
if (m_line != null)
{
m_line.flush();
m_line.stop();
}
m_status = STOPPED;
trace(1,getClass().getName(), "Stop called");
}
}
/**
* Pauses the playback.<br>
*
* Player Status = PAUSED.
*/
public void pausePlayback()
{
if (m_line != null)
{
if (m_status == PLAYING)
{
m_line.flush();
m_line.stop();
m_status = PAUSED;
trace(1,getClass().getName(), "Pause called");
}
}
}
/**
* Resumes the playback.<br>
*
* Player Status = PLAYING.
*/
public void resumePlayback()
{
if (m_line != null)
{
if (m_status == PAUSED)
{
m_line.start();
m_status = PLAYING;
trace(1,getClass().getName(), "Resume called");
}
}
}
/**
* Starts playback.
*/
public String startPlayback()
{
if ((m_status == STOPPED) || (m_status == READY))
{
trace(1,getClass().getName(), "Start called");
if (!(m_thread == null || !m_thread.isAlive()))
{
trace(1,getClass().getName(), "WARNING: old thread still runing!!");
while (m_status != READY)
{
try
{
if (m_thread != null) m_
上一篇:
BasicNameable.java
下一篇:
浮生若萍