summaryrefslogtreecommitdiff
path: root/audio/gmodplay/patches/patch-ae
blob: 8f2da2780da593013b9a9253c779eac56bb6c925 (plain)
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
$NetBSD: patch-ae,v 1.1.1.1 2001/03/19 19:35:52 wiz Exp $

--- common/modplay.cpp.orig	Mon Oct  5 01:29:52 1998
+++ common/modplay.cpp	Sun Jan 28 14:01:34 2001
@@ -14,8 +14,9 @@
 #include <fcntl.h>
 #include <math.h>
 #include <sys/ioctl.h>
-#include <sys/soundcard.h>
+#include <soundcard.h>
 #include <string.h>
+#include <libgen.h>
 
 #include "stdafx.h"
 #include "sndfile.h"
@@ -88,9 +89,9 @@
 	}
 	else {
 		int val = Player->stereo?1:0;
-		ioctl(Player->dsp.fd, SNDCTL_DSP_POST);
+		ioctl(Player->dsp.fd, SNDCTL_DSP_POST, NULL);
 		ioctl(Player->dsp.fd, SNDCTL_DSP_STEREO, &val);
-		ioctl(Player->dsp.fd, SNDCTL_DSP_RESET);
+		ioctl(Player->dsp.fd, SNDCTL_DSP_RESET, NULL);
 	}
 
 	bufsize = (TIMELEN * Player->dsp.sample_rate) / 1000;
@@ -127,8 +128,8 @@
 	Player->paused = true;
 	/* FIXME:  Useless when doing a close(dsp)??
 	if (!Player->stopped) {
-		ioctl(Player->dsp.fd, SNDCTL_DSP_SYNC);
-		ioctl(Player->dsp.fd, SNDCTL_DSP_RESET);
+		ioctl(Player->dsp.fd, SNDCTL_DSP_SYNC, NULL);
+		ioctl(Player->dsp.fd, SNDCTL_DSP_RESET, NULL);
 	}
 	*/
 	if (Player->buffer) {
@@ -143,8 +144,8 @@
 {
 	if (Player->stopped)
 		return 0;
-	ioctl(Player->dsp.fd, SNDCTL_DSP_SYNC);
-	ioctl(Player->dsp.fd, SNDCTL_DSP_RESET);
+	ioctl(Player->dsp.fd, SNDCTL_DSP_SYNC, NULL);
+	ioctl(Player->dsp.fd, SNDCTL_DSP_RESET, NULL);
 	if (Player->buffer) {
 		delete Player->buffer;
 		Player->buffer = NULL;
@@ -330,6 +331,14 @@
 	printf("   -n, --nospectrum   don't display spectrum\n");
 	printf("   -x                 disable X11 interface\n");
 	printf("   -v, --version      output version information and exit\n");
+	printf("   -s, --surround     surround sound on\n");
+	printf("   -o, --oversamp     oversampling on\n");
+	printf("   -r, --reverb       reverb on\n");
+	printf("   -b, --megabass     megabass on\n");
+	printf("   -g, --volramp      gain control on\n");
+	printf("   -f, --filter       noise reduction on\n");
+	printf("   -w, --rawdump      dump to output.raw\n");
+
 }
 
 void
@@ -370,11 +379,55 @@
 			Player->updatespectro = false;
 			continue;
 		}
+		if (strcmp(Args[i], "-s") == 0 ||
+			strcmp(Args[i], "--surround") == 0)
+		{
+			Player->surround = true;
+			continue;
+		}
+		if (strcmp(Args[i], "-o") == 0 ||
+			strcmp(Args[i], "--oversamp") == 0)
+		{
+			Player->oversamp = true;
+			continue;
+		}
+		if (strcmp(Args[i], "-r") == 0 ||
+			strcmp(Args[i], "--reverb") == 0)
+		{
+			Player->reverb = true;
+			continue;
+		}
+		if (strcmp(Args[i], "-b") == 0 ||
+			strcmp(Args[i], "--megabass") == 0)
+		{
+			Player->megabass = true;
+			continue;
+		}
+		if (strcmp(Args[i], "-g") == 0 ||
+			strcmp(Args[i], "--gain") == 0)
+		{
+			Player->nr = true;
+			continue;
+		}
+		if (strcmp(Args[i], "-f") == 0 ||
+			strcmp(Args[i], "--filter") == 0)
+		{
+			Player->volramp = true;
+			continue;
+		}
 		if (strcmp(Args[i], "-d") == 0 || strcmp(Args[i], "--device") == 0) {
 			/* FIXME: Test  if Args[i+1] starts with - */
 			Player->dsp.name = Args[1+i++];
 			continue;
 		}
+		if (strcmp(Args[i], "-w") == 0 ||
+			strcmp(Args[i], "--rawdump") == 0)
+		{
+			Player->dsp.rawdump = true;
+			Player->dsp.name = (char *)malloc(11);
+			strcpy(Player->dsp.name, "output.raw");
+			continue;
+		}
 		if (strcmp(Args[i], "--") == 0) {
 			more_params = false;
 			continue;
@@ -413,18 +466,19 @@
 
 	Player->dsp.name = NULL;
 	Player->dsp.fd = -1;
+	Player->dsp.rawdump = false;
 
 	Player->stereo = true;
 	Player->updatespectro = true;
 	Player->repeat = false;
 	Player->paused = false;
 	Player->stopped = true;
-	Player->surround = true;
-	Player->oversamp = true;
-	Player->reverb = true;
-	Player->megabass = true;
-	Player->nr = false;
-	Player->volramp = true;
+	Player->surround = false;
+	Player->oversamp = false;
+	Player->reverb = false;
+	Player->megabass = false;
+	Player->nr = true;
+	Player->volramp = false;
 
 
 	if ((Player->playlist = CreatePlayList("default")) == NULL) {