예제 #1
0
 @SuppressWarnings("unused")
 private void updatePreviewEnabled() {
   previewEnabled = previewEnabledCheckbox.isChecked();
   getSettings().setPreviewEnabled(previewEnabled);
   if (!previewEnabled) {
     previewPicture.reset();
   }
   previewPicture.updatePicture();
 }
예제 #2
0
 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);
   }
 }
예제 #3
0
 @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);
   }
 }
예제 #4
0
 private void onFocus() {
   hasFocus = true;
   if (previewEnabled) {
     previewPicture.restore();
   }
 }
예제 #5
0
 private void onDefocus() {
   hasFocus = false;
   if (previewEnabled) {
     previewPicture.reset();
   }
 }