16 #ifndef ACSDKAUDIOPLAYER_PROGRESSTIMER_H_ 17 #define ACSDKAUDIOPLAYER_PROGRESSTIMER_H_ 20 #include <condition_variable> 27 namespace acsdkAudioPlayer {
70 return std::chrono::milliseconds::max();
75 return std::chrono::milliseconds::max();
104 const std::shared_ptr<ContextInterface>& context,
105 std::chrono::milliseconds delay,
106 std::chrono::milliseconds interval,
107 std::chrono::milliseconds offset = std::chrono::milliseconds::zero());
142 void updateInterval(
const std::chrono::milliseconds& newInterval);
149 void onProgress(std::chrono::milliseconds progress);
169 friend std::ostream&
operator<<(std::ostream& stream, ProgressTimer::State state);
177 bool setState(State newState);
195 bool updateTargetLocked();
208 std::mutex m_callMutex;
211 std::mutex m_stateMutex;
217 std::shared_ptr<ContextInterface> m_context;
220 std::chrono::milliseconds m_delay;
223 std::chrono::milliseconds m_interval;
226 std::chrono::milliseconds m_offset;
229 std::chrono::milliseconds m_target;
235 std::chrono::milliseconds m_progress;
238 std::condition_variable m_wake;
241 std::thread m_thread;
247 #endif // ACSDKAUDIOPLAYER_PROGRESSTIMER_H_
void init(const std::shared_ptr< ContextInterface > &context, std::chrono::milliseconds delay, std::chrono::milliseconds interval, std::chrono::milliseconds offset=std::chrono::milliseconds::zero())
virtual void requestProgress()=0
friend std::ostream & operator<<(std::ostream &stream, ProgressTimer::State state)
Friend declaration to allow streaming State values.
void updateInterval(const std::chrono::milliseconds &newInterval)
virtual ~ContextInterface()=default
void onProgress(std::chrono::milliseconds progress)
static std::chrono::milliseconds getNoInterval()
Static function member to get interval value for no ProgressReportIntervalElapsed notifications...
Definition: ProgressTimer.h:74
static std::chrono::milliseconds getNoDelay()
Static function member to get delay value for no ProgressReportDelayElapsed notifications..
Definition: ProgressTimer.h:69
virtual void onProgressReportIntervalElapsed()=0
Definition: ProgressTimer.h:33
Definition: ProgressTimer.h:40
virtual void onProgressReportDelayElapsed()=0
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
virtual void onProgressReportIntervalUpdated()=0