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); }
/** * 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); } }
/** 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; }
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; }
/** Broadcasts an audio event to the registered listener */ private void broadcast(AudioEvent audioEvent) { mAudioEventBroadcaster.broadcast(audioEvent); }
public void removeAudioEventListener(Listener<AudioEvent> listener) { mAudioEventBroadcaster.removeListener(listener); }
/** Registers a single listener to receive audio start and audio stop events */ public void addAudioEventListener(Listener<AudioEvent> listener) { mAudioEventBroadcaster.addListener(listener); }
/** Removes the call event listener */ @Override public void removeCallEventListener(Listener<CallEvent> listener) { mCallEventBroadcaster.removeListener(listener); }
/** Adds a call event listener */ @Override public void addCallEventListener(Listener<CallEvent> listener) { mCallEventBroadcaster.addListener(listener); }
/** Broadcasts a call event to any registered listeners */ protected void broadcast(CallEvent event) { mCallEventBroadcaster.broadcast(event); }