Mercurial > audlegacy
changeset 4236:1ab015fe2ade
RG icon added. some changes
author | Eugene Zagidullin <e.asphyx@gmail.com> |
---|---|
date | Thu, 31 Jan 2008 21:43:51 +0300 |
parents | 2d4b4f13d10d |
children | 8f6956130372 |
files | src/audacious/images/replay_gain.png src/audacious/main.c src/audacious/main.h src/audacious/ui_preferences.c |
diffstat | 4 files changed, 34 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/audacious/main.c Thu Jan 31 14:15:12 2008 +0300 +++ b/src/audacious/main.c Thu Jan 31 21:43:51 2008 +0300 @@ -232,6 +232,13 @@ FALSE, /* disable inline themes */ TRUE, /* remember jtf text entry */ 16, /* output bit depth */ + TRUE, /* enable replay gain */ + TRUE, /* enable clipping prevention */ + TRUE, /* track mode */ + FALSE, /* album mode */ + FALSE, /* enable hard limiter */ + 0.0, /* preamp */ + -9.0, /* default gain */ }; typedef struct bmp_cfg_boolent_t { @@ -343,6 +350,11 @@ {"warn_about_broken_gtk_engines", &cfg.warn_about_broken_gtk_engines, TRUE}, {"disable_inline_gtk", &cfg.disable_inline_gtk, TRUE}, {"remember_jtf_entry", &cfg.remember_jtf_entry, TRUE}, + {"enable_replay_gain", &cfg.enable_replay_gain, TRUE}, + {"enable_clipping_prevention", &cfg.enable_clipping_prevention, TRUE}, + {"replay_gain_track", &cfg.replay_gain_track, TRUE}, + {"replay_gain_album", &cfg.replay_gain_album, TRUE}, + {"enable_hard_limiter", &cfg.enable_hard_limiter, TRUE}, }; static gint ncfgbent = G_N_ELEMENTS(bmp_boolents); @@ -631,6 +643,10 @@ } } + /* RG settings */ + cfg_db_get_float(db, NULL, "replay_gain_preamp", &cfg.replay_gain_preamp); + cfg_db_get_float(db, NULL, "default_gain", &cfg.default_gain); + cfg_db_close(db); @@ -883,6 +899,10 @@ } cfg_db_set_float(db, NULL, "equalizer_preamp", cfg.equalizer_preamp); + + /* RG settings */ + cfg_db_set_float(db, NULL, "replay_gain_preamp", cfg.replay_gain_preamp); + cfg_db_set_float(db, NULL, "default_gain", cfg.default_gain); for (i = 0; i < 10; i++) { str = g_strdup_printf("equalizer_band%d", i);
--- a/src/audacious/main.h Thu Jan 31 14:15:12 2008 +0300 +++ b/src/audacious/main.h Thu Jan 31 21:43:51 2008 +0300 @@ -143,6 +143,13 @@ gboolean disable_inline_gtk; gboolean remember_jtf_entry; gint output_bit_depth; + gboolean enable_replay_gain; + gboolean enable_clipping_prevention; + gboolean replay_gain_track; + gboolean replay_gain_album; + gboolean enable_hard_limiter; + gfloat replay_gain_preamp; + gfloat default_gain; }; typedef struct _BmpConfig BmpConfig;
--- a/src/audacious/ui_preferences.c Thu Jan 31 14:15:12 2008 +0300 +++ b/src/audacious/ui_preferences.c Thu Jan 31 21:43:51 2008 +0300 @@ -218,6 +218,12 @@ N_("When checked, Audacious will detect file formats based by extension. Only files with extensions of supported formats will be loaded."), FALSE}, {WIDGET_LABEL, N_("<b>Bit Depth</b>"), NULL, NULL, NULL, FALSE}, {WIDGET_CUSTOM, NULL, NULL, NULL, NULL, TRUE, ui_preferences_bit_depth}, + {WIDGET_LABEL, N_("<b>Replay Gain</b>"), NULL, NULL, NULL, FALSE}, + {WIDGET_CHK_BTN, N_("Enable Replay Gain"), &cfg.enable_replay_gain, NULL, NULL, FALSE}, + {WIDGET_RADIO_BTN, N_("Use track gain/peak"), &cfg.replay_gain_track, NULL, NULL, TRUE}, + {WIDGET_RADIO_BTN, N_("Use album gain/peak"), &cfg.replay_gain_album, NULL, NULL, TRUE}, + {WIDGET_CHK_BTN, N_("Enable clipping prevention"), &cfg.enable_clipping_prevention, NULL, NULL, TRUE}, + {WIDGET_CHK_BTN, N_("Enable 6 dB hard limiter"), &cfg.enable_hard_limiter, NULL, NULL, TRUE}, }; static PreferencesWidget playback_page_widgets[] = { @@ -1714,6 +1720,7 @@ gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5); break; case WIDGET_RADIO_BTN: + gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 12, 0); widget = gtk_radio_button_new_with_mnemonic(radio_btn_group, _(widgets[x].label)); radio_btn_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget)); g_signal_connect(G_OBJECT(widget), "toggled",