From 7039a05147b8bbfc829babea1c65bd436450b505 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Mon, 8 Jan 2007 23:53:00 +0000 Subject: Splitting out songdbj git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11953 a1c6a512-1295-4272-9138-f99709370657 --- .../share/sampled/mixer/TBaseDataLine.java | 107 ----- .../share/sampled/mixer/TBooleanControl.java | 128 ------ .../org/tritonus/share/sampled/mixer/TClip.java | 340 -------------- .../share/sampled/mixer/TCompoundControl.java | 90 ---- .../share/sampled/mixer/TCompoundControlType.java | 55 --- .../share/sampled/mixer/TControlController.java | 98 ---- .../share/sampled/mixer/TControllable.java | 62 --- .../tritonus/share/sampled/mixer/TDataLine.java | 304 ------------- .../tritonus/share/sampled/mixer/TEnumControl.java | 92 ---- .../share/sampled/mixer/TFloatControl.java | 134 ------ .../org/tritonus/share/sampled/mixer/TLine.java | 362 --------------- .../org/tritonus/share/sampled/mixer/TMixer.java | 506 --------------------- .../tritonus/share/sampled/mixer/TMixerInfo.java | 56 --- .../share/sampled/mixer/TMixerProvider.java | 240 ---------- .../org/tritonus/share/sampled/mixer/TPort.java | 77 ---- .../tritonus/share/sampled/mixer/TSoftClip.java | 318 ------------- .../org/tritonus/share/sampled/mixer/package.html | 14 - 17 files changed, 2983 deletions(-) delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TBaseDataLine.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TBooleanControl.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TClip.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TCompoundControl.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TCompoundControlType.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TControlController.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TControllable.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TDataLine.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TEnumControl.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TFloatControl.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TLine.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TMixer.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TMixerInfo.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TMixerProvider.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TPort.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/TSoftClip.java delete mode 100644 songdbj/org/tritonus/share/sampled/mixer/package.html (limited to 'songdbj/org/tritonus/share/sampled/mixer') diff --git a/songdbj/org/tritonus/share/sampled/mixer/TBaseDataLine.java b/songdbj/org/tritonus/share/sampled/mixer/TBaseDataLine.java deleted file mode 100644 index e589439838..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TBaseDataLine.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * TBaseDataLine.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 1999 - 2004 by Matthias Pfisterer - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import java.util.Collection; -import java.util.EventListener; -import java.util.EventObject; -import java.util.HashSet; -import java.util.Set; - -import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.Control; -import javax.sound.sampled.DataLine; -import javax.sound.sampled.LineEvent; -import javax.sound.sampled.Line; -import javax.sound.sampled.LineUnavailableException; - -import org.tritonus.share.TDebug; - - - -/** Base class for implementing SourceDataLine or TargetDataLine. - */ -public abstract class TBaseDataLine -extends TDataLine -{ - public TBaseDataLine(TMixer mixer, - DataLine.Info info) - { - super(mixer, - info); - } - - - - public TBaseDataLine(TMixer mixer, - DataLine.Info info, - Collection controls) - { - super(mixer, - info, - controls); - } - - - - public void open(AudioFormat format, int nBufferSize) - throws LineUnavailableException - { - if (TDebug.TraceDataLine) { TDebug.out("TBaseDataLine.open(AudioFormat, int): called with buffer size: " + nBufferSize); } - setBufferSize(nBufferSize); - open(format); - } - - - - public void open(AudioFormat format) - throws LineUnavailableException - { - if (TDebug.TraceDataLine) { TDebug.out("TBaseDataLine.open(AudioFormat): called"); } - setFormat(format); - open(); - } - - - // IDEA: move to TDataLine or TLine? - // necessary and wise at all? - protected void finalize() - { - if (isOpen()) - { - close(); - } - } -} - - - -/*** TBaseDataLine.java ***/ - diff --git a/songdbj/org/tritonus/share/sampled/mixer/TBooleanControl.java b/songdbj/org/tritonus/share/sampled/mixer/TBooleanControl.java deleted file mode 100644 index a722edbf31..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TBooleanControl.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * TBooleanControl.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 2001 by Matthias Pfisterer - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import javax.sound.sampled.BooleanControl; - -import org.tritonus.share.TDebug; - - - - -/** Base class for classes implementing BooleanControl. - */ -public class TBooleanControl -extends BooleanControl -implements TControllable -{ - private TControlController m_controller; - - - - public TBooleanControl(BooleanControl.Type type, - boolean bInitialValue) - { - this(type, bInitialValue, null); - } - - - - public TBooleanControl(BooleanControl.Type type, - boolean bInitialValue, - TCompoundControl parentControl) - { - super(type, bInitialValue); - if (TDebug.TraceControl) - { - TDebug.out("TBooleanControl.: begin"); - } - m_controller = new TControlController(); - if (TDebug.TraceControl) - { - TDebug.out("TBooleanControl.: end"); - } - } - - - - public TBooleanControl(BooleanControl.Type type, - boolean bInitialValue, - String strTrueStateLabel, - String strFalseStateLabel) - { - this(type, bInitialValue, strTrueStateLabel, strFalseStateLabel, null); - } - - - - public TBooleanControl(BooleanControl.Type type, - boolean bInitialValue, - String strTrueStateLabel, - String strFalseStateLabel, - TCompoundControl parentControl) - { - super(type, bInitialValue, strTrueStateLabel, strFalseStateLabel); - if (TDebug.TraceControl) - { - TDebug.out("TBooleanControl.: begin"); - } - m_controller = new TControlController(); - if (TDebug.TraceControl) - { - TDebug.out("TBooleanControl.: end"); - } - } - - - - public void setParentControl(TCompoundControl compoundControl) - { - m_controller.setParentControl(compoundControl); - } - - - - public TCompoundControl getParentControl() - { - return m_controller.getParentControl(); - } - - - - public void commit() - { - m_controller.commit(); - } -} - - - -/*** TBooleanControl.java ***/ diff --git a/songdbj/org/tritonus/share/sampled/mixer/TClip.java b/songdbj/org/tritonus/share/sampled/mixer/TClip.java deleted file mode 100644 index e0a8140c37..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TClip.java +++ /dev/null @@ -1,340 +0,0 @@ -/* - * TClip.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 1999 - 2004 by Matthias Pfisterer - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import java.io.IOException; -import java.io.ByteArrayInputStream; -import java.util.Collection; - -import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.Clip; -import javax.sound.sampled.Control; -import javax.sound.sampled.DataLine; -import javax.sound.sampled.SourceDataLine; -import javax.sound.sampled.AudioInputStream; -import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.Mixer; - -import org.tritonus.share.TDebug; -import org.tritonus.share.sampled.mixer.TDataLine; - - - -public class TClip -extends TDataLine -implements Clip -{ - private static final Class[] CONTROL_CLASSES = {/*GainControl.class*/}; - private static final int BUFFER_FRAMES = 16384; - - - public TClip(DataLine.Info info) - { - super(null, // TMixer - info); - } - - - - public TClip(DataLine.Info info, - Collection controls) - { - super(null, // TMixer - info, - controls); - } - - - - public void open(AudioFormat audioFormat, - byte[] abData, - int nOffset, - int nLength) - throws LineUnavailableException - { - // int nBufferLength = nNumFrames * audioFormat.getFrameSize(); - // TODO: check if nOffset + nBufferLength <= abData.length - // perhaps truncate automatically - ByteArrayInputStream bais = new ByteArrayInputStream(abData, nOffset, nLength); - AudioInputStream audioInputStream = new AudioInputStream(bais, audioFormat, AudioSystem.NOT_SPECIFIED); - try - { - open(audioInputStream); - } - catch (IOException e) - { - if (TDebug.TraceAllExceptions) - { - TDebug.out(e); - } - throw new LineUnavailableException("IOException occured"); - } - } - - - - public void open(AudioInputStream audioInputStream) - throws LineUnavailableException, IOException - { - AudioFormat audioFormat = audioInputStream.getFormat(); - // TOOD: - DataLine.Info info = new DataLine.Info(Clip.class, - audioFormat, -1/*nBufferSize*/); -/* - setLineInfo(info); - int nFrameSize = audioFormat.getFrameSize(); - long lTotalLength = audioInputStream.getFrameLength() * nFrameSize; - int nFormat = Esd.ESD_STREAM | Esd.ESD_PLAY | EsdUtils.getEsdFormat(audioFormat); - if (TDebug.TraceClip) - { - TDebug.out("format: " + nFormat); - TDebug.out("sample rate: " + audioFormat.getSampleRate()); - } - // m_esdSample.open(nFormat, (int) audioFormat.getSampleRate(), (int) lTotalLength); - if (TDebug.TraceClip) - { - TDebug.out("size in esd: " + audioInputStream.getFrameLength() * nFrameSize); - } - int nBufferLength = BUFFER_FRAMES * nFrameSize; - byte[] abData = new byte[nBufferLength]; - int nBytesRead = 0; - int nTotalBytes = 0; - while (nBytesRead != -1) - { - try - { - nBytesRead = audioInputStream.read(abData, 0, abData.length); - } - catch (IOException e) - { - if (TDebug.TraceClip || TDebug.TraceAllExceptions) - { - TDebug.out(e); - } - } - if (nBytesRead >= 0) - { - nTotalBytes += nBytesRead; - if (TDebug.TraceClip) - { - TDebug.out("TClip.open(): total bytes: " + nTotalBytes); - TDebug.out("TClip.open(): Trying to write: " + nBytesRead); - } - int nBytesWritten = 0; //m_esdSample.write(abData, 0, nBytesRead); - if (TDebug.TraceClip) - { - TDebug.out("TClip.open(): Written: " + nBytesWritten); - } - } - } - // to trigger the events - // open(); - */ - } - - - - public int getFrameLength() - { - // TODO: - return -1; - } - - - - public long getMicrosecondLength() - { - // TODO: - return -1; - } - - - - public void setFramePosition(int nPosition) - { - // TOOD: - } - - - - public void setMicrosecondPosition(long lPosition) - { - // TOOD: - } - - - - public int getFramePosition() - { - // TOOD: - return -1; - } - - - - public long getMicrosecondPosition() - { - // TOOD: - return -1; - } - - - - public void setLoopPoints(int nStart, int nEnd) - { - // TOOD: - } - - - - public void loop(int nCount) - { - if (TDebug.TraceClip) - { - TDebug.out("TClip.loop(int): called; count = " + nCount); - } - if (false/*isStarted()*/) - { - /* - * only allow zero count to stop the looping - * at the end of an iteration. - */ - if (nCount == 0) - { - if (TDebug.TraceClip) - { - TDebug.out("TClip.loop(int): stopping sample"); - } - // m_esdSample.stop(); - } - } - else - { - if (nCount == 0) - { - if (TDebug.TraceClip) - { - TDebug.out("TClip.loop(int): starting sample (once)"); - } - // m_esdSample.play(); - } - else - { - /* - * we're ignoring the count, because esd - * cannot loop for a fixed number of - * times. - */ - // TDebug.out("hallo"); - if (TDebug.TraceClip) - { - TDebug.out("TClip.loop(int): starting sample (forever)"); - } - // m_esdSample.loop(); - } - } - // TOOD: - } - - - - public void flush() - { - // TOOD: - } - - - - public void drain() - { - // TOOD: - } - - - - public void close() - { - // m_esdSample.free(); - // m_esdSample.close(); - // TOOD: - } - - - - - public void open() - { - // TODO: - } - - - - public void start() - { - if (TDebug.TraceClip) - { - TDebug.out("TClip.start(): called"); - } - /* - * This is a hack. What start() really should do is - * start playing at the position playback was stopped. - */ - if (TDebug.TraceClip) - { - TDebug.out("TClip.start(): calling 'loop(0)' [hack]"); - } - loop(0); - } - - - - public void stop() - { - // TODO: - // m_esdSample.kill(); - } - - - - /* - * This method is enforced by DataLine, but doesn't make any - * sense for Clips. - */ - public int available() - { - return -1; - } -} - - - -/*** TClip.java ***/ - diff --git a/songdbj/org/tritonus/share/sampled/mixer/TCompoundControl.java b/songdbj/org/tritonus/share/sampled/mixer/TCompoundControl.java deleted file mode 100644 index 4a370eb86c..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TCompoundControl.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * TCompoundControl.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 2001 by Matthias Pfisterer - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import javax.sound.sampled.CompoundControl; -import javax.sound.sampled.Control; - -import org.tritonus.share.TDebug; - - - - -/** Base class for classes implementing Line. - */ -public class TCompoundControl -extends CompoundControl -implements TControllable -{ - private TControlController m_controller; - - - - public TCompoundControl(CompoundControl.Type type, - Control[] aMemberControls) - { - super(type, aMemberControls); - if (TDebug.TraceControl) - { - TDebug.out("TCompoundControl.: begin"); - } - m_controller = new TControlController(); - if (TDebug.TraceControl) - { - TDebug.out("TCompoundControl.: end"); - } - } - - - - public void setParentControl(TCompoundControl compoundControl) - { - m_controller.setParentControl(compoundControl); - } - - - - public TCompoundControl getParentControl() - { - return m_controller.getParentControl(); - } - - - - public void commit() - { - m_controller.commit(); - } -} - - - -/*** TCompoundControl.java ***/ diff --git a/songdbj/org/tritonus/share/sampled/mixer/TCompoundControlType.java b/songdbj/org/tritonus/share/sampled/mixer/TCompoundControlType.java deleted file mode 100644 index 1b90b1a673..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TCompoundControlType.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * TCompoundControlType.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 2001 by Matthias Pfisterer - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import javax.sound.sampled.CompoundControl; - - - -/** CompoundControl.Type class. - This class is only needed to provide a public constructor. - */ -public class TCompoundControlType -extends CompoundControl.Type -{ - /** Constructor. - Constructs a CompoundControl.Type with the - name given. - - @param strName The name of the control. - */ - public TCompoundControlType(String strName) - { - super(strName); - } -} - - - -/*** TCompoundControlType.java ***/ diff --git a/songdbj/org/tritonus/share/sampled/mixer/TControlController.java b/songdbj/org/tritonus/share/sampled/mixer/TControlController.java deleted file mode 100644 index ec17c45b59..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TControlController.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * TControlController.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 2001 by Matthias Pfisterer - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import java.util.Collection; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.Control; -import javax.sound.sampled.Line; -import javax.sound.sampled.LineEvent; -import javax.sound.sampled.LineListener; -import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.Port; - -import org.tritonus.share.TDebug; - - - - -/** Base class for classes implementing Line. - */ -public class TControlController -implements TControllable -{ - /** The parent (compound) control. - In case this control is part of a compound control, the parentControl - property is set to a value other than null. - */ - private TCompoundControl m_parentControl; - - - public TControlController() - { - } - - - - public void setParentControl(TCompoundControl compoundControl) - { - m_parentControl = compoundControl; - } - - - public TCompoundControl getParentControl() - { - return m_parentControl; - } - - - public void commit() - { - if (TDebug.TraceControl) - { - TDebug.out("TControlController.commit(): called [" + this.getClass().getName() + "]"); - } - if (getParentControl() != null) - { - getParentControl().commit(); - } - } -} - - - -/*** TControlController.java ***/ diff --git a/songdbj/org/tritonus/share/sampled/mixer/TControllable.java b/songdbj/org/tritonus/share/sampled/mixer/TControllable.java deleted file mode 100644 index b89d34a2b3..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TControllable.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * TControllable.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 2001 by Matthias Pfisterer - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import java.util.Collection; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.Control; -import javax.sound.sampled.Line; -import javax.sound.sampled.LineEvent; -import javax.sound.sampled.LineListener; -import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.Port; - -import org.tritonus.share.TDebug; - - - - -public interface TControllable -{ - public void setParentControl(TCompoundControl compoundControl); - public TCompoundControl getParentControl(); - public void commit(); -} - - - -/*** TControllable.java ***/ diff --git a/songdbj/org/tritonus/share/sampled/mixer/TDataLine.java b/songdbj/org/tritonus/share/sampled/mixer/TDataLine.java deleted file mode 100644 index a493bac6c5..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TDataLine.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * TDataLine.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 1999 - 2004 by Matthias Pfisterer - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import java.util.Collection; -import java.util.EventListener; -import java.util.EventObject; -import java.util.HashSet; -import java.util.Set; - -import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.Control; -import javax.sound.sampled.DataLine; -import javax.sound.sampled.LineEvent; -import javax.sound.sampled.Line; - -import org.tritonus.share.TDebug; - - - -/** Base class for classes implementing DataLine. - */ -public abstract class TDataLine -extends TLine -implements DataLine -{ - private static final int DEFAULT_BUFFER_SIZE = 128000; - - private AudioFormat m_format; - private int m_nBufferSize; - private boolean m_bRunning; - // private boolean m_bActive; - - - - - public TDataLine(TMixer mixer, - DataLine.Info info) - { - super(mixer, - info); - init(info); - } - - - - public TDataLine(TMixer mixer, - DataLine.Info info, - Collection controls) - { - super(mixer, - info, - controls); - init(info); - } - - - - // IDEA: extract format and bufsize from info? - private void init(DataLine.Info info) - { - m_format = null; - m_nBufferSize = AudioSystem.NOT_SPECIFIED; - setRunning(false); - // setActive(false); - } - - - - // not defined here: - // public void drain() - // public void flush() - - - - public void start() - { - if (TDebug.TraceSourceDataLine) - { - TDebug.out("TDataLine.start(): called"); - } - setRunning(true); - } - - - - public void stop() - { - if (TDebug.TraceSourceDataLine) - { - TDebug.out("TDataLine.stop(): called"); - } - setRunning(false); - } - - - - public boolean isRunning() - { - return m_bRunning; - } - - - - // TODO: recheck - protected void setRunning(boolean bRunning) - { - boolean bOldValue = isRunning(); - m_bRunning = bRunning; - if (bOldValue != isRunning()) - { - if (isRunning()) - { - startImpl(); - notifyLineEvent(LineEvent.Type.START); - } - else - { - stopImpl(); - notifyLineEvent(LineEvent.Type.STOP); - } - } - } - - - - protected void startImpl() - { - } - - - - protected void stopImpl() - { - } - - - - /** - * This implementation returns the status of isRunning(). - * Subclasses should overwrite this method if there is more - * precise information about the status of the line available. - */ - public boolean isActive() - { - return isRunning(); - } - - -/* - public boolean isStarted() - { - return m_bStarted; - } -*/ - - // TODO: should only ALLOW engaging in data I/O. - // actual START event should only be sent when line really becomes active -/* - protected void setStarted(boolean bStarted) - { - m_bStarted = bStarted; - if (!isRunning()) - { - setActive(false); - } - } -*/ - - - public AudioFormat getFormat() - { - return m_format; - } - - - - protected void setFormat(AudioFormat format) - { - if (TDebug.TraceDataLine) - { - TDebug.out("TDataLine.setFormat(): setting: " + format); - } - m_format = format; - } - - - - public int getBufferSize() - { - return m_nBufferSize; - } - - - - protected void setBufferSize(int nBufferSize) - { - if (TDebug.TraceDataLine) - { - TDebug.out("TDataLine.setBufferSize(): setting: " + nBufferSize); - } - m_nBufferSize = nBufferSize; - } - - - - // not defined here: - // public int available() - - - - public int getFramePosition() - { - // TODO: - return -1; - } - - - - public long getLongFramePosition() - { - // TODO: - return -1; - } - - - - public long getMicrosecondPosition() - { - return (long) (getFramePosition() * getFormat().getFrameRate() * 1000000); - } - - - - /* - * Has to be overridden to be useful. - */ - public float getLevel() - { - return AudioSystem.NOT_SPECIFIED; - } - - - - protected void checkOpen() - { - if (getFormat() == null) - { - throw new IllegalStateException("format must be specified"); - } - if (getBufferSize() == AudioSystem.NOT_SPECIFIED) - { - setBufferSize(getDefaultBufferSize()); - } - } - - - - protected int getDefaultBufferSize() - { - return DEFAULT_BUFFER_SIZE; - } - - - - protected void notifyLineEvent(LineEvent.Type type) - { - notifyLineEvent(new LineEvent(this, type, getFramePosition())); - } -} - - - -/*** TDataLine.java ***/ - diff --git a/songdbj/org/tritonus/share/sampled/mixer/TEnumControl.java b/songdbj/org/tritonus/share/sampled/mixer/TEnumControl.java deleted file mode 100644 index 2c9132401f..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TEnumControl.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * TEnumControl.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 2001 by Matthias Pfisterer - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import javax.sound.sampled.EnumControl; - -import org.tritonus.share.TDebug; - - - - -/** Base class for classes implementing Line. - */ -public class TEnumControl -extends EnumControl -implements TControllable -{ - private TControlController m_controller; - - - - public TEnumControl(EnumControl.Type type, - Object[] aValues, - Object value) - { - super(type, - aValues, - value); - if (TDebug.TraceControl) - { - TDebug.out("TEnumControl.: begin"); - } - m_controller = new TControlController(); - if (TDebug.TraceControl) - { - TDebug.out("TEnumControl.: end"); - } - } - - - - public void setParentControl(TCompoundControl compoundControl) - { - m_controller.setParentControl(compoundControl); - } - - - - public TCompoundControl getParentControl() - { - return m_controller.getParentControl(); - } - - - - public void commit() - { - m_controller.commit(); - } -} - - - -/*** TEnumControl.java ***/ diff --git a/songdbj/org/tritonus/share/sampled/mixer/TFloatControl.java b/songdbj/org/tritonus/share/sampled/mixer/TFloatControl.java deleted file mode 100644 index 8a80016865..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TFloatControl.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * TFloatControl.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 2001 by Matthias Pfisterer - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import javax.sound.sampled.FloatControl; - -import org.tritonus.share.TDebug; - - - - -/** Base class for classes implementing Line. - */ -public class TFloatControl -extends FloatControl -implements TControllable -{ - private TControlController m_controller; - - - - public TFloatControl(FloatControl.Type type, - float fMinimum, - float fMaximum, - float fPrecision, - int nUpdatePeriod, - float fInitialValue, - String strUnits) - { - super(type, - fMinimum, - fMaximum, - fPrecision, - nUpdatePeriod, - fInitialValue, - strUnits); - if (TDebug.TraceControl) - { - TDebug.out("TFloatControl.: begin"); - } - m_controller = new TControlController(); - if (TDebug.TraceControl) - { - TDebug.out("TFloatControl.: end"); - } - } - - - - public TFloatControl(FloatControl.Type type, - float fMinimum, - float fMaximum, - float fPrecision, - int nUpdatePeriod, - float fInitialValue, - String strUnits, - String strMinLabel, - String strMidLabel, - String strMaxLabel) - { - super(type, - fMinimum, - fMaximum, - fPrecision, - nUpdatePeriod, - fInitialValue, - strUnits, - strMinLabel, - strMidLabel, - strMaxLabel); - if (TDebug.TraceControl) - { - TDebug.out("TFloatControl.: begin"); - } - m_controller = new TControlController(); - if (TDebug.TraceControl) - { - TDebug.out("TFloatControl.: end"); - } - } - - - - public void setParentControl(TCompoundControl compoundControl) - { - m_controller.setParentControl(compoundControl); - } - - - - public TCompoundControl getParentControl() - { - return m_controller.getParentControl(); - } - - - - public void commit() - { - m_controller.commit(); - } -} - - - -/*** TFloatControl.java ***/ diff --git a/songdbj/org/tritonus/share/sampled/mixer/TLine.java b/songdbj/org/tritonus/share/sampled/mixer/TLine.java deleted file mode 100644 index 89b38099ed..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TLine.java +++ /dev/null @@ -1,362 +0,0 @@ -/* - * TLine.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 1999 - 2004 by Matthias Pfisterer - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import java.util.Collection; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.Control; -import javax.sound.sampled.Line; -import javax.sound.sampled.LineEvent; -import javax.sound.sampled.LineListener; -import javax.sound.sampled.LineUnavailableException; - -import org.tritonus.share.TDebug; -import org.tritonus.share.TNotifier; - - - - -/** Base class for classes implementing Line. - */ -public abstract class TLine -implements Line -{ - private static final Control[] EMPTY_CONTROL_ARRAY = new Control[0]; - - private Line.Info m_info; - private boolean m_bOpen; - private List m_controls; - private Set m_lineListeners; - private TMixer m_mixer; - - - - protected TLine(TMixer mixer, - Line.Info info) - { - setLineInfo(info); - setOpen(false); - m_controls = new ArrayList(); - m_lineListeners = new HashSet(); - m_mixer = mixer; - } - - - - protected TLine(TMixer mixer, - Line.Info info, - Collection controls) - { - this (mixer, info); - m_controls.addAll(controls); - } - - - protected TMixer getMixer() - { - return m_mixer; - } - - - public Line.Info getLineInfo() - { - return m_info; - } - - - - protected void setLineInfo(Line.Info info) - { - if (TDebug.TraceLine) - { - TDebug.out("TLine.setLineInfo(): setting: " + info); - } - synchronized (this) - { - m_info = info; - } - } - - - - public void open() - throws LineUnavailableException - { - if (TDebug.TraceLine) - { - TDebug.out("TLine.open(): called"); - } - if (! isOpen()) - { - if (TDebug.TraceLine) - { - TDebug.out("TLine.open(): opening"); - } - openImpl(); - if (getMixer() != null) - { - getMixer().registerOpenLine(this); - } - setOpen(true); - } - else - { - if (TDebug.TraceLine) - { - TDebug.out("TLine.open(): already open"); - } - } - } - - - - /** - * Subclasses should override this method. - */ - protected void openImpl() - throws LineUnavailableException - { - if (TDebug.TraceLine) - { - TDebug.out("TLine.openImpl(): called"); - } - } - - - - public void close() - { - if (TDebug.TraceLine) - { - TDebug.out("TLine.close(): called"); - } - if (isOpen()) - { - if (TDebug.TraceLine) - { - TDebug.out("TLine.close(): closing"); - } - if (getMixer() != null) - { - getMixer().unregisterOpenLine(this); - } - closeImpl(); - setOpen(false); - } - else - { - if (TDebug.TraceLine) - { - TDebug.out("TLine.close(): not open"); - } - } - } - - - - /** - * Subclasses should override this method. - */ - protected void closeImpl() - { - if (TDebug.TraceLine) - { - TDebug.out("TLine.closeImpl(): called"); - } - } - - - - - - public boolean isOpen() - { - return m_bOpen; - } - - - - - protected void setOpen(boolean bOpen) - { - if (TDebug.TraceLine) - { - TDebug.out("TLine.setOpen(): called, value: " + bOpen); - } - boolean bOldValue = isOpen(); - m_bOpen = bOpen; - if (bOldValue != isOpen()) - { - if (isOpen()) - { - if (TDebug.TraceLine) - { - TDebug.out("TLine.setOpen(): opened"); - } - notifyLineEvent(LineEvent.Type.OPEN); - } - else - { - if (TDebug.TraceLine) - { - TDebug.out("TLine.setOpen(): closed"); - } - notifyLineEvent(LineEvent.Type.CLOSE); - } - } - } - - - - protected void addControl(Control control) - { - synchronized (m_controls) - { - m_controls.add(control); - } - } - - - - protected void removeControl(Control control) - { - synchronized (m_controls) - { - m_controls.remove(control); - } - } - - - - public Control[] getControls() - { - synchronized (m_controls) - { - return m_controls.toArray(EMPTY_CONTROL_ARRAY); - } - } - - - - public Control getControl(Control.Type controlType) - { - synchronized (m_controls) - { - Iterator it = m_controls.iterator(); - while (it.hasNext()) - { - Control control = it.next(); - if (control.getType().equals(controlType)) - { - return control; - } - } - throw new IllegalArgumentException("no control of type " + controlType); - } - } - - - - public boolean isControlSupported(Control.Type controlType) - { - // TDebug.out("TLine.isSupportedControl(): called"); - try - { - return getControl(controlType) != null; - } - catch (IllegalArgumentException e) - { - if (TDebug.TraceAllExceptions) - { - TDebug.out(e); - } - // TDebug.out("TLine.isSupportedControl(): returning false"); - return false; - } - } - - - - public void addLineListener(LineListener listener) - { - // TDebug.out("%% TChannel.addListener(): called"); - synchronized (m_lineListeners) - { - m_lineListeners.add(listener); - } - } - - - - public void removeLineListener(LineListener listener) - { - synchronized (m_lineListeners) - { - m_lineListeners.remove(listener); - } - } - - - - private Set getLineListeners() - { - synchronized (m_lineListeners) - { - return new HashSet(m_lineListeners); - } - } - - - // is overridden in TDataLine to provide a position - protected void notifyLineEvent(LineEvent.Type type) - { - notifyLineEvent(new LineEvent(this, type, AudioSystem.NOT_SPECIFIED)); - } - - - - protected void notifyLineEvent(LineEvent event) - { - // TDebug.out("%% TChannel.notifyChannelEvent(): called"); - // Channel.Event event = new Channel.Event(this, type, getPosition()); - TNotifier.notifier.addEntry(event, getLineListeners()); - } -} - - - -/*** TLine.java ***/ diff --git a/songdbj/org/tritonus/share/sampled/mixer/TMixer.java b/songdbj/org/tritonus/share/sampled/mixer/TMixer.java deleted file mode 100644 index 6a5dc4db72..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TMixer.java +++ /dev/null @@ -1,506 +0,0 @@ -/* - * TMixer.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 1999 - 2004 by Matthias Pfisterer - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; - -import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.Clip; -import javax.sound.sampled.DataLine; -import javax.sound.sampled.Line; -import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.Mixer; -import javax.sound.sampled.Port; -import javax.sound.sampled.SourceDataLine; -import javax.sound.sampled.TargetDataLine; - -import org.tritonus.share.TDebug; -import org.tritonus.share.sampled.AudioFormats; -import org.tritonus.share.ArraySet; - - - -// TODO: global controls (that use the system mixer) -public abstract class TMixer -extends TLine -implements Mixer -{ - private static Line.Info[] EMPTY_LINE_INFO_ARRAY = new Line.Info[0]; - private static Line[] EMPTY_LINE_ARRAY = new Line[0]; - - private Mixer.Info m_mixerInfo; - private Collection m_supportedSourceFormats; - private Collection m_supportedTargetFormats; - private Collection m_supportedSourceLineInfos; - private Collection m_supportedTargetLineInfos; - private Set m_openSourceDataLines; - private Set m_openTargetDataLines; - - - /** Constructor for mixers that use setSupportInformation(). - */ - protected TMixer(Mixer.Info mixerInfo, - Line.Info lineInfo) - { - this(mixerInfo, - lineInfo, - new ArrayList(), - new ArrayList(), - new ArrayList(), - new ArrayList()); - } - - - - /** Constructor for mixers. - */ - protected TMixer(Mixer.Info mixerInfo, - Line.Info lineInfo, - Collection supportedSourceFormats, - Collection supportedTargetFormats, - Collection supportedSourceLineInfos, - Collection supportedTargetLineInfos) - { - super(null, // TMixer - lineInfo); - if (TDebug.TraceMixer) { TDebug.out("TMixer.(): begin"); } - m_mixerInfo = mixerInfo; - setSupportInformation( - supportedSourceFormats, - supportedTargetFormats, - supportedSourceLineInfos, - supportedTargetLineInfos); - m_openSourceDataLines = new ArraySet(); - m_openTargetDataLines = new ArraySet(); - if (TDebug.TraceMixer) { TDebug.out("TMixer.(): end"); } - } - - - - protected void setSupportInformation( - Collection supportedSourceFormats, - Collection supportedTargetFormats, - Collection supportedSourceLineInfos, - Collection supportedTargetLineInfos) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.setSupportInformation(): begin"); } - m_supportedSourceFormats = supportedSourceFormats; - m_supportedTargetFormats = supportedTargetFormats; - m_supportedSourceLineInfos = supportedSourceLineInfos; - m_supportedTargetLineInfos = supportedTargetLineInfos; - if (TDebug.TraceMixer) { TDebug.out("TMixer.setSupportInformation(): end"); } - } - - - - public Mixer.Info getMixerInfo() - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getMixerInfo(): begin"); } - if (TDebug.TraceMixer) { TDebug.out("TMixer.getMixerInfo(): end"); } - return m_mixerInfo; - } - - - - public Line.Info[] getSourceLineInfo() - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSourceLineInfo(): begin"); } - Line.Info[] infos = (Line.Info[]) m_supportedSourceLineInfos.toArray(EMPTY_LINE_INFO_ARRAY); - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSourceLineInfo(): end"); } - return infos; - } - - - - public Line.Info[] getTargetLineInfo() - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getTargetLineInfo(): begin"); } - Line.Info[] infos = (Line.Info[]) m_supportedTargetLineInfos.toArray(EMPTY_LINE_INFO_ARRAY); - if (TDebug.TraceMixer) { TDebug.out("TMixer.getTargetLineInfo(): end"); } - return infos; - } - - - - public Line.Info[] getSourceLineInfo(Line.Info info) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSourceLineInfo(Line.Info): info to test: " + info); } - // TODO: - return EMPTY_LINE_INFO_ARRAY; - } - - - - public Line.Info[] getTargetLineInfo(Line.Info info) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getTargetLineInfo(Line.Info): info to test: " + info); } - // TODO: - return EMPTY_LINE_INFO_ARRAY; - } - - - - public boolean isLineSupported(Line.Info info) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.isLineSupported(): info to test: " + info); } - Class lineClass = info.getLineClass(); - if (lineClass.equals(SourceDataLine.class)) - { - return isLineSupportedImpl(info, m_supportedSourceLineInfos); - } - else if (lineClass.equals(TargetDataLine.class)) - { - return isLineSupportedImpl(info, m_supportedTargetLineInfos); - } - else if (lineClass.equals(Port.class)) - { - return isLineSupportedImpl(info, m_supportedSourceLineInfos) || isLineSupportedImpl(info, m_supportedTargetLineInfos); - } - else - { - return false; - } - } - - - - private static boolean isLineSupportedImpl(Line.Info info, Collection supportedLineInfos) - { - Iterator iterator = supportedLineInfos.iterator(); - while (iterator.hasNext()) - { - Line.Info info2 = (Line.Info) iterator.next(); - if (info2.matches(info)) - { - return true; - } - } - return false; - } - - - - public Line getLine(Line.Info info) - throws LineUnavailableException - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getLine(): begin"); } - Class lineClass = info.getLineClass(); - DataLine.Info dataLineInfo = null; - Port.Info portInfo = null; - AudioFormat[] aFormats = null; - if (info instanceof DataLine.Info) - { - dataLineInfo = (DataLine.Info) info; - aFormats = dataLineInfo.getFormats(); - } - else if (info instanceof Port.Info) - { - portInfo = (Port.Info) info; - } - AudioFormat format = null; - Line line = null; - if (lineClass == SourceDataLine.class) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getLine(): type: SourceDataLine"); } - if (dataLineInfo == null) - { - throw new IllegalArgumentException("need DataLine.Info for SourceDataLine"); - } - format = getSupportedSourceFormat(aFormats); - line = getSourceDataLine(format, dataLineInfo.getMaxBufferSize()); - } - else if (lineClass == Clip.class) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getLine(): type: Clip"); } - if (dataLineInfo == null) - { - throw new IllegalArgumentException("need DataLine.Info for Clip"); - } - format = getSupportedSourceFormat(aFormats); - line = getClip(format); - } - else if (lineClass == TargetDataLine.class) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getLine(): type: TargetDataLine"); } - if (dataLineInfo == null) - { - throw new IllegalArgumentException("need DataLine.Info for TargetDataLine"); - } - format = getSupportedTargetFormat(aFormats); - line = getTargetDataLine(format, dataLineInfo.getMaxBufferSize()); - } - else if (lineClass == Port.class) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getLine(): type: TargetDataLine"); } - if (portInfo == null) - { - throw new IllegalArgumentException("need Port.Info for Port"); - } - line = getPort(portInfo); - } - else - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getLine(): unknown line type, will throw exception"); } - throw new LineUnavailableException("unknown line class: " + lineClass); - } - if (TDebug.TraceMixer) { TDebug.out("TMixer.getLine(): end"); } - return line; - } - - - - protected SourceDataLine getSourceDataLine(AudioFormat format, int nBufferSize) - throws LineUnavailableException - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSourceDataLine(): begin"); } - throw new IllegalArgumentException("this mixer does not support SourceDataLines"); - } - - - - protected Clip getClip(AudioFormat format) - throws LineUnavailableException - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getClip(): begin"); } - throw new IllegalArgumentException("this mixer does not support Clips"); - } - - - - protected TargetDataLine getTargetDataLine(AudioFormat format, int nBufferSize) - throws LineUnavailableException - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getTargetDataLine(): begin"); } - throw new IllegalArgumentException("this mixer does not support TargetDataLines"); - } - - - - protected Port getPort(Port.Info info) - throws LineUnavailableException - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getTargetDataLine(): begin"); } - throw new IllegalArgumentException("this mixer does not support Ports"); - } - - - - private AudioFormat getSupportedSourceFormat(AudioFormat[] aFormats) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSupportedSourceFormat(): begin"); } - AudioFormat format = null; - for (int i = 0; i < aFormats.length; i++) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSupportedSourceFormat(): checking " + aFormats[i] + "..."); } - if (isSourceFormatSupported(aFormats[i])) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSupportedSourceFormat(): ...supported"); } - format = aFormats[i]; - break; - } - else - { - if (TDebug.TraceMixer) - { - TDebug.out("TMixer.getSupportedSourceFormat(): ...no luck"); - } - } - } - if (format == null) - { - throw new IllegalArgumentException("no line matchine one of the passed formats"); - } - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSupportedSourceFormat(): end"); } - return format; - } - - - - private AudioFormat getSupportedTargetFormat(AudioFormat[] aFormats) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSupportedTargetFormat(): begin"); } - AudioFormat format = null; - for (int i = 0; i < aFormats.length; i++) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSupportedTargetFormat(): checking " + aFormats[i] + " ..."); } - if (isTargetFormatSupported(aFormats[i])) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSupportedTargetFormat(): ...supported"); } - format = aFormats[i]; - break; - } - else - { - if (TDebug.TraceMixer) - { - TDebug.out("TMixer.getSupportedTargetFormat(): ...no luck"); - } - } - } - if (format == null) - { - throw new IllegalArgumentException("no line matchine one of the passed formats"); - } - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSupportedTargetFormat(): end"); } - return format; - } - - - -/* - not implemented here: - getMaxLines(Line.Info) -*/ - - - - public Line[] getSourceLines() - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getSourceLines(): called"); } - return (Line[]) m_openSourceDataLines.toArray(EMPTY_LINE_ARRAY); - } - - - - public Line[] getTargetLines() - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.getTargetLines(): called"); } - return (Line[]) m_openTargetDataLines.toArray(EMPTY_LINE_ARRAY); - } - - - - public void synchronize(Line[] aLines, - boolean bMaintainSync) - { - throw new IllegalArgumentException("synchronization not supported"); - } - - - - public void unsynchronize(Line[] aLines) - { - throw new IllegalArgumentException("synchronization not supported"); - } - - - - public boolean isSynchronizationSupported(Line[] aLines, - boolean bMaintainSync) - { - return false; - } - - - - protected boolean isSourceFormatSupported(AudioFormat format) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.isSourceFormatSupported(): format to test: " + format); } - Iterator iterator = m_supportedSourceFormats.iterator(); - while (iterator.hasNext()) - { - AudioFormat supportedFormat = iterator.next(); - if (AudioFormats.matches(supportedFormat, format)) - { - return true; - } - } - return false; - } - - - - protected boolean isTargetFormatSupported(AudioFormat format) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.isTargetFormatSupported(): format to test: " + format); } - Iterator iterator = m_supportedTargetFormats.iterator(); - while (iterator.hasNext()) - { - AudioFormat supportedFormat = iterator.next(); - if (AudioFormats.matches(supportedFormat, format)) - { - return true; - } - } - return false; - } - - - - /*package*/ void registerOpenLine(Line line) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.registerOpenLine(): line to register: " + line); - } - if (line instanceof SourceDataLine) - { - synchronized (m_openSourceDataLines) - { - m_openSourceDataLines.add((SourceDataLine) line); - } - } - else if (line instanceof TargetDataLine) - { - synchronized (m_openSourceDataLines) - { - m_openTargetDataLines.add((TargetDataLine) line); - } - } - } - - - - /*package*/ void unregisterOpenLine(Line line) - { - if (TDebug.TraceMixer) { TDebug.out("TMixer.unregisterOpenLine(): line to unregister: " + line); } - if (line instanceof SourceDataLine) - { - synchronized (m_openSourceDataLines) - { - m_openSourceDataLines.remove((SourceDataLine) line); - } - } - else if (line instanceof TargetDataLine) - { - synchronized (m_openTargetDataLines) - { - m_openTargetDataLines.remove((TargetDataLine) line); - } - } - } -} - - - -/*** TMixer.java ***/ - diff --git a/songdbj/org/tritonus/share/sampled/mixer/TMixerInfo.java b/songdbj/org/tritonus/share/sampled/mixer/TMixerInfo.java deleted file mode 100644 index cb4b7cc860..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TMixerInfo.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * TMixerInfo.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 1999, 2000 by Matthias Pfisterer - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import javax.sound.sampled.Mixer; - -import org.tritonus.share.TDebug; - - - - -/* - * This is needed only because Mixer.Info's constructor - * is protected (in the Sun jdk1.3). - */ -public class TMixerInfo -extends Mixer.Info -{ - public TMixerInfo(String a, String b, String c, String d) - { - super(a, b, c, d); - } -} - - - -/*** TMixerInfo.java ***/ - diff --git a/songdbj/org/tritonus/share/sampled/mixer/TMixerProvider.java b/songdbj/org/tritonus/share/sampled/mixer/TMixerProvider.java deleted file mode 100644 index 3116d74dc3..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TMixerProvider.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * TMixerProvider.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 1999 - 2004 by Matthias Pfisterer - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.sound.sampled.Mixer; -import javax.sound.sampled.spi.MixerProvider; - -import org.tritonus.share.TDebug; - - - -public abstract class TMixerProvider -extends MixerProvider -{ - private static final Mixer.Info[] EMPTY_MIXER_INFO_ARRAY = new Mixer.Info[0]; - - private static Map sm_mixerProviderStructs = new HashMap(); - - private boolean m_bDisabled = false; - - - - - public TMixerProvider() - { - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.(): begin"); } - // currently does nothing - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.(): end"); } - } - - - - /* - Override this method if you want a thread-safe static initializaiton. - */ - protected void staticInit() - { - } - - - - private MixerProviderStruct getMixerProviderStruct() - { - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.getMixerProviderStruct(): begin"); } - Class cls = this.getClass(); - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.getMixerProviderStruct(): called from " + cls); } - // Thread.dumpStack(); - synchronized (TMixerProvider.class) - { - MixerProviderStruct struct = sm_mixerProviderStructs.get(cls); - if (struct == null) - { - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.getMixerProviderStruct(): creating new MixerProviderStruct for " + cls); } - struct = new MixerProviderStruct(); - sm_mixerProviderStructs.put(cls, struct); - } - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.getMixerProviderStruct(): end"); } - return struct; - } - } - - - - protected void disable() - { - if (TDebug.TraceMixerProvider) { TDebug.out("disabling " + getClass().getName()); } - m_bDisabled = true; - } - - - protected boolean isDisabled() - { - return m_bDisabled; - } - - - - protected void addMixer(Mixer mixer) - { - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.addMixer(): begin"); } - MixerProviderStruct struct = getMixerProviderStruct(); - synchronized (struct) - { - struct.m_mixers.add(mixer); - if (struct.m_defaultMixer == null) - { - struct.m_defaultMixer = mixer; - } - } - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.addMixer(): end"); } - } - - - - protected void removeMixer(Mixer mixer) - { - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.removeMixer(): begin"); } - MixerProviderStruct struct = getMixerProviderStruct(); - synchronized (struct) - { - struct.m_mixers.remove(mixer); - // TODO: should search for another mixer - if (struct.m_defaultMixer == mixer) - { - struct.m_defaultMixer = null; - } - } - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.removeMixer(): end"); } - } - - - // $$mp 2003/01/11: TODO: this implementation may become obsolete once the overridden method in spi.MixerProvider is implemented in a way documented officially. - public boolean isMixerSupported(Mixer.Info info) - { - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.isMixerSupported(): begin"); } - boolean bIsSupported = false; - Mixer.Info[] infos = getMixerInfo(); - for (int i = 0; i < infos.length; i++) - { - if (infos[i].equals(info)) - { - bIsSupported = true; - break; - } - } - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.isMixerSupported(): end"); } - return bIsSupported; - } - - - - /** - */ - public Mixer getMixer(Mixer.Info info) - { - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.getMixer(): begin"); } - MixerProviderStruct struct = getMixerProviderStruct(); - Mixer mixerResult = null; - synchronized (struct) - { - if (info == null) - { - mixerResult = struct.m_defaultMixer; - } - else - { - Iterator mixers = struct.m_mixers.iterator(); - while (mixers.hasNext()) - { - Mixer mixer = (Mixer) mixers.next(); - if (mixer.getMixerInfo().equals(info)) - { - mixerResult = mixer; - break; - } - } - } - } - if (mixerResult == null) - { - throw new IllegalArgumentException("no mixer available for " + info); - } - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.getMixer(): end"); } - return mixerResult; - } - - - - public Mixer.Info[] getMixerInfo() - { - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.getMixerInfo(): begin"); } - Set mixerInfos = new HashSet(); - MixerProviderStruct struct = getMixerProviderStruct(); - synchronized (struct) - { - Iterator mixers = struct.m_mixers.iterator(); - while (mixers.hasNext()) - { - Mixer mixer = mixers.next(); - mixerInfos.add(mixer.getMixerInfo()); - } - } - if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.getMixerInfo(): end"); } - return mixerInfos.toArray(EMPTY_MIXER_INFO_ARRAY); - } - - - - private class MixerProviderStruct - { - public List m_mixers; - public Mixer m_defaultMixer; - - - - public MixerProviderStruct() - { - m_mixers = new ArrayList(); - m_defaultMixer = null; - } - } -} - - - -/*** TMixerProvider.java ***/ diff --git a/songdbj/org/tritonus/share/sampled/mixer/TPort.java b/songdbj/org/tritonus/share/sampled/mixer/TPort.java deleted file mode 100644 index 18d5abae00..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TPort.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * TPort.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 1999 - 2004 by Matthias Pfisterer - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import java.util.Collection; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.Control; -import javax.sound.sampled.Line; -import javax.sound.sampled.LineEvent; -import javax.sound.sampled.LineListener; -import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.Port; - -import org.tritonus.share.TDebug; - - - - -/** Base class for Ports. - */ -public class TPort -extends TLine -implements Port -{ - public TPort(TMixer mixer, - Line.Info info) - { - super(mixer, info); - } - - - - public TPort(TMixer mixer, - Line.Info info, - Collection controls) - { - super(mixer, info, controls); - } -} - - - -/*** TPort.java ***/ diff --git a/songdbj/org/tritonus/share/sampled/mixer/TSoftClip.java b/songdbj/org/tritonus/share/sampled/mixer/TSoftClip.java deleted file mode 100644 index b5a8aea2c1..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/TSoftClip.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * TSoftClip.java - * - * This file is part of Tritonus: http://www.tritonus.org/ - */ - -/* - * Copyright (c) 1999 by Matthias Pfisterer - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -|<--- this code is formatted to fit into 80 columns --->| -*/ - -package org.tritonus.share.sampled.mixer; - -import java.io.IOException; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; - -import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.Clip; -import javax.sound.sampled.DataLine; -import javax.sound.sampled.SourceDataLine; -import javax.sound.sampled.AudioInputStream; -import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.Mixer; - -import org.tritonus.share.TDebug; -import org.tritonus.share.sampled.mixer.TDataLine; - - - -public class TSoftClip -extends TClip -implements Runnable -{ - private static final Class[] CONTROL_CLASSES = {/*GainControl.class*/}; - private static final int BUFFER_SIZE = 16384; - - - private Mixer m_mixer; - private SourceDataLine m_line; - private byte[] m_abClip; - private int m_nRepeatCount; - private Thread m_thread; - - public TSoftClip(Mixer mixer, AudioFormat format) - throws LineUnavailableException - { - // TODO: info object -/* - DataLine.Info info = new DataLine.Info(Clip.class, - audioFormat, -1); -*/ - super(null); - m_mixer = mixer; - DataLine.Info info = new DataLine.Info( - SourceDataLine.class, - // TODO: should pass a real AudioFormat object that isn't too restrictive - format); - m_line = (SourceDataLine) AudioSystem.getLine(info); - } - - - - public void open(AudioInputStream audioInputStream) - throws LineUnavailableException, IOException - { - AudioFormat audioFormat = audioInputStream.getFormat(); - setFormat(audioFormat); - int nFrameSize = audioFormat.getFrameSize(); - if (nFrameSize < 1) - { - throw new IllegalArgumentException("frame size must be positive"); - } - if (TDebug.TraceClip) - { - TDebug.out("TSoftClip.open(): format: " + audioFormat); - // TDebug.out("sample rate: " + audioFormat.getSampleRate()); - } - byte[] abData = new byte[BUFFER_SIZE]; - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - int nBytesRead = 0; - while (nBytesRead != -1) - { - try - { - nBytesRead = audioInputStream.read(abData, 0, abData.length); - } - catch (IOException e) - { - if (TDebug.TraceClip || TDebug.TraceAllExceptions) - { - TDebug.out(e); - } - } - if (nBytesRead >= 0) - { - if (TDebug.TraceClip) - { - TDebug.out("TSoftClip.open(): Trying to write: " + nBytesRead); - } - baos.write(abData, 0, nBytesRead); - if (TDebug.TraceClip) - { - TDebug.out("TSoftClip.open(): Written: " + nBytesRead); - } - } - } - m_abClip = baos.toByteArray(); - setBufferSize(m_abClip.length); - // open the line - m_line.open(getFormat()); - // to trigger the events - // open(); - } - - - - public int getFrameLength() - { - if (isOpen()) - { - return getBufferSize() / getFormat().getFrameSize(); - } - else - { - return AudioSystem.NOT_SPECIFIED; - } - } - - - - public long getMicrosecondLength() - { - if (isOpen()) - { - return (long) (getFrameLength() * getFormat().getFrameRate() * 1000000); - } - else - { - return AudioSystem.NOT_SPECIFIED; - } - } - - - - public void setFramePosition(int nPosition) - { - // TOOD: - } - - - - public void setMicrosecondPosition(long lPosition) - { - // TOOD: - } - - - - public int getFramePosition() - { - // TOOD: - return -1; - } - - - - public long getMicrosecondPosition() - { - // TOOD: - return -1; - } - - - - public void setLoopPoints(int nStart, int nEnd) - { - // TOOD: - } - - - - public void loop(int nCount) - { - if (TDebug.TraceClip) - { - TDebug.out("TSoftClip.loop(int): called; count = " + nCount); - } - if (false/*isStarted()*/) - { - /* - * only allow zero count to stop the looping - * at the end of an iteration. - */ - if (nCount == 0) - { - if (TDebug.TraceClip) - { - TDebug.out("TSoftClip.loop(int): stopping sample"); - } - // m_esdSample.stop(); - } - } - else - { - m_nRepeatCount = nCount; - m_thread = new Thread(this); - m_thread.start(); - } - // TOOD: - } - - - - public void flush() - { - // TOOD: - } - - - - public void drain() - { - // TOOD: - } - - - - public void close() - { - // m_esdSample.free(); - // m_esdSample.close(); - // TOOD: - } - - - - - public void open() - { - // TODO: - } - - - - public void start() - { - if (TDebug.TraceClip) - { - TDebug.out("TSoftClip.start(): called"); - } - /* - * This is a hack. What start() really should do is - * start playing at the position playback was stopped. - */ - if (TDebug.TraceClip) - { - TDebug.out("TSoftClip.start(): calling 'loop(0)' [hack]"); - } - loop(0); - } - - - - public void stop() - { - // TODO: - // m_esdSample.kill(); - } - - - - /* - * This method is enforced by DataLine, but doesn't make any - * sense for Clips. - */ - public int available() - { - return -1; - } - - - - public void run() - { - while (m_nRepeatCount >= 0) - { - m_line.write(m_abClip, 0, m_abClip.length); - m_nRepeatCount--; - } - } - -} - - - -/*** TSoftClip.java ***/ - diff --git a/songdbj/org/tritonus/share/sampled/mixer/package.html b/songdbj/org/tritonus/share/sampled/mixer/package.html deleted file mode 100644 index 681024bc9d..0000000000 --- a/songdbj/org/tritonus/share/sampled/mixer/package.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -

Base classes for the implementation of MixerProviders. - The classes provided here .

- - @see javax.sound.sampled.spi.MixerProvider - @see org.tritonus.sampled.mixer.alsa - @see org.tritonus.sampled.mixer.esd - - -- cgit v1.2.3