View | Details | Raw Unified | Return to bug 69056
Collapse All | Expand All

(-)wmix/Makefile (-5 / +22 lines)
Lines 6-23 Link Here
6
#
6
#
7
7
8
PORTNAME=	wmix
8
PORTNAME=	wmix
9
PORTVERSION=	2.20
9
PORTVERSION=	3.1
10
CATEGORIES=	audio windowmaker
10
CATEGORIES=	audio windowmaker
11
MASTER_SITES=	http://www.ne.jp/asahi/linux/timecop/software/
11
MASTER_SITES=	http://www.ne.jp/asahi/linux/timecop/software/
12
12
13
MAINTAINER=	ports@FreeBSD.org
13
MAINTAINER=	bogorodskiy@inbox.ru
14
COMMENT=	An audio mixer for the WindowMaker dock with TV-like OSD
14
COMMENT=	An audio mixer for the WindowMaker dock with TV-like OSD
15
15
16
USE_REINPLACE=	yes
16
PLIST_FILES=	bin/wmix
17
PLIST_FILES=	bin/wmix
17
USE_XPM=	YES
18
ALL_TARGET=	${PORTNAME}
18
USE_X_PREFIX=	YES
19
USE_XPM=	yes
20
USE_X_PREFIX=	yes
21
22
PORTDOCS=	AUTHORS BUGS INSTALL NEWS README
23
24
post-patch:
25
	@${REINPLACE_CMD} -e 's|PORT_CC|${CC}|g' ${WRKSRC}/Makefile
26
	@${REINPLACE_CMD} -e 's|PORT_CFLAGS|${CFLAGS} -I${X11BASE}/include|g' ${WRKSRC}/Makefile
27
	@${REINPLACE_CMD} -e 's|PORT_LDFLAGS|${LDFLAGS} -L${X11BASE}/lib|g' ${WRKSRC}/Makefile
19
28
20
do-install:
29
do-install:
21
	@${INSTALL_PROGRAM} ${WRKSRC}/wmix ${PREFIX}/bin
30
	${INSTALL_PROGRAM} ${WRKSRC}/wmix ${PREFIX}/bin
31
32
post-install:
33
.ifndef (NOPORTDOCS)
34
	@${MKDIR} ${DOCSDIR}
