public abstract class SimplePermanentSoundOutputPlugin<T> extends OutputPlugin<T> implements PermanentSoundUsed, PermanentSoundHelper, PermanentSoundResources
Modifier and Type | Field and Description |
---|---|
boolean |
isUsingJava |
Constructor and Description |
---|
SimplePermanentSoundOutputPlugin(Context context,
String id,
boolean isUsingJava)
creates a new output-plugin with a new id
|
Modifier and Type | Method and Description |
---|---|
EventModel |
blockingQueueHandling()
Default implementation waits until a new Event has been received and then processes it.
|
boolean |
isOutputRunning()
retruns true if playing and false if not
|
boolean |
isUsingJava()
true if using java, false if not (and for example a C-library)
|
abstract void |
mute()
this method call must mute the plugin
|
Optional<CompletableFuture<Void>> |
startPlaying(Runnable function)
use this method to start playing sound (only plays sound if it is not already playing)
|
abstract void |
stopSound()
this method call must stop the sound
|
abstract void |
unMute()
this method call must un-mute the plugin
|
getArgument, getArgumentType, renderFinalOutput
addToEventList, getEventBlockingQueue, getOutputExtensionList, getReceivingType, getTimeoutLimit, handleFutures, isDone, isRunning, outputExtensionAdded, outputExtensionRemoved, run, stop, terminate
getContext, getID
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
endedSound, startedSound
fire, fire, fire, fire, fire
debug, debug, error, error, getContext
announceResources, createUsingSoundResource, generateResource, provideResource
announceEvents, resourcesInit
getID, isOwner
submit, submit, submit, submitRun, timeOut, timeOut
debug, debug, error, error, fatal, fatal, warn, warn
exceptionThrown
public final boolean isUsingJava
public SimplePermanentSoundOutputPlugin(Context context, String id, boolean isUsingJava)
context
- contextid
- the id of the new output-pluginpublic EventModel blockingQueueHandling() throws InterruptedException
This method is made to be overwritten as seen fit by the developer
blockingQueueHandling
in class OutputPluginArgument<Object,T>
InterruptedException
- if interrupted while waitingpublic boolean isOutputRunning()
isOutputRunning
in interface PermanentSoundUsed
public boolean isUsingJava()
isUsingJava
in interface PermanentSoundUsed
public Optional<CompletableFuture<Void>> startPlaying(Runnable function)
function
- the function which plays the soundpublic abstract void mute()
public abstract void unMute()
public abstract void stopSound()
Copyright © 2016. All rights reserved.