diff options
author | Max Kellermann <max@duempel.org> | 2014-07-30 20:58:14 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-07-30 22:17:01 +0200 |
commit | 9fb351a139a56fc7b1ece549894f8fc31fa887cd (patch) | |
tree | 7c9ce42a1262af587f1b9fede2b24ff39cef93fc /src/output | |
parent | 0d0ccacdf3e154b1cc27a0840fce80ac13f9641c (diff) | |
download | mpd-9fb351a139a56fc7b1ece549894f8fc31fa887cd.tar.gz mpd-9fb351a139a56fc7b1ece549894f8fc31fa887cd.tar.xz mpd-9fb351a139a56fc7b1ece549894f8fc31fa887cd.zip |
*Save, *State: use the OutputStream API instead of FILE*
Diffstat (limited to '')
-rw-r--r-- | src/output/OutputState.cxx | 7 | ||||
-rw-r--r-- | src/output/OutputState.hxx | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/output/OutputState.cxx b/src/output/OutputState.cxx index 7f3a8da7b..0c1424404 100644 --- a/src/output/OutputState.cxx +++ b/src/output/OutputState.cxx @@ -28,6 +28,7 @@ #include "Internal.hxx" #include "Domain.hxx" #include "Log.hxx" +#include "fs/output/BufferedOutputStream.hxx" #include "util/StringUtil.hxx" #include <assert.h> @@ -38,13 +39,13 @@ unsigned audio_output_state_version; void -audio_output_state_save(FILE *fp, const MultipleOutputs &outputs) +audio_output_state_save(BufferedOutputStream &os, + const MultipleOutputs &outputs) { for (unsigned i = 0, n = outputs.Size(); i != n; ++i) { const AudioOutput &ao = outputs.Get(i); - fprintf(fp, AUDIO_DEVICE_STATE "%d:%s\n", - ao.enabled, ao.name); + os.Format(AUDIO_DEVICE_STATE "%d:%s\n", ao.enabled, ao.name); } } diff --git a/src/output/OutputState.hxx b/src/output/OutputState.hxx index 32f4bbcce..47f8429d5 100644 --- a/src/output/OutputState.hxx +++ b/src/output/OutputState.hxx @@ -25,15 +25,15 @@ #ifndef MPD_OUTPUT_STATE_HXX #define MPD_OUTPUT_STATE_HXX -#include <stdio.h> - class MultipleOutputs; +class BufferedOutputStream; bool audio_output_state_read(const char *line, MultipleOutputs &outputs); void -audio_output_state_save(FILE *fp, const MultipleOutputs &outputs); +audio_output_state_save(BufferedOutputStream &os, + const MultipleOutputs &outputs); /** * Generates a version number for the current state of the audio |