Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
fa2e7f5b
Commit
fa2e7f5b
authored
Mar 04, 2008
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start using mlt profiles
svn path=/branches/KDE4/; revision=1997
parent
43347839
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
94 additions
and
18 deletions
+94
-18
src/definitions.h
src/definitions.h
+12
-5
src/docclipbase.cpp
src/docclipbase.cpp
+1
-1
src/kdenlivedoc.cpp
src/kdenlivedoc.cpp
+7
-3
src/kdenlivedoc.h
src/kdenlivedoc.h
+4
-1
src/mainwindow.cpp
src/mainwindow.cpp
+10
-4
src/monitor.cpp
src/monitor.cpp
+4
-0
src/monitor.h
src/monitor.h
+2
-0
src/monitormanager.cpp
src/monitormanager.cpp
+5
-0
src/monitormanager.h
src/monitormanager.h
+1
-0
src/profilesdialog.cpp
src/profilesdialog.cpp
+40
-0
src/profilesdialog.h
src/profilesdialog.h
+2
-0
src/renderer.cpp
src/renderer.cpp
+5
-3
src/renderer.h
src/renderer.h
+1
-1
No files found.
src/definitions.h
View file @
fa2e7f5b
...
@@ -27,11 +27,18 @@
...
@@ -27,11 +27,18 @@
enum
OPERATIONTYPE
{
NONE
=
0
,
MOVE
=
1
,
RESIZESTART
=
2
,
RESIZEEND
=
3
,
FADEIN
=
4
,
FADEOUT
=
5
};
enum
OPERATIONTYPE
{
NONE
=
0
,
MOVE
=
1
,
RESIZESTART
=
2
,
RESIZEEND
=
3
,
FADEIN
=
4
,
FADEOUT
=
5
};
enum
CLIPTYPE
{
UNKNOWN
=
0
,
AUDIO
=
1
,
VIDEO
=
2
,
AV
=
3
,
COLOR
=
4
,
IMAGE
=
5
,
TEXT
=
6
,
SLIDESHOW
=
7
,
VIRTUAL
=
8
,
PLAYLIST
=
9
};
enum
CLIPTYPE
{
UNKNOWN
=
0
,
AUDIO
=
1
,
VIDEO
=
2
,
AV
=
3
,
COLOR
=
4
,
IMAGE
=
5
,
TEXT
=
6
,
SLIDESHOW
=
7
,
VIRTUAL
=
8
,
PLAYLIST
=
9
};
struct
TrackViewClip
{
struct
MltVideoProfile
{
int
startTime
;
QString
path
;
int
duration
;
QString
description
;
int
cropTime
;
int
frame_rate_num
;
QString
producer
;
int
frame_rate_den
;
int
width
;
int
height
;
bool
progressive
;
int
sample_aspect_num
;
int
sample_aspect_den
;
int
display_aspect_num
;
int
display_aspect_den
;
};
};
#endif
#endif
src/docclipbase.cpp
View file @
fa2e7f5b
...
@@ -67,7 +67,7 @@ DocClipBase & DocClipBase::operator=(const DocClipBase & clip) {
...
@@ -67,7 +67,7 @@ DocClipBase & DocClipBase::operator=(const DocClipBase & clip) {
}
}
DocClipBase
::~
DocClipBase
()
{
DocClipBase
::~
DocClipBase
()
{
//
if (m_thumbProd) delete m_thumbProd;
if
(
m_thumbProd
)
delete
m_thumbProd
;
}
}
void
DocClipBase
::
slotRequestAudioThumbs
()
{
void
DocClipBase
::
slotRequestAudioThumbs
()
{
...
...
src/kdenlivedoc.cpp
View file @
fa2e7f5b
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
#include "kdenlivedoc.h"
#include "kdenlivedoc.h"
#include "docclipbase.h"
#include "docclipbase.h"
KdenliveDoc
::
KdenliveDoc
(
const
KUrl
&
url
,
double
fps
,
int
width
,
int
height
,
QWidget
*
parent
)
:
QObject
(
parent
),
m_render
(
NULL
),
m_url
(
url
),
m_
fps
(
fps
),
m_width
(
width
),
m_height
(
height
),
m_projectName
(
NULL
),
m_commandStack
(
new
KUndoStack
())
{
KdenliveDoc
::
KdenliveDoc
(
const
KUrl
&
url
,
MltVideoProfile
profile
,
QWidget
*
parent
)
:
QObject
(
parent
),
m_render
(
NULL
),
m_url
(
url
),
m_
profile
(
profile
),
m_fps
((
double
)
profile
.
frame_rate_num
/
profile
.
frame_rate_den
),
m_width
(
profile
.
width
),
m_height
(
profile
.
height
),
m_projectName
(
NULL
),
m_commandStack
(
new
KUndoStack
())
{
m_clipManager
=
new
ClipManager
(
this
);
m_clipManager
=
new
ClipManager
(
this
);
if
(
!
url
.
isEmpty
())
{
if
(
!
url
.
isEmpty
())
{
QString
tmpFile
;
QString
tmpFile
;
...
@@ -101,8 +101,8 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, double fps, int width, int height, QWi
...
@@ -101,8 +101,8 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, double fps, int width, int height, QWi
doc
.
appendChild
(
tractor
);
doc
.
appendChild
(
tractor
);
}
}
if
(
fps
==
30000.0
/
1001.0
)
m_timecode
.
setFormat
(
30
,
true
);
if
(
m_
fps
==
30000.0
/
1001.0
)
m_timecode
.
setFormat
(
30
,
true
);
else
m_timecode
.
setFormat
((
int
)
fps
);
else
m_timecode
.
setFormat
((
int
)
m_
fps
);
}
}
KdenliveDoc
::~
KdenliveDoc
()
{
KdenliveDoc
::~
KdenliveDoc
()
{
...
@@ -114,6 +114,10 @@ ClipManager *KdenliveDoc::clipManager() {
...
@@ -114,6 +114,10 @@ ClipManager *KdenliveDoc::clipManager() {
return
m_clipManager
;
return
m_clipManager
;
}
}
QString
KdenliveDoc
::
profilePath
()
{
return
m_profile
.
path
;
}
void
KdenliveDoc
::
setThumbsProgress
(
KUrl
url
,
int
progress
)
{
void
KdenliveDoc
::
setThumbsProgress
(
KUrl
url
,
int
progress
)
{
emit
thumbsProgress
(
url
,
progress
);
emit
thumbsProgress
(
url
,
progress
);
}
}
...
...
src/kdenlivedoc.h
View file @
fa2e7f5b
...
@@ -34,11 +34,12 @@
...
@@ -34,11 +34,12 @@
#include "timecode.h"
#include "timecode.h"
#include "renderer.h"
#include "renderer.h"
#include "clipmanager.h"
#include "clipmanager.h"
#include "definitions.h"
class
KdenliveDoc
:
public
QObject
{
class
KdenliveDoc
:
public
QObject
{
Q_OBJECT
public
:
Q_OBJECT
public
:
KdenliveDoc
(
const
KUrl
&
url
,
double
fps
,
int
width
,
int
height
,
QWidget
*
parent
=
0
);
KdenliveDoc
(
const
KUrl
&
url
,
MltVideoProfile
profile
,
QWidget
*
parent
=
0
);
~
KdenliveDoc
();
~
KdenliveDoc
();
QString
documentName
();
QString
documentName
();
QDomNodeList
producersList
();
QDomNodeList
producersList
();
...
@@ -66,6 +67,7 @@ Q_OBJECT public:
...
@@ -66,6 +67,7 @@ Q_OBJECT public:
void
deleteProjectClip
(
const
uint
clipId
);
void
deleteProjectClip
(
const
uint
clipId
);
/** Inform application of the audio thumbnails generation progress */
/** Inform application of the audio thumbnails generation progress */
void
setThumbsProgress
(
KUrl
url
,
int
progress
);
void
setThumbsProgress
(
KUrl
url
,
int
progress
);
QString
profilePath
();
private:
private:
KUrl
m_url
;
KUrl
m_url
;
...
@@ -79,6 +81,7 @@ private:
...
@@ -79,6 +81,7 @@ private:
KUndoStack
*
m_commandStack
;
KUndoStack
*
m_commandStack
;
QDomDocument
generateSceneList
();
QDomDocument
generateSceneList
();
ClipManager
*
m_clipManager
;
ClipManager
*
m_clipManager
;
MltVideoProfile
m_profile
;
public
slots
:
public
slots
:
...
...
src/mainwindow.cpp
View file @
fa2e7f5b
...
@@ -295,9 +295,11 @@ void MainWindow::readOptions() {
...
@@ -295,9 +295,11 @@ void MainWindow::readOptions() {
}
}
void
MainWindow
::
newFile
()
{
void
MainWindow
::
newFile
()
{
KdenliveDoc
*
doc
=
new
KdenliveDoc
(
KUrl
(),
25
,
720
,
576
);
MltVideoProfile
prof
=
ProfilesDialog
::
getVideoProfile
(
KdenliveSettings
::
default_profile
());
if
(
prof
.
width
==
0
)
prof
=
ProfilesDialog
::
getVideoProfile
(
"dv_pal"
);
KdenliveDoc
*
doc
=
new
KdenliveDoc
(
KUrl
(),
prof
);
TrackView
*
trackView
=
new
TrackView
(
doc
);
TrackView
*
trackView
=
new
TrackView
(
doc
);
m_timelineArea
->
addTab
(
trackView
,
i18n
(
"Untitled"
)
+
" / "
+
ProfilesDialog
::
getProfileDescription
(
KdenliveSettings
::
default_profile
())
);
m_timelineArea
->
addTab
(
trackView
,
i18n
(
"Untitled"
)
+
" / "
+
prof
.
description
);
if
(
m_timelineArea
->
count
()
==
1
)
if
(
m_timelineArea
->
count
()
==
1
)
connectDocument
(
trackView
,
doc
);
connectDocument
(
trackView
,
doc
);
else
m_timelineArea
->
setTabBarHidden
(
false
);
else
m_timelineArea
->
setTabBarHidden
(
false
);
...
@@ -342,9 +344,12 @@ void MainWindow::openFile() { //changed
...
@@ -342,9 +344,12 @@ void MainWindow::openFile() { //changed
}
}
void
MainWindow
::
openFile
(
const
KUrl
&
url
)
{
//new
void
MainWindow
::
openFile
(
const
KUrl
&
url
)
{
//new
KdenliveDoc
*
doc
=
new
KdenliveDoc
(
url
,
25
,
720
,
576
);
//TODO: get video profile from url before opening it
MltVideoProfile
prof
=
ProfilesDialog
::
getVideoProfile
(
KdenliveSettings
::
default_profile
());
if
(
prof
.
width
==
0
)
prof
=
ProfilesDialog
::
getVideoProfile
(
"dv_pal"
);
KdenliveDoc
*
doc
=
new
KdenliveDoc
(
url
,
prof
);
TrackView
*
trackView
=
new
TrackView
(
doc
);
TrackView
*
trackView
=
new
TrackView
(
doc
);
m_timelineArea
->
setCurrentIndex
(
m_timelineArea
->
addTab
(
trackView
,
QIcon
(),
doc
->
documentName
()));
m_timelineArea
->
setCurrentIndex
(
m_timelineArea
->
addTab
(
trackView
,
QIcon
(),
doc
->
documentName
()
+
" / "
+
prof
.
description
));
m_timelineArea
->
setTabToolTip
(
m_timelineArea
->
currentIndex
(),
doc
->
url
().
path
());
m_timelineArea
->
setTabToolTip
(
m_timelineArea
->
currentIndex
(),
doc
->
url
().
path
());
if
(
m_timelineArea
->
count
()
>
1
)
m_timelineArea
->
setTabBarHidden
(
false
);
if
(
m_timelineArea
->
count
()
>
1
)
m_timelineArea
->
setTabBarHidden
(
false
);
//connectDocument(trackView, doc);
//connectDocument(trackView, doc);
...
@@ -452,6 +457,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) { //cha
...
@@ -452,6 +457,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) { //cha
m_projectList
->
setDocument
(
doc
);
m_projectList
->
setDocument
(
doc
);
m_monitorManager
->
setTimecode
(
doc
->
timecode
());
m_monitorManager
->
setTimecode
(
doc
->
timecode
());
m_monitorManager
->
resetProfiles
(
doc
->
profilePath
());
doc
->
setRenderer
(
m_projectMonitor
->
render
);
doc
->
setRenderer
(
m_projectMonitor
->
render
);
//m_undoView->setStack(0);
//m_undoView->setStack(0);
m_commandStack
=
doc
->
commandStack
();
m_commandStack
=
doc
->
commandStack
();
...
...
src/monitor.cpp
View file @
fa2e7f5b
...
@@ -220,6 +220,10 @@ void Monitor::slotOpenFile(const QString &file) {
...
@@ -220,6 +220,10 @@ void Monitor::slotOpenFile(const QString &file) {
render
->
setSceneList
(
doc
,
0
);
render
->
setSceneList
(
doc
,
0
);
}
}
void
Monitor
::
resetProfile
(
QString
prof
)
{
if
(
render
==
NULL
)
return
;
render
->
resetProfile
(
prof
);
}
#include "monitor.moc"
#include "monitor.moc"
src/monitor.h
View file @
fa2e7f5b
...
@@ -36,6 +36,8 @@ class Monitor : public QWidget {
...
@@ -36,6 +36,8 @@ class Monitor : public QWidget {
public:
public:
Monitor
(
QString
name
,
MonitorManager
*
manager
,
QWidget
*
parent
=
0
);
Monitor
(
QString
name
,
MonitorManager
*
manager
,
QWidget
*
parent
=
0
);
Render
*
render
;
Render
*
render
;
void
resetProfile
(
QString
prof
);
virtual
void
resizeEvent
(
QResizeEvent
*
event
);
virtual
void
resizeEvent
(
QResizeEvent
*
event
);
protected:
protected:
virtual
void
mousePressEvent
(
QMouseEvent
*
event
);
virtual
void
mousePressEvent
(
QMouseEvent
*
event
);
...
...
src/monitormanager.cpp
View file @
fa2e7f5b
...
@@ -80,4 +80,9 @@ void MonitorManager::slotPlay() {
...
@@ -80,4 +80,9 @@ void MonitorManager::slotPlay() {
else
m_projectMonitor
->
slotPlay
();
else
m_projectMonitor
->
slotPlay
();
}
}
void
MonitorManager
::
resetProfiles
(
QString
prof
)
{
m_clipMonitor
->
resetProfile
(
prof
);
m_projectMonitor
->
resetProfile
(
prof
);
}
#include "monitormanager.moc"
#include "monitormanager.moc"
src/monitormanager.h
View file @
fa2e7f5b
...
@@ -34,6 +34,7 @@ public:
...
@@ -34,6 +34,7 @@ public:
void
initMonitors
(
Monitor
*
clipMonitor
,
Monitor
*
projectMonitor
);
void
initMonitors
(
Monitor
*
clipMonitor
,
Monitor
*
projectMonitor
);
Timecode
timecode
();
Timecode
timecode
();
void
setTimecode
(
Timecode
tc
);
void
setTimecode
(
Timecode
tc
);
void
resetProfiles
(
QString
prof
);
public
slots
:
public
slots
:
void
activateMonitor
(
QString
name
=
QString
::
null
);
void
activateMonitor
(
QString
name
=
QString
::
null
);
...
...
src/profilesdialog.cpp
View file @
fa2e7f5b
...
@@ -49,6 +49,46 @@ ProfilesDialog::ProfilesDialog(QWidget * parent): QDialog(parent), m_isCustomPro
...
@@ -49,6 +49,46 @@ ProfilesDialog::ProfilesDialog(QWidget * parent): QDialog(parent), m_isCustomPro
connect
(
m_view
.
profiles_list
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
slotUpdateDisplay
()));
connect
(
m_view
.
profiles_list
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
slotUpdateDisplay
()));
}
}
// static
MltVideoProfile
ProfilesDialog
::
getVideoProfile
(
QString
name
)
{
MltVideoProfile
result
;
QStringList
profilesNames
;
QStringList
profilesFiles
;
QStringList
profilesFilter
;
profilesFilter
<<
"*"
;
QString
path
;
// List the Mlt profiles
profilesFiles
=
QDir
(
KdenliveSettings
::
mltpath
()).
entryList
(
profilesFilter
,
QDir
::
Files
);
if
(
profilesFiles
.
contains
(
name
))
path
=
KdenliveSettings
::
mltpath
()
+
"/"
+
name
;
if
(
path
.
isEmpty
())
{
// List custom profiles
QStringList
customProfiles
=
KGlobal
::
dirs
()
->
findDirs
(
"appdata"
,
"profiles"
);
for
(
int
i
=
0
;
i
<
customProfiles
.
size
();
++
i
)
{
profilesFiles
=
QDir
(
customProfiles
.
at
(
i
)).
entryList
(
profilesFilter
,
QDir
::
Files
);
if
(
profilesFiles
.
contains
(
name
))
{
path
=
customProfiles
.
at
(
i
)
+
"/"
+
name
;
break
;
}
}
}
if
(
path
.
isEmpty
())
return
result
;
KConfig
confFile
(
path
);
result
.
path
=
path
;
result
.
description
=
confFile
.
entryMap
().
value
(
"description"
);
result
.
frame_rate_num
=
confFile
.
entryMap
().
value
(
"frame_rate_num"
).
toInt
();
result
.
frame_rate_den
=
confFile
.
entryMap
().
value
(
"frame_rate_den"
).
toInt
();
result
.
width
=
confFile
.
entryMap
().
value
(
"width"
).
toInt
();
result
.
height
=
confFile
.
entryMap
().
value
(
"height"
).
toInt
();
result
.
progressive
=
confFile
.
entryMap
().
value
(
"progressive"
).
toInt
();
result
.
sample_aspect_num
=
confFile
.
entryMap
().
value
(
"sample_aspect_num"
).
toInt
();
result
.
sample_aspect_den
=
confFile
.
entryMap
().
value
(
"sample_aspect_den"
).
toInt
();
result
.
display_aspect_num
=
confFile
.
entryMap
().
value
(
"display_aspect_num"
).
toInt
();
result
.
display_aspect_den
=
confFile
.
entryMap
().
value
(
"display_aspect_den"
).
toInt
();
return
result
;
}
// static
// static
QString
ProfilesDialog
::
getProfileDescription
(
QString
name
)
{
QString
ProfilesDialog
::
getProfileDescription
(
QString
name
)
{
...
...
src/profilesdialog.h
View file @
fa2e7f5b
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <QDialog>
#include <QDialog>
#include "definitions.h"
#include "ui_profiledialog_ui.h"
#include "ui_profiledialog_ui.h"
class
ProfilesDialog
:
public
QDialog
{
class
ProfilesDialog
:
public
QDialog
{
...
@@ -35,6 +36,7 @@ public:
...
@@ -35,6 +36,7 @@ public:
static
QString
getProfileDescription
(
QString
name
);
static
QString
getProfileDescription
(
QString
name
);
static
QMap
<
QString
,
QString
>
getSettingsForProfile
(
const
QString
profileName
);
static
QMap
<
QString
,
QString
>
getSettingsForProfile
(
const
QString
profileName
);
static
QMap
<
QString
,
QString
>
getSettingsFromFile
(
const
QString
path
);
static
QMap
<
QString
,
QString
>
getSettingsFromFile
(
const
QString
path
);
static
MltVideoProfile
getVideoProfile
(
QString
name
);
private
slots
:
private
slots
:
void
slotUpdateDisplay
();
void
slotUpdateDisplay
();
...
...
src/renderer.cpp
View file @
fa2e7f5b
...
@@ -114,14 +114,16 @@ void Render::closeMlt() {
...
@@ -114,14 +114,16 @@ void Render::closeMlt() {
int
Render
::
reset
Renderer
Profile
(
char
*
profile
)
{
int
Render
::
resetProfile
(
QString
profile
)
{
if
(
!
m_mltConsumer
)
return
0
;
if
(
!
m_mltConsumer
)
return
0
;
if
(
!
m_mltConsumer
->
is_stopped
())
m_mltConsumer
->
stop
();
if
(
!
m_mltConsumer
->
is_stopped
())
m_mltConsumer
->
stop
();
m_mltConsumer
->
set
(
"refresh"
,
0
);
m_mltConsumer
->
set
(
"refresh"
,
0
);
//m_mltConsumer->set("profile", profile);
//TODO: we should also rebuild filters and delete existing m_mltProfile
m_mltProfile
=
new
Mlt
::
Profile
((
char
*
)
qstrdup
(
profile
.
toUtf8
()));
kDebug
()
<<
" + + RESET CONSUMER WITH PROFILE: "
<<
profile
;
kDebug
()
<<
" + + RESET CONSUMER WITH PROFILE: "
<<
profile
;
mlt_properties
properties
=
MLT_CONSUMER_PROPERTIES
(
m_mltConsumer
->
get_consumer
());
mlt_properties
properties
=
MLT_CONSUMER_PROPERTIES
(
m_mltConsumer
->
get_consumer
());
// apply_profile_properties( m_profile, m_mltConsumer->get_consumer(), properties );
mlt_properties_set_data
(
properties
,
"profile"
,
m_mltProfile
->
get_profile
(),
0
,
0
,
NULL
);
//apply_profile_properties( m_mltProfile, m_mltConsumer->get_consumer(), properties );
refresh
();
refresh
();
return
1
;
return
1
;
}
}
...
...
src/renderer.h
View file @
fa2e7f5b
...
@@ -145,7 +145,7 @@ Q_OBJECT public:
...
@@ -145,7 +145,7 @@ Q_OBJECT public:
void
refreshDisplay
();
void
refreshDisplay
();
/** returns the current scenelist */
/** returns the current scenelist */
QDomDocument
sceneList
()
const
;
QDomDocument
sceneList
()
const
;
int
reset
Renderer
Profile
(
char
*
profile
);
int
resetProfile
(
QString
profile
);
const
double
fps
()
const
;
const
double
fps
()
const
;
/** Playlist manipulation */
/** Playlist manipulation */
...
...
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