Commit 7559f08a authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Merge branch '2008'

parents 78e4acad c0959b53
......@@ -306,8 +306,8 @@ Action=Sound
Name=Ready to capture
Name[ar]=جاهز للالتقاط
Name[bs]=Spreman za hvatanje
Name[ca]=A punt per capturar
Name[ca@valencia]=A punt per capturar
Name[ca]=A punt per a capturar
Name[ca@valencia]=A punt per a capturar
Name[cs]=Připraven zachytávat
Name[da]=Klar til at indfange
Name[de]=Bereit zur Aufnahme
......
......@@ -276,8 +276,8 @@
<screenshots>
<screenshot type="default">
<caption>Kdenlive Timeline</caption>
<caption xml:lang="ca">Línia del temps del Kdenlive</caption>
<caption xml:lang="ca-valencia">Línia del temps del Kdenlive</caption>
<caption xml:lang="ca">Línia de temps del Kdenlive</caption>
<caption xml:lang="ca-valencia">Línia de temps del Kdenlive</caption>
<caption xml:lang="cs">Časová osa Kdenlive</caption>
<caption xml:lang="da">Kdenlive tidslinje</caption>
<caption xml:lang="de">Kdenlive-Zeitleiste</caption>
......
......@@ -102,7 +102,7 @@ const QString &AbstractProjectItem::clipId() const
QPixmap AbstractProjectItem::roundedPixmap(const QPixmap &source)
{
QPixmap pix(source.size());
pix.fill(Qt::transparent);
pix.fill(QColor(0, 0, 0, 100));
QPainter p(&pix);
p.setRenderHint(QPainter::Antialiasing, true);
QPainterPath path;
......
......@@ -88,8 +88,14 @@ QString ClipCreator::createColorClip(const QString &color, int duration, const Q
QDomDocument ClipCreator::getXmlFromUrl(const QString &path)
{
QDomDocument xml;
QUrl fileUrl = QUrl::fromLocalFile(path);
if (fileUrl.matches(pCore->currentDoc()->url(), QUrl::RemoveScheme | QUrl::NormalizePathSegments)) {
// Cannot embed a project in itself
KMessageBox::sorry(QApplication::activeWindow(), i18n("You cannot add a project inside itself."), i18n("Cannot create clip"));
return xml;
}
QMimeDatabase db;
QMimeType type = db.mimeTypeForUrl(QUrl::fromLocalFile(path));
QMimeType type = db.mimeTypeForUrl(fileUrl);
QDomElement prod;
qDebug()<<"=== GOT DROPPPED MIME: "<<type.name();
......
......@@ -361,7 +361,7 @@ bool MltDeviceCapture::slotStartCapture(const QString &params, const QString &pa
auto *renderProps = new Mlt::Properties;
renderProps->set("mlt_service", "avformat");
renderProps->set("target", path.toUtf8().constData());
renderProps->set("real_time", -KdenliveSettings::mltthreads());
renderProps->set("real_time", -1);
renderProps->set("terminate_on_pause", 0); // was commented out. restoring it fixes mantis#3415 - FFmpeg recording freezes
// without this line a call to mlt_properties_get_int(terminate on pause) for in mlt/src/modules/core/consumer_multi.c is returning 1
// and going into and endless loop.
......
......@@ -23,6 +23,9 @@
#include "dialogs/profilesdialog.h"
#include "encodingprofilesdialog.h"
#include "kdenlivesettings.h"
#include "mainwindow.h"
#include "timeline2/view/timelinewidget.h"
#include "timeline2/view/timelinecontroller.h"
#include "profiles/profilemodel.hpp"
#include "profiles/profilerepository.hpp"
#include "profilesdialog.h"
......@@ -122,8 +125,6 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QMap<QString, QString> mappable_a
m_configEnv.ffmpegurl->lineEdit()->setObjectName(QStringLiteral("kcfg_ffmpegpath"));
m_configEnv.ffplayurl->lineEdit()->setObjectName(QStringLiteral("kcfg_ffplaypath"));
m_configEnv.ffprobeurl->lineEdit()->setObjectName(QStringLiteral("kcfg_ffprobepath"));
int maxThreads = QThread::idealThreadCount();
m_configEnv.kcfg_mltthreads->setMaximum(maxThreads > 2 ? maxThreads : 8);
m_configEnv.tmppathurl->setMode(KFile::Directory);
m_configEnv.tmppathurl->lineEdit()->setObjectName(QStringLiteral("kcfg_currenttmpfolder"));
m_configEnv.capturefolderurl->setMode(KFile::Directory);
......@@ -145,6 +146,11 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QMap<QString, QString> mappable_a
m_page2 = addPage(p2, i18n("Environment"));
m_page2->setIcon(QIcon::fromTheme(QStringLiteral("application-x-executable-script")));
QWidget *p10 = new QWidget;
m_configColors.setupUi(p10);
m_page10 = addPage(p10, i18n("Colors"));
m_page10->setIcon(QIcon::fromTheme(QStringLiteral("color-management")));
QWidget *p4 = new QWidget;
m_configCapture.setupUi(p4);
// Remove ffmpeg tab, unused
......@@ -220,7 +226,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QMap<QString, QString> mappable_a
m_configShuttle.kcfg_enableshuttle->setDisabled(true);
#endif /* USE_JOGSHUTTLE */
m_page5 = addPage(p5, i18n("JogShuttle"));
m_page5->setIcon(QIcon::fromTheme(QStringLiteral("jog-dial")));
m_page5->setIcon(QIcon::fromTheme(QStringLiteral("dialog-input-devices")));
QWidget *p6 = new QWidget;
m_configSdl.setupUi(p6);
......@@ -994,6 +1000,12 @@ void KdenliveSettingsDialog::updateSettings()
KdenliveSettings::setWindow_background(m_configSdl.kcfg_window_background->color());
emit updateMonitorBg();
}
if (m_configColors.kcfg_thumbColor1->color() != KdenliveSettings::thumbColor1() || m_configColors.kcfg_thumbColor2->color() != KdenliveSettings::thumbColor2()) {
KdenliveSettings::setThumbColor1(m_configColors.kcfg_thumbColor1->color());
KdenliveSettings::setThumbColor2(m_configColors.kcfg_thumbColor2->color());
pCore->window()->getMainTimeline()->controller()->colorsChanged();
}
if (m_configSdl.kcfg_volume->value() != KdenliveSettings::volume()) {
KdenliveSettings::setVolume(m_configSdl.kcfg_volume->value());
......
......@@ -33,6 +33,7 @@
#include "ui_configsdl_ui.h"
#include "ui_configtimeline_ui.h"
#include "ui_configtranscode_ui.h"
#include "ui_configcolors_ui.h"
class ProfileWidget;
......@@ -97,8 +98,10 @@ private:
KPageWidgetItem *m_page6;
KPageWidgetItem *m_page7;
KPageWidgetItem *m_page8;
KPageWidgetItem *m_page10;
Ui::ConfigEnv_UI m_configEnv;
Ui::ConfigMisc_UI m_configMisc;
Ui::ConfigColors_UI m_configColors;
Ui::ConfigTimeline_UI m_configTimeline;
Ui::ConfigCapture_UI m_configCapture;
Ui::ConfigJogShuttle_UI m_configShuttle;
......
......@@ -125,13 +125,12 @@ bool AudioThumbJob::computeWithFFMPEG()
int audioStreamIndex = m_binClip->getAudioStreamFfmpegIndex(m_audioStream);
if (!QFile::exists(thumbPath)) {
// Generate thumbnail used in monitor overlay
QStringList args;
args << QStringLiteral("-hide_banner") << QStringLiteral("-y")<< QStringLiteral("-i") << QUrl::fromLocalFile(filePath).toLocalFile() << QString("-filter_complex");
QStringList args = {QStringLiteral("-hide_banner"), QStringLiteral("-y"), QStringLiteral("-i"), QUrl::fromLocalFile(filePath).toLocalFile(), QString("-filter_complex")};
if (m_audioStream >= 0) {
args << QString("[a:%1]showwavespic=s=%2x%3:split_channels=1:scale=cbrt:colors=0xffdddd|0xddffdd").arg(audioStreamIndex).arg(m_thumbSize.width()).arg(m_thumbSize.height());
args << QString("[a:%1]showwavespic=s=%2x%3:split_channels=1:scale=cbrt:colors=%4|%5").arg(audioStreamIndex).arg(m_thumbSize.width()).arg(m_thumbSize.height()).arg(KdenliveSettings::thumbColor1().name()).arg(KdenliveSettings::thumbColor2().name());
} else {
// Only 1 audio stream in clip
args << QString("[a]showwavespic=s=%2x%3:split_channels=1:scale=cbrt:colors=0xffdddd|0xddffdd").arg(m_thumbSize.width()).arg(m_thumbSize.height());
args << QString("[a]showwavespic=s=%2x%3:split_channels=1:scale=cbrt:colors=%4|%5").arg(m_thumbSize.width()).arg(m_thumbSize.height()).arg(KdenliveSettings::thumbColor1().name()).arg(KdenliveSettings::thumbColor2().name());
}
args << QStringLiteral("-frames:v") << QStringLiteral("1");
args << thumbPath;
......
......@@ -146,7 +146,7 @@ bool MeltJob::startJob()
}
/*
if (!m_consumerParams.contains(QStringLiteral("real_time"))) {
m_consumer->set("real_time", -KdenliveSettings::mltthreads());
m_consumer->set("real_time", -1);
}
*/
......
......@@ -54,7 +54,7 @@ void SceneSplitJob::configureConsumer()
m_consumer = std::make_unique<Mlt::Consumer>(*m_profile.get(), "null");
m_consumer->set("all", 1);
m_consumer->set("terminate_on_pause", 1);
m_consumer->set("real_time", -KdenliveSettings::mltthreads());
m_consumer->set("real_time", -1);
// We just want to find scene change, set all methods to the fastests
m_consumer->set("rescale", "nearest");
m_consumer->set("deinterlace_method", "onefield");
......
......@@ -62,7 +62,7 @@ void SpeedJob::configureConsumer()
m_consumer = std::make_unique<Mlt::Consumer>(*m_profile.get(), "xml", m_destUrl.toUtf8().constData());
m_consumer->set("terminate_on_pause", 1);
m_consumer->set("title", "Speed Change");
m_consumer->set("real_time", -KdenliveSettings::mltthreads());
m_consumer->set("real_time", -1);
}
void SpeedJob::configureProducer()
......
......@@ -53,7 +53,7 @@ void StabilizeJob::configureConsumer()
m_consumer = std::make_unique<Mlt::Consumer>(*m_profile.get(), "xml", m_destUrl.toUtf8().constData());
m_consumer->set("all", 1);
m_consumer->set("title", "Stabilized");
m_consumer->set("real_time", -KdenliveSettings::mltthreads());
m_consumer->set("real_time", -1);
}
void StabilizeJob::configureFilter()
......
......@@ -880,6 +880,17 @@
<label>Color to preselect in the color clip dialog.</label>
<default>#000000</default>
</entry>
<entry name="thumbColor1" type="Color">
<label>Color to draw even audio channels.</label>
<default>#2ac1a0</default>
</entry>
<entry name="thumbColor2" type="Color">
<label>Color to draw odd audio channels.</label>
<default>#2ed172</default>
</entry>
<entry name="rescalekeepratio" type="Bool">
<label>Keep aspect ratio in render dialog rescale widget.</label>
......
......@@ -1517,7 +1517,7 @@ void MainWindow::setupActions()
editClipMarker->setObjectName(QStringLiteral("edit_marker"));
editClipMarker->setData('P');
QAction *splitAudio = addAction(QStringLiteral("clip_split"), i18n("Split Audio"), this, SLOT(slotSplitAV()),
QAction *splitAudio = addAction(QStringLiteral("clip_split"), i18n("Restore Audio"), this, SLOT(slotSplitAV()),
QIcon::fromTheme(QStringLiteral("document-new")), QKeySequence(), clipActionCategory);
// "S" will be handled specifically to change the action name depending on current selection
splitAudio->setData('S');
......@@ -1573,11 +1573,11 @@ void MainWindow::setupActions()
QIcon::fromTheme(QStringLiteral("edit-delete")), Qt::Key_Delete);
QAction *resizeStart = new QAction(QIcon(), i18n("Resize Item Start"), this);
addAction(QStringLiteral("resize_timeline_clip_start"), resizeStart, Qt::Key_1);
addAction(QStringLiteral("resize_timeline_clip_start"), resizeStart, QKeySequence(Qt::CTRL + Qt::Key_1));
connect(resizeStart, &QAction::triggered, this, &MainWindow::slotResizeItemStart);
QAction *resizeEnd = new QAction(QIcon(), i18n("Resize Item End"), this);
addAction(QStringLiteral("resize_timeline_clip_end"), resizeEnd, Qt::Key_2);
addAction(QStringLiteral("resize_timeline_clip_end"), resizeEnd, QKeySequence(Qt::CTRL + Qt::Key_2));
connect(resizeEnd, &QAction::triggered, this, &MainWindow::slotResizeItemEnd);
QAction *pasteEffects = addAction(QStringLiteral("paste_effects"), i18n("Paste Effects"), this, SLOT(slotPasteEffects()),
......@@ -1734,6 +1734,24 @@ void MainWindow::setupActions()
addAction(QStringLiteral("restore_all_sources"), i18n("Restore Current Clip Target Tracks"), pCore->projectManager(), SLOT(slotRestoreTargetTracks()));
addAction(QStringLiteral("add_project_note"), i18n("Add Project Note"), pCore->projectManager(), SLOT(slotAddProjectNote()),
QIcon::fromTheme(QStringLiteral("bookmark-new")));
// Build activate track shortcut sequences
QList <int> keysequence{Qt::Key_1, Qt::Key_2, Qt::Key_3, Qt::Key_4, Qt::Key_5, Qt::Key_6, Qt::Key_7, Qt::Key_8, Qt::Key_9};
for (int i = 1; i < 10; i++) {
QAction *ac = new QAction(QIcon(), i18n("Select Audio Track %1", i), this);
ac->setData(i - 1);
connect(ac, &QAction::triggered, this, &MainWindow::slotActivateAudioTrackSequence);
addAction(QString("activate_audio_%1").arg(i), ac, QKeySequence(Qt::ALT + keysequence[i-1]), timelineActions);
QAction *ac2 = new QAction(QIcon(), i18n("Select Video Track %1", i), this);
ac2->setData(i - 1);
connect(ac2, &QAction::triggered, this, &MainWindow::slotActivateVideoTrackSequence);
addAction(QString("activate_video_%1").arg(i), ac2, QKeySequence(keysequence[i-1]), timelineActions);
QAction *ac3 = new QAction(QIcon(), i18n("Select Target %1", i), this);
ac2->setData(i - 1);
connect(ac3, &QAction::triggered, this, &MainWindow::slotActivateTarget);
addAction(QString("activate_target_%1").arg(i), ac3, QKeySequence(Qt::Key_Q, keysequence[i-1]), timelineActions);
}
pCore->bin()->setupMenu();
......@@ -4071,6 +4089,30 @@ bool MainWindow::timelineVisible() const
return !centralWidget()->isHidden();
}
void MainWindow::slotActivateAudioTrackSequence()
{
auto *action = qobject_cast<QAction *>(sender());
const QList<int> trackIds = getMainTimeline()->controller()->getModel()->getTracksIds(true);
int trackPos = qBound(0, action->data().toInt(), trackIds.count() - 1);
int tid = trackIds.at(trackPos);
getCurrentTimeline()->controller()->setActiveTrack(tid);
}
void MainWindow::slotActivateVideoTrackSequence()
{
auto *action = qobject_cast<QAction *>(sender());
const QList<int> trackIds = getMainTimeline()->controller()->getModel()->getTracksIds(false);
int trackPos = qBound(0, action->data().toInt(), trackIds.count() - 1);
int tid = trackIds.at(trackIds.count() - 1 - trackPos);
getCurrentTimeline()->controller()->setActiveTrack(tid);
}
void MainWindow::slotActivateTarget()
{
auto *action = qobject_cast<QAction *>(sender());
const QList<int> trackIds = getMainTimeline()->controller()->getModel()->getTracksIds(false);
getCurrentTimeline()->controller()->assignCurrentTarget(action->data().toInt());
}
#ifdef DEBUG_MAINW
#undef DEBUG_MAINW
......
......@@ -490,6 +490,12 @@ private slots:
void slotSaveZoneToBin();
/** @brief Expand current timeline clip (recover clips and tracks from an MLT playlist) */
void slotExpandClip();
/** @brief Focus and activate an audio track from a shortcut sequence */
void slotActivateAudioTrackSequence();
/** @brief Focus and activate a video track from a shortcut sequence */
void slotActivateVideoTrackSequence();
/** @brief Select target for current track */
void slotActivateTarget();
signals:
Q_SCRIPTABLE void abortRenderJob(const QString &url);
......
......@@ -1135,7 +1135,7 @@ int GLWidget::reconfigure()
// m_producer->set_speed(0.0);
}
int dropFrames = realTime();
int dropFrames = 1;
if (!KdenliveSettings::monitor_dropframes()) {
dropFrames = -dropFrames;
}
......@@ -1332,15 +1332,6 @@ void GLWidget::setOffsetY(int y, int max)
update();
}
int GLWidget::realTime() const
{
// C & D
if (m_glslManager) {
return 1;
}
return KdenliveSettings::mltthreads();
}
std::shared_ptr<Mlt::Consumer> GLWidget::consumer()
{
return m_consumer;
......@@ -1778,7 +1769,7 @@ void GLWidget::setDropFrames(bool drop)
// why this lock?
QMutexLocker locker(&m_mltMutex);
if (m_consumer) {
int dropFrames = realTime();
int dropFrames = 1;
if (!drop) {
dropFrames = -dropFrames;
}
......
......@@ -112,7 +112,6 @@ public:
void resetConsumer(bool fullReset);
void lockMonitor();
void releaseMonitor();
int realTime() const;
int droppedFrames() const;
void resetDrops();
bool checkFrameNumber(int pos, int offset, bool isPlaying);
......
......@@ -647,8 +647,10 @@ void MonitorManager::updateBgColor()
{
if (m_projectMonitor) {
m_projectMonitor->updateBgColor();
m_projectMonitor->forceMonitorRefresh();
}
if (m_clipMonitor) {
m_clipMonitor->updateBgColor();
m_clipMonitor->forceMonitorRefresh();
}
}
......@@ -239,7 +239,7 @@ Item {
NumberAnimation { property: "opacity"; duration: audioThumb.isAudioClip ? 0 : 500}
} ]
Rectangle {
color: activePalette.dark
color: "black"
opacity: audioThumb.isAudioClip || root.permanentAudiothumb ? 1 : 0.6
anchors.fill: parent
}
......
......@@ -765,11 +765,19 @@ bool TimelineFunctions::requestSplitAudio(const std::shared_ptr<TimelineItemMode
}
int position = timeline->getClipPosition(cid);
int track = timeline->getClipTrackId(cid);
QList<int> possibleTracks = audioTarget >= 0 ? QList<int>() << audioTarget : timeline->getLowerTracksId(track, TrackType::AudioTrack);
QList<int> possibleTracks;
if (audioTarget >= 0) {
possibleTracks = {audioTarget};
} else {
int mirror = timeline->getMirrorAudioTrackId(track);
if (mirror > -1) {
possibleTracks = {mirror};
}
}
if (possibleTracks.isEmpty()) {
// No available audio track for splitting, abort
undo();
pCore->displayMessage(i18n("No available audio track for split operation"), ErrorMessage);
pCore->displayMessage(i18n("No available audio track for restore operation"), ErrorMessage);
return false;
}
int newId;
......@@ -777,7 +785,7 @@ bool TimelineFunctions::requestSplitAudio(const std::shared_ptr<TimelineItemMode
if (!res) {
bool undone = undo();
Q_ASSERT(undone);
pCore->displayMessage(i18n("Audio split failed"), ErrorMessage);
pCore->displayMessage(i18n("Audio restore failed"), ErrorMessage);
return false;
}
bool success = false;
......@@ -790,14 +798,14 @@ bool TimelineFunctions::requestSplitAudio(const std::shared_ptr<TimelineItemMode
if (!success) {
bool undone = undo();
Q_ASSERT(undone);
pCore->displayMessage(i18n("Audio split failed"), ErrorMessage);
pCore->displayMessage(i18n("Audio restore failed"), ErrorMessage);
return false;
}
done = true;
}
if (done) {
timeline->requestSetSelection(clips, undo, redo);
pCore->pushUndo(undo, redo, i18n("Split Audio"));
pCore->pushUndo(undo, redo, i18n("Restore Audio"));
}
return done;
}
......@@ -816,11 +824,20 @@ bool TimelineFunctions::requestSplitVideo(const std::shared_ptr<TimelineItemMode
continue;
}
int position = timeline->getClipPosition(cid);
QList<int> possibleTracks = QList<int>() << videoTarget;
int track = timeline->getClipTrackId(cid);
QList<int> possibleTracks;
if (videoTarget >= 0) {
possibleTracks = {videoTarget};
} else {
int mirror = timeline->getMirrorVideoTrackId(track);
if (mirror > -1) {
possibleTracks = {mirror};
}
}
if (possibleTracks.isEmpty()) {
// No available audio track for splitting, abort
undo();
pCore->displayMessage(i18n("No available video track for split operation"), ErrorMessage);
pCore->displayMessage(i18n("No available video track for restore operation"), ErrorMessage);
return false;
}
int newId;
......@@ -828,7 +845,7 @@ bool TimelineFunctions::requestSplitVideo(const std::shared_ptr<TimelineItemMode
if (!res) {
bool undone = undo();
Q_ASSERT(undone);
pCore->displayMessage(i18n("Video split failed"), ErrorMessage);
pCore->displayMessage(i18n("Video restore failed"), ErrorMessage);
return false;
}
bool success = false;
......@@ -841,13 +858,13 @@ bool TimelineFunctions::requestSplitVideo(const std::shared_ptr<TimelineItemMode
if (!success) {
bool undone = undo();
Q_ASSERT(undone);
pCore->displayMessage(i18n("Video split failed"), ErrorMessage);
pCore->displayMessage(i18n("Video restore failed"), ErrorMessage);
return false;
}
done = true;
}
if (done) {
pCore->pushUndo(undo, redo, i18n("Split Video"));
pCore->pushUndo(undo, redo, i18n("Restore Video"));
}
return done;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment