de.sciss.jcollider
Class Bus

java.lang.Object
  extended by de.sciss.jcollider.Bus
All Implemented Interfaces:
Constants

public class Bus
extends java.lang.Object
implements Constants

Mimics SCLang's Bus class, that is, it's a client side representation of an audio or control bus

Version:
0.31, 08-Oct-07
Author:
Hanns Holger Rutz
Todo:
missing methods (set, setn, fill, get, getn ...)
Warning:
this is a quick direct translation from SClang which is largely untested. before all methods have been thoroughly verified, excepted some of them to be wrong or behave different than expected. what certainly works is instantiation

Nested Class Summary
static interface Bus.GetCompletionAction
          Interface describing an action to take place after an asynchronous bus query is completed.
 
Field Summary
 
Fields inherited from interface de.sciss.jcollider.Constants
kAddAfter, kAddBefore, kAddReplace, kAddToHead, kAddToTail, kAudioRate, kControlRate, kDemandRate, kDoneFree, kDoneFreeAll, kDoneFreeAllPred, kDoneFreeAllSucc, kDoneFreeGroup, kDoneFreePausePred, kDoneFreePauseSucc, kDoneFreePred, kDoneFreePredGroup, kDoneFreePredGroupDeep, kDoneFreeSucc, kDoneFreeSuccGroup, kDoneFreeSuccGroupDeep, kDoneNothing, kDonePause, kDumpBoth, kDumpHex, kDumpOff, kDumpText, kHeaderAIFF, kHeaderIRCAM, kHeaderNeXT, kHeaderRaw, kHeaderWAVE, kSampleALaw, kSampleDouble, kSampleFloat, kSampleInt16, kSampleInt24, kSampleInt32, kSampleInt8, kSampleMuLaw, kScalarRate
 
Constructor Summary
Bus(Server server)
          Creates an mono audio bus on the server at index 0.
Bus(Server server, java.lang.Object rate)
           
Bus(Server server, java.lang.Object rate, int index)
           
Bus(Server server, java.lang.Object rate, int index, int numChannels)
           
 
Method Summary
 void alloc()
           
static Bus alloc(Server server, java.lang.Object rate)
           
static Bus alloc(Server server, java.lang.Object rate, int numChannels)
           
static Bus audio(Server server)
           
static Bus audio(Server server, int numChannels)
           
static Bus control(Server server)
           
static Bus control(Server server, int numChannels)
           
 boolean equals(java.lang.Object o)
           
 void fill(float value)
           
 void fill(int[] numChans, float[] values)
           
 void fill(int[] offsets, int[] numChans, float[] values)
           
 void fill(int offset, int numChans, float value)
           
 de.sciss.net.OSCMessage fillMsg(float value)
           
 de.sciss.net.OSCMessage fillMsg(int[] numChans, float[] values)
           
 de.sciss.net.OSCMessage fillMsg(int[] offsets, int[] numChans, float[] values)
           
 de.sciss.net.OSCMessage fillMsg(int offset, int numChans, float value)
           
 void free()
           
 void get(Bus.GetCompletionAction action)
           
 void get(int[] offsets, Bus.GetCompletionAction action)
           
 void get(int offset, Bus.GetCompletionAction action)
           
 int getIndex()
           
 de.sciss.net.OSCMessage getMsg()
           
 de.sciss.net.OSCMessage getMsg(int[] offsets)
           
 void getn(int[] offsets, int[] numChans, Bus.GetCompletionAction action)
           
 de.sciss.net.OSCMessage getnMsg()
           
 de.sciss.net.OSCMessage getnMsg(int numChans)
           
 de.sciss.net.OSCMessage getnMsg(int[] offsets, int[] numChans)
           
 de.sciss.net.OSCMessage getnMsg(int offset, int numChans)
           
 int getNumChannels()
           
 java.lang.Object getRate()
           
 Server getServer()
           
 int hashCode()
           
 boolean isAudioOut()
          Queries whether this bus is playing audio onto the hardware audio interface channels.
 void printOn(java.io.PrintStream stream)
           
 void realloc()
           
 void set(float value)
           
 void set(int[] offsets, float[] values)
           
 de.sciss.net.OSCMessage setMsg(float value)
          Set the value of a monophonic bus.
 de.sciss.net.OSCMessage setMsg(int[] offsets, float[] values)
           
 void setn(float[] values)
           
 void setn(int[] offsets, float[][] values)
           
 de.sciss.net.OSCMessage setnMsg(float[] values)
           
 de.sciss.net.OSCMessage setnMsg(int[] offsets, float[][] values)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bus

