Skip to content

Commit

Permalink
Remove .txt from menu items, update readme, general smaller fixes / a…
Browse files Browse the repository at this point in the history
…dditions
  • Loading branch information
psidex committed Jun 17, 2019
1 parent 3747d4d commit cce2376
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ignore generated config.txt
# Ignore generated config files
source/config.txt

# Created by https://www.gitignore.io/api/c,clion
Expand Down
44 changes: 36 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# E-APO-Config-Switcher

![travis-build](https://travis-ci.com/psidex/E-APO-Config-Switcher.svg?branch=master)
![license](https://img.shields.io/github/license/psidex/E-APO-Config-Switcher.svg)
[![Build Status](https://travis-ci.com/psidex/E-APO-Config-Switcher.svg?branch=master)](https://travis-ci.com/psidex/E-APO-Config-Switcher)
[![license](https://img.shields.io/github/license/psidex/E-APO-Config-Switcher.svg)](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

Expand All @@ -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

Expand All @@ -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

Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions source/configs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 0 additions & 1 deletion source/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <stdio.h>
#define TRAY_WINAPI 1
#include "tray.h"
#include "configs.h"
Expand Down

0 comments on commit cce2376

Please sign in to comment.