aboutsummaryrefslogtreecommitdiffstats
path: root/src/filter
diff options
context:
space:
mode:
Diffstat (limited to 'src/filter')
-rw-r--r--src/filter/replay_gain_filter_plugin.c28
-rw-r--r--src/filter/replay_gain_filter_plugin.h3
2 files changed, 20 insertions, 11 deletions
diff --git a/src/filter/replay_gain_filter_plugin.c b/src/filter/replay_gain_filter_plugin.c
index 583a09f90..9fd3cbc07 100644
--- a/src/filter/replay_gain_filter_plugin.c
+++ b/src/filter/replay_gain_filter_plugin.c
@@ -119,7 +119,7 @@ replay_gain_filter_init(G_GNUC_UNUSED const struct config_param *param,
filter_init(&filter->filter, &replay_gain_filter_plugin);
filter->mixer = NULL;
- filter->mode = replay_gain_get_real_mode();
+ filter->mode = REPLAY_GAIN_OFF;
replay_gain_info_init(&filter->info);
filter->volume = PCM_VOLUME_1;
@@ -164,16 +164,6 @@ replay_gain_filter_filter(struct filter *_filter,
(struct replay_gain_filter *)_filter;
bool success;
void *dest;
- enum replay_gain_mode rg_mode;
-
- /* check if the mode has been changed since the last call */
- rg_mode = replay_gain_get_real_mode();
-
- if (filter->mode != rg_mode) {
- g_debug("replay gain mode has changed %d->%d\n", filter->mode, rg_mode);
- filter->mode = rg_mode;
- replay_gain_filter_update(filter);
- }
*dest_size_r = src_size;
@@ -243,3 +233,19 @@ replay_gain_filter_set_info(struct filter *_filter,
replay_gain_filter_update(filter);
}
+
+void
+replay_gain_filter_set_mode(struct filter *_filter, enum replay_gain_mode mode)
+{
+ struct replay_gain_filter *filter =
+ (struct replay_gain_filter *)_filter;
+
+ if (mode == filter->mode)
+ /* no change */
+ return;
+
+ g_debug("replay gain mode has changed %d->%d\n", filter->mode, mode);
+
+ filter->mode = mode;
+ replay_gain_filter_update(filter);
+}
diff --git a/src/filter/replay_gain_filter_plugin.h b/src/filter/replay_gain_filter_plugin.h
index 45b738e40..da2df9d6a 100644
--- a/src/filter/replay_gain_filter_plugin.h
+++ b/src/filter/replay_gain_filter_plugin.h
@@ -47,4 +47,7 @@ void
replay_gain_filter_set_info(struct filter *filter,
const struct replay_gain_info *info);
+void
+replay_gain_filter_set_mode(struct filter *filter, enum replay_gain_mode mode);
+
#endif