aboutsummaryrefslogtreecommitdiffstats
path: root/src/StateFile.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-24 12:59:45 +0200
committerMax Kellermann <max@duempel.org>2014-08-24 13:24:20 +0200
commit42af040fbd0cd2b9942f02ace3462ee8ac41d3ac (patch)
tree77501fc829969fe8bf07739329ca5431fbdded29 /src/StateFile.hxx
parentd383d617c2d16bda9f32fe31e0171a59f4601f89 (diff)
downloadmpd-42af040fbd0cd2b9942f02ace3462ee8ac41d3ac.tar.gz
mpd-42af040fbd0cd2b9942f02ace3462ee8ac41d3ac.tar.xz
mpd-42af040fbd0cd2b9942f02ace3462ee8ac41d3ac.zip
StateFile: configurable interval
Diffstat (limited to 'src/StateFile.hxx')
-rw-r--r--src/StateFile.hxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/StateFile.hxx b/src/StateFile.hxx
index 4bacb3449..15ba13b97 100644
--- a/src/StateFile.hxx
+++ b/src/StateFile.hxx
@@ -34,6 +34,8 @@ class StateFile final : private TimeoutMonitor {
const AllocatedPath path;
const std::string path_utf8;
+ const unsigned interval;
+
Partition &partition;
/**
@@ -44,7 +46,10 @@ class StateFile final : private TimeoutMonitor {
prev_playlist_version;
public:
- StateFile(AllocatedPath &&path, Partition &partition, EventLoop &loop);
+ static constexpr unsigned DEFAULT_INTERVAL = 2 * 60;
+
+ StateFile(AllocatedPath &&path, unsigned interval,
+ Partition &partition, EventLoop &loop);
void Read();
void Write();