Package server.netsiddev
Klasse AudioGeneratorThread
java.lang.Object
java.lang.Thread
server.netsiddev.AudioGeneratorThread
- Alle implementierten Schnittstellen:
Runnable
Audio generating thread which communicates with SIDWrite source over a
BlockingQueue.
- Autor:
- Antti Lankila
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate int[]private final AudioConfigCurrent audio output frequency.private final AtomicBooleanIs audio thread waiting?private intWhatsSID capture time in secondsprivate IntBuffer[]private booleanprivate intprivate booleanglobal setting for each 8580 if digiboost should be enabledprivate JavaSoundAudio output driver.private long[]Fade-in/fade-out time in clock ticks.private long[]Fade-in/fade-out clock steps until next volume change and current fade-in and fade-out counters.private long[]Fade-in/fade-out clock steps until next volume change and current fade-in and fade-out counters.private long[]Fade-in/fade-out time in clock ticks.private long[]Fade-in/fade-out clock steps until next volume change and current fade-in and fade-out counters.private long[]Fade-in/fade-out clock steps until next volume change and current fade-in and fade-out counters.private doubleWhatsSID minimum confidence to matchprivate Mixer.Infoprivate intState of HP-TPDF.private final AtomicLongCurrent clock in the SID stream.private final AtomicBooleanIs audio thread requested to stop rapidly?private static final RandomRandom source for triangular ditheringprivate ResamplerSID resamplerprivate ResamplerSID resamplerprivate CPUClockCurrently active clocking valueprivate final BlockingQueue<SIDWrite> Queue with SID writes from client.private int[]private int[]private int[]private SIDChip[]SIDs that generate outputprivate SamplingMethodCurrently active sampling methodprivate booleanWhatsSID enabled?private WhatsSidSupportWhatsSIDVon Klasse geerbte Felder java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidchangeDevice(Mixer.Info deviceInfo) Change the output devicevoidEnsure that the event-handling thread is consuming events.voidlongReturn the current clock in the SID stream.Acquire command queue handle.private voidbooleanvoidmute(int sidNumber, int voiceNo, boolean mute) Mute a SID's voice.private voidUpdate SID parameters to new settings based on given clocking, sampling and output frequency.voidreopen()voidreset(int sidNumber, byte volume) Reset the specified SID and sets the volume afterwards.voidrun()voidsetAudioBufferSize(Integer audioBufferSize) voidsetClocking(CPUClock clock) Set NTSC/PAL time source.voidsetDelay(int sid, int delay) voidsetDigiBoost(boolean selected) Whether or not to enable Digiboost for all SID chips of model 8580.voidsetFadeIn(float fadeIn) voidsetFadeOut(float fadeOut) voidsetLevelAdjustment(int sid, int level) voidsetPosition(int sidNumber, int position) voidsetSampling(SamplingMethod samplingMethod) Set quality of audio output.voidvoidsetSidArray(SIDChip[] sid) protected intTriangularly shaped noise source for audio applications.booleanwaitUntilQueueReady(long timeout) Von Klasse geerbte Methoden java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Felddetails
-
RANDOM
Random source for triangular dithering -
playbackClock
Current clock in the SID stream. -
sidCommandQueue
Queue with SID writes from client. We reserve a space assuming writes come at most one every 10 cpu clocks. -
digiBoostEnabled
private boolean digiBoostEnabledglobal setting for each 8580 if digiboost should be enabled -
sids
SIDs that generate output -
resamplerL
SID resampler -
resamplerR
SID resampler -
sidClocking
Currently active clocking value -
sidSampling
Currently active sampling method -
audioConfig
Current audio output frequency. -
oldRandomValue
private int oldRandomValueState of HP-TPDF. -
sidLevel
private int[] sidLevel -
deviceIndex
private int deviceIndex -
sidPositionL
private int[] sidPositionL -
sidPositionR
private int[] sidPositionR -
audioBufferPos
private int[] audioBufferPos -
delayedSamples
-
fadeInClocks
private long[] fadeInClocksFade-in/fade-out time in clock ticks. -
fadeOutClocks
private long[] fadeOutClocksFade-in/fade-out time in clock ticks. -
fadeInStep
private long[] fadeInStepFade-in/fade-out clock steps until next volume change and current fade-in and fade-out counters. -
fadeOutStep
private long[] fadeOutStepFade-in/fade-out clock steps until next volume change and current fade-in and fade-out counters. -
fadeInVal
private long[] fadeInValFade-in/fade-out clock steps until next volume change and current fade-in and fade-out counters. -
fadeOutVal
private long[] fadeOutValFade-in/fade-out clock steps until next volume change and current fade-in and fade-out counters. -
mixerInfo
-
deviceChanged
private boolean deviceChanged -
audioWait
Is audio thread waiting? -
quicklyDiscardAudio
Is audio thread requested to stop rapidly? -
driver
Audio output driver. -
captureTime
private int captureTimeWhatsSID capture time in seconds -
whatsSidEnabled
private boolean whatsSidEnabledWhatsSID enabled? -
minimumRelativeConfidence
private double minimumRelativeConfidenceWhatsSID minimum confidence to match -
whatsSidSupport
WhatsSID
-
-
Konstruktordetails
-
AudioGeneratorThread
-
-
Methodendetails
-
triangularDithering
protected int triangularDithering()Triangularly shaped noise source for audio applications. Output of this PRNG is between ]-1, 1[.- Gibt zurück:
- triangular noise sample
-
run
public void run() -
reset
public void reset(int sidNumber, byte volume) Reset the specified SID and sets the volume afterwards.- Parameter:
sidNumber- The specified SID to reset.volume- The volume of the specified SID after resetting it.
-
reopen
public void reopen() -
initDriver
- Löst aus:
LineUnavailableException
-
mute
public void mute(int sidNumber, int voiceNo, boolean mute) Mute a SID's voice.- Parameter:
sidNumber- The specified SID to mute the voice of.voiceNo- The specific voice of the SID to mute.mute- Mute/Unmute the SID voice.
-
changeDevice
Change the output device- Parameter:
deviceInfo-
-
setAudioBufferSize
-
setClocking
Set NTSC/PAL time source.- Parameter:
clock- The specified clock value to set.
-
setSampling
Set quality of audio output.- Parameter:
samplingMethod- The desired sampling method to use.
-
refreshParams
private void refreshParams()Update SID parameters to new settings based on given clocking, sampling and output frequency. -
setPosition
public void setPosition(int sidNumber, int position) -
setLevelAdjustment
public void setLevelAdjustment(int sid, int level) -
setDelay
public void setDelay(int sid, int delay) -
setFadeIn
public void setFadeIn(float fadeIn) -
setFadeOut
public void setFadeOut(float fadeOut) -
getSidCommandQueue
Acquire command queue handle.- Gibt zurück:
- command queue
-
getDriver
-
getPlaybackClock
public long getPlaybackClock()Return the current clock in the SID stream.- Gibt zurück:
- the clock
-
ensureDraining
public void ensureDraining()Ensure that the event-handling thread is consuming events. -
ensureQuickDraining
public void ensureQuickDraining() -
isWaitingForCommands
public boolean isWaitingForCommands() -
waitUntilQueueReady
public boolean waitUntilQueueReady(long timeout) -
setSidArray
-
setSID
-
setDigiBoost
public void setDigiBoost(boolean selected) Whether or not to enable Digiboost for all SID chips of model 8580.- Parameter:
selected- Whether or not to enable Digiboost.
-
getWhatsSidSupport
-