Commit f7ec683f authored by Vincent Pinon's avatar Vincent Pinon

Fix compile warnings

parent e3c2a8c8
......@@ -170,7 +170,6 @@ bool KeyframeModel::moveKeyframe(GenTime oldPos, GenTime pos, QVariant newVal, F
if (m_paramType == ParamType::AnimatedRect) {
return updateKeyframe(pos, newVal);
}
double realValue = newVal.toDouble();
// Calculate real value from normalized
QVariant result = getNormalizedValue(newVal.toDouble());
return updateKeyframe(pos, result);
......
......@@ -53,6 +53,7 @@ AudioLevelWidget::~AudioLevelWidget()
void AudioLevelWidget::resizeEvent(QResizeEvent *event)
{
Q_UNUSED(event)
drawBackground(m_peaks.size());
}
......
......@@ -120,7 +120,7 @@ void MixerManager::registerTrack(int tid, std::shared_ptr<Mlt::Tractor> service,
});
m_mixers[tid] = mixer;
m_channelsLayout->insertWidget(0, mixer.get());
m_recommandedWidth = mixer->minimumWidth() * (m_mixers.size() + 1);
m_recommandedWidth = mixer->minimumWidth() * (int(m_mixers.size()) + 1);
}
void MixerManager::deregisterTrack(int tid)
......
......@@ -105,6 +105,7 @@ void MediaCapture::recordAudio(int tid, bool record)
void MediaCapture::recordVideo(int tid, bool record)
{
// TO DO - fix video capture
Q_UNUSED(tid)
if (!m_videoRecorder) {
QList<QCameraInfo> availableCameras = QCameraInfo::availableCameras();
foreach (const QCameraInfo &cameraInfo, availableCameras) {
......
......@@ -136,6 +136,7 @@ void RenderJobItem::setStatus(int status)
setData(1, Qt::UserRole, i18n("Rendering aborted"));
setIcon(0, QIcon::fromTheme(QStringLiteral("dialog-cancel")));
setData(1, ProgressRole, 100);
break;
default:
break;
}
......@@ -1079,7 +1080,7 @@ void RenderWidget::focusFirstVisibleItem(const QString &profile)
void RenderWidget::slotPrepareExport(bool delayedRendering, const QString &scriptPath)
{
Q_UNUSED(scriptPath);
Q_UNUSED(scriptPath)
if (pCore->projectDuration() < 2) {
// Empty project, don't attempt to render
return;
......@@ -1345,44 +1346,15 @@ void RenderWidget::generateRenderFiles(QDomDocument doc, const QString &playlist
doc.documentElement().insertAfter(consumer, profiles.at(profiles.length() - 1));
}
// Check for fps change
double forcedfps = 0;
if (renderArgs.startsWith(QLatin1String("r="))) {
QString sub = renderArgs.section(QLatin1Char(' '), 0, 0).toLower();
sub = sub.section(QLatin1Char('='), 1, 1);
forcedfps = sub.toDouble();
} else if (renderArgs.contains(QStringLiteral(" r="))) {
QString sub = renderArgs.section(QStringLiteral(" r="), 1, 1);
sub = sub.section(QLatin1Char(' '), 0, 0).toLower();
forcedfps = sub.toDouble();
} else if (renderArgs.contains(QStringLiteral("mlt_profile="))) {
QString sub = renderArgs.section(QStringLiteral("mlt_profile="), 1, 1);
sub = sub.section(QLatin1Char(' '), 0, 0).toLower();
forcedfps = ProfileRepository::get()->getProfile(sub)->fps();
}
bool resizeProfile = false;
std::unique_ptr<ProfileModel> &profile = pCore->getCurrentProfile();
if (renderArgs.contains(QLatin1String("%dv_standard"))) {
QString dvstd;
if (fmod((double)profile->frame_rate_num() / profile->frame_rate_den(), 30.01) > 27) {
if (fmod(double(profile->frame_rate_num() / profile->frame_rate_den()), 30.01) > 27) {
dvstd = QStringLiteral("ntsc");
if (!(profile->frame_rate_num() == 30000 && profile->frame_rate_den() == 1001)) {
forcedfps = 30000.0 / 1001;
}
if (!(profile->width() == 720 && profile->height() == 480)) {
resizeProfile = true;
}
} else {
dvstd = QStringLiteral("pal");
if (!(profile->frame_rate_num() == 25 && profile->frame_rate_den() == 1)) {
forcedfps = 25;
}
if (!(profile->width() == 720 && profile->height() == 576)) {
resizeProfile = true;
}
}
if ((double)profile->display_aspect_num() / profile->display_aspect_den() > 1.5) {
if (double(profile->display_aspect_num() / profile->display_aspect_den()) > 1.5) {
dvstd += QLatin1String("_wide");
}
renderArgs.replace(QLatin1String("%dv_standard"), dvstd);
......@@ -1423,8 +1395,8 @@ void RenderWidget::generateRenderFiles(QDomDocument doc, const QString &playlist
double fps = profile->fps();
double guideStart = m_view.guide_start->itemData(m_view.guide_start->currentIndex()).toDouble();
double guideEnd = m_view.guide_end->itemData(m_view.guide_end->currentIndex()).toDouble();
consumer.setAttribute(QStringLiteral("in"), (int)GenTime(guideStart).frames(fps));
consumer.setAttribute(QStringLiteral("out"), (int)GenTime(guideEnd).frames(fps));
consumer.setAttribute(QStringLiteral("in"), int(GenTime(guideStart).frames(fps)));
consumer.setAttribute(QStringLiteral("out"), int(GenTime(guideEnd).frames(fps)));
} else {
consumer.setAttribute(QStringLiteral("in"), in);
consumer.setAttribute(QStringLiteral("out"), out);
......@@ -1446,12 +1418,6 @@ void RenderWidget::generateRenderFiles(QDomDocument doc, const QString &playlist
consumer.setAttribute(QStringLiteral("s"), subsize);
}
// Check if we need to embed the playlist into the producer consumer
// That is required if PAR != 1
if (profile->sample_aspect_num() != profile->sample_aspect_den() && subsize.isEmpty()) {
resizeProfile = true;
}
// Project metadata
if (m_view.export_meta->isChecked()) {
QMap<QString, QString> metadata = project->metadata();
......@@ -1819,7 +1785,7 @@ void RenderWidget::refreshView()
// We borrow a reference to the profile's pointer to query it more easily
std::unique_ptr<ProfileModel> &profile = pCore->getCurrentProfile();
double project_framerate = (double)profile->frame_rate_num() / profile->frame_rate_den();
double project_framerate = double(profile->frame_rate_num()) / profile->frame_rate_den();
for (int i = 0; i < m_view.formats->topLevelItemCount(); ++i) {
QTreeWidgetItem *group = m_view.formats->topLevelItem(i);
for (int j = 0; j < group->childCount(); ++j) {
......@@ -1841,8 +1807,8 @@ void RenderWidget::refreshView()
QString profile_str = params.section(QStringLiteral("mlt_profile="), 1, 1).section(QLatin1Char(' '), 0, 0);
std::unique_ptr<ProfileModel> &target_profile = ProfileRepository::get()->getProfile(profile_str);
if (target_profile->frame_rate_den() > 0) {
double profile_rate = (double)target_profile->frame_rate_num() / target_profile->frame_rate_den();
if ((int)(1000.0 * profile_rate) != (int)(1000.0 * project_framerate)) {
double profile_rate = double(target_profile->frame_rate_num()) / target_profile->frame_rate_den();
if (int(1000.0 * profile_rate) != int(1000.0 * project_framerate)) {
item->setData(0, ErrorRole, i18n("Frame rate (%1) not compatible with project profile (%2)", profile_rate, project_framerate));
item->setIcon(0, brokenIcon);
item->setForeground(0, disabled);
......@@ -3025,14 +2991,14 @@ void RenderWidget::adjustAVQualities(int quality)
{
// calculate video/audio quality indexes from the general quality cursor
// taking into account decreasing/increasing video/audio quality parameter
double q = (double)quality / m_view.quality->maximum();
double q = double(quality) / m_view.quality->maximum();
int dq = q * (m_view.video->maximum() - m_view.video->minimum());
int dq = int(q * (m_view.video->maximum() - m_view.video->minimum()));
// prevent video spinbox to update quality cursor (loop)
m_view.video->blockSignals(true);
m_view.video->setValue(m_view.video->property("decreasing").toBool() ? m_view.video->maximum() - dq : m_view.video->minimum() + dq);
m_view.video->blockSignals(false);
dq = q * (m_view.audio->maximum() - m_view.audio->minimum());
dq = int(q * (m_view.audio->maximum() - m_view.audio->minimum()));
dq -= dq % m_view.audio->singleStep(); // keep a 32 pitch for bitrates
m_view.audio->setValue(m_view.audio->property("decreasing").toBool() ? m_view.audio->maximum() - dq : m_view.audio->minimum() + dq);
}
......@@ -3065,19 +3031,19 @@ void RenderWidget::checkCodecs()
consumer->set("f", "list");
consumer->start();
vcodecsList.clear();
Mlt::Properties vcodecs((mlt_properties)consumer->get_data("vcodec"));
Mlt::Properties vcodecs(mlt_properties(consumer->get_data("vcodec")));
vcodecsList.reserve(vcodecs.count());
for (int i = 0; i < vcodecs.count(); ++i) {
vcodecsList << QString(vcodecs.get(i));
}
acodecsList.clear();
Mlt::Properties acodecs((mlt_properties)consumer->get_data("acodec"));
Mlt::Properties acodecs(mlt_properties(consumer->get_data("acodec")));
acodecsList.reserve(acodecs.count());
for (int i = 0; i < acodecs.count(); ++i) {
acodecsList << QString(acodecs.get(i));
}
supportedFormats.clear();
Mlt::Properties formats((mlt_properties)consumer->get_data("f"));
Mlt::Properties formats(mlt_properties(consumer->get_data("f")));
supportedFormats.reserve(formats.count());
for (int i = 0; i < formats.count(); ++i) {
supportedFormats << QString(formats.get(i));
......
......@@ -540,6 +540,7 @@ bool TimelineModel::requestFakeClipMove(int clipId, int trackId, int position, b
bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool moveMirrorTracks, bool updateView, bool invalidateTimeline, bool finalMove, Fun &undo, Fun &redo, bool groupMove)
{
Q_UNUSED(moveMirrorTracks)
// qDebug() << "// FINAL MOVE: " << invalidateTimeline << ", UPDATE VIEW: " << updateView<<", FINAL: "<<finalMove;
if (trackId == -1) {
return false;
......@@ -1877,10 +1878,10 @@ int TimelineModel::requestItemResize(int itemId, int size, bool right, bool logU
qDebug() << "---------------------\n---------------------\nRESIZE W/UNDO CALLED\n++++++++++++++++\n++++";
}
QWriteLocker locker(&m_lock);
TRACE(itemId, size, right, logUndo, snapDistance, allowSingleResize);
TRACE(itemId, size, right, logUndo, snapDistance, allowSingleResize)
Q_ASSERT(isItem(itemId));
if (size <= 0) {
TRACE_RES(-1);
TRACE_RES(-1)
return -1;
}
int in = getItemPosition(itemId);
......@@ -1934,23 +1935,24 @@ int TimelineModel::requestItemResize(int itemId, int size, bool right, bool logU
if (!result || resizedCount == 0) {
bool undone = undo();
Q_ASSERT(undone);
TRACE_RES(-1);
TRACE_RES(-1)
return -1;
}
if (result && logUndo) {
if (isClip(itemId)) {
PUSH_UNDO(undo, redo, i18n("Resize clip"));
PUSH_UNDO(undo, redo, i18n("Resize clip"))
} else {
PUSH_UNDO(undo, redo, i18n("Resize composition"));
PUSH_UNDO(undo, redo, i18n("Resize composition"))
}
}
int res = result ? size : -1;
TRACE_RES(res);
TRACE_RES(res)
return res;
}
bool TimelineModel::requestItemResize(int itemId, int size, bool right, bool logUndo, Fun &undo, Fun &redo, bool blockUndo)
{
Q_UNUSED(blockUndo)
Fun local_undo = []() { return true; };
Fun local_redo = []() { return true; };
bool result = false;
......
......@@ -1174,7 +1174,7 @@ TEST_CASE("FuzzBug9")
undoStack->redo();
REQUIRE(timeline_0->checkConsistency());
{
int res = timeline_0->suggestClipMove(2, 1, -34, 0, 0);
timeline_0->suggestClipMove(2, 1, -34, 0, 0);
}
REQUIRE(timeline_0->checkConsistency());
undoStack->undo();
......@@ -1220,7 +1220,7 @@ TEST_CASE("FuzzBug10")
undoStack->redo();
REQUIRE(timeline_0->checkConsistency());
{
int res = timeline_0->requestItemResize(1, 12, false, true, 1, false);
timeline_0->requestItemResize(1, 12, false, true, 1, false);
}
REQUIRE(timeline_0->checkConsistency());
undoStack->undo();
......@@ -1304,7 +1304,7 @@ TEST_CASE("FuzzBug11")
undoStack->redo();
REQUIRE(timeline_0->checkConsistency());
{
bool res = timeline_0->requestSetSelection({4});
timeline_0->requestSetSelection({4});
}
REQUIRE(timeline_0->checkConsistency());
undoStack->undo();
......
......@@ -27,7 +27,7 @@ TEST_CASE("Advanced trimming operations", "[Trimming]")
auto timeline = std::shared_ptr<TimelineItemModel>(&timMock.get(), [](...) {});
TimelineItemModel::finishConstruct(timeline, guideModel);
RESET(timMock);
RESET(timMock)
QString binId = createProducer(profile_trimming, "red", binModel);
QString binId2 = createProducer(profile_trimming, "blue", binModel);
......@@ -554,10 +554,10 @@ TEST_CASE("Insert/delete", "[Trimming2]")
QString binId = createProducerWithSound(profile_trimming, binModel);
int tid2b = TrackModel::construct(timeline, -1, -1, QString(), true);
TrackModel::construct(timeline, -1, -1, QString(), true);
int tid2 = TrackModel::construct(timeline, -1, -1, QString(), true);
int tid1 = TrackModel::construct(timeline);
int tid1b = TrackModel::construct(timeline);
TrackModel::construct(timeline);
SECTION("Remove Space should preserve groups")
{
......@@ -698,6 +698,7 @@ TEST_CASE("Copy/paste", "[CP]")
Mock<KdenliveDoc> docMock;
When(Method(docMock, getDocumentProperty)).AlwaysDo([](const QString &name, const QString &defaultValue) {
Q_UNUSED(name) Q_UNUSED(defaultValue)
qDebug() << "Intercepted call";
return QStringLiteral("dummyId");
});
......@@ -718,7 +719,7 @@ TEST_CASE("Copy/paste", "[CP]")
auto timeline = std::shared_ptr<TimelineItemModel>(&timMock.get(), [](...) {});
TimelineItemModel::finishConstruct(timeline, guideModel);
RESET(timMock);
RESET(timMock)
QString binId = createProducerWithSound(profile_trimming, binModel);
QString binId2 = createProducer(profile_trimming, "red", binModel);
......@@ -978,7 +979,7 @@ TEST_CASE("Copy/paste", "[CP]")
state0();
int cid1 = -1;
REQUIRE(timeline->requestClipInsertion(binId, tid1, 3, cid1, true, true, false));
int l = timeline->getClipPlaytime(cid1);
timeline->getClipPlaytime(cid1);
int cid2 = timeline->m_groups->getSplitPartner(cid1);
auto state = [&]() {
......
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