summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-04-12 20:22:53 +0200
committerGravatar waker <wakeroid@gmail.com>2012-04-12 20:22:53 +0200
commit1d06cdb31bc39106ab50999a2b4f0b9acf8ffc19 (patch)
tree3e102ec245afb3ee77d4d0e0450dc3ca5e27adf7 /plugins
parent7420ed88b753badcdf51e9c9b731765658bde2c4 (diff)
vis buffer is now always float/mono
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtkui/widgets.c133
-rw-r--r--plugins/supereq/Fftsg_fl.c (renamed from plugins/supereq/Fftsg_fl.cpp)3
-rw-r--r--plugins/supereq/Makefile.am43
3 files changed, 60 insertions, 119 deletions
diff --git a/plugins/gtkui/widgets.c b/plugins/gtkui/widgets.c
index dbdbd50b..afe6c5fa 100644
--- a/plugins/gtkui/widgets.c
+++ b/plugins/gtkui/widgets.c
@@ -1717,25 +1717,21 @@ w_scope_draw_cb (void *data) {
gboolean
scope_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data) {
ddb_waveformat_t fmt;
- char data[DDB_AUDIO_MEMORY_BUFFER_SIZE];
- int size = deadbeef->audio_get_waveform_data (&fmt, data);
- if (fmt.channels && size > 0) {
- cairo_set_source_rgb (cr, 0, 0, 0);
- cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
- cairo_set_line_width (cr, 1);
- GtkAllocation a;
- gtk_widget_get_allocation (widget, &a);
- short *samples = (short *)data;
-
- int nframes = size / (fmt.bps/8*fmt.channels);
- float incr = nframes / (float)a.width;
- float pos = 0;
- for (int x = 0; x < a.width; x++, pos += incr) {
- short s = max (samples[(int)pos*2], samples[(int)pos*2+1]);
- cairo_line_to (cr, x, s * a.height/2 / 0x7fff + a.height/2);
- }
- cairo_stroke (cr);
+ float data[DDB_AUDIO_MEMORY_FRAMES];
+ deadbeef->audio_get_waveform_data (data);
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
+ cairo_set_line_width (cr, 1);
+ GtkAllocation a;
+ gtk_widget_get_allocation (widget, &a);
+
+ float incr = (float)DDB_AUDIO_MEMORY_FRAMES / a.width;
+ float pos = 0;
+ for (int x = 0; x < a.width; x++, pos += incr) {
+ float s = data[(int)pos];
+ cairo_line_to (cr, x, s * a.height/2 / 0x7fff + a.height/2);
}
+ cairo_stroke (cr);
return FALSE;
}
@@ -1743,71 +1739,60 @@ scope_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data) {
gboolean
scope_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data) {
w_scope_t *w = user_data;
- ddb_waveformat_t fmt;
- char data[DDB_AUDIO_MEMORY_BUFFER_SIZE];
- int size = deadbeef->audio_get_waveform_data (&fmt, data);
- if (fmt.channels && size > 0) {
- GtkAllocation a;
- gtk_widget_get_allocation (widget, &a);
+ float data[DDB_AUDIO_MEMORY_FRAMES];
+ deadbeef->audio_get_waveform_data (data);
+ GtkAllocation a;
+ gtk_widget_get_allocation (widget, &a);
- GdkGLDrawable *d = gtk_widget_get_gl_drawable (widget);
- gdk_gl_drawable_gl_begin (d, w->glcontext);
-// if (glXSwapIntervalSGI) {
-// glXSwapIntervalSGI (1);
-// }
+ GdkGLDrawable *d = gtk_widget_get_gl_drawable (widget);
+ gdk_gl_drawable_gl_begin (d, w->glcontext);
+ // if (glXSwapIntervalSGI) {
+ // glXSwapIntervalSGI (1);
+ // }
- glClear (GL_COLOR_BUFFER_BIT);
- glMatrixMode (GL_PROJECTION);
- glLoadIdentity ();
- gluOrtho2D(0,a.width,a.height,0);
- glMatrixMode (GL_MODELVIEW);
- glViewport (0, 0, a.width, a.height);
+ glClear (GL_COLOR_BUFFER_BIT);
+ glMatrixMode (GL_PROJECTION);
+ glLoadIdentity ();
+ gluOrtho2D(0,a.width,a.height,0);
+ glMatrixMode (GL_MODELVIEW);
+ glViewport (0, 0, a.width, a.height);
#if 0
- // vsync test
- static int box = 0;
- static int speed = 5;
- if (box > a.width-50) {
- box = a.width-50;
- speed = -5;
- }
- else if (box < 0) {
- box = 0;
- speed = 5;
- }
- box += speed;
-
- glBegin (GL_QUADS);
- glVertex2f (box, 0);
- glVertex2f (box+50, 0);
- glVertex2f (box+50, 50);
- glVertex2f (box, 50);
- glEnd ();
+ // vsync test
+ static int box = 0;
+ static int speed = 5;
+ if (box > a.width-50) {
+ box = a.width-50;
+ speed = -5;
+ }
+ else if (box < 0) {
+ box = 0;
+ speed = 5;
+ }
+ box += speed;
+
+ glBegin (GL_QUADS);
+ glVertex2f (box, 0);
+ glVertex2f (box+50, 0);
+ glVertex2f (box+50, 50);
+ glVertex2f (box, 50);
+ glEnd ();
#endif
- glBegin (GL_LINE_STRIP);
+ glBegin (GL_LINE_STRIP);
- short *samples = (short *)data;
+ short *samples = (short *)data;
- int nframes = size / (fmt.bps/8*fmt.channels);
- float incr = nframes / (float)a.width;
- float pos = 0;
- for (int x = 0; x < a.width; x++, pos += incr) {
- short s = max (samples[(int)pos*2], samples[(int)pos*2+1]);
- glVertex2f (x, s * a.height/2 / 0x7fff + a.height/2);
- }
+ float incr = (float)DDB_AUDIO_MEMORY_FRAMES / a.width;
+ float pos = 0;
+ for (int x = 0; x < a.width; x++, pos += incr) {
+ float s = data[(int)pos];
+ glVertex2f (x, s * a.height/2 + a.height/2);
+ }
- glEnd();
- gdk_gl_drawable_swap_buffers (d);
+ glEnd();
+ gdk_gl_drawable_swap_buffers (d);
- gdk_gl_drawable_gl_end (d);
- }
- else {
- GdkGLDrawable *d = gtk_widget_get_gl_drawable (widget);
- gdk_gl_drawable_gl_begin (d, w->glcontext);
- glClear (GL_COLOR_BUFFER_BIT);
- gdk_gl_drawable_swap_buffers (d);
- gdk_gl_drawable_gl_end (d);
- }
+ gdk_gl_drawable_gl_end (d);
return FALSE;
diff --git a/plugins/supereq/Fftsg_fl.cpp b/plugins/supereq/Fftsg_fl.c
index 636f8b8a..d66ae896 100644
--- a/plugins/supereq/Fftsg_fl.cpp
+++ b/plugins/supereq/Fftsg_fl.c
@@ -285,8 +285,6 @@ Appendix :
w[] and ip[] are compatible with all routines.
*/
-extern "C" {
-
void cdft(int n, int isgn, REAL *a, int *ip, REAL *w)
{
void makewt(int nw, int *ip, REAL *w);
@@ -2650,4 +2648,3 @@ void dstsub(int n, REAL *a, int nc, REAL *c)
}
a[m] *= c[0];
}
-}
diff --git a/plugins/supereq/Makefile.am b/plugins/supereq/Makefile.am
index 4ce19ee5..0096e4ab 100644
--- a/plugins/supereq/Makefile.am
+++ b/plugins/supereq/Makefile.am
@@ -1,48 +1,7 @@
if HAVE_SUPEREQ
supereqdir = $(libdir)/$(PACKAGE)
pkglib_LTLIBRARIES = supereq.la
-supereq_la_SOURCES = supereq.c Equ.cpp Equ.h Fftsg_fl.cpp paramlist.hpp
-
-#nsfft-1.00/simd/SIMDBaseUndiff.c\
-#nsfft-1.00/simd/SIMDBase.c\
-#nsfft-1.00/dft/DFT.c\
-#nsfft-1.00/dft/DFTUndiff.c\
-#nsfft-1.00/simd/SIMDBase.h\
-#nsfft-1.00/simd/SIMDBaseUndiff.h\
-#nsfft-1.00/dft/DFTUndiff.h\
-#nsfft-1.00/dft/DFT.h\
-#shibatch_rdft.c
-
-#ffmpeg_fft/libavutil/mem.c\
-#ffmpeg_fft/libavutil/mathematics.c\
-#ffmpeg_fft/libavutil/rational.c\
-#ffmpeg_fft/libavutil/intfloat_readwrite.c\
-#ffmpeg_fft/libavcodec/dct.c\
-#ffmpeg_fft/libavcodec/avfft.c\
-#ffmpeg_fft/libavcodec/fft.c\
-#ffmpeg_fft/libavcodec/dct32.c\
-#ffmpeg_fft/libavcodec/rdft.c\
-#ffmpeg_fft/libavutil/intfloat_readwrite.h\
-#ffmpeg_fft/libavutil/avutil.h\
-#ffmpeg_fft/libavutil/common.h\
-#ffmpeg_fft/libavutil/attributes.h\
-#ffmpeg_fft/libavutil/mem.h\
-#ffmpeg_fft/libavutil/avconfig.h\
-#ffmpeg_fft/libavutil/mathematics.h\
-#ffmpeg_fft/libavutil/rational.h\
-#ffmpeg_fft/publik.h\
-#ffmpeg_fft/ffmpeg_fft.h\
-#ffmpeg_fft/libavcodec/dct32.h\
-#ffmpeg_fft/libavcodec/fft.h\
-#ffmpeg_fft/libavcodec/avfft.h\
-#ffmpeg_fft/config.h\
-#ff_rdft.c
-
-#AM_CFLAGS = $(CFLAGS) -I ffmpeg_fft -I ffmpeg_fft/libavcodec -I ffmpeg_fft/libavutil -std=c99
-#AM_CPPFLAGS = $(CXXFLAGS) -fno-exceptions -fno-rtti -nostdlib -fno-unwind-tables -I ffmpeg_fft -I ffmpeg_fft/libavcodec -I ffmpeg_fft/libavutil
-
-#AM_CFLAGS = $(CFLAGS) -I nsfft-1.00/dft -I nsfft-1.00/simd -std=c99 -msse -DENABLE_SSE_FLOAT -DUSE_SHIBATCH
-#AM_CPPFLAGS = $(CXXFLAGS) -fno-exceptions -fno-rtti -nostdlib -fno-unwind-tables -I nsfft-1.00/dft -I nsfft-1.00/simd -msse -DENABLE_SSE_FLOAT -DUSE_SHIBATCH
+supereq_la_SOURCES = supereq.c Equ.cpp Equ.h Fftsg_fl.c paramlist.hpp
AM_CFLAGS = $(CFLAGS) -std=c99 -DUSE_OOURA
AM_CPPFLAGS = $(CXXFLAGS) -fno-exceptions -fno-rtti -nostdlib -fno-unwind-tables -DUSE_OOURA