enum { DvdButtonItem = QGraphicsItem::UserType + 1, DvdButtonUnderlineItem = QGraphicsItem::UserType + 2 };
DvdWizardMenu::DvdWizardMenu(DVDFORMAT format, QWidget *parent) :
- QWizardPage(parent),
- m_color(NULL),
- m_safeRect(NULL),
- m_finalSize(720, 576),
- m_movieLength(-1)
+ QWizardPage(parent),
+ m_color(NULL),
+ m_safeRect(NULL),
+ m_finalSize(720, 576),
+ m_movieLength(-1)
{
m_view.setupUi(this);
m_view.play_text->setText(i18n("Play"));
//font.setStyleStrategy(QFont::NoAntialias);
#if KDE_IS_VERSION(4,6,0)
if (m_view.use_shadow->isChecked()) {
- QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
- shadow->setBlurRadius(7);
- shadow->setOffset(4, 4);
- button->setGraphicsEffect(shadow);
+ QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
+ shadow->setBlurRadius(7);
+ shadow->setOffset(4, 4);
+ button->setGraphicsEffect(shadow);
}
connect(m_view.use_shadow, SIGNAL(stateChanged(int)), this, SLOT(slotEnableShadows(int)));
#elif KDE_IS_VERSION(4,6,0)
for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
if (enable) {
- QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
- shadow->setBlurRadius(7);
- shadow->setOffset(4, 4);
- list.at(i)->setGraphicsEffect(shadow);
- }
+ QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
+ shadow->setBlurRadius(7);
+ shadow->setOffset(4, 4);
+ list.at(i)->setGraphicsEffect(shadow);
+ }
else list.at(i)->setGraphicsEffect(NULL);
}
}
for (int j = 0; j < collisions.count(); j++) {
if (collisions.at(j)->type() == button->type()) {
#if KDE_IS_VERSION(4,7,0)
- m_menuMessage->setText(i18n("Buttons overlapping"));
- m_menuMessage->setMessageType(KMessageWidget::Warning);
- m_menuMessage->show();
+ m_menuMessage->setText(i18n("Buttons overlapping"));
+ m_menuMessage->setMessageType(KMessageWidget::Warning);
+ m_menuMessage->show();
#else
m_view.error_message->setText(i18n("Buttons overlapping"));
m_view.error_message->setHidden(false);
font.setPixelSize(m_view.font_size->value());
#if KDE_IS_VERSION(4,6,0)
if (m_view.use_shadow->isChecked()) {
- QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
- shadow->setBlurRadius(7);
- shadow->setOffset(4, 4);
- button->setGraphicsEffect(shadow);
+ QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
+ shadow->setBlurRadius(7);
+ shadow->setOffset(4, 4);
+ button->setGraphicsEffect(shadow);
}
#endif
//font.setStyleStrategy(QFont::NoAntialias);
{
m_format = format;
switch (m_format) {
- case PAL_WIDE:
- m_finalSize = QSize(720, 576);
- m_width = 1024;
- m_height = 576;
- break;
- case NTSC_WIDE:
- m_finalSize = QSize(720, 480);
- m_width = 853;
- m_height = 480;
- break;
- case NTSC:
- m_finalSize = QSize(720, 480);
- m_width = 640;
- m_height = 480;
- break;
- default:
- m_finalSize = QSize(720, 576);
- m_width = 768;
- m_height = 576;
+ case PAL_WIDE:
+ m_finalSize = QSize(720, 576);
+ m_width = 1024;
+ m_height = 576;
+ break;
+ case NTSC_WIDE:
+ m_finalSize = QSize(720, 480);
+ m_width = 853;
+ m_height = 480;
+ break;
+ case NTSC:
+ m_finalSize = QSize(720, 480);
+ m_width = 640;
+ m_height = 480;
+ break;
+ default:
+ m_finalSize = QSize(720, 576);
+ m_width = 768;
+ m_height = 576;
}
updatePreview();
}
if (m_safeRect) m_safeRect->setRect(safeW, safeH, m_width - 2 * safeW, m_height - 2 * safeH);
}
-void DvdWizardMenu::setTargets(QStringList list, QStringList targetlist)
+void DvdWizardMenu::setTargets(const QStringList &list, const QStringList &targetlist)
{
m_view.target_list->clear();
m_view.target_list->addItem(i18n("Play All"), "jump title 1");
} else if (m_view.background_list->currentIndex() == 2) {
// video background
m_movieLength = -1;
- QString profileName = DvdWizardVob::getDvdProfile(m_format);
- Mlt::Profile profile(profileName.toUtf8().constData());
- profile.set_explicit(true);
- Mlt::Producer *producer = new Mlt::Producer(profile, m_view.background_image->url().path().toUtf8().constData());
- if (producer && producer->is_valid()) {
- pix = QPixmap::fromImage(KThumb::getFrame(producer, 0, m_finalSize.width(), m_width, m_height));
- m_movieLength = producer->get_length();
- }
- if (producer) delete producer;
+ QString profileName = DvdWizardVob::getDvdProfile(m_format);
+ Mlt::Profile profile(profileName.toUtf8().constData());
+ profile.set_explicit(true);
+ Mlt::Producer *producer = new Mlt::Producer(profile, m_view.background_image->url().path().toUtf8().constData());
+ if (producer && producer->is_valid()) {
+ pix = QPixmap::fromImage(KThumb::getFrame(producer, 0, m_finalSize.width(), m_width, m_height));
+ m_movieLength = producer->get_length();
+ }
+ if (producer) delete producer;
}
m_background->setPixmap(pix);
m_scene->addItem(m_background);
QList<QGraphicsItem *> list = m_scene->items();
for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
- QRectF r = list.at(i)->sceneBoundingRect();
- int bottom = r.bottom() - 1;
- if (bottom % 2 == 1) bottom = bottom - 1;
- int underlineHeight = r.height() / 10;
- if (underlineHeight % 2 == 1) underlineHeight = underlineHeight - 1;
- underlineHeight = qMin(underlineHeight, 10);
- underlineHeight = qMax(underlineHeight, 2);
- r.setTop(bottom - underlineHeight);
- r.setBottom(bottom);
- r.adjust(2, 0, -2, 0);
- DvdButtonUnderline *underline = new DvdButtonUnderline(r);
- m_scene->addItem(underline);
- list.at(i)->setVisible(false);
- }
+ QRectF r = list.at(i)->sceneBoundingRect();
+ int bottom = r.bottom() - 1;
+ if (bottom % 2 == 1) bottom = bottom - 1;
+ int underlineHeight = r.height() / 10;
+ if (underlineHeight % 2 == 1) underlineHeight = underlineHeight - 1;
+ underlineHeight = qMin(underlineHeight, 10);
+ underlineHeight = qMax(underlineHeight, 2);
+ r.setTop(bottom - underlineHeight);
+ r.setBottom(bottom);
+ r.adjust(2, 0, -2, 0);
+ DvdButtonUnderline *underline = new DvdButtonUnderline(r);
+ m_scene->addItem(underline);
+ list.at(i)->setVisible(false);
+ }
}
}
QList<QGraphicsItem *> list = m_scene->items();
QList<QGraphicsItem *> toDelete;
for (int i = 0; i < list.count(); ++i) {
- if (list.at(i)->type() == DvdButtonUnderlineItem) {
- toDelete.append(list.at(i));
- }
+ if (list.at(i)->type() == DvdButtonUnderlineItem) {
+ toDelete.append(list.at(i));
+ }
if (list.at(i)->type() == DvdButtonItem) {
- list.at(i)->setVisible(true);
- }
+ list.at(i)->setVisible(true);
+ }
}
while (!toDelete.isEmpty()) {
- QGraphicsItem *item = toDelete.takeFirst();
- delete item;
+ QGraphicsItem *item = toDelete.takeFirst();
+ delete item;
}
}
for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonUnderlineItem) {
DvdButtonUnderline *underline = static_cast < DvdButtonUnderline* >(list.at(i));
- underline->setPen(Qt::NoPen);
- c.setAlpha(150);
- underline->setBrush(c);
+ underline->setPen(Qt::NoPen);
+ c.setAlpha(150);
+ underline->setBrush(c);
}
}
}
-void DvdWizardMenu::updateColor(QColor c)
+void DvdWizardMenu::updateColor(const QColor &c)
{
DvdButton *button = NULL;
QList<QGraphicsItem *> list = m_scene->items();
{
if (m_view.create_menu->isChecked()) {
m_scene->clearSelection();
- QRectF source(0, 0, m_width, m_height);
- QRectF target;
- if (!letterbox) target = QRectF(0, 0, m_finalSize.width(), m_finalSize.height());
- else {
- // Scale the button images to fit a letterbox image
- double factor = (double) m_width / m_finalSize.width();
- int letterboxHeight = m_height / factor;
- target = QRectF(0, (m_finalSize.height() - letterboxHeight) / 2, m_finalSize.width(), letterboxHeight);
- }
+ QRectF source(0, 0, m_width, m_height);
+ QRectF target;
+ if (!letterbox) target = QRectF(0, 0, m_finalSize.width(), m_finalSize.height());
+ else {
+ // Scale the button images to fit a letterbox image
+ double factor = (double) m_width / m_finalSize.width();
+ int letterboxHeight = m_height / factor;
+ target = QRectF(0, (m_finalSize.height() - letterboxHeight) / 2, m_finalSize.width(), letterboxHeight);
+ }
if (m_safeRect->scene() != 0) m_scene->removeItem(m_safeRect);
if (m_color->scene() != 0) m_scene->removeItem(m_color);
if (m_background->scene() != 0) m_scene->removeItem(m_background);
- prepareUnderLines();
+ prepareUnderLines();
#if QT_VERSION >= 0x040800
QImage img(m_finalSize.width(), m_finalSize.height(), QImage::Format_ARGB32);
img.fill(Qt::transparent);
- updateUnderlineColor(m_view.highlighted_color->color());
+ updateUnderlineColor(m_view.highlighted_color->color());
#else
- QImage img(m_finalSize.width(), m_finalSize.height(), QImage::Format_Mono);
+ QImage img(m_finalSize.width(), m_finalSize.height(), QImage::Format_Mono);
img.fill(Qt::white);
- updateUnderlineColor(Qt::black);
+ updateUnderlineColor(Qt::black);
#endif
- QPainter p;
+ QPainter p;
p.begin(&img);
//p.setRenderHints(QPainter::Antialiasing, false);
//p.setRenderHints(QPainter::TextAntialiasing, false);
- m_scene->render(&p, target, source, Qt::IgnoreAspectRatio);
+ m_scene->render(&p, target, source, Qt::IgnoreAspectRatio);
p.end();
#if QT_VERSION >= 0x040800
#elif QT_VERSION >= 0x040600
#if QT_VERSION >= 0x040800
img.fill(Qt::transparent);
- updateUnderlineColor(m_view.selected_color->color());
+ updateUnderlineColor(m_view.selected_color->color());
#else
img.fill(Qt::white);
#endif
- p.begin(&img);
+ p.begin(&img);
//p.setRenderHints(QPainter::Antialiasing, false);
//p.setRenderHints(QPainter::TextAntialiasing, false);
m_scene->render(&p, target, source, Qt::IgnoreAspectRatio);
QRectF target;
if (!letterbox) target = QRectF(0, 0, m_finalSize.width(), m_finalSize.height());
else {
- // Scale the button images to fit a letterbox image
- double factor = (double) m_width / m_finalSize.width();
- int letterboxHeight = m_height / factor;
- target = QRectF(0, (m_finalSize.height() - letterboxHeight) / 2, m_finalSize.width(), letterboxHeight);
+ // Scale the button images to fit a letterbox image
+ double factor = (double) m_width / m_finalSize.width();
+ int letterboxHeight = m_height / factor;
+ target = QRectF(0, (m_finalSize.height() - letterboxHeight) / 2, m_finalSize.width(), letterboxHeight);
}*/
-
+
if (menuMovie()) {
- showBg = true;
- if (m_background->scene() != 0) m_scene->removeItem(m_background);
- if (m_color->scene() != 0) m_scene->removeItem(m_color);
- img.fill(Qt::transparent);
+ showBg = true;
+ if (m_background->scene() != 0) m_scene->removeItem(m_background);
+ if (m_color->scene() != 0) m_scene->removeItem(m_color);
+ img.fill(Qt::transparent);
}
updateColor(m_view.text_color->color());
QPainter p(&img);
img.save(img1);
m_scene->addItem(m_safeRect);
if (showBg) {
- m_scene->addItem(m_background);
- m_scene->addItem(m_color);
+ m_scene->addItem(m_background);
+ m_scene->addItem(m_color);
}
}
int DvdWizardMenu::menuMovieLength() const
{
- return m_movieLength;
+ return m_movieLength;
}
double ratioy = 1;
int offset = 0;
if (letterbox) {
- int letterboxHeight = m_height * ratiox;
- ratioy = (double) letterboxHeight / m_finalSize.height();
- offset = (m_finalSize.height() - letterboxHeight) / 2;
+ int letterboxHeight = m_height * ratiox;
+ ratioy = (double) letterboxHeight / m_finalSize.height();
+ offset = (m_finalSize.height() - letterboxHeight) / 2;
}
for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
DvdButton *button = static_cast < DvdButton* >(list.at(i));
- QRectF r = button->sceneBoundingRect();
- QRect adjustedRect(r.x() * ratiox, offset + r.y() * ratioy, r.width() * ratiox, r.height() * ratioy);
- // Make sure y1 is not odd (requested by spumux)
+ QRectF r = button->sceneBoundingRect();
+ QRect adjustedRect(r.x() * ratiox, offset + r.y() * ratioy, r.width() * ratiox, r.height() * ratioy);
+ // Make sure y1 is not odd (requested by spumux)
if (adjustedRect.height() % 2 == 1) adjustedRect.setHeight(adjustedRect.height() + 1);
if (adjustedRect.y() % 2 == 1) adjustedRect.setY(adjustedRect.y() - 1);
QString command = button->command();
QFont font(e.attribute("font_family"));
font.setPixelSize(e.attribute("font_size").toInt());
#if KDE_IS_VERSION(4,6,0)
- if (m_view.use_shadow->isChecked()) {
- QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
- shadow->setBlurRadius(7);
- shadow->setOffset(4, 4);
- button->setGraphicsEffect(shadow);
- }
+ if (m_view.use_shadow->isChecked()) {
+ QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
+ shadow->setBlurRadius(7);
+ shadow->setOffset(4, 4);
+ button->setGraphicsEffect(shadow);
+ }
#endif
//font.setStyleStrategy(QFont::NoAntialias);
class DvdScene : public QGraphicsScene
{
-Q_OBJECT
+ Q_OBJECT
public:
DvdScene(QObject * parent = 0): QGraphicsScene(parent) {
m_width = 0; m_height = 0;
protected:
void mouseReleaseEvent( QGraphicsSceneMouseEvent * mouseEvent ) {
- QGraphicsScene::mouseReleaseEvent(mouseEvent);
- emit sceneChanged();
+ QGraphicsScene::mouseReleaseEvent(mouseEvent);
+ emit sceneChanged();
}
signals:
void sceneChanged();
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
#endif
}
- void setTarget(int t, QString c) {
+ void setTarget(int t, const QString &c) {
m_target = t;
m_command = c;
}
bool createMenu() const;
void createBackgroundImage(const QString &img1, bool letterbox);
void createButtonImages(const QString &selected_image, const QString &highlighted_image, bool letterbox);
- void setTargets(QStringList list, QStringList targetlist);
+ void setTargets(const QStringList &list, const QStringList &targetlist);
QMap <QString, QRect> buttonsInfo(bool letterbox = false);
bool loopMovie() const;
bool menuMovie() const;
void setButtonTarget(int ix);
void deleteButton();
void updateColor();
- void updateColor(QColor c);
+ void updateColor(const QColor &c);
void updateUnderlineColor(QColor c);
void setBackToMenu(bool backToMenu);
void slotZoom();
#include <unistd.h>
DvdTreeWidget::DvdTreeWidget(QWidget *parent) :
- QTreeWidget(parent)
+ QTreeWidget(parent)
{
setAcceptDrops(true);
}
void DvdTreeWidget::dragEnterEvent(QDragEnterEvent * event ) {
if (event->mimeData()->hasUrls()) {
- event->setDropAction(Qt::CopyAction);
- event->setAccepted(true);
+ event->setDropAction(Qt::CopyAction);
+ event->setAccepted(true);
}
else QTreeWidget::dragEnterEvent(event);
}
void DvdTreeWidget::dragMoveEvent(QDragMoveEvent * event) {
- event->acceptProposedAction();
+ event->acceptProposedAction();
}
void DvdTreeWidget::mouseDoubleClickEvent( QMouseEvent * )
}
DvdWizardVob::DvdWizardVob(QWidget *parent) :
- QWizardPage(parent),
- m_installCheck(true)
+ QWizardPage(parent),
+ m_installCheck(true)
{
m_view.setupUi(this);
m_view.button_add->setIcon(KIcon("list-add"));
if (KStandardDirs::findExe("dvdauthor").isEmpty()) errorMessage.append(i18n("<strong>Program %1 is required for the DVD wizard.</strong>", i18n("dvdauthor")));
if (KStandardDirs::findExe("mkisofs").isEmpty() && KStandardDirs::findExe("genisoimage").isEmpty()) errorMessage.append(i18n("<strong>Program %1 or %2 is required for the DVD wizard.</strong>", i18n("mkisofs"), i18n("genisoimage")));
if (!errorMessage.isEmpty()) {
- m_view.button_add->setEnabled(false);
- m_view.dvd_profile->setEnabled(false);
+ m_view.button_add->setEnabled(false);
+ m_view.dvd_profile->setEnabled(false);
}
m_view.dvd_profile->addItems(QStringList() << i18n("PAL 4:3") << i18n("PAL 16:9") << i18n("NTSC 4:3") << i18n("NTSC 16:9"));
QGridLayout *s = static_cast <QGridLayout*> (layout());
s->addWidget(m_warnMessage, 2, 0, 1, -1);
if (!errorMessage.isEmpty()) {
- m_warnMessage->setMessageType(KMessageWidget::Error);
- m_warnMessage->setText(errorMessage);
- m_installCheck = false;
+ m_warnMessage->setMessageType(KMessageWidget::Error);
+ m_warnMessage->setText(errorMessage);
+ m_installCheck = false;
}else {
- m_warnMessage->setMessageType(KMessageWidget::Warning);
- m_warnMessage->setText(i18n("Your clips do not match selected DVD format, transcoding required."));
- m_warnMessage->addAction(m_transcodeAction);
- m_warnMessage->hide();
+ m_warnMessage->setMessageType(KMessageWidget::Warning);
+ m_warnMessage->setText(i18n("Your clips do not match selected DVD format, transcoding required."));
+ m_warnMessage->addAction(m_transcodeAction);
+ m_warnMessage->hide();
}
m_view.button_transcode->setHidden(true);
#else
m_view.button_transcode->setDefaultAction(m_transcodeAction);
m_view.button_transcode->setEnabled(false);
if (!errorMessage.isEmpty()) {
- m_view.error_message->setText(errorMessage);
- m_installCheck = false;
+ m_view.error_message->setText(errorMessage);
+ m_installCheck = false;
}
#endif
for (int i = 0; i < m_vobList->topLevelItemCount(); ++i) {
QTreeWidgetItem *item = m_vobList->topLevelItem(i);
if (item->data(0, Qt::UserRole + 1).toInt() != comboProfile) {
- conflict = true;
- break;
- }
+ conflict = true;
+ break;
+ }
}
m_transcodeAction->setEnabled(conflict);
if (conflict) {
- showProfileError();
+ showProfileError();
}
else {
#if KDE_IS_VERSION(4,7,0)
- m_warnMessage->animatedHide();
+ m_warnMessage->animatedHide();
#else
- if (m_installCheck) m_view.error_message->setVisible(false);
+ if (m_installCheck) m_view.error_message->setVisible(false);
#endif
}
}
-void DvdWizardVob::slotAddVobList(QList <QUrl>list)
+void DvdWizardVob::slotAddVobList(const QList<QUrl> &list)
{
- foreach (const QUrl url, list) {
- slotAddVobFile(KUrl(url), QString(), false);
+ foreach (const QUrl &url, list) {
+ slotAddVobFile(KUrl(url), QString(), false);
}
slotCheckVobList();
slotCheckProfiles();
resource.prepend("avformat:");
Mlt::Producer *producer = new Mlt::Producer(profile, resource.toUtf8().data());
if (producer && producer->is_valid() && !producer->is_blank()) {
- //Mlt::Frame *frame = producer->get_frame();
- //delete frame;
- profile.from_producer(*producer);
+ //Mlt::Frame *frame = producer->get_frame();
+ //delete frame;
+ profile.from_producer(*producer);
int width = 45.0 * profile.dar();
int swidth = 45.0 * profile.width() / profile.height();
if (width % 2 == 1) width++;
- item->setData(0, Qt::DecorationRole, QPixmap::fromImage(KThumb::getFrame(producer, 0, swidth, width, 45)));
+ item->setData(0, Qt::DecorationRole, QPixmap::fromImage(KThumb::getFrame(producer, 0, swidth, width, 45)));
int playTime = producer->get_playtime();
item->setText(1, Timecode::getStringTimecode(playTime, profile.fps()));
item->setData(1, Qt::UserRole, playTime);
- int standard = -1;
- int aspect = profile.dar() * 100;
- if (profile.height() == 576 && profile.fps() == 25.0) {
- if (aspect > 150) standard = 1;
- else standard = 0;
- }
- else if (profile.height() == 480 && qAbs(profile.fps() - 30000.0 / 1001) < 0.2) {
- if (aspect > 150) standard = 3;
- else standard = 2;
- }
- QString standardName;
- switch (standard) {
- case 3:
- standardName = i18n("NTSC 16:9");
- break;
- case 2:
- standardName = i18n("NTSC 4:3");
- break;
- case 1:
- standardName = i18n("PAL 16:9");
- break;
- case 0:
- standardName = i18n("PAL 4:3");
- break;
- default:
- standardName = i18n("Unknown");
- }
- standardName.append(QString(" | %1x%2, %3fps").arg(profile.width()).arg(profile.height()).arg(profile.fps()));
- item->setData(0, Qt::UserRole, standardName);
- item->setData(0, Qt::UserRole + 1, standard);
- item->setData(0, Qt::UserRole + 2, QSize(profile.dar() * profile.height(), profile.height()));
- if (m_vobList->topLevelItemCount() == 1) {
- // This is the first added movie, auto select DVD format
- if (standard >= 0) {
- m_view.dvd_profile->blockSignals(true);
- m_view.dvd_profile->setCurrentIndex(standard);
- m_view.dvd_profile->blockSignals(false);
- }
- }
-
+ int standard = -1;
+ int aspect = profile.dar() * 100;
+ if (profile.height() == 576 && profile.fps() == 25.0) {
+ if (aspect > 150) standard = 1;
+ else standard = 0;
+ }
+ else if (profile.height() == 480 && qAbs(profile.fps() - 30000.0 / 1001) < 0.2) {
+ if (aspect > 150) standard = 3;
+ else standard = 2;
+ }
+ QString standardName;
+ switch (standard) {
+ case 3:
+ standardName = i18n("NTSC 16:9");
+ break;
+ case 2:
+ standardName = i18n("NTSC 4:3");
+ break;
+ case 1:
+ standardName = i18n("PAL 16:9");
+ break;
+ case 0:
+ standardName = i18n("PAL 4:3");
+ break;
+ default:
+ standardName = i18n("Unknown");
+ }
+ standardName.append(QString(" | %1x%2, %3fps").arg(profile.width()).arg(profile.height()).arg(profile.fps()));
+ item->setData(0, Qt::UserRole, standardName);
+ item->setData(0, Qt::UserRole + 1, standard);
+ item->setData(0, Qt::UserRole + 2, QSize(profile.dar() * profile.height(), profile.height()));
+ if (m_vobList->topLevelItemCount() == 1) {
+ // This is the first added movie, auto select DVD format
+ if (standard >= 0) {
+ m_view.dvd_profile->blockSignals(true);
+ m_view.dvd_profile->setCurrentIndex(standard);
+ m_view.dvd_profile->blockSignals(false);
+ }
+ }
+
}
else {
- // Cannot load movie, reject
- showError(i18n("The clip %1 is invalid.", url.fileName()));
+ // Cannot load movie, reject
+ showError(i18n("The clip %1 is invalid.", url.fileName()));
}
if (producer) delete producer;
item->setData(1, Qt::UserRole + 1, "0");
if (checkFormats) {
- slotCheckVobList();
- slotCheckProfiles();
+ slotCheckVobList();
+ slotCheckProfiles();
}
emit prepareMonitor();
}
int max = m_vobList->topLevelItemCount();
int i = 0;
if (m_view.use_intro->isChecked()) {
- // First movie is only for intro
- i = 1;
+ // First movie is only for intro
+ i = 1;
}
for (; i < max; ++i) {
QTreeWidgetItem *item = m_vobList->topLevelItem(i);
int max = m_vobList->topLevelItemCount();
int i = 0;
if (m_view.use_intro->isChecked()) {
- // First movie is only for intro
- i = 1;
+ // First movie is only for intro
+ i = 1;
}
for (; i < max; ++i) {
QTreeWidgetItem *item = m_vobList->topLevelItem(i);
int max = m_vobList->topLevelItemCount();
int i = 0;
if (m_view.use_intro->isChecked()) {
- // First movie is only for intro
- i = 1;
+ // First movie is only for intro
+ i = 1;
}
for (; i < max; ++i) {
QTreeWidgetItem *item = m_vobList->topLevelItem(i);
int max = m_vobList->topLevelItemCount();
int i = 0;
if (m_view.use_intro->isChecked()) {
- // First movie is only for intro
- i = 1;
+ // First movie is only for intro
+ i = 1;
}
for (; i < max; ++i) {
QTreeWidgetItem *item = m_vobList->topLevelItem(i);
{
QString profile;
switch (m_view.dvd_profile->currentIndex()) {
- case PAL_WIDE:
- profile = "dv_pal_wide";
- break;
- case NTSC:
- profile = "dv_ntsc";
- break;
- case NTSC_WIDE:
- profile = "dv_ntsc_wide";
- break;
- default:
- profile = "dv_pal";
+ case PAL_WIDE:
+ profile = "dv_pal_wide";
+ break;
+ case NTSC:
+ profile = "dv_ntsc";
+ break;
+ case NTSC_WIDE:
+ profile = "dv_ntsc_wide";
+ break;
+ default:
+ profile = "dv_pal";
}
return profile;
}
{
QString profile;
switch (format) {
- case PAL_WIDE:
- profile = "dv_pal_wide";
- break;
- case NTSC:
- profile = "dv_ntsc";
- break;
- case NTSC_WIDE:
- profile = "dv_ntsc_wide";
- break;
- default:
- profile = "dv_pal";
+ case PAL_WIDE:
+ profile = "dv_pal_wide";
+ break;
+ case NTSC:
+ profile = "dv_ntsc";
+ break;
+ case NTSC_WIDE:
+ profile = "dv_ntsc_wide";
+ break;
+ default:
+ profile = "dv_pal";
}
return profile;
}
QSize destSize;
QSize finalSize;
switch (m_view.dvd_profile->currentIndex()) {
- case PAL_WIDE:
- profileEasyName = "DVD PAL 16:9";
- destSize = QSize(1024, 576);
- finalSize = QSize(720, 576);
- break;
- case NTSC:
- profileEasyName = "DVD NTSC 4:3";
- destSize = QSize(640, 480);
- finalSize = QSize(720, 480);
- break;
- case NTSC_WIDE:
- profileEasyName = "DVD NTSC 16:9";
- destSize = QSize(853, 480);
- finalSize = QSize(720, 480);
- break;
- default:
- profileEasyName = "DVD PAL 4:3";
- destSize = QSize(768, 576);
- finalSize = QSize(720, 576);
+ case PAL_WIDE:
+ profileEasyName = "DVD PAL 16:9";
+ destSize = QSize(1024, 576);
+ finalSize = QSize(720, 576);
+ break;
+ case NTSC:
+ profileEasyName = "DVD NTSC 4:3";
+ destSize = QSize(640, 480);
+ finalSize = QSize(720, 480);
+ break;
+ case NTSC_WIDE:
+ profileEasyName = "DVD NTSC 16:9";
+ destSize = QSize(853, 480);
+ finalSize = QSize(720, 480);
+ break;
+ default:
+ profileEasyName = "DVD PAL 4:3";
+ destSize = QSize(768, 576);
+ finalSize = QSize(720, 576);
}
- QString params = transConfig.readEntry(profileEasyName);
-
+ QString params = transConfig.readEntry(profileEasyName);
+
// Transcode files that do not match selected profile
int max = m_vobList->topLevelItemCount();
int format = m_view.dvd_profile->currentIndex();
for (int i = 0; i < max; ++i) {
QTreeWidgetItem *item = m_vobList->topLevelItem(i);
- if (item->data(0, Qt::UserRole + 1).toInt() != format) {
- // File needs to be transcoded
- m_transcodeAction->setEnabled(false);
- QSize original = item->data(0, Qt::UserRole + 2).toSize();
- double input_aspect= (double) original.width() / original.height();
- QStringList postParams;
- if (input_aspect > (double) destSize.width() / destSize.height()) {
- // letterboxing
- int conv_height = (int) (destSize.width() / input_aspect);
- int conv_pad = (int) (((double) (destSize.height() - conv_height)) / 2.0);
- if (conv_pad %2 == 1) conv_pad --;
- postParams << "-vf" << QString("scale=%1:%2,pad=%3:%4:0:%5,setdar=%6").arg(finalSize.width()).arg(destSize.height() - 2 * conv_pad).arg(finalSize.width()).arg(finalSize.height()).arg(conv_pad).arg(input_aspect);
- } else {
- // pillarboxing
- int conv_width = (int) (destSize.height() * input_aspect);
- int conv_pad = (int) (((double) (destSize.width() - conv_width)) / destSize.width() * finalSize.width() / 2.0);
- if (conv_pad %2 == 1) conv_pad --;
- postParams << "-vf" << QString("scale=%1:%2,pad=%3:%4:%5:0,setdar=%6").arg(finalSize.width() - 2 * conv_pad).arg(destSize.height()).arg(finalSize.width()).arg(finalSize.height()).arg(conv_pad).arg(input_aspect);
- }
- ClipTranscode *d = new ClipTranscode(KUrl::List () << KUrl(item->text(0)), params.section(';', 0, 0), postParams, i18n("Transcoding to DVD format"), true, this);
- connect(d, SIGNAL(transcodedClip(KUrl,KUrl)), this, SLOT(slotTranscodedClip(KUrl,KUrl)));
- d->slotStartTransCode();
- d->show();
-
- }
+ if (item->data(0, Qt::UserRole + 1).toInt() != format) {
+ // File needs to be transcoded
+ m_transcodeAction->setEnabled(false);
+ QSize original = item->data(0, Qt::UserRole + 2).toSize();
+ double input_aspect= (double) original.width() / original.height();
+ QStringList postParams;
+ if (input_aspect > (double) destSize.width() / destSize.height()) {
+ // letterboxing
+ int conv_height = (int) (destSize.width() / input_aspect);
+ int conv_pad = (int) (((double) (destSize.height() - conv_height)) / 2.0);
+ if (conv_pad %2 == 1) conv_pad --;
+ postParams << "-vf" << QString("scale=%1:%2,pad=%3:%4:0:%5,setdar=%6").arg(finalSize.width()).arg(destSize.height() - 2 * conv_pad).arg(finalSize.width()).arg(finalSize.height()).arg(conv_pad).arg(input_aspect);
+ } else {
+ // pillarboxing
+ int conv_width = (int) (destSize.height() * input_aspect);
+ int conv_pad = (int) (((double) (destSize.width() - conv_width)) / destSize.width() * finalSize.width() / 2.0);
+ if (conv_pad %2 == 1) conv_pad --;
+ postParams << "-vf" << QString("scale=%1:%2,pad=%3:%4:%5:0,setdar=%6").arg(finalSize.width() - 2 * conv_pad).arg(destSize.height()).arg(finalSize.width()).arg(finalSize.height()).arg(conv_pad).arg(input_aspect);
+ }
+ ClipTranscode *d = new ClipTranscode(KUrl::List () << KUrl(item->text(0)), params.section(';', 0, 0), postParams, i18n("Transcoding to DVD format"), true, this);
+ connect(d, SIGNAL(transcodedClip(KUrl,KUrl)), this, SLOT(slotTranscodedClip(KUrl,KUrl)));
+ d->slotStartTransCode();
+ d->show();
+
+ }
}
}
void DvdWizardVob::slotTranscodedClip(KUrl src, KUrl transcoded)
{
if (transcoded.isEmpty()) {
- // Transcoding canceled or failed
- m_transcodeAction->setEnabled(true);
- return;
+ // Transcoding canceled or failed
+ m_transcodeAction->setEnabled(true);
+ return;
}
int max = m_vobList->topLevelItemCount();
for (int i = 0; i < max; ++i) {
QTreeWidgetItem *item = m_vobList->topLevelItem(i);
- if (KUrl(item->text(0)).path() == src.path()) {
- // Replace movie with transcoded version
- item->setText(0, transcoded.path());
-
- QFile f(transcoded.path());
- qint64 fileSize = f.size();
-
- Mlt::Profile profile;
- profile.set_explicit(false);
- item->setText(2, KIO::convertSize(fileSize));
- item->setData(2, Qt::UserRole, fileSize);
- item->setData(0, Qt::DecorationRole, KIcon("video-x-generic").pixmap(60, 45));
- item->setToolTip(0, transcoded.path());
-
- QString resource = transcoded.path();
- resource.prepend("avformat:");
- Mlt::Producer *producer = new Mlt::Producer(profile, resource.toUtf8().data());
- if (producer && producer->is_valid() && !producer->is_blank()) {
- profile.from_producer(*producer);
- int width = 45.0 * profile.dar();
- int swidth = 45.0 * profile.width() / profile.height();
- if (width % 2 == 1) width++;
- item->setData(0, Qt::DecorationRole, QPixmap::fromImage(KThumb::getFrame(producer, 0, swidth, width, 45)));
- int playTime = producer->get_playtime();
- item->setText(1, Timecode::getStringTimecode(playTime, profile.fps()));
- item->setData(1, Qt::UserRole, playTime);
- int standard = -1;
- int aspect = profile.dar() * 100;
- if (profile.height() == 576) {
- if (aspect > 150) standard = 1;
- else standard = 0;
- }
- else if (profile.height() == 480) {
- if (aspect > 150) standard = 3;
- else standard = 2;
- }
- QString standardName;
- switch (standard) {
- case 3:
- standardName = i18n("NTSC 16:9");
- break;
- case 2:
- standardName = i18n("NTSC 4:3");
- break;
- case 1:
- standardName = i18n("PAL 16:9");
- break;
- case 0:
- standardName = i18n("PAL 4:3");
- break;
- default:
- standardName = i18n("Unknown");
- }
- item->setData(0, Qt::UserRole, standardName);
- item->setData(0, Qt::UserRole + 1, standard);
- item->setData(0, Qt::UserRole + 2, QSize(profile.dar() * profile.height(), profile.height()));
- }
- else {
- // Cannot load movie, reject
- showError(i18n("The clip %1 is invalid.", transcoded.fileName()));
- }
- if (producer) delete producer;
- slotCheckVobList();
- slotCheckProfiles();
- break;
- }
+ if (KUrl(item->text(0)).path() == src.path()) {
+ // Replace movie with transcoded version
+ item->setText(0, transcoded.path());
+
+ QFile f(transcoded.path());
+ qint64 fileSize = f.size();
+
+ Mlt::Profile profile;
+ profile.set_explicit(false);
+ item->setText(2, KIO::convertSize(fileSize));
+ item->setData(2, Qt::UserRole, fileSize);
+ item->setData(0, Qt::DecorationRole, KIcon("video-x-generic").pixmap(60, 45));
+ item->setToolTip(0, transcoded.path());
+
+ QString resource = transcoded.path();
+ resource.prepend("avformat:");
+ Mlt::Producer *producer = new Mlt::Producer(profile, resource.toUtf8().data());
+ if (producer && producer->is_valid() && !producer->is_blank()) {
+ profile.from_producer(*producer);
+ int width = 45.0 * profile.dar();
+ int swidth = 45.0 * profile.width() / profile.height();
+ if (width % 2 == 1) width++;
+ item->setData(0, Qt::DecorationRole, QPixmap::fromImage(KThumb::getFrame(producer, 0, swidth, width, 45)));
+ int playTime = producer->get_playtime();
+ item->setText(1, Timecode::getStringTimecode(playTime, profile.fps()));
+ item->setData(1, Qt::UserRole, playTime);
+ int standard = -1;
+ int aspect = profile.dar() * 100;
+ if (profile.height() == 576) {
+ if (aspect > 150) standard = 1;
+ else standard = 0;
+ }
+ else if (profile.height() == 480) {
+ if (aspect > 150) standard = 3;
+ else standard = 2;
+ }
+ QString standardName;
+ switch (standard) {
+ case 3:
+ standardName = i18n("NTSC 16:9");
+ break;
+ case 2:
+ standardName = i18n("NTSC 4:3");
+ break;
+ case 1:
+ standardName = i18n("PAL 16:9");
+ break;
+ case 0:
+ standardName = i18n("PAL 4:3");
+ break;
+ default:
+ standardName = i18n("Unknown");
+ }
+ item->setData(0, Qt::UserRole, standardName);
+ item->setData(0, Qt::UserRole + 1, standard);
+ item->setData(0, Qt::UserRole + 2, QSize(profile.dar() * profile.height(), profile.height()));
+ }
+ else {
+ // Cannot load movie, reject
+ showError(i18n("The clip %1 is invalid.", transcoded.fileName()));
+ }
+ if (producer) delete producer;
+ slotCheckVobList();
+ slotCheckProfiles();
+ break;
+ }
}
}
#endif
}
-void DvdWizardVob::showError(const QString error)
+void DvdWizardVob::showError(const QString &error)
{
#if KDE_IS_VERSION(4,7,0)
m_warnMessage->setText(error);
signals:
void addNewClip();
- void addClips(QList<QUrl>);
+ void addClips(const QList<QUrl>&);
};
class DvdViewDelegate : public QStyledItemDelegate
if (index.column() == 0) {
painter->save();
QStyleOptionViewItemV4 opt(option);
- QRect r1 = option.rect;
+ QRect r1 = option.rect;
QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, opt.widget);
painter->drawPixmap(pixmapPoint, pixmap);
int decoWidth = pixmap.width() + 2 * textMargin;
- QFont font = painter->font();
+ QFont font = painter->font();
font.setBold(true);
painter->setFont(font);
int mid = (int)((r1.height() / 2));
KMessageWidget *m_warnMessage;
#endif
void showProfileError();
- void showError(const QString error);
+ void showError(const QString &error);
public slots:
void slotAddVobFile(KUrl url = KUrl(), const QString &chapters = QString(), bool checkFormats = true);
- void slotAddVobList(QList <QUrl>list);
+ void slotAddVobList(const QList<QUrl> &list);
void slotCheckProfiles();
private slots:
void slotAutoExpand(const QString &text);
signals:
- void addEffect(const QDomElement);
+ void addEffect(const QDomElement&);
void reloadEffects();
};
}
}
-void EffectsListWidget::loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList<QTreeWidgetItem *> *folders, int type, const QString current, bool *found)
+void EffectsListWidget::loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList<QTreeWidgetItem *> *folders, int type, const QString ¤t, bool *found)
{
QStringList effectInfo, l;
QTreeWidgetItem *parentItem;
* @param current name of selected effect before reload; if an effect name matches this one it will become selected
* @param found will be set to true if an effect name matches current
*/
- void loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList<QTreeWidgetItem *> *folders, int type, const QString current, bool *found);
+ void loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList<QTreeWidgetItem *> *folders, int type, const QString ¤t, bool *found);
private slots:
void slotExpandItem(const QModelIndex & index);
void slotSyncEffectsPos(int pos);
signals:
- void parameterChanged(const QDomElement, const QDomElement, int);
+ void parameterChanged(const QDomElement&, const QDomElement&, int);
void seekTimeline(int);
void displayMessage(const QString&, int);
void checkMonitorPosition(int);
void showComments(bool show);
void effectStateChanged(bool enabled);
/** @brief Start an MLT filter job on this clip. */
- void startFilterJob(const QString &filterName, const QString &filterParams, const QString &consumer, const QString &consumerParams, const QMap <QString, QString>);
+ void startFilterJob(const QString &filterName, const QString &filterParams, const QString &consumer, const QString &consumerParams, const QMap <QString, QString>&);
void importClipKeyframes(GRAPHICSRECTITEM = AVWIDGET);
};
profile_list->clear();
QString group;
switch (profile_type->currentIndex()) {
- case 0:
- group = "proxy";
- break;
- case 1:
- group = "video4linux";
- break;
- case 2:
- group = "screengrab";
- break;
- default:
- case 3:
- group = "decklink";
- break;
+ case 0:
+ group = "proxy";
+ break;
+ case 1:
+ group = "video4linux";
+ break;
+ case 2:
+ group = "screengrab";
+ break;
+ default:
+ case 3:
+ group = "decklink";
+ break;
}
delete m_configGroup;
}
}
-void Geometryval::setFrameSize(QPoint p)
+void Geometryval::setFrameSize(const QPoint &p)
{
m_frameSize = p;
}
virtual ~Geometryval();
QDomElement getParamDesc();
QString getValue() const;
- void setFrameSize(QPoint p);
+ void setFrameSize(const QPoint &p);
/** @brief Updates the timecode display according to settings (frame number or hh:mm:ss:ff) */
void updateTimecodeFormat();
void slotUpdateRange(int inPoint, int outPoint);
delete m_spinHeight;
delete m_opacity;
if (m_rect) {
- m_scene->removeItem(m_rect);
- delete m_rect;
+ m_scene->removeItem(m_rect);
+ delete m_rect;
}
if (m_geomPath) {
- m_scene->removeItem(m_geomPath);
- delete m_geomPath;
+ m_scene->removeItem(m_geomPath);
+ delete m_geomPath;
}
delete m_previous;
delete m_geometry;
{
KdenliveSettings::setOnmonitoreffects_geometryshowpath(show);
if (m_geomPath) {
- if (show) m_scene->addItem(m_geomPath);
- else m_scene->removeItem(m_geomPath);
+ if (show) m_scene->addItem(m_geomPath);
+ else m_scene->removeItem(m_geomPath);
}
slotPositionChanged(-1, false);
}
Mlt::GeometryItem item;
m_geometry->fetch(&item, 0);
if (m_rect) {
- m_scene->removeItem(m_rect);
- delete m_rect;
+ m_scene->removeItem(m_rect);
+ delete m_rect;
}
if (m_geomPath) {
- m_scene->removeItem(m_geomPath);
- delete m_geomPath;
+ m_scene->removeItem(m_geomPath);
+ delete m_geomPath;
}
m_rect = new OnMonitorRectItem(QRectF(0, 0, item.w(), item.h()), m_monitor->render->dar());
m_rect->setPos(item.x(), item.y());
m_geomPath->setPen(QPen(Qt::red));
m_geomPath->setPoints(m_geometry);
if (KdenliveSettings::onmonitoreffects_geometryshowpath())
- m_scene->addItem(m_geomPath);
+ m_scene->addItem(m_geomPath);
m_scene->centerView();
slotPositionChanged(0, false);
}
m_timeline->update();
if (m_geomPath && KdenliveSettings::onmonitoreffects_geometryshowpath()) {
- m_scene->removeItem(m_geomPath);
- m_geomPath->setPoints(m_geometry);
- m_scene->addItem(m_geomPath);
+ m_scene->removeItem(m_geomPath);
+ m_geomPath->setPoints(m_geometry);
+ m_scene->addItem(m_geomPath);
}
slotPositionChanged(pos, false);
emit parameterChanged();
int pos = 0;
int ix = 0;
while (ix < points.count() && !m_geometry->next_key(&item, pos)) {
- QPointF center = points.at(ix);
- QSizeF size(item.w(), item.h());
- item.x(center.x() - size.width()/2);
- item.y(center.y() - size.height()/2);
- m_geometry->insert(item);
- pos = item.frame() + 1;
- ix++;
+ QPointF center = points.at(ix);
+ QSizeF size(item.w(), item.h());
+ item.x(center.x() - size.width()/2);
+ item.y(center.y() - size.height()/2);
+ m_geometry->insert(item);
+ pos = item.frame() + 1;
+ ix++;
}
slotPositionChanged(-1, false);
emit parameterChanged();
}
}
if (m_geomPath && KdenliveSettings::onmonitoreffects_geometryshowpath()) {
- m_scene->removeItem(m_geomPath);
- m_geomPath->setPoints(m_geometry);
- m_scene->addItem(m_geomPath);
+ m_scene->removeItem(m_geomPath);
+ m_geomPath->setPoints(m_geometry);
+ m_scene->addItem(m_geomPath);
}
emit parameterChanged();
}
emit seekToPos(m_clipPos + m_timePos->getValue());
}
-void GeometryWidget::setFrameSize(QPoint size)
+void GeometryWidget::setFrameSize(const QPoint &size)
{
m_frameSize = size;
}
// Delete existing keyframes
Mlt::GeometryItem item;
while (!m_geometry->next_key(&item, 1)) {
- m_geometry->remove(item.frame());
+ m_geometry->remove(item.frame());
}
// Delete extra geometry keyframes too
for (int i = 0; i < m_extraGeometries.count(); ++i) {
Mlt::Geometry *geom = m_extraGeometries.at(i);
- while (!geom->next_key(&item, 1)) {
- geom->remove(item.frame());
- }
+ while (!geom->next_key(&item, 1)) {
+ geom->remove(item.frame());
+ }
}
// Create neutral first keyframe
m_geometry->insert(item);
m_timeline->setKeyGeometry(m_geometry, m_outPoint - m_inPoint);
if (m_geomPath && KdenliveSettings::onmonitoreffects_geometryshowpath()) {
- m_scene->removeItem(m_geomPath);
- m_geomPath->setPoints(m_geometry);
- m_scene->addItem(m_geomPath);
+ m_scene->removeItem(m_geomPath);
+ m_geomPath->setPoints(m_geometry);
+ m_scene->addItem(m_geomPath);
}
slotPositionChanged(-1, false);
emit parameterChanged();
Mlt::GeometryItem item;
int pos = m_timePos->getValue();
while (!m_geometry->next_key(&item, pos)) {
- m_geometry->remove(item.frame());
+ m_geometry->remove(item.frame());
}
// Delete extra geometry keyframes too
for (int i = 0; i < m_extraGeometries.count(); ++i) {
Mlt::Geometry *geom = m_extraGeometries.at(i);
- while (!geom->next_key(&item, pos)) {
- geom->remove(item.frame());
- }
+ while (!geom->next_key(&item, pos)) {
+ geom->remove(item.frame());
+ }
}
// Make sure we have at least one keyframe
if (m_geometry->next_key(&item, 0)) {
- item.frame(0);
- item.x(0);
- item.y(0);
- item.w(m_monitor->render->frameRenderWidth());
- item.h(m_monitor->render->renderHeight());
- item.mix(100);
- m_geometry->insert(item);
+ item.frame(0);
+ item.x(0);
+ item.y(0);
+ item.w(m_monitor->render->frameRenderWidth());
+ item.h(m_monitor->render->renderHeight());
+ item.mix(100);
+ m_geometry->insert(item);
}
m_timeline->setKeyGeometry(m_geometry, m_outPoint - m_inPoint);
if (m_geomPath && KdenliveSettings::onmonitoreffects_geometryshowpath()) {
- m_scene->removeItem(m_geomPath);
- m_geomPath->setPoints(m_geometry);
- m_scene->addItem(m_geomPath);
+ m_scene->removeItem(m_geomPath);
+ m_geomPath->setPoints(m_geometry);
+ m_scene->addItem(m_geomPath);
}
slotPositionChanged(-1, false);
emit parameterChanged();
Mlt::GeometryItem item;
int pos = 0;
while (!m_geometry->next_key(&item, pos) && pos < m_timePos->getValue()) {
- pos = item.frame() + 1;
- m_geometry->remove(item.frame());
+ pos = item.frame() + 1;
+ m_geometry->remove(item.frame());
}
// Delete extra geometry keyframes too
for (int i = 0; i < m_extraGeometries.count(); ++i) {
Mlt::Geometry *geom = m_extraGeometries.at(i);
- pos = 0;
- while (!geom->next_key(&item, pos) && pos < m_timePos->getValue()) {
- pos = item.frame() + 1;
- geom->remove(item.frame());
- }
+ pos = 0;
+ while (!geom->next_key(&item, pos) && pos < m_timePos->getValue()) {
+ pos = item.frame() + 1;
+ geom->remove(item.frame());
+ }
}
// Make sure we have at least one keyframe
if (!m_geometry->next_key(&item, 0)) {
- item.frame(0);
- /*item.x(0);
- item.y(0);
- item.w(m_monitor->render->frameRenderWidth());
- item.h(m_monitor->render->renderHeight());
- item.mix(100);*/
- m_geometry->insert(item);
+ item.frame(0);
+ /*item.x(0);
+ item.y(0);
+ item.w(m_monitor->render->frameRenderWidth());
+ item.h(m_monitor->render->renderHeight());
+ item.mix(100);*/
+ m_geometry->insert(item);
}
else {
- item.frame(0);
- item.x(0);
- item.y(0);
- item.w(m_monitor->render->frameRenderWidth());
- item.h(m_monitor->render->renderHeight());
- item.mix(100);
- m_geometry->insert(item);
+ item.frame(0);
+ item.x(0);
+ item.y(0);
+ item.w(m_monitor->render->frameRenderWidth());
+ item.h(m_monitor->render->renderHeight());
+ item.mix(100);
+ m_geometry->insert(item);
}
m_timeline->setKeyGeometry(m_geometry, m_outPoint - m_inPoint);
if (m_geomPath && KdenliveSettings::onmonitoreffects_geometryshowpath()) {
- m_scene->removeItem(m_geomPath);
- m_geomPath->setPoints(m_geometry);
- m_scene->addItem(m_geomPath);
+ m_scene->removeItem(m_geomPath);
+ m_geomPath->setPoints(m_geometry);
+ m_scene->addItem(m_geomPath);
}
slotPositionChanged(-1, false);
emit parameterChanged();
Mlt::GeometryItem item;
while (!m_geometry->next_key(&item, 0)) {
- m_geometry->remove(item.frame());
+ m_geometry->remove(item.frame());
}
int offset = 1;
if (maximum > 0 && list.count() > maximum) {
- offset = list.count() / maximum;
+ offset = list.count() / maximum;
}
for (int i = 0; i < list.count(); i += offset) {
- QString geom = list.at(i);
- if (geom.contains('=')) {
- item.frame(geom.section('=', 0, 0).toInt());
- geom = geom.section('=', 1);
- }
- else item.frame(0);
- if (geom.contains('/')) {
- item.x(geom.section('/', 0, 0).toDouble());
- item.y(geom.section('/', 1, 1).section(':', 0, 0).toDouble());
- }
- else {
- item.x(0);
- item.y(0);
- }
- if (geom.contains('x')) {
- item.w(geom.section('x', 0, 0).section(':', 1, 1).toDouble());
- item.h(geom.section('x', 1, 1).section(':', 0, 0).toDouble());
- }
- else {
- item.w(screenSize.x());
- item.h(screenSize.y());
- }
- //TODO: opacity
- item.mix(100);
- m_geometry->insert(item);
+ QString geom = list.at(i);
+ if (geom.contains('=')) {
+ item.frame(geom.section('=', 0, 0).toInt());
+ geom = geom.section('=', 1);
+ }
+ else item.frame(0);
+ if (geom.contains('/')) {
+ item.x(geom.section('/', 0, 0).toDouble());
+ item.y(geom.section('/', 1, 1).section(':', 0, 0).toDouble());
+ }
+ else {
+ item.x(0);
+ item.y(0);
+ }
+ if (geom.contains('x')) {
+ item.w(geom.section('x', 0, 0).section(':', 1, 1).toDouble());
+ item.h(geom.section('x', 1, 1).section(':', 0, 0).toDouble());
+ }
+ else {
+ item.w(screenSize.x());
+ item.h(screenSize.y());
+ }
+ //TODO: opacity
+ item.mix(100);
+ m_geometry->insert(item);
}
m_timeline->setKeyGeometry(m_geometry, m_outPoint - m_inPoint);
if (m_geomPath && KdenliveSettings::onmonitoreffects_geometryshowpath()) {
- m_scene->removeItem(m_geomPath);
- m_geomPath->setPoints(m_geometry);
- m_scene->addItem(m_geomPath);
+ m_scene->removeItem(m_geomPath);
+ m_geomPath->setPoints(m_geometry);
+ m_scene->addItem(m_geomPath);
}
slotPositionChanged(-1, false);
emit parameterChanged();
m_inPoint = inPoint;
m_outPoint = outPoint;
m_timeline->setKeyGeometry(m_geometry, m_outPoint - m_inPoint);
- m_timePos->setRange(0, m_outPoint - m_inPoint);
+ m_timePos->setRange(0, m_outPoint - m_inPoint);
}
#include "geometrywidget.moc"
* @param isEffect true if used in an effect, false if used in a transition
* @param showRotation Should we show or hide the rotation sliders
* @param parent (optional) Parent widget */
- GeometryWidget(Monitor *monitor, const Timecode &timecode, int clipPos, bool isEffect, bool showRotation, QWidget* parent = 0);
+ explicit GeometryWidget(Monitor *monitor, const Timecode &timecode, int clipPos, bool isEffect, bool showRotation, QWidget* parent = 0);
virtual ~GeometryWidget();
/** @brief Gets the geometry as a serialized string. */
QString getValue() const;
/** @brief Updates the timecode display according to settings (frame number or hh:mm:ss:ff) */
void updateTimecodeFormat();
/** @brief Sets the size of the original clip. */
- void setFrameSize(QPoint size);
+ void setFrameSize(const QPoint &size);
void addParameter(const QDomElement &elem);
void importKeyframes(const QString &data, int maximum);
int currentPosition() const;
GraphicsSceneRectMove::GraphicsSceneRectMove(QObject *parent) :
- QGraphicsScene(parent),
- m_selectedItem(NULL),
- m_resizeMode(NoResize),
- m_tool(TITLE_RECTANGLE)
+ QGraphicsScene(parent),
+ m_selectedItem(NULL),
+ m_resizeMode(NoResize),
+ m_tool(TITLE_RECTANGLE)
{
//grabMouse();
m_zoom = 1.0;
update();
}
-TITLETOOL GraphicsSceneRectMove::tool()
+TITLETOOL GraphicsSceneRectMove::tool() const
{
return m_tool;
}
case Qt::Key_Delete:
case Qt::Key_Backspace:
foreach (QGraphicsItem *qgi, selectedItems()) {
- if (qgi->data(-1).toInt() == -1) continue;
- removeItem(qgi);
- delete qgi;
+ if (qgi->data(-1).toInt() == -1) continue;
+ removeItem(qgi);
+ delete qgi;
}
m_selectedItem = NULL;
emit selectionChanged();
}
if (item == NULL || !(item->flags() & QGraphicsItem::ItemIsSelectable)) {
if (m_selectedItem && m_selectedItem->type() == QGraphicsTextItem::Type) {
- //Â disable text editing
+ // disable text editing
QGraphicsTextItem *t = static_cast<QGraphicsTextItem *>(m_selectedItem);
t->textCursor().setPosition(0);
QTextBlock cur = t->textCursor().block();
void GraphicsSceneRectMove::clearTextSelection()
{
if (m_selectedItem && m_selectedItem->type() == QGraphicsTextItem::Type) {
- //Â disable text editing
+ // disable text editing
QGraphicsTextItem *t = static_cast<QGraphicsTextItem *>(m_selectedItem);
t->textCursor().setPosition(0);
QTextBlock cur = t->textCursor().block();
if (resizeMode == Left || resizeMode == Right ) s = m_selectedItem->boundingRect().width() / newrect.width();
else s = m_selectedItem->boundingRect().height() / newrect.height();
m_selectedItem->scale( 1 / s, 1 / s );
- kDebug()<<"///Â SCALING SVG, RESIZE MODE: "<<resizeMode<<", RECT:"<<m_selectedItem->boundingRect();
+ kDebug()<<"/// SCALING SVG, RESIZE MODE: "<<resizeMode<<", RECT:"<<m_selectedItem->boundingRect();
}*/
//gi->setPos(m_selectedItem->scenePos());
/*if (resizeMode == NoResize) {
void setScale(double s);
void setZoom(double s);
void setTool(TITLETOOL tool);
- TITLETOOL tool();
+ TITLETOOL tool() const;
void clearTextSelection();
public slots:
transitions->append(ret.documentElement());*/
}
-QDomElement initEffects::quickParameterFill(QDomDocument & doc, QString name, QString tag, QString type, QString def, QString min, QString max, QString list, QString listdisplaynames, QString factor, QString namedesc, QString format, QString opacity)
+QDomElement initEffects::quickParameterFill(QDomDocument & doc, const QString &name, const QString &tag, const QString &type, const QString &def, const QString &min, const QString &max, const QString &list, const QString &listdisplaynames, const QString &factor, const QString &namedesc, const QString &format, const QString &opacity)
{
QDomElement parameter = doc.createElement("parameter");
parameter.setAttribute("tag", tag);
* @param tag parameter tag
* @param type parameter type (string, double, bool, etc.)
* @return element with the parameter information */
- static QDomElement quickParameterFill(QDomDocument & doc, QString name,
- QString tag, QString type,
- QString def = QString(),
- QString min = QString(),
- QString max = QString(),
- QString list = QString(),
- QString listdisplaynames = QString(),
- QString factor = QString(),
- QString namedesc = QString(),
- QString format = QString(),
- QString opacity = QString());
+ static QDomElement quickParameterFill(QDomDocument & doc,
+ const QString &name,
+ const QString &tag,
+ const QString &type,
+ const QString &def = QString(),
+ const QString &min = QString(),
+ const QString &max = QString(),
+ const QString &list = QString(),
+ const QString &listdisplaynames = QString(),
+ const QString &factor = QString(),
+ const QString &namedesc = QString(),
+ const QString &format = QString(),
+ const QString &opacity = QString());
/** @brief Parses a file to record information about one or more effects.
* @param customEffectList list of custom effect
for (int i=0; i < actionMap.size(); ++i) {
if (actionMap[i].isEmpty())
continue;
- mappings << QString("%1%2%3%4").arg(BUTTON_PREFIX).arg(i).arg(KEY_VALUE_SEP).arg(actionMap[i]);
+ mappings << QString::fromLatin1("%1%2%3%4").arg(BUTTON_PREFIX).arg(i).arg(KEY_VALUE_SEP).arg(actionMap[i]);
}
return mappings.join(DELIMITER);
systemLocale.setNumberOptions(QLocale::OmitGroupSeparator);
QLocale::setDefault(systemLocale);
// locale conversion might need to be redone
- initEffects::parseEffectFiles(setlocale(LC_NUMERIC, NULL));
+ initEffects::parseEffectFiles(setlocale(LC_NUMERIC, NULL));
}
*openBackup = false;
else {
QFile file(tmpFile);
QString errorMsg;
- int line;
- int col;
+ int line;
+ int col;
QDomImplementation::setInvalidDataPolicy(QDomImplementation::DropInvalidChars);
success = m_document.setContent(&file, false, &errorMsg, &line, &col);
- file.close();
+ file.close();
if (!success) {
// It is corrupted
- int answer = KMessageBox::warningYesNoCancel (parent, i18n("Cannot open the project file, error is:\n%1 (line %2, col %3)\nDo you want to open a backup file?", errorMsg, line, col), i18n("Error opening file"), KGuiItem(i18n("Open Backup")), KGuiItem(i18n("Recover")));
+ int answer = KMessageBox::warningYesNoCancel (parent, i18n("Cannot open the project file, error is:\n%1 (line %2, col %3)\nDo you want to open a backup file?", errorMsg, line, col), i18n("Error opening file"), KGuiItem(i18n("Open Backup")), KGuiItem(i18n("Recover")));
if (answer == KMessageBox::Yes) {
- *openBackup = true;
- }
- else if (answer == KMessageBox::No) {
- // Try to recover broken file produced by Kdenlive 0.9.4
- if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- int correction = 0;
- QString playlist = file.readAll();
- while (!success && correction < 2) {
- int errorPos = 0;
- line--;
- col = col - 2;
- for (int j = 0; j < line && errorPos < playlist.length(); j++) {
- errorPos = playlist.indexOf("\n", errorPos);
- errorPos++;
- }
- errorPos += col;
- if (errorPos >= playlist.length()) break;
- playlist.remove(errorPos, 1);
- line = 0;
- col = 0;
- success = m_document.setContent(playlist, false, &errorMsg, &line, &col);
- correction++;
- }
- if (!success) {
- KMessageBox::sorry(parent, i18n("Cannot recover this project file"));
- }
- else {
- // Document was modified, ask for backup
- QDomElement mlt = m_document.documentElement();
- QDomElement info = mlt.firstChildElement("kdenlivedoc");
- if (!info.isNull()) info.setAttribute("modified", 1);
- }
- }
- }
+ *openBackup = true;
+ }
+ else if (answer == KMessageBox::No) {
+ // Try to recover broken file produced by Kdenlive 0.9.4
+ if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ int correction = 0;
+ QString playlist = file.readAll();
+ while (!success && correction < 2) {
+ int errorPos = 0;
+ line--;
+ col = col - 2;
+ for (int j = 0; j < line && errorPos < playlist.length(); j++) {
+ errorPos = playlist.indexOf("\n", errorPos);
+ errorPos++;
+ }
+ errorPos += col;
+ if (errorPos >= playlist.length()) break;
+ playlist.remove(errorPos, 1);
+ line = 0;
+ col = 0;
+ success = m_document.setContent(playlist, false, &errorMsg, &line, &col);
+ correction++;
+ }
+ if (!success) {
+ KMessageBox::sorry(parent, i18n("Cannot recover this project file"));
+ }
+ else {
+ // Document was modified, ask for backup
+ QDomElement mlt = m_document.documentElement();
+ QDomElement info = mlt.firstChildElement("kdenlivedoc");
+ if (!info.isNull()) info.setAttribute("modified", 1);
+ }
+ }
+ }
}
if (success) {
parent->slotGotProgressInfo(i18n("Validating"), 0);
projectTrack.isBlind = e.attribute("blind").toInt();
projectTrack.isLocked = e.attribute("locked").toInt();
projectTrack.trackName = e.attribute("trackname");
- projectTrack.effectsList = EffectsList(true);
+ projectTrack.effectsList = EffectsList(true);
m_tracksList.append(projectTrack);
}
}
for (int k = 0; k < maxchild; k++) {
e = markerslist.at(k).toElement();
if (e.tagName() == "marker") {
- CommentedTime marker(GenTime(e.attribute("time").toDouble()), e.attribute("comment"), e.attribute("type").toInt());
- DocClipBase *baseClip = m_clipManager->getClipById(e.attribute("id"));
+ CommentedTime marker(GenTime(e.attribute("time").toDouble()), e.attribute("comment"), e.attribute("type").toInt());
+ DocClipBase *baseClip = m_clipManager->getClipById(e.attribute("id"));
if (baseClip) baseClip->addSnapMarker(marker);
- else kDebug()<< " / / Warning, missing clip: "<< e.attribute("id");
- }
+ else kDebug()<< " / / Warning, missing clip: "<< e.attribute("id");
+ }
}
infoXml.removeChild(markers);
}
audioTrack.isLocked = false;
audioTrack.trackName = QString("Audio ") + QString::number(audiotracks - i);
audioTrack.duration = 0;
- audioTrack.effectsList = EffectsList(true);
+ audioTrack.effectsList = EffectsList(true);
m_tracksList.append(audioTrack);
}
videoTrack.isLocked = false;
videoTrack.trackName = QString("Video ") + QString::number(videotracks - i);
videoTrack.duration = 0;
- videoTrack.effectsList = EffectsList(true);
+ videoTrack.effectsList = EffectsList(true);
m_tracksList.append(videoTrack);
}
return createEmptyDocument(m_tracksList);
marker.setAttribute("time", marks.at(j).time().ms() / 1000);
marker.setAttribute("comment", marks.at(j).comment());
marker.setAttribute("id", e.attribute("id"));
- marker.setAttribute("type", marks.at(j).markerType());
+ marker.setAttribute("type", marks.at(j).markerType());
markers.appendChild(marker);
}
}
if (!autosave) {
cleanupBackupFiles();
QFileInfo info(file);
- QString fileName = KUrl(path).fileName().section('.', 0, -2);
+ QString fileName = KUrl(path).fileName().section('.', 0, -2);
fileName.append('-' + m_documentProperties.value("documentid"));
fileName.append(info.lastModified().toString("-yyyy-MM-dd-hh-mm"));
fileName.append(".kdenlive.png");
return m_url;
}
-void KdenliveDoc::setUrl(KUrl url)
+void KdenliveDoc::setUrl(const KUrl &url)
{
m_url = url;
}
return m_url.fileName() + " / " + m_profile.description;
}
-bool KdenliveDoc::addClip(QDomElement elem, QString clipId, bool createClipItem)
+bool KdenliveDoc::addClip(QDomElement elem, const QString &clipId, bool createClipItem)
{
const QString producerId = clipId.section('_', 0, 0);
DocClipBase *clip = m_clipManager->getClipById(producerId);
return foundFileName;
}
-bool KdenliveDoc::addClipInfo(QDomElement elem, QDomElement orig, QString clipId)
+bool KdenliveDoc::addClipInfo(QDomElement elem, QDomElement orig, const QString &clipId)
{
DocClipBase *clip = m_clipManager->getClipById(clipId);
if (clip == NULL) {
QDomNamedNodeMap attributes = elem.attributes();
for (int i = 0; i < attributes.count(); ++i) {
QString attrname = attributes.item(i).nodeName();
- if (attrname != "resource")
+ if (attrname != "resource")
properties.insert(attrname, attributes.item(i).nodeValue());
//kDebug() << attrname << " = " << attributes.item(i).nodeValue();
}
for (QDomNode m = orig.firstChild(); !m.isNull(); m = m.nextSibling()) {
QString name = m.toElement().attribute("name");
if (name.startsWith("meta.attr")) {
- if (name.endsWith(".markup")) name = name.section('.', 0, -2);
+ if (name.endsWith(".markup")) name = name.section('.', 0, -2);
meta.insert(name.section('.', 2, -1), m.firstChild().nodeValue());
- }
+ }
}
if (!meta.isEmpty()) {
if (clip == NULL)
return m_clipManager->getClipById(clipId);
}
-void KdenliveDoc::slotCreateXmlClip(const QString &name, const QDomElement xml, QString group, const QString &groupId)
+void KdenliveDoc::slotCreateXmlClip(const QString &name, const QDomElement &xml, const QString &group, const QString &groupId)
{
m_clipManager->slotAddXmlClipFile(name, xml, group, groupId);
setModified(true);
emit selectLastAddedClip(QString::number(m_clipManager->lastClipId()));
}
-void KdenliveDoc::slotCreateColorClip(const QString &name, const QString &color, const QString &duration, QString group, const QString &groupId)
+void KdenliveDoc::slotCreateColorClip(const QString &name, const QString &color, const QString &duration, const QString &group, const QString &groupId)
{
m_clipManager->slotAddColorClipFile(name, color, duration, group, groupId);
setModified(true);
emit selectLastAddedClip(QString::number(m_clipManager->lastClipId()));
}
-void KdenliveDoc::slotCreateSlideshowClipFile(QMap <QString, QString> properties, QString group, const QString &groupId)
+void KdenliveDoc::slotCreateSlideshowClipFile(const QMap <QString, QString> &properties, const QString &group, const QString &groupId)
{
m_clipManager->slotAddSlideshowClipFile(properties, group, groupId);
setModified(true);
delete dia_ui;
}
-void KdenliveDoc::slotCreateTextTemplateClip(QString group, const QString &groupId, KUrl path)
+void KdenliveDoc::slotCreateTextTemplateClip(const QString &group, const QString &groupId, KUrl path)
{
QString titlesFolder = projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
if (path.isEmpty()) {
int KdenliveDoc::trackDuration(int ix)
{
- return m_tracksList.at(ix).duration;
+ return m_tracksList.at(ix).duration;
}
void KdenliveDoc::setTrackDuration(int ix, int duration)
m_tracksList[ix].duration = duration;
}
-void KdenliveDoc::insertTrack(int ix, TrackInfo type)
+void KdenliveDoc::insertTrack(int ix, const TrackInfo &type)
{
if (ix == -1) m_tracksList << type;
else m_tracksList.insert(ix, type);
m_tracksList.removeAt(ix);
}
-void KdenliveDoc::setTrackType(int ix, TrackInfo type)
+void KdenliveDoc::setTrackType(int ix, const TrackInfo &type)
{
if (ix < 0 || ix >= m_tracksList.count()) {
kWarning() << "SET Track Type outisde of range";
m_tracksList[ix].effectsList.append(effect);
}
-void KdenliveDoc::removeTrackEffect(int ix, QDomElement effect)
+void KdenliveDoc::removeTrackEffect(int ix, const QDomElement &effect)
{
if (ix < 0 || ix >= m_tracksList.count()) {
kWarning() << "Remove Track effect outisde of range";
//m_tracksList[trackIndex].effectsList.updateEffect(effect);
}
-void KdenliveDoc::enableTrackEffects(int trackIndex, QList <int> effectIndexes, bool disable)
+void KdenliveDoc::enableTrackEffects(int trackIndex, const QList <int> &effectIndexes, bool disable)
{
if (trackIndex < 0 || trackIndex >= m_tracksList.count()) {
kWarning() << "Set Track effect outisde of range";
EffectsList list = m_tracksList.at(trackIndex).effectsList;
QDomElement effect;
for (int i = 0; i < effectIndexes.count(); ++i) {
- effect = list.itemFromIndex(effectIndexes.at(i));
- if (!effect.isNull()) effect.setAttribute("disable", (int) disable);
+ effect = list.itemFromIndex(effectIndexes.at(i));
+ if (!effect.isNull()) effect.setAttribute("disable", (int) disable);
}
}
return list.hasEffect(tag, id);
}
-bool KdenliveDoc::saveCustomEffects(QDomNodeList customeffects)
+bool KdenliveDoc::saveCustomEffects(const QDomNodeList &customeffects)
{
QDomElement e;
QStringList importedEffects;
int maxchild = customeffects.count();
for (int i = 0; i < maxchild; ++i) {
e = customeffects.at(i).toElement();
- QString id = e.attribute("id");
- QString tag = e.attribute("tag");
+ const QString id = e.attribute("id");
+ const QString tag = e.attribute("tag");
if (!id.isEmpty()) {
// Check if effect exists or save it
if (MainWindow::customEffects.hasEffect(tag, id) == -1) {
}
}
}
- if (!importedEffects.isEmpty()) KMessageBox::informationList(kapp->activeWindow(), i18n("The following effects were imported from the project:"), importedEffects);
+ if (!importedEffects.isEmpty())
+ KMessageBox::informationList(kapp->activeWindow(), i18n("The following effects were imported from the project:"), importedEffects);
return (!importedEffects.isEmpty());
}
if (!QFile::copy(path, backupFile.path())) {
KMessageBox::information(kapp->activeWindow(), i18n("Cannot create backup copy:\n%1", backupFile.path()));
}
- }
+ }
}
void KdenliveDoc::cleanupBackupFiles()
class KdenliveDoc: public QObject
{
-Q_OBJECT public:
+ Q_OBJECT
+public:
KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap <QString, QString>& properties, const QMap <QString, QString>& metadata, const QPoint &tracks, Render *render, KTextEdit *notes, bool *openBackup, MainWindow *parent = 0, KProgressDialog *progressDialog = 0);
~KdenliveDoc();
/** @brief Adds a clip to the project tree.
* @return false if the user aborted the operation, true otherwise */
- bool addClip(QDomElement elem, QString clipId, bool createClipItem = true);
+ bool addClip(QDomElement elem, const QString &clipId, bool createClipItem = true);
/** @brief Updates information about a clip.
* @param elem the <kdenlive_producer />
* there yet), true otherwise
*
* If the clip wasn't added before, it tries to add it to the project. */
- bool addClipInfo(QDomElement elem, QDomElement orig, QString clipId);
+ bool addClipInfo(QDomElement elem, QDomElement orig, const QString &clipId);
void slotAddClipList(const KUrl::List urls, stringMap data = stringMap());
void deleteClip(const QString &clipId);
int getFramePos(QString duration);
const QString &profilePath() const;
MltVideoProfile mltProfile() const;
const QString description() const;
- void setUrl(KUrl url);
+ void setUrl(const KUrl &url);
/** @brief Updates the project profile.
* @return true if frame rate was changed */
bool saveSceneList(const QString &path, const QString &scene, const QStringList &expandedFolders, bool autosave = false);
int tracksCount() const;
TrackInfo trackInfoAt(int ix) const;
- void insertTrack(int ix, TrackInfo type);
+ void insertTrack(int ix, const TrackInfo &type);
void deleteTrack(int ix);
- void setTrackType(int ix, TrackInfo type);
+ void setTrackType(int ix, const TrackInfo &type);
const QList <TrackInfo> tracksList() const;
/** @brief Gets the number of audio and video tracks and returns them as a QPoint with x = video, y = audio. */
/** @brief Gets the list of renderer properties saved into the document. */
QMap <QString, QString> getRenderProperties() const;
void addTrackEffect(int ix, QDomElement effect);
- void removeTrackEffect(int ix, QDomElement effect);
+ void removeTrackEffect(int ix, const QDomElement &effect);
void setTrackEffect(int trackIndex, int effectIndex, QDomElement effect);
const EffectsList getTrackEffects(int ix);
/** @brief Enable / disable an effect in Kdenlive's xml list. */
- void enableTrackEffects(int trackIndex, QList <int> effectIndexes, bool disable);
+ void enableTrackEffects(int trackIndex, const QList<int> &effectIndexes, bool disable);
QDomElement getTrackEffect(int trackIndex, int effectIndex) const;
/** @brief Check if a track already contains a specific effect. */
int hasTrackEffect(int trackIndex, const QString &tag, const QString &id) const;
QDomDocument createEmptyDocument(QList <TrackInfo> tracks);
/** @brief Saves effects embedded in project file.
* @return True if effects were imported. */
- bool saveCustomEffects(QDomNodeList customeffects);
+ bool saveCustomEffects(const QDomNodeList &customeffects);
/** @brief Updates the project folder location entry in the kdenlive file dialogs to point to the current project folder. */
void updateProjectFolderPlacesEntry();
void cleanupBackupFiles();
public slots:
- void slotCreateXmlClip(const QString &name, const QDomElement xml, QString group, const QString &groupId);
- void slotCreateColorClip(const QString &name, const QString &color, const QString &duration, QString group, const QString &groupId);
- void slotCreateSlideshowClipFile(QMap <QString, QString> properties, QString group, const QString &groupId);
+ void slotCreateXmlClip(const QString &name, const QDomElement &xml, const QString &group, const QString &groupId);
+ void slotCreateColorClip(const QString &name, const QString &color, const QString &duration, const QString &group, const QString &groupId);
+ void slotCreateSlideshowClipFile(const QMap<QString, QString> &properties, const QString &group, const QString &groupId);
void slotCreateTextClip(QString group, const QString &groupId, const QString &templatePath = QString());
- void slotCreateTextTemplateClip(QString group, const QString &groupId, KUrl path);
+ void slotCreateTextTemplateClip(const QString &group, const QString &groupId, KUrl path);
/** @brief Sets the document as modified or up to date.
* @param mod (optional) true if the document has to be saved */