Skip to content

Commit

Permalink
Add click track head to apply filters to track.
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Sep 1, 2014
1 parent 2d9ba49 commit ed9ac2f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/docks/timelinedock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,17 @@ void TimelineDock::selectTrack(int by)
m_quickView.rootObject()->setProperty("currentTrack", currentTrack);
}

void TimelineDock::selectTrackHead(int trackIndex)
{
if (trackIndex >= 0) {
int i = m_model.trackList().at(trackIndex).mlt_index;
Mlt::Producer* producer = m_model.tractor()->track(i);
if (producer && producer->is_valid())
MAIN.filtersDock()->setProducer(producer);
delete producer;
}
}

void TimelineDock::openClip(int trackIndex, int clipIndex)
{
if (trackIndex < 0)
Expand Down
1 change: 1 addition & 0 deletions src/docks/timelinedock.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public slots:
void pressKey(int key, Qt::KeyboardModifiers modifiers);
void releaseKey(int key, Qt::KeyboardModifiers modifiers);
void selectTrack(int by);
void selectTrackHead(int trackIndex);
void openClip(int trackIndex, int clipIndex);
void selectClip(int trackIndex, int clipIndex);
void setTrackName(int trackIndex, const QString& value);
Expand Down
8 changes: 7 additions & 1 deletion src/qml/timeline/timeline.qml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ Rectangle {
color: (index === currentTrack)? selectedTrackColor : (index % 2)? activePalette.alternateBase : activePalette.base
width: headerWidth
height: model.audio? multitrack.trackHeight : multitrack.trackHeight * 2
onClicked: currentTrack = index
onClicked: {
currentTrack = index
timeline.selectTrackHead(currentTrack)
currentClip = -1
for (var i = 0; i < tracksRepeater.count; i++)
tracksRepeater.itemAt(i).resetStates();
}
}
}
}
Expand Down

0 comments on commit ed9ac2f

Please sign in to comment.