public Bus(Server server)
Creates an mono audio bus on the server at index 0. This does not use the server's allocators.

Parameters:
server - the Server on which the bus resides

Bus

public Bus(Server server,
           java.lang.Object rate)

Bus

public Bus(Server server,
           java.lang.Object rate,
           int index)

Bus

public Bus(Server server,
           java.lang.Object rate,
           int index,
           int numChannels)
Method Detail

control

public static Bus control(Server server)

control

public static Bus control(Server server,
                          int numChannels)

audio

public static Bus audio(Server server)

audio

public static Bus audio(Server server,
                        int numChannels)

alloc

public static Bus alloc(Server server,
                        java.lang.Object rate)

alloc

public static Bus alloc(Server server,
                        java.lang.Object rate,
                        int numChannels)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getRate

public java.lang.Object getRate()

getNumChannels

public int getNumChannels()

getIndex

public int getIndex()

getServer

public Server getServer()

set

public void set(float value)
         throws java.io.IOException
Throws:
java.io.IOException

set

public void set(int[] offsets,
                float[] values)
         throws java.io.IOException
Throws:
java.io.IOException

setMsg

public de.sciss.net.OSCMessage setMsg(float value)
Set the value of a monophonic bus. For multichannel busses, use setnMsg instead.


setMsg

public de.sciss.net.OSCMessage setMsg(int[] offsets,
                                      float[] values)
Warning:
has not been tested

setn

public void setn(float[] values)
          throws java.io.IOException
Throws:
java.io.IOException

setn

public void setn(int[] offsets,
                 float[][] values)
          throws java.io.IOException
Throws:
java.io.IOException

setnMsg

public de.sciss.net.OSCMessage setnMsg(float[] values)
Warning:
has not been tested

setnMsg

public de.sciss.net.OSCMessage setnMsg(int[] offsets,
                                       float[][] values)
Warning:
has not been tested

fill

public void fill(float value)
          throws java.io.IOException
Throws:
java.io.IOException

fill

public void fill(int offset,
                 int numChans,
                 float value)
          throws java.io.IOException
Throws:
java.io.IOException

fill

public void fill(int[] numChans,
                 float[] values)
          throws java.io.IOException
Throws:
java.io.IOException

fill

public void fill(int[] offsets,
                 int[] numChans,
                 float[] values)
          throws java.io.IOException
Throws:
java.io.IOException

fillMsg

public de.sciss.net.OSCMessage fillMsg(float value)

fillMsg

public de.sciss.net.OSCMessage fillMsg(int offset,
                                       int numChans,
                                       float value)

fillMsg

public de.sciss.net.OSCMessage fillMsg(int[] numChans,
                                       float[] values)

fillMsg

public de.sciss.net.OSCMessage fillMsg(int[] offsets,
                                       int[] numChans,
                                       float[] values)
Warning:
has not been tested

get

public void get(Bus.GetCompletionAction action)
         throws java.io.IOException
Throws:
java.io.IOException

get

public void get(int offset,
                Bus.GetCompletionAction action)
         throws java.io.IOException
Throws:
java.io.IOException

get

public void get(int[] offsets,
                Bus.GetCompletionAction action)
         throws java.io.IOException
Throws:
java.io.IOException
Warning:
has not been tested

getn

public void getn(int[] offsets,
                 int[] numChans,
                 Bus.GetCompletionAction action)
          throws java.io.IOException
Throws:
java.io.IOException
Warning:
has not been tested

getMsg

public de.sciss.net.OSCMessage getMsg()

getMsg

public de.sciss.net.OSCMessage getMsg(int[] offsets)
Warning:
has not been tested

getnMsg

public de.sciss.net.OSCMessage getnMsg()

getnMsg

public de.sciss.net.OSCMessage getnMsg(int numChans)

getnMsg

public de.sciss.net.OSCMessage getnMsg(int offset,
                                       int numChans)

getnMsg

public de.sciss.net.OSCMessage getnMsg(int[] offsets,
                                       int[] numChans)
Warning:
has not been tested

free

public void free()

alloc

public void alloc()

realloc

public void realloc()

printOn

public void printOn(java.io.PrintStream stream)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isAudioOut

public boolean isAudioOut()
Queries whether this bus is playing audio onto the hardware audio interface channels.

Returns:
true if this bus plays audio on audible interface channels, false otherwise