From ed388aa3c19bf8f1cff61789d990f6c68c6608af Mon Sep 17 00:00:00 2001
From: mycroft <mycroft@pkgsrc.org>
Date: Sun, 16 Apr 2000 02:57:20 +0000
Subject: Fix numerous display problems. Eliminate the use of slang alongside
 ncurses.

---
 audio/emixer/Makefile         |   3 +-
 audio/emixer/files/Makefile   |   4 +-
 audio/emixer/files/patch-sum  |   6 +-
 audio/emixer/patches/patch-ab |  15 +--
 audio/emixer/patches/patch-ac | 181 +++++++++++++++++++++++++++++
 audio/emixer/patches/patch-ad | 260 ++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 456 insertions(+), 13 deletions(-)
 create mode 100644 audio/emixer/patches/patch-ac
 create mode 100644 audio/emixer/patches/patch-ad

(limited to 'audio')

diff --git a/audio/emixer/Makefile b/audio/emixer/Makefile
index 959cbdd4e9f..8f24d21e24a 100644
--- a/audio/emixer/Makefile
+++ b/audio/emixer/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2000/02/02 03:39:59 hubertf Exp $
+# $NetBSD: Makefile,v 1.4 2000/04/16 02:57:20 mycroft Exp $
 #
 
 DISTNAME=	emixer-0.05.5
@@ -9,7 +9,6 @@ MASTER_SITES=	http://emixer.linuxbox.com/
 MAINTAINER=	hubertf@netbsd.org
 HOMEPAGE=	http://emixer.linuxbox.com/
 
-DEPENDS+=	libslang-1.*:../../devel/libslang
 DEPENDS+=	ncurses>=4.2:../../devel/ncurses
 DEPENDS+=	mpg123-0.59*:../../audio/mpg123
 
diff --git a/audio/emixer/files/Makefile b/audio/emixer/files/Makefile
index 9e0a088815b..62e600b847c 100644
--- a/audio/emixer/files/Makefile
+++ b/audio/emixer/files/Makefile
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.2 1999/12/20 03:28:38 hubertf Exp $
+#	$NetBSD: Makefile,v 1.3 2000/04/16 02:57:21 mycroft Exp $
 
 CFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib -Wl,-R${LOCALBASE}/lib -lm
 
 all: emixer
 emixer: main.o
-	${CC} ${LDFLAGS} -o ${.TARGET}  ${.ALLSRC} -lslang -lncurses -lossaudio
+	${CC} ${LDFLAGS} -o ${.TARGET}  ${.ALLSRC} -lncurses -lossaudio
 
 install:
 	${BSD_INSTALL_PROGRAM}	emixer	${PREFIX}/bin/emixer
diff --git a/audio/emixer/files/patch-sum b/audio/emixer/files/patch-sum
index 5589b6e6419..70a7d296e85 100644
--- a/audio/emixer/files/patch-sum
+++ b/audio/emixer/files/patch-sum
@@ -1,4 +1,6 @@
-$NetBSD: patch-sum,v 1.1.1.1 1999/12/13 02:48:41 hubertf Exp $
+$NetBSD: patch-sum,v 1.2 2000/04/16 02:57:21 mycroft Exp $
 
 MD5 (patch-aa) = 35be17da885908004a97f5df45aa6752
-MD5 (patch-ab) = a6df986223a10988c35701a13389c48a
+MD5 (patch-ab) = f25b4f123fa22bd9a323a41cfa69ac9e
+MD5 (patch-ac) = 1030c1e8ee2c53c15f65724f6ef1f44b
+MD5 (patch-ad) = 59d2401bf9ee5f80ec40ac2cda28fdff
diff --git a/audio/emixer/patches/patch-ab b/audio/emixer/patches/patch-ab
index 6c14b9b3697..2aa43ee9e67 100644
--- a/audio/emixer/patches/patch-ab
+++ b/audio/emixer/patches/patch-ab
@@ -1,15 +1,16 @@
-$NetBSD: patch-ab,v 1.1.1.1 1999/12/13 02:48:41 hubertf Exp $
+$NetBSD: patch-ab,v 1.2 2000/04/16 02:57:22 mycroft Exp $
 
---- nctgui.h.orig	Mon Dec 13 02:15:43 1999
-+++ nctgui.h	Mon Dec 13 02:18:32 1999
-@@ -9,7 +9,11 @@
+--- nctgui.h.orig	Sun Dec  5 21:40:20 1999
++++ nctgui.h	Sat Apr 15 22:16:51 2000
+@@ -8,8 +8,11 @@
+ */
  
  /* include files used by gui.c and main.c */
- #include <ncurses.h>
 +#ifdef __NetBSD__
