Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4740bef10f | ||
|
|
968d2947a7 | ||
|
|
e2cb03ab32 | ||
|
|
ce5fe3fe0c | ||
|
|
966fc748af | ||
|
|
709406f3ef | ||
|
|
ce522227c7 | ||
|
|
7d13b2a7ea | ||
|
|
d4c86b3a60 | ||
|
|
ca23f2c94c | ||
|
|
bfc285ad0f | ||
|
|
4e5f2438d3 | ||
|
|
10aac46dde | ||
|
|
e802d05ad3 | ||
|
|
95f4ad698a | ||
|
|
9f3bdd002d | ||
|
|
0cfcd806b1 | ||
|
|
c0ac97d4e2 | ||
|
|
84e9ab0e01 | ||
|
|
2c6afe730d | ||
|
|
79912510b4 | ||
|
|
8bdeea7728 | ||
|
|
22de8a00ab | ||
|
|
5cf9c021d8 | ||
|
|
2d4798abf7 | ||
|
|
e427e6f4d3 | ||
|
|
886f01c1e4 | ||
|
|
1c4ff62baa | ||
|
|
edbea6ff43 | ||
|
|
c4b1fbff77 | ||
|
|
68d05bd1db | ||
|
|
73f9a21a02 | ||
|
|
66c5a966a6 | ||
|
|
e7ce11164b | ||
|
|
f95804026c | ||
|
|
5c5d0b3709 | ||
|
|
146745829f | ||
|
|
a207b8ec62 | ||
|
|
a38ab64870 | ||
|
|
93ebb6b65c | ||
|
|
87908f7c9f | ||
|
|
f9d24bc6b9 | ||
|
|
48100b42e1 | ||
|
|
0816a4d0ce |
68
HACKING
Normal file
68
HACKING
Normal file
@@ -0,0 +1,68 @@
|
||||
In general everything brings down to figure out:
|
||||
-ID
|
||||
-Position
|
||||
-Possible value range
|
||||
|
||||
There seems to be two possible ways to figure that out.
|
||||
1) Use USB sniffer together with X-Edit
|
||||
Once you set up X-Edit and usb sniffer, set some option.
|
||||
USB sniffer should report something like this being sent to device:
|
||||
(all numbers here are hex)
|
||||
04 F0 00 00 04 10 00 5E 04 02 41 00 04 30 09 00 07 00 34 F7
|
||||
|
||||
To get SysEx command out of it, remove every 4th byte, so we have:
|
||||
F0 00 00 10 00 5E 02 41 00 30 09 00 00 34 F7
|
||||
|
||||
SysEx message format seems to be formed like this:
|
||||
magic bytes - F0 00 00 10 00 5E 02 41
|
||||
status byte - in this example 00
|
||||
ID - in this example 30 09
|
||||
Position - in this example 00
|
||||
Value - in this example 00 (can be more bytes long, see below)
|
||||
Checksum - to calculate it, XOR all bytes, and then XOR it with 07
|
||||
Every message ends with F7
|
||||
|
||||
Status byte bits explained:
|
||||
7th - ???
|
||||
6th - if active add 80 to ID
|
||||
5th - ???
|
||||
4th - is active when value will start with length
|
||||
In such case value can be something like:
|
||||
01 12 or 02 12 34 or 03 12 34 56
|
||||
and proper values are:
|
||||
01 - 12
|
||||
02 - 1234
|
||||
03 - 123456
|
||||
3rd - when 4th bit is also active, and first value byte is 01
|
||||
then add 80 to value
|
||||
2nd - when 4th bit is also active, and first value byte is 02
|
||||
then add 80 to value
|
||||
1st - when 4th bit is also active, and first value byte is 03
|
||||
then add 80 to value
|
||||
|
||||
So for above example:
|
||||
ID = 3009 (hex) = 12297 (decimal)
|
||||
Position = 0
|
||||
One of possible values is 0. Usually value range is 0 to 99,
|
||||
albeit in some cases it's different - you have to check what values can
|
||||
X-Edit assign (there doesn't seem to be any sanity check in firmware)
|
||||
This is especially needed for IDs that set some effect type.
|
||||
|
||||
2) Save preset patch
|
||||
Patches seem to be simple XML files.
|
||||
Every parameter is written like this:
|
||||
<Param>
|
||||
<ID>65</ID>
|
||||
<Position>2</Position>
|
||||
<Value>0</Value>
|
||||
<Name>Pickup Enable</Name>
|
||||
<Text>Off</Text>
|
||||
</Param>
|
||||
ID is ID, Position is Position and Value is one of possible values.
|
||||
To get all possible values you can:
|
||||
do
|
||||
change value to next one possible in X-Edit
|
||||
(for example next effect type)
|
||||
save new patch
|
||||
check patch file and note the change
|
||||
while you don't have all possible values
|
||||
12
Makefile
12
Makefile
@@ -1,7 +1,7 @@
|
||||
CC = gcc
|
||||
CFLAGS = `pkg-config --cflags glib-2.0 gtk+-2.0` -Wall -g
|
||||
CFLAGS = `pkg-config --cflags glib-2.0 gio-2.0 gtk+-2.0` -Wall -g
|
||||
OFLAG = -o
|
||||
LIBS = `pkg-config --libs glib-2.0 gtk+-2.0 libusb`
|
||||
LIBS = `pkg-config --libs glib-2.0 gio-2.0 gtk+-2.0 alsa` -lexpat
|
||||
|
||||
.SUFFIXES : .o .c
|
||||
.c.o :
|
||||
@@ -9,8 +9,8 @@ LIBS = `pkg-config --libs glib-2.0 gtk+-2.0 libusb`
|
||||
|
||||
all: gdigi
|
||||
|
||||
gdigi: gdigi.o tests.o gui.o
|
||||
$(CC) $(LIBS) $(OFLAG) gdigi gdigi.o tests.o gui.o
|
||||
gdigi: gdigi.o tests.o gui.o effects.o preset.o
|
||||
$(CC) $(LIBS) $(OFLAG) gdigi gdigi.o tests.o gui.o effects.o preset.o
|
||||
|
||||
gdigi.o: gdigi.c
|
||||
|
||||
@@ -18,6 +18,10 @@ tests.o: tests.c
|
||||
|
||||
gui.o: gui.c
|
||||
|
||||
effects.o: effects.c
|
||||
|
||||
preset.o: preset.c
|
||||
|
||||
clean:
|
||||
rm *.o
|
||||
|
||||
|
||||
13
README
13
README
@@ -1,5 +1,12 @@
|
||||
Requirments: libusb, gtk+, glib
|
||||
Requirments: alsa, gtk+, glib, expat
|
||||
|
||||
Getting started guide:
|
||||
-disable snd_usb_audio (when it's loaded gdigi can't claim interface)
|
||||
-make && ./gdigi
|
||||
-to compile: make
|
||||
-to run: ./gdigi
|
||||
|
||||
Commandline options:
|
||||
--device (-d)
|
||||
|
||||
Example:
|
||||
gdigi -d hw:1,0,0
|
||||
gdigi --device=hw:1,0,0
|
||||
|
||||
26
TODO
26
TODO
@@ -1,12 +1,26 @@
|
||||
-figure out all magic commands
|
||||
-fix usb handling code
|
||||
-make complete gui
|
||||
-amp/cabinet models
|
||||
-expression pedal options
|
||||
-audio setup options
|
||||
-cabinet models
|
||||
-tone library
|
||||
-effects library
|
||||
-effects level
|
||||
-handling presets (loading, saving, exporting/importing to/from xml patches)
|
||||
-handling presets (loading, saving, exporting to xml patches)
|
||||
-buildsystem
|
||||
-figure out how to get current device settings, start gui with proper values
|
||||
-start gui with proper values
|
||||
To do so we need to figure out reply formatting of command querying preset.
|
||||
amidi --port=hw:1,0,0 --send-hex F0 00 00 10 00 5E 02 2a 00 04 00 62 F7 --receive=preset
|
||||
will create file named preset (give a while for it, and then hit ctrl+c)
|
||||
this file should have around 440 bytes (depends on actual preset)
|
||||
0x21 byte holds amount of options
|
||||
from 0x22 byte starts effects configuration which is:
|
||||
-2 bytes for ID
|
||||
-1 byte for position
|
||||
-1 to 3 bytes for value
|
||||
Each 8th byte (beginning from 0x27) seems to be status byte which describes
|
||||
whether or not we shall add 0x80 to ID or value and whether or not value
|
||||
will be multibyte. So far I couldn't figure the exact meaning of those bytes.
|
||||
To check you can download some patch from DigiTech Sound Community, apply
|
||||
it to your device, and then do this amidi command.
|
||||
Open resulting file in hex editor, and open patch file in text editor.
|
||||
Every ID, position and value found in patch will appear in the binary file.
|
||||
-fix expression pedal settings (possible types depend on active effects)
|
||||
|
||||
522
effects.c
Normal file
522
effects.c
Normal file
@@ -0,0 +1,522 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Tomasz Moń <desowin@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; under version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses>.
|
||||
*/
|
||||
|
||||
#include "gdigi.h"
|
||||
#include "effects.h"
|
||||
|
||||
static EffectSettings wah_settings[] = {
|
||||
{"Wah min", 0.0, 99.0, WAH_MIN, WAH_POSITION_MIN_MAX},
|
||||
{"Wah max", 0.0, 99.0, WAH_MAX, WAH_POSITION_MIN_MAX},
|
||||
{"Wah level", 0.0, 12.0, WAH_LEVEL, WAH_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings comp_digi_settings[] = {
|
||||
{"Compressor sustain", 0.0, 99.0, COMP_SUSTAIN, COMP_POSITION},
|
||||
{"Compressor tone", 0.0, 99.0, COMP_TONE, COMP_POSITION},
|
||||
{"Compressor attack", 0.0, 99.0, COMP_ATTACK, COMP_POSITION},
|
||||
{"Compressor level", 0.0, 99.0, COMP_LEVEL, COMP_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings comp_cs_settings[] = {
|
||||
{"Compressor sustain", 0.0, 99.0, COMP_SUSTAIN, COMP_POSITION},
|
||||
{"Compressor attack", 0.0, 99.0, COMP_ATTACK, COMP_POSITION},
|
||||
{"Compressor level", 0.0, 99.0, COMP_LEVEL, COMP_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_screamer_settings[] = {
|
||||
{"Screamer drive", 0.0, 99.0, DIST_SCREAMER_DRIVE, DIST_POSITION},
|
||||
{"Screamer tone", 0.0, 99.0, DIST_SCREAMER_TONE, DIST_POSITION},
|
||||
{"Screamer level", 0.0, 99.0, DIST_SCREAMER_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_808_settings[] = {
|
||||
{"808 overdrive", 0.0, 99.0, DIST_808_OVERDRIVE, DIST_POSITION},
|
||||
{"808 tone", 0.0, 99.0, DIST_808_TONE, DIST_POSITION},
|
||||
{"808 level", 0.0, 99.0, DIST_808_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_guyod_settings[] = {
|
||||
{"GuyOD drive", 0.0, 99.0, DIST_GUYOD_DRIVE, DIST_POSITION},
|
||||
{"GuyOD level", 0.0, 99.0, DIST_GUYOD_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_dod250_settings[] = {
|
||||
{"DOD250 gain", 0.0, 99.0, DIST_DOD250_GAIN, DIST_POSITION},
|
||||
{"DOD250 level", 0.0, 99.0, DIST_DOD250_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_rodent_settings[] = {
|
||||
{"Rodent dist", 0.0, 99.0, DIST_RODENT_DIST, DIST_POSITION},
|
||||
{"Rodent filter", 0.0, 99.0, DIST_RODENT_FILTER, DIST_POSITION},
|
||||
{"Rodent level", 0.0, 99.0, DIST_RODENT_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_mx_settings[] = {
|
||||
{"MX dist", 0.0, 99.0, DIST_MX_DIST, DIST_POSITION},
|
||||
{"MX output", 0.0, 99.0, DIST_MX_OUTPUT, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_ds_settings[] = {
|
||||
{"DS gain", 0.0, 99.0, DIST_DS_GAIN, DIST_POSITION},
|
||||
{"DS tone", 0.0, 99.0, DIST_DS_TONE, DIST_POSITION},
|
||||
{"DS level", 0.0, 99.0, DIST_DS_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_grunge_settings[] = {
|
||||
{"Grunge", 0.0, 99.0, DIST_GRUNGE_GRUNGE, DIST_POSITION},
|
||||
{"Grunge face", 0.0, 99.0, DIST_GRUNGE_FACE, DIST_POSITION},
|
||||
{"Grunge loud", 0.0, 99.0, DIST_GRUNGE_LOUD, DIST_POSITION},
|
||||
{"Grunge butt", 0.0, 99.0, DIST_GRUNGE_BUTT, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_zone_settings[] = {
|
||||
{"Zone gain", 0.0, 99.0, DIST_ZONE_GAIN, DIST_POSITION},
|
||||
{"Zone low", 0.0, 99.0, DIST_ZONE_LOW, DIST_POSITION},
|
||||
{"Zone mid level", 0.0, 99.0, DIST_ZONE_MID_LVL, DIST_POSITION},
|
||||
{"Zone mid freq", 0.0, 99.0, DIST_ZONE_MID_FREQ, DIST_POSITION},
|
||||
{"Zone high", 0.0, 99.0, DIST_ZONE_HIGH, DIST_POSITION},
|
||||
{"Zone level", 0.0, 99.0, DIST_ZONE_LEVEL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_death_settings[] = {
|
||||
{"Death low", 0.0, 99.0, DIST_DEATH_LOW, DIST_POSITION},
|
||||
{"Death mid", 0.0, 99.0, DIST_DEATH_MID, DIST_POSITION},
|
||||
{"Death high", 0.0, 99.0, DIST_DEATH_HIGH, DIST_POSITION},
|
||||
{"Death level", 0.0, 99.0, DIST_DEATH_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_gonk_settings[] = {
|
||||
{"Gonk gonk", 0.0, 99.0, DIST_GONK_GONK, DIST_POSITION},
|
||||
{"Gonk smear", 0.0, 99.0, DIST_GONK_SMEAR, DIST_POSITION},
|
||||
{"Gonk suck", 0.0, 99.0, DIST_GONK_SUCK, DIST_POSITION},
|
||||
{"Gonk heave", 0.0, 99.0, DIST_GONK_HEAVE, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_fuzzy_settings[] = {
|
||||
{"Fuzzy fuzz", 0.0, 99.0, DIST_FUZZY_FUZZ, DIST_POSITION},
|
||||
{"Fuzzy volume", 0.0, 99.0, DIST_FUZZY_VOLUME, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_mp_settings[] = {
|
||||
{"MP sustain", 0.0, 99.0, DIST_MP_SUSTAIN, DIST_POSITION},
|
||||
{"MP tone", 0.0, 99.0, DIST_MP_TONE, DIST_POSITION},
|
||||
{"MP volume", 0.0, 99.0, DIST_MP_VOLUME, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings amp_settings[] = {
|
||||
{"AMP gain", 0.0, 99.0, AMP_GAIN, AMP_POSITION},
|
||||
{"AMP level", 0.0, 99.0, AMP_LEVEL, AMP_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings amp_settings2[] = {
|
||||
{"AMP level", 0.0, 99.0, AMP_LEVEL, AMP_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings eq_settings[] = {
|
||||
// TODO: make those display propertly (display range -12 to 12)
|
||||
{"EQ bass", 0.0, 24.0, EQ_BASS, EQ_POSITION},
|
||||
{"EQ mid", 0.0, 24.0, EQ_MID, EQ_POSITION},
|
||||
{"EQ treble", 0.0, 24.0, EQ_TREBLE, EQ_POSITION},
|
||||
// TODO: make this display propertly (display range 300 to 5000)
|
||||
{"EQ mid Hz", 0.0, 4700.0, EQ_MID_HZ, EQ_POSITION},
|
||||
// TODO: make this display propertly (display range 500 to 8000)
|
||||
{"EQ treb Hz", 0.0, 7500.0, EQ_TREBLE_HZ, EQ_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings noisegate_gate_settings[] = {
|
||||
{"Gate treshold", 0.0, 99.0, NOISEGATE_GATE_TRESHOLD, NOISEGATE_POSITION},
|
||||
{"Gate attack", 0.0, 99.0, NOISEGATE_ATTACK, NOISEGATE_POSITION},
|
||||
{"Gate release", 0.0, 99.0, NOISEGATE_RELEASE, NOISEGATE_POSITION},
|
||||
{"Gate attn", 0.0, 99.0, NOISEGATE_ATTN, NOISEGATE_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings noisegate_swell_settings[] = {
|
||||
{"Swell sens", 0.0, 99.0, NOISEGATE_SWELL_SENS, NOISEGATE_POSITION},
|
||||
{"Swell attack", 0.0, 99.0, NOISEGATE_ATTACK, NOISEGATE_POSITION},
|
||||
{"Swell release", 0.0, 99.0, NOISEGATE_RELEASE, NOISEGATE_POSITION},
|
||||
{"Swell attn", 0.0, 99.0, NOISEGATE_ATTN, NOISEGATE_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_ce_settings[] = {
|
||||
{"CE chorus speed", 0.0, 99.0, CE_CHORUS_SPEED, CHORUSFX_POSITION},
|
||||
{"CE chorus depth", 0.0, 99.0, CE_CHORUS_DEPTH, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_dual_settings[] = {
|
||||
{"Dual chorus speed", 0.0, 99.0, DUAL_CHORUS_SPEED, CHORUSFX_POSITION},
|
||||
{"Dual chorus depth", 0.0, 99.0, DUAL_CHORUS_DEPTH, CHORUSFX_POSITION},
|
||||
{"Dual chorus level", 0.0, 99.0, DUAL_CHORUS_LEVEL, CHORUSFX_POSITION},
|
||||
// TODO: DUAL_CHORUS_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_multi_settings[] = {
|
||||
{"Multi chorus speed", 0.0, 99.0, MULTI_CHORUS_SPEED, CHORUSFX_POSITION},
|
||||
{"Multi chorus depth", 0.0, 99.0, MULTI_CHORUS_DEPTH, CHORUSFX_POSITION},
|
||||
{"Multi chorus level", 0.0, 99.0, MULTI_CHORUS_LEVEL, CHORUSFX_POSITION},
|
||||
// TODO: MULTI_CHORUS_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_flanger_settings[] = {
|
||||
{"Flanger speed", 0.0, 99.0, FLANGER_SPEED, CHORUSFX_POSITION},
|
||||
{"Flanger depth", 0.0, 99.0, FLANGER_DEPTH, CHORUSFX_POSITION},
|
||||
{"Flanger regen", 0.0, 99.0, FLANGER_REGEN, CHORUSFX_POSITION},
|
||||
{"Flanger level", 0.0, 99.0, FLANGER_LEVEL, CHORUSFX_POSITION},
|
||||
// TODO: FLANGER_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_mxr_flanger_settings[] = {
|
||||
{"MXR flanger speed", 0.0, 99.0, MXR_FLANGER_SPEED, CHORUSFX_POSITION},
|
||||
{"MXR flanger width", 0.0, 99.0, MXR_FLANGER_WIDTH, CHORUSFX_POSITION},
|
||||
{"MXR flanger regen", 0.0, 99.0, MXR_FLANGER_REGEN, CHORUSFX_POSITION},
|
||||
{"MXR flanger manual", 0.0, 99.0, MXR_FLANGER_MANUAL, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_phaser_settings[] = {
|
||||
{"Phaser speed", 0.0, 99.0, PHASER_SPEED, CHORUSFX_POSITION},
|
||||
{"Phaser depth", 0.0, 99.0, PHASER_DEPTH, CHORUSFX_POSITION},
|
||||
{"Phaser regen", 0.0, 99.0, PHASER_REGEN, CHORUSFX_POSITION},
|
||||
{"Phaser level", 0.0, 99.0, PHASER_LEVEL, CHORUSFX_POSITION},
|
||||
// TODO: PHASER_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_vibrato_settings[] = {
|
||||
{"Vibrato speed", 0.0, 99.0, VIBRATO_SPEED, CHORUSFX_POSITION},
|
||||
{"Vibrato depth", 0.0, 99.0, VIBRATO_DEPTH, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_rotary_settings[] = {
|
||||
{"Rotary speed", 0.0, 99.0, ROTARY_SPEED, CHORUSFX_POSITION},
|
||||
{"Rotary intensity", 0.0, 99.0, ROTARY_INTENSITY, CHORUSFX_POSITION},
|
||||
{"Rotary doppler", 0.0, 99.0, ROTARY_DOPPLER, CHORUSFX_POSITION},
|
||||
{"Rotary crossover", 0.0, 99.0, ROTARY_CROSSOVER, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_vibropan_settings[] = {
|
||||
{"Vibropan speed", 0.0, 99.0, VIBROPAN_SPEED, CHORUSFX_POSITION},
|
||||
{"Vibropan depth", 0.0, 99.0, VIBROPAN_DEPTH, CHORUSFX_POSITION},
|
||||
{"Vibropan vibra", 0.0, 99.0, VIBROPAN_VIBRA, CHORUSFX_POSITION},
|
||||
// TODO: VIBROPAN_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_tremolo_settings[] = {
|
||||
{"Tremolo speed", 0.0, 99.0, TREMOLO_SPEED, CHORUSFX_POSITION},
|
||||
{"Tremolo depth", 0.0, 99.0, TREMOLO_DEPTH, CHORUSFX_POSITION},
|
||||
// TODO: TREMOLO_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_panner_settings[] = {
|
||||
{"Panner speed", 0.0, 99.0, PANNER_SPEED, CHORUSFX_POSITION},
|
||||
{"Panner depth", 0.0, 99.0, PANNER_DEPTH, CHORUSFX_POSITION},
|
||||
// TODO: PANNER_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_envelope_settings[] = {
|
||||
{"Envelope sensitivity", 0.0, 99.0, ENVELOPE_SENSITIVITY, CHORUSFX_POSITION},
|
||||
{"Envelope range", 0.0, 99.0, ENVELOPE_RANGE, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_autoya_settings[] = {
|
||||
{"AutoYa speed", 0.0, 99.0, AUTOYA_SPEED, CHORUSFX_POSITION},
|
||||
{"AutoYa intensity", 0.0, 99.0, AUTOYA_INTENSITY, CHORUSFX_POSITION},
|
||||
{"AutoYa range", 0.0, 49.0, AUTOYA_RANGE, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_yaya_settings[] = {
|
||||
{"YaYa pedal", 0.0, 99.0, YAYA_PEDAL, CHORUSFX_POSITION},
|
||||
{"YaYa intensity", 0.0, 99.0, YAYA_INTENSITY, CHORUSFX_POSITION},
|
||||
{"YaYa range", 0.0, 49.0, YAYA_RANGE, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_step_filter_settings[] = {
|
||||
{"Step filter speed", 0.0, 99.0, STEP_FILTER_SPEED, CHORUSFX_POSITION},
|
||||
{"Step filter intensity", 0.0, 99.0, STEP_FILTER_INTENSITY, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_whammy_settings[] = {
|
||||
{"Whammy pedal", 0.0, 99.0, WHAMMY_PEDAL, CHORUSFX_POSITION},
|
||||
{"Whammy mix", 0.0, 99.0, WHAMMY_MIX, CHORUSFX_POSITION},
|
||||
//TODO: WHAMMY_AMOUNT with valid options:
|
||||
// WHAMMY_OCT_UP, WHAMMY_2OCT_UP, WHAMMY_2ND_DN, WHAMMY_RV_2ND,
|
||||
// WHAMMY_4TH_DN, WHAMMY_OCT_DN, WHAMMY_2OCT_DN, WHAMMY_DIV_BMB,
|
||||
// WHAMMY_M3_MA, WHAMMY_2ND_MA3, WHAMMY_3RD_4TH, WHAMMY_4TH_5TH,
|
||||
// WHAMMY_5TH_OCT, WHAMMY_HOCT_UP, WHAMMY_HOCT_DN, WHAMMY_OCT_UD
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_pitch_shift_settings[] = {
|
||||
// TODO: make this display propertly (display range -24 to 24)
|
||||
{"Pitch amount", 0.0, 48.0, PITCH_AMOUNT, CHORUSFX_POSITION},
|
||||
{"Pitch mix", 0.0, 99.0, PITCH_MIX, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_detune_settings[] = {
|
||||
{"Detune amount", 0.0, 48.0, DETUNE_AMOUNT, CHORUSFX_POSITION},
|
||||
{"Detune level", 0.0, 99.0, DETUNE_LEVEL, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_ips_settings[] = {
|
||||
// TODO: IPS_SHIFT_AMOUNT with valid options:
|
||||
// IPS_7TH_DN, IPS_6TH_DN, IPS_5TH_DN, IPS_4TH_DN, IPS_3RD_DN,
|
||||
// IPS_2ND_DN, IPS_2ND_UP, IPS_3RD_UP, IPS_4TH_UP, IPS_5TH_UP,
|
||||
// IPS_6TH_UP, IPS_7TH_UP, IPS_OCT_U
|
||||
|
||||
// TODO: IPS_KEY with valid options:
|
||||
// IPS_E, IPS_F, IPS_GB, IPS_G, IPS_AB, IPS_A, IPS_BB, IPS_B,
|
||||
// IPS_C, IPS_DD, IPS_D, IPS_EB
|
||||
|
||||
// TODO: IPS_SCALE with valid options:
|
||||
// IPS_MAJOR, IPS_MINOR, IPS_DORIA, IPS_MIXLYD, IPS_LYDIAN, IPS_HMINO
|
||||
|
||||
{"IPS level", 0.0, 99.0, IPS_LEVEL, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings delay_analog_settings[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", 0.0, 139.0, DELAY_TIME, DELAY_POSITION},
|
||||
{"Delay analog level", 0.0, 99.0, ANALOG_LEVEL, DELAY_POSITION},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay analog repeats", 0.0, 100.0, ANALOG_REPEATS, DELAY_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings delay_digital_settings[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", 0.0, 139.0, DELAY_TIME, DELAY_POSITION},
|
||||
{"Delay digital level", 0.0, 99.0, DIGITAL_LEVEL, DELAY_POSITION},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay digital repeats", 0.0, 100.0, DIGITAL_REPEATS, DELAY_POSITION},
|
||||
{"Delay digital ducker thresh", 0.0, 99.0, DIGITAL_DUCKER_THRESH, DELAY_POSITION},
|
||||
{"Delay digital ducker level", 0.0, 99.0, DIGITAL_DUCKER_LEVEL, DELAY_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings delay_modulated_settings[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", 0.0, 139.0, DELAY_TIME, DELAY_POSITION},
|
||||
{"Delay modulated level", 0.0, 99.0, MODULATED_LEVEL, DELAY_POSITION},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay modulated repeats", 0.0, 100.0, MODULATED_REPEATS, DELAY_POSITION},
|
||||
{"Delay modulated depth", 0.0, 99.0, MODULATED_DEPTH, DELAY_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings delay_pong_settings[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", 0.0, 139.0, DELAY_TIME, DELAY_POSITION},
|
||||
{"Delay pong level", 0.0, 99.0, PONG_LEVEL, DELAY_POSITION},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay pong repeats", 0.0, 100.0, PONG_REPEATS, DELAY_POSITION},
|
||||
{"Delay pong ducker thresh", 0.0, 99.0, PONG_DUCKER_THRESH, DELAY_POSITION},
|
||||
{"Delay pong ducker level", 0.0, 99.0, PONG_DUCKER_LEVEL, DELAY_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings delay_tape_settings[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", 0.0, 139.0, DELAY_TIME, DELAY_POSITION},
|
||||
{"Delay tape level", 0.0, 99.0, TAPE_LEVEL, DELAY_POSITION},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay tape repeats", 0.0, 100.0, TAPE_REPEATS, DELAY_POSITION},
|
||||
{"Delay tape wow", 0.0, 99.0, TAPE_WOW, DELAY_POSITION},
|
||||
{"Delay tape flutter", 0.0, 99.0, TAPE_FLUTTER, DELAY_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings reverb_twin_settings[] = {
|
||||
{"Twin reverb", 0.0, 99.0, TWIN_REVERB, REVERB_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings reverb_lex_ambience_settings[] = {
|
||||
{"Predelay", 0.0, 15.0, LEX_AMBIENCE_PREDELAY, REVERB_POSITION},
|
||||
{"Decay", 0.0, 99.0, LEX_AMBIENCE_DECAY, REVERB_POSITION},
|
||||
{"Liveliness", 0.0, 99.0, LEX_AMBIENCE_LIVELINESS, REVERB_POSITION},
|
||||
{"Level", 0.0, 99.0, LEX_AMBIENCE_LEVEL, REVERB_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings reverb_lex_studio_settings[] = {
|
||||
{"Predelay", 0.0, 15.0, LEX_STUDIO_PREDELAY, REVERB_POSITION},
|
||||
{"Decay", 0.0, 99.0, LEX_STUDIO_DECAY, REVERB_POSITION},
|
||||
{"Liveliness", 0.0, 99.0, LEX_STUDIO_LIVELINESS, REVERB_POSITION},
|
||||
{"Level", 0.0, 99.0, LEX_STUDIO_LEVEL, REVERB_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings reverb_lex_room_settings[] = {
|
||||
{"Predelay", 0.0, 15.0, LEX_ROOM_PREDELAY, REVERB_POSITION},
|
||||
{"Decay", 0.0, 99.0, LEX_ROOM_DECAY, REVERB_POSITION},
|
||||
{"Liveliness", 0.0, 99.0, LEX_ROOM_LIVELINESS, REVERB_POSITION},
|
||||
{"Level", 0.0, 99.0, LEX_ROOM_LEVEL, REVERB_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings reverb_lex_hall_settings[] = {
|
||||
{"Predelay", 0.0, 15.0, LEX_HALL_PREDELAY, REVERB_POSITION},
|
||||
{"Decay", 0.0, 99.0, LEX_HALL_DECAY, REVERB_POSITION},
|
||||
{"Liveliness", 0.0, 99.0, LEX_HALL_LIVELINESS, REVERB_POSITION},
|
||||
{"Level", 0.0, 99.0, LEX_HALL_LEVEL, REVERB_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings reverb_emt240_plate_settings[] = {
|
||||
{"Predelay", 0.0, 15.0, EMT240_PLATE_PREDELAY, REVERB_POSITION},
|
||||
{"Decay", 0.0, 99.0, EMT240_PLATE_DECAY, REVERB_POSITION},
|
||||
{"Liveliness", 0.0, 99.0, EMT240_PLATE_LIVELINESS, REVERB_POSITION},
|
||||
{"Level", 0.0, 99.0, EMT240_PLATE_LEVEL, REVERB_POSITION},
|
||||
};
|
||||
|
||||
static EffectGroup wah_group[] = {
|
||||
{WAH_TYPE_CRY, "Cry wah", WAH_TYPE, WAH_POSITION, wah_settings, G_N_ELEMENTS(wah_settings)},
|
||||
{WAH_TYPE_FULLRANGE, "Fullrange wah", WAH_TYPE, WAH_POSITION, wah_settings, G_N_ELEMENTS(wah_settings)},
|
||||
{WAH_TYPE_CLYDE, "Clyde wah", WAH_TYPE, WAH_POSITION, wah_settings, G_N_ELEMENTS(wah_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup comp_group[] = {
|
||||
{COMP_TYPE_DIGI, "Digital compressor", COMP_TYPE, COMP_POSITION, comp_digi_settings, G_N_ELEMENTS(comp_digi_settings)},
|
||||
{COMP_TYPE_CS, "CS compressor", COMP_TYPE, COMP_POSITION, comp_cs_settings, G_N_ELEMENTS(comp_cs_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup dist_group[] = {
|
||||
{DIST_TYPE_SCREAMER, "Screamer", DIST_TYPE, DIST_POSITION, dist_screamer_settings, G_N_ELEMENTS(dist_screamer_settings)},
|
||||
{DIST_TYPE_808, "808", DIST_TYPE, DIST_POSITION, dist_808_settings, G_N_ELEMENTS(dist_808_settings)},
|
||||
{DIST_TYPE_GUYOD, "GuyOD", DIST_TYPE, DIST_POSITION, dist_guyod_settings, G_N_ELEMENTS(dist_guyod_settings)},
|
||||
{DIST_TYPE_DOD250, "DOD250", DIST_TYPE, DIST_POSITION, dist_dod250_settings, G_N_ELEMENTS(dist_dod250_settings)},
|
||||
{DIST_TYPE_RODENT, "Rodent", DIST_TYPE, DIST_POSITION, dist_rodent_settings, G_N_ELEMENTS(dist_rodent_settings)},
|
||||
{DIST_TYPE_MX, "MX", DIST_TYPE, DIST_POSITION, dist_mx_settings, G_N_ELEMENTS(dist_mx_settings)},
|
||||
{DIST_TYPE_DS, "DS", DIST_TYPE, DIST_POSITION, dist_ds_settings, G_N_ELEMENTS(dist_ds_settings)},
|
||||
{DIST_TYPE_GRUNGE, "Grunge", DIST_TYPE, DIST_POSITION, dist_grunge_settings, G_N_ELEMENTS(dist_grunge_settings)},
|
||||
{DIST_TYPE_ZONE, "Zone", DIST_TYPE, DIST_POSITION, dist_zone_settings, G_N_ELEMENTS(dist_zone_settings)},
|
||||
{DIST_TYPE_DEATH, "Death", DIST_TYPE, DIST_POSITION, dist_death_settings, G_N_ELEMENTS(dist_death_settings)},
|
||||
{DIST_TYPE_GONK, "Gonk", DIST_TYPE, DIST_POSITION, dist_gonk_settings, G_N_ELEMENTS(dist_gonk_settings)},
|
||||
{DIST_TYPE_FUZZY, "Fuzzy", DIST_TYPE, DIST_POSITION, dist_fuzzy_settings, G_N_ELEMENTS(dist_fuzzy_settings)},
|
||||
{DIST_TYPE_MP, "MP", DIST_TYPE, DIST_POSITION, dist_mp_settings, G_N_ELEMENTS(dist_mp_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup noisegate_group[] = {
|
||||
{NOISEGATE_GATE, "Gate", NOISEGATE_TYPE, NOISEGATE_POSITION, noisegate_gate_settings, G_N_ELEMENTS(noisegate_gate_settings)},
|
||||
{NOISEGATE_SWELL, "Swell", NOISEGATE_TYPE, NOISEGATE_POSITION, noisegate_swell_settings, G_N_ELEMENTS(noisegate_swell_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup chorusfx_group[] = {
|
||||
{CHORUS_TYPE_CE, "CE Chorus", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_ce_settings, G_N_ELEMENTS(chorusfx_ce_settings)},
|
||||
{CHORUS_TYPE_DUAL, "Dual Chorus", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_dual_settings, G_N_ELEMENTS(chorusfx_dual_settings)},
|
||||
{CHORUS_TYPE_MULTI, "Multi Chorus", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_multi_settings, G_N_ELEMENTS(chorusfx_multi_settings)},
|
||||
{CHORUS_TYPE_FLANGER, "Flanger", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_flanger_settings, G_N_ELEMENTS(chorusfx_flanger_settings)},
|
||||
{CHORUS_TYPE_MXR_FLANGER, "MXR FLANGER", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_mxr_flanger_settings, G_N_ELEMENTS(chorusfx_mxr_flanger_settings)},
|
||||
{CHORUS_TYPE_PHASER, "Phaser", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_phaser_settings, G_N_ELEMENTS(chorusfx_phaser_settings)},
|
||||
{CHORUS_TYPE_VIBRATO, "Vibrato", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_vibrato_settings, G_N_ELEMENTS(chorusfx_vibrato_settings)},
|
||||
{CHORUS_TYPE_ROTARY, "Rotary", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_rotary_settings, G_N_ELEMENTS(chorusfx_rotary_settings)},
|
||||
{CHORUS_TYPE_VIBROPAN, "Vibropan", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_vibropan_settings, G_N_ELEMENTS(chorusfx_vibropan_settings)},
|
||||
{CHORUS_TYPE_TREMOLO, "Tremolo", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_tremolo_settings, G_N_ELEMENTS(chorusfx_tremolo_settings)},
|
||||
{CHORUS_TYPE_PANNER, "Panner", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_panner_settings, G_N_ELEMENTS(chorusfx_panner_settings)},
|
||||
{CHORUS_TYPE_ENVELOPE, "Envelope", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_envelope_settings, G_N_ELEMENTS(chorusfx_envelope_settings)},
|
||||
{CHORUS_TYPE_AUTOYA, "AutoYa", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_autoya_settings, G_N_ELEMENTS(chorusfx_autoya_settings)},
|
||||
{CHORUS_TYPE_YAYA, "YaYa", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_yaya_settings, G_N_ELEMENTS(chorusfx_yaya_settings)},
|
||||
{CHORUS_TYPE_STEP_FILTER, "Step Filter", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_step_filter_settings, G_N_ELEMENTS(chorusfx_step_filter_settings)},
|
||||
{CHORUS_TYPE_WHAMMY, "Whammy", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_whammy_settings, G_N_ELEMENTS(chorusfx_whammy_settings)},
|
||||
{CHORUS_TYPE_PITCH_SHIFT, "Pitch Shift", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_pitch_shift_settings, G_N_ELEMENTS(chorusfx_pitch_shift_settings)},
|
||||
{CHORUS_TYPE_DETUNE, "Detune", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_detune_settings, G_N_ELEMENTS(chorusfx_detune_settings)},
|
||||
{CHORUS_TYPE_IPS, "IPS", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_ips_settings, G_N_ELEMENTS(chorusfx_ips_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup delay_group[] = {
|
||||
{DELAY_TYPE_ANALOG, "Analog", DELAY_TYPE, DELAY_POSITION, delay_analog_settings, G_N_ELEMENTS(delay_analog_settings)},
|
||||
{DELAY_TYPE_DIGITAL, "Digital", DELAY_TYPE, DELAY_POSITION, delay_digital_settings, G_N_ELEMENTS(delay_digital_settings)},
|
||||
{DELAY_TYPE_MODULATED, "Modulated", DELAY_TYPE, DELAY_POSITION, delay_modulated_settings, G_N_ELEMENTS(delay_modulated_settings)},
|
||||
{DELAY_TYPE_PONG, "Pong", DELAY_TYPE, DELAY_POSITION, delay_pong_settings, G_N_ELEMENTS(delay_pong_settings)},
|
||||
{DELAY_TYPE_TAPE, "Tape", DELAY_TYPE, DELAY_POSITION, delay_tape_settings, G_N_ELEMENTS(delay_tape_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup reverb_group[] = {
|
||||
{REVERB_TYPE_TWIN, "Twin", REVERB_TYPE, REVERB_POSITION, reverb_twin_settings, G_N_ELEMENTS(reverb_twin_settings)},
|
||||
{REVERB_TYPE_LEX_AMBIENCE, "Lexicon ambience", REVERB_TYPE, REVERB_POSITION, reverb_lex_ambience_settings, G_N_ELEMENTS(reverb_lex_ambience_settings)},
|
||||
{REVERB_TYPE_LEX_STUDIO, "Lexicon studio", REVERB_TYPE, REVERB_POSITION, reverb_lex_studio_settings, G_N_ELEMENTS(reverb_lex_studio_settings)},
|
||||
{REVERB_TYPE_LEX_ROOM, "Lexicon room", REVERB_TYPE, REVERB_POSITION, reverb_lex_room_settings, G_N_ELEMENTS(reverb_lex_room_settings)},
|
||||
{REVERB_TYPE_LEX_HALL, "Lexicon hall", REVERB_TYPE, REVERB_POSITION, reverb_lex_hall_settings, G_N_ELEMENTS(reverb_lex_hall_settings)},
|
||||
{REVERB_TYPE_EMT240_PLATE, "EMT240 Plate", REVERB_TYPE, REVERB_POSITION, reverb_emt240_plate_settings, G_N_ELEMENTS(reverb_emt240_plate_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup amp_group[] = {
|
||||
{AMP_TYPE_TWEED_CHAMP, "Tweed Champ", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_TWEED_DELUXE, "Tweed Deluxe", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_TWEED_BASSMAN, "Tweed Bassman", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_BLACKFACE_TWIN, "Blackface Twin", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_BLACKFACE_DELUXE, "Blackface Deluxe", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_SUPER_LEAD_PLEXI, "Super Lead Plexi", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_MASTER_VOLUME, "Master Volume", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_JCM800, "JCM800", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_JCM900, "JCM900", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_AC15, "AC15", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_AC30TB, "AC30TB", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_HIWATT_100, "Hiwatt 100", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_BOOGIE_MARK_II, "Boogie Mark II", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_DUAL_RECTIFIER, "Dual Rectifier", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_MATCHLESS_HC30, "Matchless HC30", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_SOLO, "Solo", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_METAL, "Metal", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_BRIGHT, "Bright", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_CLEAN, "Clean", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_HIGH_GAIN, "High Gain", AMP_TYPE, AMP_POSITION, amp_settings, G_N_ELEMENTS(amp_settings)},
|
||||
{AMP_TYPE_ACOUSTIC, "Acoustic", AMP_TYPE, AMP_POSITION, amp_settings2, G_N_ELEMENTS(amp_settings2)},
|
||||
{AMP_TYPE_DIRECT, "Direct", AMP_TYPE, AMP_POSITION, amp_settings2, G_N_ELEMENTS(amp_settings2)},
|
||||
};
|
||||
|
||||
static EffectGroup eq_group[] = {
|
||||
{EQ_TYPE_BRIGHT, "Bright", EQ_TYPE, EQ_POSITION, eq_settings, G_N_ELEMENTS(eq_settings)},
|
||||
{EQ_TYPE_MIDBOOST, "Mid Boost", EQ_TYPE, EQ_POSITION, eq_settings, G_N_ELEMENTS(eq_settings)},
|
||||
{EQ_TYPE_SCOOP, "Scoop", EQ_TYPE, EQ_POSITION, eq_settings, G_N_ELEMENTS(eq_settings)},
|
||||
{EQ_TYPE_WARM, "Warm", EQ_TYPE, EQ_POSITION, eq_settings, G_N_ELEMENTS(eq_settings)},
|
||||
};
|
||||
|
||||
static Effect wah_effect[] = {
|
||||
{"Wah", WAH_ON_OFF, WAH_POSITION, wah_group, G_N_ELEMENTS(wah_group)},
|
||||
};
|
||||
|
||||
static Effect comp_effect[] = {
|
||||
{"Compressor", COMP_ON_OFF, COMP_POSITION, comp_group, G_N_ELEMENTS(comp_group)},
|
||||
};
|
||||
|
||||
static Effect dist_effect[] = {
|
||||
{"Distortion", DIST_ON_OFF, DIST_POSITION, dist_group, G_N_ELEMENTS(dist_group)},
|
||||
};
|
||||
|
||||
static Effect noisegate_effect[] = {
|
||||
{"Noisegate", NOISEGATE_ON_OFF, NOISEGATE_POSITION, noisegate_group, G_N_ELEMENTS(noisegate_group)},
|
||||
};
|
||||
|
||||
static Effect chorusfx_effect[] = {
|
||||
{"Chorus/FX", CHORUSFX_ON_OFF, CHORUSFX_POSITION, chorusfx_group, G_N_ELEMENTS(chorusfx_group)},
|
||||
};
|
||||
|
||||
static Effect delay_effect[] = {
|
||||
{"Delay", DELAY_ON_OFF, DELAY_POSITION, delay_group, G_N_ELEMENTS(delay_group)},
|
||||
};
|
||||
|
||||
static Effect reverb_effect[] = {
|
||||
{"Reverb", REVERB_ON_OFF, REVERB_POSITION, reverb_group, G_N_ELEMENTS(reverb_group)},
|
||||
};
|
||||
|
||||
static Effect amp_effect[] = {
|
||||
{"Amp", AMP_ON_OFF, AMP_POSITION, amp_group, G_N_ELEMENTS(amp_group)},
|
||||
};
|
||||
|
||||
static Effect eq_effect[] = {
|
||||
{"EQ", EQ_ON_OFF, EQ_POSITION, eq_group, G_N_ELEMENTS(eq_group)},
|
||||
};
|
||||
|
||||
EffectList effects[] = {
|
||||
{wah_effect, G_N_ELEMENTS(wah_effect)},
|
||||
{amp_effect, G_N_ELEMENTS(amp_effect)},
|
||||
{eq_effect, G_N_ELEMENTS(eq_effect)},
|
||||
{comp_effect, G_N_ELEMENTS(comp_effect)},
|
||||
{dist_effect, G_N_ELEMENTS(dist_effect)},
|
||||
{noisegate_effect, G_N_ELEMENTS(noisegate_effect)},
|
||||
{chorusfx_effect, G_N_ELEMENTS(chorusfx_effect)},
|
||||
{delay_effect, G_N_ELEMENTS(delay_effect)},
|
||||
{reverb_effect, G_N_ELEMENTS(reverb_effect)},
|
||||
};
|
||||
|
||||
int n_effects = G_N_ELEMENTS(effects);
|
||||
52
effects.h
Normal file
52
effects.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Tomasz Moń <desowin@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; under version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses>.
|
||||
*/
|
||||
|
||||
#ifndef GDIGI_EFFECTS_H
|
||||
#define GDIGI_EFFECTS_H
|
||||
|
||||
#include <glib/gtypes.h>
|
||||
|
||||
typedef struct {
|
||||
char *label; /* Parameter name */
|
||||
gdouble min; /* Parameter minumum value */
|
||||
gdouble max; /* Parameter maximum value */
|
||||
guint option; /* ID (to set parameter) */
|
||||
guint position; /* position */
|
||||
} EffectSettings;
|
||||
|
||||
typedef struct {
|
||||
guint id; /* value (type) */
|
||||
gchar *label; /* Effect name */
|
||||
guint option; /* ID (to set effect type) */
|
||||
guint position; /* position */
|
||||
EffectSettings *settings; /* possible parameters */
|
||||
gint settings_amt; /* possible parameters length */
|
||||
} EffectGroup;
|
||||
|
||||
typedef struct {
|
||||
char *label; /* Base effect name */
|
||||
guint option; /* ID (to set effect on/off) */
|
||||
guint position; /* position */
|
||||
EffectGroup *group; /* possible effect types */
|
||||
gint group_amt; /* possible effect types length */
|
||||
} Effect;
|
||||
|
||||
typedef struct {
|
||||
Effect *effect; /* list of supported effects */
|
||||
gint amt; /* list of supported effects length */
|
||||
} EffectList;
|
||||
|
||||
#endif /* GDIGI_EFFECTS_H */
|
||||
633
gdigi.h
633
gdigi.h
@@ -14,207 +14,289 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses>.
|
||||
*/
|
||||
|
||||
#include <usb.h>
|
||||
#ifndef GDIGI_H
|
||||
#define GDIGI_H
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
extern struct usb_dev_handle *handle;
|
||||
#include <glib-object.h>
|
||||
|
||||
enum {
|
||||
WAH_TYPE_CRY = 0,
|
||||
WAH_TYPE_FULLRANGE,
|
||||
WAH_TYPE_CLYDE
|
||||
WAH_TYPE_CRY = 132,
|
||||
WAH_TYPE_FULLRANGE = 133,
|
||||
WAH_TYPE_CLYDE = 134
|
||||
};
|
||||
|
||||
#define WAH_POSITION_MIN_MAX 20
|
||||
|
||||
#define WAH_MIN 8195
|
||||
#define WAH_MAX 8196
|
||||
|
||||
#define WAH_TYPE 128
|
||||
#define WAH_ON_OFF 129
|
||||
#define WAH_POSITION 3
|
||||
|
||||
#define WAH_LEVEL 133
|
||||
|
||||
enum {
|
||||
COMP_TYPE_DIGI = 195,
|
||||
COMP_TYPE_CS = 196
|
||||
};
|
||||
|
||||
#define COMP_TYPE 207
|
||||
#define COMP_ON_OFF 193
|
||||
#define COMP_POSITION 4
|
||||
|
||||
#define COMP_SUSTAIN 208
|
||||
#define COMP_TONE 209
|
||||
#define COMP_ATTACK 211
|
||||
#define COMP_LEVEL 210
|
||||
|
||||
enum {
|
||||
PICKUP_TYPE_HB_SC = 66,
|
||||
PICKUP_TYPE_SC_HB = 65
|
||||
};
|
||||
|
||||
#define PICKUP_TYPE 64
|
||||
#define PICKUP_ON_OFF 65
|
||||
#define PICKUP_POSITION 2
|
||||
|
||||
enum {
|
||||
DIST_TYPE_SCREAMER = 1280,
|
||||
DIST_TYPE_808 = 1292,
|
||||
DIST_TYPE_GUYOD = 1285,
|
||||
DIST_TYPE_DOD250 = 1283,
|
||||
DIST_TYPE_RODENT = 1281,
|
||||
DIST_TYPE_MX = 1291,
|
||||
DIST_TYPE_DS = 1282,
|
||||
DIST_TYPE_GRUNGE = 1287,
|
||||
DIST_TYPE_ZONE = 1289,
|
||||
DIST_TYPE_DEATH = 1294,
|
||||
DIST_TYPE_GONK = 1293,
|
||||
DIST_TYPE_FUZZY = 1288,
|
||||
DIST_TYPE_MP = 1284
|
||||
};
|
||||
|
||||
#define DIST_TYPE 2432
|
||||
#define DIST_ON_OFF 2433
|
||||
#define DIST_POSITION 6
|
||||
|
||||
#define DIST_SCREAMER_DRIVE 2434
|
||||
#define DIST_SCREAMER_TONE 2435
|
||||
#define DIST_SCREAMER_LVL 2436
|
||||
#define DIST_808_OVERDRIVE 2473
|
||||
#define DIST_808_TONE 2474
|
||||
#define DIST_808_LVL 2475
|
||||
#define DIST_GUYOD_DRIVE 2448
|
||||
#define DIST_GUYOD_LVL 2449
|
||||
#define DIST_DOD250_GAIN 2443
|
||||
#define DIST_DOD250_LVL 2444
|
||||
#define DIST_RODENT_DIST 2437
|
||||
#define DIST_RODENT_FILTER 2438
|
||||
#define DIST_RODENT_LVL 2439
|
||||
#define DIST_MX_DIST 2468
|
||||
#define DIST_MX_OUTPUT 2469
|
||||
#define DIST_DS_GAIN 2440
|
||||
#define DIST_DS_TONE 2441
|
||||
#define DIST_DS_LVL 2442
|
||||
#define DIST_GRUNGE_GRUNGE 2454
|
||||
#define DIST_GRUNGE_FACE 2456
|
||||
#define DIST_GRUNGE_LOUD 2457
|
||||
#define DIST_GRUNGE_BUTT 2455
|
||||
#define DIST_ZONE_GAIN 2460
|
||||
#define DIST_ZONE_LOW 2463
|
||||
#define DIST_ZONE_MID_LVL 2462
|
||||
#define DIST_ZONE_MID_FREQ 2461
|
||||
#define DIST_ZONE_HIGH 2464
|
||||
#define DIST_ZONE_LEVEL 2465
|
||||
#define DIST_DEATH_LOW 2477
|
||||
#define DIST_DEATH_MID 2476
|
||||
#define DIST_DEATH_HIGH 2479
|
||||
#define DIST_DEATH_LVL 2478
|
||||
#define DIST_GONK_GONK 2480
|
||||
#define DIST_GONK_SMEAR 2471
|
||||
#define DIST_GONK_SUCK 2470
|
||||
#define DIST_GONK_HEAVE 2472
|
||||
#define DIST_FUZZY_FUZZ 2458
|
||||
#define DIST_FUZZY_VOLUME 2459
|
||||
#define DIST_MP_SUSTAIN 2445
|
||||
#define DIST_MP_TONE 2446
|
||||
#define DIST_MP_VOLUME 2447
|
||||
|
||||
#define PRESET_POSITION 18
|
||||
#define PRESET_LEVEL 2626
|
||||
|
||||
enum {
|
||||
AMP_TYPE_TWEED_CHAMP = 307,
|
||||
AMP_TYPE_TWEED_DELUXE = 308,
|
||||
AMP_TYPE_TWEED_BASSMAN = 309,
|
||||
AMP_TYPE_BLACKFACE_TWIN = 311,
|
||||
AMP_TYPE_BLACKFACE_DELUXE = 312,
|
||||
AMP_TYPE_SUPER_LEAD_PLEXI = 314,
|
||||
AMP_TYPE_MASTER_VOLUME = 316,
|
||||
AMP_TYPE_JCM800 = 317,
|
||||
AMP_TYPE_JCM900 = 318,
|
||||
AMP_TYPE_AC15 = 322,
|
||||
AMP_TYPE_AC30TB = 323,
|
||||
AMP_TYPE_HIWATT_100 = 324,
|
||||
AMP_TYPE_BOOGIE_MARK_II = 320,
|
||||
AMP_TYPE_DUAL_RECTIFIER = 321,
|
||||
AMP_TYPE_MATCHLESS_HC30 = 326,
|
||||
AMP_TYPE_SOLO = 331,
|
||||
AMP_TYPE_METAL = 332,
|
||||
AMP_TYPE_BRIGHT = 333,
|
||||
AMP_TYPE_CLEAN = 335,
|
||||
AMP_TYPE_HIGH_GAIN = 337,
|
||||
AMP_TYPE_ACOUSTIC = 341,
|
||||
AMP_TYPE_DIRECT = 306
|
||||
};
|
||||
|
||||
enum {
|
||||
COMP_TYPE_DIGI = 0,
|
||||
COMP_TYPE_CS
|
||||
EQ_TYPE_BRIGHT = 1474,
|
||||
EQ_TYPE_MIDBOOST = 1472,
|
||||
EQ_TYPE_SCOOP = 1473,
|
||||
EQ_TYPE_WARM = 1475
|
||||
};
|
||||
|
||||
#define AMP_TYPE 2496
|
||||
#define AMP_ON_OFF 265
|
||||
#define AMP_POSITION 8
|
||||
|
||||
#define AMP_GAIN 2497
|
||||
#define AMP_LEVEL 2498
|
||||
|
||||
#define EQ_TYPE 3202
|
||||
#define EQ_ON_OFF 3212
|
||||
#define EQ_POSITION 24
|
||||
|
||||
#define EQ_BASS 3203
|
||||
#define EQ_MID 3204
|
||||
#define EQ_MID_HZ 3206
|
||||
#define EQ_TREBLE 3205
|
||||
#define EQ_TREBLE_HZ 3211
|
||||
|
||||
enum {
|
||||
PICKUP_TYPE_HB_SC = 0,
|
||||
PICKUP_TYPE_SC_HB
|
||||
NOISEGATE_GATE = 768,
|
||||
NOISEGATE_SWELL = 769
|
||||
};
|
||||
|
||||
enum {
|
||||
DIST_TYPE_SCREAMER = 0,
|
||||
DIST_TYPE_808,
|
||||
DIST_TYPE_GUYOD,
|
||||
DIST_TYPE_DOD250,
|
||||
DIST_TYPE_RODENT,
|
||||
DIST_TYPE_MX,
|
||||
DIST_TYPE_DS,
|
||||
DIST_TYPE_GRUNGE,
|
||||
DIST_TYPE_ZONE,
|
||||
DIST_TYPE_DEATH,
|
||||
DIST_TYPE_GONK,
|
||||
DIST_TYPE_FUZZY,
|
||||
DIST_TYPE_MP
|
||||
};
|
||||
|
||||
#define DIST_SCREAMER_DRIVE 0x02
|
||||
#define DIST_SCREAMER_TONE 0x03
|
||||
#define DIST_SCREAMER_LVL 0x04
|
||||
#define DIST_808_OVERDRIVE 0x29
|
||||
#define DIST_808_TONE 0x2A
|
||||
#define DIST_808_LVL 0x2B
|
||||
#define DIST_GUYOD_DRIVE 0x10
|
||||
#define DIST_GUYOD_LVL 0x11
|
||||
#define DIST_DOD250_GAIN 0x0B
|
||||
#define DIST_DOD250_LVL 0x0C
|
||||
#define DIST_RODENT_DIST 0x05
|
||||
#define DIST_RODENT_FILTER 0x06
|
||||
#define DIST_RODENT_LVL 0x07
|
||||
#define DIST_MX_DIST 0x24
|
||||
#define DIST_MX_OUTPUT 0x25
|
||||
#define DIST_DS_GAIN 0x08
|
||||
#define DIST_DS_TONE 0x09
|
||||
#define DIST_DS_LVL 0x0A
|
||||
#define DIST_GRUNGE_GRUNGE 0x16
|
||||
#define DIST_GRUNGE_FACE 0x18
|
||||
#define DIST_GRUNGE_LOUD 0x19
|
||||
#define DIST_GRUNGE_BUTT 0x17
|
||||
#define DIST_ZONE_GAIN 0x1C
|
||||
#define DIST_ZONE_LOW 0x1F
|
||||
#define DIST_ZONE_MID_LVL 0x1E
|
||||
#define DIST_ZONE_MID_FREQ 0x1D
|
||||
#define DIST_ZONE_HIGH 0x20
|
||||
#define DIST_ZONE_LEVEL 0x21
|
||||
#define DIST_DEATH_LOW 0x2D
|
||||
#define DIST_DEATH_MID 0x2C
|
||||
#define DIST_DEATH_HIGH 0x2F
|
||||
#define DIST_DEATH_LVL 0x2E
|
||||
#define DIST_GONK_GONK 0x30
|
||||
#define DIST_GONK_SMEAR 0x27
|
||||
#define DIST_GONK_SUCK 0x26
|
||||
#define DIST_GONK_HEAVE 0x28
|
||||
#define DIST_FUZZY_FUZZ 0x1A
|
||||
#define DIST_FUZZY_VOLUME 0x1B
|
||||
#define DIST_MP_SUSTAIN 0x0D
|
||||
#define DIST_MP_TONE 0x0E
|
||||
#define DIST_MP_VOLUME 0x0F
|
||||
|
||||
enum {
|
||||
EQ_TYPE_BRIGHT = 0,
|
||||
EQ_TYPE_MIDBOOST,
|
||||
EQ_TYPE_SCOOP,
|
||||
EQ_TYPE_WARM
|
||||
};
|
||||
|
||||
enum {
|
||||
NOISEGATE_GATE = 0,
|
||||
NOISEGATE_SWELL
|
||||
};
|
||||
#define NOISEGATE_TYPE 704
|
||||
#define NOISEGATE_ON_OFF 705
|
||||
#define NOISEGATE_POSITION 12
|
||||
|
||||
/* available only in Gate mode */
|
||||
#define NOISEGATE_GATE_TRESHOLD 0x46
|
||||
#define NOISEGATE_GATE_TRESHOLD 710
|
||||
/* available only in Swell mode */
|
||||
#define NOISEGATE_SWELL_SENS 0x47
|
||||
#define NOISEGATE_SWELL_SENS 711
|
||||
/* available in both Gate and Swell modes */
|
||||
#define NOISEGATE_ATTACK 0x48
|
||||
#define NOISEGATE_RELEASE 0x49
|
||||
#define NOISEGATE_ATTN 0x4A
|
||||
#define NOISEGATE_ATTACK 712
|
||||
#define NOISEGATE_RELEASE 713
|
||||
#define NOISEGATE_ATTN 714
|
||||
|
||||
enum {
|
||||
CHORUS_TYPE_CE = 0,
|
||||
CHORUS_TYPE_DUAL,
|
||||
CHORUS_TYPE_MULTI,
|
||||
CHORUS_TYPE_FLANGER,
|
||||
CHORUS_TYPE_MXR_FLANGER,
|
||||
CHORUS_TYPE_PHASER,
|
||||
CHORUS_TYPE_VIBRATO,
|
||||
CHORUS_TYPE_ROTARY,
|
||||
CHORUS_TYPE_VIBROPAN,
|
||||
CHORUS_TYPE_TREMOLO,
|
||||
CHORUS_TYPE_PANNER,
|
||||
CHORUS_TYPE_ENVELOPE,
|
||||
CHORUS_TYPE_AUTOYA,
|
||||
CHORUS_TYPE_YAYA,
|
||||
CHORUS_TYPE_STEP_FILTER,
|
||||
CHORUS_TYPE_WHAMMY,
|
||||
CHORUS_TYPE_PITCH_SHIFT,
|
||||
CHORUS_TYPE_DETUNE,
|
||||
CHORUS_TYPE_IPS
|
||||
CHORUS_TYPE_CE = 0x37B,
|
||||
CHORUS_TYPE_DUAL = 0x379,
|
||||
CHORUS_TYPE_MULTI = 0x37a,
|
||||
CHORUS_TYPE_FLANGER = 0x37d,
|
||||
CHORUS_TYPE_MXR_FLANGER = 0x37f,
|
||||
CHORUS_TYPE_PHASER = 0x381,
|
||||
CHORUS_TYPE_VIBRATO = 0x360,
|
||||
CHORUS_TYPE_ROTARY = 0x361,
|
||||
CHORUS_TYPE_VIBROPAN = 0x38f,
|
||||
CHORUS_TYPE_TREMOLO = 0x35e,
|
||||
CHORUS_TYPE_PANNER = 0x35f,
|
||||
CHORUS_TYPE_ENVELOPE = 0x38a,
|
||||
CHORUS_TYPE_AUTOYA = 0x38b,
|
||||
CHORUS_TYPE_YAYA = 0x38c,
|
||||
CHORUS_TYPE_STEP_FILTER = 0x38d,
|
||||
CHORUS_TYPE_WHAMMY = 0x540,
|
||||
CHORUS_TYPE_PITCH_SHIFT = 0x543,
|
||||
CHORUS_TYPE_DETUNE = 0x542,
|
||||
CHORUS_TYPE_IPS = 0x541
|
||||
};
|
||||
|
||||
#define CE_CHORUS_SPEED 0x45
|
||||
#define CE_CHORUS_DEPTH 0x46
|
||||
#define CHORUSFX_TYPE 768
|
||||
#define CHORUSFX_ON_OFF 769
|
||||
#define CHORUSFX_POSITION 14
|
||||
|
||||
#define DUAL_CHORUS_SPEED 0x45
|
||||
#define DUAL_CHORUS_DEPTH 0x46
|
||||
#define DUAL_CHORUS_LEVEL 0x44
|
||||
#define DUAL_CHORUS_WAVE 0x48
|
||||
#define CE_CHORUS_SPEED 837
|
||||
#define CE_CHORUS_DEPTH 838
|
||||
|
||||
#define MULTI_CHORUS_SPEED 0x45
|
||||
#define MULTI_CHORUS_DEPTH 0x46
|
||||
#define MULTI_CHORUS_WAVE 0x48
|
||||
#define MULTI_CHORUS_LEVEL 0x44
|
||||
#define DUAL_CHORUS_SPEED 837
|
||||
#define DUAL_CHORUS_DEPTH 838
|
||||
#define DUAL_CHORUS_LEVEL 836
|
||||
#define DUAL_CHORUS_WAVE 840
|
||||
|
||||
#define FLANGER_SPEED 0x06
|
||||
#define FLANGER_DEPTH 0x07
|
||||
#define FLANGER_REGEN 0x08
|
||||
#define FLANGER_LEVEL 0x05
|
||||
#define FLANGER_WAVE 0x09
|
||||
#define MULTI_CHORUS_SPEED 837
|
||||
#define MULTI_CHORUS_DEPTH 838
|
||||
#define MULTI_CHORUS_WAVE 840
|
||||
#define MULTI_CHORUS_LEVEL 836
|
||||
|
||||
#define MXR_FLANGER_SPEED 0x06
|
||||
#define MXR_FLANGER_WIDTH 0x12
|
||||
#define MXR_FLANGER_REGEN 0x08
|
||||
#define MXR_FLANGER_MANUAL 0x15
|
||||
#define FLANGER_SPEED 902
|
||||
#define FLANGER_DEPTH 903
|
||||
#define FLANGER_REGEN 904
|
||||
#define FLANGER_LEVEL 901
|
||||
#define FLANGER_WAVE 905
|
||||
|
||||
#define PHASER_SPEED 0x42
|
||||
#define PHASER_DEPTH 0x43
|
||||
#define PHASER_REGEN 0x46
|
||||
#define PHASER_LEVEL 0x45
|
||||
#define PHASER_WAVE 0x47
|
||||
#define MXR_FLANGER_SPEED 902
|
||||
#define MXR_FLANGER_WIDTH 914
|
||||
#define MXR_FLANGER_REGEN 904
|
||||
#define MXR_FLANGER_MANUAL 917
|
||||
|
||||
#define VIBRATO_SPEED 0x04
|
||||
#define VIBRATO_DEPTH 0x05
|
||||
#define PHASER_SPEED 962
|
||||
#define PHASER_DEPTH 963
|
||||
#define PHASER_REGEN 966
|
||||
#define PHASER_LEVEL 965
|
||||
#define PHASER_WAVE 967
|
||||
|
||||
#define ROTARY_SPEED 0x42
|
||||
#define ROTARY_INTENSITY 0x44
|
||||
#define ROTARY_DOPPLER 0x46
|
||||
#define ROTARY_CROSSOVER 0x47
|
||||
#define VIBRATO_SPEED 1284
|
||||
#define VIBRATO_DEPTH 1285
|
||||
|
||||
#define VIBROPAN_SPEED 0x22
|
||||
#define VIBROPAN_DEPTH 0x23
|
||||
#define VIBROPAN_VIBRA 0x24
|
||||
#define VIBROPAN_WAVE 0x25
|
||||
#define ROTARY_SPEED 1346
|
||||
#define ROTARY_INTENSITY 1348
|
||||
#define ROTARY_DOPPLER 1350
|
||||
#define ROTARY_CROSSOVER 1351
|
||||
|
||||
#define TREMOLO_SPEED 0x04
|
||||
#define TREMOLO_DEPTH 0x03
|
||||
#define TREMOLO_WAVE 0x05
|
||||
#define VIBROPAN_SPEED 1314
|
||||
#define VIBROPAN_DEPTH 1315
|
||||
#define VIBROPAN_VIBRA 1316
|
||||
#define VIBROPAN_WAVE 1317
|
||||
|
||||
#define PANNER_SPEED 0x44
|
||||
#define PANNER_DEPTH 0x43
|
||||
#define PANNER_WAVE 0x45
|
||||
#define TREMOLO_SPEED 1156
|
||||
#define TREMOLO_DEPTH 1155
|
||||
#define TREMOLO_WAVE 1157
|
||||
|
||||
#define ENVELOPE_SENSITIVITY 0x46
|
||||
#define ENVELOPE_RANGE 0x45
|
||||
#define PANNER_SPEED 1220
|
||||
#define PANNER_DEPTH 1219
|
||||
#define PANNER_WAVE 1221
|
||||
|
||||
#define AUTOYA_SPEED 0x46
|
||||
#define AUTOYA_INTENSITY 0x4A
|
||||
#define AUTOYA_RANGE 0x4B
|
||||
#define ENVELOPE_SENSITIVITY 1606
|
||||
#define ENVELOPE_RANGE 1605
|
||||
|
||||
#define YAYA_PEDAL 0x02
|
||||
#define YAYA_INTENSITY 0x09
|
||||
#define YAYA_RANGE 0x0A
|
||||
#define AUTOYA_SPEED 1478
|
||||
#define AUTOYA_INTENSITY 1482
|
||||
#define AUTOYA_RANGE 1483
|
||||
|
||||
#define STEP_FILTER_SPEED 0x42
|
||||
#define STEP_FILTER_INTENSITY 0x43
|
||||
#define YAYA_PEDAL 1410
|
||||
#define YAYA_INTENSITY 1417
|
||||
#define YAYA_RANGE 1418
|
||||
|
||||
#define WHAMMY_AMOUNT 0x05
|
||||
#define WHAMMY_PEDAL 0x03
|
||||
#define WHAMMY_MIX 0x04
|
||||
#define STEP_FILTER_SPEED 3010
|
||||
#define STEP_FILTER_INTENSITY 3011
|
||||
|
||||
#define PITCH_AMOUNT 0x42
|
||||
#define PITCH_MIX 0x51
|
||||
#define WHAMMY_AMOUNT 1797
|
||||
#define WHAMMY_PEDAL 1795
|
||||
#define WHAMMY_MIX 1796
|
||||
|
||||
#define DETUNE_AMOUNT 0x04
|
||||
#define DETUNE_LEVEL 0x03
|
||||
#define PITCH_AMOUNT 1730
|
||||
#define PITCH_MIX 1745
|
||||
|
||||
#define IPS_SHIFT_AMOUNT 0x42
|
||||
#define IPS_KEY 0x44
|
||||
#define IPS_SCALE 0x43
|
||||
#define IPS_LEVEL 0x45
|
||||
#define DETUNE_AMOUNT 1668
|
||||
#define DETUNE_LEVEL 1667
|
||||
|
||||
#define IPS_SHIFT_AMOUNT 2754
|
||||
#define IPS_KEY 2756
|
||||
#define IPS_SCALE 2755
|
||||
#define IPS_LEVEL 2757
|
||||
|
||||
/* DUAL_CHORUS_WAVE, MULTI_CHORUS_WAVE, FLANGER_WAVE, PHASER_WAVE,
|
||||
VIBROPAN_WAVE, TREMOLO_WAVE, PANNER_WAVE valid values */
|
||||
@@ -279,118 +361,143 @@ enum {
|
||||
#define IPS_HMINO 0x05
|
||||
|
||||
enum {
|
||||
DELAY_TYPE_ANALOG = 0,
|
||||
DELAY_TYPE_DIGITAL,
|
||||
DELAY_TYPE_MODULATED,
|
||||
DELAY_TYPE_PONG,
|
||||
DELAY_TYPE_TAPE
|
||||
DELAY_TYPE_ANALOG = 1046,
|
||||
DELAY_TYPE_DIGITAL = 1045,
|
||||
DELAY_TYPE_MODULATED = 1047,
|
||||
DELAY_TYPE_PONG = 1048,
|
||||
DELAY_TYPE_TAPE = 1049
|
||||
};
|
||||
|
||||
#define ANALOG_LEVEL 0x44
|
||||
#define ANALOG_REPEATS 0x47
|
||||
#define DELAY_TYPE 1856
|
||||
#define DELAY_ON_OFF 1857
|
||||
#define DELAY_POSITION 15
|
||||
|
||||
#define DIGITAL_LEVEL 0x44
|
||||
#define DIGITAL_REPEATS 0x47
|
||||
#define DIGITAL_DUCKER_THRESH 0x61
|
||||
#define DIGITAL_DUCKER_LEVEL 0x62
|
||||
#define DELAY_TIME 1888
|
||||
|
||||
#define MODULATED_LEVEL 0x44
|
||||
#define MODULATED_REPEATS 0x47
|
||||
#define MODULATED_DEPTH 0x51
|
||||
#define ANALOG_LEVEL 1860
|
||||
#define ANALOG_REPEATS 1863
|
||||
|
||||
#define PONG_LEVEL 0x44
|
||||
#define PONG_REPEATS 0x47
|
||||
#define PONG_DUCKER_THRESH 0x61
|
||||
#define PONG_DUCKER_LEVEL 0x62
|
||||
#define DIGITAL_LEVEL 1860
|
||||
#define DIGITAL_REPEATS 1863
|
||||
#define DIGITAL_DUCKER_THRESH 1889
|
||||
#define DIGITAL_DUCKER_LEVEL 1890
|
||||
|
||||
#define TAPE_LEVEL 0x44
|
||||
#define TAPE_REPEATS 0x47
|
||||
#define TAPE_WOW 0x63
|
||||
#define TAPE_FLUTTER 0x64
|
||||
#define MODULATED_LEVEL 1860
|
||||
#define MODULATED_REPEATS 1863
|
||||
#define MODULATED_DEPTH 1873
|
||||
|
||||
#define PONG_LEVEL 1860
|
||||
#define PONG_REPEATS 1863
|
||||
#define PONG_DUCKER_THRESH 1889
|
||||
#define PONG_DUCKER_LEVEL 1890
|
||||
|
||||
#define TAPE_LEVEL 1860
|
||||
#define TAPE_REPEATS 1863
|
||||
#define TAPE_WOW 1891
|
||||
#define TAPE_FLUTTER 1892
|
||||
|
||||
enum {
|
||||
REVERB_TYPE_TWIN = 0,
|
||||
REVERB_TYPE_LEX_AMBIENCE,
|
||||
REVERB_TYPE_LEX_STUDIO,
|
||||
REVERB_TYPE_LEX_ROOM,
|
||||
REVERB_TYPE_LEX_HALL,
|
||||
REVERB_TYPE_EMT240_PLATE
|
||||
REVERB_TYPE_TWIN = 1146,
|
||||
REVERB_TYPE_LEX_AMBIENCE = 1150,
|
||||
REVERB_TYPE_LEX_STUDIO = 1149,
|
||||
REVERB_TYPE_LEX_ROOM = 1148,
|
||||
REVERB_TYPE_LEX_HALL = 1147,
|
||||
REVERB_TYPE_EMT240_PLATE = 1151
|
||||
};
|
||||
|
||||
#define TWIN_REVERB 0x05
|
||||
#define REVERB_TYPE 1920
|
||||
#define REVERB_ON_OFF 1921
|
||||
#define REVERB_POSITION 16
|
||||
|
||||
#define LEX_AMBIENCE_PREDELAY 0x02
|
||||
#define LEX_AMBIENCE_DECAY 0x07
|
||||
#define LEX_AMBIENCE_LIVELINESS 0x0D
|
||||
#define LEX_AMBIENCE_LEVEL 0x05
|
||||
#define TWIN_REVERB 1925
|
||||
|
||||
#define LEX_STUDIO_PREDELAY 0x02
|
||||
#define LEX_STUDIO_DECAY 0x07
|
||||
#define LEX_STUDIO_LIVELINESS 0x0D
|
||||
#define LEX_STUDIO_LEVEL 0x05
|
||||
#define LEX_AMBIENCE_PREDELAY 1922
|
||||
#define LEX_AMBIENCE_DECAY 1927
|
||||
#define LEX_AMBIENCE_LIVELINESS 1933
|
||||
#define LEX_AMBIENCE_LEVEL 1925
|
||||
|
||||
#define LEX_ROOM_PREDELAY 0x02
|
||||
#define LEX_ROOM_DECAY 0x07
|
||||
#define LEX_ROOM_LIVELINESS 0x0D
|
||||
#define LEX_ROOM_LEVEL 0x05
|
||||
#define LEX_STUDIO_PREDELAY 1922
|
||||
#define LEX_STUDIO_DECAY 1927
|
||||
#define LEX_STUDIO_LIVELINESS 1933
|
||||
#define LEX_STUDIO_LEVEL 1925
|
||||
|
||||
#define LEX_HALL_PREDELAY 0x02
|
||||
#define LEX_HALL_DECAY 0x07
|
||||
#define LEX_HALL_LIVELINESS 0x0D
|
||||
#define LEX_HALL_LEVEL 0x05
|
||||
#define LEX_ROOM_PREDELAY 1922
|
||||
#define LEX_ROOM_DECAY 1927
|
||||
#define LEX_ROOM_LIVELINESS 1933
|
||||
#define LEX_ROOM_LEVEL 1925
|
||||
|
||||
#define EMT240_PLATE_PREDELAY 0x02
|
||||
#define EMT240_PLATE_DECAY 0x07
|
||||
#define EMT240_PLATE_LIVELINESS 0x0D
|
||||
#define EMT240_PLATE_LEVEL 0x05
|
||||
#define LEX_HALL_PREDELAY 1922
|
||||
#define LEX_HALL_DECAY 1927
|
||||
#define LEX_HALL_LIVELINESS 1933
|
||||
#define LEX_HALL_LEVEL 1925
|
||||
|
||||
void set_wah_min(struct usb_dev_handle *handle, int level);
|
||||
void set_wah_max(struct usb_dev_handle *handle, int level);
|
||||
void set_wah_level(struct usb_dev_handle *handle, int level);
|
||||
void set_wah_type(struct usb_dev_handle *handle, int type);
|
||||
void set_wah_on_off(struct usb_dev_handle *handle, gboolean val);
|
||||
void set_comp_sustain(struct usb_dev_handle *handle, int level);
|
||||
void set_comp_tone(struct usb_dev_handle *handle, int level);
|
||||
void set_comp_attack(struct usb_dev_handle *handle, int level);
|
||||
void set_comp_level(struct usb_dev_handle *handle, int level);
|
||||
void set_comp_type(struct usb_dev_handle *handle, int type);
|
||||
void set_comp_on_off(struct usb_dev_handle *handle, gboolean val);
|
||||
void switch_user_preset(struct usb_dev_handle *handle, int x);
|
||||
void switch_system_preset(struct usb_dev_handle *handle, int x);
|
||||
void set_pickup_type(struct usb_dev_handle *handle, int type);
|
||||
void set_pickup_on_off(struct usb_dev_handle *handle, gboolean val);
|
||||
void set_dist_type(struct usb_dev_handle *handle, int type);
|
||||
void set_dist_option(struct usb_dev_handle *handle, char option, int value);
|
||||
void set_dist_on_off(struct usb_dev_handle *handle, gboolean val);
|
||||
void set_preset_level(struct usb_dev_handle *handle, int level);
|
||||
void set_eq_type(struct usb_dev_handle *handle, int type);
|
||||
void set_eq_gain(struct usb_dev_handle *handle, int x);
|
||||
void set_eq_level(struct usb_dev_handle *handle, int x);
|
||||
void set_eq_bass(struct usb_dev_handle *handle, int x);
|
||||
void set_eq_mid(struct usb_dev_handle *handle, int x);
|
||||
void set_eq_mid_hz(struct usb_dev_handle *handle, int x);
|
||||
void set_eq_treble(struct usb_dev_handle *handle, int x);
|
||||
void set_eq_treb_hz(struct usb_dev_handle *handle, int x);
|
||||
void set_eq_on_off(struct usb_dev_handle *handle, gboolean val);
|
||||
void set_noisegate_type(struct usb_dev_handle *handle, int type);
|
||||
void set_gate_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_noisegate_on_off(struct usb_dev_handle *handle, gboolean val);
|
||||
void set_chorusfx_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_flanger_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_vibrato_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_tremolo_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_envelope_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_ya_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_filter_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_whammy_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_pitch_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_ips_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_chorusfx_type(struct usb_dev_handle *handle, int type);
|
||||
void set_chorusfx_on_off(struct usb_dev_handle *handle, gboolean val);
|
||||
void set_delay_time(struct usb_dev_handle *handle, int x);
|
||||
void set_delay_type(struct usb_dev_handle *handle, int type);
|
||||
void set_delay_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_delay_on_off(struct usb_dev_handle *handle, gboolean val);
|
||||
void set_reverb_option(struct usb_dev_handle *handle, char option, int x);
|
||||
void set_reverb_type(struct usb_dev_handle *handle, int type);
|
||||
void set_reverb_on_off(struct usb_dev_handle *handle, gboolean val);
|
||||
#define EMT240_PLATE_PREDELAY 1922
|
||||
#define EMT240_PLATE_DECAY 1927
|
||||
#define EMT240_PLATE_LIVELINESS 1933
|
||||
#define EMT240_PLATE_LEVEL 1925
|
||||
|
||||
enum {
|
||||
EXP_TYPE_NONE = 0,
|
||||
EXP_TYPE_PICKUP_ENABLE = 131137,
|
||||
EXP_TYPE_PIKCUP_TYPE = 131136,
|
||||
EXP_TYPE_COMP_ENABLE = 262337,
|
||||
EXP_TYPE_COMP_SUST = 262352,
|
||||
EXP_TYPE_COMP_TONE = 262353,
|
||||
EXP_TYPE_COMP_LEVEL = 262354,
|
||||
EXP_TYPE_COMP_ATTACK = 262355,
|
||||
EXP_TYPE_DIST_ENABLE = 395649,
|
||||
EXP_TYPE_DIST_DISTORTION = 395653,
|
||||
EXP_TYPE_DIST_FILTER = 395654,
|
||||
EXP_TYPE_DIST_VOLUME = 395655,
|
||||
EXP_TYPE_AMP_ENABLE = 524553,
|
||||
EXP_TYPE_AMP_GAIN = 526785,
|
||||
EXP_TYPE_AMP_LEVEL = 526786,
|
||||
EXP_TYPE_EQ_ENABLE = 1576076,
|
||||
EXP_TYPE_EQ_BASS = 1576067,
|
||||
EXP_TYPE_EQ_MID = 1576068,
|
||||
EXP_TYPE_EQ_TREB = 1576069,
|
||||
EXP_TYPE_GATE_ENABLE = 787137,
|
||||
EXP_TYPE_GATE_THRESHOLD = 787142,
|
||||
EXP_TYPE_GATE_ATTACK = 787144,
|
||||
EXP_TYPE_GATE_RELEASE = 787145,
|
||||
EXP_TYPE_GATE_ATTN = 787146,
|
||||
EXP_TYPE_CHORUSFX_ENABLE = 918273,
|
||||
EXP_TYPE_PHASER_SPEED = 918466,
|
||||
EXP_TYPE_PHASER_DEPTH = 918467,
|
||||
EXP_TYPE_PHASER_REGEN = 918470,
|
||||
EXP_TYPE_PHASER_WAVEFORM = 918471,
|
||||
EXP_TYPE_PHASER_LEVEL = 918469,
|
||||
EXP_TYPE_DELAY_ENABLE = 984897,
|
||||
EXP_TYPE_DELAY_TIME = 984928,
|
||||
EXP_TYPE_DELAY_REPEATS = 984903,
|
||||
EXP_TYPE_DELAY_LEVEL = 984900,
|
||||
EXP_TYPE_DELAY_DUCK_THRESH = 984929,
|
||||
EXP_TYPE_DELAY_DUCK_LEVEL = 984930,
|
||||
EXP_TYPE_REVERB_ENABLE = 1050497,
|
||||
EXP_TYPE_REVERB_LEVEL = 1050501,
|
||||
EXP_TYPE_VOLUME_PRE_FX = 854594,
|
||||
EXP_TYPE_VOLUME_POST_FX = 1116738
|
||||
};
|
||||
|
||||
#define EXP_TYPE 8194
|
||||
#define EXP_POSITION 19
|
||||
|
||||
#define EXP_MIN 8195
|
||||
#define EXP_MAX 8196
|
||||
|
||||
#define USB_POSITION 0
|
||||
#define USB_AUDIO_PLAYBACK_MIX 12297
|
||||
#define USB_AUDIO_LEVEL 12307
|
||||
|
||||
typedef enum {
|
||||
PRESETS_SYSTEM = 0,
|
||||
PRESETS_USER = 1
|
||||
} PresetBank;
|
||||
|
||||
void set_option(guint id, guint position, guint value);
|
||||
void switch_preset(guint bank, guint x);
|
||||
void store_preset_name(int x, const gchar *name);
|
||||
void set_preset_level(int level);
|
||||
GStrv query_preset_names(PresetBank bank);
|
||||
|
||||
#endif /* GDIGI_H */
|
||||
|
||||
5
gui.h
5
gui.h
@@ -14,4 +14,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses>.
|
||||
*/
|
||||
|
||||
#ifndef GDIGI_GUI_H
|
||||
#define GDIGI_GUI_H
|
||||
|
||||
void create_window();
|
||||
|
||||
#endif /* GDIGI_GUI_H */
|
||||
|
||||
181
preset.c
Normal file
181
preset.c
Normal file
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Tomasz Moń <desowin@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; under version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses>.
|
||||
*/
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include <expat.h>
|
||||
#include <string.h>
|
||||
#include "preset.h"
|
||||
|
||||
enum {
|
||||
PARSER_TYPE_NOT_SET = -1,
|
||||
PARSER_TYPE_PRESET_NAME = 0,
|
||||
PARSER_TYPE_PARAM_ID,
|
||||
PARSER_TYPE_PARAM_POSITION,
|
||||
PARSER_TYPE_PARAM_VALUE,
|
||||
PARSER_TYPE_PARAM_NAME,
|
||||
PARSER_TYPE_PARAM_TEXT
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int depth;
|
||||
int id;
|
||||
Preset *preset;
|
||||
} AppData;
|
||||
|
||||
static void XMLCALL start(void *data, const char *el, const char **attr) {
|
||||
AppData *ad = (AppData *) data;
|
||||
|
||||
ad->id = PARSER_TYPE_NOT_SET;
|
||||
if (g_strcmp0(el, "Name") == 0) {
|
||||
if (ad->depth == 1) {
|
||||
ad->id = PARSER_TYPE_PRESET_NAME;
|
||||
} else if (ad->depth == 3) {
|
||||
ad->id = PARSER_TYPE_PARAM_NAME;
|
||||
}
|
||||
}
|
||||
|
||||
if (g_strcmp0(el, "Params") == 0) {
|
||||
if (ad->preset->params != NULL)
|
||||
g_message("Params aleady exists!");
|
||||
} else if (g_strcmp0(el, "Param") == 0) {
|
||||
SettingParam *param = (SettingParam *)g_malloc(sizeof(SettingParam));
|
||||
param->id = -1;
|
||||
param->position = -1;
|
||||
param->value = -1;
|
||||
ad->preset->params = g_list_prepend(ad->preset->params, param);
|
||||
} else if (g_strcmp0(el, "ID") == 0) {
|
||||
ad->id = PARSER_TYPE_PARAM_ID;
|
||||
} else if (g_strcmp0(el, "Position") == 0) {
|
||||
ad->id = PARSER_TYPE_PARAM_POSITION;
|
||||
} else if (g_strcmp0(el, "Value") == 0) {
|
||||
ad->id = PARSER_TYPE_PARAM_VALUE;
|
||||
} else if (g_strcmp0(el, "Text") == 0) {
|
||||
ad->id = PARSER_TYPE_PARAM_TEXT;
|
||||
}
|
||||
|
||||
ad->depth++;
|
||||
}
|
||||
|
||||
static void XMLCALL end(void *data, const char *el) {
|
||||
AppData *ad = (AppData *) data;
|
||||
ad->depth--;
|
||||
ad->id = PARSER_TYPE_NOT_SET;
|
||||
}
|
||||
|
||||
static void XMLCALL text_cb(void *data, const char* text, int len)
|
||||
{
|
||||
AppData *ad = (AppData *) data;
|
||||
|
||||
if ((ad == NULL) || (ad->preset == NULL))
|
||||
return;
|
||||
|
||||
if (ad->id == PARSER_TYPE_PRESET_NAME) {
|
||||
if (ad->preset->name != NULL)
|
||||
g_free(ad->preset->name);
|
||||
ad->preset->name = g_strndup(text, len);
|
||||
}
|
||||
|
||||
if (ad->preset->params == NULL)
|
||||
return;
|
||||
|
||||
SettingParam *param = (SettingParam *) ad->preset->params->data;
|
||||
if (param == NULL)
|
||||
return;
|
||||
|
||||
gchar *value = g_strndup(text, len);
|
||||
|
||||
switch (ad->id) {
|
||||
case PARSER_TYPE_PARAM_ID:
|
||||
param->id = atoi(value);
|
||||
break;
|
||||
case PARSER_TYPE_PARAM_POSITION:
|
||||
param->position = atoi(value);
|
||||
break;
|
||||
case PARSER_TYPE_PARAM_VALUE:
|
||||
param->value = atoi(value);
|
||||
break;
|
||||
}
|
||||
|
||||
g_free(value);
|
||||
}
|
||||
|
||||
/*
|
||||
Parses preset file
|
||||
On success returns Preset which must be freed using preset_free, or NULL on error
|
||||
*/
|
||||
Preset *create_preset_from_xml_file(gchar *filename)
|
||||
{
|
||||
GFile *file;
|
||||
GError *error = NULL;
|
||||
gchar *contents;
|
||||
|
||||
file = g_file_new_for_path(filename);
|
||||
if (g_file_get_contents(filename, &contents, NULL, &error) == FALSE) {
|
||||
g_message("Failed to get %s contents: %s", filename, error->message);
|
||||
g_error_free(error);
|
||||
g_object_unref(file);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
AppData *ad = (AppData *) g_malloc(sizeof(AppData));
|
||||
ad->depth = 0;
|
||||
ad->preset = g_malloc(sizeof(Preset));
|
||||
ad->preset->name = NULL;
|
||||
ad->preset->params = NULL;
|
||||
ad->id = PARSER_TYPE_NOT_SET;
|
||||
|
||||
XML_Parser p;
|
||||
p = XML_ParserCreate(NULL);
|
||||
XML_SetUserData(p, (void *) ad);
|
||||
XML_SetElementHandler(p, start, end);
|
||||
XML_SetCharacterDataHandler(p, text_cb);
|
||||
|
||||
if (XML_Parse(p, contents, strlen(contents), XML_TRUE) != XML_STATUS_OK) {
|
||||
g_warning("Parse error at line %d:\n%s",
|
||||
(int)XML_GetCurrentLineNumber(p),
|
||||
XML_ErrorString(XML_GetErrorCode(p)));
|
||||
preset_free(ad->preset);
|
||||
g_free(ad);
|
||||
g_free(contents);
|
||||
g_object_unref(file);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Preset *preset = ad->preset;
|
||||
preset->params = g_list_reverse(preset->params);
|
||||
|
||||
XML_ParserFree(p);
|
||||
g_free(ad);
|
||||
|
||||
g_free(contents);
|
||||
g_object_unref(file);
|
||||
return preset;
|
||||
}
|
||||
|
||||
void preset_free(Preset *preset)
|
||||
{
|
||||
g_return_if_fail(preset != NULL);
|
||||
|
||||
if (preset->params != NULL) {
|
||||
g_list_foreach(preset->params, (GFunc)g_free, NULL);
|
||||
g_list_free(preset->params);
|
||||
}
|
||||
|
||||
if (preset->name != NULL)
|
||||
g_free(preset->name);
|
||||
|
||||
g_free(preset);
|
||||
}
|
||||
36
preset.h
Normal file
36
preset.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Tomasz Moń <desowin@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; under version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses>.
|
||||
*/
|
||||
|
||||
#ifndef GDIGI_PRESET_H
|
||||
#define GDIGI_PRESET_H
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
typedef struct {
|
||||
int id;
|
||||
int position;
|
||||
int value;
|
||||
} SettingParam;
|
||||
|
||||
typedef struct {
|
||||
gchar *name;
|
||||
GList *params;
|
||||
} Preset;
|
||||
|
||||
Preset *create_preset_from_xml_file(gchar *filename);
|
||||
void preset_free(Preset *preset);
|
||||
|
||||
#endif /* GDIGI_PRESET_H */
|
||||
29
tests.h
29
tests.h
@@ -14,16 +14,23 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses>.
|
||||
*/
|
||||
|
||||
#ifndef GDIGI_TESTS_H
|
||||
#define GDIGI_TESTS_H
|
||||
|
||||
#include "gdigi.h"
|
||||
|
||||
void test_wah(struct usb_dev_handle *handle);
|
||||
void test_compressor(struct usb_dev_handle *handle);
|
||||
void test_dist(struct usb_dev_handle *handle);
|
||||
void test_presets(struct usb_dev_handle *handle);
|
||||
void test_pickups(struct usb_dev_handle *handle);
|
||||
void test_eq(struct usb_dev_handle *handle);
|
||||
void test_noisegate(struct usb_dev_handle *handle);
|
||||
void test_chorusfx(struct usb_dev_handle *handle);
|
||||
void test_delay(struct usb_dev_handle *handle);
|
||||
void test_reverb(struct usb_dev_handle *handle);
|
||||
void test_all(struct usb_dev_handle *handle);
|
||||
void test_wah();
|
||||
void test_compressor();
|
||||
void test_dist();
|
||||
void test_presets();
|
||||
void test_pickups();
|
||||
void test_eq();
|
||||
void test_noisegate();
|
||||
void test_chorusfx();
|
||||
void test_delay();
|
||||
void test_reverb();
|
||||
void test_exp();
|
||||
void test_usb();
|
||||
void test_all();
|
||||
|
||||
#endif /* GDIGI_TESTS_H */
|
||||
|
||||
Reference in New Issue
Block a user