summaryrefslogtreecommitdiff
blob: 07d6f2d3751c21f77476db77b85ff6b89b71b78b (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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
* Remove completely broken Qt handling, dating back to Qt3 days
* Fix ancient C++ includes using '.h' suffixes
* Fix warnings caused by not using 'const char*'

--- a/apps/common.cc
+++ b/apps/common.cc
@@ -34,7 +34,7 @@
 int splay_threadnum=50;
 #endif
 
-char *splay_Sounderrors[SOUND_ERROR_UNKNOWN]=
+const char *splay_Sounderrors[SOUND_ERROR_UNKNOWN]=
 { "Failed to open sound device.",
   "Sound device is busy.",
   "Buffersize of sound device is wrong.",
--- a/apps/Makefile.am
+++ b/apps/Makefile.am
@@ -1,4 +1,4 @@
-bin_PROGRAMS = splay @XSPLAY@
+bin_PROGRAMS = splay
 EXTRA_PROGRAMS =xsplay
 splay_SOURCES =  common.cc splay.cc splay.h
 xsplay_SOURCES = xsplay.cc functions.cc \
@@ -17,7 +17,7 @@
 INCLUDES = -I../libs  -I/usr/include/qt
 xsplay_LDADD=-lqt $(LDADD)
 
-man_MANS = splay.1 xsplay.1
+man_MANS = splay.1
 EXTRA_DIST = $(man_MANS)
 
 
--- a/apps/splay.cc
+++ b/apps/splay.cc
@@ -16,20 +16,23 @@
 
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <iostream.h>
+#include <iostream>
 
 #ifdef HAVE_LIBID3
 #include <id3/tag.h>
 #include <id3/misc_support.h>
 #endif /* HAVE_LIBID3 */
 
-#include <iomanip.h>
+#include <iomanip>
+
+using std::cout;
+using std::endl;
 
 #include "mpegsound.h"
 
 #include "splay.h"
 
-static char *help=
+static const char *help=
 "\t-2 : playing with half frequency.\n"
 "\t-e : exit when playing is done. (only XSPLAY)\n"
 "\t-f : display frame and time info (played and remaining).\n"
--- a/apps/splay.h
+++ b/apps/splay.h
@@ -20,7 +20,7 @@
             splay_forcetomonoflag,
             splay_frameinfo;
 
-extern char *splay_Sounderrors[];
+extern const char *splay_Sounderrors[];
 
 #ifdef PTHREADEDMPEG
 extern int  splay_threadnum;
--- a/apps/xsplay.cc
+++ b/apps/xsplay.cc
@@ -29,8 +29,8 @@
 #include <fcntl.h>
 #include <string.h>
 #include <unistd.h>
-#include <iostream.h>
-#include <iomanip.h>
+#include <iostream>
+#include <iomanip>
 
 #include "mpegsound.h"
 #include "xsplay.h"
--- a/configure.in
+++ b/configure.in
@@ -10,12 +10,12 @@
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_RANLIB
+AM_PROG_AR
 
 dnl Checks for libraries.
 AC_CHECK_LIB(id3, ID3Tag_New)
 AC_CHECK_LIB(m, cos)
 AC_CHECK_LIB(pthread,main,INCLUDEPTHREAD=1)
-AC_CHECK_LIB(qt, main,XSPLAY=xsplay)
 
 if test "$INCLUDEPTHREAD" = 1; then
 	LIBS="$LIBS -lpthread"
--- a/libs/fileplayer.cc
+++ b/libs/fileplayer.cc
@@ -10,7 +10,7 @@
 #endif
 
 #include <string.h>
-#include <iostream.h>
+#include <iostream>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -18,6 +18,10 @@
 
 #include "mpegsound.h"
 
+using std::cout;
+using std::cerr;
+using std::endl;
+
 // File player superclass
 Fileplayer::Fileplayer()
 {
@@ -43,7 +47,7 @@
   if(server)delete server;
 }
 
-bool Mpegfileplayer::openfile(char *filename,char *device)
+bool Mpegfileplayer::openfile(char *filename, const char *device)
 {
 // Player
   if(device==NULL){
@@ -188,7 +192,7 @@
 
 void Mpegfileplayer::showverbose(int )
 {
-  static char *modestring[4]={"stereo","joint stereo","dual channel","mono"};
+  static const char *modestring[4]={"stereo","joint stereo","dual channel","mono"};
 
   fprintf(stderr,"\tMPEG-%d Layer %d, %s,\n\t%dHz%s, %dkbit/s, ",
 	  server->getversion()+1,
--- a/libs/mpegsound.h
+++ b/libs/mpegsound.h
@@ -230,7 +230,7 @@
   Soundplayer() {__errorcode=SOUND_ERROR_OK;};
   virtual ~Soundplayer();
 
-  virtual bool initialize(char *filename)                       =0;
+  virtual bool initialize(const char *filename)                       =0;
   virtual void abort(void);
   virtual int  getprocessed(void);
 
@@ -255,7 +255,7 @@
 public:
   ~Rawtofile();
 
-  bool initialize(char *filename);
+  bool initialize(const char *filename);
   bool setsoundtype(int stereo,int samplesize,int speed);
   bool putblock(void *buffer,int size);
 
@@ -270,7 +270,7 @@
 public:
   ~Rawplayer();
 
-  bool initialize(char *filename);
+  bool initialize(const char *filename);
   void abort(void);
   int  getprocessed(void);
 
@@ -284,7 +284,7 @@
   void setquota(int q){quota=q;};
   int  getquota(void) {return quota;};
 
-  static char *defaultdevice;
+  static const char *defaultdevice;
   static int  setvolume(int volume);
 
 private:
@@ -573,7 +573,7 @@
 
   int geterrorcode(void)        {return __errorcode;};
 
-  virtual bool openfile(char *filename,char *device)=0;
+  virtual bool openfile(char *filename, const char *device)=0;
   virtual void setforcetomono(bool flag)            =0;
   virtual bool playing(int verbose,bool frameinfo, int startframe)                 =0;
 
@@ -593,7 +593,7 @@
   Mpegfileplayer();
   ~Mpegfileplayer();
 
-  bool openfile(char *filename,char *device);
+  bool openfile(char *filename, const char *device);
   void setforcetomono(bool flag);
   void setdownfrequency(int value);
   bool playing(int verbose, bool frameinfo, int startframe);
--- a/libs/mpegtoraw.cc
+++ b/libs/mpegtoraw.cc
@@ -552,7 +552,7 @@
 #endif
 
 
-#include <iostream.h>
+#include <iostream>
 // Convert mpeg to raw
 bool Mpegtoraw::run(int frames)
 {
--- a/libs/rawplayer.cc
+++ b/libs/rawplayer.cc
@@ -24,7 +24,7 @@
 #define IOCTL(a,b,c)		(c = ioctl(a,b,c) )
 #endif
 
-char *Rawplayer::defaultdevice="/dev/dsp";
+const char *Rawplayer::defaultdevice="/dev/dsp";
 
 /* Volume */
 int Rawplayer::setvolume(int volume)
@@ -57,7 +57,7 @@
   close(audiohandle);
 }
 
-bool Rawplayer::initialize(char *filename)
+bool Rawplayer::initialize(const char *filename)
 {
   int flag;
 
@@ -172,7 +172,7 @@
 
   if(quota)
     while(getprocessed()>quota)usleep(3);
-  write(audiohandle,buffer,modifiedsize);
+  if(write(audiohandle,buffer,modifiedsize)) {}
 
   return true;
 }
--- a/libs/rawtofile.cc
+++ b/libs/rawtofile.cc
@@ -20,7 +20,7 @@
   close(filehandle);
 }
 
-bool Rawtofile::initialize(char *filename)
+bool Rawtofile::initialize(const char *filename)
 {
   if(filename==NULL)filehandle=1;
   else if((filehandle=creat(filename,0644))==-1)