Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
aafe89da
Commit
aafe89da
authored
Jan 23, 2018
by
Jean-Baptiste Mardelle
Browse files
Split audio now extracts audio on audio tracks
parent
30d5daff
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/definitions.h
View file @
aafe89da
...
...
@@ -120,7 +120,7 @@ enum MonitorSceneType {
enum
MessageType
{
DefaultMessage
,
ProcessingJobMessage
,
OperationCompletedMessage
,
InformationMessage
,
ErrorMessage
,
MltError
};
enum
TrackType
{
AudioTrack
=
0
,
VideoTrack
=
1
};
enum
TrackType
{
AudioTrack
=
0
,
VideoTrack
=
1
,
AnyTrack
=
2
};
enum
CacheType
{
SystemCacheRoot
=
-
1
,
CacheRoot
=
0
,
CacheBase
=
1
,
CachePreview
=
2
,
CacheProxy
=
3
,
CacheAudio
=
4
,
CacheThumbs
=
5
};
...
...
src/timeline2/model/timelinefunctions.cpp
View file @
aafe89da
...
...
@@ -380,7 +380,13 @@ bool TimelineFunctions::requestSplitAudio(std::shared_ptr<TimelineItemModel> tim
int
position
=
timeline
->
getClipPosition
(
cid
);
int
duration
=
timeline
->
getClipPlaytime
(
cid
);
int
track
=
timeline
->
getClipTrackId
(
cid
);
int
newTrack
=
timeline
->
getNextTrackId
(
track
);
int
newTrack
=
timeline
->
getLowerTrackId
(
track
,
TrackType
::
AudioTrack
);
if
(
newTrack
==
-
1
)
{
// No available audio track for splitting, abort
undo
();
pCore
->
displayMessage
(
i18n
(
"No available audio track for split operation"
),
ErrorMessage
);
return
false
;
}
int
newId
;
TimelineFunctions
::
changeClipState
(
timeline
,
clipId
,
PlaylistState
::
VideoOnly
);
bool
res
=
copyClip
(
timeline
,
cid
,
newId
,
PlaylistState
::
AudioOnly
,
undo
,
redo
);
...
...
src/timeline2/model/timelinemodel.cpp
View file @
aafe89da
...
...
@@ -249,13 +249,29 @@ int TimelineModel::getTrackMltIndex(int trackId) const
return
getTrackPosition
(
trackId
)
+
1
;
}
int
TimelineModel
::
get
Next
TrackId
(
int
trackId
)
const
int
TimelineModel
::
get
Lower
TrackId
(
int
trackId
,
TrackType
type
)
const
{
READ_LOCK
();
Q_ASSERT
(
isTrack
(
trackId
));
auto
it
=
m_iteratorTable
.
at
(
trackId
);
--
it
;
return
(
it
!=
m_allTracks
.
begin
())
?
(
*
it
)
->
getId
()
:
-
1
;
while
(
it
!=
m_allTracks
.
begin
())
{
--
it
;
if
(
it
==
m_allTracks
.
begin
())
{
// no track available
return
-
1
;
}
if
(
type
==
TrackType
::
AnyTrack
)
{
return
(
*
it
)
->
getId
();
}
int
audioTrack
=
(
*
it
)
->
getProperty
(
"kdenlive:audio_track"
).
toInt
();
if
(
type
==
TrackType
::
AudioTrack
&&
audioTrack
==
1
)
{
return
(
*
it
)
->
getId
();
}
if
(
type
==
TrackType
::
VideoTrack
&&
audioTrack
==
0
)
{
return
(
*
it
)
->
getId
();
}
}
return
-
1
;
}
int
TimelineModel
::
getPreviousVideoTrackPos
(
int
trackId
)
const
...
...
src/timeline2/model/timelinemodel.hpp
View file @
aafe89da
...
...
@@ -245,7 +245,7 @@ public:
Return -1 if we give the last track
@param trackId Id of the track to test
*/
int
get
Next
TrackId
(
int
trackId
)
const
;
int
get
Lower
TrackId
(
int
trackId
,
TrackType
type
=
TrackType
::
AnyTrack
)
const
;
/* @brief Returns the MLT track index of the video track just below the given trackC
@param trackId Id of the track to test
...
...
Write
Preview
Supports
Markdown
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