Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
4f66175b
Commit
4f66175b
authored
Mar 08, 2010
by
Hugo Beauzee-Luyssen
Browse files
MediaCellView: Unbreak the way clip count should be handled.
This doesn't restore the functionnality yet.
parent
48db69f0
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/Gui/library/MediaCellView.cpp
View file @
4f66175b
...
...
@@ -38,24 +38,46 @@ MediaCellView::MediaCellView( Clip* clip, QWidget *parent ) :
setAutoFillBackground
(
true
);
connect
(
m_ui
->
delLabel
,
SIGNAL
(
clicked
(
QWidget
*
,
QMouseEvent
*
)
),
this
,
SLOT
(
deleteButtonClicked
(
QWidget
*
,
QMouseEvent
*
)
)
);
connect
(
m_ui
->
arrow
,
SIGNAL
(
clicked
(
QWidget
*
,
QMouseEvent
*
)
),
SLOT
(
arrowButtonClicked
(
QWidget
*
,
QMouseEvent
*
)
)
);
if
(
clip
->
isBaseClip
()
==
true
)
{
connect
(
m_ui
->
arrow
,
SIGNAL
(
clicked
(
QWidget
*
,
QMouseEvent
*
)
),
SLOT
(
arrowButtonClicked
(
QWidget
*
,
QMouseEvent
*
)
)
);
m_ui
->
clipCount
->
setText
(
QString
::
number
(
clip
->
getParent
()
->
clipsCount
()
)
);
connect
(
clip
->
getParent
(),
SIGNAL
(
clipAdded
(
Clip
*
)
),
this
,
SLOT
(
nbClipUpdated
(
Clip
*
)
)
);
connect
(
clip
->
getParent
(),
SIGNAL
(
clipRemoved
(
Clip
*
)
),
this
,
SLOT
(
nbClipUpdated
(
Clip
*
)
)
);
}
else
{
m_ui
->
clipCount
->
hide
();
m_ui
->
clipCountLabel
->
hide
();
m_ui
->
arrow
->
hide
();
disconnect
(
m_ui
->
arrow
,
SIGNAL
(
clicked
(
QWidget
*
,
QMouseEvent
*
)
),
this
,
SLOT
(
arrowButtonClicked
(
QWidget
*
,
QMouseEvent
*
)
)
);
}
if
(
clip
->
getParent
()
->
isMetadataComputed
()
==
false
)
setEnabled
(
false
);
connect
(
clip
->
getParent
(),
SIGNAL
(
metaDataComputed
(
const
Media
*
)
),
this
,
SLOT
(
metadataUpdated
(
const
Media
*
)
)
);
connect
(
clip
->
getParent
(),
SIGNAL
(
snapshotComputed
(
const
Media
*
)
),
this
,
SLOT
(
snapshotUpdated
(
const
Media
*
)
)
);
setThumbnail
(
clip
->
getParent
()
->
snapshot
()
);
setTitle
(
clip
->
getParent
()
->
fileName
()
);
setLength
(
clip
->
lengthSecond
()
*
1000
);
}
MediaCellView
::~
MediaCellView
()
{
delete
m_ui
;
}
void
MediaCellView
::
metadataUpdated
(
const
Media
*
media
)
{
setNbClips
(
media
->
clipsCount
()
);
setLength
(
media
->
lengthMS
()
);
setEnabled
(
true
);
}
...
...
@@ -66,11 +88,6 @@ MediaCellView::snapshotUpdated( const Media *media )
setThumbnail
(
media
->
snapshot
()
);
}
MediaCellView
::~
MediaCellView
()
{
delete
m_ui
;
}
void
MediaCellView
::
changeEvent
(
QEvent
*
e
)
{
QWidget
::
changeEvent
(
e
);
...
...
@@ -89,9 +106,9 @@ void MediaCellView::setTitle( const QString& title )
m_ui
->
title
->
setText
(
title
);
}
void
MediaCellView
::
setN
bClip
s
(
int
nbC
lip
)
void
MediaCellView
::
n
bClip
Updated
(
Clip
*
c
lip
)
{
m_ui
->
clipCount
->
setText
(
QString
::
number
(
nbClip
)
);
m_ui
->
clipCount
->
setText
(
QString
::
number
(
clip
->
getParent
()
->
clipsCount
()
)
);
}
void
...
...
@@ -194,12 +211,7 @@ void MediaCellView::decrementClipCount( const int nb )
void
MediaCellView
::
containsClip
()
{
m_ui
->
clipCount
->
hide
();
m_ui
->
clipCountLabel
->
hide
();
m_ui
->
arrow
->
hide
();
disconnect
(
m_ui
->
arrow
,
SIGNAL
(
clicked
(
QWidget
*
,
QMouseEvent
*
)
),
this
,
SLOT
(
arrowButtonClicked
(
QWidget
*
,
QMouseEvent
*
)
)
);
}
const
QUuid
&
...
...
src/Gui/library/MediaCellView.h
View file @
4f66175b
...
...
@@ -45,7 +45,6 @@ public:
~
MediaCellView
();
void
setTitle
(
const
QString
&
title
);
void
setNbClips
(
int
nbClip
);
void
setThumbnail
(
const
QPixmap
&
pixmap
);
const
QPixmap
*
getThumbnail
()
const
;
/**
...
...
@@ -84,6 +83,8 @@ public slots:
private
slots
:
void
snapshotUpdated
(
const
Media
*
media
);
void
metadataUpdated
(
const
Media
*
media
);
void
nbClipUpdated
(
Clip
*
clip
);
};
#endif // MEDIACELLVIEW_H
src/Gui/library/MediaListViewController.cpp
View file @
4f66175b
...
...
@@ -54,7 +54,6 @@ void MediaListViewController::newMediaLoaded( Media* media )
this
,
SLOT
(
showClipList
(
const
QUuid
&
)
)
);
connect
(
media
,
SIGNAL
(
clipAdded
(
Clip
*
)
),
this
,
SLOT
(
newClipAdded
(
Clip
*
)
)
);
cell
->
setNbClips
(
media
->
clipsCount
()
);
addCell
(
cell
);
m_cells
->
insert
(
media
->
baseClip
()
->
uuid
(),
cell
);
}
...
...
src/Media/Clip.cpp
View file @
4f66175b
...
...
@@ -236,3 +236,9 @@ Clip::maxEnd() const
{
return
m_maxEnd
;
}
bool
Clip
::
isBaseClip
()
const
{
return
(
m_parent
->
baseClip
()
==
this
);
}
src/Media/Clip.h
View file @
4f66175b
...
...
@@ -115,6 +115,8 @@ class Clip : public QObject
void
computeLength
();
bool
isBaseClip
()
const
;
private:
Media
*
m_parent
;
/**
...
...
src/Media/Media.cpp
View file @
4f66175b
...
...
@@ -291,9 +291,12 @@ Media::clips() const
return
m_clips
;
}
void
Media
::
removeClip
(
const
QUuid
&
uuid
)
Clip
*
Media
::
removeClip
(
const
QUuid
&
uuid
)
{
m_clips
.
remove
(
uuid
);
Clip
*
clip
=
m_clips
.
take
(
uuid
);
emit
clipRemoved
(
clip
);
return
clip
;
}
bool
...
...
src/Media/Media.h
View file @
4f66175b
...
...
@@ -138,7 +138,7 @@ public:
// bool hasMetadata() const;
bool
addClip
(
Clip
*
clip
);
void
removeClip
(
const
QUuid
&
uuid
);
Clip
*
removeClip
(
const
QUuid
&
uuid
);
Clip
*
clip
(
const
QUuid
&
uuid
);
quint32
clipsCount
()
const
;
const
QHash
<
QUuid
,
Clip
*>
&
clips
()
const
;
...
...
@@ -181,6 +181,7 @@ signals:
void
snapshotComputed
(
const
Media
*
);
void
audioSpectrumComputed
(
const
QUuid
&
);
void
clipAdded
(
Clip
*
);
void
clipRemoved
(
Clip
*
);
};
#endif // CLIP_H__
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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