diff options
Diffstat (limited to '')
-rw-r--r-- | src/output_command.c | 6 | ||||
-rw-r--r-- | src/output_state.c | 8 | ||||
-rw-r--r-- | src/output_state.h | 8 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/output_command.c b/src/output_command.c index 5da176dde..9d948c8cc 100644 --- a/src/output_command.c +++ b/src/output_command.c @@ -31,6 +31,8 @@ #include "mixer_control.h" #include "idle.h" +extern unsigned audio_output_state_version; + bool audio_output_enable_index(unsigned idx) { @@ -44,6 +46,8 @@ audio_output_enable_index(unsigned idx) ao->enabled = true; idle_add(IDLE_OUTPUT); + ++audio_output_state_version; + return true; } @@ -67,5 +71,7 @@ audio_output_disable_index(unsigned idx) idle_add(IDLE_MIXER); } + ++audio_output_state_version; + return true; } diff --git a/src/output_state.c b/src/output_state.c index 7fc60518c..be135f6d0 100644 --- a/src/output_state.c +++ b/src/output_state.c @@ -34,6 +34,8 @@ #define AUDIO_DEVICE_STATE "audio_device_state:" +unsigned audio_output_state_version; + void audio_output_state_save(FILE *fp) { @@ -80,3 +82,9 @@ audio_output_state_read(const char *line) ao->enabled = false; return true; } + +unsigned +audio_output_state_get_version(void) +{ + return audio_output_state_version; +} diff --git a/src/output_state.h b/src/output_state.h index 1efae94a1..3b865f5fe 100644 --- a/src/output_state.h +++ b/src/output_state.h @@ -34,4 +34,12 @@ audio_output_state_read(const char *line); void audio_output_state_save(FILE *fp); +/** + * Generates a version number for the current state of the audio + * outputs. This is used by timer_save_state_file() to determine + * whether the state has changed and the state file should be saved. + */ +unsigned +audio_output_state_get_version(void); + #endif |