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
64369374
Commit
64369374
authored
Mar 05, 2011
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: EPG: Always update data on EPG refresh and highlight simultaneous
programs
parent
cb9b7a6c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
24 deletions
+41
-24
modules/gui/qt4/components/epg/EPGEvent.hpp
modules/gui/qt4/components/epg/EPGEvent.hpp
+5
-0
modules/gui/qt4/components/epg/EPGItem.cpp
modules/gui/qt4/components/epg/EPGItem.cpp
+4
-2
modules/gui/qt4/components/epg/EPGItem.hpp
modules/gui/qt4/components/epg/EPGItem.hpp
+1
-0
modules/gui/qt4/components/epg/EPGWidget.cpp
modules/gui/qt4/components/epg/EPGWidget.cpp
+31
-22
No files found.
modules/gui/qt4/components/epg/EPGEvent.hpp
View file @
64369374
...
...
@@ -53,6 +53,11 @@ public:
return
start_
.
addSecs
(
duration
)
<
ref
;
}
bool
plays_at
(
const
QDateTime
&
ref
)
const
{
return
(
start
<=
ref
)
&&
!
ends_before
(
ref
);
}
QDateTime
start
;
int
duration
;
QString
name
;
...
...
modules/gui/qt4/components/epg/EPGItem.cpp
View file @
64369374
...
...
@@ -40,6 +40,7 @@ EPGItem::EPGItem( EPGView *view )
:
m_view
(
view
)
{
m_current
=
false
;
m_simultaneous
=
false
;
m_boundingRect
.
setHeight
(
TRACKS_HEIGHT
);
setFlags
(
QGraphicsItem
::
ItemIsSelectable
|
QGraphicsItem
::
ItemIsFocusable
);
setAcceptHoverEvents
(
true
);
...
...
@@ -66,8 +67,8 @@ void EPGItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *option,
QTransform
viewPortTransform
=
m_view
->
viewportTransform
();
QRectF
mapped
=
deviceTransform
(
viewPortTransform
).
mapRect
(
boundingRect
()
);
if
(
m_current
)
gradientColor
.
setRgb
(
244
,
125
,
0
);
if
(
m_current
||
m_simultaneous
)
gradientColor
.
setRgb
(
244
,
125
,
0
,
m_simultaneous
?
192
:
255
);
else
gradientColor
.
setRgb
(
201
,
217
,
242
);
...
...
@@ -147,6 +148,7 @@ void EPGItem::setData( EPGEvent *event )
setDuration
(
event
->
duration
);
updatePos
();
setToolTip
(
m_name
);
update
();
}
void
EPGItem
::
setDuration
(
int
duration
)
...
...
modules/gui/qt4/components/epg/EPGItem.hpp
View file @
64369374
...
...
@@ -61,6 +61,7 @@ private:
QRectF
m_boundingRect
;
int
m_channelNb
;
/*FIXME: Bad object design. We shouldn't need to clone this EPGEvent data */
QDateTime
m_start
;
int
m_duration
;
QString
m_name
;
...
...
modules/gui/qt4/components/epg/EPGWidget.cpp
View file @
64369374
...
...
@@ -26,6 +26,7 @@
#endif
#include "EPGWidget.hpp"
#include "EPGItem.hpp"
#include <QVBoxLayout>
#include <QScrollBar>
...
...
@@ -97,7 +98,7 @@ void EPGWidget::setZoom( int level )
void
EPGWidget
::
updateEPG
(
vlc_epg_t
**
pp_epg
,
int
i_epg
,
uint8_t
i_input_type
)
{
QStringList
channelsList
;
EPGEvent
*
item
;
EPGEvent
*
epgEvent
;
/* if we have epg time available take new minimum time */
if
(
i_epg
>
0
&&
pp_epg
[
0
]
->
i_event
>
0
)
...
...
@@ -110,8 +111,11 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg, uint8_t i_input_type )
/* flag all entries as non updated */
foreach
(
const
QString
&
str
,
m_events
.
uniqueKeys
()
)
foreach
(
item
,
m_events
.
values
(
str
)
)
item
->
updated
=
false
;
foreach
(
epgEvent
,
m_events
.
values
(
str
)
)
{
epgEvent
->
updated
=
false
;
epgEvent
->
current
=
false
;
}
for
(
int
i
=
0
;
i
<
i_epg
;
++
i
)
{
...
...
@@ -129,19 +133,19 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg, uint8_t i_input_type )
/* FIXME: EPGView timechanged signal is duplicate */
QList
<
EPGEvent
*>
events
=
m_events
.
values
(
channelName
);
item
=
new
EPGEvent
(
eventName
);
item
->
description
=
qfu
(
p_event
->
psz_description
);
item
->
shortDescription
=
qfu
(
p_event
->
psz_short_description
);
item
->
start
=
eventStart
;
item
->
duration
=
p_event
->
i_duration
;
item
->
channelName
=
channelName
;
item
->
current
=
(
p_epg
->
p_current
==
p_event
)
?
true
:
false
;
epgEvent
=
new
EPGEvent
(
eventName
);
epgEvent
->
description
=
qfu
(
p_event
->
psz_description
);
epgEvent
->
shortDescription
=
qfu
(
p_event
->
psz_short_description
);
epgEvent
->
start
=
eventStart
;
epgEvent
->
duration
=
p_event
->
i_duration
;
epgEvent
->
channelName
=
channelName
;
epgEvent
->
current
=
(
p_epg
->
p_current
==
p_event
)
?
true
:
false
;
bool
alreadyIn
=
false
;
for
(
int
k
=
0
;
k
<
events
.
count
();
++
k
)
{
if
(
*
events
.
at
(
k
)
==
*
item
)
if
(
*
events
.
at
(
k
)
==
*
epgEvent
)
{
alreadyIn
=
true
;
events
.
at
(
k
)
->
updated
=
true
;
...
...
@@ -151,11 +155,11 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg, uint8_t i_input_type )
if
(
!
alreadyIn
)
{
m_events
.
insert
(
channelName
,
item
);
m_epgView
->
addEvent
(
item
);
m_events
.
insert
(
channelName
,
epgEvent
);
m_epgView
->
addEvent
(
epgEvent
);
}
else
/* the new
item
is unused */
delete
item
;
else
/* the new
epgEvent
is unused */
delete
epgEvent
;
}
}
...
...
@@ -164,23 +168,28 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg, uint8_t i_input_type )
QMultiMap
<
QString
,
EPGEvent
*>::
iterator
i
=
m_events
.
begin
();
while
(
i
!=
m_events
.
end
()
)
{
item
=
i
.
value
();
if
(
channelsList
.
contains
(
item
->
channelName
)
&&
!
item
->
updated
)
epgEvent
=
i
.
value
();
if
(
channelsList
.
contains
(
epgEvent
->
channelName
)
&&
!
epgEvent
->
updated
)
{
m_epgView
->
delEvent
(
item
);
delete
item
;
m_epgView
->
delEvent
(
epgEvent
);
delete
epgEvent
;
i
=
m_events
.
erase
(
i
);
}
else
{
/* If it's known but not in current libvlc data, try to expire it */
if
(
item
->
ends_before
(
timeReference
)
)
if
(
epgEvent
->
ends_before
(
timeReference
)
)
{
m_epgView
->
delEvent
(
item
);
delete
item
;
m_epgView
->
delEvent
(
epgEvent
);
delete
epgEvent
;
i
=
m_events
.
erase
(
i
);
}
else
{
++
i
;
epgEvent
->
simultaneous
=
(
!
epgEvent
->
current
&&
epgEvent
->
plays_at
(
QDateTime
::
currentDateTime
()
)
);
epgEvent
->
item
->
setData
(
epgEvent
);
/* update data */
}
}
}
...
...
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