* internal rework: switch clip id's from integer to string

* improve loading of older kdenlive documents

svn path=/branches/KDE4/; revision=2385
parent 34e669ba
......@@ -150,6 +150,6 @@ install(TARGETS kdenlive DESTINATION ${BIN_INSTALL_DIR})
install( FILES kdenliveui.rc DESTINATION ${DATA_INSTALL_DIR}/kdenlive )
install (FILES kdenlivesettings.kcfg DESTINATION share/config.kcfg)
install (FILES kdenlive.desktop DESTINATION share/applications/kde)
install (FILES application-x-kdenlive.svgz DESTINATION share/icons/oxygen/scalable/mimetypes)
install (FILES application-x-kdenlive.svgz video-mlt-playlist.svgz DESTINATION share/icons/oxygen/scalable/mimetypes)
......@@ -22,7 +22,7 @@
#include "addclipcommand.h"
#include "kdenlivedoc.h"
AddClipCommand::AddClipCommand(KdenliveDoc *doc, const QDomElement &xml, const uint id, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_doc(doc), m_xml(xml), m_id(id), m_doIt(doIt) {
AddClipCommand::AddClipCommand(KdenliveDoc *doc, const QDomElement &xml, const QString &id, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_doc(doc), m_xml(xml), m_id(id), m_doIt(doIt) {
if (doIt) setText(i18n("Add clip"));
else setText(i18n("Delete clip"));
}
......@@ -41,4 +41,3 @@ void AddClipCommand::redo() {
else m_doc->deleteClip(m_id);
}
#include "addclipcommand.moc"
......@@ -29,7 +29,7 @@ class KdenliveDoc;
class AddClipCommand : public QUndoCommand {
public:
AddClipCommand(KdenliveDoc *list, const QDomElement &xml, const uint id, bool doIt, QUndoCommand * parent = 0);
AddClipCommand(KdenliveDoc *list, const QDomElement &xml, const QString &id, bool doIt, QUndoCommand * parent = 0);
virtual void undo();
virtual void redo();
......@@ -37,7 +37,7 @@ public:
private:
KdenliveDoc *m_doc;
QDomElement m_xml;
uint m_id;
QString m_id;
bool m_doIt;
};
......
......@@ -45,4 +45,4 @@ void AddEffectCommand::redo() {
else m_view->deleteEffect(m_track, m_pos, m_effect);
}
#include "addeffectcommand.moc"
......@@ -22,7 +22,7 @@
#include "addfoldercommand.h"
#include "kdenlivedoc.h"
AddFolderCommand::AddFolderCommand(KdenliveDoc *doc, const QString folderName, int clipId, bool doIt)
AddFolderCommand::AddFolderCommand(KdenliveDoc *doc, const QString folderName, const QString &clipId, bool doIt)
: m_doc(doc), m_name(folderName), m_id(clipId), m_doIt(doIt) {
if (doIt) setText(i18n("Add folder"));
else setText(i18n("Delete folder"));
......@@ -39,4 +39,4 @@ void AddFolderCommand::redo() {
else m_doc->deleteFolder(m_name, m_id);
}
#include "addfoldercommand.moc"
......@@ -27,7 +27,7 @@ class KdenliveDoc;
class AddFolderCommand : public QUndoCommand {
public:
AddFolderCommand(KdenliveDoc *doc, const QString folderName, int clipId, bool doIt);
AddFolderCommand(KdenliveDoc *doc, const QString folderName, const QString &clipId, bool doIt);
virtual void undo();
virtual void redo();
......@@ -35,7 +35,7 @@ public:
private:
KdenliveDoc *m_doc;
QString m_name;
int m_id;
QString m_id;
bool m_doIt;
};
......
......@@ -19,7 +19,7 @@
#include "addmarkercommand.h"
#include "customtrackview.h"
AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const QString &oldcomment, const QString &comment, const int id, const GenTime &pos, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_oldcomment(oldcomment), m_comment(comment), m_id(id), m_pos(pos), m_doIt(doIt) {
AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const QString &oldcomment, const QString &comment, const QString &id, const GenTime &pos, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_oldcomment(oldcomment), m_comment(comment), m_id(id), m_pos(pos), m_doIt(doIt) {
if (m_comment.isEmpty()) setText(i18n("Delete marker"));
else if (m_oldcomment.isEmpty()) setText(i18n("Add marker"));
else setText(i18n("Edit marker"));
......@@ -38,4 +38,3 @@ void AddMarkerCommand::redo() {
m_doIt = true;
}
#include "addmarkercommand.moc"
......@@ -31,7 +31,7 @@ class CustomTrackView;
class AddMarkerCommand : public QUndoCommand {
public:
AddMarkerCommand(CustomTrackView *view, const QString &oldcomment, const QString &comment, const int id, const GenTime &pos, bool doIt, QUndoCommand * parent = 0);
AddMarkerCommand(CustomTrackView *view, const QString &oldcomment, const QString &comment, const QString &id, const GenTime &pos, bool doIt, QUndoCommand * parent = 0);
virtual void undo();
virtual void redo();
......@@ -39,7 +39,7 @@ private:
CustomTrackView *m_view;
QString m_oldcomment;
QString m_comment;
int m_id;
QString m_id;
GenTime m_pos;
bool m_doIt;
};
......
......@@ -22,7 +22,7 @@
#include "addtimelineclipcommand.h"
#include "customtrackview.h"
AddTimelineClipCommand::AddTimelineClipCommand(CustomTrackView *view, QDomElement xml, int clipId, ItemInfo info, EffectsList effects, bool doIt, bool doRemove, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_xml(xml), m_clipId(clipId), m_clipInfo(info), m_effects(effects), m_doIt(doIt), m_remove(doRemove) {
AddTimelineClipCommand::AddTimelineClipCommand(CustomTrackView *view, QDomElement xml, const QString &clipId, ItemInfo info, EffectsList effects, bool doIt, bool doRemove, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_xml(xml), m_clipId(clipId), m_clipInfo(info), m_effects(effects), m_doIt(doIt), m_remove(doRemove) {
if (!m_remove) setText(i18n("Add timeline clip"));
else setText(i18n("Delete timeline clip"));
}
......@@ -42,4 +42,4 @@ void AddTimelineClipCommand::redo() {
m_doIt = true;
}
#include "addtimelineclipcommand.moc"
......@@ -35,7 +35,7 @@ class CustomTrackView;
class AddTimelineClipCommand : public QUndoCommand {
public:
AddTimelineClipCommand(CustomTrackView *view, QDomElement xml, int clipId, ItemInfo info, EffectsList effects, bool doIt, bool doRemove, QUndoCommand * parent = 0);
AddTimelineClipCommand(CustomTrackView *view, QDomElement xml, const QString &clipId, ItemInfo info, EffectsList effects, bool doIt, bool doRemove, QUndoCommand * parent = 0);
virtual void undo();
virtual void redo();
......@@ -43,7 +43,7 @@ private:
CustomTrackView *m_view;
ItemInfo m_clipInfo;
EffectsList m_effects;
int m_clipId;
QString m_clipId;
QDomElement m_xml;
bool m_doIt;
bool m_remove;
......
......@@ -39,4 +39,4 @@ void AddTransitionCommand::redo() {
m_doIt = true;
}
#include "addtimelineclipcommand.moc"
......@@ -22,7 +22,7 @@
#include "changespeedcommand.h"
#include "customtrackview.h"
ChangeSpeedCommand::ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, double old_speed, double new_speed, int clipId, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_clipInfo(info), m_old_speed(old_speed), m_new_speed(new_speed), m_clipId(clipId), m_doIt(doIt) {
ChangeSpeedCommand::ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, double old_speed, double new_speed, const QString &clipId, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_clipInfo(info), m_old_speed(old_speed), m_new_speed(new_speed), m_clipId(clipId), m_doIt(doIt) {
setText(i18n("Adjust clip length"));
}
......@@ -39,4 +39,4 @@ void ChangeSpeedCommand::redo() {
m_doIt = true;
}
#include "changespeedcommand.moc"
......@@ -32,14 +32,14 @@ class CustomTrackView;
class ChangeSpeedCommand : public QUndoCommand {
public:
ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, double old_speed, double new_speed, int clipId, bool doIt, QUndoCommand * parent = 0);
ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, double old_speed, double new_speed, const QString &clipId, bool doIt, QUndoCommand * parent = 0);
virtual void undo();
virtual void redo();
private:
CustomTrackView *m_view;
ItemInfo m_clipInfo;
int m_clipId;
QString m_clipId;
bool m_doIt;
double m_old_speed;
double m_new_speed;
......
......@@ -67,7 +67,7 @@ ClipItem::ClipItem(DocClipBase *clip, ItemInfo info, double fps)
connect(this , SIGNAL(prepareAudioThumb(double, int, int, int)) , this, SLOT(slotPrepareAudioThumb(double, int, int, int)));
setBrush(QColor(141, 166, 215));
if (m_clipType == VIDEO || m_clipType == AV || m_clipType == SLIDESHOW) {
if (m_clipType == VIDEO || m_clipType == AV || m_clipType == SLIDESHOW || m_clipType == PLAYLIST) {
m_hasThumbs = true;
startThumbTimer = new QTimer(this);
startThumbTimer->setSingleShot(true);
......@@ -388,7 +388,7 @@ QString ClipItem::clipName() const {
return m_clipName;
}
int ClipItem::clipProducer() const {
const QString &ClipItem::clipProducer() const {
return m_producer;
}
......
......@@ -49,7 +49,7 @@ public:
void resizeStart(int posx);
void resizeEnd(int posx);
OPERATIONTYPE operationMode(QPointF pos);
int clipProducer() const;
const QString &clipProducer() const;
int clipType() const;
DocClipBase *baseClip() const;
QString clipName() const;
......@@ -112,7 +112,7 @@ private:
DocClipBase *m_clip;
OPERATIONTYPE m_resizeMode;
int m_grabPoint;
int m_producer;
QString m_producer;
CLIPTYPE m_clipType;
QString m_clipName;
QString m_effectNames;
......
......@@ -54,11 +54,11 @@ QList <DocClipBase*> ClipManager::documentClipList() {
void ClipManager::addClip(DocClipBase *clip) {
m_clipList.append(clip);
int id = clip->getId();
if (id >= m_clipIdCounter) m_clipIdCounter = id + 1;
QString id = clip->getId();
if (id.toInt() >= m_clipIdCounter) m_clipIdCounter = id.toInt() + 1;
}
void ClipManager::slotDeleteClip(uint clipId) {
void ClipManager::slotDeleteClip(const QString &clipId) {
for (int i = 0; i < m_clipList.count(); i++) {
if (m_clipList.at(i)->getId() == clipId) {
AddClipCommand *command = new AddClipCommand(m_doc, m_clipList.at(i)->toXML(), clipId, false);
......@@ -68,7 +68,7 @@ void ClipManager::slotDeleteClip(uint clipId) {
}
}
void ClipManager::deleteClip(uint clipId) {
void ClipManager::deleteClip(const QString &clipId) {
for (int i = 0; i < m_clipList.count(); i++) {
if (m_clipList.at(i)->getId() == clipId) {
m_clipList.removeAt(i);
......@@ -81,7 +81,7 @@ DocClipBase *ClipManager::getClipAt(int pos) {
return m_clipList.at(pos);
}
DocClipBase *ClipManager::getClipById(int clipId) {
DocClipBase *ClipManager::getClipById(const QString &clipId) {
//kDebug() << "++++ CLIP MAN, LOOKING FOR CLIP ID: " << clipId;
for (int i = 0; i < m_clipList.count(); i++) {
if (m_clipList.at(i)->getId() == clipId) {
......@@ -92,7 +92,7 @@ DocClipBase *ClipManager::getClipById(int clipId) {
return NULL;
}
void ClipManager::slotAddClipList(const KUrl::List urls, const QString group, const int groupId) {
void ClipManager::slotAddClipList(const KUrl::List urls, const QString group, const QString &groupId) {
QUndoCommand *addClips = new QUndoCommand();
addClips->setText("Add clips");
......@@ -113,13 +113,13 @@ void ClipManager::slotAddClipList(const KUrl::List urls, const QString group, co
prod.setAttribute("in", "0");
prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::image_duration()) - 1);
}
new AddClipCommand(m_doc, prod, id, true, addClips);
new AddClipCommand(m_doc, prod, QString::number(id), true, addClips);
}
}
m_doc->commandStack()->push(addClips);
}
void ClipManager::slotAddClipFile(const KUrl url, const QString group, const int groupId) {
void ClipManager::slotAddClipFile(const KUrl url, const QString group, const QString &groupId) {
kDebug() << "///// CLIP MANAGER, ADDING CLIP: " << url;
QDomDocument doc;
QDomElement prod = doc.createElement("producer");
......@@ -136,11 +136,11 @@ void ClipManager::slotAddClipFile(const KUrl url, const QString group, const int
prod.setAttribute("in", "0");
prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::image_duration()) - 1);
}
AddClipCommand *command = new AddClipCommand(m_doc, prod, id, true);
AddClipCommand *command = new AddClipCommand(m_doc, prod, QString::number(id), true);
m_doc->commandStack()->push(command);
}
void ClipManager::slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const int groupId) {
void ClipManager::slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const QString &groupId) {
QDomDocument doc;
QDomElement prod = doc.createElement("producer");
prod.setAttribute("mlt_service", "colour");
......@@ -155,11 +155,11 @@ void ClipManager::slotAddColorClipFile(const QString name, const QString color,
prod.setAttribute("groupname", group);
prod.setAttribute("groupid", groupId);
}
AddClipCommand *command = new AddClipCommand(m_doc, prod, id, true);
AddClipCommand *command = new AddClipCommand(m_doc, prod, QString::number(id), true);
m_doc->commandStack()->push(command);
}
void ClipManager::slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const int softness, QString group, const int groupId) {
void ClipManager::slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const int softness, QString group, const QString &groupId) {
QDomDocument doc;
QDomElement prod = doc.createElement("producer");
prod.setAttribute("resource", path);
......@@ -179,13 +179,13 @@ void ClipManager::slotAddSlideshowClipFile(const QString name, const QString pat
prod.setAttribute("groupname", group);
prod.setAttribute("groupid", groupId);
}
AddClipCommand *command = new AddClipCommand(m_doc, prod, id, true);
AddClipCommand *command = new AddClipCommand(m_doc, prod, QString::number(id), true);
m_doc->commandStack()->push(command);
}
void ClipManager::slotAddTextClipFile(const QString path, const QString xml, const QString group, const int groupId) {
void ClipManager::slotAddTextClipFile(const QString path, const QString xml, const QString group, const QString &groupId) {
kDebug() << "///// CLIP MANAGER, ADDING CLIP: " << path;
QDomDocument doc;
QDomElement prod = doc.createElement("producer");
......@@ -202,7 +202,7 @@ void ClipManager::slotAddTextClipFile(const QString path, const QString xml, con
prod.setAttribute("transparency", "1");
prod.setAttribute("in", "0");
prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::image_duration()) - 1);
AddClipCommand *command = new AddClipCommand(m_doc, prod, id, true);
AddClipCommand *command = new AddClipCommand(m_doc, prod, QString::number(id), true);
m_doc->commandStack()->push(command);
}
......
......@@ -47,14 +47,14 @@ Q_OBJECT public:
virtual ~ ClipManager();
void addClip(DocClipBase *clip);
DocClipBase *getClipAt(int pos);
void deleteClip(uint clipId);
void slotAddClipFile(const KUrl url, const QString group, const int groupId);
void slotAddClipList(const KUrl::List urls, const QString group, const int groupId);
void slotAddTextClipFile(const QString path, const QString xml, const QString group, const int groupId);
void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const int groupId);
void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const int softness, const QString group, const int groupId);
DocClipBase *getClipById(int clipId);
void slotDeleteClip(uint clipId);
void deleteClip(const QString &clipId);
void slotAddClipFile(const KUrl url, const QString group, const QString &groupId);
void slotAddClipList(const KUrl::List urls, const QString group, const QString &groupId);
void slotAddTextClipFile(const QString path, const QString xml, const QString group, const QString &groupId);
void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const QString &groupId);
void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const int softness, const QString group, const QString &groupId);
DocClipBase *getClipById(const QString &clipId);
void slotDeleteClip(const QString & clipId);
void setThumbsProgress(const QString &message, int progress);
void checkAudioThumbs();
QList <DocClipBase*> documentClipList();
......
......@@ -179,8 +179,7 @@ void ClipProperties::slotAddMarker() {
CommentedTime marker(GenTime(), i18n("Marker"));
MarkerDialog d(m_clip, marker, m_tc, this);
if (d.exec() == QDialog::Accepted) {
int id = m_clip->getId();
emit addMarker(id, d.newMarker().time(), d.newMarker().comment());
emit addMarker(m_clip->getId(), d.newMarker().time(), d.newMarker().comment());
}
QTimer::singleShot(500, this, SLOT(slotFillMarkersList()));
}
......@@ -191,8 +190,7 @@ void ClipProperties::slotEditMarker() {
if (pos < 0 || pos > marks.count() - 1) return;
MarkerDialog d(m_clip, marks.at(pos), m_tc, this);
if (d.exec() == QDialog::Accepted) {
int id = m_clip->getId();
emit addMarker(id, d.newMarker().time(), d.newMarker().comment());
emit addMarker(m_clip->getId(), d.newMarker().time(), d.newMarker().comment());
}
QTimer::singleShot(500, this, SLOT(slotFillMarkersList()));
}
......@@ -201,13 +199,12 @@ void ClipProperties::slotDeleteMarker() {
QList < CommentedTime > marks = m_clip->commentedSnapMarkers();
int pos = m_view.markers_list->currentIndex().row();
if (pos < 0 || pos > marks.count() - 1) return;
int id = m_clip->getId();
emit addMarker(id, marks.at(pos).time(), QString());
emit addMarker(m_clip->getId(), marks.at(pos).time(), QString());
QTimer::singleShot(500, this, SLOT(slotFillMarkersList()));
}
int ClipProperties::clipId() const {
const QString &ClipProperties::clipId() const {
return m_clip->getId();
}
......
......@@ -34,7 +34,7 @@ class ClipProperties : public QDialog {
public:
ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidget * parent = 0);
QMap <QString, QString> properties();
int clipId() const;
const QString &clipId() const;
bool needsTimelineRefresh() const;
private slots:
......@@ -54,7 +54,7 @@ private:
bool m_clipNeedsRefresh;
signals:
void addMarker(int, GenTime, QString);
void addMarker(const QString &, GenTime, QString);
};
......
......@@ -753,8 +753,8 @@ void CustomTrackView::dragEnterEvent(QDragEnterEvent * event) {
//TODO: drop of several clips
for (int i = 0; i < ids.size(); ++i) {
}
DocClipBase *clip = m_document->getBaseClip(ids.at(0).toInt());
if (clip == NULL) kDebug() << " WARNING))))))))) CLIP NOT FOUND : " << ids.at(0).toInt();
DocClipBase *clip = m_document->getBaseClip(ids.at(0));
if (clip == NULL) kDebug() << " WARNING))))))))) CLIP NOT FOUND : " << ids.at(0);
addItem(clip, event->pos());
event->acceptProposedAction();
} else QGraphicsView::dragEnterEvent(event);
......@@ -1095,7 +1095,7 @@ void CustomTrackView::slotSwitchTrackVideo(int ix) {
m_document->renderer()->mltChangeTrackState(tracknumber, m_scene->m_tracksList.at(tracknumber - 1).isMute, m_scene->m_tracksList.at(tracknumber - 1).isBlind);
}
void CustomTrackView::deleteClip(int clipId) {
void CustomTrackView::deleteClip(const QString &clipId) {
QList<QGraphicsItem *> itemList = items();
for (int i = 0; i < itemList.count(); i++) {
if (itemList.at(i)->type() == AVWIDGET) {
......@@ -1410,7 +1410,7 @@ void CustomTrackView::changeClipSpeed() {
m_commandStack->push(changeSelected);
}
void CustomTrackView::doChangeClipSpeed(ItemInfo info, double speed, int id) {
void CustomTrackView::doChangeClipSpeed(ItemInfo info, double speed, const QString &id) {
DocClipBase *baseclip = m_document->clipManager()->getClipById(id);
ClipItem *item = getClipItemAt((int) info.startPos.frames(m_document->fps()) + 1, info.track);
info.track = m_scene->m_tracksList.count() - item->track();
......@@ -1440,7 +1440,7 @@ void CustomTrackView::cutSelectedClips() {
}
}
void CustomTrackView::addClip(QDomElement xml, int clipId, ItemInfo info, EffectsList effects) {
void CustomTrackView::addClip(QDomElement xml, const QString &clipId, ItemInfo info, EffectsList effects) {
DocClipBase *baseclip = m_document->clipManager()->getClipById(clipId);
ClipItem *item = new ClipItem(baseclip, info, m_document->fps());
item->setEffectList(effects);
......@@ -1455,7 +1455,7 @@ void CustomTrackView::addClip(QDomElement xml, int clipId, ItemInfo info, Effect
m_document->renderer()->doRefresh();
}
void CustomTrackView::slotUpdateClip(int clipId) {
void CustomTrackView::slotUpdateClip(const QString &clipId) {
QList<QGraphicsItem *> list = scene()->items();
ClipItem *clip = NULL;
for (int i = 0; i < list.size(); ++i) {
......@@ -1718,7 +1718,7 @@ void CustomTrackView::slotAddClipMarker() {
GenTime pos = GenTime(m_cursorPos, m_document->fps());
if (item->startPos() > pos || item->endPos() < pos) return;
ClipItem *clip = (ClipItem *) item;
int id = clip->baseClip()->getId();
QString id = clip->baseClip()->getId();
GenTime position = pos - item->startPos() + item->cropStart();
CommentedTime marker(position, i18n("Marker"));
MarkerDialog d(clip->baseClip(), marker, m_document->timecode(), this);
......@@ -1727,7 +1727,7 @@ void CustomTrackView::slotAddClipMarker() {
}
}
void CustomTrackView::slotAddClipMarker(int id, GenTime t, QString c) {
void CustomTrackView::slotAddClipMarker(const QString &id, GenTime t, QString c) {
QString oldcomment = m_document->clipManager()->getClipById(id)->markerComment(t);
AddMarkerCommand *command = new AddMarkerCommand(this, oldcomment, c, id, t, true);
m_commandStack->push(command);
......@@ -1751,7 +1751,7 @@ void CustomTrackView::slotDeleteClipMarker() {
return;
}
ClipItem *clip = (ClipItem *) item;
int id = clip->baseClip()->getId();
QString id = clip->baseClip()->getId();
GenTime position = pos - item->startPos() + item->cropStart();
QString comment = clip->baseClip()->markerComment(position);
if (comment.isEmpty()) {
......@@ -1782,7 +1782,7 @@ void CustomTrackView::slotDeleteAllClipMarkers() {
emit displayMessage(i18n("Clip has no markers"), ErrorMessage);
return;
}
int id = clip->baseClip()->getId();
QString id = clip->baseClip()->getId();
QUndoCommand *deleteMarkers = new QUndoCommand();
deleteMarkers->setText("Delete clip markers");
......@@ -1810,7 +1810,7 @@ void CustomTrackView::slotEditClipMarker() {
return;
}
ClipItem *clip = (ClipItem *) item;
int id = clip->baseClip()->getId();
QString id = clip->baseClip()->getId();
GenTime position = pos - item->startPos() + item->cropStart();
QString oldcomment = clip->baseClip()->markerComment(position);
if (oldcomment.isEmpty()) {
......@@ -1835,7 +1835,7 @@ void CustomTrackView::slotEditClipMarker() {
}
}
void CustomTrackView::addMarker(const int id, const GenTime &pos, const QString comment) {
void CustomTrackView::addMarker(const QString &id, const GenTime &pos, const QString comment) {
DocClipBase *base = m_document->clipManager()->getClipById(id);
if (!comment.isEmpty()) base->addSnapMarker(pos, comment);
else base->deleteSnapMarker(pos);
......
......@@ -56,15 +56,15 @@ public:
/** move transition, startPos = (old start, old end), endPos = (new start, new end) */
void moveTransition(const ItemInfo start, const ItemInfo end);
void resizeClip(const ItemInfo start, const ItemInfo end);
void addClip(QDomElement xml, int clipId, ItemInfo info, EffectsList list = EffectsList());
void addClip(QDomElement xml, const QString &clipId, ItemInfo info, EffectsList list = EffectsList());
void deleteClip(ItemInfo info);
void slotAddClipMarker();
void slotEditClipMarker();
void slotDeleteClipMarker();
void slotDeleteAllClipMarkers();
void addMarker(const int id, const GenTime &pos, const QString comment);
void addMarker(const QString &id, const GenTime &pos, const QString comment);
void setScale(double scaleFactor);
void deleteClip(int clipId);
void deleteClip(const QString &clipId);
void slotAddEffect(QDomElement effect, GenTime pos, int track);
void addEffect(int track, GenTime pos, QDomElement effect);
void deleteEffect(int track, GenTime pos, QDomElement effect);
......@@ -94,7 +94,7 @@ public:
void clipStart();
void clipEnd();
void changeClipSpeed();
void doChangeClipSpeed(ItemInfo info, double speed, int id);
void doChangeClipSpeed(ItemInfo info, double speed, const QString &id);
public slots:
void setCursorPos(int pos, bool seek = true);
......@@ -111,8 +111,8 @@ public slots:
void slotTransitionUpdated(Transition *, QDomElement);
void slotSwitchTrackAudio(int ix);
void slotSwitchTrackVideo(int ix);
void slotUpdateClip(int clipId);
void slotAddClipMarker(int id, GenTime t, QString c);
void slotUpdateClip(const QString &clipId);
void slotAddClipMarker(const QString &id, GenTime t, QString c);
bool addGuide(const GenTime pos, const QString &comment);
void slotAddGuide();
void slotEditGuide(CommentedTime guide);
......
......@@ -22,12 +22,11 @@
#include "kthumb.h"
#include "clipmanager.h"
DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, uint id):
DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, const QString &id):
m_id(id), m_description(QString()), m_refcount(0), m_audioThumbCreated(false), m_duration(GenTime()), m_thumbProd(NULL), m_audioTimer(NULL), m_clipProducer(NULL) {
int type = xml.attribute("type").toInt();
m_clipType = (CLIPTYPE) type;
m_name = xml.attribute("name");
m_id = id;
QDomNamedNodeMap attributes = xml.attributes();
for (unsigned int i = 0; i < attributes.count(); i++) {
......@@ -102,11 +101,11 @@ const QString & DocClipBase::name() const {
return m_name;
}
uint DocClipBase::getId() const {
const QString &DocClipBase::getId() const {
return m_id;
}
void DocClipBase::setId(const uint &newId) {
void DocClipBase::setId(const QString &newId) {
m_id = newId;
}
......
......@@ -54,7 +54,7 @@ Q_OBJECT public:
* done here. If a new clip type is added then it should be possible to combine it with both audio
* and video. */