|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable com.softsynth.jsyn.SynthObject
public class SynthObject
Root class for all JSyn units, samples, envelopes, etc.
SynthObject deletes its native peers when deleted.
This class used to keep a list of all SynthObjects created to prevent
unexpected garbage collection. Now that list is kept in the SynthContext.
Synth
,
SynthUnit
Constructor Summary | |
---|---|
SynthObject(SynthContext context)
|
Method Summary | |
---|---|
void |
delete()
Delete the native structure that is associated with this object. |
static void |
deleteAll()
Delete all units, SynthSamples, SynthEnvelopes and other Synth objects created since Synth.startEngine() was called. |
static void |
enableDeletionByGarbageCollector(boolean ifEnabled)
Note: call this method if you are using a global SynthContext, in other words if you called "Synth.startEngine()". |
static void |
enableTracking(boolean ifTrack)
Request that all SynthObjects created by the currently executing thread be automatically tracked when created, or not. |
int |
getPeer()
|
SynthContext |
getSynthContext()
|
static boolean |
isTrackingEnabled()
|
java.lang.String |
toString()
|
void |
track()
Keep a reference to this object in a vector in the SynthContext class. |
Methods inherited from class java.util.Observable |
---|
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SynthObject(SynthContext context)
Method Detail |
---|
public SynthContext getSynthContext()
public static boolean isTrackingEnabled()
public static void enableTracking(boolean ifTrack)
track
public void track()
public int getPeer() throws SynthException
SynthException
public static void deleteAll() throws SynthException
SynthException
public void delete() throws SynthException
SynthException
- If token already deleted.public static void enableDeletionByGarbageCollector(boolean ifEnabled)
Enable deletion of the native portion of SynthObjects (eg. units and samples)
when the Java portion is deleted by the Garbage Collector.
Warning: enabling this can cause unexpected removal of objects that may be
making sound but are no longer referenced by Java.
The sudden silence can be embarassing.
Warning: disabling this can cause native resources to accumulate unless you explicitly
delete them using their delete() method.
This can consume memory and cause memory allocation to fail.
The safest thing to do is to disable this and delete() your own objects
when you are through using them.
ifEnabled
- set true to enable deletion, false to disable, default is trueSynth.getObjectCount
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |