else m_clipList.at(i)->slotClearAudioCache();
}
if (m_audioThumbsEnabled) {
- if (m_generatingAudioId.isEmpty()) startAudioThumbsGeneration();
- }
- else {
- m_audioThumbsQueue.clear();
- m_generatingAudioId = QString();
+ if (m_generatingAudioId.isEmpty()) startAudioThumbsGeneration();
+ } else {
+ m_audioThumbsQueue.clear();
+ m_generatingAudioId = QString();
}
}
void ClipManager::startAudioThumbsGeneration() {
if (!KdenliveSettings::audiothumbnails()) {
- m_audioThumbsQueue.clear();
- m_generatingAudioId = QString();
- return;
+ m_audioThumbsQueue.clear();
+ m_generatingAudioId = QString();
+ return;
}
if (!m_audioThumbsQueue.isEmpty()) {
- m_generatingAudioId = m_audioThumbsQueue.takeFirst();
- DocClipBase *clip = getClipById(m_generatingAudioId);
- if (!clip || !clip->slotGetAudioThumbs())
- endAudioThumbsGeneration(m_generatingAudioId);
+ m_generatingAudioId = m_audioThumbsQueue.takeFirst();
+ DocClipBase *clip = getClipById(m_generatingAudioId);
+ if (!clip || !clip->slotGetAudioThumbs())
+ endAudioThumbsGeneration(m_generatingAudioId);
} else {
m_generatingAudioId = QString();
}
void ClipManager::endAudioThumbsGeneration(const QString &requestedId) {
if (!KdenliveSettings::audiothumbnails()) {
- m_audioThumbsQueue.clear();
- m_generatingAudioId = QString();
- return;
+ m_audioThumbsQueue.clear();
+ m_generatingAudioId = QString();
+ return;
}
if (!m_audioThumbsQueue.isEmpty()) {
if (m_generatingAudioId == requestedId) {
setCentralWidget(m_timelineArea);
setupGUI(Default, NULL /*"kdenliveui.rc"*/);
- kDebug() << factory() << " " << factory()->container("video_effects_menu", this);
+ //kDebug() << factory() << " " << factory()->container("video_effects_menu", this);
+
+ m_projectMonitor->setupMenu(static_cast<QMenu*>(factory()->container("monitor_go", this)));
+ m_clipMonitor->setupMenu(static_cast<QMenu*>(factory()->container("monitor_go", this)));
// build effects menus
QAction *action;
collection->addAction("seek_clip_end", clipEnd);
connect(clipEnd, SIGNAL(triggered(bool)), this, SLOT(slotClipEnd()));
- KAction* projectStart = new KAction(KIcon("media-seek-backward"), i18n("Go to Project Start"), this);
+ KAction* projectStart = new KAction(KIcon("go-first"), i18n("Go to Project Start"), this);
projectStart->setShortcut(Qt::CTRL + Qt::Key_Home);
collection->addAction("seek_start", projectStart);
connect(projectStart, SIGNAL(triggered(bool)), m_monitorManager, SLOT(slotStart()));
- KAction* projectEnd = new KAction(KIcon("media-seek-forward"), i18n("Go to Project End"), this);
+ KAction* projectEnd = new KAction(KIcon("go-last"), i18n("Go to Project End"), this);
projectEnd->setShortcut(Qt::CTRL + Qt::Key_End);
collection->addAction("seek_end", projectEnd);
connect(projectEnd, SIGNAL(triggered(bool)), m_monitorManager, SLOT(slotEnd()));
#include <KDebug>
#include <KLocale>
#include <KFileDialog>
+#include <KApplication>
#include "gentime.h"
#include "monitor.h"
toolbar->addAction(KIcon("media-skip-backward"), i18n("Rewind 1 frame"), this, SLOT(slotRewindOneFrame()));
QToolButton *playButton = new QToolButton(toolbar);
- QMenu *playMenu = new QMenu(i18n("Play..."), this);
- playButton->setMenu(playMenu);
- playButton->setPopupMode(QToolButton::MenuButtonPopup);
- toolbar->addWidget(playButton);
-
- m_playAction = playMenu->addAction(m_playIcon, i18n("Play"));
+ m_playMenu = new QMenu(i18n("Play..."), this);
+ m_playAction = m_playMenu->addAction(m_playIcon, i18n("Play"));
m_playAction->setCheckable(true);
connect(m_playAction, SIGNAL(triggered()), this, SLOT(slotPlay()));
- playMenu->addAction(m_playIcon, i18n("Play Section"), this, SLOT(slotPlayZone()));
- playMenu->addAction(m_playIcon, i18n("Loop Section"), this, SLOT(slotLoopZone()));
+ m_playMenu->addAction(m_playIcon, i18n("Play Section"), this, SLOT(slotPlayZone()));
+ m_playMenu->addAction(m_playIcon, i18n("Loop Section"), this, SLOT(slotLoopZone()));
+
+ playButton->setMenu(m_playMenu);
+ playButton->setPopupMode(QToolButton::MenuButtonPopup);
+ toolbar->addWidget(playButton);
toolbar->addAction(KIcon("media-skip-forward"), i18n("Forward 1 frame"), this, SLOT(slotForwardOneFrame()));
toolbar->addAction(KIcon("media-seek-forward"), i18n("Forward"), this, SLOT(slotForward()));
playButton->setDefaultAction(m_playAction);
QToolButton *configButton = new QToolButton(toolbar);
- QMenu *configMenu = new QMenu(i18n("Misc..."), this);
+ m_configMenu = new QMenu(i18n("Misc..."), this);
configButton->setIcon(KIcon("system-run"));
- configButton->setMenu(configMenu);
+ configButton->setMenu(m_configMenu);
configButton->setPopupMode(QToolButton::QToolButton::InstantPopup);
toolbar->addWidget(configButton);
//m_ruler->setPixelPerMark(3);
-
QVBoxLayout *rendererBox = new QVBoxLayout(ui.video_frame);
rendererBox->setContentsMargins(0, 0, 0, 0);
m_monitorRefresh = new MonitorRefresh(ui.video_frame);
render = new Render(m_name, (int) m_monitorRefresh->winId(), -1, this);
m_monitorRefresh->setRenderer(render);
- m_contextMenu = new QMenu(this);
- m_contextMenu->addMenu(playMenu);
- QMenu *goMenu = new QMenu(i18n("Go to..."), this);
- goMenu->addAction(i18n("Start"), this, SLOT(slotStart()));
- goMenu->addAction(i18n("End"), this, SLOT(slotEnd()));
- goMenu->addAction(i18n("Zone start"), this, SLOT(slotZoneStart()));
- goMenu->addAction(i18n("Zone end"), this, SLOT(slotZoneEnd()));
+
connect(m_ruler, SIGNAL(seekRenderer(int)), this, SLOT(slotSeek(int)));
connect(m_ruler, SIGNAL(zoneChanged(QPoint)), this, SIGNAL(zoneUpdated(QPoint)));
connect(render, SIGNAL(rendererPosition(int)), this, SLOT(seekCursor(int)));
connect(render, SIGNAL(rendererStopped(int)), this, SLOT(rendererStopped(int)));
- configMenu->addSeparator();
- configMenu->addAction(KIcon("transform-scale"), i18n("Resize (100%)"), this, SLOT(slotSetSizeOneToOne()));
- configMenu->addAction(KIcon("transform-scale"), i18n("Resize (50%)"), this, SLOT(slotSetSizeOneToTwo()));
+ m_configMenu->addSeparator();
+ m_configMenu->addAction(KIcon("transform-scale"), i18n("Resize (100%)"), this, SLOT(slotSetSizeOneToOne()));
+ m_configMenu->addAction(KIcon("transform-scale"), i18n("Resize (50%)"), this, SLOT(slotSetSizeOneToTwo()));
//render->createVideoXWindow(ui.video_frame->winId(), -1);
m_length = 0;
- m_contextMenu->addMenu(goMenu);
- m_contextMenu->addAction(zoneStart);
- m_contextMenu->addAction(zoneEnd);
- //TODO: add save zone to timeline monitor when fixed
- if (name == "clip") m_contextMenu->addAction(KIcon("document-save"), i18n("Save zone"), this, SLOT(slotSaveZone()));
-
- QAction *extractFrame = m_contextMenu->addAction(KIcon("document-new"), i18n("Extract frame"), this, SLOT(slotExtractCurrentFrame()));
- configMenu->addAction(extractFrame);
-
if (name != "clip") {
connect(render, SIGNAL(rendererPosition(int)), this, SIGNAL(renderPosition(int)));
connect(render, SIGNAL(durationChanged(int)), this, SIGNAL(durationChanged(int)));
- QAction *splitView = m_contextMenu->addAction(KIcon("document-new"), i18n("Split view"), render, SLOT(slotSplitView(bool)));
- splitView->setCheckable(true);
- configMenu->addAction(splitView);
- } else {
- QAction *setThumbFrame = m_contextMenu->addAction(KIcon("document-new"), i18n("Set current image as thumbnail"), this, SLOT(slotSetThumbFrame()));
- configMenu->addAction(setThumbFrame);
}
-
m_monitorRefresh->show();
kDebug() << "/////// BUILDING MONITOR, ID: " << ui.video_frame->winId();
}
return m_name;
}
+void Monitor::setupMenu(QMenu *goMenu) {
+ m_contextMenu = new QMenu(this);
+ m_contextMenu->addMenu(m_playMenu);
+ m_contextMenu->addMenu(goMenu);
+
+ //TODO: add save zone to timeline monitor when fixed
+ if (m_name == "clip") m_contextMenu->addAction(KIcon("document-save"), i18n("Save zone"), this, SLOT(slotSaveZone()));
+
+ QAction *extractFrame = m_configMenu->addAction(KIcon("document-new"), i18n("Extract frame"), this, SLOT(slotExtractCurrentFrame()));
+ m_contextMenu->addAction(extractFrame);
+
+ if (m_name != "clip") {
+ QAction *splitView = m_contextMenu->addAction(KIcon("document-new"), i18n("Split view"), render, SLOT(slotSplitView(bool)));
+ splitView->setCheckable(true);
+ m_configMenu->addAction(splitView);
+ } else {
+ QAction *setThumbFrame = m_contextMenu->addAction(KIcon("document-new"), i18n("Set current image as thumbnail"), this, SLOT(slotSetThumbFrame()));
+ m_configMenu->addAction(setThumbFrame);
+ }
+
+}
+
void Monitor::slotSetSizeOneToOne() {
QRect r = QApplication::desktop()->screenGeometry();
const int maxWidth = r.width() - 20;