Commit aec2d041 authored by Nicolas Carion's avatar Nicolas Carion

[Timeline2] Remove fromTrack parameter

parent 10e27741
......@@ -91,17 +91,15 @@ Column{
clip.draggedX = clip.x
}
onMoved: {
var fromTrack = clip.originalTrackId
var toTrack = clip.trackId
var cIndex = clip.clipId
var frame = Math.round(clip.x / timeScale)
console.log("Asking move ",toTrack, cIndex, frame)
var val = timeline.moveClip(fromTrack, toTrack, cIndex, frame, true)
var val = timeline.moveClip(toTrack, cIndex, frame, true)
console.log("RESULT", val)
}
onDragged: {
var fromTrack = clip.originalTrackId
var toTrack = clip.trackId
var cIndex = clip.clipId
var frame = Math.round(clip.x / timeScale)
......@@ -115,7 +113,7 @@ Column{
// Prevent dragging left of multitracks origin.
console.log("dragging clip x: ", clip.x, " ID: "<<clip.originalClipIndex)
clip.x = Math.max(0, clip.x)
if (!timeline.allowMoveClip(fromTrack, toTrack, cIndex, frame, false)) {
if (!timeline.allowMoveClip(toTrack, cIndex, frame, false)) {
// Abort move
clip.x = clip.draggedX
}
......
......@@ -134,12 +134,12 @@ bool TimelineWidget::scrub()
return false;
}
bool TimelineWidget::moveClip(int /*fromTrack*/, int toTrack, int clipIndex, int position, bool logUndo)
bool TimelineWidget::moveClip(int toTrack, int clipIndex, int position, bool logUndo)
{
return m_model->requestClipMove(clipIndex, toTrack, position, logUndo);
}
bool TimelineWidget::allowMoveClip(int /*fromTrack*/, int toTrack, int clipIndex, int position)
bool TimelineWidget::allowMoveClip(int toTrack, int clipIndex, int position)
{
return m_model->allowClipMove(clipIndex, toTrack, position);
}
......
......@@ -45,8 +45,8 @@ public:
Q_INVOKABLE int selectedTrack() const { return m_selection.selectedTrack; }
Q_INVOKABLE double scaleFactor() const;
Q_INVOKABLE void setScaleFactor(double scale);
Q_INVOKABLE bool moveClip(int fromTrack, int toTrack, int clipIndex, int position, bool logUndo = true);
Q_INVOKABLE bool allowMoveClip(int fromTrack, int toTrack, int clipIndex, int position);
Q_INVOKABLE bool moveClip(int toTrack, int clipIndex, int position, bool logUndo = true);
Q_INVOKABLE bool allowMoveClip(int toTrack, int clipIndex, int position);
int duration() const;
int position() const { return m_position; }
void setPosition(int);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment