[LAD] [ANN] guitarix-0.04.4-1 release

James Warden warjamy at yahoo.com
Fri May 22 16:07:38 UTC 2009


Hermann,

I added a Latency menu to guitarix. You can now change the jack server latency on the fly from guitarix (a la ardour). See patches below:

--------- PATCH Start guitarix.cpp -----------
Index: guitarix.cpp
===================================================================
--- guitarix.cpp	(revision 125)
+++ guitarix.cpp	(working copy)
@@ -9,7 +9,7 @@
 
 
 // global static fields
-GtkWidget* fWindow, *menul, *menus, *pb, *midibox, *fbutton, *label1, *menuh;
+GtkWidget* fWindow, *menul, *menus, *menulat, *pb, *midibox, *fbutton, *label1, *menuh;
 GdkPixbuf*   ib, *ibm, *ibr;
 GtkStatusIcon*  status_icon;
 GtkWidget* livewa;
@@ -203,6 +203,32 @@
 bool		GTKUI::fInitialized = false;
 list<UI*>	UI::fGuiList;
 
+//----menu function latency
+void set_jack_buffer_size(GtkCheckMenuItem *menuitem, gpointer arg)
+{
+  // let's avoid triggering the jack server on "inactive"
+  if (gtk_check_menu_item_get_active(menuitem) == false)
+    return;
+
+  // are we a proper jack client ?
+  if (!client) {
+    cerr << "<*** guitarix.cpp: set_jack_buffer_size()"
+	 << " we are not a jack client, server may be down ***>" 
+	 << endl;
+    return;
+  }
+
+
+  // if the buffer size is the same, no need to trigger it
+  jack_nframes_t buf_size = (jack_nframes_t)GPOINTER_TO_INT(arg);
+
+  if (buf_size == jack_get_buffer_size(client))
+    return;
+
+  // let's resize the buffer
+  jack_set_buffer_size(client, buf_size);
+}
+
 //----menu funktion play stop
 void play_function (GtkCheckMenuItem *menuitem, gpointer checkplay)
 {
---------- PATCH END guitarix.cpp --------------




---------- PATCH START GTKUI.cpp ---------------
Index: GTKUI.cpp
===================================================================
--- GTKUI.cpp	(revision 125)
+++ GTKUI.cpp	(working copy)
@@ -897,6 +897,7 @@
     GtkWidget *menuHelp;
     GtkWidget *menuLoad;
     GtkWidget *menuSave;
+    GtkWidget *menuLatency;
     GtkWidget *menubar;
     GtkWidget *menu;
     GtkWidget *menu1;
@@ -948,6 +949,40 @@
     gtk_widget_show (menuitem);
     /*---------------- End Engine menu declarations ----------------*/
 
+    /*---------------- Create Latency menu items --------------------*/
+    /*-- Create  Latency submenu under Engine submenu --*/
+    menuLatency = gtk_menu_item_new_with_label ("Latency");
+    gtk_menu_bar_append (GTK_MENU_BAR(menubar), menuLatency);
+    menulat = gtk_menu_new();
+    gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuLatency), menulat);
+
+    /*-- Create  menu item under Latency submenu --*/
+    gchar buf_size[8];
+    const int min_pow = 5;  // 2**5  = 32
+    const int max_pow = 13; // 2**13 = 8192
+    group = NULL;
+
+    for (int i = min_pow; i <= max_pow; i++) {  
+      int jack_buffer_size = (int)pow(2.,i);
+      (void)snprintf(buf_size, 5, "%d", jack_buffer_size);
+      menuitem = gtk_radio_menu_item_new_with_label (group, buf_size);
+      group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem));
+      gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), FALSE);
+      
+      g_signal_connect (GTK_OBJECT (menuitem), "activate", 
+			GTK_SIGNAL_FUNC (set_jack_buffer_size), 
+			GINT_TO_POINTER(jack_buffer_size));
+
+      // display actual buffer size as default
+      if (client)
+	if (jack_buffer_size == (int)jack_get_buffer_size(client))
+	  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), TRUE);
+
+      gtk_menu_append(GTK_MENU(menulat), menuitem);
+      gtk_widget_show (menuitem);
+    }
+    /*---------------- End Latency menu declarations ----------------*/
+
     /*---------------- Create Settings menu items --------------------*/
     menuEdit = gtk_menu_item_new_with_label ("Presets");
     gtk_menu_bar_append (GTK_MENU_BAR(menubar), menuEdit);
@@ -1074,6 +1109,7 @@
     gtk_widget_show(handlebox);   // remove handelbox here
     gtk_widget_show(menuitem);
     gtk_widget_show(menuFile);
+    gtk_widget_show(menuLatency);
     gtk_widget_show(menuEdit);
     gtk_widget_show(menuLoad);
     gtk_widget_show(menuSave);
------------ PATCH END GTKUI.cpp

Feel free to add this functionality or not.

Cheers!
J.












--- On Thu, 5/21/09, hermann meyer <brummer- at web.de> wrote:

> From: hermann meyer <brummer- at web.de>
> Subject: [LAD]  [ANN] guitarix-0.04.4-1 release
> To: linux-audio-dev at lists.linuxaudio.org
> Date: Thursday, May 21, 2009, 8:56 AM
> guitarix is a simple Linux Rock
> Guitar amplifier for jack(Jack Audio Connektion Kit)
> with one input and two outputs. Designed to get nice
> thrash/metal/rock/blues
> guitar sounds. . . .
> 
> 
> Some new effect's in the amp section with new controllers,
> overworked tuner, overworked midi output 
> (still it is experimental but can be usefull for rhythm
> blues or jazz or. . . fun)
> 
> Many thanks to Orcan Ogetbil (Fedora) for give the right
> hint to impruve the tuner,
> and the patch's to create a proper Makefile and more,
> thanks Orcan. 
> 
> have fun
> ________________________________________________________________________
> 
> guitarix based on Gtk, a great part is also realesed as
> ladspa plugin.
> guitarix is licensed under GPL
> 
> Projektpage with screenshots:
>         http://guitarix.sourceforge.net/
> 
> download:
>         http://sourceforge.net/projects/guitarix/
> 
> 
> For capture guitarix make use of jack_capture ver >=
> 0.9.30 from Kjetil
> S. Matheussen. If you dont have it installed, look here:
> 
>         http://old.notam02.no/arkiv/src/?M=D
> 
> For extra Impulse Response guitarix make use of jconv from
> Fons Adriaensen. If
> you dont have it installed, look here:
> 
>         http://www.kokkinizita.net/linuxaudio/index.html
> 
> I use faust to build the prototype and will say thanks to
>                
>         : Julius Smith
>         http://ccrma.stanford.edu/realsimple/faust/
>                
>         : Albert Graef
>         http://www.musikwissenschaft.uni-mainz.de/~ag/ag.html
>                
>         : Yann Orlary 
>         http://faust.grame.fr/
> 
> 
> regards    hermann
> 
> _______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev at lists.linuxaudio.org
> http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
> 


      



More information about the Linux-audio-dev mailing list