VideoEditor::VideoEditor(QWidget* parent, Video *video, Doc* doc) : QWidget(parent) , m_doc(doc) , m_video(video) { Q_ASSERT(doc != NULL); Q_ASSERT(video != NULL); setupUi(this); m_nameEdit->setText(m_video->name()); m_nameEdit->setSelection(0, m_nameEdit->text().length()); connect(m_video, SIGNAL(totalTimeChanged(qint64)), this, SLOT(slotDurationChanged(qint64))); connect(m_video, SIGNAL(metaDataChanged(QString,QVariant)), this, SLOT(slotMetaDataChanged(QString,QVariant))); connect(m_nameEdit, SIGNAL(textEdited(const QString&)), this, SLOT(slotNameEdited(const QString&))); connect(m_fileButton, SIGNAL(clicked()), this, SLOT(slotSourceFileClicked())); connect(m_previewButton, SIGNAL(toggled(bool)), this, SLOT(slotPreviewToggled(bool))); m_filenameLabel->setText(m_video->getSourceFileName()); m_durationLabel->setText(Function::speedToString(m_video->totalDuration())); for (int i = 0; i < m_video->getScreenCount(); i++) m_screenCombo->addItem(QString("Screen %1").arg(i + 1)); m_screenCombo->setCurrentIndex(m_video->screen()); if (m_video->fullscreen() == true) m_fullCheck->setChecked(true); else m_winCheck->setChecked(true); connect(m_screenCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotScreenIndexChanged(int))); connect(m_winCheck, SIGNAL(clicked()), this, SLOT(slotWindowedCheckClicked())); connect(m_fullCheck, SIGNAL(clicked()), this, SLOT(slotFullscreenCheckClicked())); // Set focus to the editor m_nameEdit->setFocus(); }
VideoEditor::VideoEditor(QWidget* parent, Video *video, Doc* doc) : QWidget(parent) , m_doc(doc) , m_video(video) { Q_ASSERT(doc != NULL); Q_ASSERT(video != NULL); setupUi(this); m_nameEdit->setText(m_video->name()); m_nameEdit->setSelection(0, m_nameEdit->text().length()); connect(m_video, SIGNAL(totalTimeChanged(qint64)), this, SLOT(slotDurationChanged(qint64))); connect(m_video, SIGNAL(metaDataChanged(QString,QVariant)), this, SLOT(slotMetaDataChanged(QString,QVariant))); connect(m_nameEdit, SIGNAL(textEdited(const QString&)), this, SLOT(slotNameEdited(const QString&))); connect(m_fileButton, SIGNAL(clicked()), this, SLOT(slotSourceFileClicked())); connect(m_urlButton, SIGNAL(clicked()), this, SLOT(slotSourceUrlClicked())); connect(m_previewButton, SIGNAL(toggled(bool)), this, SLOT(slotPreviewToggled(bool))); m_filenameLabel->setText(m_video->sourceUrl()); m_durationLabel->setText(Function::speedToString(m_video->totalDuration())); QSize res = video->resolution(); m_resolutionLabel->setText(QString("%1x%2").arg(res.width()).arg(res.height())); m_vcodecLabel->setText(video->videoCodec()); m_acodecLabel->setText(video->audioCodec()); int screenCount = 0; QDesktopWidget *desktop = qApp->desktop(); if (desktop != NULL) screenCount = desktop->screenCount(); if (screenCount > 0) { for (int i = 0; i < screenCount; i++) m_screenCombo->addItem(QString("Screen %1").arg(i + 1)); } m_screenCombo->setCurrentIndex(m_video->screen()); if (m_video->fullscreen() == true) m_fullCheck->setChecked(true); else m_winCheck->setChecked(true); connect(m_screenCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotScreenIndexChanged(int))); connect(m_winCheck, SIGNAL(clicked()), this, SLOT(slotWindowedCheckClicked())); connect(m_fullCheck, SIGNAL(clicked()), this, SLOT(slotFullscreenCheckClicked())); if(m_video->runOrder() == Video::Loop) m_loopCheck->setChecked(true); else m_singleCheck->setChecked(true); connect(m_loopCheck, SIGNAL(clicked()), this, SLOT(slotLoopCheckClicked())); connect(m_singleCheck, SIGNAL(clicked()), this, SLOT(slotSingleShotCheckClicked())); // Set focus to the editor m_nameEdit->setFocus(); }
AudioEditor::AudioEditor(QWidget* parent, Audio *audio, Doc* doc) : QWidget(parent) , m_doc(doc) , m_audio(audio) , m_speedDials(NULL) { Q_ASSERT(doc != NULL); Q_ASSERT(audio != NULL); setupUi(this); m_nameEdit->setText(m_audio->name()); m_nameEdit->setSelection(0, m_nameEdit->text().length()); m_fadeInEdit->setText(Function::speedToString(audio->fadeInSpeed())); m_fadeOutEdit->setText(Function::speedToString(audio->fadeOutSpeed())); connect(m_nameEdit, SIGNAL(textEdited(const QString&)), this, SLOT(slotNameEdited(const QString&))); connect(m_fileButton, SIGNAL(clicked()), this, SLOT(slotSourceFileClicked())); connect(m_speedDialButton, SIGNAL(toggled(bool)), this, SLOT(slotSpeedDialToggle(bool))); connect(m_fadeInEdit, SIGNAL(returnPressed()), this, SLOT(slotFadeInEdited())); connect(m_fadeOutEdit, SIGNAL(returnPressed()), this, SLOT(slotFadeOutEdited())); connect(m_previewButton, SIGNAL(toggled(bool)), this, SLOT(slotPreviewToggled(bool))); AudioDecoder *adec = m_audio->getAudioDecoder(); m_filenameLabel->setText(m_audio->getSourceFileName()); if (adec != NULL) { AudioParameters ap = adec->audioParameters(); m_durationLabel->setText(Function::speedToString(m_audio->getDuration())); m_srateLabel->setText(QString("%1 Hz").arg(ap.sampleRate())); m_channelsLabel->setText(QString("%1").arg(ap.channels())); m_bitrateLabel->setText(QString("%1 kb/s").arg(adec->bitrate())); } QList<AudioDeviceInfo> devList; #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #if defined( __APPLE__) || defined(Q_OS_MAC) devList = AudioRendererPortAudio::getDevicesInfo(); #elif defined(WIN32) || defined(Q_OS_WIN) devList = AudioRendererWaveOut::getDevicesInfo(); #else devList = AudioRendererAlsa::getDevicesInfo(); #endif #else devList = AudioRendererQt::getDevicesInfo(); #endif QSettings settings; QString outputName; int i = 0, selIdx = 0; m_audioDevCombo->addItem(tr("Default device"), "__qlcplusdefault__"); if (m_audio->audioDevice().isEmpty()) { QVariant var = settings.value(SETTINGS_AUDIO_OUTPUT_DEVICE); if (var.isValid() == true) outputName = var.toString(); } else outputName = m_audio->audioDevice(); foreach( AudioDeviceInfo info, devList) { if (info.capabilities & AUDIO_CAP_OUTPUT) { m_audioDevCombo->addItem(info.deviceName, info.privateName); if (info.privateName == outputName) selIdx = i; i++; } } m_audioDevCombo->setCurrentIndex(selIdx); connect(m_audioDevCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotAudioDeviceChanged(int))); // Set focus to the editor m_nameEdit->setFocus(); }