MythTV
master
|
#include <libmythbase/platforms/mythpowerosx.h>
Protected Slots | |
void | Refresh (void) override |
![]() | |
void | FeatureTimeout (void) |
virtual void | Refresh (void) |
Protected Member Functions | |
MythPowerOSX () | |
Power management for OSX. More... | |
~MythPowerOSX () override | |
void | Init (void) override |
bool | DoFeature (bool Delayed=false) override |
![]() | |
MythPower () | |
~MythPower () override=default | |
virtual void | DidWakeUp (void) |
virtual void | FeatureHappening (Feature Spontaneous=FeatureNone) |
Signal to the rest of MythTV that the given feature will happen now. More... | |
virtual bool | ScheduleFeature (enum Feature Type, std::chrono::seconds Delay) |
void | SetRequestedDelay (std::chrono::seconds Delay) |
void | PowerLevelChanged (int Level) |
![]() | |
virtual | ~ReferenceCounter (void) |
Called on destruction, will warn if object deleted with references in place. More... | |
Static Protected Member Functions | |
static void | PowerCallBack (void *Reference, io_service_t Service, natural_t Type, void *Data) |
Receive notification of power status changes. More... | |
static void | PowerSourceCallBack (void *Reference) |
Receive notification of changes to the power supply. More... | |
![]() | |
static QString | FeatureToString (enum Feature Type) |
static bool | FeatureIsEquivalent (Feature First, Feature Second) |
Protected Attributes | |
CFRunLoopSourceRef | m_powerRef { nullptr } |
io_connect_t | m_rootPowerDomain { 0 } |
io_object_t | m_powerNotifier { MACH_PORT_NULL } |
IONotificationPortRef | m_powerNotifyPort { nullptr } |
![]() | |
Features | m_features { FeatureNone } |
Feature | m_scheduledFeature { FeatureNone } |
bool | m_isSpontaneous { false } |
std::chrono::seconds | m_maxRequestedDelay { 0s } |
std::chrono::seconds | m_maxSupportedDelay { MAXIMUM_SHUTDOWN_WAIT } |
QTimer | m_featureTimer |
QDateTime | m_sleepTime |
int | m_powerLevel { Unset } |
bool | m_warnForLowBattery { false } |
![]() | |
bool | m_logDebug |
This is used to suppress creating LoggingItem classes for LoggingItem reference count changes. More... | |
QAtomicInt | m_referenceCount {1} |
Friends | |
class | MythPower |
Additional Inherited Members | |
![]() | |
enum | PowerLevel : std::int8_t { UPS = -2, ACPower = -1, BatteryEmpty = 0, BatteryLow = 10, BatteryFull = 100, UnknownPower = 101, Unset = 102 } |
enum | Feature : std::uint8_t { FeatureNone = 0x00, FeatureShutdown = 0x01, FeatureSuspend = 0x02, FeatureHibernate = 0x04, FeatureRestart = 0x08, FeatureHybridSleep = 0x10 } |
![]() | |
virtual void | CancelFeature (void) |
This is untested as it is currently not clear whether it is useful. More... | |
![]() | |
void | ShuttingDown (void) |
void | Suspending (void) |
void | Hibernating (void) |
void | Restarting (void) |
void | HybridSleeping (void) |
void | WillShutDown (std::chrono::milliseconds MilliSeconds=0ms) |
void | WillSuspend (std::chrono::milliseconds MilliSeconds=0ms) |
void | WillHibernate (std::chrono::milliseconds MilliSeconds=0ms) |
void | WillRestart (std::chrono::milliseconds MilliSeconds=0ms) |
void | WillHybridSleep (std::chrono::milliseconds MilliSeconds=0ms) |
void | WokeUp (std::chrono::seconds SecondsAsleep) |
void | LowBattery (void) |
![]() | |
virtual bool | RequestFeature (Feature Request, bool Delay=true) |
Features | GetFeatures (void) |
bool | IsFeatureSupported (Feature Supported) |
int | GetPowerLevel (void) const |
QStringList | GetFeatureList (void) |
![]() | |
ReferenceCounter (const QString &debugName, bool logDebug=true) | |
Creates reference counter with an initial value of 1. More... | |
virtual int | IncrRef (void) |
Increments reference count. More... | |
virtual int | DecrRef (void) |
Decrements reference count and deletes on 0. More... | |
![]() | |
static MythPower * | AcquireRelease (void *Reference, bool Acquire, std::chrono::seconds MinimumDelay=0s) |
![]() | |
static void | PrintDebug (void) |
Print out any leaks if that level of debugging is enabled. More... | |
![]() | |
static QRecursiveMutex | s_lock |
Definition at line 15 of file mythpowerosx.h.
|
protected |
Power management for OSX.
Definition at line 24 of file mythpowerosx.cpp.
|
overrideprotected |
Definition at line 29 of file mythpowerosx.cpp.
|
overrideprotectedslot |
Definition at line 108 of file mythpowerosx.cpp.
Referenced by Init(), and PowerSourceCallBack().
|
overrideprotectedvirtual |
Reimplemented from MythPower.
Definition at line 49 of file mythpowerosx.cpp.
Referenced by MythPowerOSX().
Reimplemented from MythPower.
Definition at line 91 of file mythpowerosx.cpp.
|
staticprotected |
Receive notification of power status changes.
Definition at line 174 of file mythpowerosx.cpp.
Referenced by Init().
|
staticprotected |
Receive notification of changes to the power supply.
Changes may be a change in the battery level or switches between mains power and battery.
Definition at line 160 of file mythpowerosx.cpp.
Referenced by Init().
|
friend |
Definition at line 19 of file mythpowerosx.h.
|
protected |
Definition at line 36 of file mythpowerosx.h.
Referenced by Init(), Refresh(), and ~MythPowerOSX().
|
protected |
Definition at line 37 of file mythpowerosx.h.
Referenced by Init(), and ~MythPowerOSX().
|
protected |
Definition at line 38 of file mythpowerosx.h.
Referenced by Init(), and ~MythPowerOSX().
|
protected |
Definition at line 39 of file mythpowerosx.h.
Referenced by Init(), and ~MythPowerOSX().