/[cabestan]/callbacks.c
ViewVC logotype

Annotation of /callbacks.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (hide annotations)
Sun Oct 4 20:33:09 2009 UTC (9 years, 9 months ago) by ben
File MIME type: text/plain
File size: 1277 byte(s)
first commit
1 ben 1 #include <gtk/gtk.h>
2     #include <jack/jack.h>
3     #include <jack/transport.h>
4    
5     void on_play (GtkButton* button, gpointer app_data) {
6     jack_client_t* client = (jack_client_t*)app_data;
7     GtkWidget* pauseimage = NULL;
8     GtkWidget* playimage = NULL;
9     static gboolean playing = FALSE;
10    
11     if (!playing) {
12     jack_transport_start(client);
13     pauseimage = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PAUSE, GTK_ICON_SIZE_BUTTON);
14     gtk_button_set_image(GTK_BUTTON(button), pauseimage);
15     playing = TRUE;
16     } else {
17     jack_transport_stop(client);
18     playimage = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_BUTTON);
19     gtk_button_set_image(GTK_BUTTON(button), playimage);
20     playing = FALSE;
21     }
22     }
23    
24     void on_rewind (GtkButton* button, gpointer app_data) {
25     jack_client_t* client = (jack_client_t*)app_data;
26    
27     jack_transport_locate(client, 0); /* go to frame 0 */
28     button = NULL;
29     }
30    
31     void on_stepf (GtkButton* button, gpointer app_data) {
32     jack_client_t* client = (jack_client_t*)app_data;
33    
34     jack_transport_locate(client, 1+jack_get_current_transport_frame(client));
35     button = NULL;
36     }
37    
38     void on_stepr (GtkButton* button, gpointer app_data) {
39     jack_client_t* client = (jack_client_t*)app_data;
40    
41     jack_transport_locate(client, (-1)+jack_get_current_transport_frame(client));
42     button = NULL;
43     }

  ViewVC Help
Powered by ViewVC 1.1.26