Am Montag, den 25.07.2011, 13:11 +0200 schrieb R.Wolff: > > On 24.07.2011 13:12, wrote hermann: > > > Hello > > > > I like to announce the first release of gxtuner, a simple, small and > > lightweight guitar/bass tuner for jack. > > > > gxtuner comes with a analogue like interface (scale), show the tune > > (char) and the accumulated frequency (Hz) and is licensed under the GPL. > > > > It's a break out of the guitarix tuner module, you can download it here: > > > > http://sourceforge.net/projects/guitarix/files/gxtuner/gxtuner-1.0.tar.bz2/download > > > > have fun > > hermann > > > > Hi Hermann, > nice, but could the graphics be larger or scalable? On my screen res. of 1600x1200 > I can barely see it. > Thank you very much for the guitar tools. > > Raphael ;) Hi Raphael I'm glade to hear you like it. Well, here is a small patch to make gxtuner scalable. Put it into the source directory /gxtuner and run patch <patch-gxtuner-scale.patch after that run make && make install and you have a (ZUI) scalable tuner interface. greats hermann
--- ../gxtuner-1.0/gxtuner.cpp 2011-07-24 12:07:27.000000000 +0200 +++ ./gxtuner.cpp 2011-07-25 19:14:55.000000000 +0200 @@ -94,7 +94,7 @@ P_("The frequency for which tuning is displayed"), 0.0, 1000.0, 0.0, GParamFlags(GTK_PARAM_READWRITE))); klass->surface_tuner = cairo_image_surface_create( - CAIRO_FORMAT_ARGB32, tuner_width, tuner_height); + CAIRO_FORMAT_ARGB32, tuner_width*2., tuner_height*2.); g_assert(klass->surface_tuner != NULL); draw_background(klass->surface_tuner); } @@ -166,13 +166,29 @@ double y0 = (widget->allocation.height - 90) * 0.5; cr = gdk_cairo_create(widget->window); - if (x0 > 0 || y0 > 0) { + cairo_save(cr); + static double grow = 1.; + if (x0/grow > 1 || y0/grow > 1) { cairo_rectangle (cr, 0, 0, widget->allocation.width, widget->allocation.height); cairo_set_source_rgb (cr, 0, 0, 0.04); cairo_fill (cr); } + + if(widget->allocation.width > widget->allocation.height +(10.*grow*2)) { + grow = (widget->allocation.height/90.)/2.; + } else { + grow = (widget->allocation.width/100.)/2.; + } + cairo_translate(cr, -x0*grow, -y0*grow); + cairo_scale(cr, grow, grow); cairo_set_source_surface(cr, GX_TUNER_CLASS(GTK_OBJECT_GET_CLASS(widget))->surface_tuner, x0, y0); cairo_paint (cr); + cairo_restore(cr); + + cairo_save(cr); + cairo_translate(cr, -x0*grow*2., -y0*grow*2.); + cairo_scale(cr, grow*2., grow*2.); + float scale = -0.5; if (tuner->freq) { float fvis = 12 * log2f(tuner->freq/440.0); @@ -223,7 +239,8 @@ double y0 = 0; cr = cairo_create(surface); - + // cairo_translate(cr, -x0*grow, -y0*grow); + cairo_scale(cr, 2, 2); // bottom part of gauge cairo_rectangle (cr, x0,y0+60,rect_width+1,30); cairo_set_source_rgb (cr, 0, 0, 0); @@ -615,7 +632,6 @@ gtk_init (&argc, &argv); GError* err = NULL; GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_default_size(GTK_WINDOW(window),200,110); gtk_window_set_icon_from_file(GTK_WINDOW(window), (std::string(PIXMAPS_DIR) + "/gxtuner.png").c_str(),&err); if (err != NULL) g_error_free(err);
_______________________________________________ Linux-audio-user mailing list Linux-audio-user@xxxxxxxxxxxxxxxxxxxx http://lists.linuxaudio.org/listinfo/linux-audio-user