diff -ur old/wmcdplay/Imakefile new/wmcdplay/Imakefile --- old/wmcdplay/Imakefile Sat Sep 5 08:11:26 1998 +++ new/wmcdplay/Imakefile Mon May 1 17:57:46 2000 @@ -1,8 +1,37 @@ -DEPLIBS = $(DEPXLIB) +# +# the following entry compiles wmcdplay using g++ under linux or Solaris. +# Comment out the first line and uncomment the second to compile using the +# Sun workshop compiler. +# +CCC = g++ +#CCC = CC + +# +# You may need to add a run (-R) and link (-L) flag if your copy of +# libxpm is installed somewhere non-standard. Uncomment and edit +# LOCAL_LIBRARY_PATHS if that is the case. + +LOCAL_LIBRARY_PATHS += -R/usr/local/lib -L/usr/local/lib +LOCAL_LIBRARY_PATHS += -R/opt/sfw/lib -L/opt/sfw/lib +LOCAL_LIBRARIES = $(XPMLIB) $(XLIB) $(LOCAL_LIBRARY_PATHS) -lXpm -LOCAL_LIBRARIES = $(XPMLIB) $(XLIB) +# +# If your xpm.h header is in a non-standard place, uncomment CPPFLAGS and +# edit it to point at the directory containing xpm.h. +# +CPPFLAGS += -I/usr/local/include +CPPFLAGS += -I/opt/sfw/include + +#- - - - You shouldn't need to edit below this point - - - - - - - - - - - - - + +# +# For some reason CXX doesn't get set, but we need it to link, so force it +# to be the same as the C++ compiler. Can't we all just get along? +# +CXX = $(CCC) +DEPLIBS = $(DEPXLIB) SRCS = wmcdplay.cc OBJS = wmcdplay.o -ComplexProgramTarget(wmcdplay) +SimpleCplusplusProgramTarget(wmcdplay) diff -ur old/wmcdplay/cdctl.h new/wmcdplay/cdctl.h --- old/wmcdplay/cdctl.h Sat Sep 5 08:11:26 1998 +++ new/wmcdplay/cdctl.h Fri Jan 21 00:02:28 2000 @@ -30,7 +30,11 @@ #include #include #include -#include +#ifdef sun +# include +#else +# include +#endif // CD status values #define ssData 0 @@ -52,6 +56,10 @@ #define acEject 8 #define acClose 9 +#ifndef CD_MSF_OFFSET /* Solaris doesn't define CD_MSF_OFFSET */ +#define CD_MSF_OFFSET 150 +#endif + // Track selection values (what to do when I've played the requested track) // Note: Track selection is not perfect - so use tsNone if you want to avoid trouble. // Basically, if we receive a CDROM_AUDIO_COMPLETED status, then we have to decide what to do. @@ -163,8 +171,10 @@ status_state=ssTrayOpen; break; case acClose: - ioctl(cdfd,CDROMCLOSETRAY); +#ifdef CDROMCLOSETRAY /* Solaris doesn't support CDROMCLOSETRAY */ + ioctl(cdfd,CDROMCLOSETRAY); status_state=ssNoCD; +#endif break; } doStatus(); @@ -244,10 +254,14 @@ } void readVolume(){ if(cdfdopen){ + status_volumel=0; + status_volumer=0; +#ifdef CDROMVOLREAD /* Solaris doesn't have CDROMVOLREAD */ struct cdrom_volctrl vol; ioctl(cdfd,CDROMVOLREAD,&vol); status_volumel=vol.channel0; status_volumer=vol.channel1; +#endif } } int getVolumeL(){ diff -ur old/wmcdplay/wmcdplay.cc new/wmcdplay/wmcdplay.cc --- old/wmcdplay/wmcdplay.cc Sat Sep 5 08:11:26 1998 +++ new/wmcdplay/wmcdplay.cc Fri Oct 29 19:57:20 1999 @@ -541,6 +541,7 @@ } void update(){ + XPoint *mply; if(mode==ssData) sprintf(timestr, "DA_TA"); if(mode==ssNoCD) @@ -548,7 +549,7 @@ if(mode==ssTrayOpen) sprintf(timestr, "OP_EN"); - XPoint mply[art_nbtns]; + mply = new XPoint[art_nbtns]; if(pm_cdmask!=None){ XSetForeground(d_display, gc_bitgc, 0); XCopyArea(d_display, pm_cdmask, pm_mask, gc_bitgc, 0, 0, 64, 64, 0, 0); @@ -591,6 +592,7 @@ XCopyArea(d_display, pm_sled, pm_disp, gc_gc, (art_ledsize[2]+1)*mode, 0, art_ledsize[2], art_ledsize[3], art_ledpos[2][0], art_ledpos[2][1]); if(art_showled[3]) XCopyArea(d_display, pm_tled, pm_disp, gc_gc, (art_ledsize[4]+1)*tsel, 0, art_ledsize[4], art_ledsize[5], art_ledpos[3][0], art_ledpos[3][1]); + delete [] mply; } void drawText(int x, int y, char *text){