Added fg/bg pipe defaults, fixed parsing bugs, fixed broken smoothing defaults

This commit is contained in:
Jarcode
2019-04-03 01:20:45 -07:00
parent d72deb8fae
commit c766c574a6
9 changed files with 40 additions and 44 deletions

View File

@@ -536,10 +536,8 @@ void ext_process(struct glsl_ext* ext, const char* f) {
} else parse_error(line, f, "Unexpected `--pipe` binding name '@%s' while parsing GLSL."
" Try assigning a default or binding the value.", parsed_name);
}
state = at == '\n' ? LINE_START : GLSL;
if (bbuf_idx >= sizeof(bbuf) - 1)
state = GLSL;
continue;
else goto copy; /* copy character if it ended the sequence */
}
}
}

View File

@@ -2,25 +2,23 @@
/* Center line thickness (pixels) */
#define C_LINE 1
/* Width (in pixels) of each bar */
#define BAR_WIDTH 4
#define BAR_WIDTH 5
/* Width (in pixels) of each bar gap */
#define BAR_GAP 2
/* Outline color */
#define BAR_OUTLINE #262626
#define BAR_GAP 1
/* Outline width (in pixels, set to 0 to disable outline drawing) */
#define BAR_OUTLINE_WIDTH 0
#define BAR_OUTLINE_WIDTH 1
/* Amplify magnitude of the results each bar displays */
#define AMPLIFY 300
/* Whether the current settings use the alpha channel;
enabling this is required for alpha to function
correctly on X11 with `"native"` transparency */
#define USE_ALPHA 0
/* How strong the gradient changes */
#define GRADIENT_POWER 60
/* Bar color changes with height */
#define GRADIENT (d / GRADIENT_POWER + 1)
/* Bar color */
#define COLOR (#3366b2 * GRADIENT)
/* How quickly the gradient transitions, in pixels */
#define GRADIENT 80
/* Bar color. By default this provides a blue-white gradient. */
#define COLOR @fg:mix(#3366b2, #a0a0b2, clamp(d / GRADIENT, 0, 1))
/* Outline color. By default this provides a 'glint' outline based on the bar color */
#define BAR_OUTLINE @bg:vec4(COLOR.rgb * 1.5, COLOR.a)
/* Direction that the bars are facing, 0 for inward, 1 for outward */
#define DIRECTION 0
/* Whether to switch left/right audio buffers */

View File

@@ -3,7 +3,7 @@
/* center line thickness (pixels) */
#define C_LINE 1.5
/* outline color */
#define OUTLINE #333333
#define OUTLINE @fg:#333333
/* Amplify magnitude of the results each bar displays */
#define AMPLIFY 150
/* Angle (in radians) for how much to rotate the visualizer */

View File

@@ -5,10 +5,10 @@
#define DIRECTION 1
/* Color gradient scale, (optionally) used in `COLOR` macro */
#define GRADIENT_SCALE 75
#define GRADIENT 75
/* Color definition. By default this is a gradient formed by mixing two colors.
`pos` represents the pixel position relative to the visualizer baseline. */
#define COLOR mix(#802A2A, #4F4F92, clamp(pos / GRADIENT_SCALE, 0, 1))
#define COLOR @fg:mix(#802A2A, #4F4F92, clamp(pos / GRADIENT, 0, 1))
/* 1 to draw outline, 0 to disable */
#define DRAW_OUTLINE 0
/* 1 to draw edge highlight, 0 to disable */
@@ -18,7 +18,7 @@
Note: requires `xroot` or `none` opacity to be set */
#define ANTI_ALIAS 0
/* outline color */
#define OUTLINE #262626
#define OUTLINE @bg:#262626
/* 1 to join the two channels together in the middle, 0 to clamp both down to zero */
#define JOIN_CHANNELS 0
/* 1 to invert (vertically), 0 otherwise */

View File

@@ -108,10 +108,11 @@ void render_side(in sampler1D tex, float idx) {
/* and finally set fragment color if we are in range */
#if INVERT > 0
float pos = float(screen.y) - gl_FragCoord.y;
float d = float(screen.y) - gl_FragCoord.y;
#else
float pos = gl_FragCoord.y;
float d = gl_FragCoord.y;
#endif
#define pos d
if (pos + 1.5 <= s) {
fragment = COLOR;
} else {

View File

@@ -4,19 +4,17 @@
/* center line thickness (pixels) */
#define C_LINE 2
/* outline color */
#define OUTLINE #333333
#define OUTLINE @bg:#333333
/* number of bars (use even values for best results) */
#define NBARS 180
#define NBARS 160
/* width (in pixels) of each bar*/
#define BAR_WIDTH 3.5
/* outline color */
#define BAR_OUTLINE OUTLINE
/* outline width (in pixels, set to 0 to disable outline drawing) */
#define BAR_OUTLINE_WIDTH 0
#define BAR_WIDTH 4.5
/* Amplify magnitude of the results each bar displays */
#define AMPLIFY 300
/* Bar color */
#define COLOR (#cc3333 * ((d / 40) + 1))
/* How quickly the gradient transitions, in pixels */
#define GRADIENT 95
/* Bar color. This is a gradient by default. */
#define COLOR @fg:mix(#cc3333, #cca0a0, clamp(d / GRADIENT, 0, 1))
/* Angle (in radians) for how much to rotate the visualizer */
#define ROTATE (PI / 2)
/* Whether to swap left/right audio buffers, set to 1 to enable */
@@ -34,6 +32,10 @@
/* Gravity step, override from `smooth_parameters.glsl` */
#request setgravitystep 5.0
/* Smoothing factor, override from `smooth_parameters.glsl` */
#request setsmoothfactor 0.02
/* (DEPRECATED) outline color */
#define BAR_OUTLINE OUTLINE
/* (DEPRECATED) outline width (in pixels, set to 0 to disable outline drawing) */
#define BAR_OUTLINE_WIDTH 0

View File

@@ -66,6 +66,7 @@ void main() {
idx = -sign(idx) * (TWOPI - dir); /* Re-correct position values to [-pi, pi) */
#if INVERT == 0
idx = -idx; /* Invert if needed */
#endif
float pos = int(abs(idx) / section) / float(NBARS / 2); /* bar position, [0, 1) */
#define smooth_f(tex) smooth_audio(tex, audio_sz, pos) /* smooth function format */
float v;

View File

@@ -39,7 +39,7 @@
/* The frequency range to sample. 1.0 would be the entire FFT output,
and lower values reduce the displayed frequencies in a log-like
scale. */
#define SAMPLE_RANGE 1.5
#define SAMPLE_RANGE 0.9
/* Factor for how to scale higher frequencies. Used in a linear equation
which is multiplied by the result of the fft transformation. */

View File

@@ -1,14 +1,10 @@
/* min (vertical) line thickness */
/* Min (vertical) line thickness */
#define MIN_THICKNESS 1
/* max (vertical) line thickness */
/* Max (vertical) line thickness */
#define MAX_THICKNESS 6
/* base color to use, distance from center will multiply the RGB components */
#define BASE_COLOR vec4(0.7, 0.2, 0.45, 1)
/* amplitude */
/* Base color to use, distance from center will multiply the RGB components */
#define BASE_COLOR @fg:vec4(0.7, 0.2, 0.45, 1)
/* Amplitude */
#define AMPLIFY 500
/* outline color */
#define OUTLINE vec4(0.15, 0.15, 0.15, 1)
/* Outline color */
#define OUTLINE @bg:vec4(0.15, 0.15, 0.15, 1)