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
90b6e3dc
Commit
90b6e3dc
authored
Jan 17, 2011
by
Srikanth Raju
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt/ML: Pictureflow should work with VLCModel
parent
64646d3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
11 deletions
+32
-11
modules/gui/qt4/util/pictureflow.cpp
modules/gui/qt4/util/pictureflow.cpp
+31
-10
modules/gui/qt4/util/pictureflow.hpp
modules/gui/qt4/util/pictureflow.hpp
+1
-1
No files found.
modules/gui/qt4/util/pictureflow.cpp
View file @
90b6e3dc
...
...
@@ -26,6 +26,7 @@
*/
#include "pictureflow.hpp"
#include "components/playlist/ml_model.hpp"
// detect Qt version
#if QT_VERSION < 0x040300
...
...
@@ -144,7 +145,7 @@ public:
PFreal
offsetX
;
PFreal
offsetY
;
PL
Model
*
model
;
VLC
Model
*
model
;
SlideInfo
centerSlide
;
QVector
<
SlideInfo
>
leftSlides
;
QVector
<
SlideInfo
>
rightSlides
;
...
...
@@ -596,8 +597,8 @@ static QImage* prepareSurface(const QImage* slideImage, int w, int h, QRgb bgcol
imagePainter
.
setBrush
(
QBrush
(
Qt
::
lightGray
)
);
imagePainter
.
setPen
(
QColor
(
Qt
::
lightGray
)
);
QFontMetrics
fm
=
imagePainter
.
fontMetrics
();
imagePainter
.
drawText
(
0
,
img
.
height
()
+
13
,
PL
Model
::
getMeta
(
index
,
COLUMN_TITLE
)
);
imagePainter
.
drawText
(
0
,
img
.
height
()
+
13
+
fm
.
xHeight
()
*
2
,
PL
Model
::
getMeta
(
index
,
COLUMN_ARTIST
)
);
imagePainter
.
drawText
(
0
,
img
.
height
()
+
13
,
VLC
Model
::
getMeta
(
index
,
COLUMN_TITLE
)
);
imagePainter
.
drawText
(
0
,
img
.
height
()
+
13
+
fm
.
xHeight
()
*
2
,
VLC
Model
::
getMeta
(
index
,
COLUMN_ARTIST
)
);
/*
for (int x = 0; x < w; x++)
for (int y = 0; y < h; y++)
...
...
@@ -614,7 +615,7 @@ QImage* PictureFlowSoftwareRenderer::surface(QModelIndex index)
if
(
!
state
||
!
index
.
isValid
())
return
0
;
QImage
*
img
=
new
QImage
(
PL
Model
::
getArtPixmap
(
index
,
QImage
*
img
=
new
QImage
(
VLC
Model
::
getArtPixmap
(
index
,
QSize
(
state
->
slideWidth
,
state
->
slideHeight
)
).
toImage
());
QImage
*
sr
=
prepareSurface
(
img
,
state
->
slideWidth
,
state
->
slideHeight
,
bgcolor
,
state
->
reflectionEffect
,
index
);
...
...
@@ -633,13 +634,33 @@ QRect PictureFlowSoftwareRenderer::renderSlide(const SlideInfo &slide, int col1,
QModelIndex
index
;
index
=
state
->
model
->
index
(
slide
.
slideIndex
,
0
,
state
->
model
->
currentIndex
().
parent
()
);
if
(
!
index
.
isValid
()
)
return
QRect
();
QString
artURL
;
PLModel
*
plm
=
dynamic_cast
<
PLModel
*>
(
state
->
model
);
#ifdef MEDIA_LIBRARY
MLModel
*
mlm
=
dynamic_cast
<
MLModel
*>
(
state
->
model
);
#endif
if
(
plm
!=
0
)
{
index
=
((
PLModel
*
)
state
->
model
)
->
index
(
slide
.
slideIndex
,
0
,
state
->
model
->
currentIndex
().
parent
()
);
if
(
!
index
.
isValid
()
)
return
QRect
();
PLItem
*
item
=
static_cast
<
PLItem
*>
(
index
.
internalPointer
()
);
PLItem
*
item
=
static_cast
<
PLItem
*>
(
index
.
internalPointer
()
);
artURL
=
InputManager
::
decodeArtURL
(
item
->
inputItem
()
);
}
#ifdef MEDIA_LIBRARY
else
if
(
mlm
!=
0
)
{
index
=
((
MLModel
*
)
state
->
model
)
->
index
(
slide
.
slideIndex
,
0
,
QModelIndex
()
);
if
(
!
index
.
isValid
()
)
return
QRect
();
QString
key
=
QString
(
"%1%2%3%4"
).
arg
(
PLModel
::
getMeta
(
index
,
COLUMN_TITLE
)).
arg
(
PLModel
::
getMeta
(
index
,
COLUMN_ARTIST
)
).
arg
(
index
.
data
(
PLModel
::
IsCurrentRole
).
toBool
()
).
arg
(
InputManager
::
decodeArtURL
(
item
->
inputItem
()
)
);
MLItem
*
item
=
static_cast
<
MLItem
*>
(
index
.
internalPointer
()
);
artURL
=
qfu
(
item
->
getMedia
()
->
psz_cover
);
}
#endif
QString
key
=
QString
(
"%1%2%3%4"
).
arg
(
VLCModel
::
getMeta
(
index
,
COLUMN_TITLE
)).
arg
(
VLCModel
::
getMeta
(
index
,
COLUMN_ARTIST
)
).
arg
(
index
.
data
(
VLCModel
::
IsCurrentRole
).
toBool
()
).
arg
(
artURL
);
QImage
*
src
;
if
(
cache
.
contains
(
key
)
)
...
...
@@ -796,7 +817,7 @@ public:
};
PictureFlow
::
PictureFlow
(
QWidget
*
parent
,
PL
Model
*
_p_model
)
:
QWidget
(
parent
)
PictureFlow
::
PictureFlow
(
QWidget
*
parent
,
VLC
Model
*
_p_model
)
:
QWidget
(
parent
)
{
d
=
new
PictureFlowPrivate
;
d
->
state
=
new
PictureFlowState
;
...
...
modules/gui/qt4/util/pictureflow.hpp
View file @
90b6e3dc
...
...
@@ -63,7 +63,7 @@ public:
/*!
Creates a new PictureFlow widget.
*/
PictureFlow
(
QWidget
*
parent
=
0
,
PL
Model
*
model
=
0
);
PictureFlow
(
QWidget
*
parent
=
0
,
VLC
Model
*
model
=
0
);
/*!
Destroys the widget.
...
...
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