*Save, *State: use the OutputStream API instead of FILE*
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user