diff options
Diffstat (limited to 'src/StateFile.cxx')
-rw-r--r-- | src/StateFile.cxx | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/StateFile.cxx b/src/StateFile.cxx index 75cef2c99..a1d8945c4 100644 --- a/src/StateFile.cxx +++ b/src/StateFile.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -19,12 +19,13 @@ #include "config.h" #include "StateFile.hxx" -#include "OutputState.hxx" +#include "output/OutputState.hxx" #include "PlaylistState.hxx" -#include "TextFile.hxx" +#include "fs/TextFile.hxx" #include "Partition.hxx" -#include "Volume.hxx" -#include "event/Loop.hxx" +#include "Instance.hxx" +#include "mixer/Volume.hxx" +#include "SongLoader.hxx" #include "fs/FileSystem.hxx" #include "util/Domain.hxx" #include "Log.hxx" @@ -75,7 +76,7 @@ StateFile::Write() } save_sw_volume_state(fp); - audio_output_state_save(fp); + audio_output_state_save(fp, partition.outputs); playlist_state_save(fp, partition.playlist, partition.pc); fclose(fp); @@ -97,11 +98,19 @@ StateFile::Read() return; } +#ifdef ENABLE_DATABASE + const SongLoader song_loader(partition.instance.database, + partition.instance.storage); +#else + const SongLoader song_loader(nullptr, nullptr); +#endif + const char *line; while ((line = file.ReadLine()) != NULL) { - success = read_sw_volume_state(line) || - audio_output_state_read(line) || - playlist_state_restore(line, file, partition.playlist, + success = read_sw_volume_state(line, partition.outputs) || + audio_output_state_read(line, partition.outputs) || + playlist_state_restore(line, file, song_loader, + partition.playlist, partition.pc); if (!success) FormatError(state_file_domain, |