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); } }
@SuppressWarnings("unused") private void onFlushAudioBuffer() { audioBufferStatus = AudioBufferStatus.FLUSHING; enabledAudioWidgets(false); btnFlushAudioBuffer.setText(Strings.btnRenderAudioBufferFlushing); parent.flushAudioBuffer(false); }
RenderingTab(final SrcDemoUI parent) { this.parent = parent; initUI(); parent.getQApplication().installEventFilter(focusEventFilter); final Runnable updateUi = new Runnable() { @Override public void run() { updateUI(); } }; new Timer("Rendering tab updater", true) .schedule( new TimerTask() { @Override public void run() { QCoreApplication.invokeLater(updateUi); } }, 0, uiUpdateInterval); }
private SrcSettings getSettings() { return parent.getSettings(); }