Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
208e377c
Commit
208e377c
authored
Jan 16, 2010
by
Hugo Beauzee-Luyssen
Browse files
Refactored track counting.
Adding track count to clip property window
parent
a87971d5
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/Gui/ClipProperty.cpp
View file @
208e377c
...
...
@@ -51,7 +51,11 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
ui
->
fpsValueLabel
->
setText
(
QString
::
number
(
m_clip
->
getParent
()
->
getFps
()
)
);
//Snapshot
ui
->
snapshotLabel
->
setPixmap
(
m_clip
->
getParent
()
->
getSnapshot
().
scaled
(
128
,
128
,
Qt
::
KeepAspectRatio
)
);
//nb tracks :
ui
->
nbVideoTracksValueLabel
->
setText
(
QString
::
number
(
m_clip
->
getParent
()
->
getNbVideoTracks
()
)
);
ui
->
nbAudioTracksValueLabel
->
setText
(
QString
::
number
(
m_clip
->
getParent
()
->
getNbAudioTracks
()
)
);
//Metatags
const
QPushButton
*
button
=
ui
->
buttonBox
->
button
(
QDialogButtonBox
::
Apply
);
Q_ASSERT
(
button
!=
NULL
);
...
...
src/Gui/timeline/TracksView.cpp
View file @
208e377c
...
...
@@ -176,6 +176,7 @@ void TracksView::deleteMedia( const QUuid& uuid )
void
TracksView
::
addMediaItem
(
Clip
*
clip
,
unsigned
int
track
,
MainWorkflow
::
TrackType
trackType
,
qint64
start
)
{
qDebug
()
<<
"adding media item"
;
Q_ASSERT
(
clip
);
// If there is not enough tracks to insert
...
...
@@ -204,7 +205,7 @@ void TracksView::addMediaItem( Clip* clip, unsigned int track, MainWorkflow::Tra
if
(
track
+
1
==
m_numAudioTrack
)
addAudioTrack
();
}
qDebug
()
<<
"check for existence in timeline"
;
// Is the clip already existing in the timeline ?
QList
<
QGraphicsItem
*>
trackItems
=
getTrack
(
trackType
,
track
)
->
childItems
();;
for
(
int
i
=
0
;
i
<
trackItems
.
size
();
++
i
)
...
...
@@ -216,6 +217,7 @@ void TracksView::addMediaItem( Clip* clip, unsigned int track, MainWorkflow::Tra
return
;
}
qDebug
()
<<
"connecting split"
;
AbstractGraphicsMediaItem
*
item
=
0
;
if
(
trackType
==
MainWorkflow
::
VideoTrack
)
{
...
...
@@ -232,6 +234,7 @@ void TracksView::addMediaItem( Clip* clip, unsigned int track, MainWorkflow::Tra
item
=
new
GraphicsAudioItem
(
clip
);
}
qDebug
()
<<
"doing stuffs"
;
item
->
m_tracksView
=
this
;
item
->
setHeight
(
tracksHeight
()
);
item
->
setParentItem
(
getTrack
(
trackType
,
track
)
);
...
...
src/Gui/ui/ClipProperty.ui
View file @
208e377c
...
...
@@ -50,7 +50,7 @@
</size>
</property>
<property
name=
"text"
>
<string
>
TextLabel
</string
>
<string
/
>
</property>
</widget>
</item>
...
...
@@ -156,6 +156,34 @@
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
>
<widget
class=
"QLabel"
name=
"nbVideoTracks"
>
<property
name=
"text"
>
<string>
Number of video tracks
</string>
</property>
</widget>
</item>
<item
row=
"5"
column=
"0"
>
<widget
class=
"QLabel"
name=
"nbAudioTracks"
>
<property
name=
"text"
>
<string>
Number of audio tracks
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"1"
>
<widget
class=
"QLabel"
name=
"nbVideoTracksValueLabel"
>
<property
name=
"text"
>
<string>
0
</string>
</property>
</widget>
</item>
<item
row=
"5"
column=
"1"
>
<widget
class=
"QLabel"
name=
"nbAudioTracksValueLabel"
>
<property
name=
"text"
>
<string>
0
</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
...
...
src/LibVLCpp/VLCMediaPlayer.cpp
View file @
208e377c
...
...
@@ -267,14 +267,18 @@ QString MediaPlayer::getLoadedMRL()
return
QString
(
str
);
}
bool
MediaPlayer
::
hasVide
oTrack
()
int
MediaPlayer
::
getNbAudi
oTrack
()
{
return
(
libvlc_video_get_track_count
(
m_internalPtr
,
m_ex
)
>
0
);
int
res
=
libvlc_audio_get_track_count
(
m_internalPtr
,
m_ex
);
CheckVlcppException
(
m_ex
);
return
res
;
}
bool
MediaPlayer
::
hasAudi
oTrack
()
int
MediaPlayer
::
getNbVide
oTrack
()
{
return
(
libvlc_audio_get_track_count
(
m_internalPtr
,
m_ex
)
>
0
);
int
res
=
libvlc_video_get_track_count
(
m_internalPtr
,
m_ex
);
CheckVlcppException
(
m_ex
);
return
res
;
}
src/LibVLCpp/VLCMediaPlayer.h
View file @
208e377c
...
...
@@ -62,8 +62,8 @@ namespace LibVLCpp
bool
hasVout
();
const
QString
&
getLoadedFileName
()
const
;
QString
getLoadedMRL
();
bool
hasVide
oTrack
();
bool
hasAudi
oTrack
();
int
getNbAudi
oTrack
();
int
getNbVide
oTrack
();
private:
static
void
callbacks
(
const
libvlc_event_t
*
event
,
void
*
self
);
...
...
src/Media/Media.cpp
View file @
208e377c
...
...
@@ -47,8 +47,8 @@ Media::Media( const QString& filePath, const QString& uuid /*= QString()*/ )
m_height
(
0
),
m_fps
(
.0
f
),
m_baseClip
(
NULL
),
m_
hasVideo
(
false
),
m_
hasAudio
(
false
)
m_
nbAudioTracks
(
0
),
m_
nbVideoTracks
(
0
)
{
if
(
uuid
.
length
()
==
0
)
m_uuid
=
QUuid
::
createUuid
();
...
...
@@ -277,20 +277,37 @@ void Media::removeClip( const QUuid& uuid )
}
bool
Media
::
hasAudioTrack
()
const
Media
::
hasAudioTrack
()
const
{
return
m_hasAudio
;
return
(
m_nbAudioTracks
>
0
)
;
}
bool
Media
::
hasVideoTrack
()
const
{
return
m_hasVideo
;
return
(
m_nbVideoTracks
>
0
)
;
}
void
Media
::
set
TracksAvailable
(
bool
video
,
bool
audio
)
Media
::
set
NbAudioTrack
(
int
nbTrack
)
{
m_hasVideo
=
video
;
m_hasAudio
=
audio
;
m_nbAudioTracks
=
nbTrack
;
}
void
Media
::
setNbVideoTrack
(
int
nbTracks
)
{
m_nbVideoTracks
=
nbTracks
;
}
int
Media
::
getNbAudioTracks
()
const
{
return
m_nbAudioTracks
;
}
int
Media
::
getNbVideoTracks
()
const
{
return
m_nbVideoTracks
;
}
src/Media/Media.h
View file @
208e377c
...
...
@@ -116,7 +116,10 @@ public:
bool
hasAudioTrack
()
const
;
bool
hasVideoTrack
()
const
;
void
setTracksAvailable
(
bool
video
,
bool
audio
);
void
setNbAudioTrack
(
int
nbTrack
);
void
setNbVideoTrack
(
int
nbTrack
);
int
getNbAudioTracks
()
const
;
int
getNbVideoTracks
()
const
;
FileType
getFileType
()
const
;
static
const
QString
VideoExtensions
;
...
...
@@ -167,8 +170,8 @@ protected:
Clip
*
m_baseClip
;
QHash
<
QUuid
,
Clip
*>
m_clips
;
QList
<
int
>*
m_audioValueList
;
bool
m_
hasVideo
;
bool
m_
hasAudio
;
int
m_
nbAudioTracks
;
int
m_
nbVideoTracks
;
signals:
void
metaDataComputed
(
Media
*
);
...
...
src/Metadata/MetaDataWorker.cpp
View file @
208e377c
...
...
@@ -126,8 +126,8 @@ void MetaDataWorker::metaDataAvailable()
}
m_media
->
setLength
(
m_mediaPlayer
->
getLength
()
);
m_media
->
set
TracksAvailable
(
m_mediaPlayer
->
hasVide
oTrack
()
,
m_mediaPlayer
->
hasAudi
oTrack
()
);
m_media
->
set
NbAudioTrack
(
m_mediaPlayer
->
getNbAudi
oTrack
()
);
m_media
->
setNbVideoTrack
(
m_mediaPlayer
->
getNbVide
oTrack
()
);
m_media
->
setNbFrames
(
(
m_media
->
getLengthMS
()
/
1000
)
*
m_media
->
getFps
()
);
m_media
->
emitMetaDataComputed
();
...
...
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