Klasse AudioGeneratorThread

java.lang.Object
java.lang.Thread
server.netsiddev.AudioGeneratorThread
Alle implementierten Schnittstellen:
Runnable

public class AudioGeneratorThread extends Thread
Audio generating thread which communicates with SIDWrite source over a BlockingQueue.
Autor:
Antti Lankila
  • Felddetails

    • RANDOM

      private static final Random RANDOM
      Random source for triangular dithering
    • playbackClock

      private final AtomicLong playbackClock
      Current clock in the SID stream.
    • sidCommandQueue

      private final BlockingQueue<SIDWrite> sidCommandQueue
      Queue with SID writes from client. We reserve a space assuming writes come at most one every 10 cpu clocks.
    • digiBoostEnabled

      private boolean digiBoostEnabled
      global setting for each 8580 if digiboost should be enabled
    • sids

      private SIDChip[] sids
      SIDs that generate output
    • resamplerL

      private Resampler resamplerL
      SID resampler
    • resamplerR

      private Resampler resamplerR
      SID resampler
    • sidClocking

      private CPUClock sidClocking
      Currently active clocking value
    • sidSampling

      private SamplingMethod sidSampling
      Currently active sampling method
    • audioConfig

      private final AudioConfig audioConfig
      Current audio output frequency.
    • oldRandomValue

      private int oldRandomValue
      State of HP-TPDF.
    • sidLevel

      private int[] sidLevel
    • deviceIndex

      private int deviceIndex
    • sidPositionL

      private int[] sidPositionL
    • sidPositionR

      private int[] sidPositionR
    • audioBufferPos

      private int[] audioBufferPos
    • delayedSamples

      private IntBuffer[] delayedSamples
    • fadeInClocks

      private long[] fadeInClocks
      Fade-in/fade-out time in clock ticks.
    • fadeOutClocks

      private long[] fadeOutClocks
      Fade-in/fade-out time in clock ticks.
    • fadeInStep

      private long[] fadeInStep
      Fade-in/fade-out clock steps until next volume change and current fade-in and fade-out counters.
    • fadeOutStep

      private long[] fadeOutStep
      Fade-in/fade-out clock steps until next volume change and current fade-in and fade-out counters.
    • fadeInVal

      private long[] fadeInVal
      Fade-in/fade-out clock steps until next volume change and current fade-in and fade-out counters.
    • fadeOutVal

      private long[] fadeOutVal
      Fade-in/fade-out clock steps until next volume change and current fade-in and fade-out counters.
    • mixerInfo

      private Mixer.Info mixerInfo
    • deviceChanged

      private boolean deviceChanged
    • audioWait

      private final AtomicBoolean audioWait
      Is audio thread waiting?
    • quicklyDiscardAudio

      private final AtomicBoolean quicklyDiscardAudio
      Is audio thread requested to stop rapidly?
    • driver

      private JavaSound driver
      Audio output driver.
    • captureTime

      private int captureTime
      WhatsSID capture time in seconds
    • whatsSidEnabled

      private boolean whatsSidEnabled
      WhatsSID enabled?
    • minimumRelativeConfidence

      private double minimumRelativeConfidence
      WhatsSID minimum confidence to match
    • whatsSidSupport

      private WhatsSidSupport whatsSidSupport
      WhatsSID
  • Konstruktordetails

    • AudioGeneratorThread

      public AudioGeneratorThread(AudioConfig config)
  • 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()
      Angegeben von:
      run in Schnittstelle Runnable
      Setzt außer Kraft:
      run in Klasse Thread
    • 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

      private void initDriver() throws LineUnavailableException
      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

      public void changeDevice(Mixer.Info deviceInfo)
      Change the output device
      Parameter:
      deviceInfo -
    • setAudioBufferSize

      public void setAudioBufferSize(Integer audioBufferSize)
    • setClocking

      public void setClocking(CPUClock clock)
      Set NTSC/PAL time source.
      Parameter:
      clock - The specified clock value to set.
    • setSampling

      public void setSampling(SamplingMethod samplingMethod)
      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

      public BlockingQueue<SIDWrite> getSidCommandQueue()
      Acquire command queue handle.
      Gibt zurück:
      command queue
    • getDriver

      public JavaSound 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

      public void setSidArray(SIDChip[] sid)
    • setSID

      public void setSID(int sidNumber, SIDChip sidConfig)
    • 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

      public WhatsSidSupport getWhatsSidSupport()