/[cabestan]/main.c
ViewVC logotype

Diff of /main.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5 by ben, Mon Oct 5 02:35:27 2009 UTC revision 7 by ben, Mon Oct 5 19:15:42 2009 UTC
# Line 14  Line 14 
14  #include "cabestan.h"  #include "cabestan.h"
15    
16  #define _(string) gettext (string)  #define _(string) gettext (string)
 #define TIMERVAL 200 /* msec for refreshing timeline */  
17  int main (int argc, char* argv[]) {  int main (int argc, char* argv[]) {
18          GtkWidget* window; /* main window */          GtkWidget* window; /* main window */
19          GtkWidget* vbox;          GtkWidget* vbox;
20          GtkWidget* hbox;  /*      GtkWidget* hbox1; */
21            GtkWidget* hbox2;
22          GtkWidget* play, * rewind, * stepf, * stepr, * quit; /* buttons */          GtkWidget* play, * rewind, * stepf, * stepr, * quit; /* buttons */
23          AppData* app_data = NULL;          AppData* app_data = NULL;
24          jack_status_t jackd_status;          jack_status_t jackd_status;
# Line 30  int main (int argc, char* argv[]) { Line 30  int main (int argc, char* argv[]) {
30                    
31          app_data->jackd_client = NULL; /* jackd handle */          app_data->jackd_client = NULL; /* jackd handle */
32          app_data->timeline = NULL; /* the gtk timeline label */          app_data->timeline = NULL; /* the gtk timeline label */
33            app_data->frame_check = NULL; /* the gtk frame check */
34                    
35  #if 0  #if 0
36          /*  internationalization */          /*  internationalization */
# Line 42  int main (int argc, char* argv[]) { Line 43  int main (int argc, char* argv[]) {
43          /* gtk init */          /* gtk init */
44          gtk_init (&argc, &argv);          gtk_init (&argc, &argv);
45                    
46          /* systray visible icon */          /* look for icon */
47          data_dirs = g_get_system_data_dirs();          data_dirs = g_get_system_data_dirs();
48          for (i = 0; data_dirs[i]; ++i) {          for (i = 0; data_dirs[i]; ++i) {
49                  icon_path = g_strconcat(data_dirs[i],"/icons/cabestan.png", NULL);                  icon_path = g_strconcat(data_dirs[i],"/icons/cabestan.png", NULL);
# Line 61  int main (int argc, char* argv[]) { Line 62  int main (int argc, char* argv[]) {
62          window = window_create("Cabestan");          window = window_create("Cabestan");
63          vbox = vbox_create();          vbox = vbox_create();
64          window_add_vbox(window, vbox);          window_add_vbox(window, vbox);
65    
66          app_data->timeline = timeline_create();          app_data->timeline = timeline_create();
67          vbox_pack_widget(vbox, app_data->timeline);          vbox_pack_widget(vbox, app_data->timeline);
68          hbox = hbox_create();  #if 0  
69          vbox_pack_widget(vbox, hbox);          hbox1 = hbox_create();
70            vbox_pack_widget(vbox, hbox1);
71            app_data->frame_check = frame_check_create();
72            hbox_pack_widget(hbox1, app_data->frame_check);
73    #endif
74            hbox2 = hbox_create();
75            vbox_pack_widget(vbox, hbox2);
76          rewind = button_create(GTK_STOCK_MEDIA_PREVIOUS);          rewind = button_create(GTK_STOCK_MEDIA_PREVIOUS);
77          hbox_pack_widget(hbox, rewind);          hbox_pack_widget(hbox2, rewind);
78          stepr = button_create(GTK_STOCK_MEDIA_REWIND);          stepr = button_create(GTK_STOCK_MEDIA_REWIND);
79          hbox_pack_widget(hbox, stepr);          hbox_pack_widget(hbox2, stepr);
80          play = button_create(GTK_STOCK_MEDIA_PLAY);          play = button_create(GTK_STOCK_MEDIA_PLAY);
81          hbox_pack_widget(hbox, play);          hbox_pack_widget(hbox2, play);
82          stepf = button_create(GTK_STOCK_MEDIA_FORWARD);          stepf = button_create(GTK_STOCK_MEDIA_FORWARD);
83          hbox_pack_widget(hbox, stepf);          hbox_pack_widget(hbox2, stepf);
84          quit = button_create(GTK_STOCK_QUIT);          quit = button_create(GTK_STOCK_QUIT);
85          hbox_pack_widget(hbox, quit);          hbox_pack_widget(hbox2, quit);
86    
87          /* callback connection */          /* callback connection */
88          g_signal_connect_swapped(G_OBJECT(quit), "clicked", G_CALLBACK(gtk_main_quit), (gpointer)NULL);          g_signal_connect_swapped(G_OBJECT(quit), "clicked", G_CALLBACK(gtk_main_quit), (gpointer)NULL);
89          g_signal_connect_swapped(G_OBJECT(window), "delete-event", G_CALLBACK(gtk_main_quit), (gpointer)NULL);          g_signal_connect_swapped(G_OBJECT(window), "delete-event", G_CALLBACK(gtk_main_quit), (gpointer)NULL);
90          g_signal_connect(G_OBJECT(play), "clicked", G_CALLBACK(on_play), (gpointer)app_data->jackd_client);          g_signal_connect(G_OBJECT(play), "clicked", G_CALLBACK(on_play), (gpointer)app_data->jackd_client);
91          g_signal_connect(G_OBJECT(rewind), "clicked", G_CALLBACK(on_rewind), (gpointer)app_data->jackd_client);          g_signal_connect(G_OBJECT(rewind), "clicked", G_CALLBACK(on_rewind), (gpointer)app_data->jackd_client);
92          g_signal_connect(G_OBJECT(stepf), "clicked", G_CALLBACK(on_stepf), (gpointer)app_data->jackd_client);          g_signal_connect(G_OBJECT(stepf), "pressed", G_CALLBACK(on_stepf_pressed), (gpointer)app_data->jackd_client);
93          g_signal_connect(G_OBJECT(stepr), "clicked", G_CALLBACK(on_stepr), (gpointer)app_data->jackd_client);          g_signal_connect(G_OBJECT(stepf), "released", G_CALLBACK(on_stepf_released), (gpointer)app_data->jackd_client);
94            g_signal_connect(G_OBJECT(stepr), "pressed", G_CALLBACK(on_stepr_pressed), (gpointer)app_data->jackd_client);
95            g_signal_connect(G_OBJECT(stepr), "released", G_CALLBACK(on_stepr_released), (gpointer)app_data->jackd_client);
96                    
97          gtk_widget_show_all(window);          gtk_widget_show_all(window);
98                    

Legend:
Removed from v.5  
changed lines
  Added in v.7

  ViewVC Help
Powered by ViewVC 1.1.26