"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/docks/timelinedock.cpp" between
shotcut-20.09.01.tar.gz and shotcut-20.09.13.tar.gz

About: Shotcut is a cross-platform (Qt) advanced video editor.

timelinedock.cpp  (shotcut-20.09.01):timelinedock.cpp  (shotcut-20.09.13)
skipping to change at line 239 skipping to change at line 239
m_quickView.rootObject()->setProperty("currentTrack", qBound(0, currentTrack , m_model.trackList().size() - 1)); m_quickView.rootObject()->setProperty("currentTrack", qBound(0, currentTrack , m_model.trackList().size() - 1));
} }
int TimelineDock::currentTrack() const int TimelineDock::currentTrack() const
{ {
if (!m_quickView.rootObject()) if (!m_quickView.rootObject())
return 0; return 0;
return m_quickView.rootObject()->property("currentTrack").toInt(); return m_quickView.rootObject()->property("currentTrack").toInt();
} }
void TimelineDock::zoomIn()
{
QMetaObject::invokeMethod(m_quickView.rootObject(), "zoomIn");
}
void TimelineDock::zoomOut()
{
QMetaObject::invokeMethod(m_quickView.rootObject(), "zoomOut");
}
void TimelineDock::resetZoom()
{
QMetaObject::invokeMethod(m_quickView.rootObject(), "resetZoom");
}
void TimelineDock::makeTracksShorter()
{
QMetaObject::invokeMethod(m_quickView.rootObject(), "makeTracksShorter");
}
void TimelineDock::makeTracksTaller()
{
QMetaObject::invokeMethod(m_quickView.rootObject(), "makeTracksTaller");
}
void TimelineDock::setSelectionFromJS(const QVariantList& list) void TimelineDock::setSelectionFromJS(const QVariantList& list)
{ {
QList<QPoint> points; QList<QPoint> points;
for (const auto& v : list) { for (const auto& v : list) {
auto p = v.toPoint(); auto p = v.toPoint();
if (!isBlank(p.y(), p.x())) if (!isBlank(p.y(), p.x()))
points << p; points << p;
} }
setSelection(points); setSelection(points);
} }
skipping to change at line 944 skipping to change at line 919
} }
void TimelineDock::setTrackLock(int trackIndex, bool lock) void TimelineDock::setTrackLock(int trackIndex, bool lock)
{ {
MAIN.undoStack()->push( MAIN.undoStack()->push(
new Timeline::LockTrackCommand(m_model, trackIndex, lock)); new Timeline::LockTrackCommand(m_model, trackIndex, lock));
} }
bool TimelineDock::moveClip(int fromTrack, int toTrack, int clipIndex, int posit ion, bool ripple) bool TimelineDock::moveClip(int fromTrack, int toTrack, int clipIndex, int posit ion, bool ripple)
{ {
if (toTrack >= 0 && clipIndex >= 0) {
int length = 0;
int i = m_model.trackList().at(fromTrack).mlt_index;
Mlt::Producer track(m_model.tractor()->track(i));
if (track.is_valid()) {
Mlt::Playlist playlist(track);
length = playlist.clip_length(clipIndex);
}
i = m_model.trackList().at(toTrack).mlt_index;
track = Mlt::Producer(m_model.tractor()->track(i));
if (track.is_valid()) {
Mlt::Playlist playlist(track);
if (m_model.isTransition(playlist, playlist.get_clip_index_at(positi
on)) ||
m_model.isTransition(playlist, playlist.get_clip_index_at(positi
on + length - 1))) {
return false;
}
}
}
if (selection().size() <= 1 && m_model.addTransitionValid(fromTrack, toTrack , clipIndex, position, ripple)) { if (selection().size() <= 1 && m_model.addTransitionValid(fromTrack, toTrack , clipIndex, position, ripple)) {
emit transitionAdded(fromTrack, clipIndex, position, ripple); emit transitionAdded(fromTrack, clipIndex, position, ripple);
if (m_updateCommand) if (m_updateCommand)
m_updateCommand->setPosition(toTrack, clipIndex, position); m_updateCommand->setPosition(toTrack, clipIndex, position);
} else { } else {
// Check for locked tracks // Check for locked tracks
auto trackDelta = toTrack - fromTrack; auto trackDelta = toTrack - fromTrack;
for (const auto& clip : selection()) { for (const auto& clip : selection()) {
auto trackIndex = clip.y() + trackDelta; auto trackIndex = clip.y() + trackDelta;
if (isTrackLocked(clip.y())) { if (isTrackLocked(clip.y())) {
 End of changes. 2 change blocks. 
25 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)