-+#include <slang.h>
++#include <ncurses.h>
 +#else
- #include <slang/slang.h>
+ #include <ncurses.h>
+-#include <slang/slang.h>
 +#endif
  #include <string.h>
  
diff --git a/audio/emixer/patches/patch-ac b/audio/emixer/patches/patch-ac
new file mode 100644
index 00000000000..42f1e70a373
--- /dev/null
+++ b/audio/emixer/patches/patch-ac
@@ -0,0 +1,181 @@
+$NetBSD: patch-ac,v 1.1 2000/04/16 02:57:22 mycroft Exp $
+
+--- nctgui.c.orig	Sun Dec  5 21:41:42 1999
++++ nctgui.c	Sat Apr 15 22:41:06 2000
+@@ -30,7 +30,10 @@
+ void ncurses_init(void)
+ {
+     (void) initscr();
+-    curs_set(0);
++    cbreak();
++    noecho();
++    //nodelay(stdscr,TRUE);
++    keypad(stdscr,TRUE);
+ }/* ncurses_init */
+ 
+ void ncurses_exit(void)
+@@ -66,24 +69,23 @@
+     int j;
+     int maxY,maxX;
+ 
+-    wattrset(barWin,COLOR_PAIR(2)); wbkgdset(barWin,COLOR_PAIR(2));
++    wbkgdset(barWin,COLOR_PAIR(2));
++    wmove(barWin,0,0); wclrtoeol(barWin);
+ 
+-    wmove(barWin,0,0); wclrtoeol(barWin);  wrefresh(barWin);
+     for(j=0; j<num_menus; j++)
+     {
+         wmove(barWin,0,(j*MENU_WIDTH));
+         if(j==hpos && menus_active)
+-        {
+             wattrset(barWin,COLOR_PAIR(3)|A_BOLD);
+-        }
+-        waddstr(barWin,menu_name[j]); wrefresh (barWin);
++	else
++            wattrset(barWin,COLOR_PAIR(2));
++        waddstr(barWin,menu_name[j]);
+ 
+         wattrset(barWin,COLOR_PAIR(15));
+         getmaxyx(stdscr,maxY,maxX); mvwaddstr(barWin,0,maxX-20,emixer_version);
+-        
+-        wattrset(barWin,COLOR_PAIR(2));
+-        wrefresh (barWin);
+     }
++
++    wrefresh (barWin);
+ } /* display_bar */
+ 
+ /*Display additional info at bottom of screen*/
+@@ -106,14 +108,14 @@
+     
+     for(j=0;j<num_items[hpos];j++)
+     {
+-        if(j==vpos){wattrset(subWn,COLOR_PAIR(3)); wbkgdset(subWn,COLOR_PAIR(3)); }
++        if(j==vpos){wattrset(subWn,COLOR_PAIR(3)|A_BOLD);wbkgdset(subWn,COLOR_PAIR(3)); }
+         else {wattrset(subWn,COLOR_PAIR(2));wbkgdset(subWn,COLOR_PAIR(2)); }
+ 
+         wmove(subWn,j+1,1);
+         waddstr(subWn,menu_item[hpos][j]); wclrtoeol(subWn);
+-        wrefresh(subWn);
+     }
+-    wattrset(subWn,COLOR_PAIR(2));wbkgdset(subWn,COLOR_PAIR(2));
++    wattrset(subWn,COLOR_PAIR(2)|A_ALTCHARSET);
++    wbkgdset(subWn,COLOR_PAIR(2));
+     box(subWn,0,0);
+     wrefresh(subWn);
+ } /* display_menu */
+@@ -127,6 +129,7 @@
+     switch(active_channel)
+     {
+     case CHANNEL_1:
++	wattrset(chWin,COLOR_PAIR(11)|A_BOLD|A_ALTCHARSET);
+         wbkgd(chWin,COLOR_PAIR(11)|A_BOLD);
+         box(chWin,0,0);
+         wmove(chWin,0,2);
+@@ -137,6 +140,7 @@
+         break;
+      
+     case CHANNEL_2:
++	wattrset(chWin,COLOR_PAIR(12)|A_BOLD|A_ALTCHARSET);
+         wbkgd(chWin,COLOR_PAIR(12)|A_BOLD);
+         box(chWin,0,0);
+         wmove(chWin,0,width-13);
+@@ -155,6 +159,7 @@
+     int centre, j;
+ 
+     centre=(FADER_BARS/2)+2;
++    wattrset(faderWin,COLOR_PAIR(1)|A_BOLD|A_ALTCHARSET);
+     wbkgd(faderWin,COLOR_PAIR(1)|A_BOLD);
+     box(faderWin,0,0);
+     wattrset(faderWin,COLOR_PAIR(9)|A_BOLD);
+@@ -201,6 +206,7 @@
+ 
+     getmaxyx(volumeWin,maxY,maxX);
+     centre=(VOLUME_BARS/2)+2;
++    wattrset(volumeWin,COLOR_PAIR(1)|A_BOLD|A_ALTCHARSET);
+     wbkgd(volumeWin,COLOR_PAIR(1)|A_BOLD);
+     box(volumeWin,0,0);
+     if(bar==VOLBAR)mvwaddstr(volumeWin,maxY-1,maxX-9,"[Active]");
+@@ -263,6 +269,7 @@
+ 
+     getmaxyx(speedWin,maxY,maxX);
+     centre=(SPEED_BARS/2)+2;
++    wattrset(speedWin,COLOR_PAIR(1)|A_BOLD|A_ALTCHARSET);
+     wbkgd(speedWin,COLOR_PAIR(1)|A_BOLD);
+     box(speedWin,0,0);
+     if(bar==SPDBAR)mvwaddstr(speedWin,maxY-1,maxX-9,"[Active]");
+@@ -323,6 +330,7 @@
+ void display_player_status(int sim_play, int cont_play)
+ {
+ 
++    wattrset(pStatusWin,COLOR_PAIR(1)|A_BOLD|A_ALTCHARSET);
+     wbkgd(pStatusWin,COLOR_PAIR(1)|A_BOLD);
+     box(pStatusWin,0,0);
+     wattrset(pStatusWin,COLOR_PAIR(9)|A_BOLD);
+@@ -341,54 +349,6 @@
+  exit(0);
+ } /*gui_exit/*/
+ 
+-void sLang_init(void)
+-{
+-    SLtt_get_terminfo();
+-    SLang_init_tty(0,0,1);
+-    SLkp_init();
+-    SLsmg_init_smg();
+-    SLsig_block_signals();
+-    /*ncurses stuff - experimental */
+-    (void) initscr();
+-    curs_set(0);
+-    noecho();
+-    keypad(stdscr,TRUE);
+-} /* sLang_init*/
+-
+-
+-void sLang_exit(void)
+-{
+-    /*ncurses stuff - experimental */
+-    endwin();
+-
+-    SLsmg_cls();
+-    SLsmg_refresh ();
+-    SLsmg_reset_smg();
+-    SLang_reset_tty();
+-} /* sLang_exit*/
+-
+-void set_color_schemes(void)
+-{
+-    SLtt_set_color(1, NULL, "white", "blue");
+-    SLtt_set_color(2, NULL, "black", "lightgray");
+-    SLtt_set_color(3, NULL, "black", "green");
+-    SLtt_set_color(4, NULL, "red","lightgray");
+-    SLtt_set_color(5, NULL, "yellow","blue");
+-    SLtt_set_color(6, NULL, "lightgray","blue");
+-    SLtt_set_color(7, NULL, "yellow","black");
+-    SLtt_set_color(8, NULL, "green","blue");
+-    SLtt_set_color(9, NULL, "lightgray","black");
+-    SLtt_set_color(10, NULL, "red","black");
+-    SLtt_set_color(11, NULL, "brightcyan","black");
+-    SLtt_set_color(12, NULL, "brightmagenta","black");
+-    SLtt_set_color(13, NULL, "black","brightcyan");
+-    SLtt_set_color(14, NULL, "black","brightmagenta");
+-    SLtt_set_color(15, NULL, "white","brightcyan");
+-    SLtt_set_color(16, NULL, "white","brightmagenta");
+-
+-
+-}/*set_color_schemes*/
+-
+ void create_windows()
+ {
+     int maxY, maxX, height, width, origY=1, origX=0;
+@@ -396,10 +356,7 @@
+     getmaxyx(stdscr,maxY,maxX);
+     height = maxY-4; width  = (maxX/10)*7;
+     chWin  = newwin(height,width,origY,origX);
+-
+-    origY=origY++; origX=origX++ ;
+-    height = maxY-6;  width = ((maxX/10)*7)-2;
+-    subWin  = newwin(height,width,origY,origX);
++    subWin  = subwin(chWin,height-2,width-2,origY+1,origX+1);
+     
+     origY=maxY-1; origX=0;
+     height = 1;  width = maxX-1;
diff --git a/audio/emixer/patches/patch-ad b/audio/emixer/patches/patch-ad
new file mode 100644
index 00000000000..d0b8031388b
--- /dev/null
+++ b/audio/emixer/patches/patch-ad
@@ -0,0 +1,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);
-- 
cgit v1.2.3