35
.for i in ${PORTDOCS}
36
	@${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
37
.endfor
38
.endif
22
39
23
.include <bsd.port.mk>
40
.include <bsd.port.mk>
(-)wmix/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
MD5 (wmix-2.20.tar.gz) = c1d33e155a582cfebdb9ff9caf518c69
1
MD5 (wmix-3.1.tar.gz) = 62f6e86f7558f193e081dc29444a6699
2
SIZE (wmix-2.20.tar.gz) = 42665
2
SIZE (wmix-3.1.tar.gz) = 21344
(-)wmix/files/patch-Makefile (+12 lines)
Line 0 Link Here
1
--- Makefile.orig	Wed Jul 14 16:55:24 2004
2
+++ Makefile	Wed Jul 14 16:56:37 2004
3
@@ -1,6 +1,6 @@
4
-CC		= gcc
5
-CFLAGS		= -O3 -W -Wall
6
-LDFLAGS		= -L/usr/X11R6/lib
7
+CC		= PORT_CC
8
+CFLAGS		= PORT_CFLAGS
9
+LDFLAGS		= PORT_LDFLAGS
10
 OBJECTS		= misc.o mixer-oss.o ui_x.o wmix.o
11
 
12
 # where to install this program (also for packaging stuff)
(-)wmix/files/patch-aa (-20 lines)
Lines 1-20 Link Here
1
--- Makefile.orig	Thu Mar 29 13:49:38 2001
2
+++ Makefile	Mon Apr 30 14:49:50 2001
3
@@ -1,6 +1,5 @@
4
-CC	= gcc
5
-CFLAGS	= -O2 -Wall -I/usr/X11R6/include -DCUSTOM
6
-LIBS	= -L/usr/X11R6/lib -lX11 -lXpm -lXext
7
+CFLAGS += -Wall -I/usr/local/include -I/usr/X11R6/include -DCUSTOM
8
+LDFLAGS = -L/usr/local/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext
9
 
10
 SRCS	= mix.c config.c
11
 OBJS	= mix.o config.o
12
@@ -8,7 +7,7 @@
13
 all:	mixer
14
 
15
 mixer:	$(OBJS)
16
-	$(CC) $(CFLAGS) -o wmix $(OBJS) $(LIBS)
17
+	$(CC) $(CFLAGS) $(LDFLAGS) -o wmix $(OBJS)
18
 
19
 clean:
20
 	rm -f *.o *~ wmix trace
(-)wmix/files/patch-ab (-146 lines)
Lines 1-146 Link Here
1
*** mix.c.orig	Fri Apr 20 11:52:28 2001
2
--- mix.c	Sun Jul 22 12:19:34 2001
3
***************
4
*** 20,26 ****
5
--- 20,28 ----
6
  #include <stdlib.h>
7
  #include <string.h>
8
  #include <ctype.h>
9
+ #ifdef linux
10
  #include <getopt.h>
11
+ #endif
12
  #include <time.h>
13
  #include <unistd.h>
14
  #include <fcntl.h>
15
***************
16
*** 887,899 ****
17
  #ifdef CUSTOM
18
  #undef SOUND_DEVICE_NAMES
19
  
20
! #define SOUND_DEVICE_NAMES	{"Master Volume", "Bass", "Treble", "FM Synth Volume", "PCM - Wave Volume", "PC Speaker", "Line In Level", \
21
! 				 "Microphone Level", "CD Input Volume", "Mixer Level", "PCM2 - Wave Volume", "Recording Volume", "Input Gain", "Output Gain", \
22
! 				 "Line1 Input", "Line2 Input", "Line3 Input", "Digital 1", "Digital 2", "Digital 3", \
23
! 				 "Phone Input", "Phone Output", "Video Card Volume", "Radio Card volume", "Monitor Volume"}
24
  #endif
25
      char *names[] = SOUND_DEVICE_NAMES;
26
      struct mixer_info mixer_info;
27
  
28
      if ((mixer_fd = open(value("mixerdev"), O_RDWR)) == -1) {
29
  	printf("error: cannot open mixer device %s\n", value("mixerdev"));
30
--- 889,903 ----
31
  #ifdef CUSTOM
32
  #undef SOUND_DEVICE_NAMES
33
  
34
! #define SOUND_DEVICE_NAMES	{" Master Volume", " Bass", " Treble", " Synth Volume", " Wave Volume", " PC Speaker", " Line In Level", \
35
! 				 " Microphone Level", " CD Volume", " Mixer Level", " Wave 2 Volume", " Recording Volume", " Input Gain", " Output Gain", \
36
! 				 " Line1 Input", " Line2 Input", " Line3 Input", " Digital 1", " Digital 2", " Digital 3", \
37
! 				 " Phone Input", " Phone Output", " Video Card Volume", " Radio Card Volume", " Monitor Volume"}
38
  #endif
39
      char *names[] = SOUND_DEVICE_NAMES;
40
+ #ifndef __FreeBSD__
41
      struct mixer_info mixer_info;
42
+ #endif
43
  
44
      if ((mixer_fd = open(value("mixerdev"), O_RDWR)) == -1) {
45
  	printf("error: cannot open mixer device %s\n", value("mixerdev"));
46
***************
47
*** 921,932 ****
48
  	exit(1);
49
      }
50
  
51
      if (ioctl(mixer_fd, SOUND_MIXER_INFO, &mixer_info) == -1) {
52
  	printf("error: cannot get mixer info off mixer\n");
53
  	exit(1);
54
      }
55
- 
56
      printf("%s (%s) [", mixer_info.name, mixer_info.id);
