<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ca">
	<id>http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Llibreries_gr%C3%A0fiques_GTK</id>
	<title>Llibreries gràfiques GTK - Historial de revisió</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Llibreries_gr%C3%A0fiques_GTK"/>
	<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Llibreries_gr%C3%A0fiques_GTK&amp;action=history"/>
	<updated>2026-04-20T13:27:08Z</updated>
	<subtitle>Historial de revisió per a aquesta pàgina del wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=Llibreries_gr%C3%A0fiques_GTK&amp;diff=248975&amp;oldid=prev</id>
		<title>Joan: /* Projecte GTK-JACK (knob) */</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Llibreries_gr%C3%A0fiques_GTK&amp;diff=248975&amp;oldid=prev"/>
		<updated>2012-02-28T09:20:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Projecte GTK-JACK (knob)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__TOC__&lt;br /&gt;
Segueixo&lt;br /&gt;
*http://zetcode.com/tutorials/gtktutorial/&lt;br /&gt;
=Instal.lació de les llibreries=&lt;br /&gt;
però primer hauré d'instal.lar les llibrerires GTK (els headers, perquè les llibreries ja les tinc, doncs faig servir GNOME):&lt;br /&gt;
*http://www.linuxforums.org/forum/ubuntu-linux/66535-installing-gtk-anjuta-ubuntu.html&lt;br /&gt;
Ubuntu comes with the GTK+2 library by default, specially since it's default desktop environment is GNOME which make heavy use of GTK+2. There should be no need for you to download the GTK source. If all you need are the header files then you want the &amp;quot;libgtk2.0-dev&amp;quot; package.&lt;br /&gt;
&lt;br /&gt;
i clar, s'instal.len moltes coses (58 MB):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo apt-get install libgtk2.0-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=Primers passos=&lt;br /&gt;
Tutorial:&lt;br /&gt;
*http://zetcode.com/tutorials/gtktutorial/&lt;br /&gt;
simple1.c:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;gtk/gtk.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main( int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  GtkWidget *window;&lt;br /&gt;
&lt;br /&gt;
  gtk_init(&amp;amp;argc, &amp;amp;argv);&lt;br /&gt;
&lt;br /&gt;
  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);&lt;br /&gt;
  gtk_window_set_title(GTK_WINDOW(window), &amp;quot;Center&amp;quot;);&lt;br /&gt;
  gtk_window_set_default_size(GTK_WINDOW(window), 230, 150);&lt;br /&gt;
  gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);&lt;br /&gt;
  gtk_widget_show(window);&lt;br /&gt;
&lt;br /&gt;
  g_signal_connect_swapped(G_OBJECT(window), &amp;quot;destroy&amp;quot;,&lt;br /&gt;
      G_CALLBACK(gtk_main_quit), NULL);&lt;br /&gt;
&lt;br /&gt;
  gtk_main();&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ gcc -o simple1 simple1.c `pkg-config --libs --cflags gtk+-2.0`&lt;br /&gt;
