aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/NullOutputPlugin.cxx
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-05-12 19:03:42 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-05-12 19:03:42 +0600
commit49a3845135142ada6d581d5a6f4a5192aaed49be (patch)
tree67dd709c03fb8cc18377ad74d09da512a217f42a /src/output/NullOutputPlugin.cxx
parent21dac6c05ddff1ce130843a82127618f9ed766a7 (diff)
downloadmpd-49a3845135142ada6d581d5a6f4a5192aaed49be.tar.gz
mpd-49a3845135142ada6d581d5a6f4a5192aaed49be.tar.xz
mpd-49a3845135142ada6d581d5a6f4a5192aaed49be.zip
timer: convert to class
Diffstat (limited to '')
-rw-r--r--src/output/NullOutputPlugin.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/output/NullOutputPlugin.cxx b/src/output/NullOutputPlugin.cxx
index bbcf26c00..b167032b6 100644
--- a/src/output/NullOutputPlugin.cxx
+++ b/src/output/NullOutputPlugin.cxx
@@ -20,7 +20,7 @@
#include "config.h"
#include "NullOutputPlugin.hxx"
#include "output_api.h"
-#include "timer.h"
+#include "Timer.hxx"
#include <assert.h>
@@ -29,7 +29,7 @@ struct NullOutput {
bool sync;
- struct timer *timer;
+ Timer *timer;
bool Initialize(const config_param *param, GError **error_r) {
return ao_base_init(&base, &null_output_plugin, param,
@@ -72,7 +72,7 @@ null_open(struct audio_output *ao, struct audio_format *audio_format,
NullOutput *nd = (NullOutput *)ao;
if (nd->sync)
- nd->timer = timer_new(audio_format);
+ nd->timer = new Timer(*audio_format);
return true;
}
@@ -83,7 +83,7 @@ null_close(struct audio_output *ao)
NullOutput *nd = (NullOutput *)ao;
if (nd->sync)
- timer_free(nd->timer);
+ delete nd->timer;
}
static unsigned
@@ -91,8 +91,8 @@ null_delay(struct audio_output *ao)
{
NullOutput *nd = (NullOutput *)ao;
- return nd->sync && nd->timer->started
- ? timer_delay(nd->timer)
+ return nd->sync && nd->timer->IsStarted()
+ ? nd->timer->GetDelay()
: 0;
}
@@ -101,14 +101,14 @@ null_play(struct audio_output *ao, gcc_unused const void *chunk, size_t size,
gcc_unused GError **error)
{
NullOutput *nd = (NullOutput *)ao;
- struct timer *timer = nd->timer;
+ Timer *timer = nd->timer;
if (!nd->sync)
return size;
- if (!timer->started)
- timer_start(timer);
- timer_add(timer, size);
+ if (!timer->IsStarted())
+ timer->Start();
+ timer->Add(size);
return size;
}
@@ -121,7 +121,7 @@ null_cancel(struct audio_output *ao)
if (!nd->sync)
return;
- timer_reset(nd->timer);
+ nd->timer->Reset();
}
const struct audio_output_plugin null_output_plugin = {