From: Jean-Baptiste Mardelle Date: Tue, 2 Dec 2008 10:49:07 +0000 (+0000) Subject: Add track should work, delete track is still to do X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4f4c324719ed2db1b759112723409051890937d1;p=kdenlive Add track should work, delete track is still to do svn path=/branches/KDE4/; revision=2744 --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eba7e5d8..205d5f51 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -60,6 +60,7 @@ kde4_add_ui_files(kdenlive_UI widgets/wizardstandard_ui.ui widgets/wizardextra_ui.ui widgets/spacerdialog_ui.ui + widgets/addtrack_ui.ui ) set(kdenlive_SRCS @@ -135,6 +136,7 @@ set(kdenlive_SRCS editclipcommand.cpp insertspacecommand.cpp spacerdialog.cpp + addtrackcommand.cpp ) if(NO_JOGSHUTTLE) diff --git a/src/addtrackcommand.cpp b/src/addtrackcommand.cpp new file mode 100644 index 00000000..184d0661 --- /dev/null +++ b/src/addtrackcommand.cpp @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#include + +#include "addtrackcommand.h" +#include "customtrackview.h" + +AddTrackCommand::AddTrackCommand(CustomTrackView *view, int ix, TrackInfo info, bool addTrack, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_ix(ix), m_info(info), m_addTrack(addTrack), m_doIt(doIt) { + if (addTrack) setText(i18n("Add track")); + else setText(i18n("Delete track")); +} + + +// virtual +void AddTrackCommand::undo() { +// kDebug()<<"---- undoing action"; + m_doIt = true; + if (m_addTrack) m_view->deleteTimelineTrack(m_ix); + else m_view->addTimelineTrack(m_ix, m_info); +} +// virtual +void AddTrackCommand::redo() { + kDebug() << "---- redoing action"; + if (m_doIt) { + if (m_addTrack) m_view->addTimelineTrack(m_ix, m_info); + else m_view->deleteTimelineTrack(m_ix); + } + m_doIt = true; +} + diff --git a/src/addtrackcommand.h b/src/addtrackcommand.h new file mode 100644 index 00000000..787a03f7 --- /dev/null +++ b/src/addtrackcommand.h @@ -0,0 +1,48 @@ +/*************************************************************************** + * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + + +#ifndef ADDTRACKCOMMAND_H +#define ADDTRACKCOMMAND_H + +#include +#include +#include + +#include +#include "definitions.h" + +class CustomTrackView; + +class AddTrackCommand : public QUndoCommand { +public: + AddTrackCommand(CustomTrackView *view, int ix, TrackInfo info, bool addTrack, bool doIt, QUndoCommand * parent = 0); + virtual void undo(); + virtual void redo(); + +private: + CustomTrackView *m_view; + int m_ix; + bool m_doIt; + bool m_addTrack; + TrackInfo m_info; +}; + +#endif + diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index 4d59c1ef..f41af69e 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -63,6 +63,8 @@ #include "abstractgroupitem.h" #include "insertspacecommand.h" #include "spacerdialog.h" +#include "addtrackcommand.h" +#include "ui_addtrack_ui.h" //TODO: // disable animation if user asked it in KDE's global settings @@ -794,7 +796,7 @@ void CustomTrackView::mouseDoubleClickEvent(QMouseEvent *event) { endInfo.startPos = d.startPos(); endInfo.endPos = m_dragItem->endPos() + (endInfo.startPos - startInfo.startPos); endInfo.track = m_dragItem->track(); - MoveClipCommand *command = new MoveClipCommand(this, startInfo, endInfo, true); + MoveClipCommand *command = new MoveClipCommand(this, startInfo, endInfo, false, true); m_commandStack->push(command); } else { //TODO: move transition @@ -1308,8 +1310,9 @@ int CustomTrackView::duration() const { return m_projectDuration; } -void CustomTrackView::addTrack(TrackInfo type) { - m_scene->m_tracksList << type; +void CustomTrackView::addTrack(TrackInfo type, int ix) { + if (ix == -1) m_scene->m_tracksList << type; + else m_scene->m_tracksList.insert(ix, type); m_cursorLine->setLine(m_cursorLine->line().x1(), 0, m_cursorLine->line().x1(), m_tracksHeight * m_scene->m_tracksList.count()); setSceneRect(0, 0, sceneRect().width(), m_tracksHeight * m_scene->m_tracksList.count()); verticalScrollBar()->setMaximum(m_tracksHeight * m_scene->m_tracksList.count()); @@ -1513,7 +1516,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event) { ClipItem *item = static_cast (m_dragItem); bool success = m_document->renderer()->mltMoveClip((int)(m_scene->m_tracksList.count() - m_dragItemInfo.track), (int)(m_scene->m_tracksList.count() - m_dragItem->track()), (int) m_dragItemInfo.startPos.frames(m_document->fps()), (int)(m_dragItem->startPos().frames(m_document->fps())), item->baseClip()->producer(info.track)); if (success) { - MoveClipCommand *command = new MoveClipCommand(this, m_dragItemInfo, info, false); + MoveClipCommand *command = new MoveClipCommand(this, m_dragItemInfo, info, false, false); m_commandStack->push(command); if (item->baseClip()->isTransparent()) { // Also move automatic transition @@ -1526,7 +1529,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event) { } } else { // undo last move and emit error message - MoveClipCommand *command = new MoveClipCommand(this, info, m_dragItemInfo, true); + MoveClipCommand *command = new MoveClipCommand(this, info, m_dragItemInfo, false, true); m_commandStack->push(command); emit displayMessage(i18n("Cannot move clip to position %1seconds", QString::number(m_dragItemInfo.startPos.seconds(), 'g', 2)), ErrorMessage); } @@ -1879,7 +1882,7 @@ Transition *CustomTrackView::getTransitionItemAt(GenTime pos, int track) { return getTransitionItemAt(framepos, track); } -void CustomTrackView::moveClip(const ItemInfo start, const ItemInfo end) { +void CustomTrackView::moveClip(const ItemInfo start, const ItemInfo end, bool forceProducer) { ClipItem *item = getClipItemAt((int) start.startPos.frames(m_document->fps()) + 1, start.track); if (!item) { emit displayMessage(i18n("Cannot move clip at time: %1s on track %2", QString::number(start.startPos.seconds(), 'g', 2), start.track), ErrorMessage); @@ -1888,7 +1891,7 @@ void CustomTrackView::moveClip(const ItemInfo start, const ItemInfo end) { } //kDebug() << "----------------  Move CLIP FROM: " << startPos.x() << ", END:" << endPos.x() << ",TRACKS: " << startPos.y() << " TO " << endPos.y(); - bool success = m_document->renderer()->mltMoveClip((int)(m_scene->m_tracksList.count() - start.track), (int)(m_scene->m_tracksList.count() - end.track), (int) start.startPos.frames(m_document->fps()), (int)end.startPos.frames(m_document->fps()), item->baseClip()->producer(end.track)); + bool success = m_document->renderer()->mltMoveClip((int)(m_scene->m_tracksList.count() - start.track), (int)(m_scene->m_tracksList.count() - end.track), (int) start.startPos.frames(m_document->fps()), (int)end.startPos.frames(m_document->fps()), item->baseClip()->producer(end.track), forceProducer); if (success) { item->setPos((int) end.startPos.frames(m_document->fps()), (int)(end.track * m_tracksHeight + 1)); if (item->baseClip()->isTransparent()) { @@ -2592,10 +2595,79 @@ void CustomTrackView::slotUpdateAllThumbs() { } } -void CustomTrackView::slotInsertTrack() { +void CustomTrackView::slotInsertTrack(int ix) { + kDebug() << "// INSERTING TRK: " << ix; + + QDialog d(parentWidget()); + Ui::AddTrack_UI view; + view.setupUi(&d); + view.track_nb->setMaximum(m_scene->m_tracksList.count() - 1); + view.track_nb->setValue(ix); + + if (d.exec() == QDialog::Accepted) { + if (view.before_select->currentIndex() == 2) { + kDebug() << "// AFTER"; + ix++; + } + TrackInfo info; + if (view.video_track->isChecked()) { + info.type = VIDEOTRACK; + info.isMute = false; + info.isBlind = false; + } else { + info.type = AUDIOTRACK; + info.isMute = false; + info.isBlind = false; + } + AddTrackCommand* command = new AddTrackCommand(this, ix, info, true, true); + m_commandStack->push(command); + } +} + +void CustomTrackView::slotDeleteTrack(int ix) { +} + +void CustomTrackView::addTimelineTrack(int ix, TrackInfo info) { + double startY = ix * m_tracksHeight + 1 + m_tracksHeight / 2; + QRectF r(0, startY, sceneRect().width(), sceneRect().height() - startY); + QList selection = m_scene->items(r); + kDebug() << "// TRK RECT: " << r << ", ITEMS: " << selection.count(); + addTrack(info, m_scene->m_tracksList.count() - ix); + QUndoCommand *addTrack = new QUndoCommand(); + addTrack->setText("Add track"); + + resetSelectionGroup(); + + m_selectionGroup = new AbstractGroupItem(m_document->fps()); + scene()->addItem(m_selectionGroup); + for (int i = 0; i < selection.count(); i++) { + if (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET) + m_selectionGroup->addToGroup(selection.at(i)); + } + // insert track in MLT playlist + m_document->renderer()->mltInsertTrack(m_scene->m_tracksList.count() - ix); + + // Move graphic items + m_selectionGroup->setPos(m_selectionGroup->pos().x(), m_selectionGroup->pos().y() + m_tracksHeight); + + // adjust track number + QList children = m_selectionGroup->childItems(); + for (int i = 0; i < children.count(); i++) { + AbstractClipItem *item = static_cast (children.at(i)); + item->updateItem(); + if (item->type() == AV || item->type() == AUDIO) { + // We add a move clip command so that we get the correct producer for new track number + ItemInfo clipinfo = item->info(); + MoveClipCommand(this, clipinfo, clipinfo, true, true, addTrack); + } + } + resetSelectionGroup(); + m_commandStack->push(addTrack); + update(); + emit trackHeightChanged(); } -void CustomTrackView::slotDeleteTrack() { +void CustomTrackView::deleteTimelineTrack(int ix) { } #include "customtrackview.moc" diff --git a/src/customtrackview.h b/src/customtrackview.h index 67f0dc3f..742c7e87 100644 --- a/src/customtrackview.h +++ b/src/customtrackview.h @@ -48,11 +48,11 @@ public: virtual void mouseReleaseEvent(QMouseEvent * event); virtual void mouseMoveEvent(QMouseEvent * event); virtual void mouseDoubleClickEvent(QMouseEvent *event); - void addTrack(TrackInfo type); + void addTrack(TrackInfo type, int ix = -1); void removeTrack(); int cursorPos(); void checkAutoScroll(); - void moveClip(const ItemInfo start, const ItemInfo end); + void moveClip(const ItemInfo start, const ItemInfo end, bool forceProducer); /** 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); @@ -100,6 +100,8 @@ public: void slotRemoveSpace(); void insertSpace(const GenTime &pos, int track, const GenTime duration, bool add); ClipItem *getActiveClipUnderCursor(bool allowOutsideCursor = false) const; + void addTimelineTrack(int ix, TrackInfo info); + void deleteTimelineTrack(int ix); public slots: void setCursorPos(int pos, bool seek = true); @@ -131,8 +133,8 @@ public slots: void pasteClipEffects(); void slotUpdateAllThumbs(); void slotCheckPositionScrolling(); - void slotInsertTrack(); - void slotDeleteTrack(); + void slotInsertTrack(int ix); + void slotDeleteTrack(int ix); protected: virtual void drawBackground(QPainter * painter, const QRectF & rect); diff --git a/src/moveclipcommand.cpp b/src/moveclipcommand.cpp index 6767f673..1cc459bb 100644 --- a/src/moveclipcommand.cpp +++ b/src/moveclipcommand.cpp @@ -21,8 +21,7 @@ #include "moveclipcommand.h" #include "customtrackview.h" -MoveClipCommand::MoveClipCommand(CustomTrackView *view, const ItemInfo start, const ItemInfo end, bool doIt) - : m_view(view), m_startPos(start), m_endPos(end), m_doIt(doIt) { +MoveClipCommand::MoveClipCommand(CustomTrackView *view, const ItemInfo start, const ItemInfo end, bool forceProducer, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_startPos(start), m_endPos(end), m_forceProducer(forceProducer), m_doIt(doIt) { setText(i18n("Move clip")); } @@ -31,13 +30,13 @@ MoveClipCommand::MoveClipCommand(CustomTrackView *view, const ItemInfo start, co void MoveClipCommand::undo() { // kDebug()<<"---- undoing action"; m_doIt = true; - m_view->moveClip(m_endPos, m_startPos); + m_view->moveClip(m_endPos, m_startPos, m_forceProducer); } // virtual void MoveClipCommand::redo() { kDebug() << "---- redoing action"; if (m_doIt) - m_view->moveClip(m_startPos, m_endPos); + m_view->moveClip(m_startPos, m_endPos, m_forceProducer); m_doIt = true; } diff --git a/src/moveclipcommand.h b/src/moveclipcommand.h index 7cf002ec..6c785a8c 100644 --- a/src/moveclipcommand.h +++ b/src/moveclipcommand.h @@ -32,7 +32,7 @@ class CustomTrackView; class MoveClipCommand : public QUndoCommand { public: - MoveClipCommand(CustomTrackView *view, const ItemInfo start, const ItemInfo end, bool doIt); + MoveClipCommand(CustomTrackView *view, const ItemInfo start, const ItemInfo end, bool forceProducer, bool doIt, QUndoCommand * parent = 0); virtual void undo(); virtual void redo(); @@ -41,6 +41,7 @@ private: const ItemInfo m_startPos; const ItemInfo m_endPos; bool m_doIt; + bool m_forceProducer; }; #endif diff --git a/src/moveeffectcommand.cpp b/src/moveeffectcommand.cpp index 88df05ac..cc0e90ae 100644 --- a/src/moveeffectcommand.cpp +++ b/src/moveeffectcommand.cpp @@ -22,8 +22,7 @@ #include "moveeffectcommand.h" #include "customtrackview.h" -MoveEffectCommand::MoveEffectCommand(CustomTrackView *view, const int track, GenTime pos, int oldPos, int newPos, bool doIt) - : m_view(view), m_track(track), m_pos(pos), m_oldindex(oldPos), m_newindex(newPos), m_doIt(doIt) { +MoveEffectCommand::MoveEffectCommand(CustomTrackView *view, const int track, GenTime pos, int oldPos, int newPos, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_track(track), m_pos(pos), m_oldindex(oldPos), m_newindex(newPos), m_doIt(doIt) { /* QString effectName; QDomNode namenode = effect.elementsByTagName("name").item(0); if (!namenode.isNull()) effectName = i18n(namenode.toElement().text().toUtf8().data()); diff --git a/src/moveeffectcommand.h b/src/moveeffectcommand.h index e6f18020..1ac6946b 100644 --- a/src/moveeffectcommand.h +++ b/src/moveeffectcommand.h @@ -30,7 +30,7 @@ class CustomTrackView; class MoveEffectCommand : public QUndoCommand { public: - MoveEffectCommand(CustomTrackView *view, const int track, GenTime pos, int oldPos, int newPos, bool doIt); + MoveEffectCommand(CustomTrackView *view, const int track, GenTime pos, int oldPos, int newPos, bool doIt, QUndoCommand * parent = 0); virtual int id() const; virtual bool mergeWith(const QUndoCommand * command); diff --git a/src/projectlist.cpp b/src/projectlist.cpp index cf5fb043..17b247da 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -58,6 +58,7 @@ ProjectList::ProjectList(QWidget *parent) QWidget *vbox = new QWidget; listView = new ProjectListView(this);; QVBoxLayout *layout = new QVBoxLayout; + layout->setContentsMargins(0, 0, 0, 0); m_clipIdCounter = 0; // setup toolbar searchView = new KTreeWidgetSearchLine(this); diff --git a/src/renderer.cpp b/src/renderer.cpp index 13b13725..c85c8ab7 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -2095,12 +2095,12 @@ bool Render::mltResizeClipStart(ItemInfo info, GenTime diff) { return true; } -bool Render::mltMoveClip(int startTrack, int endTrack, GenTime moveStart, GenTime moveEnd, Mlt::Producer *prod) { - return mltMoveClip(startTrack, endTrack, (int) moveStart.frames(m_fps), (int) moveEnd.frames(m_fps), prod); +bool Render::mltMoveClip(int startTrack, int endTrack, GenTime moveStart, GenTime moveEnd, Mlt::Producer *prod, bool forceProducer) { + return mltMoveClip(startTrack, endTrack, (int) moveStart.frames(m_fps), (int) moveEnd.frames(m_fps), prod, forceProducer); } -bool Render::mltMoveClip(int startTrack, int endTrack, int moveStart, int moveEnd, Mlt::Producer *prod) { +bool Render::mltMoveClip(int startTrack, int endTrack, int moveStart, int moveEnd, Mlt::Producer *prod, bool forceProducer) { m_isBlocked = true; m_mltConsumer->set("refresh", 0); @@ -2116,22 +2116,27 @@ bool Render::mltMoveClip(int startTrack, int endTrack, int moveStart, int moveEn bool checkLength = false; if (endTrack == startTrack) { //mlt_service_lock(service.get_service()); - Mlt::Producer clipProducer(trackPlaylist.replace_with_blank(clipIndex)); - - if (!trackPlaylist.is_blank_at(moveEnd)) { - // error, destination is not empty - //int ix = trackPlaylist.get_clip_index_at(moveEnd); - kDebug() << "// ERROR MOVING CLIP TO : " << moveEnd; - mlt_service_unlock(m_mltConsumer->get_service()); - m_isBlocked = false; - return false; + if (forceProducer) { + Mlt::Producer clipProducer(trackPlaylist.replace_with_blank(clipIndex)); + trackPlaylist.insert(clipProducer, moveEnd, clipProducer.get_in(), clipProducer.get_out()); } else { - trackPlaylist.consolidate_blanks(0); - int newIndex = trackPlaylist.insert_at(moveEnd, clipProducer, 1); - /*if (QString(clipProducer.parent().get("transparency")).toInt() == 1) { - mltMoveTransparency(moveStart, moveEnd, startTrack, endTrack, QString(clipProducer.parent().get("id")).toInt()); - }*/ - if (newIndex + 1 == trackPlaylist.count()) checkLength = true; + Mlt::Producer clipProducer(trackPlaylist.replace_with_blank(clipIndex)); + + if (!trackPlaylist.is_blank_at(moveEnd)) { + // error, destination is not empty + //int ix = trackPlaylist.get_clip_index_at(moveEnd); + kDebug() << "// ERROR MOVING CLIP TO : " << moveEnd; + mlt_service_unlock(m_mltConsumer->get_service()); + m_isBlocked = false; + return false; + } else { + trackPlaylist.consolidate_blanks(0); + int newIndex = trackPlaylist.insert_at(moveEnd, clipProducer, 1); + /*if (QString(clipProducer.parent().get("transparency")).toInt() == 1) { + mltMoveTransparency(moveStart, moveEnd, startTrack, endTrack, QString(clipProducer.parent().get("id")).toInt()); + }*/ + if (newIndex + 1 == trackPlaylist.count()) checkLength = true; + } } //mlt_service_unlock(service.get_service()); } else { @@ -2577,5 +2582,73 @@ QList Render::producersList() { return prods; } +void Render::mltInsertTrack(int ix) { + blockSignals(true); + m_isBlocked = true; + + m_mltConsumer->set("refresh", 0); + mlt_service_lock(m_mltConsumer->get_service()); + Mlt::Service service(m_mltProducer->parent().get_service()); + if (service.type() != tractor_type) kWarning() << "// TRACTOR PROBLEM"; + + Mlt::Tractor tractor(service); + Mlt::Playlist *playlist = new Mlt::Playlist(); + int ct = tractor.count(); + kDebug() << "// TRACK INSERT: " << ix << ", MAX: " << ct; + int pos = ix; + if (pos < ct) { + Mlt::Producer *prodToMove = new Mlt::Producer(tractor.track(pos)); + tractor.set_track(*playlist, pos); + pos++; + for (; pos <= ct; pos++) { + Mlt::Producer *prodToMove2 = new Mlt::Producer(tractor.track(pos)); + tractor.set_track(*prodToMove, pos); + prodToMove = prodToMove2; + } + } else tractor.set_track(*playlist, ix); + + // Move transitions + mlt_service serv = m_mltProducer->parent().get_service(); + mlt_service nextservice = mlt_service_get_producer(serv); + mlt_properties properties = MLT_SERVICE_PROPERTIES(nextservice); + QString mlt_type = mlt_properties_get(properties, "mlt_type"); + QString resource = mlt_properties_get(properties, "mlt_service"); + + while (mlt_type == "transition") { + if (resource != "mix") { + mlt_transition tr = (mlt_transition) nextservice; + int currentTrack = mlt_transition_get_b_track(tr); + int currentaTrack = mlt_transition_get_a_track(tr); + mlt_properties properties = MLT_TRANSITION_PROPERTIES(tr); + + if (currentTrack >= ix) { + mlt_properties_set_int(properties, "b_track", currentTrack + 1); + mlt_properties_set_int(properties, "a_track", currentaTrack + 1); + } + } + nextservice = mlt_service_producer(nextservice); + if (nextservice == NULL) break; + properties = MLT_SERVICE_PROPERTIES(nextservice); + mlt_type = mlt_properties_get(properties, "mlt_type"); + resource = mlt_properties_get(properties, "mlt_service"); + } + + // Add audio mix transition to last track + Mlt::Field *field = tractor.field(); + Mlt::Transition *transition = new Mlt::Transition(*m_mltProfile, "mix"); + //transition->set("mlt_service", "mix"); + transition->set("a_track", 1); + transition->set("b_track", ct); + transition->set("always_active", 1); + transition->set("internal_added", 237); + transition->set("combine", 1); + field->plant_transition(*transition, 1, ct); + + mlt_service_unlock(m_mltConsumer->get_service()); + m_isBlocked = false; + blockSignals(false); + //Mlt::Producer trackProducer(tractor.track(startTrack)); +} + #include "renderer.moc" diff --git a/src/renderer.h b/src/renderer.h index 20800cbe..5737f203 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -154,8 +154,8 @@ Q_OBJECT public: int mltGetSpaceLength(const GenTime pos, int track); bool mltResizeClipEnd(ItemInfo info, GenTime clipDuration); bool mltResizeClipStart(ItemInfo info, GenTime diff); - bool mltMoveClip(int startTrack, int endTrack, GenTime pos, GenTime moveStart, Mlt::Producer *prod); - bool mltMoveClip(int startTrack, int endTrack, int pos, int moveStart, Mlt::Producer *prod); + bool mltMoveClip(int startTrack, int endTrack, GenTime pos, GenTime moveStart, Mlt::Producer *prod, bool forceProducer = false); + bool mltMoveClip(int startTrack, int endTrack, int pos, int moveStart, Mlt::Producer *prod, bool forceProducer = false); bool mltRemoveClip(int track, GenTime position); bool mltRemoveEffect(int track, GenTime position, QString index, bool doRefresh = true); bool mltAddEffect(int track, GenTime position, QHash args, bool doRefresh = true); @@ -171,6 +171,7 @@ Q_OBJECT public: void mltMoveTransparency(int startTime, int endTime, int startTrack, int endTrack, int id); void mltDeleteTransparency(int pos, int track, int id); void mltResizeTransparency(int oldStart, int newStart, int newEnd, int track, int id); + void mltInsertTrack(int ix); /** Change speed of a clip in playlist. To do this, we create a new "framebuffer" producer. This new producer must have its "resource" param set to: video.mpg?0.6 where video.mpg is the path diff --git a/src/widgets/addtrack_ui.ui b/src/widgets/addtrack_ui.ui new file mode 100644 index 00000000..453b68d7 --- /dev/null +++ b/src/widgets/addtrack_ui.ui @@ -0,0 +1,128 @@ + + AddTrack_UI + + + + 0 + 0 + 249 + 97 + + + + Dialog + + + + + + Insert track + + + + + + + + before + + + + + after + + + + + + + + 0 + + + + + + + Video track + + + true + + + + + + + Audio track + + + + + + + Qt::Vertical + + + + 20 + 10 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + KIntNumInput + QWidget +
knuminput.h
+
+
+ + + + buttonBox + accepted() + AddTrack_UI + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AddTrack_UI + reject() + + + 316 + 260 + + + 286 + 274 + + + + +