EPG-Refresh: periodischer Timer alle 60s aktualisiert Jetzt/Danach wenn Sendung endet
This commit is contained in:
parent
735ab0b489
commit
c978d66c56
1 changed files with 9 additions and 0 deletions
|
|
@ -34,6 +34,9 @@ public partial class MainWindow : Window
|
||||||
// EPG-Fallback Timer (falls MetaChanged nicht feuert)
|
// EPG-Fallback Timer (falls MetaChanged nicht feuert)
|
||||||
private readonly DispatcherTimer _epgTimer;
|
private readonly DispatcherTimer _epgTimer;
|
||||||
|
|
||||||
|
// Periodischer Refresh: aktualisiert Jetzt/Danach wenn Sendung endet
|
||||||
|
private readonly DispatcherTimer _epgRefreshTimer;
|
||||||
|
|
||||||
// Pre-Fullscreen UI-State
|
// Pre-Fullscreen UI-State
|
||||||
private WindowStyle _prevStyle = WindowStyle.SingleBorderWindow;
|
private WindowStyle _prevStyle = WindowStyle.SingleBorderWindow;
|
||||||
private WindowState _prevState = WindowState.Normal;
|
private WindowState _prevState = WindowState.Normal;
|
||||||
|
|
@ -56,6 +59,11 @@ public partial class MainWindow : Window
|
||||||
_epgTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(500) };
|
_epgTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(500) };
|
||||||
_epgTimer.Tick += EpgTimer_Tick;
|
_epgTimer.Tick += EpgTimer_Tick;
|
||||||
|
|
||||||
|
// Jede Minute prüfen ob Jetzt/Danach noch aktuell sind
|
||||||
|
_epgRefreshTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(60) };
|
||||||
|
_epgRefreshTimer.Tick += (_, _) => { if (_currentChannel != null) UpdateNextFromEpgService(_currentChannel); };
|
||||||
|
_epgRefreshTimer.Start();
|
||||||
|
|
||||||
Loaded += MainWindow_Loaded;
|
Loaded += MainWindow_Loaded;
|
||||||
Closing += MainWindow_Closing;
|
Closing += MainWindow_Closing;
|
||||||
KeyDown += MainWindow_KeyDown;
|
KeyDown += MainWindow_KeyDown;
|
||||||
|
|
@ -130,6 +138,7 @@ public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
_epgTimer.Stop();
|
_epgTimer.Stop();
|
||||||
_zapTimer.Stop();
|
_zapTimer.Stop();
|
||||||
|
_epgRefreshTimer.Stop();
|
||||||
_player?.Stop();
|
_player?.Stop();
|
||||||
_settings.LastChannel = _currentChannel?.Name ?? "";
|
_settings.LastChannel = _currentChannel?.Name ?? "";
|
||||||
_settings.Volume = SldVolume.Value;
|
_settings.Volume = SldVolume.Value;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue