12#ifndef __STATEMACHINE_H
13#define __STATEMACHINE_H
15#if __cplusplus < 201703L
16#error "C++17 or higher is required"
24#include <vdr/thread.h>
38struct overload : Ts... {
using Ts::operator()...; };
97 [](
const PlayEvent&) ->
const char* {
return "PlayEvent"; },
98 [](
const PauseEvent&) ->
const char* {
return "PauseEvent"; },
99 [](
const StopEvent&) ->
const char* {
return "StopEvent"; },
100 [](
const TrickSpeedEvent&) ->
const char* {
return "TrickSpeedEvent"; },
102 [](
const DetachEvent&) ->
const char* {
return "DetachEvent"; },
103 [](
const AttachEvent&) ->
const char* {
return "AttachEvent"; },
104 [](
const BufferUnderrunEvent&
e) ->
const char* {
return e.type ==
AUDIO ?
"BufferUnderrunEvent: Audio" :
"BufferUnderrunEvent: Video"; },
107 [](
const ResyncEvent&) ->
const char* {
return "ResyncEvent"; },
void AddEvent(Event)
Add an event to the queue.
std::vector< Event > m_eventQueue
event fifo queue
std::mutex m_mutex
queue mutex
~cEventHandler(void)
Stop and delete the event handler thread.
void Action(void)
Periodically send events in the queue to the final event receiver/handler.
cStateMachine * m_pStateMachine
pointer to state machine
Output Device Implementation.
State Machine Implementation.
void SetState(State state)
std::atomic< State > m_state
current state
State GetState(void) const
std::mutex m_mutex
state machine mutex
cSoftHdDevice * m_pDevice
pointer to the device
void ChangeState(State)
Sets the new state and triggers actions, which are necessary when leaving the old and entering the ne...
void OnEventReceived(const Event &)
Event handler for playback state transitions.
Plugin Configuration Header File.
std::variant< PlayEvent, PauseEvent, StopEvent, TrickSpeedEvent, StillPictureEvent, DetachEvent, AttachEvent, BufferUnderrunEvent, BufferingThresholdReachedEvent, ScheduleResyncAtPtsMsEvent, ResyncEvent, DisplayChangeEvent > Event
const char * EventToString(const Event &e)
const char * StateToString(State s)
Holds possible display configurations.