Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
d732fd2f
Commit
d732fd2f
authored
Nov 19, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Beginning of implementation of art fetch when played
parent
420d5f17
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
287 deletions
+45
-287
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+8
-6
modules/gui/qt4/pixmaps/art.xpm
modules/gui/qt4/pixmaps/art.xpm
+0
-267
modules/gui/qt4/pixmaps/noart.png
modules/gui/qt4/pixmaps/noart.png
+0
-0
modules/gui/qt4/playlist_model.cpp
modules/gui/qt4/playlist_model.cpp
+8
-2
modules/gui/qt4/playlist_model.hpp
modules/gui/qt4/playlist_model.hpp
+1
-0
modules/gui/qt4/res.qrc
modules/gui/qt4/res.qrc
+1
-0
modules/gui/qt4/util/qvlcframe.hpp
modules/gui/qt4/util/qvlcframe.hpp
+0
-2
src/playlist/control.c
src/playlist/control.c
+18
-5
src/playlist/engine.c
src/playlist/engine.c
+9
-5
No files found.
modules/gui/qt4/components/interface_widgets.cpp
View file @
d732fd2f
...
...
@@ -27,7 +27,6 @@
#include "main_interface.hpp"
#include "input_manager.hpp"
#include "pixmaps/art.xpm"
#include <vlc/vout.h>
#include <QLabel>
...
...
@@ -286,10 +285,13 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_intf ) :
left
->
addWidget
(
selector
);
art
=
new
QLabel
(
""
);
art
->
setMinimumHeight
(
128
);
art
->
setMinimumWidth
(
128
);
art
->
setMaximumHeight
(
128
);
art
->
setMaximumWidth
(
128
);
art
->
setScaledContents
(
true
);
art
->
setPixmap
(
QPixmap
(
art_xpm
)
);
//":/vlc128.png" ) );
art
->
setPixmap
(
QPixmap
(
":/noart.png"
)
);
left
->
addWidget
(
art
);
playlist_item_t
*
p_root
=
playlist_GetPreferredNode
(
THEPL
,
...
...
@@ -319,11 +321,11 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_intf ) :
void
PlaylistWidget
::
setArt
(
QString
url
)
{
if
(
prevArt
!=
url
)
{
if
(
url
.
isNull
()
)
art
->
setPixmap
(
QPixmap
(
":/noart.png"
)
);
else
if
(
prevArt
!=
url
)
art
->
setPixmap
(
QPixmap
(
url
)
);
prevArt
=
url
;
}
prevArt
=
url
;
}
PlaylistWidget
::~
PlaylistWidget
()
...
...
modules/gui/qt4/pixmaps/art.xpm
deleted
100644 → 0
View file @
420d5f17
This diff is collapsed.
Click to expand it.
modules/gui/qt4/pixmaps/noart.png
0 → 100644
View file @
d732fd2f
15 KB
modules/gui/qt4/playlist_model.cpp
View file @
d732fd2f
...
...
@@ -133,12 +133,13 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
strings
[
2
]
=
QString
(
psz_duration
);
type
=
p_item
->
p_input
->
i_type
;
current
=
iscurrent
;
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
)
)
{
model
->
sendArt
(
qfu
(
p_item
->
p_input
->
p_meta
->
psz_arturl
)
);
}
else
if
(
current
)
model
->
removeArt
();
}
/*************************************************************************
...
...
@@ -729,6 +730,11 @@ void PLModel::sendArt( QString url )
emit
artSet
(
arturl
);
}
void
PLModel
::
removeArt
()
{
emit
artSet
(
QString
()
);
}
/**
* 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 @
d732fd2f
...
...
@@ -133,6 +133,7 @@ public:
QStringList
mimeTypes
()
const
;
void
sendArt
(
QString
url
);
void
removeArt
(
);
private:
void
addCallbacks
();
void
delCallbacks
();
...
...
modules/gui/qt4/res.qrc
View file @
d732fd2f
...
...
@@ -8,5 +8,6 @@
<file>
pixmaps/volume-low.png
</file>
<file>
pixmaps/volume-high.png
</file>
<file
alias=
"vlc128.png"
>
../../../share/vlc128x128.png
</file>
<file
alias=
"noart.png"
>
pixmaps/noart.png
</file>
</qresource>
</RCC>
modules/gui/qt4/util/qvlcframe.hpp
View file @
d732fd2f
...
...
@@ -66,7 +66,6 @@ public:
QPushButton
**
other
,
char
*
psz_other
)
{
#ifdef QT42
fprintf
(
stderr
,
"Gra
\n
"
);
#else
QHBoxLayout
*
buttons_layout
=
new
QHBoxLayout
;
QSpacerItem
*
spacerItem
=
new
QSpacerItem
(
40
,
20
,
...
...
@@ -75,7 +74,6 @@ public:
if
(
psz_default
)
{
utf8_fprintf
(
stderr
,
"Creating default button %s
\n
"
,
psz_default
);
*
defaul
=
new
QPushButton
(
0
);
(
*
defaul
)
->
setFocus
();
buttons_layout
->
addWidget
(
*
defaul
);
...
...
src/playlist/control.c
View file @
d732fd2f
...
...
@@ -188,7 +188,7 @@ int playlist_PreparseEnqueueItem( playlist_t *p_playlist,
}
int
playlist_AskForArtEnqueue
(
playlist_t
*
p_playlist
,
input_item_t
*
p_item
)
input_item_t
*
p_item
)
{
int
i
;
preparse_item_t
p
;
...
...
@@ -437,21 +437,34 @@ playlist_item_t * playlist_NextItem( playlist_t *p_playlist )
int
playlist_PlayItem
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_item
)
{
vlc_value_t
val
;
input_item_t
*
p_input
=
p_item
->
p_input
;
int
i_activity
=
var_GetInteger
(
p_playlist
,
"activity"
)
;
msg_Dbg
(
p_playlist
,
"creating new input thread"
);
p_i
tem
->
p_i
nput
->
i_nb_played
++
;
p_input
->
i_nb_played
++
;
p_playlist
->
status
.
p_item
=
p_item
;
p_playlist
->
status
.
i_status
=
PLAYLIST_RUNNING
;
var_SetInteger
(
p_playlist
,
"activity"
,
i_activity
+
DEFAULT_INPUT_ACTIVITY
);
p_playlist
->
p_input
=
input_CreateThread
(
p_playlist
,
p_item
->
p_input
);
p_playlist
->
p_input
=
input_CreateThread
(
p_playlist
,
p_input
);
if
(
p_playlist
->
p_fetcher
->
i_art_policy
==
ALBUM_ART_WHEN_PLAYED
)
{
if
(
p_input
->
p_meta
&&
EMPTY_STR
(
p_input
->
p_meta
->
psz_arturl
)
)
{
PL_DEBUG
(
"requesting art for %s"
,
p_input
->
psz_name
);
playlist_AskForArtEnqueue
(
p_playlist
,
p_input
);
}
else
if
(
!
p_input
->
p_meta
)
{
PL_DEBUG2
(
"unable to request art for %s, no meta"
,
p_input
->
psz_name
);
}
}
val
.
i_int
=
p_item
->
p_input
->
i_id
;
/* unlock the playlist to set the var...mmm */
val
.
i_int
=
p_input
->
i_id
;
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
var_Set
(
p_playlist
,
"playlist-current"
,
val
);
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
...
...
src/playlist/engine.c
View file @
d732fd2f
...
...
@@ -558,9 +558,9 @@ void playlist_PreparseLoop( playlist_preparse_t *p_obj )
p
.
p_item
=
p_current
;
p
.
b_fetch_art
=
VLC_TRUE
;
vlc_mutex_lock
(
&
p_playlist
->
p_fetcher
->
object_lock
);
TAB_APPEND
(
p_playlist
->
p_fetcher
->
i
_waiting
,
p_playlist
->
p_fetcher
->
p
_waiting
,
p
);
INSERT_ELEM
(
p_playlist
->
p_fetcher
->
p
_waiting
,
p_playlist
->
p_fetcher
->
i
_waiting
,
p_playlist
->
p_fetcher
->
i_waiting
,
p
);
vlc_mutex_unlock
(
&
p_playlist
->
p_fetcher
->
object_lock
);
vlc_cond_signal
(
&
p_playlist
->
p_fetcher
->
object_wait
);
}
...
...
@@ -642,15 +642,19 @@ void playlist_FetcherLoop( playlist_fetcher_t *p_obj )
if
(
i_ret
==
1
)
{
PL_DEBUG
(
"downloading art for %s"
,
p_item
->
psz_name
);
if
(
!
input_DownloadAndCacheArt
(
p_playlist
,
p_item
)
)
if
(
input_DownloadAndCacheArt
(
p_playlist
,
p_item
)
)
p_item
->
p_meta
->
i_status
|=
ITEM_ART_NOTFOUND
;
else
else
{
p_item
->
p_meta
->
i_status
|=
ITEM_ART_FETCHED
;
var_SetInteger
(
p_playlist
,
"item-change"
,
p_item
->
i_id
);
}
}
else
if
(
i_ret
==
0
)
/* Was in cache */
{
PL_DEBUG
(
"found art for %s in cache"
,
p_item
->
psz_name
);
p_item
->
p_meta
->
i_status
|=
ITEM_ART_FETCHED
;
var_SetInteger
(
p_playlist
,
"item-change"
,
p_item
->
i_id
);
}
else
{
...
...
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