/[paths]/src/paths.c
ViewVC logotype

Contents of /src/paths.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 52 - (show annotations)
Mon Aug 20 02:10:15 2012 UTC (7 years, 1 month ago) by ben
File MIME type: text/plain
File size: 1800 byte(s)
avoid warnings
1 #include <gtk/gtk.h>
2 #include <jack/jack.h>
3 #include "main.h"
4
5 void on_stop_clicked(GtkButton *button, gpointer user_data)
6 {
7 struct app *app = user_data;
8 GtkToggleToolButton *play;
9
10 jack_client_t* client = app->jack->client;
11
12 /* use play button functionnality for stopping */
13 play = GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object (app->ui, "play"));
14 gtk_toggle_tool_button_set_active (play, FALSE);
15
16 jack_transport_locate(client, 0); /* go to frame 0 */
17 }
18
19 void on_play_toggled(GtkToggleToolButton *togglebutton, gpointer user_data)
20 {
21 struct app *app = user_data;
22 jack_client_t* client = app->jack->client;
23 jack_position_t tpos;
24 jack_transport_state_t tstate;
25 gboolean playing;
26
27 tstate = jack_transport_query(client, &tpos);
28 playing = (tstate == JackTransportRolling || tstate == JackTransportLooping);
29 if (!playing) {
30 jack_transport_start(client);
31 } else {
32 jack_transport_stop(client);
33 }
34 /* playing is out of date, use opposite */
35 gtk_toggle_tool_button_set_active(togglebutton, !playing);
36 }
37
38 void on_new_activate(GtkMenuItem *menuitem, gpointer user_data)
39 {
40 struct app *app = user_data;
41 }
42
43 void on_open_activate(GtkMenuItem *menuitem, gpointer user_data)
44 {
45 struct app *app = user_data;
46 }
47
48 void on_save_activate(GtkMenuItem *menuitem, gpointer user_data)
49 {
50 struct app *app = user_data;
51 }
52 void on_save_as_activate(GtkMenuItem *menuitem, gpointer user_data)
53 {
54 struct app *app = user_data;
55 }
56
57 static void quit(struct app* app)
58 {
59 /* ensure to stop playing */
60 /* popup a save dialog if needed */
61
62 /* else quit graphical event loop */
63 gtk_main_quit();
64 }
65
66 void on_quit_activate(GtkMenuItem *menuitem, gpointer user_data)
67 {
68 struct app *app = user_data;
69 quit(app);
70 }
71
72 void on_window_destroy(GtkWidget *window, gpointer user_data)
73 {
74 struct app *app = user_data;
75 quit(app);
76 }

  ViewVC Help
Powered by ViewVC 1.1.26