|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.beadsproject.beads.data.SampleManager
public class SampleManager
SampleManager provides a static repository for Sample
data and provides methods to organise samples into groups.
Nested Class Summary | |
---|---|
static interface |
SampleManager.SampleGroupListener
|
Constructor Summary | |
---|---|
SampleManager()
|
Method Summary | |
---|---|
static void |
addGroupListener(SampleManager.SampleGroupListener l)
|
static void |
destroyGroup(java.lang.String groupName)
Removes the specified group, and removes all of the samples found in the group from the sample repository. |
static FeatureSet |
featuresForSample(Sample sample)
Gets the FeatureSet for a given Sample. |
static Sample |
fromGroup(java.lang.String groupName,
int index)
Gets the Sample at the specified index from the specified group. |
static java.util.ArrayList<Sample> |
getGroup(java.lang.String groupName)
Gets the specified group in the form ArrayList<Sample>. |
static java.util.List<java.lang.String> |
getSampleNameList()
Returns an ArrayList containing all of the Sample names. |
static void |
group(java.lang.String groupName,
Sample[] sampleList)
Generates a new group with the given group name and list of Samples to be added to the group. |
static void |
group(java.lang.String groupName,
java.lang.String folderName)
Generates a new group with the given group name and a string that specifies where to load samples to be added to the group. |
static void |
group(java.lang.String groupName,
java.lang.String[] fileNameList)
Generates a new group with the given group name and a list of file names to be added to the group. |
static void |
group(java.lang.String groupName,
java.lang.String[] fileNameList,
int maxItems)
Generates a new group with the given group name and a list of file names to be added to the group, with number of elements loaded limited to maxItems. |
static void |
group(java.lang.String groupName,
java.lang.String folderName,
int maxItems)
Generates a new group with the given group name and a string that specifies where to load samples to be added to the group, and also limits the number of items loaded from the folder to maxItems. |
static java.util.Set<java.lang.String> |
groups()
Gets the set of group names. |
static java.util.List<java.lang.String> |
groupsAsList()
|
static boolean |
isVerbose()
Determines if SampleManager is being verbose. |
static void |
printSampleList()
Prints a list of all Sample s to System.out. |
static Sample |
randomFromGroup(java.lang.String groupName)
Gets a random sample from the specified group. |
static void |
removeGroup(java.lang.String groupName)
Removes the specified group, without removing the samples. |
static void |
removeGroupListener(SampleManager.SampleGroupListener l)
|
static void |
removeSample(Sample sample)
Removes the Sample . |
static void |
removeSample(java.lang.String sampleName)
Removes the named Sample . |
static Sample |
sample(java.io.InputStream is)
Returns a new Sample from the given filename. |
static Sample |
sample(java.lang.String fn)
Returns a new Sample from the given filename. |
static Sample |
sample(java.lang.String ref,
java.io.InputStream is)
Like sample(String) but with the option to specify the name with which this Sample is indexed. |
static void |
sample(java.lang.String name,
Sample sample)
Adds a sample by name to the sample list. |
static Sample |
sample(java.lang.String ref,
java.lang.String fn)
Like sample(String) but with the option to specify the name with which this Sample is indexed. |
static void |
setBufferingRegime(Sample.Regime r)
Set the buffering regime to use when loading all future samples. |
static void |
setVerbose(boolean verbose)
Tells SampleManager to produce verbose output. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SampleManager()
Method Detail |
---|
public static Sample sample(java.lang.String fn)
fn
- the file path.
public static Sample sample(java.io.InputStream is)
fn
- the file path.
public static void sample(java.lang.String name, Sample sample)
name
- sample
- public static Sample sample(java.lang.String ref, java.lang.String fn) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
sample(String)
but with the option to specify the name with which this Sample
is indexed.
ref
- the name with which to index this Sample.fn
- the file path.
java.io.IOException
javax.sound.sampled.UnsupportedAudioFileException
public static Sample sample(java.lang.String ref, java.io.InputStream is) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
sample(String)
but with the option to specify the name with which this Sample
is indexed.
ref
- the name with which to index this Sample.fn
- the file path.
java.io.IOException
javax.sound.sampled.UnsupportedAudioFileException
public static void group(java.lang.String groupName, Sample[] sampleList)
groupName
- the group name.sampleList
- the sample list.public static void group(java.lang.String groupName, java.lang.String folderName)
groupName
- the group name.folderName
- the folder address (URL or file path).public static void group(java.lang.String groupName, java.lang.String folderName, int maxItems)
groupName
- the group name.folderName
- the folder address (URL or file path).maxItems
- number of items to limit to.public static void group(java.lang.String groupName, java.lang.String[] fileNameList)
groupName
- the group name.fileNameList
- the file name list.public static void group(java.lang.String groupName, java.lang.String[] fileNameList, int maxItems)
groupName
- the group name.fileNameList
- the file name list.maxItems
- number of items to limit to.public static java.util.Set<java.lang.String> groups()
public static java.util.List<java.lang.String> groupsAsList()
public static java.util.ArrayList<Sample> getGroup(java.lang.String groupName)
groupName
- the group name.
public static Sample randomFromGroup(java.lang.String groupName)
groupName
- the group.
public static Sample fromGroup(java.lang.String groupName, int index)
groupName
- the group name.index
- the index.
public static void removeSample(java.lang.String sampleName)
Sample
.
sampleName
- the sample name.public static void removeSample(Sample sample)
Sample
.
sample
- the Sample.public static void removeGroup(java.lang.String groupName)
groupName
- the group name.public static void destroyGroup(java.lang.String groupName)
groupName
- the group name.public static void addGroupListener(SampleManager.SampleGroupListener l)
public static void removeGroupListener(SampleManager.SampleGroupListener l)
public static void printSampleList()
Sample
s to System.out.
public static java.util.List<java.lang.String> getSampleNameList()
public static void setBufferingRegime(Sample.Regime r)
r
- The regime.public static boolean isVerbose()
public static void setVerbose(boolean verbose)
verbose
- true for verbose output.public static FeatureSet featuresForSample(Sample sample)
sample
- the Sample to search for features of.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |