head 1.5; access; symbols pkgsrc-2013Q3:1.4.0.82 pkgsrc-2013Q3-base:1.4 pkgsrc-2013Q2:1.4.0.80 pkgsrc-2013Q2-base:1.4 pkgsrc-2013Q1:1.4.0.78 pkgsrc-2013Q1-base:1.4 pkgsrc-2012Q4:1.4.0.76 pkgsrc-2012Q4-base:1.4 pkgsrc-2012Q3:1.4.0.74 pkgsrc-2012Q3-base:1.4 pkgsrc-2012Q2:1.4.0.72 pkgsrc-2012Q2-base:1.4 pkgsrc-2012Q1:1.4.0.70 pkgsrc-2012Q1-base:1.4 pkgsrc-2011Q4:1.4.0.68 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q3:1.4.0.66 pkgsrc-2011Q3-base:1.4 pkgsrc-2011Q2:1.4.0.64 pkgsrc-2011Q2-base:1.4 pkgsrc-2011Q1:1.4.0.62 pkgsrc-2011Q1-base:1.4 pkgsrc-2010Q4:1.4.0.60 pkgsrc-2010Q4-base:1.4 pkgsrc-2010Q3:1.4.0.58 pkgsrc-2010Q3-base:1.4 pkgsrc-2010Q2:1.4.0.56 pkgsrc-2010Q2-base:1.4 pkgsrc-2010Q1:1.4.0.54 pkgsrc-2010Q1-base:1.4 pkgsrc-2009Q4:1.4.0.52 pkgsrc-2009Q4-base:1.4 pkgsrc-2009Q3:1.4.0.50 pkgsrc-2009Q3-base:1.4 pkgsrc-2009Q2:1.4.0.48 pkgsrc-2009Q2-base:1.4 pkgsrc-2009Q1:1.4.0.46 pkgsrc-2009Q1-base:1.4 pkgsrc-2008Q4:1.4.0.44 pkgsrc-2008Q4-base:1.4 pkgsrc-2008Q3:1.4.0.42 pkgsrc-2008Q3-base:1.4 cube-native-xorg:1.4.0.40 cube-native-xorg-base:1.4 pkgsrc-2008Q2:1.4.0.38 pkgsrc-2008Q2-base:1.4 cwrapper:1.4.0.36 pkgsrc-2008Q1:1.4.0.34 pkgsrc-2008Q1-base:1.4 pkgsrc-2007Q4:1.4.0.32 pkgsrc-2007Q4-base:1.4 pkgsrc-2007Q3:1.4.0.30 pkgsrc-2007Q3-base:1.4 pkgsrc-2007Q2:1.4.0.28 pkgsrc-2007Q2-base:1.4 pkgsrc-2007Q1:1.4.0.26 pkgsrc-2007Q1-base:1.4 pkgsrc-2006Q4:1.4.0.24 pkgsrc-2006Q4-base:1.4 pkgsrc-2006Q3:1.4.0.22 pkgsrc-2006Q3-base:1.4 pkgsrc-2006Q2:1.4.0.20 pkgsrc-2006Q2-base:1.4 pkgsrc-2006Q1:1.4.0.18 pkgsrc-2006Q1-base:1.4 pkgsrc-2005Q4:1.4.0.16 pkgsrc-2005Q4-base:1.4 pkgsrc-2005Q3:1.4.0.14 pkgsrc-2005Q3-base:1.4 pkgsrc-2005Q2:1.4.0.12 pkgsrc-2005Q2-base:1.4 pkgsrc-2005Q1:1.4.0.10 pkgsrc-2005Q1-base:1.4 pkgsrc-2004Q4:1.4.0.8 pkgsrc-2004Q4-base:1.4 pkgsrc-2004Q3:1.4.0.6 pkgsrc-2004Q3-base:1.4 pkgsrc-2004Q2:1.4.0.4 pkgsrc-2004Q2-base:1.4 pkgsrc-2004Q1:1.4.0.2 pkgsrc-2004Q1-base:1.4 pkgsrc-2003Q4:1.3.0.10 pkgsrc-2003Q4-base:1.3 netbsd-1-6-1:1.3.0.6 netbsd-1-6-1-base:1.3 netbsd-1-6:1.3.0.8 netbsd-1-6-RELEASE-base:1.3 pkgviews:1.3.0.4 pkgviews-base:1.3 buildlink2:1.3.0.2 buildlink2-base:1.3 netbsd-1-5-PATCH003:1.3 netbsd-1-5-PATCH001:1.3 netbsd-1-5-RELEASE:1.2 netbsd-1-4-PATCH003:1.2; locks; strict; comment @# @; 1.5 date 2013.10.14.13.33.31; author roy; state dead; branches; next 1.4; commitid vUfsp4z8HPhksg9x; 1.4 date 2004.01.28.10.56.21; author agc; state Exp; branches; next 1.3; 1.3 date 2001.01.07.03.10.50; author wiz; state Exp; branches; next 1.2; 1.2 date 2000.04.16.03.59.32; author mycroft; state Exp; branches; next 1.1; 1.1 date 2000.04.16.02.57.22; author mycroft; state Exp; branches; next ; desc @@ 1.5 log @Drop dependency on ncurses as system curses works fine. Regenrate patchset. @ text @$NetBSD: patch-ad,v 1.4 2004/01/28 10:56:21 agc Exp $ --- main.c.orig 2000-01-26 00:11:56.000000000 +0000 +++ main.c 2004-01-28 10:53:42.000000000 +0000 @@@@ -115,8 +115,6 @@@@ menus_active = FALSE; /*initialize screen routines*/ - sLang_init(); - set_color_schemes(); ncurses_init(); set_ncurses_color_schemes(); create_windows(); @@@@ -125,19 +123,9 @@@@ change_channel(&ch1,mp3Path1); change_channel(&ch2,mp3Path2); - /*display windows*/ - display_bar(num_menus, menu_name); - display_ch_window(active_channel); - display_track_path(active_channel,sim_play,ch1_current,ch2_current); - display_track_status(); - adjust_display(get_code()); - display_listdata(); - display_player_status(sim_play,playmode); - display_volume(ch1_volume_pos,ch2_volume_pos,active_bar); - display_speed(ch1_speed_pos,ch2_speed_pos,active_bar); - display_fader(fader_pos); - + refresh_windows(); + display_bar(num_menus,menu_name); while(TRUE) { @@@@ -149,9 +137,9 @@@@ if((ch1.end==1)||(ch2.end==1)) display_track_status(); if(rcount==5) { - refresh_windows(); - display_bar(num_menus, menu_name); - rcount=0; + refresh_windows(); + display_bar(num_menus,menu_name); + rcount=0; } if(playmode==1) /*loop play*/ @@@@ -173,7 +161,7 @@@@ } } - else if(playmode==2) /*continous play*/ + else if(playmode==2) /*continous play*/ { if((ch1.on==0)&&(ch1.end==1)) { @@@@ -215,7 +203,7 @@@@ } } - else if(playmode==3) /*random play*/ + else if(playmode==3) /*random play*/ { if((ch1.on==0)&&(ch1.end==1)) { @@@@ -259,9 +247,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 +258,7 @@@@ display_menu(menu_item,num_items); break; - case SL_KEY_RIGHT: + case KEY_RIGHT: vpos=0; hpos=(hpos0) ? --vpos: num_items[hpos]-1; display_menu(menu_item,num_items); break; - case SL_KEY_DOWN: + case KEY_DOWN: vpos=(vpos=(fader_bars/2))fader_pos=(fader_bars/2) ; if(fader_pos == 0) @@@@ -660,10 +646,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(); @@@@ -671,9 +657,10 @@@@ case'r': /*redraws screen*/ case'R': + clearok(stdscr,TRUE); refresh_windows(); - display_bar(num_menus, menu_name); - break ; + display_bar(num_menus,menu_name); + break; default: for(j=0; j= height-1)&&(current->fLink!=NULL)) { top=top->fLink; current=current->fLink; @@@@ -800,7 +787,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 +796,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++; @@@@ -884,11 +871,9 @@@@ height1,width1; node *top, *current, *temp; - if (active_channel==CHANNEL_1) { top=ch1_Head; current=ch1_current; - } else if(active_channel==CHANNEL_2) { @@@@ -904,46 +889,53 @@@@ while(temp!=bHead){tracktotal++;temp=temp->fLink;} /* display current track number and total tracks */ - /*wmove(chWin,height1-1,width1-15);*/ mvwprintw(chWin,height1-1,width1-15,"[%5i][%5i]",tracknum,tracktotal); - touchwin(chWin); wrefresh(chWin); getmaxyx(subWin,height,width); - wbkgd(subWin,COLOR_PAIR(9)|A_BOLD); while (top!=NULL) { + char *fnstart; fpath=top->filePath; playcount=top->playcount; /*get songname from path, the songname is assumed to be the characters after the last forward slash(/) */ - songname=strstr(strrchr(fpath,'/'),"/")+1; + fnstart = strrchr(fpath,'/'); + if (fnstart == NULL) + songname=fpath; + else + songname=strstr(fnstart,"/")+1; if(current==top) + { if(active_channel==CHANNEL_1) { - wbkgdset(subWin,COLOR_PAIR(7)|A_BOLD); wattrset(subWin,COLOR_PAIR(7)|A_BOLD); + wbkgdset(subWin,COLOR_PAIR(7)|A_BOLD); } else if(active_channel==CHANNEL_2) { - wbkgdset(subWin,COLOR_PAIR(8)|A_BOLD); wattrset(subWin,COLOR_PAIR(8)|A_BOLD); + wbkgdset(subWin,COLOR_PAIR(8)|A_BOLD); } + } + else + { + wattrset(subWin,COLOR_PAIR(9)); + wbkgdset(subWin,COLOR_PAIR(9)); + } tempname=strdup(songname); /*shorten song so that it fits in channel/display window*/ mvwaddstr(subWin,index,0,tempname); wclrtoeol(subWin); mvwprintw(subWin,index,width-6,"*%5i",playcount); - - touchwin(subWin); - wrefresh(subWin); - wbkgdset(subWin,COLOR_PAIR(9)|A_BOLD); - index++; if(index==height)return; + index++; if(index==height)break; top=top->fLink; } + + wrefresh(subWin); } /*display_listdata */ void menu_action(char *item_name) @@@@ -967,21 +959,10 @@@@ 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(); @ 1.4 log @Get rid of two '^H' characters in C source. My, can gcc3 be picky. @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.3 2001/01/07 03:10:50 wiz Exp $ @ 1.3 log @USE_CURSES instead of hardwired dependency on ncurses. Fix a segfault while I'm here. @ text @d1 1 a1 1 $NetBSD$ d3 2 a4 2 --- main.c.orig Wed Jan 26 01:11:56 2000 +++ main.c d49 18 @ 1.2 log @Fix yet more display problems. @ text @d3 2 a4 2 --- main.c.orig Tue Jan 25 19:11:56 2000 +++ main.c Sat Apr 15 23:51:57 2000 d285 1 a285 1 @@@@ -904,14 +889,11 @@@@ d300 4 a303 1 @@@@ -921,29 +903,34 @@@@ d305 6 a310 1 songname=strstr(strrchr(fpath,'/'),"/")+1; d350 1 a350 1 @@@@ -967,21 +954,10 @@@@ @ 1.1 log @Fix numerous display problems. Eliminate the use of slang alongside ncurses. @ text @d4 1 a4 1 +++ main.c Sat Apr 15 22:49:36 2000 d14 10 a23 4 @@@@ -131,7 +129,7 @@@@ display_ch_window(active_channel); display_track_path(active_channel,sim_play,ch1_current,ch2_current); display_track_status(); d25 25 a49 5 + 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 @@@@ d61 1 a61 1 @@@@ -270,7 +268,7 @@@@ d70 1 a70 1 @@@@ -279,28 +277,27 @@@@ d105 1 a105 1 @@@@ -318,42 +315,41 @@@@ d156 1 a156 1 @@@@ -472,7 +468,7 @@@@ d165 1 a165 1 @@@@ -507,7 +503,7 @@@@ d174 1 a174 1 @@@@ -542,7 +538,7 @@@@ d183 1 a183 1 @@@@ -574,7 +570,7 @@@@ d192 1 a192 1 @@@@ -605,7 +601,7 @@@@ d201 1 a201 1 @@@@ -620,7 +616,7 @@@@ d210 1 a210 1 @@@@ -660,10 +656,10 @@@@ d225 14 a238 1 @@@@ -792,7 +788,7 @@@@ d247 1 a247 1 @@@@ -800,7 +796,7 @@@@ d256 1 a256 1 @@@@ -809,14 +805,14 @@@@ d273 70 a342 1 @@@@ -967,24 +963,13 @@@@ d364 1 a364 5 - erase();refresh(); + clearok(stdscr,TRUE);erase();refresh(); display_ch_window(active_channel); display_listdata(); display_player_status(sim_play,playmode); @