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
f4066d3c
Commit
f4066d3c
authored
Dec 17, 2009
by
Clement CHAVANCE
Committed by
Clement CHAVANCE
Dec 30, 2009
Browse files
clip view is now available in the media library
parent
432a2a91
Changes
11
Hide whitespace changes
Inline
Side-by-side
src/GUI/ImportMediaListController.cpp
View file @
f4066d3c
...
...
@@ -68,10 +68,8 @@ bool ImportMediaListController::contains( QUuid uuid )
void
ImportMediaListController
::
removeMedia
(
const
QUuid
&
uuid
)
{
ImportMediaCellView
*
cell
=
m_mediaCellList
->
value
(
uuid
);
removeCell
(
cell
);
removeCell
(
m_mediaCellList
->
value
(
uuid
)
);
m_mediaCellList
->
remove
(
uuid
);
delete
cell
;
}
void
ImportMediaListController
::
addClip
(
Clip
*
clip
)
...
...
src/GUI/import/ImportController.cpp
View file @
f4066d3c
...
...
@@ -139,7 +139,6 @@ void ImportController::mediaSelection( const QUuid& uuid )
void
ImportController
::
clipSelection
(
const
QUuid
&
uuid
)
{
qDebug
()
<<
m_clipListController
;
if
(
!
m_currentUuid
.
isNull
()
&&
!
m_controllerSwitched
)
m_clipListController
->
getCell
(
m_currentUuid
)
->
setPalette
(
palette
()
);
else
...
...
@@ -203,10 +202,8 @@ void ImportController::setUIMetaData( Clip* clip )
//compute clip length
QTime
time
;
qint64
length
=
clip
->
getLengthSecond
();
qDebug
()
<<
"Clip Length"
<<
length
;
time
=
time
.
addSecs
(
length
);
qDebug
()
<<
time
;
qDebug
()
<<
"time :"
<<
time
.
toString
(
"hh:mm:ss"
);
m_ui
->
durationValueLabel
->
setText
(
time
.
toString
(
"hh:mm:ss"
)
);
//Filename || title
m_ui
->
nameValueLabel
->
setText
(
clip
->
getParent
()
->
getFileInfo
()
->
fileName
()
);
...
...
@@ -275,13 +272,15 @@ void ImportController::mediaDeletion( const QUuid& uuid )
void
ImportController
::
clipDeletion
(
const
QUuid
&
uuid
)
{
m_
media
ListController
->
removeClip
(
uuid
);
m_
clip
ListController
->
removeClip
(
uuid
);
QUuid
id
;
foreach
(
id
,
m_model
->
getMedias
()
->
keys
()
)
{
Media
*
media
=
m_model
->
getMedias
()
->
value
(
id
);
if
(
media
->
clip
(
uuid
)
)
if
(
media
->
clip
(
uuid
)
)
{
media
->
removeClip
(
uuid
);
}
}
}
...
...
src/GUI/library/ListViewController.cpp
View file @
f4066d3c
...
...
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include
<QtDebug>
#include
<QPushButton>
#include
"ListViewController.h"
...
...
@@ -31,13 +32,11 @@ ListViewController::ListViewController( StackViewController* nav ) : m_nav( nav
m_title
=
new
QString
(
"Media List"
);
m_scrollArea
=
new
QScrollArea
();
m_layout
=
new
QVBoxLayout
();
m_container
=
new
QWidget
();
m_layout
->
setAlignment
(
Qt
::
AlignTop
);
m_layout
->
setSpacing
(
0
);
m_layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
m_container
->
setLayout
(
m_layout
);
m_scrollArea
->
setWidget
(
m_container
);
m_scrollArea
->
setLayout
(
m_layout
);
m_scrollArea
->
setWidgetResizable
(
true
);
m_scrollArea
->
setAcceptDrops
(
true
);
...
...
@@ -48,7 +47,6 @@ ListViewController::~ListViewController()
delete
m_title
;
delete
m_scrollArea
;
delete
m_layout
;
delete
m_container
;
}
// ViewController method implementation
...
...
@@ -71,4 +69,5 @@ void ListViewController::addCell( QWidget* cell )
void
ListViewController
::
removeCell
(
QWidget
*
cell
)
{
m_layout
->
removeWidget
(
cell
);
delete
cell
;
}
src/GUI/library/ListViewController.h
View file @
f4066d3c
...
...
@@ -54,7 +54,6 @@ protected:
private:
QString
*
m_title
;
QScrollArea
*
m_scrollArea
;
QWidget
*
m_container
;
StackViewController
*
m_nav
;
};
...
...
src/GUI/library/MediaCellView.cpp
View file @
f4066d3c
...
...
@@ -109,6 +109,7 @@ void MediaCellView::mousePressEvent( QMouseEvent* event )
void
MediaCellView
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
qDebug
()
<<
"in MediaCellView::mouseMoveEvent"
;
if
(
(
event
->
buttons
()
|
Qt
::
LeftButton
)
!=
Qt
::
LeftButton
)
return
;
...
...
@@ -147,9 +148,12 @@ void MediaCellView::arrowButtonClicked( QWidget*, QMouseEvent* )
emit
arrowClicked
(
uuid
()
);
}
void
MediaCellView
::
setLength
(
qint64
length
)
void
MediaCellView
::
setLength
(
qint64
length
,
bool
mSecs
)
{
QTime
duration
;
duration
=
duration
.
addMSecs
(
length
);
if
(
mSecs
)
duration
=
duration
.
addMSecs
(
length
);
else
duration
=
duration
.
addSecs
(
length
);
m_ui
->
length
->
setText
(
duration
.
toString
(
"hh:mm:ss"
)
);
}
src/GUI/library/MediaCellView.h
View file @
f4066d3c
...
...
@@ -48,7 +48,7 @@ public:
* \brief Set the length displayed in the cell
* \param length The media length, in ms.
*/
void
setLength
(
qint64
length
);
void
setLength
(
qint64
length
,
bool
mSecs
=
true
);
QString
title
()
const
;
const
QUuid
&
uuid
()
const
;
const
ClickableLabel
*
nextButton
()
const
;
...
...
src/GUI/library/MediaLibraryWidget.cpp
View file @
f4066d3c
...
...
@@ -32,10 +32,14 @@ MediaLibraryWidget::MediaLibraryWidget( QWidget* parent ) : QWidget( parent )
m_nav
=
new
StackViewController
(
this
);
MediaListViewController
*
list
=
new
MediaListViewController
(
m_nav
);
Library
*
library
=
Library
::
getInstance
();
//Media
connect
(
list
,
SIGNAL
(
mediaSelected
(
Media
*
)
),
this
,
SLOT
(
mediaSelection
(
Media
*
)
)
);
connect
(
list
,
SIGNAL
(
mediaDeleted
(
const
QUuid
&
)
),
library
,
SLOT
(
removingMediaAsked
(
const
QUuid
&
)
)
);
connect
(
library
,
SIGNAL
(
mediaRemoved
(
QUuid
)
),
list
,
SLOT
(
mediaRemoved
(
const
QUuid
&
)
)
);
connect
(
m_nav
,
SIGNAL
(
importRequired
()
),
this
,
SIGNAL
(
importRequired
()
)
);
//Clip
connect
(
list
,
SIGNAL
(
clipSelected
(
Clip
*
clip
)
),
this
,
SIGNAL
(
clipSelected
(
Clip
*
)
)
);
connect
(
list
,
SIGNAL
(
clipRemoved
(
const
QUuid
&
,
const
QUuid
&
)
),
library
,
SLOT
(
removeClip
(
const
QUuid
&
,
const
QUuid
&
)
)
);
m_nav
->
pushViewController
(
list
);
}
...
...
src/GUI/library/MediaListViewController.cpp
View file @
f4066d3c
...
...
@@ -93,5 +93,20 @@ void MediaListViewController::updateCell( Media* media )
void
MediaListViewController
::
showClipList
(
const
QUuid
&
uuid
)
{
qDebug
()
<<
"need to show the clip list of "
<<
uuid
;
if
(
Library
::
getInstance
()
->
getMedia
(
uuid
)
->
clips
()
->
size
()
==
0
)
return
;
m_clipsListView
=
new
ClipListViewController
(
m_nav
,
uuid
);
m_clipsListView
->
addClipsFromMedia
(
Library
::
getInstance
()
->
getMedia
(
uuid
)
);
qDebug
()
<<
"Clips added"
;
connect
(
m_clipsListView
,
SIGNAL
(
clipSelected
(
const
QUuid
&
)
),
this
,
SIGNAL
(
clipSelected
(
const
QUuid
&
)
)
);
m_nav
->
pushViewController
(
m_clipsListView
);
qDebug
()
<<
"View Pushed"
;
}
void
MediaListViewController
::
restoreContext
()
{
qDebug
()
<<
"context restored"
;
if
(
m_clipsListView
!=
0
)
delete
m_clipsListView
;
m_clipsListView
=
0
;
}
src/GUI/library/MediaListViewController.h
View file @
f4066d3c
...
...
@@ -4,6 +4,7 @@
#include
"StackViewController.h"
#include
"ListViewController.h"
#include
"MediaCellView.h"
#include
"ClipListViewController.h"
#include
"Library.h"
#include
"Media.h"
...
...
@@ -19,6 +20,7 @@ private:
StackViewController
*
m_nav
;
QUuid
m_currentUuid
;
QHash
<
QUuid
,
QWidget
*>*
m_cells
;
ClipListViewController
*
m_clipsListView
;
public
slots
:
void
newMediaLoaded
(
Media
*
);
...
...
@@ -27,6 +29,9 @@ public slots:
void
mediaRemoved
(
const
QUuid
&
uuid
);
void
updateCell
(
Media
*
media
);
void
showClipList
(
const
QUuid
&
uuid
);
private
slots
:
void
restoreContext
();
signals:
void
mediaSelected
(
Media
*
media
);
void
mediaDeleted
(
const
QUuid
&
uuid
);
...
...
src/GUI/library/StackViewController.cpp
View file @
f4066d3c
...
...
@@ -74,6 +74,7 @@ void StackViewController::pushViewController( ViewController* viewController,
}
m_current
=
viewController
;
qDebug
()
<<
"title :"
<<
&
m_current
->
title
();
m_nav
->
setTitle
(
m_current
->
title
()
);
m_layout
->
insertWidget
(
1
,
m_current
->
view
()
);
}
...
...
src/GUI/library/library.pri
View file @
f4066d3c
...
...
@@ -7,12 +7,13 @@ HEADERS += ListViewController.h \
MediaListViewController.h \
StackViewController.h \
StackViewNavController.h \
ViewController.h
ViewController.h \
ClipListViewController.h
SOURCES += ListViewController.cpp \
MediaCellView.cpp \
MediaLibraryWidget.cpp \
MediaListViewController.cpp \
StackViewController.cpp \
StackViewNavController.cpp
StackViewNavController.cpp
\
ClipListViewController.cpp
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