diff --git a/.gitignore b/.gitignore index 09a26d7..19d2b57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Ignore generated config.txt +# Ignore generated config files source/config.txt # Created by https://www.gitignore.io/api/c,clion diff --git a/README.md b/README.md index 97f5e52..f84ecea 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # E-APO-Config-Switcher - - +[](https://travis-ci.com/psidex/E-APO-Config-Switcher) +[](LICENSE) A small Windows app that sits in the tray and allows you to quickly switch between using different [Equalizer APO](https://sourceforge.net/projects/equalizerapo/) configuration files @@ -15,10 +15,8 @@ A small Windows app that sits in the tray and allows you to quickly switch betwe ## Warnings -*Both of these will be fixed in a future release* - -- This will erase any configuration you currently have (and will continue to erase any changes you make to `config.txt`) -- This will not work alongside other configuration programs, such as Peace +- This won't work alongside other configuration programs such as Peace or the default configuration program that comes with Equalizer APO +- This will overwrite Equalizer APO's `config.txt`. Make a backup if you need to! ## Install @@ -30,9 +28,39 @@ A small Windows app that sits in the tray and allows you to quickly switch betwe ## Edit / Add / Remove Configurations -Simply copy the configuration text you want and put it in a `.txt` file inside `E-APO-Config-Switcher\config-files`. If you look in there you will also see the configurations that are included with this app +The configuration folder (the folder that contains all the configuration files) is located at `EqualizerAPO\config\E-APO-Config-Switcher\config-files` + +### Adding your own config + +Let's say you have this configuration for Equalizer APO: + +``` +Channel: all +Preamp: -2.5 dB +Filter 1: ON LS Fc 500 Hz Gain 5 dB +``` + +and you want to call the configuration `My Config` + +Copy the config text (shown above) and place in a file named `My Config.txt` + +Move this file into the configuration folder + +Restart E-APO-Config-Switcher and you will see your new configuration appear in the list + +### Editing a config + +Find the `.txt` in the configuration folder of the config you want to edit + +Open the file and edit the text how you want + +Once you save the file, un-check (if it was previously checked) and check the configuration in E-APO-Config-Switcher and your new configuration will be applied + +### Remove a config + +To remove a config all you have to do is delete the `.txt` file associated with that configuration -You will need to restart the app if you create / delete any configuration files +Restart E-APO-Config-Switcher and you will see the configuration does not appear in the list anymore ## Credits diff --git a/screenshot.png b/screenshot.png index 27829a6..9f5f3f6 100644 Binary files a/screenshot.png and b/screenshot.png differ diff --git a/source/configs.c b/source/configs.c index d7be168..2cf6591 100644 --- a/source/configs.c +++ b/source/configs.c @@ -6,19 +6,19 @@ const char config_files_glob[] = "config-files\\*.txt"; // The master config file that Equalizer APO reads -const char config_master_path[] = "../config.txt"; +const char config_file_path[] = "../config.txt"; // config_files_base is relative to the master config file const char config_files_base[] = "E-APO-Config-Switcher\\config-files\\"; void config_write_to_file(int config_count, struct e_apo_config *e_apo_configs) { + // TODO: Handle file stream being NULL + FILE *config_file = fopen(config_file_path, "w"); // For each checked config, write the include_text to the master config file - // TODO: Switch to fopen_s?, handle err - FILE *fp = fopen(config_master_path, "w"); for(int i = 0; i < config_count; i++) { - if (e_apo_configs[i].checked) fputs(e_apo_configs[i].include_text, fp); + if (e_apo_configs[i].checked) fputs(e_apo_configs[i].include_text, config_file); } - fclose(fp); + fclose(config_file); } int config_file_count() { diff --git a/source/main.c b/source/main.c index fe552db..31f243a 100644 --- a/source/main.c +++ b/source/main.c @@ -1,4 +1,3 @@ -#include <stdio.h> #define TRAY_WINAPI 1 #include "tray.h" #include "configs.h"