Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
ed59ed1e
Commit
ed59ed1e
authored
Apr 25, 2009
by
Ludovic Fauvet
Browse files
Project duration is updated to reflect the timeline content
parent
62561473
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/gui/Timeline.cpp
View file @
ed59ed1e
...
...
@@ -50,8 +50,9 @@ Timeline::Timeline( QWidget *parent ) :
tracksRulerLayout
->
addWidget
(
m_tracksRuler
);
changeZoom
(
10
);
setDuration
(
1
500
);
setDuration
(
1
);
connect
(
m_tracksView
->
horizontalScrollBar
(),
SIGNAL
(
valueChanged
(
int
)
),
m_tracksRuler
,
SLOT
(
moveRuler
(
int
)
)
);
connect
(
m_tracksView
,
SIGNAL
(
durationChanged
(
int
)
),
this
,
SLOT
(
setDuration
(
int
)
)
);
}
void
Timeline
::
changeEvent
(
QEvent
*
e
)
...
...
src/gui/TracksView.cpp
View file @
ed59ed1e
...
...
@@ -49,8 +49,8 @@ TracksView::TracksView( QGraphicsScene* scene, QWidget* parent )
setSceneRect
(
0
,
0
,
sceneRect
().
width
(),
maxHeight
);
m_cursorPos
=
0
;
m_cursorLine
=
m_scene
->
addLine
(
0
,
0
,
0
,
maxHeight
);
m_cursorLine
->
setZValue
(
100
);
m_cursorLine
=
m_scene
->
addLine
(
0
,
0
,
0
,
maxHeight
);
m_cursorLine
->
setZValue
(
100
);
}
void
TracksView
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
...
...
@@ -180,7 +180,7 @@ void TracksView::wheelEvent( QWheelEvent* event )
void
TracksView
::
setCursorPos
(
int
pos
)
{
m_cursorPos
=
pos
;
m_cursorLine
->
setPos
(
m_cursorPos
,
0
);
m_cursorLine
->
setPos
(
m_cursorPos
,
0
);
}
void
TracksView
::
addClip
(
Media
*
clip
,
const
QPoint
&
point
)
...
...
@@ -196,6 +196,12 @@ void TracksView::addClip( Media* clip, const QPoint& point )
item
->
setWidth
(
(
(
double
)
clip
->
getLength
()
/
1000
)
*
m_fps
);
item
->
setHeight
(
tracksHeight
()
);
m_scene
->
addItem
(
item
);
int
duration
=
mappedXPos
+
(
(
double
)
clip
->
getLength
()
/
1000
)
*
m_fps
;
if
(
duration
>
m_projectDuration
)
{
m_projectDuration
=
duration
;
emit
durationChanged
(
duration
);
}
item
->
show
();
}
...
...
src/gui/TracksView.h
View file @
ed59ed1e
...
...
@@ -69,6 +69,7 @@ private:
signals:
void
zoomIn
();
void
zoomOut
();
void
durationChanged
(
int
duration
);
};
#endif // TRACKSVIEW_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment