Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
48f7e0b2
Commit
48f7e0b2
authored
Sep 23, 2006
by
zorglub
Browse files
Very very preliminary Qt implementation of album art
parent
2b7997ac
Changes
6
Hide whitespace changes
Inline
Side-by-side
modules/gui/qt4/components/interface_widgets.cpp
View file @
48f7e0b2
...
...
@@ -287,7 +287,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_intf ) :
selector
->
setMaximumWidth
(
130
);
left
->
addWidget
(
selector
);
QLabel
*
art
=
new
QLabel
(
""
);
art
=
new
QLabel
(
""
);
art
->
setMaximumHeight
(
128
);
art
->
setMaximumWidth
(
128
);
art
->
setScaledContents
(
true
);
...
...
@@ -302,6 +302,8 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_intf ) :
CONNECT
(
selector
,
activated
(
int
),
rightPanel
,
setRoot
(
int
)
);
CONNECT
(
qobject_cast
<
StandardPLPanel
*>
(
rightPanel
)
->
model
,
artSet
(
QString
)
,
this
,
setArt
(
QString
)
);
connect
(
selector
,
SIGNAL
(
activated
(
int
)),
this
,
SIGNAL
(
rootChanged
(
int
)
)
);
emit
rootChanged
(
p_root
->
i_id
);
...
...
@@ -312,6 +314,12 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_intf ) :
setLayout
(
layout
);
}
void
PlaylistWidget
::
setArt
(
QString
url
)
{
fprintf
(
stderr
,
"************** YEAH ! *************
\n
"
);
art
->
setPixmap
(
QPixmap
(
url
)
);
}
PlaylistWidget
::~
PlaylistWidget
()
{
}
...
...
modules/gui/qt4/components/interface_widgets.hpp
View file @
48f7e0b2
...
...
@@ -136,6 +136,9 @@ private:
PLSelector
*
selector
;
PLPanel
*
rightPanel
;
QPushButton
*
addButton
;
QLabel
*
art
;
private
slots
:
void
setArt
(
QString
);
signals:
void
rootChanged
(
int
);
};
...
...
modules/gui/qt4/components/playlist/panels.hpp
View file @
48f7e0b2
...
...
@@ -55,6 +55,7 @@ public slots:
virtual
void
setRoot
(
int
)
=
0
;
};
class
PlaylistWidget
;
class
StandardPLPanel
:
public
PLPanel
{
...
...
@@ -65,8 +66,10 @@ public:
virtual
~
StandardPLPanel
();
protected:
virtual
void
keyPressEvent
(
QKeyEvent
*
e
);
pr
ivate
:
pr
otected
:
PLModel
*
model
;
friend
class
PlaylistWidget
;
private:
QTreeView
*
view
;
QPushButton
*
repeatButton
,
*
randomButton
,
*
addButton
;
ClickLineEdit
*
searchLine
;
...
...
modules/gui/qt4/components/playlist/selector.hpp
View file @
48f7e0b2
...
...
@@ -30,6 +30,7 @@
#include
<playlist_model.hpp>
class
QTreeView
;
class
PlaylistWidget
;
class
PLSelector
:
public
QWidget
{
...
...
@@ -37,9 +38,11 @@ class PLSelector: public QWidget
public:
PLSelector
(
QWidget
*
p
,
intf_thread_t
*
_p_intf
,
playlist_t
*
);
virtual
~
PLSelector
();
protected:
PLModel
*
model
;
friend
class
PlaylistWidget
;
private:
intf_thread_t
*
p_intf
;
PLModel
*
model
;
QTreeView
*
view
;
private
slots
:
void
setSource
(
const
QModelIndex
&
);
...
...
modules/gui/qt4/playlist_model.cpp
View file @
48f7e0b2
...
...
@@ -132,6 +132,15 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
strings
[
2
]
=
QString
(
psz_duration
);
type
=
p_item
->
p_input
->
i_type
;
current
=
iscurrent
;
fprintf
(
stderr
,
"Updating current %i
\n
"
);
fprintf
(
stderr
,
"Meta %p art %s
\n
"
,
p_item
->
p_input
->
p_meta
,
p_item
->
p_input
->
p_meta
?
p_item
->
p_input
->
p_meta
->
psz_arturl
:
"non"
);
if
(
current
&&
p_item
->
p_input
->
p_meta
&&
p_item
->
p_input
->
p_meta
->
psz_arturl
&&
!
strncmp
(
p_item
->
p_input
->
p_meta
->
psz_arturl
,
"file://"
,
7
)
)
{
fprintf
(
stderr
,
"Have art %s
\n
"
,
p_item
->
p_input
->
p_meta
->
psz_arturl
);
model
->
sendArt
(
qfu
(
p_item
->
p_input
->
p_meta
->
psz_arturl
)
);
}
}
/*************************************************************************
...
...
@@ -593,6 +602,13 @@ void PLModel::UpdateTreeItem( playlist_item_t *p_item, PLItem *item,
/************************* Actions ******************************/
void
PLModel
::
sendArt
(
QString
url
)
{
QString
arturl
=
url
.
replace
(
"file://"
,
QString
(
""
)
);
fprintf
(
stderr
,
"send %s
\n
"
,
qta
(
arturl
)
);
emit
artSet
(
arturl
);
}
/**
* Deletion, here we have to do a ugly slow hack as we retrieve the full
* list of indexes to delete at once: when we delete a node and all of
...
...
modules/gui/qt4/playlist_model.hpp
View file @
48f7e0b2
...
...
@@ -121,6 +121,8 @@ public:
void
doDelete
(
QModelIndexList
selected
);
void
search
(
QString
search
);
void
sort
(
int
column
,
Qt
::
SortOrder
order
);
void
sendArt
(
QString
url
);
private:
void
addCallbacks
();
void
delCallbacks
();
...
...
@@ -159,6 +161,8 @@ private:
PLItem
*
p_cached_item_bi
;
int
i_cached_id
;
int
i_cached_input_id
;
signals:
void
artSet
(
QString
);
public
slots
:
void
activateItem
(
const
QModelIndex
&
index
);
void
activateItem
(
playlist_item_t
*
p_item
);
...
...
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