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); } }
private void initUI() { final QHBoxLayout mainHbox = new QHBoxLayout(); { final QGroupBox videoBox = new QGroupBox(Strings.grpRenderingVideoFrames); final QVBoxLayout videoVbox = new QVBoxLayout(); { final QHBoxLayout hbox = new QHBoxLayout(); hbox.addWidget(new QLabel(Strings.lblLastFrameProcessed)); lblLastFrameProcessed = new QLabel(Strings.lblLastFrameProcessedDefault); lblLastFrameProcessed.setAlignment(AlignmentFlag.AlignRight); hbox.addWidget(lblLastFrameProcessed); videoVbox.addLayout(hbox, 0); } { final QHBoxLayout hbox = new QHBoxLayout(); hbox.addWidget(new QLabel(Strings.lblFramesProcessedPerSecond)); lblFramesProcessedPerSecond = new QLabel(Strings.lblFramesProcessedPerSecondDefault); lblFramesProcessedPerSecond.setAlignment(AlignmentFlag.AlignRight); hbox.addWidget(lblFramesProcessedPerSecond); videoVbox.addLayout(hbox, 0); } { final QHBoxLayout hbox = new QHBoxLayout(); hbox.addWidget(new QLabel(Strings.lblLastFrameSaved)); lblLastFrameSaved = new QLabel(Strings.lblLastFrameSavedDefault); lblLastFrameSaved.setAlignment(AlignmentFlag.AlignRight); hbox.addWidget(lblLastFrameSaved); videoVbox.addLayout(hbox, 0); } { previewPicture = new UpdatablePicture( Files.iconRenderingDefault, maximumPreviewWidth, maximumPreviewHeight); videoVbox.addWidget(previewPicture, 1); } { previewEnabledCheckbox = new QCheckBox(Strings.lblEnablePreview); previewEnabledCheckbox.stateChanged.connect(this, "updatePreviewEnabled()"); previewEnabled = getSettings().getPreviewEnabled(); previewEnabledCheckbox.setChecked(previewEnabled); videoVbox.addWidget(previewEnabledCheckbox, 0, AlignmentFlag.AlignHCenter); } videoBox.setLayout(videoVbox); mainHbox.addWidget(videoBox, 1); } { final QGroupBox audioBox = new QGroupBox(Strings.grpRenderingAudioBuffer); final QVBoxLayout audioVbox = new QVBoxLayout(); { audioBuffer = new QProgressBar(); audioBuffer.setOrientation(Orientation.Vertical); audioBuffer.setSizePolicy(Policy.Expanding, Policy.Expanding); audioVbox.addWidget(audioWidget(audioBuffer), 1, AlignmentFlag.AlignHCenter); lblAudioBuffer1 = new QLabel(); audioVbox.addWidget(audioWidget(lblAudioBuffer1), 0, AlignmentFlag.AlignCenter); lblAudioBuffer2 = new QLabel(); audioVbox.addWidget(audioWidget(lblAudioBuffer2), 0, AlignmentFlag.AlignCenter); btnFlushAudioBuffer = new QPushButton(Strings.btnRenderAudioBufferFlush); btnFlushAudioBuffer.clicked.connect(this, "onFlushAudioBuffer()"); btnFlushAudioBuffer.setEnabled(false); audioVbox.addWidget(audioWidget(btnFlushAudioBuffer), 0, AlignmentFlag.AlignCenter); } audioBox.setLayout(audioVbox); mainHbox.addWidget(audioBox, 0); } setLayout(mainHbox); }