QToolBar *toolbar = new QToolBar(name, this);
QHBoxLayout *layout = new QHBoxLayout;
-
+ layout->setContentsMargins(0, 0, 0, 0);
m_playIcon = KIcon("media-playback-start");
m_pauseIcon = KIcon("media-playback-pause");
connect(m_recAction, SIGNAL(triggered()), this, SLOT(slotRecord()));
m_recAction->setCheckable(true);
+ toolbar->addSeparator();
+
+ QAction *configAction = toolbar->addAction(KIcon("configure"), i18n("Configure"));
+ connect(configAction, SIGNAL(triggered()), this, SLOT(slotConfigure()));
+ configAction->setCheckable(false);
+
layout->addWidget(toolbar);
ui.control_frame_firewire->setLayout(layout);
return m_name;
}
+void RecMonitor::slotConfigure() {
+ emit showConfigDialog(4, ui.device_selector->currentIndex());
+}
+
void RecMonitor::slotVideoDeviceChanged(int ix) {
switch (ix) {
case SCREENGRAB:
m_recAction->setEnabled(true);
m_stopAction->setEnabled(false);
m_playAction->setEnabled(false);
- ui.video_frame->setPixmap(mergeSideBySide(KIcon("video-display").pixmap(QSize(50, 50)), i18n("Press record button\nto start screen capture")));
+ ui.video_frame->setPixmap(mergeSideBySide(KIcon("video-display").pixmap(QSize(50, 50)), i18n("Press record button\nto start screen capture\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
//ui.video_frame->setText(i18n("Press record button\nto start screen capture"));
break;
case VIDEO4LINUX:
m_rewAction->setEnabled(false);
m_fwdAction->setEnabled(false);
//ui.video_frame->setText(i18n("Plug your camcorder and\npress connect button\nto initialize connection"));
- ui.video_frame->setPixmap(mergeSideBySide(KIcon("network-connect").pixmap(QSize(50, 50)), i18n("Plug your camcorder and\npress connect button\nto initialize connection")));
+ ui.video_frame->setPixmap(mergeSideBySide(KIcon("network-connect").pixmap(QSize(50, 50)), i18n("Plug your camcorder and\npress connect button\nto initialize connection\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
break;
}
}
-QPixmap RecMonitor::mergeSideBySide( const QPixmap& pix, const QString txt )
-{
+QPixmap RecMonitor::mergeSideBySide(const QPixmap& pix, const QString txt) {
QPainter p;
- int strWidth = p.fontMetrics().boundingRect( QRect(0, 0, ui.video_frame->width(), ui.video_frame->height()), Qt::AlignLeft, txt ).width();
- int strHeight = p.fontMetrics().height();
+ QRect r = p.fontMetrics().boundingRect(QRect(0, 0, ui.video_frame->width(), ui.video_frame->height()), Qt::AlignLeft, txt);
+ int strWidth = r.width();
+ int strHeight = r.height();
int pixWidth = pix.width();
int pixHeight = pix.height();
- QPixmap res( strWidth + 8 + pixWidth, qMax( strHeight, pixHeight ) );
+ QPixmap res(strWidth + 8 + pixWidth, qMax(strHeight, pixHeight));
res.fill(Qt::transparent);
- p.begin( &res );
- p.drawPixmap(0,0, pix );
- p.drawText( QRect( pixWidth +8, 0, strWidth, pixHeight), 0, txt );
+ p.begin(&res);
+ p.drawPixmap(0, 0, pix);
+ p.drawText(QRect(pixWidth + 8, 0, strWidth, strHeight), 0, txt);
p.end();
return res;
}
if (!KIO::NetAccess::exists(KUrl(KdenliveSettings::video4vdevice()), KIO::NetAccess::SourceSide , this)) {
m_playAction->setEnabled(false);
m_recAction->setEnabled(false);
- ui.video_frame->setPixmap(mergeSideBySide(KIcon("camera-web").pixmap(QSize(50, 50)), i18n("Cannot read from device %1\nPlease check drivers and access rights.", KdenliveSettings::video4vdevice())));
+ ui.video_frame->setPixmap(mergeSideBySide(KIcon("camera-web").pixmap(QSize(50, 50)), i18n("Cannot read from device %1\nPlease check drivers and access rights.", KdenliveSettings::video4vdevice())));
//ui.video_frame->setText(i18n("Cannot read from device %1\nPlease check drivers and access rights.", KdenliveSettings::video4vdevice()));
} else //ui.video_frame->setText(i18n("Press play or record button\nto start video capture"));
- ui.video_frame->setPixmap(mergeSideBySide(KIcon("camera-web").pixmap(QSize(50, 50)), i18n("Press play or record button\nto start video capture")));
+ ui.video_frame->setPixmap(mergeSideBySide(KIcon("camera-web").pixmap(QSize(50, 50)), i18n("Press play or record button\nto start video capture\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
}
void RecMonitor::slotDisconnect() {
const QRect rect = QApplication::desktop()->screenGeometry();
args = KdenliveSettings::screengrabcapture().replace("%size", QString::number(rect.width()) + "x" + QString::number(rect.height())).replace("%offset", QString());
kDebug() << "// capture params: " << args;
- if (KdenliveSettings::screengrabenableaudio()) {
- // also capture audio
- m_captureArgs << KdenliveSettings::screengrabaudiocapture().simplified().split(' ');
- }
+ if (KdenliveSettings::screengrabenableaudio()) {
+ // also capture audio
+ m_captureArgs << KdenliveSettings::screengrabaudiocapture().simplified().split(' ');
+ }
m_captureArgs << args.simplified().split(' ') << KdenliveSettings::screengrabencoding().simplified().split(' ') << m_captureFile.path();
ui.video_frame->setText(i18n("Capturing..."));
m_isCapturing = true;
QString args = KdenliveSettings::screengrabcapture().replace("%size", QString::number(width) + "x" + QString::number(height)).replace("%offset", "+" + QString::number(rect.x()) + "," + QString::number(rect.y()));
kDebug() << "// capture params: " << args;
if (KdenliveSettings::screengrabenableaudio()) {
- // also capture audio
- m_captureArgs << KdenliveSettings::screengrabaudiocapture().simplified().split(' ');
+ // also capture audio
+ m_captureArgs << KdenliveSettings::screengrabaudiocapture().simplified().split(' ');
}
m_captureArgs << args.simplified().split(' ') << KdenliveSettings::screengrabencoding().simplified().split(' ') << m_captureFile.path();
m_isCapturing = true;
m_playAction->setEnabled(false);
m_rewAction->setEnabled(false);
m_fwdAction->setEnabled(false);
+ m_recAction->setEnabled(false);
}
- m_isCapturing = false;
m_isPlaying = false;
m_playAction->setIcon(m_playIcon);
m_recAction->setChecked(false);
ui.device_selector->setEnabled(true);
if (captureProcess && captureProcess->exitStatus() == QProcess::CrashExit) {
ui.video_frame->setText(i18n("Capture crashed, please check your parameters"));
- } else ui.video_frame->setText(i18n("Not connected"));
+ } else {
+ ui.video_frame->setText(i18n("Not connected"));
+ if (m_isCapturing && ui.device_selector->currentIndex() == FIREWIRE) {
+ //TODO: show dialog asking user confirmation for captured files
+ }
+ }
+ m_isCapturing = false;
} else {
if (ui.device_selector->currentIndex() != SCREENGRAB) m_stopAction->setEnabled(true);
ui.device_selector->setEnabled(false);