|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcami.jmootcher.JMootcher
public class JMootcher
An inner class, representating a freesound-sample
Field Summary | |
---|---|
static java.lang.String |
JMOOTCHER_VERSION
|
Fields inherited from interface cami.jmootcher.JMootcherConstants |
---|
AIFF, AUDIOSAMPLE_DATE_FORMAT, BUFFER_SIZE, CACHE_ROOT_DIR, ENCODING, FILE_URL, FLAC, HOME_URL, LOGIN_REDIRECT_URL, LOGIN_URL, LOGOUT_URL, MP3, OGG, PREVIEW_CACHE_DIRNAME, SAMPLE_CACHE_DIRNAME, VALID_LOGIN_TEXT, VALID_XML_LINE_PREFIX, VALID_XML_SECONDLINE, WAV, XML_CACHE_DIRNAME, XML_SEARCH_URL, XML_SIMILAR_URL, XML_URL |
Method Summary | |
---|---|
void |
checkogin()
|
static JMootcher |
factory(java.lang.String username,
java.lang.String password)
constructs a single instance of the JMootcher class. |
java.lang.String |
getCacheDir()
|
AudioSample[] |
getDissimilarSamples(int ID)
|
java.lang.String |
getFlushedURLConnectionContent(java.net.HttpURLConnection huc)
Returns the content of an HttpURLConnection -object and
flushes the object. |
java.io.InputStream |
getInputStream(AudioSample sf)
Returns an InputStream to the complete, full-quality
sample. |
java.io.InputStream |
getInputStream(int ID)
Returns an InputStream to the complete, full-quality
sample. |
java.lang.String |
getPreviewCacheDir()
|
AudioSample[] |
getSampleByBitDepth(int bitDepth)
|
AudioSample[] |
getSampleByBitrate(int bitRate)
|
AudioSample |
getSampleByID(int ID)
returns a new AudioSample null if nonexisting |
AudioSample[] |
getSampleBySampleRate(int sampleRate)
|
java.lang.String |
getSampleCacheDir()
|
AudioSample[] |
getSampleDuration(float min,
float max)
|
AudioSample[] |
getSamples(int ID)
fetches a sample with a given ID |
AudioSample[] |
getSamples(java.lang.String key)
fetches samples with given tags / keywords |
AudioSample[] |
getSamples(java.lang.String[] keys)
fetches samples with given tags / keywords |
AudioSample[] |
getSamplesByKeyword(java.lang.String key)
Returns an Array filled with the samples, mathing the
given keyword. |
AudioSample[] |
getSamplesByKeyword(java.lang.String[] keys)
Returns an Array filled with the samples, mathing the
given keywords. |
AudioSample[] |
getSimilarSamples(int ID)
|
java.lang.String |
getURLConnectionContent(java.net.HttpURLConnection huc)
returns the content of an HttpURLConnection -object. |
java.lang.String |
getURLConnectionContent(java.net.HttpURLConnection huc,
boolean disconnect)
Fetches the content of a HttpURLConnection and returns it as a a String |
java.lang.String |
getXMLCacheDir()
|
boolean |
isLoggedIn()
Returns true if we're logged in. |
void |
logout()
Clears the current session... |
void |
setCacheDir(java.io.File cachedir)
sets the cache-dir, wehere all files are stored/downloaded |
void |
setPreviewCacheDirName(java.lang.String dirname)
|
void |
setSampleCacheDirName(java.lang.String dirname)
|
void |
setXMLCacheDirName(java.lang.String dirname)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String JMOOTCHER_VERSION
Method Detail |
---|
public static JMootcher factory(java.lang.String username, java.lang.String password) throws java.lang.Exception
java.lang.Exception
public AudioSample[] getSamples(int ID)
AudioSample
or null
public AudioSample[] getSamples(java.lang.String key)
key
-
AudioSamples
or
null
public AudioSample[] getSamples(java.lang.String[] keys)
key
-
public AudioSample getSampleByID(int ID)
ID
-
public AudioSample[] getSamplesByKeyword(java.lang.String key)
Array
filled with the samples, mathing the
given keyword. The Array
is empty if an error occured
while doing the query-stuff.
key
- A keyword or name of sample
public AudioSample[] getSamplesByKeyword(java.lang.String[] keys)
Array
filled with the samples, mathing the
given keywords. The Array
is empty if an error occured
while doing the query-stuff.
keys
- An Array of keywords or names of samples
public AudioSample[] getSampleByBitrate(int bitRate)
bitRate
- the required bitrate of a sample
public AudioSample[] getSampleByBitDepth(int bitDepth)
bitDepth
- the required bitDepth of a sample
public AudioSample[] getSampleBySampleRate(int sampleRate)
sampleRate
- the required samplerate of a sample
public AudioSample[] getSampleDuration(float min, float max)
min
- the minimal required durationmax
- the maximal required duration
public AudioSample[] getSimilarSamples(int ID)
ID
-
public AudioSample[] getDissimilarSamples(int ID)
ID
-
public boolean isLoggedIn()
true
if we're logged in.
public java.io.InputStream getInputStream(AudioSample sf)
InputStream
to the complete, full-quality
sample. This cannot be done unless you have a valid freesound account.
ID
- AudioSample
public java.io.InputStream getInputStream(int ID)
InputStream
to the complete, full-quality
sample. This cannot be done unless you have a valid freesound account.
ID
- ID of a freesound-sample
public java.lang.String getCacheDir()
public void setCacheDir(java.io.File cachedir)
cachedir
- public java.lang.String getXMLCacheDir()
public void setXMLCacheDirName(java.lang.String dirname)
public java.lang.String getSampleCacheDir()
public void setSampleCacheDirName(java.lang.String dirname)
public java.lang.String getPreviewCacheDir()
public void setPreviewCacheDirName(java.lang.String dirname)
public void checkogin()
public void logout()
public java.lang.String getFlushedURLConnectionContent(java.net.HttpURLConnection huc)
HttpURLConnection
-object and
flushes the object. This is an alias-method for
getURLConnectionContent
-method
public java.lang.String getURLConnectionContent(java.net.HttpURLConnection huc)
HttpURLConnection
-object. This
is an alias-method for getURLConnectionContent
-method
public java.lang.String getURLConnectionContent(java.net.HttpURLConnection huc, boolean disconnect)
huc
- a opened HttpURLConnectiondisconnect
- should the Connection be closed after fetching the content
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |