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
249
250
251
252
253
254
255
256
257
258
259
260
|
$NetBSD: patch-ad,v 1.1 2000/04/16 02:57:22 mycroft Exp $
--- main.c.orig Tue Jan 25 19:11:56 2000
+++ main.c Sat Apr 15 22:49:36 2000
@@ -115,8 +115,6 @@
menus_active = FALSE;
/*initialize screen routines*/
- sLang_init();
- set_color_schemes();
ncurses_init();
set_ncurses_color_schemes();
create_windows();
@@ -131,7 +129,7 @@
display_ch_window(active_channel);
display_track_path(active_channel,sim_play,ch1_current,ch2_current);
display_track_status();
- adjust_display(get_code());
+ adjust_display(getch());
display_listdata();
display_player_status(sim_play,playmode);
display_volume(ch1_volume_pos,ch2_volume_pos,active_bar);
@@ -259,9 +257,9 @@
{
{
display_info(inactive_info);
- switch(get_code())
+ switch(getch())
{
- case SL_KEY_LEFT:
+ case KEY_LEFT:
vpos=0;
hpos=(hpos>0) ? --hpos: num_menus-1;
display_bar(num_menus, menu_name);
@@ -270,7 +268,7 @@
display_menu(menu_item,num_items);
break;
- case SL_KEY_RIGHT:
+ case KEY_RIGHT:
vpos=0;
hpos=(hpos<num_menus-1) ? ++hpos: 0;
display_bar(num_menus, menu_name);
@@ -279,28 +277,27 @@
display_menu(menu_item,num_items);
break;
- case SL_KEY_UP:
+ case KEY_UP:
vpos=(vpos>0) ? --vpos: num_items[hpos]-1;
display_menu(menu_item,num_items);
break;
- case SL_KEY_DOWN:
+ case KEY_DOWN:
vpos=(vpos<num_items[hpos]-1) ? ++vpos:0;
display_menu(menu_item,num_items);
break;
- case 10:
- case ENTER:
+ case '\n':
+ case KEY_ENTER:
menus_active=FALSE;
menu_action(menu_item[hpos][vpos]);
vpos=0;
display_ch_window(active_channel);
display_listdata();
+ display_bar(num_menus,menu_name);
break;
-
- /*case KEY_F(1):*/
- case '`':
+ case KEY_F(1):
vpos=0;
menus_active=FALSE;
display_ch_window(active_channel);
@@ -318,42 +315,41 @@
else
{
display_info(inactive_info);
- extcode = get_code();
+ extcode = getch();
switch(extcode)
{
- case 10:
- case ENTER: /*enter key pressed, selects track in active channel */
+ case '\n':
+ case KEY_ENTER: /*enter key pressed, selects track in active channel */
if(active_channel==CHANNEL_1)
{
ch1_speed=1.0;ch1_speed_pos=0;ch1.speed=ch1_speed;
+ ch1_last=ch1_current;
if(sim_play) /*starts same track in both channels*/
{
- /* ch2_current = ch1_current;*/
ch2_speed=1.0;ch2_speed_pos=0;ch2.speed=ch2_speed;
mp3Path2=track_selection(&ch2,ch1_current,mp3Path1);
mp3Path1=track_selection(&ch1,ch1_current,mp3Path1);
ch2_Head=ch1_Head;
ch2_current=ch1_current;
-
+ ch2_last=ch1_last;
}
else mp3Path1=track_selection(&ch1,ch1_current,mp3Path1);
- ch1_last=ch1_current;
}
else
{
ch2_speed=1.0;ch2_speed_pos=0; ch2.speed=ch2_speed;
+ ch2_last=ch2_current;
if(sim_play) /*starts same track in both channels*/
{
- /*ch1_current = ch2_current; */
ch1_speed=1.0;ch1_speed_pos=0;ch1.speed=ch1_speed;
mp3Path1=track_selection(&ch1,ch2_current,mp3Path2);
mp3Path2=track_selection(&ch2,ch2_current,mp3Path2);
- ch1_current=ch2_current;
ch1_Head=ch2_Head;
+ ch1_current=ch2_current;
+ ch1_last=ch2_last;
}
else mp3Path2=track_selection(&ch2,ch2_current,mp3Path2);
- ch2_last=ch2_current;
}
display_listdata();
display_track_path(active_channel,sim_play,ch1_last,ch2_last);
@@ -472,7 +468,7 @@
//printf("------- %i ----------\n",playmode);
break;
- case SL_KEY_IC:
+ case KEY_IC:
if (active_bar==VOLBAR)
{
ch1_volume_pos--;
@@ -507,7 +503,7 @@
break;
- case SL_KEY_HOME:
+ case KEY_HOME:
if (active_bar==VOLBAR)
{
@@ -542,7 +538,7 @@
}
break;
- case SL_KEY_DELETE:
+ case KEY_DC:
if (active_bar==VOLBAR)
{
ch2_volume_pos--;
@@ -574,7 +570,7 @@
}
break;
- case SL_KEY_END:
+ case KEY_END:
if (active_bar==VOLBAR)
{
ch2_volume_pos++;
@@ -605,7 +601,7 @@
}
break;
- case SL_KEY_LEFT : /* left arrow pressed, adjusts fader postion */
+ case KEY_LEFT : /* left arrow pressed, adjusts fader postion */
fader_pos-- ;
if(fader_pos<=-(fader_bars/2))fader_pos=-(fader_bars/2);
if(fader_pos == 0)
@@ -620,7 +616,7 @@
display_fader(fader_pos);
break;
- case SL_KEY_RIGHT:
+ case KEY_RIGHT:
fader_pos++;
if(fader_pos>=(fader_bars/2))fader_pos=(fader_bars/2) ;
if(fader_pos == 0)
@@ -660,10 +656,10 @@
display_fader(fader_pos);
break;
- case SL_KEY_DOWN:
- case SL_KEY_UP:
- case SL_KEY_PPAGE:
- case SL_KEY_NPAGE:
+ case KEY_DOWN:
+ case KEY_UP:
+ case KEY_PPAGE:
+ case KEY_NPAGE:
adjust_display(extcode);
display_ch_window(active_channel);
display_listdata();
@@ -792,7 +788,7 @@
a circular linked list*/
switch(key)
{
- case SL_KEY_DOWN:
+ case KEY_DOWN:
if((counter >= height-1)&&(current->fLink!=NULL))
{
top=top->fLink; current=current->fLink;
@@ -800,7 +796,7 @@
else if(current->fLink!=NULL) current=current->fLink;
break;
- case SL_KEY_UP:
+ case KEY_UP:
if((top->bLink!=NULL)&&(top==current))
{
top=top->bLink; current=current->bLink;
@@ -809,14 +805,14 @@
if(current->bLink!=NULL) current=current->bLink ;
break;
- case SL_KEY_NPAGE: /*pagedown*/
+ case KEY_NPAGE: /*pagedown*/
while((index < height-1)&&(current->fLink!=NULL))
{
top=top->fLink; current=current->fLink; index++;
}
break;
- case SL_KEY_PPAGE:/*pageup*/
+ case KEY_PPAGE:/*pageup*/
while((index < height-1)&(top->bLink!=NULL))
{
top=top->bLink; current=current->bLink; index++;
@@ -967,24 +963,13 @@
void exit_prog(void)
{
reset_audio();
- sLang_exit();
+ ncurses_exit();
gui_exit();
}/*exit_prog*/
-int get_code(void)
-{
- int key;
- /*qiflush(); */
- /*if(clickcount>=15){flushinp(); clickcount=0;}*/
- if(SLang_input_pending(-10)) key= /*getch(); */
- SLkp_getkey();
- else key=0;
- /*clickcount++;*/
- return(key);
-} /* get_code */
void refresh_windows(void)
{
- erase();refresh();
+ clearok(stdscr,TRUE);erase();refresh();
display_ch_window(active_channel);
display_listdata();
display_player_status(sim_play,playmode);
|