Imported Upstream version 0.11.1
Ross Gammon
8 years ago
0 | guitarix (0.09.0SVN) unstable; urgency=low | |
1 | ||
2 | * SVN HEAD | |
3 | ||
4 | -- brummer <brummer-@web.de> Fri, 14 May 2010 17:18:15 +0200 | |
0 | guitarix (0.11.1) unstable; urgency=low | |
1 | * fix Bug Echo/Chorus/Delay/Slooper dont work | |
2 | * add pre/post processing switch to all mono Effects | |
3 | ||
4 | -- brummer <brummer-@web.de> Sun, 24 Aug 2010 15:47:15 +0200 | |
5 | ||
6 | guitarix (0.11.0) unstable; urgency=low | |
7 | * new version of the impulse response parameter editor. You can | |
8 | now graphically define a gain line to be applied to the IR data, | |
9 | e.g. emphasize a part of the early reflections or damping the | |
10 | reverb tail to make it fit to your guitar sound. | |
11 | * the multi-line distortion effect now has 4 frequency bands and | |
12 | is better optimized | |
13 | * fix regression from version 0.10.0: now the default preset file is | |
14 | created again if it doesn't exist (e.g. in new installations). | |
15 | ||
16 | -- Andreas Degert <andreas.degert@googlemail.com> Tue, 03 Aug 2010 22:13:50 +0200 | |
17 | ||
18 | guitarix (0.10.0) unstable; urgency=low | |
19 | ||
20 | * add tonestack models | |
21 | * add 2. amp model | |
22 | * add cabinet impulse response modul | |
23 | * add Patch Info widget | |
24 | * add Preset File Load/Export option | |
25 | * add simple looper | |
26 | * add Oscilloscope and tuner state to main settings | |
27 | * selectable distortion model (multi/single line) | |
28 | * selectable EQ model (fixed/scalable freq) | |
29 | * free mem when not used (delay lines) | |
30 | * reworked Gui | |
31 | * fix varios bugs | |
32 | ||
33 | -- brummer <brummer-@web.de> Sun, 11 Jul 2010 07:18:15 +0200 | |
34 | ||
35 | guitarix (0.09.0) unstable; urgency=low | |
36 | ||
37 | * make distortion a multiband distortion | |
38 | * fix bug in resample IR-files | |
39 | * resample IR-files now on-the-fly | |
40 | * add insert point ports to the effect chain | |
41 | * add --optimization flag for configure the build | |
42 | * switch to double precision instead of single precision | |
43 | * fix bug in reconfigure convolver when preset change | |
44 | * add patch from Peder Hedlund, build against gtk-2.12.9 and gcc-4.3.1 | |
45 | * add faust 0.9.24 to the "good_faust_versions" | |
46 | ||
47 | -- brummer <brummer-@web.de> Sun, 06 Jun 2010 17:18:15 +0200 | |
5 | 48 | |
6 | 49 | guitarix (0.08.0) unstable; urgency=low |
7 | 50 |
0 | guitarix (0.09.0SVN) unstable; urgency=low | |
1 | ||
2 | * SVN HEAD | |
3 | ||
4 | -- brummer <brummer-@web.de> Fri, 14 May 2010 17:18:15 +0200 | |
5 | ||
6 | guitarix (0.08.0) unstable; urgency=low | |
7 | ||
8 | * new portmap window | |
9 | * add Quad Filter | |
10 | * add Moog Filter | |
11 | * add Flanger | |
12 | * add new post processing tube3 | |
13 | * add two 10 band parametric EQ's | |
14 | * add oversample mode selector | |
15 | * fix some bugs in midi out | |
16 | * reworked tuner interface (show frequency(hz)) | |
17 | * add new configure options (see ./waf --help form more info) | |
18 | ||
19 | -- Andreas Degert <andreas.degert@googlemail.com> Fri, 14 May 2010 15:18:15 +0200 | |
20 | ||
21 | guitarix (0.07.1) unstable; urgency=low | |
22 | ||
23 | * version check of ~/.guitarix was commented out | |
24 | ||
25 | -- Andreas Degert <andreas.degert@googlemail.com> Tue, 29 Mar 2010 22:13:50 +0200 | |
26 | ||
27 | guitarix (0.07.0) unstable; urgency=low | |
28 | ||
29 | * nearly complete reworked source by Andreas Degert | |
30 | * amp and effect units based direct on faust expressions | |
31 | * all faust sources included | |
32 | * new accumulated tuner unit with new interface (analogue Style needle meter) | |
33 | * Midi controller connections could saved with in presets and/or general | |
34 | * a editable Midi controller map is available | |
35 | * new human readable preset style | |
36 | * knobs could be used like sliders (press ctrl + mouse-button | |
37 | and move the mouse horizontal, leave the ctrl and hold mouse-button | |
38 | for fine tune), or like real knobs (turn them around) | |
39 | * convolution unit based on zita-convolver is now integrated in the engine | |
40 | * presets could change with Midi Program Messages | |
41 | * I'm sure I have some things forgotten to mention here. | |
42 | ||
43 | -- Andreas Degert <andreas.degert@googlemail.com> Tue, 28 Mar 2010 21:09:25 +0200 | |
44 | ||
45 | guitarix (0.05.4-1) unstable; urgency=low | |
46 | * performace boost by remove float to int casts from engine | |
47 | * reorder GUI | |
48 | ||
49 | -- brummer <brummer-@web.de> Mon, 02 Dec 2009 16:20:56 +0200 | |
50 | ||
51 | guitarix (0.05.3-1) unstable; urgency=low | |
52 | * quick update to cover renaming of jconv to jconvolver | |
53 | ||
54 | -- brummer <brummer-@web.de> Mon, 02 Dec 2009 16:20:56 +0200 | |
55 | ||
56 | guitarix (0.05.2-1) unstable; urgency=low | |
57 | * varios improvements | |
58 | ||
59 | -- brummer <brummer-@web.de> Mon, 30 Nov 2009 13:20:56 +0200 | |
60 | ||
61 | guitarix (0.05.1-1) unstable; urgency=low | |
62 | * varios improvements | |
63 | ||
64 | -- brummer <brummer-@web.de> Mon, 26 Oct 2009 08:24:42 +0200 | |
65 | ||
66 | guitarix (0.05.0-1) unstable; urgency=low | |
67 | * add keyboard shortcuts | |
68 | * new code structure by James | |
69 | * impruved skin handling | |
70 | * add middle tone control | |
71 | * reworked audio engine | |
72 | * add bypass mode | |
73 | * add logging window | |
74 | * add engine state widget | |
75 | ||
76 | -- brummer <brummer-@web.de> Mon, 27 Jul 2009 08:24:42 +0200 | |
77 | ||
78 | guitarix (0.04.6-1) unstable; urgency=low | |
79 | * switch to waf build system | |
80 | * use boost libary for cmd commands | |
81 | * varios code cleanups by James | |
82 | * new tube model | |
83 | * add scrollwheel controlls | |
84 | ||
85 | -- brummer <brummer-@web.de> Wed, 24 Jun 2009 14:24:42 +0200 | |
86 | ||
87 | guitarix (0.04.5-1) unstable; urgency=low | |
88 | * fix wrong porthandling in dsp | |
89 | * add latency menu by James Warden | |
90 | * impruve midi out | |
91 | ||
92 | -- brummer <brummer-@web.de> Thu, 26 May 2009 14:24:42 +0200 | |
93 | ||
94 | guitarix (0.04.4-1) unstable; urgency=low | |
95 | * switch back to use portbuffer for midi output | |
96 | * add some audio effect's | |
97 | * impruve tuner and midi out | |
98 | * add fix's for makefile/readme/changlog submit by Orcan Ogetbil | |
99 | ||
100 | -- brummer <brummer-@web.de> Wed, 21 May 2009 14:24:42 +0200 | |
101 | ||
102 | guitarix (0.04.3-1) unstable; urgency=low | |
103 | * fix denormals | |
104 | ||
105 | -- brummer <brummer-@web.de> Wed, 06 Mar 2009 07:24:42 +0200 | |
106 | ||
107 | guitarix (0.04.2-1) unstable; urgency=low | |
108 | * bug fix release, fix wrong porthandling | |
109 | * add anti aliase unit | |
110 | ||
111 | -- brummer <brummer-@web.de> Tue, 05 Mar 2009 07:24:42 +0200 | |
112 | ||
113 | guitarix (0.04.1-1) unstable; urgency=low | |
114 | * bug fix (upload the wrong source, sorry) | |
115 | ||
116 | -- brummer <brummer-@web.de> Thu, 28 Mar 2009 07:24:42 +0200 | |
117 | ||
118 | guitarix (0.04.0-1) unstable; urgency=low | |
119 | * add more Oscilloscope modes | |
120 | * fix bug port_registration with jackdmp | |
121 | * set jack_midi_port stable | |
122 | * improve UI | |
123 | ||
124 | -- brummer <brummer-@web.de> Thu, 23 Mar 2009 17:24:42 +0200 | |
125 | ||
126 | guitarix (0.03.9-1) unstable; urgency=low | |
127 | * add Oscilloscope like wave view widget | |
128 | * fix bug in jconv gain settings | |
129 | * set jack_midi_port to be temporarly (off by default) | |
130 | * remove sse and fast-math flags from makefile | |
131 | ||
132 | -- brummer <brummer-@web.de> Thu, 26 Mar 2009 18:24:42 +0200 | |
133 | ||
134 | guitarix (0.03.8-1) unstable; urgency=low | |
135 | * add wave view and select samples widget to the jconv settings | |
136 | * some bugfixe's, some cleanup's | |
137 | * add auto gain correction to Overdrive | |
138 | ||
139 | -- brummer <brummer-@web.de> Wed, 18 Mar 2009 11:24:42 +0200 | |
140 | ||
141 | guitarix (0.03.7-svn-1) unstable; urgency=low | |
142 | * make single ladspa plugins from the inbuild effects | |
143 | * new sorce structure | |
144 | ||
145 | -- brummer <brummer-@web.de> Fri, 06 Mar 2009 11:24:42 +0200 | |
146 | ||
147 | guitarix (0.03.7-1) unstable; urgency=low | |
148 | * rework distortion | |
149 | * bugfix in adjustment call for entry's, reportet by Aurélien Leblond | |
150 | ||
151 | -- brummer <brummer-@web.de> Thu, 05 Feb 2009 11:24:42 +0200 | |
152 | ||
153 | guitarix (0.03.6-1) unstable; urgency=low | |
154 | * add overdrive | |
155 | * make GUI smaler | |
156 | ||
157 | -- brummer <brummer-@web.de> Thu, 05 Feb 2009 11:24:42 +0200 | |
158 | ||
159 | guitarix (0.03.5-1) unstable; urgency=low | |
160 | * change knob pointer | |
161 | ||
162 | -- brummer <brummer-@web.de> Wed, 04 Feb 2009 17:24:42 +0200 | |
163 | ||
164 | guitarix (0.03.4-1) unstable; urgency=low | |
165 | * use knobs, switchs and graphicaly sliders for the interface | |
166 | * set black style as default | |
167 | * make effekts modular | |
168 | * new preamp model | |
169 | ||
170 | -- brummer <brummer-@web.de> Wed, 04 Feb 2009 14:24:42 +0200 | |
171 | ||
172 | guitarix (0.03.3-1) unstable; urgency=low | |
173 | * add resampler for ir.wav files | |
174 | * autoremove white space in ir.wav file names | |
175 | * protected advanced setting widgets for destroy call from window manager | |
176 | * add experimental tuner | |
177 | * add jack midi out port | |
178 | * add pitch tracker/beatdetector to midi converter | |
179 | * add midi controlls for velocity, channel choose, program choose, okatve switch and sensity | |
180 | * add more midi out channels (3), clean up the processing | |
181 | * add controll interface for pitch tracker/beatdetector | |
182 | * add extra tread for midi processing | |
183 | * add system tray icon with menu | |
184 | * add high cpu load sys tray warning and midi send notify | |
185 | * clean up midi process | |
186 | * set midi process to a lower rt level (-20) when run in realtime | |
187 | * add compressor | |
188 | * add midi controlles for volume and auto pichweel | |
189 | ||
190 | ||
191 | -- brummer <brummer-@web.de> Wed, 14 Dec 2009 14:24:42 +0200 | |
192 | ||
193 | guitarix (0.03.a-1) unstable; urgency=low | |
194 | * bug fix for jconv wet/dry slider | |
195 | * bug fix for jconv gain settings | |
196 | ||
197 | -- brummer <brummer-@web.de> Thu, 03 Dec 2008 16:24:42 +0200 | |
198 | ||
199 | ||
200 | guitarix (0.03.0-1) unstable; urgency=low | |
201 | * add advanced setting widgets to distortion, freeverb, ImpulseResponse and Crybaby | |
202 | * rework the jconv settings window | |
203 | * split code | |
204 | ||
205 | -- brummer <brummer-@web.de> Sun, 23 Nov 2008 16:24:42 +0200 | |
206 | ||
207 | guitarix (0.02.9a-1) unstable; urgency=low | |
208 | * bugfix for the run jconv handling | |
209 | * bugfix a typo in the Makefile for the LADSPAPATH | |
210 | * clean code | |
211 | ||
212 | -- brummer <brummer-@web.de> Mon, 10 Nov 2008 13:55:42 +0200 | |
213 | ||
214 | ||
215 | guitarix (0.02.9-1) unstable; urgency=low | |
216 | * add a wet/dry fader for jconv | |
217 | * clean code | |
218 | ||
219 | -- brummer <brummer-@web.de> Sat, 08 Nov 2008 13:55:42 +0200 | |
220 | ||
221 | guitarix (0.02.8-1) unstable; urgency=low | |
222 | * add more settings for jconv | |
223 | * clean code | |
224 | ||
225 | -- brummer <brummer-@web.de> Thu, 06 Nov 2008 13:55:42 +0200 | |
226 | ||
227 | guitarix (0.02.7-1) unstable; urgency=low | |
228 | * add suport for jconv | |
229 | * use jack_capture_gui2 to create the comandline for jack_capture | |
230 | * add preamp | |
231 | * change preset handling to save by name include the jconv settings | |
232 | * rework the distortion funktion | |
233 | * add all effekts to the ladspa plugin | |
234 | * add versioncheck to make sure the saved presets work with new version | |
235 | ||
236 | -- brummer <brummer-@web.de> Thu, 02 Nov 2008 13:24:31 +0200 | |
237 | ||
238 | guitarix (0.02.4-1) unstable; urgency=low | |
239 | * change the gui to expander | |
240 | * add suport for meterbridge | |
241 | * add macro for no see environment | |
242 | * add nogui parameter and options | |
243 | * add record with jack_capture | |
244 | * add feedback and feedforward filter | |
245 | * start to clean the code. | |
246 | * remove the skin option, all colers comes now from Gtk. | |
247 | ||
248 | -- brummer <brummer-@web.de> Thu, 05 Aug 2008 13:24:31 +0200 | |
249 | ||
250 | guitarix (0.02.3-1) unstable; urgency=low | |
251 | * add nogui parameter and options | |
252 | * add record with jack_capture | |
253 | * add feedback and feedforward filter | |
254 | * start to clean the code. | |
255 | * remove the skin option, all colers comes now from Gtk. | |
256 | ||
257 | -- brummer <brummer-@web.de> Thu, 03 Aug 2008 13:24:31 +0200 | |
258 | ||
259 | guitarix (0.02.2-1) unstable; urgency=low | |
260 | * add echo, crybaby and ImpulseResponse | |
261 | * add menu save and load presets | |
262 | ||
263 | -- brummer <brummer-@web.de> Thu, 23 Jul 2008 13:24:31 +0200 | |
264 | ||
265 | guitarix (0.02.1-1) unstable; urgency=low | |
266 | * add Distortion and Freeverb | |
267 | * add skin and gtk.rc file suport | |
268 | * Initial Release.(0.01) | |
269 | ||
270 | -- brummer <brummer-@web.de> Thu, 05 Jul 2008 13:24:31 +0200 |
0 | ../changelog⏎ |
37 | 37 | rm -f build-stamp configure-stamp |
38 | 38 | |
39 | 39 | # Add here commands to clean up after the build process. |
40 | ./waf clean | |
40 | ./waf distclean | |
41 | 41 | |
42 | 42 | dh_clean |
43 | 43 |
16 | 16 | */ |
17 | 17 | |
18 | 18 | #include <gtk/gtk.h> |
19 | #include <gxw/gxinit.h> | |
19 | 20 | #include "config.h" |
20 | 21 | |
21 | 22 | /* Catalog init function */ |
22 | 23 | void glade_gx_init (const char *name) |
23 | 24 | { |
25 | gxw_init(); | |
24 | 26 | gtk_icon_theme_append_search_path( |
25 | 27 | gtk_icon_theme_get_default(), GX_ICON_DIR); |
26 | 28 | } |
38 | 38 | target = 'gladegx', |
39 | 39 | lib = ["gxw"], |
40 | 40 | libpath = bld.path.find_dir("../libgxw/gxw").bldpath(bld.env), |
41 | includes = ['..'], | |
41 | includes = ['..','../libgxw'], | |
42 | 42 | install_path = bld.env["GLADE_MODULES_DIR"], |
43 | 43 | ) |
44 | 44 |
69 | 69 | gint slider_width; |
70 | 70 | gtk_widget_style_get(widget, "slider-width", &slider_width, NULL); |
71 | 71 | GdkPixbuf *image1 = gdk_pixbuf_copy(image); |
72 | gdk_pixbuf_copy_area(image, rect->width, 0, slider_width, rect->height, image1, sliderstate, 0); | |
72 | gdk_pixbuf_copy_area(image, rect->width, 0, slider_width, rect->height, image1, (int)(sliderstate), 0); | |
73 | 73 | if (has_focus) { |
74 | 74 | gdk_pixbuf_saturate_and_pixelate(image1, image1, sat, FALSE); |
75 | 75 | if (paint_focus) { |
83 | 83 | g_object_unref(image1); |
84 | 84 | } |
85 | 85 | |
86 | static const gint sat = 70.0; | |
86 | static const gdouble sat = 70.0; | |
87 | 87 | |
88 | 88 | static gboolean gx_hslider_expose(GtkWidget *widget, GdkEventExpose *event) |
89 | 89 | { |
103 | 103 | break; |
104 | 104 | case GTK_POS_TOP: |
105 | 105 | case GTK_POS_BOTTOM: |
106 | value_rect.x = image_rect.x + sliderstate - (value_rect.width - slider_width)/2; | |
106 | value_rect.x = image_rect.x + (int)sliderstate - (value_rect.width - slider_width)/2; | |
107 | 107 | if (value_rect.x + value_rect.width > widget->allocation.x + widget->allocation.width) { |
108 | 108 | value_rect.x = widget->allocation.x + widget->allocation.width - value_rect.width; |
109 | 109 | } |
150 | 150 | gboolean drag, int state, int button) |
151 | 151 | { |
152 | 152 | int linearmode = ((state & GDK_CONTROL_MASK) == 0) ^ jump_to_mouse; |
153 | GdkRectangle image_rect; | |
153 | GdkRectangle image_rect, value_rect; | |
154 | 154 | GdkPixbuf *pb = gtk_widget_render_icon(widget, icon, GtkIconSize(-1), NULL); |
155 | 155 | image_rect.width = gdk_pixbuf_get_width(pb); |
156 | 156 | image_rect.height = gdk_pixbuf_get_height(pb); |
157 | 157 | g_object_unref(pb); |
158 | 158 | x += widget->allocation.x; |
159 | 159 | y += widget->allocation.y; |
160 | _gx_regler_get_positions(GX_REGLER(widget), &image_rect, NULL); | |
161 | if (!drag && !_approx_in_rectangle(x, y, &image_rect)) { | |
162 | return FALSE; | |
163 | } | |
164 | if (button == 3) { | |
165 | gboolean ret; | |
166 | g_signal_emit_by_name(GX_REGLER(widget), "value-entry", &image_rect, &ret); | |
167 | return FALSE; | |
160 | _gx_regler_get_positions(GX_REGLER(widget), &image_rect, &value_rect); | |
161 | if (!drag) { | |
162 | GdkRectangle *rect = NULL; | |
163 | if (_approx_in_rectangle(x, y, &image_rect)) { | |
164 | if (button == 3) { | |
165 | rect = &image_rect; | |
166 | } | |
167 | } else if (_approx_in_rectangle(x, y, &value_rect)) { | |
168 | if (button == 1 || button == 3) { | |
169 | rect = &value_rect; | |
170 | } else { | |
171 | return FALSE; | |
172 | } | |
173 | } else { | |
174 | return FALSE; | |
175 | } | |
176 | if (rect) { | |
177 | gboolean ret; | |
178 | g_signal_emit_by_name(GX_REGLER(widget), "value-entry", rect, &ret); | |
179 | return FALSE; | |
180 | } | |
168 | 181 | } |
169 | 182 | static double last_y = 2e20; |
170 | 183 | GxKnob *knob = GX_KNOB(widget); |
516 | 516 | /* create a cairo context */ |
517 | 517 | cr = gdk_cairo_create(wi->window); |
518 | 518 | |
519 | double x0 = wi->allocation.x+1; | |
520 | double y0 = wi->allocation.y+1; | |
521 | double rect_width = wi->allocation.width-2; | |
522 | double rect_height = wi->allocation.height-3; | |
519 | gint x0 = wi->allocation.x+1; | |
520 | gint y0 = wi->allocation.y+1; | |
521 | gint rect_width = wi->allocation.width-2; | |
522 | gint rect_height = wi->allocation.height-3; | |
523 | 523 | |
524 | 524 | stock_image = gtk_widget_render_icon(wi,"guitar",(GtkIconSize)-1,NULL); |
525 | 525 | _image = gdk_pixbuf_scale_simple( |
599 | 599 | /* create a cairo context */ |
600 | 600 | cr = gdk_cairo_create(wi->window); |
601 | 601 | |
602 | double x0 = wi->allocation.x+1; | |
603 | double y0 = wi->allocation.y+1; | |
604 | double rect_width = wi->allocation.width-2; | |
605 | double rect_height = wi->allocation.height-3; | |
602 | gint x0 = wi->allocation.x+1; | |
603 | gint y0 = wi->allocation.y+1; | |
604 | gint rect_width = wi->allocation.width-2; | |
605 | gint rect_height = wi->allocation.height-3; | |
606 | 606 | |
607 | 607 | stock_image = gtk_widget_render_icon(wi,"tribe",(GtkIconSize)-1,NULL); |
608 | 608 | _image = gdk_pixbuf_scale_simple( |
27 | 27 | #include <gtk/gtkprivate.h> |
28 | 28 | #include <gtk/gtkbindings.h> |
29 | 29 | #include <gtk/gtkmarshal.h> |
30 | ||
31 | #define gtk_widget_get_requisition(w, r) (*r = (w)->requisition) | |
30 | 32 | |
31 | 33 | #define P_(s) (s) // FIXME -> gettext |
32 | 34 | #define I_(s) (s) // FIXME -> gettext |
129 | 131 | { |
130 | 132 | gboolean continue_emission; |
131 | 133 | gboolean signal_handled; |
132 | ||
134 | ||
133 | 135 | signal_handled = g_value_get_boolean (handler_return); |
134 | 136 | g_value_set_boolean (return_accu, signal_handled); |
135 | 137 | continue_emission = !signal_handled; |
136 | ||
138 | ||
137 | 139 | return continue_emission; |
138 | 140 | } |
139 | 141 | |
143 | 145 | { |
144 | 146 | gboolean continue_emission; |
145 | 147 | const gchar *str; |
146 | ||
148 | ||
147 | 149 | str = g_value_get_string(handler_return); |
148 | 150 | g_value_set_string(return_accu, str); |
149 | 151 | continue_emission = str == NULL; |
582 | 584 | } |
583 | 585 | |
584 | 586 | static gboolean should_invert(GtkRange *range) |
585 | { | |
587 | { | |
586 | 588 | if (range->orientation == GTK_ORIENTATION_HORIZONTAL) { |
587 | 589 | return |
588 | 590 | (range->inverted && !range->flippable) || |
605 | 607 | else |
606 | 608 | step_back (range); |
607 | 609 | break; |
608 | ||
610 | ||
609 | 611 | case GTK_SCROLL_STEP_UP: |
610 | 612 | case GTK_SCROLL_STEP_RIGHT: |
611 | 613 | if (should_invert (range)) |
613 | 615 | else |
614 | 616 | step_forward (range); |
615 | 617 | break; |
616 | ||
617 | ||
618 | ||
619 | ||
618 | 620 | case GTK_SCROLL_STEP_BACKWARD: |
619 | 621 | step_back (range); |
620 | 622 | break; |
621 | ||
623 | ||
622 | 624 | case GTK_SCROLL_STEP_FORWARD: |
623 | 625 | step_forward (range); |
624 | 626 | break; |
630 | 632 | else |
631 | 633 | page_back (range); |
632 | 634 | break; |
633 | ||
635 | ||
634 | 636 | case GTK_SCROLL_PAGE_UP: |
635 | 637 | case GTK_SCROLL_PAGE_RIGHT: |
636 | 638 | if (should_invert (range)) |
638 | 640 | else |
639 | 641 | page_forward (range); |
640 | 642 | break; |
641 | ||
643 | ||
642 | 644 | case GTK_SCROLL_PAGE_BACKWARD: |
643 | 645 | page_back (range); |
644 | 646 | break; |
645 | ||
647 | ||
646 | 648 | case GTK_SCROLL_PAGE_FORWARD: |
647 | 649 | page_forward (range); |
648 | 650 | break; |
742 | 744 | gboolean _approx_in_rectangle(gdouble x, gdouble y, GdkRectangle *rect) |
743 | 745 | { |
744 | 746 | const int off = 5; |
747 | if (rect->width == 0 || rect->height == 0) { | |
748 | return FALSE; | |
749 | } | |
745 | 750 | if (x >= rect->x-off && x < rect->x + rect->width + off && |
746 | 751 | y >= rect->y-off && y < rect->y + rect->height + off) { |
747 | 752 | return TRUE; |
1173 | 1178 | |
1174 | 1179 | static void gx_regler_init(GxRegler *regler) |
1175 | 1180 | { |
1181 | GTK_RANGE(regler)->round_digits = 0; | |
1176 | 1182 | regler->value_position = GTK_POS_BOTTOM; |
1177 | 1183 | regler->show_value = TRUE; |
1178 | 1184 | regler->value_xalign = 0.5; |
19 | 19 | #include <gtk/gtk.h> |
20 | 20 | #include <gtk/gtkprivate.h> |
21 | 21 | #include <string.h> |
22 | ||
23 | #define gtk_widget_get_requisition(w, r) (*r = (w)->requisition) | |
22 | 24 | |
23 | 25 | #define P_(s) (s) // FIXME -> gettext |
24 | 26 |
166 | 166 | float scale = -0.5; |
167 | 167 | if (tuner->freq) { |
168 | 168 | float fvis = 12 * log2f(tuner->freq/440.0); |
169 | int vis = round(fvis); | |
169 | int vis = int(round(fvis)); | |
170 | 170 | scale = (fvis-vis) / 2; |
171 | 171 | vis = vis % 12; |
172 | 172 | if (vis < 0) { |
62 | 62 | image_rect.x, image_rect.y, image_rect.width, image_rect.height, |
63 | 63 | GDK_RGB_DITHER_NORMAL, 0, 0); |
64 | 64 | gdk_draw_pixbuf(GDK_DRAWABLE(widget->window), widget->style->fg_gc[0], |
65 | ws, wheelstate + image_rect.width, 0, | |
65 | ws, (int)(wheelstate) + image_rect.width, 0, | |
66 | 66 | image_rect.x, image_rect.y, image_rect.width, image_rect.height, |
67 | 67 | GDK_RGB_DITHER_NORMAL, 0, 0); |
68 | 68 | gdk_draw_pixbuf(GDK_DRAWABLE(widget->window), widget->style->fg_gc[0], |
69 | 69 | wp,0, 0, |
70 | image_rect.x+smoth_pointer+wheelstate*0.4, image_rect.y, | |
70 | image_rect.x+smoth_pointer+(int)(wheelstate*0.4), image_rect.y, | |
71 | 71 | gdk_pixbuf_get_width(wp), image_rect.height, |
72 | 72 | GDK_RGB_DITHER_NORMAL, 0, 0); |
73 | 73 | _gx_regler_display_value(regler, &value_rect); |
92 | 92 | { |
93 | 93 | GtkAdjustment *adj = gtk_range_get_adjustment(GTK_RANGE(widget)); |
94 | 94 | GdkPixbuf *wb = gtk_widget_render_icon(widget, "wheel_back", GtkIconSize(-1), NULL); |
95 | GdkRectangle image_rect; | |
95 | GdkRectangle image_rect, value_rect; | |
96 | 96 | image_rect.width = gdk_pixbuf_get_width(wb); |
97 | 97 | image_rect.height = gdk_pixbuf_get_height(wb); |
98 | 98 | x += widget->allocation.x; |
99 | 99 | y += widget->allocation.y; |
100 | _gx_regler_get_positions(GX_REGLER(widget), &image_rect, NULL); | |
101 | if (!drag && !_approx_in_rectangle(x, y, &image_rect)) { | |
102 | return FALSE; | |
103 | } | |
104 | if (button == 3) { | |
105 | gboolean ret; | |
106 | g_signal_emit_by_name(GX_REGLER(widget), "value-entry", &image_rect, &ret); | |
107 | return FALSE; | |
100 | _gx_regler_get_positions(GX_REGLER(widget), &image_rect, &value_rect); | |
101 | if (!drag) { | |
102 | GdkRectangle *rect = NULL; | |
103 | if (_approx_in_rectangle(x, y, &image_rect)) { | |
104 | if (button == 3) { | |
105 | rect = &image_rect; | |
106 | } | |
107 | } else if (_approx_in_rectangle(x, y, &value_rect)) { | |
108 | if (button == 1 || button == 3) { | |
109 | rect = &value_rect; | |
110 | } else { | |
111 | return FALSE; | |
112 | } | |
113 | } else { | |
114 | return FALSE; | |
115 | } | |
116 | if (rect) { | |
117 | gboolean ret; | |
118 | g_signal_emit_by_name(GX_REGLER(widget), "value-entry", rect, &ret); | |
119 | return FALSE; | |
120 | } | |
108 | 121 | } |
109 | 122 | double pos = adj->lower + ((x - image_rect.x)/image_rect.width)* (adj->upper - adj->lower); |
110 | 123 | gboolean handled; |
16 | 16 | */ |
17 | 17 | |
18 | 18 | #include <gtk/gtkiconfactory.h> |
19 | #include "GxIREdit.h" | |
20 | #include "GxRadioButton.h" | |
21 | #include "GxValueDisplay.h" | |
19 | #include "gxinit.h" | |
22 | 20 | |
23 | 21 | #include "gximages.cc" |
24 | 22 | |
56 | 54 | { NULL, NULL }, |
57 | 55 | }; |
58 | 56 | |
59 | extern "C" void __attribute__ ((constructor)) gxw_init() | |
57 | void gxw_init() | |
60 | 58 | { |
61 | 59 | g_type_init(); |
62 | 60 | GtkIconFactory *factory = gtk_icon_factory_new(); |
0 | /* | |
1 | * Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert | |
2 | * | |
3 | * This program is free software; you can redistribute it and/or modify | |
4 | * it under the terms of the GNU General Public License as published by | |
5 | * the Free Software Foundation; either version 2 of the License, or | |
6 | * (at your option) any later version. | |
7 | * | |
8 | * This program is distributed in the hope that it will be useful, | |
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | * GNU General Public License for more details. | |
12 | * | |
13 | * You should have received a copy of the GNU General Public License | |
14 | * along with this program; if not, write to the Free Software | |
15 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
16 | */ | |
17 | ||
18 | /****************************************************************************** | |
19 | part of guitarix, use knobs with Gtk | |
20 | ******************************************************************************/ | |
21 | ||
22 | #ifndef __GX_RADIO_BUTTON_H__ | |
23 | #define __GX_RADIO_BUTTON_H__ | |
24 | ||
25 | #include <gtk/gtkradiobutton.h> | |
26 | #include "compat2-12.h" | |
27 | ||
28 | G_BEGIN_DECLS | |
29 | ||
30 | void gxw_init(); | |
31 | ||
32 | G_END_DECLS | |
33 | ||
34 | #endif /* __GX_RADIO_BUTTON_H__ */ |
40 | 40 | #include <gxw/GxMeterScale.h> |
41 | 41 | #include <gxw/GxGradient.h> |
42 | 42 | #include <gxw/GxValueDisplay.h> |
43 | #include <gxw/gxinit.h> | |
43 | 44 | |
44 | 45 | #endif /* __GXW_H__ */ |
16 | 16 | */ |
17 | 17 | |
18 | 18 | #include <gtkmm/main.h> |
19 | #include <gxw/gxinit.h> | |
20 | #include <gxwmm/init.h> | |
19 | 21 | #include "wrap_init.h" |
20 | 22 | |
21 | extern "C" void __attribute__ ((constructor)) gxwmm_init() | |
23 | namespace Gxw | |
22 | 24 | { |
23 | Gtk::Main::init_gtkmm_internals(); //Sets up the g type system and the Glib::wrap() table. | |
24 | Gxw::wrap_init(); //Tells the Glib::wrap() table about the libsomethingmm classes. | |
25 | ||
26 | void init() | |
27 | { | |
28 | gxw_init(); | |
29 | Gtk::Main::init_gtkmm_internals(); //Sets up the g type system and the Glib::wrap() table. | |
30 | Gxw::wrap_init(); //Tells the Glib::wrap() table about the libsomethingmm classes. | |
25 | 31 | } |
32 | ||
33 | } // namespace Gxw |
0 | #ifndef GXWMM_INIT_H_INCLUDED | |
1 | #define GXWMM_INIT_H_INCLUDED | |
2 | ||
3 | namespace Gxw { | |
4 | ||
5 | void init(); | |
6 | ||
7 | } | |
8 | ||
9 | #endif /* GXWMM_INIT_H_INCLUDED */ |
11 | 11 | target = 'gxw_demo', |
12 | 12 | uselib = 'GTKMM', |
13 | 13 | includes = ['.','../libgxw'], |
14 | linkflags = "-Wl,-u,gxw_init", | |
15 | 14 | install_path = None, |
16 | 15 | ) |
17 | 16 | if bld.env["GX_LIB_SHARED"]: |
0 | 0 | #include <pygobject.h> |
1 | #include <gxw/gxinit.h> | |
1 | 2 | #define PY_ARRAY_UNIQUE_SYMBOL gxw_ARRAY_API |
2 | 3 | #include <numpy/arrayobject.h> |
3 | 4 | |
8 | 9 | { |
9 | 10 | PyObject *m, *d; |
10 | 11 | |
12 | gxw_init(); | |
11 | 13 | init_pygobject (); |
12 | 14 | import_array(); |
13 | 15 |
103 | 103 | prog.lib = ["gxw"] |
104 | 104 | else: |
105 | 105 | prog.uselib_local = ['gxw'] |
106 | prog.linkflags = ["-Wl,-u,gxw_init"] |
4 | 4 | |
5 | 5 | wet = vslider("wet_dry[name:wet/dry][tooltip:percentage of processed signal in output signal]", 100, 0, 100, 1) : /(100); |
6 | 6 | dry = 1 - wet; |
7 | deltadelay = vslider("diff_delay[name:Delta Delay][tooltip:delay left or right channel by the specified amount (unit: ms)]", 0, -10, 10, 0.01)*millisec; | |
7 | deltadelay = vslider("diff_delay[name:Delta Delay][tooltip:delay left or right channel by the specified amount (unit: ms)]", 0, -10, 10, 0.01)*millisec : smoothi(0.999); | |
8 | 8 | gain = vslider("gain[name:Gain][tooltip:gain trim for processed signal (unit: dB)]", 0, -20, 20, 0.1) : db2linear : smoothi(0.999); |
9 | jbal = vslider("balance[name:Balance][tooltip:left/right trim for processed signal]", 0, -1, 1, 0.1); | |
10 | bal = vslider(".amp.balance[alias]", 0, -1, 1, 0.1); | |
9 | jbal = vslider("balance[name:Balance][tooltip:left/right trim for processed signal]", 0, -1, 1, 0.1): smoothi(0.999); | |
10 | bal = vslider(".amp.balance[alias]", 0, -1, 1, 0.1): smoothi(0.999); | |
11 | 11 | |
12 | 12 | /* |
13 | 13 | ** We want to move the sound source to the right |
5 | 5 | double fVec0[65536]; |
6 | 6 | FAUSTFLOAT fslider1; |
7 | 7 | double fConst0; |
8 | double fRec0[2]; | |
8 | 9 | FAUSTFLOAT fslider2; |
9 | double fRec0[2]; | |
10 | double fRec1[2]; | |
10 | 11 | FAUSTFLOAT fslider3; |
12 | double fRec2[2]; | |
11 | 13 | FAUSTFLOAT& fslider4 = get_alias("amp.balance"); |
14 | double fRec3[2]; | |
12 | 15 | double fVec1[65536]; |
13 | 16 | int fSamplingFreq; |
14 | 17 | |
17 | 20 | fSamplingFreq = samplingFreq; |
18 | 21 | IOTA = 0; |
19 | 22 | for (int i=0; i<65536; i++) fVec0[i] = 0; |
20 | fConst0 = (0.001 * fSamplingFreq); | |
23 | fConst0 = (1.000000000000001e-06 * fSamplingFreq); | |
21 | 24 | for (int i=0; i<2; i++) fRec0[i] = 0; |
25 | for (int i=0; i<2; i++) fRec1[i] = 0; | |
26 | for (int i=0; i<2; i++) fRec2[i] = 0; | |
27 | for (int i=0; i<2; i++) fRec3[i] = 0; | |
22 | 28 | for (int i=0; i<65536; i++) fVec1[i] = 0; |
23 | 29 | } |
24 | 30 | |
27 | 33 | double fSlow0 = (0.01 * fslider0); |
28 | 34 | double fSlow1 = (1 - fSlow0); |
29 | 35 | double fSlow2 = (fConst0 * fslider1); |
30 | double fSlow3 = ((int((fSlow2 < 0)))?0:fSlow2); | |
31 | int iSlow4 = int(fSlow3); | |
32 | int iSlow5 = int((iSlow4 & 65535)); | |
33 | int iSlow6 = (1 + iSlow4); | |
34 | double fSlow7 = (iSlow6 - fSlow3); | |
35 | int iSlow8 = int((int(iSlow6) & 65535)); | |
36 | double fSlow9 = (fSlow3 - iSlow4); | |
37 | double fSlow10 = (0.0010000000000000009 * pow(10,(0.05 * fslider2))); | |
38 | double fSlow11 = fslider3; | |
39 | double fSlow12 = (1 - max(0, fSlow11)); | |
40 | double fSlow13 = fslider4; | |
41 | double fSlow14 = (1 - max(0, fSlow13)); | |
42 | double fSlow15 = ((int((fSlow2 > 0)))?0:(0 - fSlow2)); | |
43 | int iSlow16 = int(fSlow15); | |
44 | int iSlow17 = int((iSlow16 & 65535)); | |
45 | int iSlow18 = (1 + iSlow16); | |
46 | double fSlow19 = (iSlow18 - fSlow15); | |
47 | int iSlow20 = int((int(iSlow18) & 65535)); | |
48 | double fSlow21 = (fSlow15 - iSlow16); | |
49 | double fSlow22 = (1 - max(0, (0 - fSlow11))); | |
50 | double fSlow23 = (1 - max(0, (0 - fSlow13))); | |
36 | double fSlow3 = (0.0010000000000000009 * fslider2); | |
37 | double fSlow4 = (0.0010000000000000009 * pow(10,(0.05 * fslider3))); | |
38 | double fSlow5 = (0.0010000000000000009 * fslider4); | |
51 | 39 | for (int i=0; i<count; i++) { |
52 | 40 | double fTemp0 = (fSlow0 * (double)input2[i]); |
53 | 41 | fVec0[IOTA&65535] = fTemp0; |
54 | fRec0[0] = (fSlow10 + (0.999 * fRec0[1])); | |
55 | output0[i] = (FAUSTFLOAT)(fSlow14 * ((fSlow12 * (fRec0[0] * ((fSlow9 * fVec0[(IOTA-iSlow8)&65535]) + (fSlow7 * fVec0[(IOTA-iSlow5)&65535])))) + (fSlow1 * (double)input0[i]))); | |
56 | double fTemp1 = (fSlow0 * (double)input3[i]); | |
57 | fVec1[IOTA&65535] = fTemp1; | |
58 | output1[i] = (FAUSTFLOAT)(fSlow23 * ((fSlow22 * (fRec0[0] * ((fSlow21 * fVec1[(IOTA-iSlow20)&65535]) + (fSlow19 * fVec1[(IOTA-iSlow17)&65535])))) + (fSlow1 * (double)input1[i]))); | |
42 | fRec0[0] = (fSlow2 + (0.999 * fRec0[1])); | |
43 | double fTemp1 = ((int((fRec0[0] < 0)))?0:fRec0[0]); | |
44 | int iTemp2 = int(fTemp1); | |
45 | int iTemp3 = (1 + iTemp2); | |
46 | fRec1[0] = (fSlow3 + (0.999 * fRec1[1])); | |
47 | fRec2[0] = (fSlow4 + (0.999 * fRec2[1])); | |
48 | fRec3[0] = (fSlow5 + (0.999 * fRec3[1])); | |
49 | output0[i] = (FAUSTFLOAT)((1 - max(0, fRec3[0])) * (((fRec2[0] * (1 - max(0, fRec1[0]))) * (((fTemp1 - iTemp2) * fVec0[(IOTA-int((int(iTemp3) & 65535)))&65535]) + ((iTemp3 - fTemp1) * fVec0[(IOTA-int((iTemp2 & 65535)))&65535]))) + (fSlow1 * (double)input0[i]))); | |
50 | double fTemp4 = (fSlow0 * (double)input3[i]); | |
51 | fVec1[IOTA&65535] = fTemp4; | |
52 | double fTemp5 = ((int((fRec0[0] > 0)))?0:(0 - fRec0[0])); | |
53 | int iTemp6 = int(fTemp5); | |
54 | int iTemp7 = (1 + iTemp6); | |
55 | output1[i] = (FAUSTFLOAT)((1 - max(0, (0 - fRec3[0]))) * (((fRec2[0] * (1 - max(0, (0 - fRec1[0])))) * (((fTemp5 - iTemp6) * fVec1[(IOTA-int((int(iTemp7) & 65535)))&65535]) + ((iTemp7 - fTemp5) * fVec1[(IOTA-int((iTemp6 & 65535)))&65535]))) + (fSlow1 * (double)input1[i]))); | |
59 | 56 | // post processing |
57 | fRec3[1] = fRec3[0]; | |
58 | fRec2[1] = fRec2[0]; | |
59 | fRec1[1] = fRec1[0]; | |
60 | 60 | fRec0[1] = fRec0[0]; |
61 | 61 | IOTA = IOTA+1; |
62 | 62 | } |
65 | 65 | static struct RegisterParams { RegisterParams(); } RegisterParams; |
66 | 66 | RegisterParams::RegisterParams() |
67 | 67 | { |
68 | registerVar("jconv.balance","Balance","S","left/right trim for processed signal",&fslider3, 0.0, -1.0, 1.0, 0.1); | |
69 | registerVar("jconv.gain","Gain","S","gain trim for processed signal (unit: dB)",&fslider2, 0.0, -2e+01, 2e+01, 0.1); | |
68 | registerVar("jconv.gain","Gain","S","gain trim for processed signal (unit: dB)",&fslider3, 0.0, -2e+01, 2e+01, 0.1); | |
69 | registerVar("jconv.balance","Balance","S","left/right trim for processed signal",&fslider2, 0.0, -1.0, 1.0, 0.1); | |
70 | 70 | registerVar("jconv.diff_delay","Delta Delay","S","delay left or right channel by the specified amount (unit: ms)",&fslider1, 0.0, -1e+01, 1e+01, 0.01); |
71 | 71 | registerVar("jconv.wet_dry","wet/dry","S","percentage of processed signal in output signal",&fslider0, 1e+02, 0.0, 1e+02, 1.0); |
72 | 72 | registerInit("jconv", init); |
452 | 452 | /* create a cairo context */ |
453 | 453 | cr = gdk_cairo_create(wi->window); |
454 | 454 | |
455 | double x0 = wi->allocation.x+1; | |
456 | double y0 = wi->allocation.y+1; | |
457 | double rect_width = wi->allocation.width-2; | |
458 | double rect_height = wi->allocation.height-3; | |
455 | gint x0 = wi->allocation.x+1; | |
456 | gint y0 = wi->allocation.y+1; | |
457 | gint rect_width = wi->allocation.width-2; | |
458 | gint rect_height = wi->allocation.height-3; | |
459 | 459 | |
460 | 460 | _image = gdk_pixbuf_scale_simple(tribeimage1,rect_width,rect_height,GDK_INTERP_HYPER); |
461 | 461 | |
540 | 540 | /* create a cairo context */ |
541 | 541 | cr = gdk_cairo_create(wi->window); |
542 | 542 | |
543 | double x0 = wi->allocation.x+1; | |
544 | double y0 = wi->allocation.y+1; | |
545 | double rect_width = wi->allocation.width-2; | |
546 | double rect_height = wi->allocation.height-3; | |
543 | gint x0 = wi->allocation.x+1; | |
544 | gint y0 = wi->allocation.y+1; | |
545 | gint rect_width = wi->allocation.width-2; | |
546 | gint rect_height = wi->allocation.height-3; | |
547 | 547 | |
548 | 548 | _image = gdk_pixbuf_scale_simple(tribeimage,rect_width,rect_height,GDK_INTERP_HYPER); |
549 | 549 | |
594 | 594 | /* create a cairo context */ |
595 | 595 | cr = gdk_cairo_create(wi->window); |
596 | 596 | |
597 | double x0 = wi->allocation.x+1; | |
598 | double y0 = wi->allocation.y; | |
599 | double rect_width = wi->allocation.width-2; | |
600 | double rect_height = wi->allocation.height; | |
597 | gint x0 = wi->allocation.x+1; | |
598 | gint y0 = wi->allocation.y; | |
599 | gint rect_width = wi->allocation.width-2; | |
600 | gint rect_height = wi->allocation.height; | |
601 | 601 | |
602 | 602 | _image = gdk_pixbuf_scale_simple(tribeimage2,rect_width,rect_height,GDK_INTERP_HYPER); |
603 | 603 |
304 | 304 | } |
305 | 305 | } |
306 | 306 | if (cnt) { |
307 | ||
307 | ||
308 | 308 | for (int ichan = 0; ichan < nchan; ichan++) { |
309 | 309 | int rc; |
310 | 310 | if (ichan >= audio.chan()) { |
68 | 68 | ** register audio variables to paramtable |
69 | 69 | */ |
70 | 70 | |
71 | AudioVariables::AudioVariables() | |
71 | void AudioVariables::register_parameter() | |
72 | 72 | { |
73 | 73 | static const char *amp_threshold[] = {"off","clip","foldback",0}; |
74 | 74 | registerEnumParam("amp.threshold", "threshold", amp_threshold, &ffuse, 0); |
84 | 84 | gx_gui::registerParam("freeverb.on_off", "on/off", &fcheckbox6, 0); |
85 | 85 | gx_gui::registerParam("IR.on_off", "on/off", &fcheckbox8, 0); |
86 | 86 | gx_gui::registerParam("crybaby.on_off", "on/off", &fcheckbox5, 0); |
87 | gx_gui::registerParam("echo.on_off", "on/off", &fcheckbox7, 0); | |
88 | gx_gui::registerParam("delay.on_off", "on/off", &fdelay, 0); | |
89 | gx_gui::registerParam("chorus.on_off", "on/off", &fchorus, 0); | |
87 | gx_gui::registerParam("echo.on_off", "on/off", (float*) &fcheckbox7, 0.); | |
88 | gx_gui::registerParam("delay.on_off", "on/off", (float*) &fdelay, 0.); | |
89 | gx_gui::registerParam("chorus.on_off", "on/off", (float*) &fchorus, 0.); | |
90 | 90 | gx_gui::registerParam("compressor.on_off", "on/off", &fcheckboxcom1, 0); |
91 | 91 | gx_gui::registerParam("tube2.on_off", "on/off", &ftube3, 0); |
92 | 92 | gx_gui::registerParam("tube3.on_off", "on/off", &ftube3e, 0); |
107 | 107 | gx_gui::registerParam("moog.on_off", "on/off", &fmoog, 0); |
108 | 108 | gx_gui::registerParam("biquad.on_off", "on/off", &fbiquad, 0); |
109 | 109 | gx_gui::registerParam("flanger.on_off", "on/off", &fflanger, 0); |
110 | gx_gui::registerParam("SampleLooper.on_off", "on/off", &fsloop, 0); | |
110 | gx_gui::registerParam("SampleLooper.on_off", "on/off", (float*) &fsloop, 0.); | |
111 | 111 | gx_gui::registerParam("jconv.on_off", "Run", &gx_jconv::GxJConvSettings::checkbutton7); |
112 | 112 | static const char *amp_select[] = {"1x","2x", "3x","4x","5x", "6x", "7x", "8x",0}; |
113 | 113 | registerEnumParam("amp.select", "select", amp_select, &upsample_mode, 3); |
116 | 116 | gx_gui::registerParam("cab.on_off", "Cab-ImpResp", &fcab,0); |
117 | 117 | static const char *tonestack_model[] = {"default","Bassman","Twin Reverb","Princeton","JCM-800","JCM-2000","M-Lead","M2199","AC-30","Off",0}; |
118 | 118 | registerEnumParam("amp.tonestack.select","select",tonestack_model,&tonestack, 0); |
119 | static const char *post_pre[] = {"post","pre",0}; | |
120 | registerEnumParam("crybaby.pp","select",post_pre,&crybabypp, 0); | |
121 | registerEnumParam("overdrive.pp","select",post_pre,&overdrivepp, 0); | |
122 | registerEnumParam("distortion.pp","select",post_pre,&distortionpp, 0); | |
123 | registerEnumParam("freeverb.pp","select",post_pre,&freeverbpp, 0); | |
124 | registerEnumParam("IR.pp","select",post_pre,&IRpp, 0); | |
125 | registerEnumParam("compressor.pp","select",post_pre,&compressorpp, 0); | |
126 | registerEnumParam("echo.pp","select",post_pre,&echopp, 0); | |
127 | registerEnumParam("delay.pp","select",post_pre,&delaypp, 0); | |
119 | 128 | |
120 | 129 | // only save and restore, no midi control |
121 | 130 | |
327 | 336 | void compute_insert (int count, float* input1, float* output0, float* output1) |
328 | 337 | { |
329 | 338 | // retrieve engine state |
330 | const GxEngineState estate = (GxEngineState)checky; | |
339 | const GxEngineState estate = checky; | |
331 | 340 | |
332 | 341 | //------------ determine processing type |
333 | 342 | unsigned short process_type = ZEROIZE_BUFFERS; |
387 | 396 | void compute (int count, float* input, float* output0) |
388 | 397 | { |
389 | 398 | // retrieve engine state |
390 | const GxEngineState estate = (GxEngineState)checky; | |
399 | const GxEngineState estate = checky; | |
391 | 400 | |
392 | 401 | //------------ determine processing type |
393 | 402 | unsigned short process_type = ZEROIZE_BUFFERS; |
491 | 500 | float *ovs_buffer; |
492 | 501 | if (audio.fupsample) { |
493 | 502 | // *oversample |
494 | t_upsample = min(8,audio.upsample_mode+1); | |
503 | t_upsample = min(8,(int)audio.upsample_mode+1); | |
495 | 504 | if (t_upsample != t_upsample_old) { |
496 | 505 | t_upsample_old = t_upsample; |
497 | 506 | fupsample_old = audio.fupsample; |
505 | 514 | distortion1::init(t_upsample * gx_jack::jack_sr); |
506 | 515 | distortion::init(t_upsample * gx_jack::jack_sr); |
507 | 516 | } |
508 | resampTube.up(count, output0, oversample); | |
517 | ||
509 | 518 | ovs_sr = t_upsample * gx_jack::jack_sr; |
510 | 519 | ovs_count = t_upsample * count; |
511 | ovs_buffer = oversample; | |
520 | ||
512 | 521 | } else { |
513 | 522 | ovs_sr = gx_jack::jack_sr; |
514 | 523 | ovs_count = count; |
515 | ovs_buffer = output0; | |
524 | ||
516 | 525 | } |
517 | 526 | if (audio.fupsample != fupsample_old) { |
518 | 527 | fupsample_old = audio.fupsample; |
523 | 532 | distortion1::init(ovs_sr); |
524 | 533 | distortion::init(ovs_sr); |
525 | 534 | } |
535 | ||
536 | ||
537 | for (int m = 0; m < 8; m++) { | |
538 | if (audio.posit0 == m && audio.fcheckbox5 && !audio.fautowah && audio.crybabypp) { | |
539 | crybaby::compute(count, output0, output0); | |
540 | } else if (audio.posit0 == m && audio.fcheckbox5 && audio.fautowah && audio.crybabypp) { | |
541 | autowah::compute(count, output0, output0); | |
542 | } else if (audio.posit5 == m && audio.fcheckboxcom1 && audio.compressorpp) { | |
543 | compressor::compute(count, output0, output0); | |
544 | } else if (audio.posit1 == m && audio.foverdrive4 && audio.overdrivepp) { | |
545 | overdrive::compute(count, output0, output0); | |
546 | } else if (audio.posit2 == m && audio.fcheckbox4 && audio.distortionpp) { | |
547 | if (audio.fupsample) { | |
548 | // 2*oversample | |
549 | //over_sample(count, output0, oversample); | |
550 | resampDist.up(count, output0, oversample); | |
551 | if(audio.witchdistortion) distortion1::compute(ovs_count, oversample, oversample); | |
552 | else distortion::compute(ovs_count, oversample, oversample); | |
553 | resampDist.down(count, oversample, output0); | |
554 | //down_sample(count, oversample, output0); | |
555 | } else { | |
556 | if(audio.witchdistortion) distortion1::compute(count, output0, output0); | |
557 | else distortion::compute(count, output0, output0); | |
558 | } | |
559 | } else if (audio.posit3 == m && audio.fcheckbox6 && audio.freeverbpp) { | |
560 | freeverb::compute(count, output0, output0); | |
561 | } else if (audio.posit6 == m && audio.fcheckbox7 && echo::is_inited() && audio.echopp) { | |
562 | echo::compute(count, output0, output0); | |
563 | } else if (audio.posit4 == m && audio.fcheckbox8 && audio.IRpp) { | |
564 | impulseresponse::compute(count, output0, output0); | |
565 | } else if (audio.posit7 == m && audio.fdelay && delay::is_inited() && audio.delaypp) { | |
566 | delay::compute(count, output0, output0); | |
567 | } | |
568 | } | |
569 | ||
570 | if (audio.fupsample) { | |
571 | resampTube.up(count, output0, oversample); | |
572 | ovs_buffer = oversample; | |
573 | } else { | |
574 | ovs_buffer = output0; | |
575 | } | |
576 | ||
526 | 577 | if (audio.antialis0) { |
527 | 578 | AntiAlias::compute(ovs_count, ovs_buffer, ovs_buffer); |
528 | 579 | } |
590 | 641 | } |
591 | 642 | |
592 | 643 | for (int m = 0; m < 8; m++) { |
593 | if (audio.posit0 == m && audio.fcheckbox5 && !audio.fautowah) { | |
644 | if (audio.posit0 == m && audio.fcheckbox5 && !audio.fautowah && !audio.crybabypp) { | |
594 | 645 | crybaby::compute(count, output0, output0); |
595 | } else if (audio.posit0 == m && audio.fcheckbox5 && audio.fautowah) { | |
646 | } else if (audio.posit0 == m && audio.fcheckbox5 && audio.fautowah && !audio.crybabypp) { | |
596 | 647 | autowah::compute(count, output0, output0); |
597 | } else if (audio.posit5 == m && audio.fcheckboxcom1) { | |
648 | } else if (audio.posit5 == m && audio.fcheckboxcom1 && !audio.compressorpp) { | |
598 | 649 | compressor::compute(count, output0, output0); |
599 | } else if (audio.posit1 == m && audio.foverdrive4) { | |
650 | } else if (audio.posit1 == m && audio.foverdrive4 && !audio.overdrivepp) { | |
600 | 651 | overdrive::compute(count, output0, output0); |
601 | } else if (audio.posit2 == m && audio.fcheckbox4) { | |
652 | } else if (audio.posit2 == m && audio.fcheckbox4 && !audio.distortionpp) { | |
602 | 653 | if (audio.fupsample) { |
603 | 654 | // 2*oversample |
604 | 655 | //over_sample(count, output0, oversample); |
611 | 662 | if(audio.witchdistortion) distortion1::compute(count, output0, output0); |
612 | 663 | else distortion::compute(count, output0, output0); |
613 | 664 | } |
614 | } else if (audio.posit3 == m && audio.fcheckbox6) { | |
665 | } else if (audio.posit3 == m && audio.fcheckbox6 && !audio.freeverbpp) { | |
615 | 666 | freeverb::compute(count, output0, output0); |
616 | } else if (audio.posit6 == m && audio.fcheckbox7 && echo::is_inited()) { | |
667 | } else if (audio.posit6 == m && audio.fcheckbox7 && echo::is_inited() && !audio.echopp) { | |
617 | 668 | echo::compute(count, output0, output0); |
618 | } else if (audio.posit4 == m && audio.fcheckbox8) { | |
669 | } else if (audio.posit4 == m && audio.fcheckbox8 && !audio.IRpp) { | |
619 | 670 | impulseresponse::compute(count, output0, output0); |
620 | } else if (audio.posit7 == m && audio.fdelay && delay::is_inited()) { | |
671 | } else if (audio.posit7 == m && audio.fdelay && delay::is_inited() && !audio.delaypp) { | |
621 | 672 | delay::compute(count, output0, output0); |
622 | 673 | } |
623 | 674 | } |
647 | 698 | memcpy(output0, input1, count*sizeof(float)); |
648 | 699 | feed::compute(count, output0, output0, output1); |
649 | 700 | |
650 | if (audio.fchorus and chorus::is_inited()) { | |
701 | if (audio.fchorus && chorus::is_inited()) { | |
651 | 702 | chorus::compute(count, output0, output1, output0, output1); |
652 | 703 | } |
653 | 704 | if (audio.fflanger) { |
27 | 27 | namespace gx_engine |
28 | 28 | { |
29 | 29 | |
30 | MidiVariables::MidiVariables() | |
30 | void MidiVariables::register_parameter() | |
31 | 31 | { |
32 | 32 | gx_gui::registerParam("midi_out.channel_1.velocity", "velocity", &fslider26, 64.f, 0.f, 127.f, 1.f); |
33 | 33 | gx_gui::registerParam("midi_out.channel_1.volume", "volume", &fslider46, 64.f, 0.f, 127.f, 1.f); |
157 | 157 | { |
158 | 158 | |
159 | 159 | // retrieve engine state |
160 | const GxEngineState estate = (GxEngineState)checky; | |
160 | const GxEngineState estate = checky; | |
161 | 161 | |
162 | 162 | //------------ determine processing type |
163 | 163 | unsigned short process_type = ZEROIZE_BUFFERS; |
100 | 100 | const char *name; |
101 | 101 | } inidef; |
102 | 102 | |
103 | list<inidef> inilist; | |
104 | ||
105 | float& get_alias(const char *id) | |
103 | ||
104 | static list<inidef>& get_inilist() | |
105 | { | |
106 | static list<inidef> inilist; | |
107 | return inilist; | |
108 | } | |
109 | ||
110 | static list<gx_gui::Parameter*>& get_paramlist() | |
111 | { | |
112 | static list<gx_gui::Parameter*> paramlist; | |
113 | return paramlist; | |
114 | } | |
115 | ||
116 | void register_faust_parameters() | |
117 | { | |
118 | list<gx_gui::Parameter*>& paramlist = get_paramlist(); | |
119 | for (list<gx_gui::Parameter*>::iterator i = paramlist.begin(); i != paramlist.end(); i++) { | |
120 | gx_gui::parameter_map.insert(*i); | |
121 | } | |
122 | paramlist.clear(); | |
123 | } | |
124 | ||
125 | static gx_gui::Parameter *find_parameter(const char *id) | |
126 | { | |
127 | list<gx_gui::Parameter*>& paramlist = get_paramlist(); | |
128 | for (list<gx_gui::Parameter*>::iterator i = paramlist.begin(); i != paramlist.end(); i++) { | |
129 | if ((*i)->id() == id) { | |
130 | return *i; | |
131 | } | |
132 | } | |
133 | return 0; | |
134 | } | |
135 | ||
136 | static float& get_alias(const char *id) | |
106 | 137 | { |
107 | 138 | static float dummy; |
108 | if (!gx_gui::parameter_map.hasId(id)) { | |
139 | gx_gui::Parameter *p = find_parameter(id); | |
140 | if (!p) { | |
109 | 141 | gx_system::gx_print_error("engine", string("can't define alias for unknown (or not yet defined) parameter id: ") + id); |
110 | 142 | return dummy; |
111 | 143 | } else { |
112 | return gx_gui::parameter_map[id].getFloat().value; | |
113 | } | |
114 | } | |
115 | ||
116 | void registerVar(const char* id, const char* name, const char* tp, | |
117 | const char* tooltip, float* var, float val=0, | |
118 | float low=0, float up=0, float step=0, bool exp=false) | |
144 | return p->getFloat().value; | |
145 | } | |
146 | } | |
147 | ||
148 | static void registerVar(const char* id, const char* name, const char* tp, | |
149 | const char* tooltip, float* var, float val=0, | |
150 | float low=0, float up=0, float step=0, bool exp=false) | |
119 | 151 | { |
120 | 152 | if (!name[0]) { |
121 | 153 | assert(strrchr(id, '.')); |
126 | 158 | if (tooltip) { |
127 | 159 | p->set_desc(tooltip); |
128 | 160 | } |
129 | gx_gui::parameter_map.insert(p); | |
130 | } | |
131 | ||
132 | void registerEnumVar(const char *id, const char* name, const char* tp, | |
133 | const char* tooltip, const char** values, float *var, float val, | |
134 | float low=0, float up=0, float step=1, bool exp=false) | |
161 | get_paramlist().push_back(p); | |
162 | } | |
163 | ||
164 | static void registerEnumVar(const char *id, const char* name, const char* tp, | |
165 | const char* tooltip, const char** values, float *var, float val, | |
166 | float low=0, float up=0, float step=1, bool exp=false) | |
135 | 167 | { |
136 | 168 | if (!name[0]) { |
137 | 169 | assert(strrchr(id, '.')); |
139 | 171 | } |
140 | 172 | assert(low == 0.0 && step == 1.0); |
141 | 173 | gx_gui::FloatEnumParameter *p = new gx_gui::FloatEnumParameter( |
142 | id, name, values, true, *var, val, true, exp); | |
174 | id, name, values, true, *var, (int)round(val), true, exp); | |
143 | 175 | assert(up == p->upper); // calculated by constructor |
144 | gx_gui::parameter_map.insert(p); | |
145 | } | |
146 | ||
147 | inline void registerIntParam(const char*a,const char*b,int*c,int std=0,int lower=0,int upper=1,bool exp=false) | |
176 | get_paramlist().push_back(p); | |
177 | } | |
178 | ||
179 | static inline void registerIntParam(const char*a,const char*b,int*c,int std=0,int lower=0,int upper=1,bool exp=false) | |
148 | 180 | { |
149 | gx_gui::parameter_map.insert(new gx_gui::IntParameter(a,b,gx_gui::Parameter::Enum,true,*c,std,lower,upper,true,exp)); | |
181 | get_paramlist().push_back( | |
182 | new gx_gui::IntParameter(a,b,gx_gui::Parameter::Enum,true,*c,std, | |
183 | lower,upper,true,exp)); | |
150 | 184 | } |
151 | 185 | |
152 | void registerInit(const char *name, inifunc f) | |
186 | static void registerInit(const char *name, inifunc f) | |
153 | 187 | { |
154 | 188 | inidef i; |
155 | 189 | i.func = f; |
156 | 190 | i.name = name; |
157 | inilist.push_back(i); | |
158 | } | |
159 | ||
160 | void jack_sync() | |
191 | get_inilist().push_back(i); | |
192 | } | |
193 | ||
194 | static void jack_sync() | |
161 | 195 | { |
162 | 196 | while (sem_wait(&gx_jack::jack_sync_sem) == EINTR); |
163 | 197 | } |
164 | 198 | |
165 | 199 | #define max(x,y) (((x)>(y)) ? (x) : (y)) |
166 | 200 | #define min(x,y) (((x)<(y)) ? (x) : (y)) |
201 | ||
202 | //FIXME (temporary)hack to support older compiler versions | |
203 | inline float pow(float b, float e) { return ::powf(b, e); } | |
204 | inline double pow(double b, double e){return ::pow(b, e); } | |
205 | inline double pow(double b, int e) { return ::pow(b, (double)e); } | |
206 | inline double pow(int b, double e) { return ::pow((double)b, e); } | |
207 | inline double pow(double b, float e){ return ::pow(b, (double)e); } | |
208 | inline double pow(float b, double e){ return ::pow((double)b, e); } | |
209 | inline float pow(float b, int e) { return ::powf(b, (float) e); } | |
210 | inline float pow(int b, float e) { return ::powf((float)b, e); } | |
167 | 211 | |
168 | 212 | template <int N> inline float faustpower(float x) { return powf(x,N); } |
169 | 213 | template <int N> inline double faustpower(double x) { return pow(x,N); } |
253 | 297 | faust_add_callback("delay.on_off", delay::activate); |
254 | 298 | faust_add_callback("echo.on_off", echo::activate); |
255 | 299 | faust_add_callback("chorus.on_off", chorus::activate); |
300 | list<inidef>& inilist = get_inilist(); | |
256 | 301 | for (list<inidef>::iterator i = inilist.begin(); i != inilist.end(); i++) { |
257 | 302 | try { |
258 | 303 | i->func(samplingFreq); |
27 | 27 | /* ----- main engine ----- */ |
28 | 28 | namespace gx_engine |
29 | 29 | { |
30 | float checky = 1.0; | |
30 | GxEngineState checky = kEngineOn; | |
31 | 31 | float* get_frame = NULL; |
32 | 32 | float* get_frame1 = NULL; |
33 | 33 | float* checkfreq = NULL; |
74 | 74 | /* --------- menu function triggering engine on/off/bypass --------- */ |
75 | 75 | void gx_engine_switch (GtkWidget* widget, gpointer arg) |
76 | 76 | { |
77 | gx_engine::GxEngineState estate = | |
78 | (gx_engine::GxEngineState)gx_engine::checky; | |
77 | gx_engine::GxEngineState estate = gx_engine::checky; | |
79 | 78 | |
80 | 79 | switch (estate) |
81 | 80 | { |
104 | 103 | ); |
105 | 104 | } |
106 | 105 | |
107 | gx_engine::checky = (float)estate; | |
106 | gx_engine::checky = estate; | |
108 | 107 | gx_refresh_engine_status_display(); |
109 | 108 | } |
110 | 109 | |
111 | 110 | /* -------------- refresh engine status display ---------------- */ |
112 | 111 | void gx_refresh_engine_status_display() |
113 | 112 | { |
114 | gx_engine::GxEngineState estate = | |
115 | (gx_engine::GxEngineState)gx_engine::checky; | |
113 | gx_engine::GxEngineState estate = gx_engine::checky; | |
116 | 114 | |
117 | 115 | string state; |
118 | 116 |
692 | 692 | { |
693 | 693 | openVerticalBox("compressor"); |
694 | 694 | { |
695 | create_selector("compressor.pp"); | |
695 | 696 | openSpaceBox(""); |
696 | 697 | closeBox(); |
697 | 698 | create_smallknob("compressor.ratio"); |
749 | 750 | //----- overdrive |
750 | 751 | openVerticalBox("overdrive"); |
751 | 752 | { |
753 | create_selector("overdrive.pp"); | |
752 | 754 | openSpaceBox(""); |
753 | 755 | closeBox(); |
754 | 756 | create_smallknob("overdrive.drive"," drive "); |
764 | 766 | //----- distortion |
765 | 767 | openVerticalBox("distortion"); |
766 | 768 | { |
769 | create_selector("distortion.pp"); | |
767 | 770 | create_selector("distortiont.onetwo"); |
768 | 771 | //create_switch(sw_switch, "distortion.onetwo", ""); |
769 | 772 | openVerticalSwitchBox(" ",0, 0, &gx_engine::audio.witchdistortion); |
960 | 963 | //----- freeverb |
961 | 964 | openVerticalBox(" freeverb"); |
962 | 965 | { |
966 | create_selector("freeverb.pp"); | |
963 | 967 | openSpaceBox(""); |
964 | 968 | closeBox(); |
965 | 969 | create_smallknob("freeverb.RoomSize"); |
1008 | 1012 | //----- IR |
1009 | 1013 | openVerticalBox("IR"); |
1010 | 1014 | { |
1015 | create_selector("IR.pp"); | |
1011 | 1016 | create_selector("IR.auto_freq"); |
1012 | 1017 | openHorizontalBox(""); |
1013 | 1018 | { |
1095 | 1100 | //----- crybaby |
1096 | 1101 | openVerticalBox("crybaby"); |
1097 | 1102 | { |
1103 | create_selector("crybaby.pp"); | |
1098 | 1104 | create_selector("crybaby.autowah"); |
1099 | 1105 | //create_switch(sw_minitoggle, "crybaby.autowah"," autowah"); |
1100 | 1106 | create_smallknob("crybaby.wah"," wah "); |
1171 | 1177 | //----- echo |
1172 | 1178 | openVerticalBox("echo"); |
1173 | 1179 | { |
1180 | create_selector("echo.pp"); | |
1174 | 1181 | openSpaceBox(""); |
1175 | 1182 | closeBox(); |
1176 | 1183 | openHorizontalBox(""); |
1216 | 1223 | { |
1217 | 1224 | openVerticalBox("delay"); |
1218 | 1225 | { |
1226 | create_selector("delay.pp"); | |
1219 | 1227 | openSpaceBox(""); |
1220 | 1228 | closeBox(); |
1221 | 1229 | openHorizontalBox(""); |
264 | 264 | static gboolean gx_engine_restart(gpointer data) |
265 | 265 | { |
266 | 266 | usleep(5); |
267 | checky = (float)kEngineOn; | |
267 | checky = kEngineOn; | |
268 | 268 | return false; |
269 | 269 | } |
270 | 270 | |
273 | 273 | { |
274 | 274 | // set engine off for one GTK thread cycle to avoid Xrun at startup |
275 | 275 | gx_gui::g_threads[4] = g_idle_add_full(G_PRIORITY_HIGH_IDLE+20,gx_engine_restart,NULL,NULL); |
276 | checky = (float)kEngineOff; | |
276 | checky = kEngineOff; | |
277 | 277 | |
278 | 278 | // set autoconnect capture to user capture port |
279 | 279 | if (!optvar[JACK_INP].empty()) |
646 | 646 | //---- jack buffer size change callback |
647 | 647 | int gx_jack_buffersize_callback (jack_nframes_t nframes,void* arg) |
648 | 648 | { |
649 | GxEngineState estate = (GxEngineState)checky; | |
649 | GxEngineState estate = checky; | |
650 | 650 | |
651 | 651 | // turn off engine |
652 | 652 | // Note: simply changing checky is enough to "stop" processing |
658 | 658 | // immediately during the jack_processing of jack cycles. |
659 | 659 | |
660 | 660 | if (estate != kEngineOff) |
661 | checky = (float)kEngineOff; | |
661 | checky = kEngineOff; | |
662 | 662 | |
663 | 663 | jack_bs = nframes; |
664 | 664 | |
697 | 697 | } |
698 | 698 | |
699 | 699 | // restore previous state |
700 | checky = (float)estate; | |
700 | checky = estate; | |
701 | 701 | // return 0 to jack |
702 | 702 | return 0; |
703 | 703 |
31 | 31 | * ---------------------------------------------------------------------------- |
32 | 32 | */ |
33 | 33 | |
34 | #include "giomm/init.h" | |
35 | #include "gtkmm/main.h" | |
34 | #include <giomm/init.h> | |
35 | #include <gtkmm/main.h> | |
36 | #include <gxwmm/init.h> | |
36 | 37 | #include "guitarix.h" |
37 | 38 | |
38 | 39 | using namespace gx_system; |
65 | 66 | // ----------------------- init basic subsystems ---------------------- |
66 | 67 | Glib::thread_init(); |
67 | 68 | Glib::init(); |
69 | Gxw::init(); | |
68 | 70 | |
69 | 71 | // ------ initialize parameter list ------ |
72 | gx_engine::audio.register_parameter(); | |
73 | gx_engine::midi.register_parameter(); | |
74 | gx_engine::register_faust_parameters(); | |
70 | 75 | gx_preset::init(); |
71 | 76 | gx_gui::parameter_map.set_init_values(); |
72 | 77 | |
106 | 111 | // ----------------------- run GTK main loop ---------------------- |
107 | 112 | gx_set_override_options(optvar); |
108 | 113 | gx_ui::GxUI::updateAllGuis(); |
114 | g_type_class_unref (g_type_class_ref (GTK_TYPE_IMAGE_MENU_ITEM)); | |
115 | g_object_set (gtk_settings_get_default (), "gtk-menu-images", TRUE, NULL); | |
109 | 116 | gui->show(); |
110 | 117 | |
111 | 118 | if (gx_jack::client) { |
1070 | 1070 | { |
1071 | 1071 | GtkWidget * scrollbox = gtk_scrolled_window_new(NULL,NULL); |
1072 | 1072 | gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrollbox),GTK_POLICY_AUTOMATIC,GTK_POLICY_NEVER); |
1073 | gtk_widget_set_size_request (scrollbox, 338, -1); | |
1073 | gtk_widget_set_size_request (scrollbox, 358, -1); | |
1074 | 1074 | GtkWidget * box = gtk_vbox_new (homogene, 0); |
1075 | 1075 | GtkWidget * box1 = gtk_hbox_new (homogene, 0); |
1076 | 1076 | gtk_container_set_border_width (GTK_CONTAINER (box), 0); |
673 | 673 | return; |
674 | 674 | } |
675 | 675 | jp.check_expect(gx_system::JsonParser::value_string); |
676 | int up = round(upper); | |
676 | int up = int(round(upper)); | |
677 | 677 | int n = 0; |
678 | 678 | for (; n <= up; n++) { |
679 | 679 | if (jp.current_value() == value_names[n]) { |
234 | 234 | // index for keyboard shortcut (can take any list) |
235 | 235 | vector<GtkMenuItem*>::iterator its; |
236 | 236 | int pos = 0; |
237 | for (its = pm_list[lindex].begin() ; its < pm_list[lindex].end(); its++ ) | |
237 | for (its = pm_list[lindex].begin() ; its != pm_list[lindex].end(); its++ ) | |
238 | 238 | { |
239 | 239 | pos++; |
240 | 240 | } |
282 | 282 | { |
283 | 283 | vector<string>::iterator its; |
284 | 284 | int pos = 0; |
285 | for (its = plist.begin() ; its < plist.end(); its++ ) | |
285 | for (its = plist.begin() ; its != plist.end(); its++ ) | |
286 | 286 | { |
287 | 287 | pos++; |
288 | 288 | if( presname == *its) |
297 | 297 | vector<string>::iterator its; |
298 | 298 | vector<GtkMenuItem*>::iterator it = pm_list[lindex].begin(); |
299 | 299 | int pos = 0; |
300 | for (its = plist.begin() ; its < plist.end(); its++ ) | |
300 | for (its = plist.begin() ; its != plist.end(); its++ ) | |
301 | 301 | { |
302 | 302 | pos++; |
303 | 303 | if( name == *its) |
323 | 323 | gx_build_preset_list(); |
324 | 324 | } |
325 | 325 | vector<string>::iterator its; |
326 | for (its = plist.begin() ; its < plist.end(); its++) { | |
326 | for (its = plist.begin() ; its != plist.end(); its++) { | |
327 | 327 | gx_add_preset_to_menus(*its); |
328 | 328 | } |
329 | 329 | } |
368 | 368 | { |
369 | 369 | GtkMenuItem* const itemi = |
370 | 370 | gx_get_preset_item_from_name(LOAD_PRESET_LIST, gx_current_preset); |
371 | for (it = pm_list[LOAD_PRESET_LIST].begin() ; it < pm_list[LOAD_PRESET_LIST].end(); it++ ) | |
371 | for (it = pm_list[LOAD_PRESET_LIST].begin() ; it != pm_list[LOAD_PRESET_LIST].end(); it++ ) | |
372 | 372 | { |
373 | 373 | if( itemi == *it) |
374 | 374 | break; |
400 | 400 | { |
401 | 401 | GtkMenuItem* const itemi = |
402 | 402 | gx_get_preset_item_from_name(LOAD_PRESET_LIST, gx_current_preset); |
403 | for (it = pm_list[LOAD_PRESET_LIST].begin() ; it < pm_list[LOAD_PRESET_LIST].end(); it++ ) | |
403 | for (it = pm_list[LOAD_PRESET_LIST].begin() ; it != pm_list[LOAD_PRESET_LIST].end(); it++ ) | |
404 | 404 | { |
405 | 405 | if( itemi == *it) |
406 | 406 | break; |
646 | 646 | // retrieve preset name |
647 | 647 | vector<GtkMenuItem*>::iterator it = pm_list[LOAD_PRESET_LIST].begin(); |
648 | 648 | vector<string>::iterator its = plist.begin() ;; |
649 | for (it = pm_list[LOAD_PRESET_LIST].begin() ; it < pm_list[LOAD_PRESET_LIST].end(); it++ ) | |
649 | for (it = pm_list[LOAD_PRESET_LIST].begin() ; it != pm_list[LOAD_PRESET_LIST].end(); it++ ) | |
650 | 650 | { |
651 | 651 | if( menuitem == *it) |
652 | 652 | break; |
816 | 816 | |
817 | 817 | vector<GtkMenuItem*>::iterator it; |
818 | 818 | |
819 | for (it = pm_list[SAVE_PRESET_LIST].begin() ; it < pm_list[LOAD_PRESET_LIST].end(); it++ ) { | |
819 | for (it = pm_list[SAVE_PRESET_LIST].begin() ; it != pm_list[SAVE_PRESET_LIST].end(); it++ ) { | |
820 | 820 | if( menuitem == *it) { |
821 | 821 | break; |
822 | 822 | } |
854 | 854 | vector<string>::iterator its; |
855 | 855 | vector<GtkMenuItem*>::iterator it = pm_list[SAVE_PRESET_LIST].begin(); |
856 | 856 | |
857 | for (its = plist.begin() ; its < plist.end(); its++ ) | |
857 | for (its = plist.begin() ; its != plist.end(); its++ ) | |
858 | 858 | { |
859 | 859 | // found a match |
860 | 860 | if (presname == *its) |
972 | 972 | { |
973 | 973 | vector<string>::iterator its = plist.begin(); |
974 | 974 | vector<GtkMenuItem*>::iterator it = pm_list[RENAME_PRESET_LIST].begin(); |
975 | for (it = pm_list[RENAME_PRESET_LIST].begin() ; it < pm_list[RENAME_PRESET_LIST].end(); it++ ) | |
975 | for (it = pm_list[RENAME_PRESET_LIST].begin() ; it != pm_list[RENAME_PRESET_LIST].end(); it++ ) | |
976 | 976 | { |
977 | 977 | if( menuitem == *it) |
978 | 978 | break; |
1325 | 1325 | { |
1326 | 1326 | s = ""; |
1327 | 1327 | |
1328 | int abs_i = abs(double(i)); | |
1329 | do | |
1330 | { | |
1328 | int abs_i = abs(i); | |
1329 | do { | |
1331 | 1330 | // note: using base 10 since 10 digits (0123456789) |
1332 | 1331 | char c = static_cast<char>(ASCII_START+abs_i%10); |
1333 | 1332 | s.insert(0, &c, 1); |
103 | 103 | gboolean gx_do_program_change(gpointer arg) |
104 | 104 | { |
105 | 105 | int pgm = GPOINTER_TO_INT(arg); |
106 | gx_engine::GxEngineState estate = | |
107 | (gx_engine::GxEngineState)gx_engine::checky; | |
106 | gx_engine::GxEngineState estate = gx_engine::checky; | |
108 | 107 | if (gx_preset::gx_nth_preset(pgm)) |
109 | 108 | { |
110 | 109 | if (estate == gx_engine::kEngineBypass) |
63 | 63 | bool foverdrive4; |
64 | 64 | bool fcheckbox4; |
65 | 65 | bool fcheckbox6; |
66 | bool fcheckbox7; | |
66 | int fcheckbox7; | |
67 | 67 | bool fcheckbox8; |
68 | bool fdelay; | |
68 | int fdelay; | |
69 | 69 | bool fmultifilter; |
70 | 70 | bool fboost; |
71 | bool fchorus; | |
71 | int fchorus; | |
72 | 72 | float ffuse; |
73 | 73 | bool fdialogbox1; |
74 | 74 | bool fdialogbox2; |
102 | 102 | bool ftube3e; |
103 | 103 | float upsample_mode; |
104 | 104 | float fampexpand; |
105 | bool fsloop; | |
105 | int fsloop; | |
106 | 106 | float witchdistortion; |
107 | 107 | bool fdis1; |
108 | 108 | bool fcab; |
112 | 112 | float witchamp; |
113 | 113 | bool famp2; |
114 | 114 | int tonestack; |
115 | ||
116 | AudioVariables(); | |
115 | int crybabypp; | |
116 | int overdrivepp; | |
117 | int distortionpp; | |
118 | int freeverbpp; | |
119 | int IRpp; | |
120 | int compressorpp; | |
121 | int echopp; | |
122 | int delaypp; | |
123 | ||
124 | void register_parameter(); | |
117 | 125 | }; |
118 | 126 | |
119 | 127 | extern AudioVariables audio; |
178 | 186 | float BeatFilter2; |
179 | 187 | float BeatFilterk; |
180 | 188 | |
181 | MidiVariables(); | |
189 | void register_parameter(); | |
182 | 190 | void init(int samplingFreq); |
183 | 191 | }; |
184 | 192 | |
198 | 206 | inline void turnOnMidi() { audio.midistate = kMidiOn; } |
199 | 207 | |
200 | 208 | /* function declarations */ |
209 | void register_faust_parameters(); | |
201 | 210 | void gx_engine_init( const string *optvar ); |
202 | 211 | void gx_engine_reset(); |
203 | 212 | void faust_init(int samplingFreq); |
43 | 43 | } GxMidiState; |
44 | 44 | |
45 | 45 | /* global var declarations */ |
46 | extern float checky; | |
46 | extern GxEngineState checky; | |
47 | 47 | extern float* get_frame; |
48 | 48 | extern float* get_frame1; |
49 | 49 | extern float* checkfreq; |
50 | 50 | { |
51 | 51 | public: |
52 | 52 | bool setup(int srcRate, int dstRate, int nchan); |
53 | int get_max_out_size(int i_size) { return (i_size * ratio_b() + ratio_a() - 1) / ratio_a(); } | |
53 | int get_max_out_size(int i_size) { return (i_size * ratio_b()) / ratio_a() + 1; } | |
54 | 54 | int process(int count, float *input, float *output); |
55 | 55 | int flush(float *output); // check source for max. output size |
56 | 56 | }; |
48 | 48 | libpath = [bld.path.find_dir("../libgxw/gxw").bldpath(bld.env), |
49 | 49 | bld.path.find_dir("../libgxwmm/gxwmm").bldpath(bld.env)] |
50 | 50 | uselib_local = [] |
51 | linkflags = [] | |
52 | 51 | else: |
53 | 52 | libpath = [] |
54 | 53 | uselib_local = ['gxwmm','gxw'] |
55 | linkflags = ["-Wl,-u,gxw_init,-u,gxwmm_init"] | |
56 | 54 | bld(features = 'cxx cprogram', |
57 | 55 | includes = incl, |
58 | 56 | cxxflags= bld.env['CXXFLAGS'], |
62 | 60 | 'GTK2', 'GTKMM', 'GIOMM', 'ZITA_CONVOLVER', 'FFTW3'], |
63 | 61 | uselib_local = uselib_local, |
64 | 62 | libpath = libpath, |
65 | linkflags = linkflags, | |
66 | 63 | target = bld.env['BIN_NAME'], |
67 | 64 | chmod = 0755, |
68 | 65 | install_path = bld.env['BINDIR'], |
14 | 14 | import Configure, Scripting |
15 | 15 | |
16 | 16 | # used by waf dist and waf build |
17 | VERSION='0.11.0' | |
17 | VERSION='0.11.1' | |
18 | 18 | APPNAME='guitarix' |
19 | 19 | |
20 | good_faust_versions = ['0.9.24','0.9.27'] | |
20 | good_faust_versions = ['0.9.24','0.9.27','0.9.29'] | |
21 | 21 | |
22 | 22 | # these variables are mandatory ('/' are converted automatically) |
23 | 23 | srcdir = '.' |