Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
luyikei
VLMC
Commits
bf2fbd11
Commit
bf2fbd11
authored
May 21, 2009
by
Hugo Beauzee-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plugging timeline with main workflow
parent
f8194924
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
124 additions
and
19 deletions
+124
-19
src/Workflow/MainWorkflow.cpp
src/Workflow/MainWorkflow.cpp
+42
-0
src/Workflow/MainWorkflow.h
src/Workflow/MainWorkflow.h
+46
-0
src/Workflow/TrackWorkflow.cpp
src/Workflow/TrackWorkflow.cpp
+4
-0
src/Workflow/TrackWorkflow.h
src/Workflow/TrackWorkflow.h
+1
-0
src/gui/GraphicsMovieItem.cpp
src/gui/GraphicsMovieItem.cpp
+1
-1
src/gui/Timeline.cpp
src/gui/Timeline.cpp
+3
-1
src/gui/Timeline.h
src/gui/Timeline.h
+7
-5
src/gui/TracksView.cpp
src/gui/TracksView.cpp
+7
-3
src/gui/TracksView.h
src/gui/TracksView.h
+9
-7
vlmc.pro
vlmc.pro
+4
-2
No files found.
src/Workflow/MainWorkflow.cpp
0 → 100644
View file @
bf2fbd11
/*****************************************************************************
* MainWorkflow.cpp : Will query all of the track workflows to render the final
* image
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Hugo Beauzee-Luyssen <hugo@vlmc.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 <QtDebug>
#include "MainWorkflow.h"
MainWorkflow
::
MainWorkflow
()
{
m_tracks
=
new
TrackWorkflow
*
[
NB_TRACKS
];
for
(
unsigned
int
i
=
0
;
i
<
NB_TRACKS
;
++
i
)
m_tracks
[
i
]
=
new
TrackWorkflow
;
}
void
MainWorkflow
::
addClip
(
Clip
*
clip
,
unsigned
int
trackId
)
{
Q_ASSERT_X
(
trackId
<
NB_TRACKS
,
"MainWorkflow::addClip"
,
"The specified trackId isn't valid, for it's higher than the number of tracks"
);
qDebug
()
<<
"MainWorkflow: Adding clip"
<<
clip
->
getUuid
()
<<
"to track"
<<
trackId
;
m_tracks
[
trackId
]
->
addClip
(
clip
);
}
src/Workflow/MainWorkflow.h
0 → 100644
View file @
bf2fbd11
/*****************************************************************************
* MainWorkflow.h : Will query all of the track workflows to render the final
* image
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Hugo Beauzee-Luyssen <hugo@vlmc.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 MAINWORKFLOW_H
#define MAINWORKFLOW_H
#include <QObject>
#include "TrackWorkflow.h"
//TODO: THIS HAS TO GO ASAP !!!!!
#define NB_TRACKS 1
class
MainWorkflow
:
public
QObject
{
Q_OBJECT
public:
MainWorkflow
();
void
addClip
(
Clip
*
clip
,
unsigned
int
trackId
);
private:
TrackWorkflow
**
m_tracks
;
};
#endif // MAINWORKFLOW_H
src/Workflow/TrackWorkflow.cpp
View file @
bf2fbd11
...
...
@@ -34,6 +34,10 @@ TrackWorkflow::TrackWorkflow()
void
TrackWorkflow
::
addClip
(
Clip
*
clip
)
{
m_currentClipWorkflow
=
new
ClipWorkflow
(
clip
,
m_condMutex
,
m_waitCondition
);
}
void
TrackWorkflow
::
startRender
()
{
m_currentClipWorkflow
->
startRender
(
m_mediaPlayer
);
}
...
...
src/Workflow/TrackWorkflow.h
View file @
bf2fbd11
...
...
@@ -39,6 +39,7 @@ class TrackWorkflow : public QObject
public:
TrackWorkflow
();
void
startRender
();
const
unsigned
char
*
getOutput
()
const
;
private:
ClipWorkflow
*
m_currentClipWorkflow
;
...
...
src/gui/GraphicsMovieItem.cpp
View file @
bf2fbd11
...
...
@@ -72,7 +72,7 @@ void GraphicsMovieItem::paintAudioSpectrum( QPainter* painter )
for
(
int
i
=
0
;
i
<
m_media
->
getAudioFrameList
().
size
();
i
++
)
{
//qDebug() << "Frame: " << i << "/" << m_media->getAudioFrameList().size();
for
(
int
u
=
0
;
u
<
m_media
->
getAudioNbSample
();
u
+=
400
)
for
(
unsigned
int
u
=
0
;
u
<
m_media
->
getAudioNbSample
();
u
+=
400
)
{
...
...
src/gui/Timeline.cpp
View file @
bf2fbd11
...
...
@@ -32,8 +32,10 @@ Timeline::Timeline( QWidget *parent ) :
{
m_ui
.
setupUi
(
this
);
m_mainWorkflow
=
new
MainWorkflow
();
m_tracksScene
=
new
TracksScene
(
this
);
m_tracksView
=
new
TracksView
(
m_tracksScene
,
m_ui
.
tracksFrame
);
m_tracksView
=
new
TracksView
(
m_tracksScene
,
m_mainWorkflow
,
m_ui
.
tracksFrame
);
m_tracksView
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
m_tracksView
->
scale
(
1
,
1
);
m_tracksView
->
setAlignment
(
Qt
::
AlignLeft
|
Qt
::
AlignTop
);
...
...
src/gui/Timeline.h
View file @
bf2fbd11
...
...
@@ -27,6 +27,7 @@
#include "TracksView.h"
#include "TracksScene.h"
#include "TracksRuler.h"
#include "Workflow/MainWorkflow.h"
class
Timeline
:
public
QWidget
{
...
...
@@ -45,11 +46,12 @@ protected:
virtual
void
changeEvent
(
QEvent
*
e
);
private:
Ui
::
Timeline
m_ui
;
TracksView
*
m_tracksView
;
TracksScene
*
m_tracksScene
;
TracksRuler
*
m_tracksRuler
;
double
m_scale
;
Ui
::
Timeline
m_ui
;
TracksView
*
m_tracksView
;
TracksScene
*
m_tracksScene
;
TracksRuler
*
m_tracksRuler
;
double
m_scale
;
MainWorkflow
*
m_mainWorkflow
;
};
#endif // TIMELINE_H
src/gui/TracksView.cpp
View file @
bf2fbd11
...
...
@@ -31,8 +31,8 @@
#include "GraphicsMovieItem.h"
#include "GraphicsCursorItem.h"
TracksView
::
TracksView
(
QGraphicsScene
*
scene
,
QWidget
*
parent
)
:
QGraphicsView
(
scene
,
parent
),
m_scene
(
scene
)
TracksView
::
TracksView
(
QGraphicsScene
*
scene
,
MainWorkflow
*
mainWorkflow
,
QWidget
*
parent
)
:
QGraphicsView
(
scene
,
parent
),
m_scene
(
scene
)
,
m_mainWorkflow
(
mainWorkflow
)
{
//TODO should be defined by the settings
m_tracksHeight
=
50
;
...
...
@@ -183,7 +183,7 @@ int TracksView::cursorPos()
void
TracksView
::
addClip
(
Media
*
clip
,
const
QPoint
&
point
)
{
int
track
=
(
int
)(
mapToScene
(
point
).
y
()
/
m_tracksHeight
);
unsigned
int
track
=
(
unsigned
int
)(
mapToScene
(
point
).
y
()
/
m_tracksHeight
);
if
(
track
+
1
>
m_tracksCount
)
return
;
//mappedXPos: 1 pixel = 1 frame
...
...
@@ -202,6 +202,10 @@ void TracksView::addClip( Media* clip, const QPoint& point )
emit
durationChanged
(
duration
);
}
item
->
show
();
qDebug
()
<<
"TracksView::addClip: Adding a new clip to track"
<<
track
;
//FIXME: this leaks, but it will be corrected once we really use Clip instead
// of Media
m_mainWorkflow
->
addClip
(
new
Clip
(
clip
),
track
);
}
void
TracksView
::
setScale
(
double
scaleFactor
)
...
...
src/gui/TracksView.h
View file @
bf2fbd11
...
...
@@ -32,13 +32,14 @@
#include <QDragMoveEvent>
#include "Media.h"
#include "GraphicsCursorItem.h"
#include "Workflow/MainWorkflow.h"
class
TracksView
:
public
QGraphicsView
{
Q_OBJECT
public:
TracksView
(
QGraphicsScene
*
scene
,
QWidget
*
parent
=
0
);
TracksView
(
QGraphicsScene
*
scene
,
MainWorkflow
*
mainWorkflow
,
QWidget
*
parent
=
0
);
void
setDuration
(
int
duration
);
int
duration
()
const
{
return
m_projectDuration
;
}
int
tracksHeight
()
const
{
return
m_tracksHeight
;
}
...
...
@@ -65,12 +66,13 @@ private slots:
void
ensureCursorVisible
();
private:
QGraphicsScene
*
m_scene
;
int
m_tracksHeight
;
int
m_tracksCount
;
int
m_projectDuration
;
int
m_fps
;
GraphicsCursorItem
*
m_cursorLine
;
QGraphicsScene
*
m_scene
;
int
m_tracksHeight
;
unsigned
int
m_tracksCount
;
int
m_projectDuration
;
int
m_fps
;
GraphicsCursorItem
*
m_cursorLine
;
MainWorkflow
*
m_mainWorkflow
;
signals:
void
zoomIn
();
...
...
vlmc.pro
View file @
bf2fbd11
...
...
@@ -41,7 +41,8 @@ SOURCES += src/main.cpp \
src
/
TimelineBackend
.
cpp
\
src
/
Track
.
cpp
\
src
/
Workflow
/
ClipWorkflow
.
cpp
\
src
/
Workflow
/
TrackWorkflow
.
cpp
src
/
Workflow
/
TrackWorkflow
.
cpp
\
src
/
Workflow
/
MainWorkflow
.
cpp
HEADERS
+=
src
/
gui
/
MainWindow
.
h
\
src
/
gui
/
DockWidgetManager
.
h
\
src
/
gui
/
LibraryWidget
.
h
\
...
...
@@ -75,7 +76,8 @@ HEADERS += src/gui/MainWindow.h \
src
/
TimelineBackend
.
h
\
src
/
Track
.
h
\
src
/
Workflow
/
ClipWorkflow
.
h
\
src
/
Workflow
/
TrackWorkflow
.
h
src
/
Workflow
/
TrackWorkflow
.
h
\
src
/
Workflow
/
MainWorkflow
.
h
FORMS
+=
src
/
gui
/
ui
/
MainWindow
.
ui
\
src
/
gui
/
ui
/
PreviewWidget
.
ui
\
src
/
gui
/
ui
/
Preferences
.
ui
\
...
...
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