YATS/Forge Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
paulscode.sound.codecs.CodecIBXM Class Reference
Inheritance diagram for paulscode.sound.codecs.CodecIBXM:

Public Member Functions

 CodecIBXM ()
 
void reverseByteOrder (boolean b)
 
boolean initialize (URL url)
 
boolean initialized ()
 
SoundBuffer read ()
 
SoundBuffer readAll ()
 
boolean endOfStream ()
 
void cleanup ()
 
AudioFormat getAudioFormat ()
 

Static Public Member Functions

static void reverseBytes (byte[] buffer)
 
static void reverseBytes (byte[] buffer, int offset, int size)
 

Detailed Description

The CodecIBXM class provides an ICodec interface for reading from MOD/S3M/XM files via the IBXM library. SoundSystem CodecIBXM Class License:

You are free to use this class for any purpose, commercial or otherwise. You may modify this class or source code, and distribute it any way you like, provided the following conditions are met:
1) You may not falsely claim to be the author of this class or any unmodified portion of it.
2) You may not copyright this class or a modified version of it and then sue me for copyright infringement.
3) If you modify the source code, you must clearly document the changes made before redistributing the modified source code, so other users know it is not the original code.
4) You are not required to give me credit for this class in any derived work, but if you do, you must also mention my website: http://www.paulscode.com
5) I the author will not be responsible for any damages (physical, financial, or otherwise) caused by the use if this class or any portion of it.
6) I the author do not guarantee, warrant, or make any representations, either expressed or implied, regarding the use of this class or any portion of it.

Author: Paul Lamb
http://www.paulscode.com


This software is based on or using the IBXM library available from http://www.geocities.com/sunet2000/


IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Constructor & Destructor Documentation

paulscode.sound.codecs.CodecIBXM.CodecIBXM ( )

Constructor: Grabs a handle to the logger.

Member Function Documentation

void paulscode.sound.codecs.CodecIBXM.cleanup ( )

Closes the audio stream and remove references to all instantiated objects.

boolean paulscode.sound.codecs.CodecIBXM.endOfStream ( )

Returns false if there is still more data available to be read in.

Returns
True if end of stream was reached.
AudioFormat paulscode.sound.codecs.CodecIBXM.getAudioFormat ( )

Returns the audio format of the data being returned by the read() and readAll() methods.

Returns
Information wrapped into an AudioFormat context.
boolean paulscode.sound.codecs.CodecIBXM.initialize ( URL  url)

Prepares an audio stream to read from. If another stream is already opened, it will be closed and a new audio stream opened in its place.

Parameters
urlURL to an audio file to stream from.
Returns
False if an error occurred or if end of stream was reached.
boolean paulscode.sound.codecs.CodecIBXM.initialized ( )

Returns false if the stream is busy initializing.

Returns
True if steam is initialized.
SoundBuffer paulscode.sound.codecs.CodecIBXM.read ( )

Reads in one stream buffer worth of audio data. See SoundSystemConfig for more information about accessing and changing default settings.

Returns
The audio data wrapped into a SoundBuffer context.
SoundBuffer paulscode.sound.codecs.CodecIBXM.readAll ( )

Reads in all the audio data from the stream (up to the default "maximum file size". See SoundSystemConfig for more information about accessing and changing default settings.

Returns
the audio data wrapped into a SoundBuffer context.
void paulscode.sound.codecs.CodecIBXM.reverseByteOrder ( boolean  b)

Tells this codec when it will need to reverse the byte order of the data before returning it in the read() and readAll() methods. The IBXM library produces audio data in a format that some external audio libraries require to be reversed. Derivatives of the Library and Source classes for audio libraries which require this type of data to be reversed will call the reverseByteOrder() method.

Parameters
bTrue if the calling audio library requires byte-reversal.
static void paulscode.sound.codecs.CodecIBXM.reverseBytes ( byte[]  buffer)
static

Reverse-orders all bytes contained in the specified array.

Parameters
bufferArray containing audio data.
static void paulscode.sound.codecs.CodecIBXM.reverseBytes ( byte[]  buffer,
int  offset,
int  size 
)
static

Reverse-orders the specified range of bytes contained in the specified array.

Parameters
bufferArray containing audio data.
offsetArray index to begin.
sizenumber of bytes to reverse-order.

The documentation for this class was generated from the following file: