Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
261
Issues
261
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
984f452f
Commit
984f452f
authored
Jan 06, 2021
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'vivekkde/kdenlive-develop'
parents
8d41f152
c877a1f3
Pipeline
#46571
passed with stage
in 10 minutes and 36 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
84 additions
and
4 deletions
+84
-4
src/bin/bin.cpp
src/bin/bin.cpp
+19
-0
src/bin/bin.h
src/bin/bin.h
+16
-1
src/dialogs/clipcreationdialog.cpp
src/dialogs/clipcreationdialog.cpp
+44
-0
src/dialogs/clipcreationdialog.h
src/dialogs/clipcreationdialog.h
+2
-0
src/mainwindow.cpp
src/mainwindow.cpp
+2
-1
src/project/projectmanager.h
src/project/projectmanager.h
+1
-1
src/timeline2/view/qml/Composition.qml
src/timeline2/view/qml/Composition.qml
+0
-1
No files found.
src/bin/bin.cpp
View file @
984f452f
...
...
@@ -824,6 +824,16 @@ bool LineEventEater::eventFilter(QObject *obj, QEvent *event)
return
QObject
::
eventFilter
(
obj
,
event
);
}
void
ClipWidget
::
init
(
QDockWidget
*
m_DockClipWidget
,
KdenliveDoc
*
doc
,
std
::
shared_ptr
<
ProjectItemModel
>
model
)
{
ClipCreationDialog
::
clipWidget
(
m_DockClipWidget
,
doc
,
model
);
/*QString clipFolder = KRecentDirs::dir(QStringLiteral(":KdenliveClipFolder"));
KFileWidget* fileWidget = new KFileWidget(QUrl::fromLocalFile(clipFolder), m_DockClipWidget);
fileWidget->setMode(KFile::Files);
m_DockClipWidget->setWidget(fileWidget);*/
}
Bin
::
Bin
(
std
::
shared_ptr
<
ProjectItemModel
>
model
,
QWidget
*
parent
)
:
QWidget
(
parent
)
,
isLoading
(
false
)
...
...
@@ -847,6 +857,7 @@ Bin::Bin(std::shared_ptr<ProjectItemModel> model, QWidget *parent)
,
m_gainedFocus
(
false
)
,
m_audioDuration
(
0
)
,
m_processedAudio
(
0
)
,
m_clipWidget
()
{
m_layout
=
new
QVBoxLayout
(
this
);
...
...
@@ -4368,3 +4379,11 @@ QList<int> Bin::getUsedClipIds()
}
return
timelineClipIds
;
}
ClipWidget
*
Bin
::
getWidget
(){
return
m_clipWidget
;
}
void
Bin
::
dockWidgetInit
(
QDockWidget
*
m_DockClipWidget
){
m_clipWidget
->
init
(
m_DockClipWidget
,
m_doc
,
m_itemModel
);
}
src/bin/bin.h
View file @
984f452f
...
...
@@ -40,6 +40,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QUrl>
#include <QWidget>
#include <QActionGroup>
#include <QtWidgets>
#include "KFileWidget"
#include "KRecentDirs"
class
AbstractProjectItem
;
class
BinItemDelegate
;
...
...
@@ -163,6 +167,15 @@ signals:
* @brief The bin widget takes care of both item model and view upon project opening.
*/
class
ClipWidget
:
public
QWidget
{
public:
explicit
ClipWidget
(){}
~
ClipWidget
()
override
;
void
init
(
QDockWidget
*
m_DockClipWidget
,
KdenliveDoc
*
doc
,
std
::
shared_ptr
<
ProjectItemModel
>
model
);
};
class
Bin
:
public
QWidget
{
Q_OBJECT
...
...
@@ -175,7 +188,7 @@ public:
~
Bin
()
override
;
bool
isLoading
;
void
dockWidgetInit
(
QDockWidget
*
m_DockClipWidget
);
/** @brief Sets the document for the bin and initialize some stuff */
void
setDocument
(
KdenliveDoc
*
project
);
/** @brief Delete all project related data, to be called before setDocument */
...
...
@@ -298,6 +311,7 @@ public:
void
loadFolderState
(
QStringList
foldersToExpand
);
/** @brief gets a QList of all clips used in timeline */
QList
<
int
>
getUsedClipIds
();
ClipWidget
*
getWidget
();
// TODO refac: remove this and call directly the function in ProjectItemModel
void
cleanupUnused
();
...
...
@@ -471,6 +485,7 @@ private:
QActionGroup
*
m_sortGroup
;
SmallJobLabel
*
m_infoLabel
;
TagWidget
*
m_tagsWidget
;
ClipWidget
*
m_clipWidget
;
QMenu
*
m_filterMenu
;
QActionGroup
m_filterGroup
;
QActionGroup
m_filterRateGroup
;
...
...
src/dialogs/clipcreationdialog.cpp
View file @
984f452f
...
...
@@ -417,6 +417,7 @@ void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, const QString &par
while
(
fileName
.
size
()
>
0
&&
fileName
.
at
(
fileName
.
size
()
-
1
).
isDigit
())
{
fileName
.
chop
(
1
);
}
QString
duration
=
doc
->
timecode
().
reformatSeparators
(
KdenliveSettings
::
sequence_duration
());
std
::
unordered_map
<
QString
,
QString
>
properties
;
properties
[
QStringLiteral
(
"ttl"
)]
=
QString
::
number
(
doc
->
getFramePos
(
duration
));
...
...
@@ -448,3 +449,46 @@ void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, const QString &par
pCore
->
pushUndo
(
undo
,
redo
,
i18np
(
"Add clip"
,
"Add clips"
,
list
.
size
()));
}
}
void
ClipCreationDialog
::
clipWidget
(
QDockWidget
*
m_DockClipWidget
,
KdenliveDoc
*
doc
,
const
std
::
shared_ptr
<
ProjectItemModel
>
model
)
{
QString
clipFolder
=
KRecentDirs
::
dir
(
QStringLiteral
(
":KdenliveClipFolder"
));
KFileWidget
*
fileWidget
=
new
KFileWidget
(
QUrl
::
fromLocalFile
(
clipFolder
),
m_DockClipWidget
);
fileWidget
->
setMode
(
KFile
::
Files
|
KFile
::
ExistingOnly
|
KFile
::
LocalOnly
|
KFile
::
Directory
);
QPushButton
*
importseq
=
new
QPushButton
(
i18n
(
"Import image sequence"
));
fileWidget
->
setCustomWidget
(
importseq
);
QObject
::
connect
(
importseq
,
&
QPushButton
::
clicked
,
fileWidget
,
&
KFileWidget
::
slotOk
);
QObject
::
connect
(
importseq
,
&
QPushButton
::
clicked
,
fileWidget
,
&
KFileWidget
::
accepted
);
QObject
::
connect
(
importseq
,
&
QPushButton
::
clicked
,
fileWidget
,
&
KFileWidget
::
accept
);
QObject
::
connect
(
importseq
,
&
QPushButton
::
clicked
,
fileWidget
,
[
=
,
&
doc
]{
QUrl
url
;
url
=
fileWidget
->
selectedUrl
();
QStringList
patternlist
;
QString
pattern
=
SlideshowClip
::
selectedPath
(
url
,
false
,
QString
(),
&
patternlist
);
int
count
=
patternlist
.
size
();
QString
fileName
=
url
.
fileName
().
section
(
QLatin1Char
(
'.'
),
0
,
-
2
);
if
(
count
>=
1
)
{
while
(
fileName
.
size
()
>
0
&&
fileName
.
at
(
fileName
.
size
()
-
1
).
isDigit
())
{
fileName
.
chop
(
1
);
}
QString
parentFolder
=
"-1"
;
QString
duration
=
doc
->
timecode
().
reformatSeparators
(
KdenliveSettings
::
sequence_duration
());
std
::
unordered_map
<
QString
,
QString
>
properties
;
properties
[
QStringLiteral
(
"ttl"
)]
=
QString
::
number
(
doc
->
getFramePos
(
duration
));
properties
[
QStringLiteral
(
"loop"
)]
=
QString
::
number
(
0
);
properties
[
QStringLiteral
(
"crop"
)]
=
QString
::
number
(
0
);
properties
[
QStringLiteral
(
"fade"
)]
=
QString
::
number
(
0
);
properties
[
QStringLiteral
(
"luma_duration"
)]
=
QString
::
number
(
doc
->
getFramePos
(
doc
->
timecode
().
getTimecodeFromFrames
(
int
(
ceil
(
doc
->
timecode
().
fps
())))));
int
frame_duration
=
doc
->
getFramePos
(
duration
)
*
count
;
ClipCreator
::
createSlideshowClip
(
pattern
,
frame_duration
,
fileName
,
parentFolder
,
properties
,
model
);
return
;
}
});
m_DockClipWidget
->
setWidget
(
fileWidget
);
}
src/dialogs/clipcreationdialog.h
View file @
984f452f
...
...
@@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define CLIPCREATIONDIALOG_H
#include "definitions.h"
#include <QDockWidget>
class
KdenliveDoc
;
class
Bin
;
...
...
@@ -45,6 +46,7 @@ void createSlideshowClip(KdenliveDoc *doc, const QString &parentId, std::shared_
void
createTitleClip
(
KdenliveDoc
*
doc
,
const
QString
&
parentFolder
,
const
QString
&
templatePath
,
std
::
shared_ptr
<
ProjectItemModel
>
model
);
void
createTitleTemplateClip
(
KdenliveDoc
*
doc
,
const
QString
&
parentFolder
,
std
::
shared_ptr
<
ProjectItemModel
>
model
);
void
createClipsCommand
(
KdenliveDoc
*
doc
,
const
QString
&
parentFolder
,
const
std
::
shared_ptr
<
ProjectItemModel
>
&
model
);
void
clipWidget
(
QDockWidget
*
m_DockClipWidget
,
KdenliveDoc
*
doc
,
const
std
::
shared_ptr
<
ProjectItemModel
>
model
);
}
// namespace ClipCreationDialog
#endif
src/mainwindow.cpp
View file @
984f452f
...
...
@@ -346,7 +346,8 @@ void MainWindow::init()
spectrumDock
->
close
();
m_projectBinDock
=
addDock
(
i18n
(
"Project Bin"
),
QStringLiteral
(
"project_bin"
),
pCore
->
bin
());
QDockWidget
*
m_ClipDockWidget
=
addDock
(
i18n
(
"Media Browser"
),
QStringLiteral
(
"bin_clip"
),
pCore
->
bin
()
->
getWidget
());
pCore
->
bin
()
->
dockWidgetInit
(
m_ClipDockWidget
);
m_assetPanel
=
new
AssetPanel
(
this
);
m_effectStackDock
=
addDock
(
i18n
(
"Effect/Composition Stack"
),
QStringLiteral
(
"effect_stack"
),
m_assetPanel
);
connect
(
m_assetPanel
,
&
AssetPanel
::
doSplitEffect
,
m_projectMonitor
,
&
Monitor
::
slotSwitchCompare
);
...
...
src/project/projectmanager.h
View file @
984f452f
...
...
@@ -89,7 +89,7 @@ public:
*/
void
saveWithUpdatedProfile
(
const
QString
&
updatedProfile
);
/** @brief Get the number of tracks in this projec (video, audio).
/** @brief Get the number of tracks in this projec
t
(video, audio).
*/
QPair
<
int
,
int
>
tracksCount
();
...
...
src/timeline2/view/qml/Composition.qml
View file @
984f452f
...
...
@@ -216,7 +216,6 @@ Item {
anchors.fill
:
displayRect
anchors.margins
:
displayRect
.
border
.
width
clip
:
true
Rectangle
{
// text background
id
:
labelRect
...
...
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