X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fkdenlivedoc.cpp;h=93eb9d2fc79c2d5261f3a0969ea53aff19c82143;hb=b1df63026140900ad2a9089b59437cab3a1c8134;hp=a04b6145b10d288e8597df86f93f719d0e8817f5;hpb=7931e3703f53c9eb89490b3d209c31674989cf95;p=kdenlive diff --git a/src/kdenlivedoc.cpp b/src/kdenlivedoc.cpp index a04b6145..93eb9d2f 100644 --- a/src/kdenlivedoc.cpp +++ b/src/kdenlivedoc.cpp @@ -27,9 +27,9 @@ #include "kdenlivedoc.h" - KdenliveDoc::KdenliveDoc(const KUrl &url, double fps, int width, int height, QWidget *parent):QObject(parent), m_render(NULL), m_url(url), m_fps(fps), m_width(width), m_height(height), m_projectName(NULL), m_commandStack(new KUndoStack()) { + m_clipManager = new ClipManager(this); if (!url.isEmpty()) { QString tmpFile; if(KIO::NetAccess::download(url.path(), tmpFile, parent)) @@ -99,6 +99,12 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, double fps, int width, int height, QWi KdenliveDoc::~KdenliveDoc() { delete m_commandStack; + delete m_clipManager; +} + +ClipManager *KdenliveDoc::clipManager() +{ + return m_clipManager; } KUndoStack *KdenliveDoc::commandStack() @@ -117,6 +123,16 @@ Render *KdenliveDoc::renderer() return m_render; } +void KdenliveDoc::updateClip(int id) +{ + emit updateClipDisplay(id); +} + +int KdenliveDoc::getFramePos(QString duration) +{ + return m_timecode.getFrameCount(duration, m_fps); +} + QString KdenliveDoc::producerName(int id) { QString result = "unnamed"; @@ -238,5 +254,34 @@ KUrl KdenliveDoc::url() return m_url; } +void KdenliveDoc::addClip(const QDomElement &elem, const int clipId) +{ + kDebug()<<"///////// DOCUM, CREATING NEW CLIP, ID:"<addClip(clip); + emit addProjectClip(clip); +} + +void KdenliveDoc::deleteClip(const uint clipId) +{ + m_clipManager->deleteClip(clipId); +} + +void KdenliveDoc::slotAddClipFile(const KUrl url, const QString group) +{ + kDebug()<<"///////// DOCUM, ADD CLP: "<slotAddClipFile(url, group); +} + +DocClipBase *KdenliveDoc::getBaseClip(int clipId) +{ + return m_clipManager->getClipById(clipId); +} + +void KdenliveDoc::slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group) +{ + m_clipManager->slotAddColorClipFile(name, color, duration, group); +} + #include "kdenlivedoc.moc"