crayolon.portamod
Class Player

java.lang.Object
  extended by crayolon.portamod.Player

public class Player
extends java.lang.Object


Nested Class Summary
 class Player.Driver
           
 
Field Summary
 javax.sound.sampled.AudioFormat af
           
 IBXM ibxm
           
 boolean loop
           
 Module module
           
 byte[] output_buffer
           
 javax.sound.sampled.SourceDataLine output_line
           
 int play_position
           
 int rate
           
 int receivedbuffersize
           
 boolean running
           
 int song_duration
           
 javax.sound.sampled.SourceDataLine source
           
 
Constructor Summary
Player(int interp)
          Instantiate a new Player.
 
Method Summary
 int get_bpm()
           
 int get_num_channels()
           
 int get_num_instruments()
           
 int get_seek_return()
          syphus' edit - return updated position after seek
 int get_sequence_length()
           
 java.lang.String get_title()
           
 java.lang.String[] infotext()
           
 java.lang.String ins_name(int ins_num)
           
static Module load_module(java.io.InputStream input)
          Decode the data in the specified InputStream into a Module instance.
 void play()
          Open the audio device and begin playback.
 void receivebuffer(int buffersize)
          Syphus' edit - pass a custom buffersize to the class
 void seek(int s)
          syphus' edit - user seek!
 void set_global_volume(int vol)
          syphus' edit - global volume! (out of 64)
 void set_loop(boolean loop)
          If loop is true, playback will continue indefinitely, otherwise the module will play through once and stop.
 void set_module(Module m)
          Set the Module instance to be played.
 void set_sequence(int sequence_index, int pattern_index)
           
 void set_speed(int speed)
           
 void set_tempo(int bpm)
           
 void stop()
          Stop playback and close the audio device.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ibxm

public IBXM ibxm

module

public Module module

song_duration

public int song_duration

play_position

public int play_position

running

public boolean running

loop

public boolean loop

output_buffer

public byte[] output_buffer

output_line

public javax.sound.sampled.SourceDataLine output_line

source

public javax.sound.sampled.SourceDataLine source

receivedbuffersize

public int receivedbuffersize

rate

public int rate

af

public javax.sound.sampled.AudioFormat af
Constructor Detail

Player

public Player(int interp)
       throws javax.sound.sampled.LineUnavailableException
Instantiate a new Player.

Throws:
javax.sound.sampled.LineUnavailableException
Method Detail

load_module

public static Module load_module(java.io.InputStream input)
                          throws java.lang.IllegalArgumentException,
                                 java.io.IOException
Decode the data in the specified InputStream into a Module instance.

Parameters:
input - an InputStream containing the module file to be decoded.
Throws:
java.lang.IllegalArgumentException - if the data is not recognised as a module file.
java.io.IOException

set_module

public void set_module(Module m)
Set the Module instance to be played.


seek

public void seek(int s)
syphus' edit - user seek!


get_seek_return

public int get_seek_return()
syphus' edit - return updated position after seek


get_bpm

public int get_bpm()

set_global_volume

public void set_global_volume(int vol)
syphus' edit - global volume! (out of 64)


set_speed

public void set_speed(int speed)

set_tempo

public void set_tempo(int bpm)

get_num_channels

public int get_num_channels()

get_sequence_length

public int get_sequence_length()

set_sequence

public void set_sequence(int sequence_index,
                         int pattern_index)

get_title

public java.lang.String get_title()

get_num_instruments

public int get_num_instruments()

infotext

public java.lang.String[] infotext()

ins_name

public java.lang.String ins_name(int ins_num)

set_loop

public void set_loop(boolean loop)
If loop is true, playback will continue indefinitely, otherwise the module will play through once and stop.


receivebuffer

public void receivebuffer(int buffersize)
Syphus' edit - pass a custom buffersize to the class


play

public void play()
Open the audio device and begin playback. If a module is already playing it will be restarted.


stop

public void stop()
Stop playback and close the audio device.



processing library PortaMod by Brendan Ratliff. (c) 2009