Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2593 → Rev 3495

/programs/media/ac97snd/ac97snd/ac97wav.c
64,6 → 64,8
DWORD status;
DWORD first_sync;
DWORD PLStatus=0; //Asper+
byte replay=0;
byte hidden=0;
 
#ifdef DOCKABLE_WINDOW
byte thread_info[1024]; //Asper+
92,6 → 94,7
char buttons_xm[] = " Play Stop Vol- Vol+"; /* uFMOD integration */
char buttons_wav[] = " Play Stop << >> Vol- Vol+"; /* uFMOD integration */
char button_PL[] = "PL"; //Asper+
char button_R[] = "R"; //Asper+
char *buttons_text = buttons_wav; /* uFMOD integration */
 
void play_xm(); /* uFMOD integration */
223,10 → 226,46
exit();
break;
 
case 0x19: //P - playlist
switch (PLStatus)
{ case 0x00: //PL not started.
pl_tid=create_thread(pl_thread_proc, 0, 4096);
PLStatus=0x12;
break;
case 0x01: //PL started, but hidden.
PLStatus=0x12;
break;
case 0x02: //PL started and showed.
PLStatus=0x11;
break;
}
break;
 
case 0x1C: //Enter
currActive=currFirstShowed+currSelected-1;
status = ST_TRACK;
break;
 
case 0x2C: //Z - previous
currActive-=2;
status = ST_TRACK;
break;
case 0x2D: //X - play
status = ST_PLAY;
break;
case 0x2E: //C - pause
break;
case 0x2F: //V - stop
status = ST_STOP;
break;
case 0x30: //B - next
status = ST_TRACK;
break;
 
case 0x47: //Home
if(l_vol < 0)
{ l_vol+=100;
239,6 → 278,7
{
if (currFirstShowed>0)
currFirstShowed--;
else break;
ShowPLContent(pl_buff);
break;
}
289,16 → 329,9
PLStatus=0x00;
exit();
}
for (i=0;i<PL_MAX_SHOWN_ITEMS;i++)
{
if (button==0x10+i)
{
currActive=currFirstShowed+i-1;
currActive=currFirstShowed+button-0x10-1;
status = ST_TRACK;
break;
}
}
break;
case EV_IPC:
*ipc_buff='\0';
ShowPLContent(pl_buff);
344,9 → 377,9
count++;
if (count-1==index)
{
if (j>MAX_TEXT_WIDTH || ch=='\n')
if (j>MAX_TEXT_WIDTH || ch=='\r' || ch=='\n')
{
name[j-1]='\0';
name[j]='\0';
break;
}
if (ch=='\\') ch='/';
397,22 → 430,27
return 1;
}
//Asper_____________________Play List code end_____________________________
void redraw_R_button() //Asper +
{
DWORD rc = 0xA0FFA0; //R button text color
if (!replay) rc = 0x404040;
write_text(14,74,rc|FONT0,button_R,sizeof(button_R)-1);
}
 
void update_dinamic_content() //Asper +
{
int len; /* uFMOD integration */
int len = strlen(filename);
if (len > 47) len = 47;
draw_bar(7,41,286,11,main_wc);
draw_bar(7,55,286,11,main_wc);
len = strlen(filename); /* uFMOD integration */
if(len > 47) len = 47; /* uFMOD integration */
write_text(11,57,0x00FF20|FONT0, filename, len); /* uFMOD integration */
write_text(11,57,0x00FF20|FONT0, filename, len);
}
 
void draw_window()
{
BeginDraw();
 
if (!hidden)
{
DrawWindow(100,100,299,main_wh,main_wc,4,0,0,0); //Asper+
 
make_button(7,24,45,13, 0x10|BT_NORMAL,main_bc);
423,6 → 461,7
make_button(248,24,45,13, 0x15|BT_NORMAL,main_bc);
 
make_button(268,70,25,13, 0x16|BT_NORMAL,main_bc); //Asper+ PL button
make_button(10,70,12,13, 0x17|BT_NORMAL,main_wc); //Asper+ R button
 
make_button(7,41,286,11, 0x30|BT_HIDE|BT_NOFRAME,main_wc);
 
433,6 → 472,8
 
write_text(276,74,main_wc|FONT0,button_PL,sizeof(button_PL)-1); //Asper+ PL button text
write_text(275,73,0xA0FFA0|FONT0,button_PL,sizeof(button_PL)-1); //Asper+
redraw_R_button();
}
EndDraw();
};
 
624,9 → 665,14
int err, ver;
int i;
char ipc_msg[2]="\0\0";
pl_items_number=0;
if (argv[1][0]=='-' && argv[1][1]=='h')
{
hidden = 1;
argv[1]+=3;
}
strcpy (full_filename, argv[1]);
pl_items_number=0;
InitHeap(1024*1024);
663,7 → 709,13
if (LoadFile(full_filename))
status = ST_PLAY;
}
else status = ST_STOP;
else
{
currSelected=currFirstShowed=0;
currActive=-1;
if (!replay) status = ST_STOP;
continue;
}
 
//Update ac97snd and PL windows
i=currActive-currFirstShowed;
904,6 → 956,46
exit();
break;
case 0x13: //R - repeat on/off
replay=!replay;
redraw_R_button();
break;
 
case 0x19: //P - playlist
switch (PLStatus)
{ case 0x00: //PL not started.
pl_tid=create_thread(pl_thread_proc, 0, 4096);
PLStatus=0x12;
break;
case 0x01: //PL started, but hidden.
PLStatus=0x12;
break;
case 0x02: //PL started and showed.
PLStatus=0x11;
break;
}
break;
 
case 0x2C: //Z - previous
currActive-=2;
status = ST_TRACK;
break;
case 0x2D: //X - play
status = ST_PLAY;
break;
case 0x2E: //C - pause
break;
case 0x2F: //V - stop
status = ST_STOP;
break;
case 0x30: //B - next
status = ST_TRACK;
break;
 
case 0x47: //Home
if(l_vol < 0)
{ l_vol+=100;
944,7 → 1036,7
case 0x10:
status = ST_PLAY;
continue;
break;//continue;
 
case 0x11:
status = ST_STOP;
987,6 → 1079,10
break;
}
break;
case 0x17: //Asper+ PL button action
replay=!replay;
redraw_R_button();
break;
 
case 0x30:
if(status==ST_DONE)
1182,7 → 1278,7
 
 
///*********
void *__cdecl memmove ( void * dst, const void * src, unsigned int count) /* uFMOD integration */
void *memmove ( void * dst, void * src, unsigned int count) /* uFMOD integration */
{ void *ret;
ret = dst;