Exemple #1
0
  public LJ1200Decoder(AliasList aliasList) {
    mDecimationFilter =
        new HalfBandFilter_RB_RB(
            Filters.FIR_HALF_BAND_31T_ONE_EIGHTH_FCO.getCoefficients(), 1.0f, true);

    mBandPassFilter =
        new RealFIRFilter_RB_RB(Filters.FIRBP_1200FSK_24000FS.getCoefficients(), 1.02f);
    mDecimationFilter.setListener(mBandPassFilter);

    mFSKDecoder = new FSK2Decoder(DECIMATED_SAMPLE_RATE, SYMBOL_RATE, Output.INVERTED);
    mBandPassFilter.setListener(mFSKDecoder);

    mFSKDecoder.setListener(mFSKDecoderBroadcaster);

    mTowerMessageFramer = new MessageFramer(SyncPattern.LJ1200.getPattern(), MESSAGE_LENGTH);
    mTransponderMessageFramer =
        new MessageFramer(SyncPattern.LJ1200_TRANSPONDER.getPattern(), MESSAGE_LENGTH);
    mFSKDecoderBroadcaster.addListener(mTowerMessageFramer);
    mFSKDecoderBroadcaster.addListener(mTransponderMessageFramer);

    mMessageProcessor = new LJ1200MessageProcessor(aliasList);
    mTowerMessageFramer.addMessageListener(mMessageProcessor);
    mTransponderMessageFramer.addMessageListener(mMessageProcessor);
    mMessageProcessor.setMessageListener(this);
  }
Exemple #2
0
  /**
   * Monitors the source data line playback state and broadcasts audio events to the registered
   * listener as the state changes
   */
  @Override
  public void update(LineEvent event) {
    LineEvent.Type type = event.getType();

    if (type == LineEvent.Type.START) {
      mAudioEventBroadcaster.broadcast(mAudioStartEvent);
    } else if (type == LineEvent.Type.STOP) {
      mAudioEventBroadcaster.broadcast(mAudioStopEvent);
    }
  }
Exemple #3
0
  /** Disposes any resources or pointers held by this instance to prepare for garbage collection */
  public void dispose() {
    mCallEventBroadcaster.dispose();
    mCallEventBroadcaster = null;
    mChangedAttributeListener = null;
    mDecoderStateListener = null;
    mMetadataListener = null;

    mAliasList = null;
  }
Exemple #4
0
  public void dispose() {
    mCanProcessAudio = false;

    if (mProcessorTask != null && mThreadPoolManager != null) {
      mThreadPoolManager.cancel(mProcessorTask);
    }

    mThreadPoolManager = null;
    mProcessorTask = null;

    mBuffer.clear();

    mAudioEventBroadcaster.dispose();
    mAudioEventBroadcaster = null;
    mAudioMetadataListener = null;

    if (mOutput != null) {
      mOutput.close();
    }

    mOutput = null;
    mGainControl = null;
    mMuteControl = null;
  }
Exemple #5
0
 /** Broadcasts an audio event to the registered listener */
 private void broadcast(AudioEvent audioEvent) {
   mAudioEventBroadcaster.broadcast(audioEvent);
 }
Exemple #6
0
 public void removeAudioEventListener(Listener<AudioEvent> listener) {
   mAudioEventBroadcaster.removeListener(listener);
 }
Exemple #7
0
 /** Registers a single listener to receive audio start and audio stop events */
 public void addAudioEventListener(Listener<AudioEvent> listener) {
   mAudioEventBroadcaster.addListener(listener);
 }
Exemple #8
0
 /** Removes the call event listener */
 @Override
 public void removeCallEventListener(Listener<CallEvent> listener) {
   mCallEventBroadcaster.removeListener(listener);
 }
Exemple #9
0
 /** Adds a call event listener */
 @Override
 public void addCallEventListener(Listener<CallEvent> listener) {
   mCallEventBroadcaster.addListener(listener);
 }
Exemple #10
0
 /** Broadcasts a call event to any registered listeners */
 protected void broadcast(CallEvent event) {
   mCallEventBroadcaster.broadcast(event);
 }