Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

automatically select if we should export audio or not:

http://www.kdenlive.org/mantis/view.php?id=1672

svn path=/trunk/kdenlive/; revision=4642
parent a1b36538
......@@ -49,6 +49,7 @@ kde4_add_ui_files(kdenlive_UI
widgets/configsdl_ui.ui
widgets/configcapture_ui.ui
widgets/configtranscode_ui.ui
widgets/configproject_ui.ui
widgets/effectlist_ui.ui
widgets/effectstack_ui.ui
widgets/profiledialog_ui.ui
......
......@@ -301,7 +301,6 @@ void ClipManager::slotAddClipList(const KUrl::List urls, const QString group, co
foreach(const KFileMetaInfoItem& metaInfoItem, metaInfoItems) {
prod.setAttribute("meta.attr." + metaInfoItem.name().section("#", 1), metaInfoItem.value().toString());
}
}
} else if (type->is("application/x-kdenlivetitle")) {
// opening a title file
......
......@@ -173,6 +173,10 @@ CustomTrackView::CustomTrackView(KdenliveDoc *doc, CustomTrackScene* projectscen
connect(&m_thumbsTimer, SIGNAL(timeout()), this, SLOT(slotFetchNextThumbs()));
m_thumbsTimer.setInterval(500);
m_thumbsTimer.setSingleShot(true);
connect(&m_audioMonitorTimer, SIGNAL(timeout()), this, SIGNAL(documentModified()));
m_audioMonitorTimer.setInterval(2000);
m_audioMonitorTimer.setSingleShot(true);
}
CustomTrackView::~CustomTrackView()
......@@ -197,6 +201,7 @@ void CustomTrackView::keyPressEvent(QKeyEvent * event)
void CustomTrackView::setDocumentModified()
{
m_document->setModified(true);
m_audioMonitorTimer.start();
}
void CustomTrackView::setContextMenu(QMenu *timeline, QMenu *clip, QMenu *transition, QActionGroup *clipTypeGroup, QMenu *markermenu)
......@@ -914,7 +919,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
bool selected = !m_dragItem->isSelected();
if (dragGroup)
dragGroup->setSelected(selected);
else
else
m_dragItem->setSelected(selected);
groupSelectedItems();
......@@ -3687,7 +3692,7 @@ void CustomTrackView::slotRazorGroup(QList <ItemInfo> clips1, QList <ItemInfo> t
break;
}
}
for(int i = 0; i < clipsCut.count(); ++i)
for (int i = 0; i < clipsCut.count(); ++i)
cutClip(clipsCut.at(i), cutPos, false);
// TODO: uncut transitonsCut
doGroupClips(QList <ItemInfo>() << clips1 << clipsCut << clips2, QList <ItemInfo>() << transitions1 << transitionsCut << transitions2, true);
......@@ -6196,3 +6201,19 @@ void CustomTrackView::setTipAnimation(AbstractClipItem *clip, OPERATIONTYPE mode
m_animationTimer->start();
}
}
bool CustomTrackView::hasAudio(int track) const
{
QRectF rect(0, (double)(track * m_tracksHeight + 1), (double) sceneRect().width(), (double)(m_tracksHeight - 1));
QList<QGraphicsItem *> collisions = scene()->items(rect, Qt::IntersectsItemBoundingRect);
QGraphicsItem *item;
for (int i = 0; i < collisions.count(); i++) {
item = collisions.at(i);
if (!item->isEnabled()) continue;
if (item->type() == AVWIDGET) {
ClipItem *clip = static_cast <ClipItem *>(item);
if (!clip->isVideoOnly() && (clip->clipType() == AUDIO || clip->clipType() == AV || clip->clipType() == PLAYLIST)) return true;
}
}
return false;
}
......@@ -175,6 +175,11 @@ public:
KPixmapCache* pixmapCache;
/** update the timeline objects when palette changes */
void updatePalette();
/** @brief Returns true if a track has audio data on it.
* @param track The track number
*
* Check whether given track has a clip with audio in it. */
bool hasAudio(int track) const;
public slots:
void setCursorPos(int pos, bool seek = true);
......@@ -300,6 +305,8 @@ private:
QActionGroup *m_clipTypeGroup;
QTimer m_scrollTimer;
QTimer m_thumbsTimer;
/** @brief Monitor for changes in timeline (do we have audio data) */
QTimer m_audioMonitorTimer;
int m_scrollOffset;
bool m_clipDrag;
......@@ -343,7 +350,7 @@ private:
void adjustTimelineTransitions(EDITMODE mode, Transition *item, QUndoCommand *command);
/** Adjust keyframes when pasted to another clip */
void adjustKeyfames(GenTime oldstart, GenTime newstart, GenTime duration, QDomElement xml);
/** @brief Removes the tip and stops the animation timer. */
void removeTipAnimation();
/** @brief Creates a new tip animation.
......@@ -401,6 +408,8 @@ signals:
void updateClipMarkers(DocClipBase *);
void updateTrackHeaders();
void playMonitor();
/** @brief Monitor document changes (for example the presence of audio data in timeline for export widget.*/
void documentModified();
};
#endif
......
......@@ -58,8 +58,9 @@ DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, const QStrin
QDomNamedNodeMap attributes = xml.attributes();
for (int i = 0; i < attributes.count(); i++) {
QString name = attributes.item(i).nodeName();
if (name.startsWith("meta.attr.")) m_metadata.insert(name.section('.', 2, 3), attributes.item(i).nodeValue());
else m_properties.insert(name, attributes.item(i).nodeValue());
if (name.startsWith("meta.attr.")) {
m_metadata.insert(name.section('.', 2, 3), attributes.item(i).nodeValue());
} else m_properties.insert(name, attributes.item(i).nodeValue());
}
if (xml.hasAttribute("cutzones")) {
......@@ -576,7 +577,6 @@ Mlt::Producer *DocClipBase::producer(int track)
m_baseTrackProducers[track] = NULL;
return NULL;
}
if (m_properties.contains("force_aspect_ratio")) m_baseTrackProducers[track]->set("force_aspect_ratio", m_properties.value("force_aspect_ratio").toDouble());
if (m_properties.contains("force_fps")) m_baseTrackProducers[track]->set("force_fps", m_properties.value("force_fps").toDouble());
if (m_properties.contains("force_progressive")) m_baseTrackProducers[track]->set("force_progressive", m_properties.value("force_progressive").toInt());
......@@ -726,7 +726,11 @@ void DocClipBase::setMetadata(QMap <QString, QString> properties)
QMapIterator<QString, QString> i(properties);
while (i.hasNext()) {
i.next();
m_metadata.insert(i.key(), i.value());
if (i.value().isEmpty() && m_metadata.contains(i.key())) {
m_metadata.remove(i.key());
} else {
m_metadata.insert(i.key(), i.value());
}
}
}
......
......@@ -54,6 +54,10 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent) :
// Hide multi tab option until Kdenlive really supports it
m_configMisc.kcfg_activatetabs->setVisible(false);
QWidget *p8 = new QWidget;
m_configProject.setupUi(p8);
m_page8 = addPage(p8, i18n("Project Defaults"), "file-new");
QWidget *p3 = new QWidget;
m_configDisplay.setupUi(p3);
m_page3 = addPage(p3, i18n("Display"), "video-display");
......@@ -142,7 +146,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent) :
connect(m_configSdl.kcfg_audio_driver, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckAlsaDriver()));
initDevices();
connect(m_configMisc.kcfg_profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
connect(m_configProject.kcfg_profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
connect(m_configCapture.kcfg_rmd_capture_type, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateRmdRegionStatus()));
slotUpdateRmdRegionStatus();
......@@ -195,18 +199,18 @@ void KdenliveSettingsDialog::slotUpdateRmdRegionStatus()
void KdenliveSettingsDialog::checkProfile()
{
m_configMisc.kcfg_profiles_list->clear();
m_configProject.kcfg_profiles_list->clear();
QMap <QString, QString> profilesInfo = ProfilesDialog::getProfilesInfo();
QMapIterator<QString, QString> i(profilesInfo);
while (i.hasNext()) {
i.next();
m_configMisc.kcfg_profiles_list->addItem(i.key(), i.value());
m_configProject.kcfg_profiles_list->addItem(i.key(), i.value());
}
if (!KdenliveSettings::default_profile().isEmpty()) {
for (int i = 0; i < m_configMisc.kcfg_profiles_list->count(); i++) {
if (m_configMisc.kcfg_profiles_list->itemData(i).toString() == KdenliveSettings::default_profile()) {
m_configMisc.kcfg_profiles_list->setCurrentIndex(i);
for (int i = 0; i < m_configProject.kcfg_profiles_list->count(); i++) {
if (m_configProject.kcfg_profiles_list->itemData(i).toString() == KdenliveSettings::default_profile()) {
m_configProject.kcfg_profiles_list->setCurrentIndex(i);
KdenliveSettings::setProfiles_list(i);
break;
}
......@@ -418,7 +422,7 @@ void KdenliveSettingsDialog::updateSettings()
{
//kDebug() << "// // // KCONFIG UPDATE called";
m_defaultProfile = m_configMisc.kcfg_profiles_list->currentText();
m_defaultProfile = m_configProject.kcfg_profiles_list->currentText();
KdenliveSettings::setDefault_profile(m_defaultPath);
bool resetProfile = false;
......@@ -510,15 +514,15 @@ void KdenliveSettingsDialog::updateSettings()
void KdenliveSettingsDialog::slotUpdateDisplay()
{
QString currentProfile = m_configMisc.kcfg_profiles_list->itemData(m_configMisc.kcfg_profiles_list->currentIndex()).toString();
QString currentProfile = m_configProject.kcfg_profiles_list->itemData(m_configProject.kcfg_profiles_list->currentIndex()).toString();
QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(currentProfile);
m_configMisc.p_size->setText(values.value("width") + 'x' + values.value("height"));
m_configMisc.p_fps->setText(values.value("frame_rate_num") + '/' + values.value("frame_rate_den"));
m_configMisc.p_aspect->setText(values.value("sample_aspect_num") + '/' + values.value("sample_aspect_den"));
m_configMisc.p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den"));
if (values.value("progressive").toInt() == 0) m_configMisc.p_progressive->setText(i18n("Interlaced"));
else m_configMisc.p_progressive->setText(i18n("Progressive"));
m_defaultProfile = m_configMisc.kcfg_profiles_list->itemText(m_configMisc.kcfg_profiles_list->currentIndex());
m_configProject.p_size->setText(values.value("width") + 'x' + values.value("height"));
m_configProject.p_fps->setText(values.value("frame_rate_num") + '/' + values.value("frame_rate_den"));
m_configProject.p_aspect->setText(values.value("sample_aspect_num") + '/' + values.value("sample_aspect_den"));
m_configProject.p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den"));
if (values.value("progressive").toInt() == 0) m_configProject.p_progressive->setText(i18n("Interlaced"));
else m_configProject.p_progressive->setText(i18n("Progressive"));
m_defaultProfile = m_configProject.kcfg_profiles_list->itemText(m_configProject.kcfg_profiles_list->currentIndex());
m_defaultPath = currentProfile;
}
......
......@@ -33,6 +33,7 @@
#include "ui_configjogshuttle_ui.h"
#include "ui_configsdl_ui.h"
#include "ui_configtranscode_ui.h"
#include "ui_configproject_ui.h"
class KdenliveSettingsDialog : public KConfigDialog
{
......@@ -73,6 +74,7 @@ private:
KPageWidgetItem *m_page5;
KPageWidgetItem *m_page6;
KPageWidgetItem *m_page7;
KPageWidgetItem *m_page8;
Ui::ConfigEnv_UI m_configEnv;
Ui::ConfigMisc_UI m_configMisc;
Ui::ConfigDisplay_UI m_configDisplay;
......@@ -80,6 +82,7 @@ private:
Ui::ConfigJogShuttle_UI m_configShuttle;
Ui::ConfigSdl_UI m_configSdl;
Ui::ConfigTranscode_UI m_configTranscode;
Ui::ConfigProject_UI m_configProject;
QString m_defaultProfile;
QString m_defaultPath;
KProcess m_readProcess;
......
......@@ -504,8 +504,8 @@ bool MainWindow::queryClose()
if (m_monitorManager) m_monitorManager->stopActiveMonitor();
// warn the user to save if document is modified and we have clips in our project list
if (m_activeDocument && m_activeDocument->isModified() &&
((m_projectList->documentClipList().isEmpty() && !m_activeDocument->url().isEmpty()) ||
!m_projectList->documentClipList().isEmpty())) {
((m_projectList->documentClipList().isEmpty() && !m_activeDocument->url().isEmpty()) ||
!m_projectList->documentClipList().isEmpty())) {
QString message;
if (m_activeDocument->url().fileName().isEmpty())
message = i18n("Save changes to document?");
......@@ -1682,7 +1682,9 @@ bool MainWindow::saveFileAs(const QString &outputFileName)
bool MainWindow::saveFileAs()
{
QString outputFile = KFileDialog::getSaveFileName(m_activeDocument->projectFolder(), getMimeType());
if (outputFile.isEmpty()) { return false; }
if (outputFile.isEmpty()) {
return false;
}
if (QFile::exists(outputFile)) {
// Show the file dialog again if the user does not want to overwrite the file
if (KMessageBox::questionYesNo(this, i18n("File already exists.\nDo you want to overwrite it?")) == KMessageBox::No)
......@@ -1985,11 +1987,9 @@ void MainWindow::slotRenderProject()
m_renderWidget->setDocumentPath(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
m_renderWidget->setRenderProfile(m_activeDocument->getDocumentProperty("renderdestination"), m_activeDocument->getDocumentProperty("rendercategory"), m_activeDocument->getDocumentProperty("renderprofile"), m_activeDocument->getDocumentProperty("renderurl"));
}
if (m_activeTimeline) connect(m_activeTimeline, SIGNAL(projectHasAudio(bool)), m_renderWidget, SLOT(slotEnableAudio(bool)));
}
slotCheckRenderStatus();
/*TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
if (currentTab) m_renderWidget->setTimeline(currentTab);
m_renderWidget->setDocument(m_activeDocument);*/
m_renderWidget->show();
m_renderWidget->showNormal();
......@@ -2191,6 +2191,9 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha
trackView->projectView()->setContextMenu(m_timelineContextMenu, m_timelineContextClipMenu, m_timelineContextTransitionMenu, m_clipTypeGroup, (QMenu*)(factory()->container("marker_menu", this)));
if (m_renderWidget) {
if (m_activeTimeline) disconnect(m_activeTimeline, SIGNAL(projectHasAudio(bool)), m_renderWidget, SLOT(slotEnableAudio(bool)));
}
m_activeTimeline = trackView;
if (m_renderWidget) {
slotCheckRenderStatus();
......@@ -2198,6 +2201,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha
m_renderWidget->setGuides(doc->guidesXml(), doc->projectDuration());
m_renderWidget->setDocumentPath(doc->projectFolder().path(KUrl::AddTrailingSlash));
m_renderWidget->setRenderProfile(doc->getDocumentProperty("renderdestination"), doc->getDocumentProperty("rendercategory"), doc->getDocumentProperty("renderprofile"), doc->getDocumentProperty("renderurl"));
connect(m_activeTimeline, SIGNAL(projectHasAudio(bool)), m_renderWidget, SLOT(slotEnableAudio(bool)));
}
//doc->setRenderer(m_projectMonitor->render);
m_commandStack->setActiveStack(doc->commandStack());
......@@ -2341,9 +2345,9 @@ void MainWindow::slotSwitchSnap()
void MainWindow::slotDeleteItem()
{
if (QApplication::focusWidget() &&
QApplication::focusWidget()->parentWidget() &&
QApplication::focusWidget()->parentWidget()->parentWidget() &&
QApplication::focusWidget()->parentWidget()->parentWidget() == m_projectListDock) {
QApplication::focusWidget()->parentWidget() &&
QApplication::focusWidget()->parentWidget()->parentWidget() &&
QApplication::focusWidget()->parentWidget()->parentWidget() == m_projectListDock) {
m_projectList->slotRemoveClip();
} else {
......@@ -3625,20 +3629,44 @@ void MainWindow::slotShowTitleBars(bool show)
m_RGBParadeDock->setTitleBarWidget(0);
m_histogramDock->setTitleBarWidget(0);
} else {
if (!m_effectStackDock->isFloating()) { m_effectStackDock->setTitleBarWidget(new QWidget(this)); }
if (!m_clipMonitorDock->isFloating()) { m_clipMonitorDock->setTitleBarWidget(new QWidget(this)); }
if (!m_projectMonitorDock->isFloating()) { m_projectMonitorDock->setTitleBarWidget(new QWidget(this)); }
if (!m_effectStackDock->isFloating()) {
m_effectStackDock->setTitleBarWidget(new QWidget);
}
if (!m_clipMonitorDock->isFloating()) {
m_clipMonitorDock->setTitleBarWidget(new QWidget);
}
if (!m_projectMonitorDock->isFloating()) {
m_projectMonitorDock->setTitleBarWidget(new QWidget);
}
#ifndef Q_WS_MAC
if (!m_recMonitorDock->isFloating()) { m_recMonitorDock->setTitleBarWidget(new QWidget(this)); }
if (!m_recMonitorDock->isFloating()) {
m_recMonitorDock->setTitleBarWidget(new QWidget);
}
#endif
if (!m_effectListDock->isFloating()) { m_effectListDock->setTitleBarWidget(new QWidget(this)); }
if (!m_transitionConfigDock->isFloating()) { m_transitionConfigDock->setTitleBarWidget(new QWidget(this)); }
if (!m_projectListDock->isFloating()) { m_projectListDock->setTitleBarWidget(new QWidget(this)); }
if (!m_undoViewDock->isFloating()) { m_undoViewDock->setTitleBarWidget(new QWidget(this)); }
if (!m_vectorscopeDock->isFloating()) { m_vectorscopeDock->setTitleBarWidget(new QWidget(this)); }
if (!m_waveformDock->isFloating()) { m_waveformDock->setTitleBarWidget(new QWidget(this)); }
if (!m_RGBParadeDock->isFloating()) { m_RGBParadeDock->setTitleBarWidget(new QWidget(this)); }
if (!m_histogramDock->isFloating()) { m_histogramDock->setTitleBarWidget(new QWidget(this)); }
if (!m_effectListDock->isFloating()) {
m_effectListDock->setTitleBarWidget(new QWidget);
}
if (!m_transitionConfigDock->isFloating()) {
m_transitionConfigDock->setTitleBarWidget(new QWidget);
}
if (!m_projectListDock->isFloating()) {
m_projectListDock->setTitleBarWidget(new QWidget);
}
if (!m_undoViewDock->isFloating()) {
m_undoViewDock->setTitleBarWidget(new QWidget);
}
if (!m_vectorscopeDock->isFloating()) {
m_vectorscopeDock->setTitleBarWidget(new QWidget);
}
if (!m_waveformDock->isFloating()) {
m_waveformDock->setTitleBarWidget(new QWidget);
}
if (!m_RGBParadeDock->isFloating()) {
m_RGBParadeDock->setTitleBarWidget(new QWidget(this));
}
if (!m_histogramDock->isFloating()) {
m_histogramDock->setTitleBarWidget(new QWidget(this));
}
}
KdenliveSettings::setShowtitlebars(show);
}
......
......@@ -425,6 +425,7 @@ private slots:
void slotUnGroupClips();
void slotEditItemDuration();
void slotClipInProjectTree();
//void slotClipToProjectTree();
void slotSplitAudio();
void slotUpdateClipType(QAction *action);
void slotShowTimeline(bool show);
......
......@@ -63,6 +63,7 @@ ProjectSettings::ProjectSettings(ProjectList *projectlist, QStringList lumas, in
video_thumbs->setChecked(KdenliveSettings::videothumbnails());
audio_tracks->setValue(audiotracks);
video_tracks->setValue(videotracks);
if (readOnlyTracks) {
video_tracks->setEnabled(false);
audio_tracks->setEnabled(false);
......@@ -236,6 +237,7 @@ bool ProjectSettings::enableAudioThumbs() const
return audio_thumbs->isChecked();
}
//static
QStringList ProjectSettings::extractPlaylistUrls(QString path)
{
......
......@@ -62,7 +62,8 @@ const int FINISHEDJOB = 2;
RenderWidget::RenderWidget(const QString &projectfolder, QWidget * parent) :
QDialog(parent),
m_projectFolder(projectfolder),
m_blockProcessing(false)
m_blockProcessing(false),
m_autoAudio(false)
{
m_view.setupUi(this);
setWindowTitle(i18n("Rendering"));
......@@ -111,6 +112,9 @@ RenderWidget::RenderWidget(const QString &projectfolder, QWidget * parent) :
m_view.errorLabel->setPalette(p);
m_view.errorLabel->setHidden(true);
connect(m_view.export_audio, SIGNAL(stateChanged(int)), this, SLOT(slotUpdateAudioLabel(int)));
m_view.export_audio->setCheckState(Qt::PartiallyChecked);
parseProfiles();
parseScriptFiles();
......@@ -748,7 +752,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const
else if (m_view.scanning_list->currentIndex() == 2) renderArgs.append(" progressive=0");
// disable audio if requested
if (!m_view.export_audio->isChecked())
if (m_view.export_audio->checkState() == Qt::Unchecked || (m_view.export_audio->checkState() == Qt::PartiallyChecked && !m_autoAudio))
renderArgs.append(" an=1 ");
// Check if the rendering profile is different from project profile,
......@@ -1787,9 +1791,10 @@ void RenderWidget::missingClips(bool hasMissing)
} else m_view.errorLabel->setHidden(true);
}
void RenderWidget::enableAudio(bool enable)
void RenderWidget::slotEnableAudio(bool enable)
{
m_view.export_audio->setChecked(enable);
m_autoAudio = enable;
if (m_view.export_audio->checkState() == Qt::PartiallyChecked) m_view.export_audio->setText(m_autoAudio ? i18n("Export audio (on)") : i18n("Export audio (off)"));
}
void RenderWidget::slotUpdateRescaleWidth(int val)
......@@ -1818,3 +1823,10 @@ void RenderWidget::slotSwitchAspectRatio()
if (m_view.rescale_keep->isChecked()) slotUpdateRescaleWidth(m_view.rescale_width->value());
}
void RenderWidget::slotUpdateAudioLabel(int ix)
{
if (ix == Qt::PartiallyChecked)
m_view.export_audio->setText(m_autoAudio ? i18n("Export audio (on)") : i18n("Export audio (off)"));
else
m_view.export_audio->setText(i18n("Audio export"));
}
\ No newline at end of file
......@@ -113,10 +113,11 @@ public:
QString getFreeScriptName(const QString &prefix = QString());
bool startWaitingRenderJobs();
void missingClips(bool hasMissing);
void enableAudio(bool enable);
public slots:
void slotExport(bool scriptExport, int zoneIn, int zoneOut, const QString &playlistPath, const QString &scriptPath);
/** @brief Enable / disable audio export if audio export checkbox is in auto mode. */
void slotEnableAudio(bool enable);
private slots:
void slotUpdateButtons(KUrl url);
......@@ -150,6 +151,8 @@ private slots:
void slotUpdateRescaleHeight(int);
void slotUpdateRescaleWidth(int);
void slotSwitchAspectRatio();
/** @brief Update export audio label depending on current settings. */
void slotUpdateAudioLabel(int ix);
private:
Ui::RenderWidget_UI m_view;
......@@ -168,6 +171,8 @@ private:
void saveProfile(QDomElement newprofile);
QList <QListWidgetItem *> m_renderItems;
QList <QListWidgetItem *> m_renderCategory;
/** @brief True if current project has audio, false otherwise. */
bool m_autoAudio;
signals:
void abortProcess(const QString &url);
......
......@@ -117,6 +117,7 @@ TrackView::TrackView(KdenliveDoc *doc, bool *ok, QWidget *parent) :
slotChangeZoom(m_doc->zoom().x(), m_doc->zoom().y());
slotSetZone(m_doc->zone());
connect(m_trackview, SIGNAL(documentModified()), this, SLOT(slotCheckProjectAudio()));
}
TrackView::~TrackView()
......@@ -147,6 +148,21 @@ int TrackView::tracksNumber() const
return m_projectTracks - 1;
}
void TrackView::slotCheckProjectAudio()
{
bool hasAudio = false;
const QList <TrackInfo> list = m_doc->tracksList();
int max = list.count();
for (int i = 0; i < max; i++) {
TrackInfo info = list.at(max - i - 1);
if (!info.isMute && m_trackview->hasAudio(i)) {
hasAudio = true;
break;
}
}
emit projectHasAudio(hasAudio);
}
int TrackView::inPoint() const
{
return m_ruler->inPoint();
......@@ -436,6 +452,7 @@ void TrackView::parseDocument(QDomDocument doc)
else
KMessageBox::information(this, i18n("Your project file was upgraded to the latest Kdenlive document version, but it was not possible to create a backup copy.", backupFile));
}
slotCheckProjectAudio();
//m_trackview->setCursorPos(cursorPos);
//m_scrollBox->setGeometry(0, 0, 300 * zoomFactor(), m_scrollArea->height());
}
......
......@@ -63,12 +63,13 @@ public:
int outPoint() const;
int inPoint() const;
int fitZoom() const;
/** @brief Updates (redraws) the ruler.
*
* Used to change from displaying frames to timecode or vice versa. */
void updateRuler();
protected:
virtual void keyPressEvent(QKeyEvent * event);
......@@ -119,6 +120,11 @@ private slots:
* of the vertical scrollbar is maximal */
void slotUpdateVerticalScroll(int min, int max);
/** @brief Parse tracks to see if project has audio in it.
*
* Parses all tracks to check if there is audio data. */
void slotCheckProjectAudio();
signals:
void mousePosition(int);
void cursorMoved();
......@@ -128,6 +134,8 @@ signals:
void configTrack(int);
void updateTracksInfo();
void setZoom(int);
/** @brief Inform render widget if our project has audio */
void projectHasAudio(bool);
};
#endif
......@@ -6,33 +6,33 @@
<rect>
<x>0</x>
<y>0</y>
<width>338</width>
<height>359</height>
<width>298</width>
<height>220</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="6">
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_openlastproject">
<property name="text">
<string>Open last project on startup</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="6">
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_crashrecovery">
<property name="text">
<string>Crash recovery (automatic backup)</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="6">
<item row="2" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_activatetabs">
<property name="text">
<string>Open projects in new tabs</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="6">
<item row="5" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Default Durations</string>
......@@ -83,120 +83,7 @@
</layout>
</widget>
</item>
<item row="6" column="0" colspan="6">
<widget class="QGroupBox" name="properties">
<property name="title">
<string>Default Profile</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Profile</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="kcfg_profiles_list"/>
</item>
<item row="1" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Size:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="p_size">
<property name="text">
<string>720x576</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Frame rate:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="p_fps">
<property name="text">
<string>25/1</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Aspect ratio:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="p_aspect">
<property name="text">
<string>59/54</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Display ratio:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="p_display">
<property name="text">
<string>4/3</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="p_progressive">
<property name="text">
<string>Interlaced</string>
</property>
</widget>
</item>