aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist_state.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-08 15:22:39 +0200
committerMax Kellermann <max@duempel.org>2009-10-08 15:22:39 +0200
commitecb118f1edab572a904890eddafd3b11c0a79a79 (patch)
tree4e273cd64778fcff80250b3b33ffb050a257c981 /src/playlist_state.h
parent1e663b186998ffdeef9b3b9775558e9378bad342 (diff)
downloadmpd-ecb118f1edab572a904890eddafd3b11c0a79a79.tar.gz
mpd-ecb118f1edab572a904890eddafd3b11c0a79a79.tar.xz
mpd-ecb118f1edab572a904890eddafd3b11c0a79a79.zip
state_file: save only if something has changed
If nothing has changed since the last save, don't save the state file. Saving will spin up the hard drive, which is undesirable on hosts where MPD is idling in background.
Diffstat (limited to 'src/playlist_state.h')
-rw-r--r--src/playlist_state.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/playlist_state.h b/src/playlist_state.h
index 7ed7e8c8e..d116aaeb1 100644
--- a/src/playlist_state.h
+++ b/src/playlist_state.h
@@ -36,4 +36,13 @@ playlist_state_save(FILE *fp, const struct playlist *playlist);
bool
playlist_state_restore(const char *line, FILE *fp, struct playlist *playlist);
+/**
+ * Generates a hash number for the current state of the playlist and
+ * the playback options. This is used by timer_save_state_file() to
+ * determine whether the state has changed and the state file should
+ * be saved.
+ */
+unsigned
+playlist_state_get_hash(const struct playlist *playlist);
+
#endif