@SuppressWarnings("unused") private void updatePreviewEnabled() { previewEnabled = previewEnabledCheckbox.isChecked(); getSettings().setPreviewEnabled(previewEnabled); if (!previewEnabled) { previewPicture.reset(); } previewPicture.updatePicture(); }
private void updateUI() { lblLastFrameProcessed.setText(Integer.toString(framesProcessed.get())); lblFramesProcessedPerSecond.setText(framesProcessRate.getFormattedRate()); lblLastFrameSaved.setText(Integer.toString(framesSaved.get())); if (previewEnabled) { previewPicture.updatePicture(); } if (audioBufferInUse && parent.isAudioBufferInUse()) { switch (audioBufferStatus) { case REGULAR: audioBuffer.setMaximum(audioBufferTotal); audioBuffer.setValue(audioBufferOccupied); lblAudioBuffer1.setText( (audioBufferOccupied / 1024) + Strings.lblRenderAudioBuffer1 + (audioBufferOccupied * 100 / audioBufferTotal) + Strings.lblRenderAudioBuffer2); lblAudioBuffer2.setText( Strings.lblRenderAudioBuffer3 + (audioBufferTotal / 1024) + Strings.lblRenderAudioBuffer4); btnFlushAudioBuffer.setText(Strings.btnRenderAudioBufferFlush); enabledAudioWidgets(audioBufferOccupied > 0 && audioBufferTotal > 0); break; case FLUSHING: case DESTROYED: audioBuffer.setMaximum(1); audioBuffer.setValue(0); btnFlushAudioBuffer.setEnabled(false); break; } } else { enabledAudioWidgets(false); } }
@Override public void onFrameSaved( final File savedFrame, final int[] pixels, final int width, final int height) { framesSaved.incrementAndGet(); if (previewEnabled && hasFocus) { previewPicture.push(pixels, width, height); } }
private void onFocus() { hasFocus = true; if (previewEnabled) { previewPicture.restore(); } }
private void onDefocus() { hasFocus = false; if (previewEnabled) { previewPicture.reset(); } }