-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdialogs.c
More file actions
248 lines (238 loc) · 5.8 KB
/
dialogs.c
File metadata and controls
248 lines (238 loc) · 5.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
/*
* $Id: dialogs.c,v 1.2 2003/03/19 16:45:47 jd Exp $
* Groovit Copyright (C) 1998,1999 Jean-Daniel PAUGET
* making accurate and groovy sound/noise
*
* groovit@disjunkt.com - http://groovit.disjunkt.com/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* you can also try the web at http://www.gnu.org/
*
* $Log: dialogs.c,v $
* Revision 1.2 2003/03/19 16:45:47 jd
* major changes everywhere while retrieving source history up to this almost final release
*
* Revision 1.2.0.24.0.2 1999/10/19 19:29:45 jd
* *** empty log message ***
*
* Revision 1.2.0.24.0.1 1999/10/11 18:36:29 jd
* *** empty log message ***
*
* Revision 1.2.0.24 1999/10/11 15:30:51 jd
* second pre-tel-aviv revision
*
* Revision 1.2.0.23.0.5 1999/10/07 14:08:05 jd
* Revision 1.2.0.23.0.3 1999/10/02 17:22:04 jd
* modified gpl handling
*
* Revision 1.2.0.23.0.2 1999/09/30 01:09:04 jd
* added gpl handling with rc file
* corrected gpl announces
*
* Revision 1.2.0.23 1999/09/15 10:20:39 jd
* second pre tel-aviv public revision, for testing
*
* Revision 1.2.0.22.0.3 1999/08/30 22:16:03 jd
* adapted includes
*
* Revision 1.2.0.22.0.2 1999/08/29 22:49:01 jd
* adapted to fileselect's actionne
*
* Revision 1.1 1999/08/29 16:54:59 jd
* Initial revision
*
*/
#include <stdio.h>
#include <string.h>
#include "config.h"
#include "sample.h"
#include "placement.h"
#include "controls.h"
#include "alert.h"
#include "fileselect.h"
#include "grsel.h"
#include "menu_board.h"
#include "settings.h"
#include "groovit.h"
/* ---------------- les handles de controls a conserver ----------------------- */
static int alerts; /* handle de la fenetre d'alerte */
int initdialogs (void)
{
alerts = create_alerts (8, 7, 80 - 16, 9);
return alerts;
}
int Aalert_nothing (int c)
{
if (poll_alerts (alerts))
quit_alerts (alerts);
return (0);
}
int alert_about (char *rcsid)
{
return open_alerts (alerts, "groovit", " agreed ", " of ", "course !",
" groovit - alpha version - (C) 1999 Jean-Daniel Pauget.",
" Making accurate and groovy sound/noise.",
rcsid,
" groovit comes with absolutely NO WARRANTY. Please refer",
" to the file GPL.txt or try http://www.gnu.org/ .",
Aalert_nothing
);
}
int Aalert_gpl (int c)
{
switch (poll_alerts (alerts))
{
case 0:
break;
break;
case 3:
allpower = BUT_OFF;
case 1:
default:
{
void *tab[] =
{(void *) &gpl_accepted,
(void *) &readrevision,
NULL
};
gpl_accepted = 1;
write_pref (&tab[0]);
quit_alerts (alerts);
}
}
return (0);
}
int alert_gpl (void)
{
return open_alerts (alerts, "groovit", " agreed ", NULL, " no ",
" groovit Making accurate and groovy sound/noise.",
" alpha version (C) 1999 Jean-Daniel Pauget.",
" groovit comes with absolutely NO WARRANTY. Please refer",
" to the file GPL.txt or try http://www.gnu.org/ . If you",
" agree with the license conditions, press <agree>.",
Aalert_gpl
);
}
int Aalert_era (int c)
{
switch (poll_alerts (alerts))
{
case 0:
break;
case 3:
initallvoices ();
resync_displaypatterns ();
strcpy (cursongfile, "no-title");
shortcursongfile = cursongfile;
settitle (gname, shortcursongfile);
refreshscreen ();
quit_alerts (alerts);
break;
default:
quit_alerts (alerts);
break;
}
return (0);
}
int alert_era (void)
{
return open_alerts (alerts, "groovit", " No ! ", NULL, " Yes ! ",
" current song :",
cursongfile,
" has been modified",
NULL,
" Proceed with erasing anyway ?",
Aalert_era
);
}
/* load song anyway ? */
int Aalert_lany (int c)
{
switch (poll_alerts (alerts))
{
case 0:
break;
case 3:
quit_alerts (alerts);
grsel_load (cursongfile);
break;
case 1:
quit_alerts (alerts);
grsel_save (cursongfile);
}
return (0);
}
int alert_lany (void)
{
return open_alerts (alerts, "groovit", " No ! ", NULL, " Yes ! ",
" current song :",
cursongfile,
" has been modified",
NULL,
" Proceed with loading anyway ?",
Aalert_lany
);
}
int Aalert_quit (int c)
{
switch (poll_alerts (alerts))
{
case 0:
break;
case 3:
allpower = BUT_OFF;
default:
quit_alerts (alerts);
}
return (0);
}
int alert_quit (void)
{
return open_alerts (alerts, "groovit", " Nooo ! ", NULL, " Yes. ",
NULL,
" You're going to leave groovit and you",
" REALLY want to QUIT ?",
NULL,
NULL,
Aalert_quit
);
}
int Aalert_savequit (int c)
{
switch (poll_alerts (alerts))
{
case 0:
break;
case 3:
allpower = BUT_OFF;
break;
default:
quit_alerts (alerts);
grsel_save (cursongfile);
}
return (0);
}
int alert_savequit (void)
{
return open_alerts (alerts, "groovit", " No ! ", NULL, " Yes ! ",
" current song :",
cursongfile,
" has been modified",
NULL,
" Proceed with quiting anyway ?",
Aalert_savequit
);
}