public class KeyboardAudioTrigger extends Object implements AudioTrigger, KeyListener
| Modifier and Type | Field and Description |
|---|---|
protected AudioSourceState |
next |
protected Key |
pauseKey |
protected Key |
playKey |
protected Key |
stopKey |
| Constructor and Description |
|---|
KeyboardAudioTrigger(KeyMap keyMap)
Construct a new KeyboardAudioTrigger with the default keys (J, K, L).
|
KeyboardAudioTrigger(KeyMap keyMap,
Key playKey,
Key pauseKey,
Key stopKey)
Construct a new KeyboardAudioTrigger with custom keys.
|
| Modifier and Type | Method and Description |
|---|---|
protected AudioSourceState |
getNext() |
protected Key |
getPauseKey() |
protected Key |
getPlayKey() |
protected Key |
getStopKey() |
AudioSourceState |
next(AudioSource as)
This tells the AudioEngine the desired state for any given AudioSource.
|
void |
onAction(KeyEvent event)
This method just sets the internal state, which is returned by
next(AudioSource) |
protected void |
setNext(AudioSourceState next) |
protected Key playKey
protected Key pauseKey
protected Key stopKey
protected AudioSourceState next
public KeyboardAudioTrigger(KeyMap keyMap, Key playKey, Key pauseKey, Key stopKey)
KeyMap is used in the constructor only for registering.keyMap - this trigger will register itself on this keymapplayKey - key to indicate a playpauseKey - key to indicate a pausestopKey - key to indicate a stoppublic AudioSourceState next(AudioSource as)
next in interface AudioTriggeras - AudioSource to testpublic void onAction(KeyEvent event)
next(AudioSource)onAction in interface KeyListenerevent - The KeyEvent@Generated(value="lombok") protected Key getPlayKey()
@Generated(value="lombok") protected Key getPauseKey()
@Generated(value="lombok") protected Key getStopKey()
@Generated(value="lombok") protected AudioSourceState getNext()
@Generated(value="lombok") protected void setNext(AudioSourceState next)
Copyright © 2015. All rights reserved.