Commit e3fbbac6 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Merge branch '2004'

parents b5d66ab6 2824c27d
Pipeline #17061 passed with stage
in 14 minutes and 38 seconds
......@@ -83,7 +83,7 @@ void MixerManager::registerTrack(int tid, std::shared_ptr<Mlt::Tractor> service,
// Track already registered
return;
}
std::shared_ptr<MixerWidget> mixer(new MixerWidget(m_mixers.size(), tid, service, trackTag, this));
std::shared_ptr<MixerWidget> mixer(new MixerWidget(m_mixers.size() % 2 == 0, tid, service, trackTag, this));
connect(mixer.get(), &MixerWidget::muteTrack, [&](int id, bool mute) {
m_model->setTrackProperty(id, "hide", mute ? QStringLiteral("1") : QStringLiteral("3"));
});
......@@ -163,7 +163,7 @@ void MixerManager::setModel(std::shared_ptr<TimelineItemModel> model)
// delete previous master mixer
m_masterBox->removeWidget(m_masterMixer.get());
}
m_masterMixer.reset(new MixerWidget(m_mixers.size(), -1, service, i18n("Master"), this));
m_masterMixer.reset(new MixerWidget(m_mixers.size() % 2 == 0, -1, service, i18n("Master"), this));
connect(m_masterMixer.get(), &MixerWidget::muteTrack, [&](int /*id*/, bool mute) {
m_model->tractor()->set("hide", mute ? 3 : 1);
});
......
......@@ -94,7 +94,7 @@ void MixerWidget::property_changed( mlt_service , MixerWidget *widget, char *nam
}
}
MixerWidget::MixerWidget(int ix, int tid, std::shared_ptr<Mlt::Tractor> service, const QString &trackTag, MixerManager *parent)
MixerWidget::MixerWidget(bool alternateBackground, int tid, std::shared_ptr<Mlt::Tractor> service, const QString &trackTag, MixerManager *parent)
: QWidget(parent)
, m_manager(parent)
, m_tid(tid)
......@@ -109,10 +109,10 @@ MixerWidget::MixerWidget(int ix, int tid, std::shared_ptr<Mlt::Tractor> service,
, m_listener(nullptr)
, m_recording(false)
{
buildUI(ix, service.get(), trackTag);
buildUI(alternateBackground, service.get(), trackTag);
}
MixerWidget::MixerWidget(int ix, int tid, Mlt::Tractor *service, const QString &trackTag, MixerManager *parent)
MixerWidget::MixerWidget(bool alternateBackground, int tid, Mlt::Tractor *service, const QString &trackTag, MixerManager *parent)
: QWidget(parent)
, m_manager(parent)
, m_tid(tid)
......@@ -127,7 +127,7 @@ MixerWidget::MixerWidget(int ix, int tid, Mlt::Tractor *service, const QString &
, m_listener(nullptr)
, m_recording(false)
{
buildUI(ix, service, trackTag);
buildUI(alternateBackground, service, trackTag);
}
MixerWidget::~MixerWidget()
......@@ -137,7 +137,7 @@ MixerWidget::~MixerWidget()
}
}
void MixerWidget::buildUI(int ix, Mlt::Tractor *service, const QString &trackTag)
void MixerWidget::buildUI(bool alternateBackground, Mlt::Tractor *service, const QString &trackTag)
{
setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
// Build audio meter widget
......@@ -145,7 +145,7 @@ void MixerWidget::buildUI(int ix, Mlt::Tractor *service, const QString &trackTag
// initialize for stereo display
m_audioMeterWidget->setAudioValues({-100, -100});
setAutoFillBackground(true);
setBackgroundRole(ix %2 == 0 ? QPalette::AlternateBase : QPalette::Base);
setBackgroundRole(alternateBackground ? QPalette::AlternateBase : QPalette::Base);
// Build volume widget
m_volumeSlider = new QSlider(Qt::Vertical, this);
......
......@@ -50,10 +50,10 @@ class MixerWidget : public QWidget
Q_OBJECT
public:
MixerWidget(int ix, int tid, std::shared_ptr<Mlt::Tractor> service, const QString &trackTag, MixerManager *parent = nullptr);
MixerWidget(int ix, int tid, Mlt::Tractor *service, const QString &trackTag, MixerManager *parent = nullptr);
MixerWidget(bool alternateBackground, int tid, std::shared_ptr<Mlt::Tractor> service, const QString &trackTag, MixerManager *parent = nullptr);
MixerWidget(bool alternateBackground, int tid, Mlt::Tractor *service, const QString &trackTag, MixerManager *parent = nullptr);
virtual ~MixerWidget();
void buildUI(int ix, Mlt::Tractor *service, const QString &trackTag);
void buildUI(bool alternateBackground, Mlt::Tractor *service, const QString &trackTag);
/** @brief discard stored audio values and reset vu-meter to 0 if requested */
void reset();
/** @brief discard stored audio values */
......
......@@ -87,6 +87,16 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QMap<QString, QString> mappable_a
m_page8->setIcon(QIcon::fromTheme(QStringLiteral("project-defaults")));
m_configProject.projecturl->setMode(KFile::Directory);
m_configProject.projecturl->setUrl(QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder()));
connect(m_configProject.kcfg_videotracks, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this]() {
if (m_configProject.kcfg_videotracks->value() + m_configProject.kcfg_audiotracks->value() <= 0) {
m_configProject.kcfg_videotracks->setValue(1);
}
});
connect(m_configProject.kcfg_audiotracks, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this] () {
if (m_configProject.kcfg_videotracks->value() + m_configProject.kcfg_audiotracks->value() <= 0) {
m_configProject.kcfg_audiotracks->setValue(1);
}
});
QWidget *p9 = new QWidget;
m_configProxy.setupUi(p9);
......
......@@ -92,6 +92,16 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap<QString, QString> metada
connect(generate_imageproxy, &QAbstractButton::toggled, proxy_imageminsize, &QWidget::setEnabled);
connect(generate_imageproxy, &QAbstractButton::toggled, image_label, &QWidget::setEnabled);
connect(generate_imageproxy, &QAbstractButton::toggled, proxy_imagesize, &QWidget::setEnabled);
connect(video_tracks, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this]() {
if (video_tracks->value() + audio_tracks->value() <= 0) {
video_tracks->setValue(1);
}
});
connect(audio_tracks, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this] () {
if (video_tracks->value() + audio_tracks->value() <= 0) {
audio_tracks->setValue(1);
}
});
QString currentProf;
if (doc) {
......
......@@ -32,7 +32,7 @@ TrackDialog::TrackDialog(const std::shared_ptr<TimelineItemModel> &model, int tr
setWindowTitle(deleteMode ? i18n("Delete Track") : i18n("Add Track"));
// setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
setupUi(this);
if (m_model->isAudioTrack(m_trackIndex)) {
if (m_trackIndex > -1 && m_model->isAudioTrack(m_trackIndex)) {
audio_track->setChecked(true);
before_select->setCurrentIndex(1);
}
......
This diff is collapsed.
......@@ -63,7 +63,7 @@ TimelineController::TimelineController(QObject *parent)
: QObject(parent)
, m_root(nullptr)
, m_usePreview(false)
, m_activeTrack(0)
, m_activeTrack(-1)
, m_audioRef(-1)
, m_zone(-1, -1)
, m_scale(QFontMetrics(QApplication::font()).maxWidth() / 250)
......
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