$ ./simple1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tutorial GTK+=&lt;br /&gt;
*http://zetcode.com/tutorials/gtktutorial/&lt;br /&gt;
*[[Imatge:Tutorial gtk.zip]]: codi i binaris del tutorial&lt;br /&gt;
Compte! perque el codi està deprecated com es comenta a:&lt;br /&gt;
*http://www.gtkforums.com/about5729.html&lt;br /&gt;
&lt;br /&gt;
Si vull un tutorial realment actualitzat el millor és la documentació oficial. Per exemple, jo que tinc la versió 2.20 de les llibreries GTK:&lt;br /&gt;
*http://library.gnome.org/devel/gtk-tutorial/2.20/&lt;br /&gt;
&lt;br /&gt;
Per saber quina versió de les llibreries tinc instal.lada:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkg-config --modversion gtk+-2.0&lt;br /&gt;
2.20.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==custom widget==&lt;br /&gt;
Com a culminació del tutorial, aquí tenim un widget que és un slider i que el puc integrar amb projectes musicals i amb un controlador MIDI&lt;br /&gt;
&lt;br /&gt;
=Projecte GTK-JACK (slider)=&lt;br /&gt;
A partir del codi vist anteriorment (widget slider), la idea és integrar-ho amb el codi que feia sonar una nota ('hola món audio', enviar un sinusoide a la targeta de so), de manera que movent el slider puc modificar la freqüència. El següenta pas és integrar-ho amb un controlador midi (Axiom 25), per tal de què el slider software respongui a alguna rodeta de l'Axiom o al control del pitch.&lt;br /&gt;
*el codi de les tres versions: [[Imatge:Gtk jack.zip]]&lt;br /&gt;
*v1: main_v1.c és el widget scale per una banda (GTK), i ''hola món audio'' (JACK) per altra banda, i no estan integrats&lt;br /&gt;
*v2: main_v2.c. Ja estan integrats. Quan moc el slider varia la freqüència. Aquest exemple només és didàctic, doncs no es pot ficar un bucle for dins del callback de JACK.&lt;br /&gt;
*v3: main_v3.c. Utilitzo el controlador Axiom 25 per moure el scale i per tant per variar la freqüència. El port que utilitza es fica manualment (port[3]). Utilitza a2jmidid per tal que els ports del Axiom 25 estiguin disponibles per als clients JACK.&lt;br /&gt;
&lt;br /&gt;
=Projecte GTK-JACK (knob)=&lt;br /&gt;
El mateix que l'anterior, però ara necessito un widget que sigui un knob. Finalment he trobat un codi d'exemple de knob que suposo que es pot integrar:&lt;br /&gt;
*http://svn.berlios.de/wsvn/phat/trunk/phat/phat/phatknob.c&lt;br /&gt;
*http://svn.berlios.de/wsvn/phat/trunk/phat/pixmaps/knob.png&lt;br /&gt;
&lt;br /&gt;
Després de tocar bastantes coses he fet funcionar i compilar el knob.c que està dins de demo/&lt;br /&gt;
&lt;br /&gt;
'''Què és phat?'''&lt;br /&gt;
*http://phat.berlios.de/&lt;br /&gt;
&lt;br /&gt;
PHAT is a collection of GTK+ widgets geared toward pro-audio apps. The goal is to eliminate duplication of effort and provide some standardization (well, at least for GTK+ apps). It's open source software, licensed under the GNU GPL, version 2.0 or later.&lt;br /&gt;
&lt;br /&gt;
I'm keen to hear any thoughts or feature requests, if you are making custom widgets and want to them included in phat tell me! If it's a useful widget for audio it should be in phat. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ svn checkout svn://svn.berlios.de/phat/trunk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Imatge on es pot veure els widgets que inclout phat: http://developer.berlios.de/dbimage.php?id=2738 (inclou el rotary knob):  [[Imatge:Khagan main.png|thumbnail]]&lt;br /&gt;
&lt;br /&gt;
Khagan: http://khagan.berlios.de/&lt;br /&gt;
&lt;br /&gt;
Khagan is a live user interface builder for controling parameters via OSC. It's mainly aimed at the Om modular synthesizer. &lt;br /&gt;
&lt;br /&gt;
=Exemples Harry Haaren=&lt;br /&gt;
Harry Haaren és el desenvolupador de Lupp, que utilitza GTK+, i en el seu bloc ha posat alguns exemples de com es programen Widgets amb GTK+.&lt;br /&gt;
*http://harryhaaren.blogspot.com/2010/06/tutorials.html -&amp;gt; Gtkmm Custom Widgets&lt;br /&gt;
*Simple Gtkmm Window: http://harryhaaren.blogspot.com/2009/11/tut-2-simple-gtkmm-window.html&lt;br /&gt;
{{Autor}}, novembre 2010&lt;/div&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
</feed>