57
      for (count = 0; count < SOUND_MIXER_NRDEVICES; count++) {
58
  	if ((1 << count) & devmask) {
59
  	    strcpy(mixer[nchannels].name, names[count]);
60
--- 925,940 ----
61
  	exit(1);
62
      }
63
  
64
+ #ifdef __FreeBSD__
65
+     printf("[");
66
+ #else
67
      if (ioctl(mixer_fd, SOUND_MIXER_INFO, &mixer_info) == -1) {
68
  	printf("error: cannot get mixer info off mixer\n");
69
  	exit(1);
70
      }
71
      printf("%s (%s) [", mixer_info.name, mixer_info.id);
72
+ #endif
73
+ 
74
      for (count = 0; count < SOUND_MIXER_NRDEVICES; count++) {
75
  	if ((1 << count) & devmask) {
76
  	    strcpy(mixer[nchannels].name, names[count]);
77
***************
78
*** 946,951 ****
79
--- 954,960 ----
80
  	    printf("0");
81
  	}
82
      }
83
+ 
84
      printf("]\n");
85
  }
86
  
87
***************
88
*** 953,971 ****
89
  {
90
      int i;
91
      int left, right, foo;
92
      int retry = 3;
93
      int stat = 1;
94
      struct mixer_info mixer_info;
95
      static int modify_counter;
96
-     static Mixer old_mix[SOUND_MIXER_NRDEVICES];
97
  
98
      /* check for possible failure here - happens with older kernels */
99
      if (ioctl(mixer_fd, SOUND_MIXER_INFO, &mixer_info)) {
100
  	while (retry-- && stat)
101
  	    stat = ioctl(mixer_fd, SOUND_MIXER_INFO, &mixer_info);
102
      }
103
  
104
!     if (mixer_info.modify_counter != modify_counter) {
105
  	i = 0;
106
  	/* this happens if mixer was changed by another program,
107
  	 * so we need to update the values.  We do not know, under OSS,
108
--- 962,987 ----
109
  {
110
      int i;
111
      int left, right, foo;
112
+     char doupdate = 0;
113
+     static Mixer old_mix[SOUND_MIXER_NRDEVICES];
114
+ #ifndef __FreeBSD__
115
      int retry = 3;
116
      int stat = 1;
117
      struct mixer_info mixer_info;
118
      static int modify_counter;
119
  
120
      /* check for possible failure here - happens with older kernels */
121
      if (ioctl(mixer_fd, SOUND_MIXER_INFO, &mixer_info)) {
122
  	while (retry-- && stat)
123
  	    stat = ioctl(mixer_fd, SOUND_MIXER_INFO, &mixer_info);
124
      }
125
+     doupdate = mixer_info.modify_counter != modify_counter;
126
+ #else
127
+     /* clearly something better would be nice, but hey, it works! */
128
+     doupdate = 1;
129
+ #endif
130
  
131
!     if (doupdate) {
132
  	i = 0;
133
  	/* this happens if mixer was changed by another program,
134
  	 * so we need to update the values.  We do not know, under OSS,
135
***************
136
*** 1022,1028 ****
137
--- 1038,1046 ----
138
  	    }
139
  	}
140
      }
141
+ #ifndef __FreeBSD__
142
      modify_counter = mixer_info.modify_counter;
143
+ #endif
144
      memcpy(old_mix, mixer, sizeof(mixer));
145
  }
146
  
(-)wmix/files/patch-ac (-29 lines)
Lines 1-29 Link Here
1
*** config.c.orig	Sun Apr  1 22:43:30 2001
2
--- config.c	Sun Apr  1 22:43:51 2001
3
***************
4
*** 135,141 ****
5
  	free((struct var *) vars);
6
  	vars = vp;
7
      }
8
!     if (vars)
9
  	for (new = vars; new->v_next;)
10
  	    if (!strcmp(new->v_next->v_name, name)) {
11
  		vp = new->v_next->v_next;
12
--- 135,141 ----
13
  	free((struct var *) vars);
14
  	vars = vp;
15
      }
16
!     if (vars) {
17
  	for (new = vars; new->v_next;)
18
  	    if (!strcmp(new->v_next->v_name, name)) {
19
  		vp = new->v_next->v_next;
20
***************
21
*** 143,148 ****
22
--- 143,149 ----
23
  		new->v_next = vp;
24
  	    } else
25
  		new = new->v_next;
26
+     }
27
  }
28
  
29
  char *vcopy(char *str)
(-)wmix/files/patch-mixer-oss.c (+69 lines)
Line 0 Link Here
1
--- mixer-oss.c.orig	Wed Jul 14 18:00:14 2004
2
+++ mixer-oss.c	Wed Jul 14 17:58:50 2004
3
@@ -94,7 +94,9 @@
4
 
5
 static bool get_mixer_state(void)
6
 {
7
+#if 0
8
     struct mixer_info m_info;
9
+#endif
10
     int dev_lr_volume, dev_left_volume, dev_right_volume;
11
     float left, right;
12
     int srcmask;
13
@@ -103,14 +105,16 @@
14
     /* to really keep track of updates */
15
     static MixerChannel oldmixer[SOUND_MIXER_NRDEVICES];
16
 
17
+#if 0
18
     ioctl(mixer_fd, SOUND_MIXER_INFO, &m_info);
19
 
20
+   
21
     if (m_info.modify_counter == prev_modify_counter)
22
 	/*
23
 	 * Mixer state has not changed
24
 	 */
25
 	return false;
26
-
27
+#endif
28
     /* Mixer state was changed by another program, so we need
29
      * to update. As OSS cannot tell us specifically which
30
      * channels changed, we read all of them in.
31
@@ -157,7 +161,7 @@
32
 	}
33
 	mixer[ch].is_recording = ((1 << mixer[ch].dev) & srcmask) != 0;
34
     }
35
-    prev_modify_counter = m_info.modify_counter;
36
+    /* prev_modify_counter = m_info.modify_counter; */
37
     /* check if this was due to OSS stupidity or if we really changed */
38
     if (!memcmp(&mixer, &oldmixer, sizeof(mixer))) {
39
 	memcpy(&oldmixer, &mixer, sizeof(mixer));
40
@@ -224,7 +228,9 @@
41
 void mixer_init(const char *mixer_device, bool verbose, const char * exclude[])
42
 {
43
     int devmask, srcmask, recmask, stmask;
44
+#if 0
45
     struct mixer_info m_info;
46
+#endif
47
     int count;
48
     int mask;
49
 
50
@@ -256,15 +262,19 @@
51
 	exit(EXIT_FAILURE);
52
     }
53
 
54
+#if 0
55
     if (ioctl(mixer_fd, SOUND_MIXER_INFO, &m_info) == -1) {
56
 	fputs("error: could not read mixer info\n", stderr);
57
+	perror("ioctl");
58
 	exit(EXIT_FAILURE);
59
     }
60
 
61
+    
62
     if (verbose) {
63
 	printf("%s (%s)\n", m_info.name, m_info.id);
64
 	puts("Supported channels:");
65
     }
66
+#endif
67
     for (count = 0; count < SOUND_MIXER_NRDEVICES; count++) {
68
 	mask = 1 << count;
69
 	if ((mask & devmask) && (!is_exclude((short_names[count]),exclude))) {
(-)wmix/files/patch-wmix.c (+10 lines)
Line 0 Link Here
1
--- wmix.c.orig	Wed Jul 14 18:15:17 2004
2
+++ wmix.c	Wed Jul 14 18:15:26 2004
3
@@ -24,7 +24,6 @@
4
 #include <string.h>
5
 #include <signal.h>
6
 #include <string.h>
7
-#include <getopt.h>
8
 #include <unistd.h>
9
 
10
 #include <X11/X.h>

Return to bug 69056