Mercurial > audlegacy-plugins
diff src/spectrum/spectrum.c @ 1325:a33da9237bed
Several "i18n" improvements.
| author | Stany HENRY <StrassBoy@gmail.com> |
|---|---|
| date | Sat, 21 Jul 2007 17:55:46 +0200 |
| parents | b10c821f0b4e |
| children | 761e17b23e0c |
line wrap: on
line diff
--- a/src/spectrum/spectrum.c Sat Jul 21 10:26:23 2007 -0500 +++ b/src/spectrum/spectrum.c Sat Jul 21 17:55:46 2007 +0200 @@ -1,7 +1,7 @@ /* Spectrum Analyzer Visualization Plugin for Audacious * * Copyright (C) 2006 William Pitcock - * Copyright (C) 1998-2001 Vágvölgyi Attila, Peter Alm, Mikael Alm, + * Copyright (C) 1998-2001 V�gv�lgyi Attila, Peter Alm, Mikael Alm, * Olle Hallnas, Thomas Nilsson and 4Front Technologies * * This program is free software; you can redistribute it and/or modify @@ -25,6 +25,7 @@ #include <math.h> #include <audacious/plugin.h> #include <audacious/util.h> +#include <audacious/i18n.h> #include "logo.xpm" @@ -64,7 +65,7 @@ NULL, "Spectrum Analyzer", 0, - 1, + 1, fsanalyzer_init, /* init */ fsanalyzer_cleanup, /* cleanup */ NULL, /* about */ @@ -92,7 +93,7 @@ return; window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_title(GTK_WINDOW(window),"Spectrum Analyzer"); + gtk_window_set_title(GTK_WINDOW(window), _("Spectrum Analyzer")); gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE); gtk_widget_realize(window); bg_pixmap = gdk_pixmap_create_from_xpm_d(window->window,NULL,NULL,logo_xpm); @@ -102,13 +103,13 @@ gtk_widget_set_size_request(GTK_WIDGET(window), WIDTH, HEIGHT); gc = gdk_gc_new(window->window); draw_pixmap = gdk_pixmap_new(window->window,WIDTH,HEIGHT,gdk_rgb_get_visual()->depth); - + bar = gdk_pixmap_new(window->window,25, HEIGHT, gdk_rgb_get_visual()->depth); for(i = 0; i < HEIGHT / 2; i++) { color.red = 0xFFFF; color.green = ((i * 255) / (HEIGHT / 2)) << 8; color.blue = 0; - + gdk_color_alloc(gdk_colormap_get_system(),&color); gdk_gc_set_foreground(gc,&color); gdk_draw_line(bar,gc,0,i,24,i); @@ -117,17 +118,17 @@ color.red = (255 - ((i * 255) / (HEIGHT / 2))) <<8; color.green = 0xFFFF; color.blue = 0; - + gdk_color_alloc(gdk_colormap_get_system(),&color); gdk_gc_set_foreground(gc,&color); gdk_draw_line(bar,gc,0,i + (HEIGHT / 2),24,i + (HEIGHT / 2)); } - + scale = HEIGHT / ( log((1 - d) / d) * 2 ); x00 = d*d*32768.0/(2 * d - 1); y00 = -log(-x00) * scale; -/* d=0.2, HEIGHT=128 +/* d=0.2, HEIGHT=128 scale = 46.1662413084; x00 = -2184.53333333; y00 = -354.979500941; @@ -135,12 +136,12 @@ gdk_color_black(gdk_colormap_get_system(),&color); gdk_gc_set_foreground(gc,&color); - + area = gtk_drawing_area_new(); gtk_container_add(GTK_CONTAINER(window),area); gtk_widget_realize(area); gdk_window_set_back_pixmap(area->window,bg_pixmap,0); - + gtk_widget_show(area); gtk_widget_show(window); gdk_window_clear(window->window); @@ -171,13 +172,13 @@ static gint draw_func(gpointer data) { gint i; - + /* FIXME: should allow spare redrawing like the vis. in the main window */ if(!window) { /* timeout_tag = 0;*/ return FALSE; } - + GDK_THREADS_ENTER(); gdk_draw_rectangle(draw_pixmap, gc, TRUE, 0, 0, WIDTH, HEIGHT); @@ -186,7 +187,7 @@ gdk_window_clear(area->window); GDK_THREADS_LEAVE(); - + return TRUE; }
