mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-03 16:48:52 +02:00
time provider
git-svn-id: svn://elaine/murooma/trunk@268 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
19e77f0f20
commit
2fedce489c
6 changed files with 93 additions and 12 deletions
34
client/timeProvider.h
Normal file
34
client/timeProvider.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
#ifndef TIME_PROVIDER_H
|
||||
#define TIME_PROVIDER_H
|
||||
|
||||
#include "doubleBuffer.h"
|
||||
|
||||
class TimeProvider
|
||||
{
|
||||
public:
|
||||
static TimeProvider& getInstance()
|
||||
{
|
||||
static TimeProvider instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
void setDiffToServer(double ms);
|
||||
long getDiffToServer();
|
||||
long getDiffToServerMs();
|
||||
|
||||
private:
|
||||
TimeProvider(); // Constructor? (the {} brackets) are needed here.
|
||||
// Dont forget to declare these two. You want to make sure they
|
||||
// are unaccessable otherwise you may accidently get copies of
|
||||
// your singleton appearing.
|
||||
TimeProvider(TimeProvider const&); // Don't Implement
|
||||
void operator=(TimeProvider const&); // Don't implement
|
||||
|
||||
DoubleBuffer<long> diffBuffer;
|
||||
long diffToServer;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue