Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Farid Abdelnour
kdenlive
Commits
4d59dfaf
Commit
4d59dfaf
authored
Dec 29, 2011
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Freesound: save audio file url in clip comment (for attribution)
parent
a3912e34
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
14 deletions
+21
-14
src/clipmanager.cpp
src/clipmanager.cpp
+4
-3
src/clipmanager.h
src/clipmanager.h
+2
-2
src/kdenlivedoc.cpp
src/kdenlivedoc.cpp
+2
-2
src/kdenlivedoc.h
src/kdenlivedoc.h
+1
-1
src/mainwindow.cpp
src/mainwindow.cpp
+3
-3
src/mainwindow.h
src/mainwindow.h
+1
-1
src/utils/freesound.cpp
src/utils/freesound.cpp
+1
-1
src/utils/freesound.h
src/utils/freesound.h
+1
-1
src/widgets/freesound_ui.ui
src/widgets/freesound_ui.ui
+6
-0
No files found.
src/clipmanager.cpp
View file @
4d59dfaf
...
...
@@ -460,7 +460,7 @@ void ClipManager::resetProducersList(const QList <Mlt::Producer *> prods, bool d
emit
checkAllClips
(
displayRatioChanged
,
fpsChanged
,
brokenClips
);
}
void
ClipManager
::
slotAddClipList
(
const
KUrl
::
List
urls
,
const
QString
&
group
,
const
QString
&
groupId
)
void
ClipManager
::
slotAddClipList
(
const
KUrl
::
List
urls
,
const
QString
&
group
,
const
QString
&
groupId
,
const
QString
&
comment
)
{
QUndoCommand
*
addClips
=
new
QUndoCommand
();
foreach
(
const
KUrl
&
file
,
urls
)
{
...
...
@@ -476,6 +476,7 @@ void ClipManager::slotAddClipList(const KUrl::List urls, const QString &group, c
prod
.
setAttribute
(
"resource"
,
file
.
path
());
uint
id
=
m_clipIdCounter
++
;
prod
.
setAttribute
(
"id"
,
QString
::
number
(
id
));
if
(
!
comment
.
isEmpty
())
prod
.
setAttribute
(
"description"
,
comment
);
if
(
!
group
.
isEmpty
())
{
prod
.
setAttribute
(
"groupname"
,
group
);
prod
.
setAttribute
(
"groupid"
,
groupId
);
...
...
@@ -536,9 +537,9 @@ void ClipManager::slotAddClipList(const KUrl::List urls, const QString &group, c
}
}
void
ClipManager
::
slotAddClipFile
(
const
KUrl
&
url
,
const
QString
&
group
,
const
QString
&
groupId
)
void
ClipManager
::
slotAddClipFile
(
const
KUrl
&
url
,
const
QString
&
group
,
const
QString
&
groupId
,
const
QString
&
comment
)
{
slotAddClipList
(
KUrl
::
List
(
url
),
group
,
groupId
);
slotAddClipList
(
KUrl
::
List
(
url
),
group
,
groupId
,
comment
);
}
void
ClipManager
::
slotAddXmlClipFile
(
const
QString
&
name
,
const
QDomElement
&
xml
,
const
QString
&
group
,
const
QString
&
groupId
)
...
...
src/clipmanager.h
View file @
4d59dfaf
...
...
@@ -72,14 +72,14 @@ Q_OBJECT public:
* @param url file to add
* @param group name of the group to insert the file in (can be empty)
* @param groupId id of the group (if any) */
void
slotAddClipFile
(
const
KUrl
&
url
,
const
QString
&
group
,
const
QString
&
groupId
);
void
slotAddClipFile
(
const
KUrl
&
url
,
const
QString
&
group
,
const
QString
&
groupId
,
const
QString
&
comment
=
QString
()
);
/** @brief Adds a list of files to the project.
* @param urls files to add
* @param group name of the group to insert the files in (can be empty)
* @param groupId id of the group (if any)
* It checks for duplicated items and asks to the user for instructions. */
void
slotAddClipList
(
const
KUrl
::
List
urls
,
const
QString
&
group
,
const
QString
&
groupId
);
void
slotAddClipList
(
const
KUrl
::
List
urls
,
const
QString
&
group
,
const
QString
&
groupId
,
const
QString
&
comment
=
QString
()
);
void
slotAddTextClipFile
(
const
QString
&
titleName
,
int
out
,
const
QString
&
xml
,
const
QString
&
group
,
const
QString
&
groupId
);
void
slotAddTextTemplateClip
(
QString
titleName
,
const
KUrl
&
path
,
const
QString
&
group
,
const
QString
&
groupId
);
void
slotAddXmlClipFile
(
const
QString
&
name
,
const
QDomElement
&
xml
,
const
QString
&
group
,
const
QString
&
groupId
);
...
...
src/kdenlivedoc.cpp
View file @
4d59dfaf
...
...
@@ -1201,9 +1201,9 @@ void KdenliveDoc::slotAddClipList(const KUrl::List urls, const QString &group, c
}
void
KdenliveDoc
::
slotAddClipFile
(
const
KUrl
&
url
,
const
QString
&
group
,
const
QString
&
groupId
)
void
KdenliveDoc
::
slotAddClipFile
(
const
KUrl
&
url
,
const
QString
&
group
,
const
QString
&
groupId
,
const
QString
&
comment
)
{
m_clipManager
->
slotAddClipFile
(
url
,
group
,
groupId
);
m_clipManager
->
slotAddClipFile
(
url
,
group
,
groupId
,
comment
);
emit
selectLastAddedClip
(
QString
::
number
(
m_clipManager
->
lastClipId
()));
setModified
(
true
);
}
...
...
src/kdenlivedoc.h
View file @
4d59dfaf
...
...
@@ -83,7 +83,7 @@ Q_OBJECT public:
*
* If the clip wasn't added before, it tries to add it to the project. */
bool
addClipInfo
(
QDomElement
elem
,
QDomElement
orig
,
QString
clipId
);
void
slotAddClipFile
(
const
KUrl
&
url
,
const
QString
&
group
,
const
QString
&
groupId
=
QString
());
void
slotAddClipFile
(
const
KUrl
&
url
,
const
QString
&
group
,
const
QString
&
groupId
=
QString
(),
const
QString
&
comment
=
QString
());
void
slotAddClipList
(
const
KUrl
::
List
urls
,
const
QString
&
group
,
const
QString
&
groupId
=
QString
());
void
deleteClip
(
const
QString
&
clipId
);
int
getFramePos
(
QString
duration
);
...
...
src/mainwindow.cpp
View file @
4d59dfaf
...
...
@@ -3055,10 +3055,10 @@ void MainWindow::slotEditItemDuration()
m_activeTimeline
->
projectView
()
->
editItemDuration
();
}
void
MainWindow
::
slotAddProjectClip
(
KUrl
url
)
void
MainWindow
::
slotAddProjectClip
(
KUrl
url
,
const
QString
&
comment
)
{
if
(
m_activeDocument
)
m_activeDocument
->
slotAddClipFile
(
url
,
QString
());
m_activeDocument
->
slotAddClipFile
(
url
,
QString
()
,
QString
(),
comment
);
}
void
MainWindow
::
slotAddProjectClipList
(
KUrl
::
List
urls
)
...
...
@@ -4508,7 +4508,7 @@ void MainWindow::slotDownloadAudio()
if
(
m_activeDocument
)
currentFolder
=
m_activeDocument
->
projectFolder
().
path
();
else
currentFolder
=
KdenliveSettings
::
defaultprojectfolder
();
FreeSound
*
d
=
new
FreeSound
(
currentFolder
);
connect
(
d
,
SIGNAL
(
addClip
(
KUrl
)),
this
,
SLOT
(
slotAddProjectClip
(
KUrl
)));
connect
(
d
,
SIGNAL
(
addClip
(
KUrl
,
const
QString
&
)),
this
,
SLOT
(
slotAddProjectClip
(
KUrl
,
const
QString
&
)));
d
->
show
();
}
...
...
src/mainwindow.h
View file @
4d59dfaf
...
...
@@ -411,7 +411,7 @@ private slots:
void
slotSelectAddTimelineTransition
();
void
slotAddVideoEffect
(
QAction
*
result
);
void
slotAddTransition
(
QAction
*
result
);
void
slotAddProjectClip
(
KUrl
url
);
void
slotAddProjectClip
(
KUrl
url
,
const
QString
&
comment
=
QString
()
);
void
slotAddProjectClipList
(
KUrl
::
List
urls
);
void
slotShowClipProperties
(
DocClipBase
*
clip
);
void
slotShowClipProperties
(
QList
<
DocClipBase
*>
cliplist
,
QMap
<
QString
,
QString
>
commonproperties
);
...
...
src/utils/freesound.cpp
View file @
4d59dfaf
...
...
@@ -199,7 +199,7 @@ void FreeSound::slotSaveSound()
QString
saveUrl
=
KFileDialog
::
getSaveFileName
(
KUrl
(
path
),
ext
);
if
(
saveUrl
.
isEmpty
())
return
;
if
(
KIO
::
NetAccess
::
download
(
KUrl
(
m_currentUrl
),
saveUrl
,
this
))
{
emit
addClip
(
KUrl
(
saveUrl
));
emit
addClip
(
KUrl
(
saveUrl
)
,
sound_name
->
url
()
);
}
}
...
...
src/utils/freesound.h
View file @
4d59dfaf
...
...
@@ -59,7 +59,7 @@ private:
QProcess
*
m_previewProcess
;
signals:
void
addClip
(
KUrl
);
void
addClip
(
KUrl
,
const
QString
&
);
};
...
...
src/widgets/freesound_ui.ui
View file @
4d59dfaf
...
...
@@ -82,6 +82,9 @@
<property
name=
"text"
>
<string/>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"4"
column=
"1"
>
...
...
@@ -116,6 +119,9 @@
<property
name=
"text"
>
<string/>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
</layout>
...
...
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