Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
193f5024
Commit
193f5024
authored
Mar 04, 2011
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: reset EPG data when input type changes
parent
9cac200d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
5 deletions
+31
-5
modules/gui/qt4/components/epg/EPGWidget.cpp
modules/gui/qt4/components/epg/EPGWidget.cpp
+21
-1
modules/gui/qt4/components/epg/EPGWidget.hpp
modules/gui/qt4/components/epg/EPGWidget.hpp
+4
-1
modules/gui/qt4/dialogs/epg.cpp
modules/gui/qt4/dialogs/epg.cpp
+6
-3
No files found.
modules/gui/qt4/components/epg/EPGWidget.cpp
View file @
193f5024
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
EPGWidget
::
EPGWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
EPGWidget
::
EPGWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
{
b_input_type_known
=
false
;
m_rulerWidget
=
new
EPGRuler
(
this
);
m_rulerWidget
=
new
EPGRuler
(
this
);
m_epgView
=
new
EPGView
(
this
);
m_epgView
=
new
EPGView
(
this
);
m_channelsWidget
=
new
EPGChannels
(
this
,
m_epgView
);
m_channelsWidget
=
new
EPGChannels
(
this
,
m_epgView
);
...
@@ -71,6 +72,20 @@ EPGWidget::~EPGWidget()
...
@@ -71,6 +72,20 @@ EPGWidget::~EPGWidget()
delete
item
;
delete
item
;
}
}
void
EPGWidget
::
reset
()
{
foreach
(
const
QString
&
str
,
m_events
.
uniqueKeys
()
)
foreach
(
EPGEvent
*
item
,
m_events
.
values
(
str
)
)
{
m_epgView
->
delEvent
(
item
);
m_events
.
remove
(
str
,
item
);
delete
item
;
}
m_epgView
->
updateDuration
();
m_epgView
->
updateStartTime
();
m_channelsWidget
->
update
();
}
void
EPGWidget
::
setZoom
(
int
level
)
void
EPGWidget
::
setZoom
(
int
level
)
{
{
double
scale
=
(
double
)
level
/
20
;
double
scale
=
(
double
)
level
/
20
;
...
@@ -78,13 +93,18 @@ void EPGWidget::setZoom( int level )
...
@@ -78,13 +93,18 @@ void EPGWidget::setZoom( int level )
m_rulerWidget
->
setScale
(
scale
);
m_rulerWidget
->
setScale
(
scale
);
}
}
void
EPGWidget
::
updateEPG
(
vlc_epg_t
**
pp_epg
,
int
i_epg
)
void
EPGWidget
::
updateEPG
(
vlc_epg_t
**
pp_epg
,
int
i_epg
,
uint8_t
i_input_type
)
{
{
QStringList
channelsList
;
QStringList
channelsList
;
EPGEvent
*
item
;
EPGEvent
*
item
;
/* FIXME: dvb time might be from the next timezone */
/* FIXME: dvb time might be from the next timezone */
QDateTime
timeReference
=
QDateTime
::
currentDateTime
();
QDateTime
timeReference
=
QDateTime
::
currentDateTime
();
/* flush our EPG data if input type has changed */
if
(
b_input_type_known
&&
i_input_type
!=
i_event_source_type
)
reset
();
i_event_source_type
=
i_input_type
;
b_input_type_known
=
true
;
/* flag all entries as non updated */
/* flag all entries as non updated */
foreach
(
const
QString
&
str
,
m_events
.
uniqueKeys
()
)
foreach
(
const
QString
&
str
,
m_events
.
uniqueKeys
()
)
foreach
(
item
,
m_events
.
values
(
str
)
)
foreach
(
item
,
m_events
.
values
(
str
)
)
...
...
modules/gui/qt4/components/epg/EPGWidget.hpp
View file @
193f5024
...
@@ -43,10 +43,11 @@ class EPGWidget : public QWidget
...
@@ -43,10 +43,11 @@ class EPGWidget : public QWidget
public:
public:
explicit
EPGWidget
(
QWidget
*
parent
=
0
);
explicit
EPGWidget
(
QWidget
*
parent
=
0
);
~
EPGWidget
();
~
EPGWidget
();
void
reset
();
public
slots
:
public
slots
:
void
setZoom
(
int
level
);
void
setZoom
(
int
level
);
void
updateEPG
(
vlc_epg_t
**
pp_epg
,
int
i_epg
);
void
updateEPG
(
vlc_epg_t
**
pp_epg
,
int
i_epg
,
uint8_t
i_input_type
);
private:
private:
EPGRuler
*
m_rulerWidget
;
EPGRuler
*
m_rulerWidget
;
...
@@ -54,6 +55,8 @@ private:
...
@@ -54,6 +55,8 @@ private:
EPGChannels
*
m_channelsWidget
;
EPGChannels
*
m_channelsWidget
;
QMultiMap
<
QString
,
EPGEvent
*>
m_events
;
QMultiMap
<
QString
,
EPGEvent
*>
m_events
;
uint8_t
i_event_source_type
;
bool
b_input_type_known
;
signals:
signals:
void
itemSelectionChanged
(
EPGEvent
*
);
void
itemSelectionChanged
(
EPGEvent
*
);
...
...
modules/gui/qt4/dialogs/epg.cpp
View file @
193f5024
...
@@ -73,6 +73,7 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
...
@@ -73,6 +73,7 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
CONNECT
(
epg
,
itemSelectionChanged
(
EPGEvent
*
),
this
,
showEvent
(
EPGEvent
*
)
);
CONNECT
(
epg
,
itemSelectionChanged
(
EPGEvent
*
),
this
,
showEvent
(
EPGEvent
*
)
);
CONNECT
(
THEMIM
->
getIM
(),
epgChanged
(),
this
,
updateInfos
()
);
CONNECT
(
THEMIM
->
getIM
(),
epgChanged
(),
this
,
updateInfos
()
);
CONNECT
(
THEMIM
,
inputChanged
(
input_thread_t
*
),
this
,
updateInfos
()
);
QDialogButtonBox
*
buttonsBox
=
new
QDialogButtonBox
(
this
);
QDialogButtonBox
*
buttonsBox
=
new
QDialogButtonBox
(
this
);
...
@@ -121,8 +122,10 @@ void EpgDialog::showEvent( EPGEvent *event )
...
@@ -121,8 +122,10 @@ void EpgDialog::showEvent( EPGEvent *event )
void
EpgDialog
::
updateInfos
()
void
EpgDialog
::
updateInfos
()
{
{
if
(
!
THEMIM
->
getInput
()
)
return
;
if
(
!
THEMIM
->
getInput
()
)
return
;
int
i_nbitems
=
input_GetItem
(
THEMIM
->
getInput
())
->
i_epg
;
msg_Dbg
(
p_intf
,
"Found %i EPG items"
,
input_GetItem
(
THEMIM
->
getInput
())
->
i_epg
);
if
(
i_nbitems
>
0
)
msg_Dbg
(
p_intf
,
"Found %i EPG items"
,
i_nbitems
);
epg
->
updateEPG
(
input_GetItem
(
THEMIM
->
getInput
())
->
pp_epg
,
input_GetItem
(
THEMIM
->
getInput
())
->
i_epg
);
epg
->
updateEPG
(
input_GetItem
(
THEMIM
->
getInput
())
->
pp_epg
,
input_GetItem
(
THEMIM
->
getInput
())
->
i_epg
,
input_GetItem
(
THEMIM
->
getInput
())
->
i_type
);
}
}
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