diff options
-rw-r--r-- | doc/kscd/index.docbook | 1 | ||||
-rw-r--r-- | kscd/Makefile.am | 1 | ||||
-rwxr-xr-x | kscd/kscd-script | 32 | ||||
-rw-r--r-- | kscd/kscdmagic/main.cpp | 2 | ||||
-rw-r--r-- | kscd/kscdmagic/syna.h | 6 | ||||
-rw-r--r-- | kscd/kscdmagic/xlibwrap.cpp | 2 | ||||
-rw-r--r-- | kscd/libwm/CMakeLists.txt | 2 | ||||
-rw-r--r-- | kscd/libwm/Makefile.am | 2 | ||||
-rw-r--r-- | kscd/libwm/PLAT_IMPL_STATUS | 70 | ||||
-rw-r--r-- | kscd/libwm/include/wm_config.h | 17 | ||||
-rw-r--r-- | kscd/libwm/plat_osf1.c | 674 | ||||
-rw-r--r-- | mpg123_artsplugin/mpg123PlayObject_impl.h | 2 | ||||
-rw-r--r-- | noatun/library/engine.cpp | 4 | ||||
-rw-r--r-- | tdefile-plugins/au/tdefile_au.cpp | 5 | ||||
-rw-r--r-- | tdefile-plugins/avi/tdefile_avi.cpp | 6 | ||||
-rw-r--r-- | tdefile-plugins/avi/tdefile_avi.h | 6 | ||||
-rw-r--r-- | tdefile-plugins/wav/tdefile_wav.cpp | 5 |
17 files changed, 42 insertions, 795 deletions
diff --git a/doc/kscd/index.docbook b/doc/kscd/index.docbook index b724ac6d..d36645af 100644 --- a/doc/kscd/index.docbook +++ b/doc/kscd/index.docbook @@ -128,7 +128,6 @@ support)</para></listitem> <listitem><para>&SGI; Irix (including <abbrev>cdda</abbrev> support)</para></listitem> <listitem><para>Sony NEWS</para></listitem> -<listitem><para>OSF/1</para></listitem> <listitem><para>Ultrix</para></listitem> </itemizedlist> diff --git a/kscd/Makefile.am b/kscd/Makefile.am index c7091a6d..93297cb5 100644 --- a/kscd/Makefile.am +++ b/kscd/Makefile.am @@ -65,7 +65,6 @@ plat_hpux.c:config.h plat_irix.c:config.h plat_linux.c:config.h plat_news.c:config.h -plat_osf1.c:config.h plat_scor5.c:config.h plat_sun.c:config.h plat_sun_audio.c:config.h diff --git a/kscd/kscd-script b/kscd/kscd-script index 89146f7c..27de2d26 100755 --- a/kscd/kscd-script +++ b/kscd/kscd-script @@ -51,7 +51,6 @@ echo " Sun ........................ S" echo " HPUX ....................... H" echo " Irix ....................... I" echo " Sony NEWS .................. N" -echo " OSF/1 ...................... O" echo " Ultrix ..................... U" echo " Generic SVR4 (not Sun) ..... V" echo @@ -661,36 +660,6 @@ echo "#endif /* ultrix */" >> $config_file } -osf_conf(){ - -clear -echo "KSCD configuration for OSF systems" -echo "----------------------------------" -echo - -give_instructions -write_config_header - -echo "" >> config_file -echo "#if defined(__osf__)" >> $config_file - -echo "Nothing to be done for OSF. The CD device should be automatically detected." -echo "If you have trouble look at plat_osf1.c and let me know what needs to be" -echo "changed." - -echo "" -echo $ac_n "Press [Enter] to continue.$ac_c" -read dummy - -echo "" >> $config_file -echo "#endif /* osf */" >> $config_file -echo "" >> $config_file - -#endif - - -} - generic_svr_conf(){ clear @@ -751,7 +720,6 @@ s|S) sun_conf;; h|H) hp_conf;; i|I) irix_conf;; n|N) sony_conf;; -o|O) osf_conf;; u|U) ultrix_conf;; v|V) generic_svr_conf;; *) linux_conf;; diff --git a/kscd/kscdmagic/main.cpp b/kscd/kscdmagic/main.cpp index 312b4b14..f0ae7df8 100644 --- a/kscd/kscdmagic/main.cpp +++ b/kscd/kscdmagic/main.cpp @@ -37,7 +37,7 @@ #include <stdio.h> #include <errno.h> -#if defined(__linux__) || defined(__svr4__) || defined(__osf__) +#if defined(__linux__) || defined(__svr4__) #include <signal.h> #include <time.h> diff --git a/kscd/kscdmagic/syna.h b/kscd/kscdmagic/syna.h index d359a8c2..98725dd8 100644 --- a/kscd/kscdmagic/syna.h +++ b/kscd/kscdmagic/syna.h @@ -28,7 +28,7 @@ #define __SYNA_H__ -#if defined(__linux__) || defined(__svr4__) || defined(__osf__) +#if defined(__linux__) || defined(__svr4__) void error(const char *str, bool syscall=false); //Display error and exit void warning(const char *str, bool syscall=false); //Display error @@ -64,11 +64,7 @@ typedef short sampleType; #endif #endif -#ifdef __osf__ -#include <machine/endian.h> -#else #include <endian.h> -#endif #if BYTE_ORDER == BIG_ENDIAN #define BIGENDIAN #else diff --git a/kscd/kscdmagic/xlibwrap.cpp b/kscd/kscdmagic/xlibwrap.cpp index e0ff74ba..b893ea84 100644 --- a/kscd/kscdmagic/xlibwrap.cpp +++ b/kscd/kscdmagic/xlibwrap.cpp @@ -21,7 +21,7 @@ 27 Bond St., Mt. Waverley, 3149, Melbourne, Australia */ -#if defined(__linux__) || defined (__svr4__) || defined(__osf__) +#if defined(__linux__) || defined (__svr4__) #include <string.h> diff --git a/kscd/libwm/CMakeLists.txt b/kscd/libwm/CMakeLists.txt index d3816c9e..ae7832b0 100644 --- a/kscd/libwm/CMakeLists.txt +++ b/kscd/libwm/CMakeLists.txt @@ -29,7 +29,7 @@ tde_add_library( workman STATIC_PIC database.c index.c scsi.c cdda.c plat_linux_cdda.c plat_sun_cdda.c plat_aix.c plat_bsd386.c plat_freebsd.c plat_hpux.c plat_irix.c plat_linux.c plat_netbsd.c plat_svr4.c plat_ultrix.c plat_news.c - plat_openbsd.c plat_osf1.c plat_sun.c plat_scor5.c + plat_openbsd.c plat_sun.c plat_scor5.c drv_sony.c drv_toshiba.c EMBED workmanaudio-static diff --git a/kscd/libwm/Makefile.am b/kscd/libwm/Makefile.am index ae2a9144..b46b371a 100644 --- a/kscd/libwm/Makefile.am +++ b/kscd/libwm/Makefile.am @@ -16,7 +16,7 @@ libworkman_la_SOURCES = cddb.c cdinfo.c cdrom.c wm_helpers.c cdtext.c\ database.c index.c scsi.c cdda.c plat_linux_cdda.c plat_sun_cdda.c\ plat_aix.c plat_bsd386.c plat_freebsd.c plat_hpux.c plat_irix.c \ plat_linux.c plat_svr4.c plat_ultrix.c plat_news.c plat_openbsd.c \ -plat_osf1.c plat_sun.c plat_scor5.c \ +plat_sun.c plat_scor5.c \ drv_sony.c drv_toshiba.c #libworkmanincludedir = $(includedir)/libwm diff --git a/kscd/libwm/PLAT_IMPL_STATUS b/kscd/libwm/PLAT_IMPL_STATUS index d1919728..93ac8c5c 100644 --- a/kscd/libwm/PLAT_IMPL_STATUS +++ b/kscd/libwm/PLAT_IMPL_STATUS @@ -8,41 +8,41 @@ X function available \ function dummy, null implementation or commented out (X) function available in special configurations -function |aix |bsd386|freebsd|hpux |irix |linux|news |openbsd|osf1 |scor5|sun |svr4 |ultrix| -------------------------+-----+------+-------+-----+-----+-----+-----+-------+-----+-----+-----+-----+------+ -find_cdrom() | - | - | - | - | - | - | - | - | X | - | X | X | X | -gen_init() | \ | \ | \ | \ | (X) | \ | \ | \ | \ | \ | X | \ | \ | -wmcd_open() | X | X | X | X | X | X | X | X | X | X | X | X | X | -wmcd_close() | - | - | - | - | - | - | X | - | - | - | - | - | - | -wmcd_reopen() | X | X | X | X | X | X | X | X | X | X | X | X | X | -wm_scsi() | \ | \ | \ | X | \ | X | \ | \ | \ | X | X | X | \ | -keep_cd_open() | - | - | - | - | - | \ | - | - | - | \ | - | - | - | -gen_get_drive_status() | X | X | X | X | X | X | X | X | X | X | X | X | X | -------------------------+-----+------+-------+-----+-----+-----+-----+-------+-----+-----+-----+-----+------+ -gen_get_trackcount() | X | X | X | X | X | X | X | X | X | X | X | X | X | -gen_get_trackinfo() | X | X | X | X | X | X | X | X | X | X | X | X | X | -gen_get_cdlen() | X | X | X | X | X | X | X | X | X | X | X | X | X | -------------------------+-----+------+-------+-----+-----+-----+-----+-------+-----+-----+-----+-----+------+ -gen_play() | X | X | X | X | X | X | X | X | X | X | X | X | X | -gen_pause() | X | X | X | X | X | X | X | X | X | X | X | X | X | -gen_resume() | X | X | X | X | X | X | X | X | X | X | X | X | X | -gen_stop() | X | X | X | X | X | X | X | X | X | X | X | X | X | -gen_eject() | X | X | X | X | X | X | X | X | X | X | X | X | X | -gen_closetray() | X | X | X | X | X | X | X | X | X | X | X | X | X | -------------------------+-----+------+-------+-----+-----+-----+-----+-------+-----+-----+-----+-----+------+ -scale_volume() | X | X | X | - | - | X | - | X | X | - | - | - | X | -unscale_volume() | X | X | X | - | - | - | - | X | X | - | - | - | X | -gen_set_volume() | X | X | X | X | X | X | X | X | X | X | X | X | X | -gen_get_volume() | X | X | X | X | X | X | X | X | X | X | X | X | X | -------------------------+-----+------+-------+-----+-----+-----+-----+-------+-----+-----+-----+-----+------+ -cdda_init() | - | - | - | - | - | \ | - | - | - | - | X | - | - | -get_ack() | - | - | - | - | - | \ | - | - | - | - | X | - | - | -cdda_kill() | - | - | - | - | - | \ | - | - | - | - | X | - | - | -gen_set_direction() | - | - | - | - | - | \ | - | - | - | - | X | - | - | -gen_set_speed() | - | - | - | - | - | \ | - | - | - | - | X | - | - | -gen_set_loudness() | - | - | - | - | - | \ | - | - | - | - | X | - | - | -gen_save() | - | - | - | - | - | \ | - | - | - | - | X | - | - | -------------------------+-----+------+-------+-----+-----+-----+-----+-------+-----+-----+-----+-----+------+ +function |aix |bsd386|freebsd|hpux |irix |linux|news |openbsd|sun |svr4 |ultrix| +------------------------+-----+------+-------+-----+-----+-----+-----+-------+-----+-----+------+ +find_cdrom() | - | - | - | - | - | - | - | - | X | X | X | +gen_init() | \ | \ | \ | \ | (X) | \ | \ | \ | \ | \ | \ | +wmcd_open() | X | X | X | X | X | X | X | X | X | X | X | +wmcd_close() | - | - | - | - | - | - | X | - | - | - | - | +wmcd_reopen() | X | X | X | X | X | X | X | X | X | X | X | +wm_scsi() | \ | \ | \ | X | \ | X | \ | \ | \ | X | \ | +keep_cd_open() | - | - | - | - | - | \ | - | - | - | - | - | +gen_get_drive_status() | X | X | X | X | X | X | X | X | X | X | X | +------------------------+-----+------+-------+-----+-----+-----+-----+-------+-----+-----+------+ +gen_get_trackcount() | X | X | X | X | X | X | X | X | X | X | X | +gen_get_trackinfo() | X | X | X | X | X | X | X | X | X | X | X | +gen_get_cdlen() | X | X | X | X | X | X | X | X | X | X | X | +------------------------+-----+------+-------+-----+-----+-----+-----+-------+-----+-----+------+ +gen_play() | X | X | X | X | X | X | X | X | X | X | X | +gen_pause() | X | X | X | X | X | X | X | X | X | X | X | +gen_resume() | X | X | X | X | X | X | X | X | X | X | X | +gen_stop() | X | X | X | X | X | X | X | X | X | X | X | +gen_eject() | X | X | X | X | X | X | X | X | X | X | X | +gen_closetray() | X | X | X | X | X | X | X | X | X | X | X | +------------------------+-----+------+-------+-----+-----+-----+-----+-------+-----+-----+------+ +scale_volume() | X | X | X | - | - | X | - | X | X | - | X | +unscale_volume() | X | X | X | - | - | - | - | X | X | - | X | +gen_set_volume() | X | X | X | X | X | X | X | X | X | X | X | +gen_get_volume() | X | X | X | X | X | X | X | X | X | X | X | +------------------------+-----+------+-------+-----+-----+-----+-----+-------+-----+-----+------+ +cdda_init() | - | - | - | - | - | \ | - | - | - | - | - | +get_ack() | - | - | - | - | - | \ | - | - | - | - | - | +cdda_kill() | - | - | - | - | - | \ | - | - | - | - | - | +gen_set_direction() | - | - | - | - | - | \ | - | - | - | - | - | +gen_set_speed() | - | - | - | - | - | \ | - | - | - | - | - | +gen_set_loudness() | - | - | - | - | - | \ | - | - | - | - | - | +gen_save() | - | - | - | - | - | \ | - | - | - | - | - | +------------------------+-----+------+-------+-----+-----+-----+-----+-------+-----+-----+------+ diff --git a/kscd/libwm/include/wm_config.h b/kscd/libwm/include/wm_config.h index caf7d17e..a2f2640a 100644 --- a/kscd/libwm/include/wm_config.h +++ b/kscd/libwm/include/wm_config.h @@ -45,7 +45,6 @@ * Linux * News (Sony NewsOS) * OpenBSD - * OSF1 * Sun (SunOS/Solaris, Sparc or x86) * SVR4 * Ultrix @@ -288,22 +287,6 @@ #endif /****************************************************************** - * OSF1 - ****************************************************************** - **** **** *** *** *** ******************************* - *** ** ** ****** ****** ** ******************************* - *** ** **** **** *** ***** ******************************* - *** ** ****** ** **** ****** ******************************* - **** **** *** *** ***** ***************************** - ******************************************************************/ -#if defined(__osf__) || defined(__osf) - -/* not needed here, it's figured out by plat_osf1.c */ -/* #define DEFAULT_CD_DEVICE "/dev/rcdrom/cd0" */ - -#endif - -/****************************************************************** * SunOS/Solaris ****************************************************************** **** *** ** ** *** *************************************** diff --git a/kscd/libwm/plat_osf1.c b/kscd/libwm/plat_osf1.c deleted file mode 100644 index 2ccfc49c..00000000 --- a/kscd/libwm/plat_osf1.c +++ /dev/null @@ -1,674 +0,0 @@ -/* - * This file is part of WorkMan, the civilized CD player library - * (c) 1991-1997 by Steven Grimm (original author) - * (c) by Dirk Försterling (current 'author' = maintainer) - * The maintainer can be contacted by his e-mail address: - * milliByte@DeathsDoor.com - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * - * OSF drive control routines. - */ - - -#if defined(__osf__) || defined(__osf) - - -#include <errno.h> -#include <stdio.h> -#include <sys/types.h> -#include <fcntl.h> -#include <sys/param.h> -#include <sys/stat.h> -#include <sys/ststfd.h> -#include <sys/time.h> -#include <string.h> -/* #include <sys/rzdisk.h> -#include <sys/cdrom.h> */ -#include <io/cam/rzdisk.h> -#include <io/cam/cdrom.h> - -#include "include/wm_config.h" -#include "include/wm_struct.h" -#include "include/wm_helpers.h" -#include "include/wm_cdtext.h" - - -#define WM_MSG_CLASS WM_MSG_CLASS_PLATFORM - -/* - * This structure will be filled with the TOC header and all entries. - * Ultrix doesn't seem to allow getting single TOC entries. - * - Chris Ross (cross@eng.umd.edu) - */ -struct cd_toc_header_and_entries -{ - struct cd_toc_header cdth; - struct cd_toc_entry cdte[CDROM_MAX_TRACK+1]; -}; - -void *malloc(); -char *strchr(); - -int min_volume = 128; -int max_volume = 255; -static char* osf_cd_device = NULL; - -/* - * fgetline() - * - * Simulate fgets, but joining continued lines in the output of uerf. - * - * platform specific internal function - * - */ - -#define BUF_SIZE 85 /* Max length of a (real) line */ - -char * -fgetline( FILE *fp ) -{ - static char *retval = NULL; - static char holdbuf[BUF_SIZE + 1]; - char tmp[BUF_SIZE + 1]; - char *stmp; - - if (!retval) - { - retval = malloc(BUF_SIZE * 3); /* 3 lines can be joined */ - if (!retval) - return(NULL); - else - *retval = '\0'; - } - - if (*holdbuf) - { - strcpy(retval, holdbuf); - retval[strlen(retval)-1] = '\0'; - memset(holdbuf, 0, BUF_SIZE+1); - } - - while (fgets(tmp, BUF_SIZE, fp)) - { - stmp = tmp + strspn(tmp, " \t"); - if (*stmp == '_') { /* Continuation line */ - retval[strlen(retval)-1] = '\0'; /* Trim off C/R */ - strcat(retval, stmp+1); - } else { - if (*retval) - { - strcpy(holdbuf, tmp); - holdbuf[strlen(holdbuf)-1] = -1; - return retval; - } else { /* First line read, keep reading */ - strcat(retval, stmp); - retval[strlen(retval)-1] = '\0'; - } - } - } - return NULL; -} /* fgetline() */ - - -/* - * find_cdrom - * - * Determine the name of the CD-ROM device. - * - * Read through the boot records (via a call to uerf) and find the SCSI - * address of the CD-ROM. - */ -const char* -find_cdrom() -{ - char *data; - FILE *uerf; - int fds[2]; - int pid; - extern char *getenv(); - const char *device = NULL; - - pipe(fds); - - device = getenv("CDROM"); - /* - ** the path of the device has to start w/ /dev - ** otherwise we are vulnerable to race conditions - ** Thomas Biege <thomas@suse.de> - */ - if ( device == NULL || - strncmp("/dev/", device, 5) || - strstr(device, "/../") - ) - return NULL; - - if ((pid = fork()) == 0) - { - close(fds[0]); - dup2(fds[1], 1); - execl("/etc/uerf", "uerf", "-R", "-r", "300", (void *)0); - execl("/usr/sbin/uerf", "uerf", "-R", "-r", "300", (void *)0); - return NULL; /* _exit(1); */ - } else if (pid < 0) { - perror("fork"); - return NULL; - } - - close(fds[1]); - uerf = fdopen(fds[0], "r"); - - while (data = fgetline(uerf)) - if (strstr(data, "RRD42")) - { - char *device_p; - - osf_cd_device = (char *)malloc(sizeof("/dev/rrz##c")); - strcpy(osf_cd_device, "/dev/r"); - device_p = strstr(data, "rz"); - device_p[(int)(strchr(device_p, ' ') - device_p)] = '\0'; - strcat(osf_cd_device, device_p); - strcat(osf_cd_device, "c"); - device = osf_cd_device; - break; - } - - fclose(uerf); - - if (device == NULL) - { - fprintf(stderr, - "No cdrom (RRD42) is installed on this system\n"); - return NULL; - } - - kill(pid, 15); - (void)wait((int *)NULL); - return device; -} /* find_cdrom() */ - -/* - * Initialize the drive. A no-op for the generic driver. - */ -int -gen_init( struct wm_drive *d ) -{ - return (0); -} /* gen_init() */ - -/* - * Open the CD device and figure out what kind of drive is attached. - */ -int -wmcd_open( struct wm_drive *d ) -{ - int fd; - static int warned = 0; - - if (d->fd >= 0) /* Device already open? */ - { - wm_lib_message(WM_MSG_LEVEL_DEBUG|WM_MSG_CLASS, "wmcd_open(): [device is open (fd=%d)]\n", d->fd); - return (0); - } - - if (d->cd_device == NULL) - d->cd_device = find_cdrom(); - - d->fd = open(d->cd_device, O_RDWR); - if (d->fd < 0) - { - if (errno == EACCES) - { - return -EACCES; - } - else if (errno != EINTR) - { - return (-6); - } - - /* No CD in drive. */ - return (1); - } - - /* Now fill in the relevant parts of the wm_drive structure. */ - find_drive_struct("", "", ""); - d->fd = fd; - - (d->init)(d); - - return (0); -} /* wmcd_open() */ - -/* - * Re-Open the device if it is open. - */ -int -wmcd_reopen( struct wm_drive *d ) -{ - int status; - - do { - wm_lib_message(WM_MSG_LEVEL_DEBUG|WM_MSG_CLASS, "wmcd_reopen\n"); - status = gen_close( d ); - wm_susleep( 1000 ); - wm_lib_message(WM_MSG_LEVEL_DEBUG|WM_MSG_CLASS, "calling wmcd_open()\n"); - status = wmcd_open( d ); /* open it as usual */ - wm_susleep( 1000 ); - } while ( status != 0 ); - return status; -} /* wmcd_reopen() */ - -/* - * Send an arbitrary SCSI command to a device. - */ -int -wm_scsi(struct wm_drive *d, unsigned char *cdb, int cdblen, - void *retbuf, int retbuflen, int getreply) -{ - /* OSF1 doesn't have a SCSI passthrough interface, does it? */ - return (-1); -} /* wm_scsi() */ - -int -gen_close( struct wm_drive *d ) -{ - if(d->fd != -1) { - wm_lib_message(WM_MSG_LEVEL_DEBUG|WM_MSG_CLASS, "closing the device\n"); - close(d->fd); - d->fd = -1; - } - return 0; -} - -/* - * Get the current status of the drive: the current play mode, the absolute - * position from start of disc (in frames), and the current track and index - * numbers if the CD is playing or paused. - */ -int -gen_get_drive_status(struct wm_drive *d, int oldmode, - int *mode, int *pos, int *track, int *index) -{ - struct cd_sub_channel sc; - struct cd_subc_channel_data scd; - - /* If we can't get status, the CD is ejected, so default to that. */ - *mode = WM_CDM_EJECTED; - - sc.sch_address_format = CDROM_MSF_FORMAT; - sc.sch_data_format = CDROM_CURRENT_POSITION; - sc.sch_track_number = 0; - sc.sch_alloc_length = sizeof(scd); - sc.sch_buffer = (caddr_t)&scd; - - /* Is the device open? */ - if (d->fd < 0) - { - switch (wmcd_open(d)) - { - case -1: /* error */ - return (-1); - - case 1: /* retry */ - return (0); - } - } - - if (ioctl(d->fd, CDROM_READ_SUBCHANNEL, &sc)) - return (0); /* ejected */ - - switch (scd.scd_header.sh_audio_status) - { - case AS_PLAY_IN_PROGRESS: - *mode = WM_CDM_PLAYING; - dopos: - *pos = scd.scd_position_data.scp_absaddr.msf.m_units * 60 * 75 + - scd.scd_position_data.scp_absaddr.msf.s_units * 75 + - scd.scd_position_data.scp_absaddr.msf.f_units; - *track = scd.scd_position_data.scp_track_number; - *index = scd.scd_position_data.scp_index_number; - break; - - case AS_PLAY_PAUSED: - if (oldmode == WM_CDM_PLAYING || oldmode == WM_CDM_PAUSED) - { - *mode = WM_CDM_PAUSED; - goto dopos; - } - else - *mode = WM_CDM_STOPPED; - break; - - case AS_PLAY_COMPLETED: - *mode = WM_CDM_TRACK_DONE; /* waiting for next track. */ - break; - - case AS_NO_STATUS: - *mode = WM_CDM_STOPPED; - break; - default: - abort(); - } - - return (0); -} /* gen_get_drive_status() */ - -/* - * Play the CD from one position to another (both in frames.) - */ -int -gen_play( struct wm_drive *d, int start, int end ) -{ - struct cd_play_audio_msf msf; - - msf.msf_starting_M_unit = start / (60*75); - msf.msf_starting_S_unit = (start % (60*75)) / 75; - msf.msf_starting_F_unit = start % 75; - msf.msf_ending_M_unit = end / (60*75); - msf.msf_ending_S_unit = (end % (60*75)) / 75; - msf.msf_ending_F_unit = end % 75; - - if (ioctl(d->fd, SCSI_START_UNIT)) - return (-1); - if (ioctl(d->fd, CDROM_PLAY_AUDIO_MSF, &msf)) - return (-2); - - return (0); -} /* gen_play() */ - -/* - * Pause the CD. - */ -int -gen_pause( struct wm_drive *d ) -{ - return (ioctl(d->fd, CDROM_PAUSE_PLAY, 0)); -} /* gen_pause() */ - -/* - * Resume playing the CD (assuming it was paused.) - */ -int -gen_resume( struct wm_drive *d ) -{ - return (ioctl(d->fd, CDROM_RESUME_PLAY, 0)); -} /* gen_resume() */ - -/* - * Stop the CD. - */ -int -gen_stop( struct wm_drive *d ) -{ - return (ioctl(d->fd, SCSI_STOP_UNIT, 0)); -} /* gen_stop() */ - -/* - * Eject the current CD, if there is one. - */ -int -gen_eject(struct wm_drive *d) -{ - /* On some systems, we can check to see if the CD is mounted. */ - struct stat stbuf; - struct statfs sfsbuf; - - if (fstat(d->fd, &stbuf) != 0) - return (-2); - - /* Is this a mounted filesystem? */ - if (fstatfs(d->fd, &sfsbuf) == 0) - return (-3); - - return (ioctl(d->fd, CDROM_EJECT_CADDY, 0)); -} /* gen_eject() */ - -/*----------------------------------------* - * Close the CD tray - * - * Please edit and send changes to - * milliByte@DeathsDoor.com - *----------------------------------------*/ - -int -gen_closetray(struct wm_drive *d) -{ -#ifdef CAN_CLOSE - if(!close(d->fd)) - { - d->fd=-1; - return(wmcd_reopen(d)); - } else { - return(-1); - } -#else - /* Always succeed if the drive can't close */ - return(0); -#endif /* CAN_CLOSE */ -} /* gen_closetray() */ - -/* - * Get the number of tracks on the CD. - */ -int -gen_get_trackcount(struct wm_drive *d, int *tracks) -{ - struct cd_toc_header hdr; - - if (ioctl(d->fd, CDROM_TOC_HEADER, &hdr)) - return (-1); - - *tracks = hdr.th_ending_track; - - return (0); -} /* gen_get_trackcount() */ - -/* - * Get the start time and mode (data or audio) of a track. - * - * XXX - this should get cached, but that means keeping track of ejects. - */ -int -gen_get_trackinfo(struct wm_drive *d, int track, int *data, int *startframe) -{ - struct cd_toc toc; - struct cd_toc_header hdr; - struct cd_toc_header_and_entries toc_buffer; - - if (ioctl(d->fd, CDROM_TOC_HEADER, &hdr)) - return (-1); - - bzero((char *)&toc_buffer, sizeof(toc_buffer)); - toc.toc_address_format = CDROM_MSF_FORMAT; - toc.toc_starting_track = 0; - toc.toc_alloc_length = (u_short)(((hdr.th_data_len1 << 8) + - hdr.th_data_len0) & 0xfff) + 2; - toc.toc_buffer = (caddr_t)&toc_buffer; - - if (ioctl(d->fd, CDROM_TOC_ENTRYS, &toc)) - return (-1); - - if (track == 0) - track = hdr.th_ending_track + 1; - - *data = (toc_buffer.cdte[track-1].te_control & CDROM_DATA_TRACK) ? 1:0; - *startframe = toc_buffer.cdte[track - 1].te_absaddr.msf.m_units*60*75 + - toc_buffer.cdte[track - 1].te_absaddr.msf.s_units * 75 + - toc_buffer.cdte[track - 1].te_absaddr.msf.f_units; - - return (0); -} /* gen_get_trackinfo() */ - -/* - * Get the number of frames on the CD. - */ -int -gen_get_cdlen( struct wm_drive *d, int *frames ) -{ - int tmp; - - return (gen_get_trackinfo(d, 0, &tmp, frames)); -} /* gen_get_cdlen() */ - -/* - * scale_volume(vol, max) - * - * Return a volume value suitable for passing to the CD-ROM drive. "vol" - * is a volume slider setting; "max" is the slider's maximum value. - * - * On Sun and DEC CD-ROM drives, the amount of sound coming out the jack - * increases much faster toward the top end of the volume scale than it - * does at the bottom. To make up for this, we make the volume scale look - * sort of logarithmic (actually an upside-down inverse square curve) so - * that the volume value passed to the drive changes less and less as you - * approach the maximum slider setting. The actual formula looks like - * - * (max^2 - (max - vol)^2) * (max_volume - min_volume) - * v = --------------------------------------------------- + min_volume - * max^2 - * - * If your system's volume settings aren't broken in this way, something - * like the following should work: - * - * return ((vol * (max_volume - min_volume)) / max + min_volume); - */ -scale_volume(int vol, int max) -{ - return ((max * max - (max - vol) * (max - vol)) * - (max_volume - min_volume) / (max * max) + min_volume); -} /* scale_volume() */ - -/* - * unscale_volume(cd_vol, max) - * - * Given a value between min_volume and max_volume, return the volume slider - * value needed to achieve that value. - * - * Rather than perform floating-point calculations to reverse the above - * formula, we simply do a binary search of scale_volume()'s return values. - */ -static int -unscale_volume( int cd_vol, int max ) -{ - int vol = 0, top = max, bot = 0, scaled; - - while (bot <= top) - { - vol = (top + bot) / 2; - scaled = scale_volume(vol, max); - if (cd_vol == scaled) - break; - if (cd_vol < scaled) - top = vol - 1; - else - bot = vol + 1; - } - - if (vol < 0) - vol = 0; - else if (vol > max) - vol = max; - - return (vol); -} /* unscale_volume() */ - -/* - * Set the volume level for the left and right channels. Their values - * range from 0 to 100. - */ -int -gen_set_volume(struct wm_drive *d, int left, int right) -{ - struct cd_playback pb; - struct cd_playback_status ps; - struct cd_playback_control pc; - - left = scale_volume(left, 100); - right = scale_volume(right, 100); - - bzero((char *)&pb, sizeof(pb)); - bzero((char *)&ps, sizeof(ps)); - bzero((char *)&pc, sizeof(pc)); - - pb.pb_alloc_length = sizeof(ps); - pb.pb_buffer = (caddr_t)&ps; - - if (ioctl(d->fd, CDROM_PLAYBACK_STATUS, &pb)) - return (-1); - - pc.pc_chan0_select = ps.ps_chan0_select; - pc.pc_chan0_volume = (left < CDROM_MIN_VOLUME) ? - CDROM_MIN_VOLUME : (left > CDROM_MAX_VOLUME) ? - CDROM_MAX_VOLUME : left; - pc.pc_chan1_select = ps.ps_chan1_select; - pc.pc_chan1_volume = (right < CDROM_MIN_VOLUME) ? - CDROM_MIN_VOLUME : (right > CDROM_MAX_VOLUME) ? - CDROM_MAX_VOLUME : right; - - pb.pb_alloc_length = sizeof(pc); - pb.pb_buffer = (caddr_t)&pc; - - if (ioctl(d->fd, CDROM_PLAYBACK_CONTROL, &pb)) - return (-1); - - return (0); -} /* gen_set_volume() */ - - -/* - * Read the initial volume from the drive, if available. Each channel - * ranges from 0 to 100, with -1 indicating data not available. - */ -int -gen_get_volume( struct wm_drive *d, int *left, int *right ) -{ - struct cd_playback pb; - struct cd_playback_status ps; - - bzero((char *)&pb, sizeof(pb)); - bzero((char *)&ps, sizeof(ps)); - - pb.pb_alloc_length = sizeof(ps); - pb.pb_buffer = (caddr_t)&ps; - - if (d->fd >= 0) - { - if (ioctl(d->fd, CDROM_PLAYBACK_STATUS, &pb)) - *left = *right = -1; - else - { - *left = unscale_volume(ps.ps_chan0_volume, 100); - *right = unscale_volume(ps.ps_chan1_volume, 100); - } - } - else - *left = *right = -1; - - return (0); -} /* gen_get_volume() */ - -/*------------------------------------------------------------------------* - * gen_get_cdtext(drive, buffer, length) - *------------------------------------------------------------------------*/ - -int -gen_get_cdtext(struct wm_drive *d, unsigned char **pp_buffer, int *p_buffer_length) -{ - return -1; /* no SCSI, no CDTEXT */ -} /* gen_get_cdtext() */ - - -#endif diff --git a/mpg123_artsplugin/mpg123PlayObject_impl.h b/mpg123_artsplugin/mpg123PlayObject_impl.h index e8be2619..8c08df79 100644 --- a/mpg123_artsplugin/mpg123PlayObject_impl.h +++ b/mpg123_artsplugin/mpg123PlayObject_impl.h @@ -3,7 +3,7 @@ using namespace std; -#if (defined(__GNU_LIBRARY__) && defined(_SEM_SEMUN_UNDEFINED)) || defined(__osf__) || defined(__sun__) +#if (defined(__GNU_LIBRARY__) && defined(_SEM_SEMUN_UNDEFINED)) || defined(__sun__) /* union semun is defined by including <sys/sem.h> */ /* according to X/OPEN we have to define it ourselves */ union semun { diff --git a/noatun/library/engine.cpp b/noatun/library/engine.cpp index 8e0000fa..4b25a433 100644 --- a/noatun/library/engine.cpp +++ b/noatun/library/engine.cpp @@ -39,9 +39,7 @@ static Arts::PlayObject nullPO() { return Arts::PlayObject::null(); } #define HARDWARE_VOLUME -#if defined(__osf__) -#undef HARDWARE_VOLUME -#elif defined(__linux__) +#if defined(__linux__) #include <sys/soundcard.h> #elif defined(__FreeBSD__) #include <sys/soundcard.h> diff --git a/tdefile-plugins/au/tdefile_au.cpp b/tdefile-plugins/au/tdefile_au.cpp index fdc34a4b..5b474ee4 100644 --- a/tdefile-plugins/au/tdefile_au.cpp +++ b/tdefile-plugins/au/tdefile_au.cpp @@ -32,12 +32,7 @@ #include <tqfile.h> #include <tqdatetime.h> -#if !defined(__osf__) #include <inttypes.h> -#else -typedef unsigned long uint32_t; -typedef unsigned short uint16_t; -#endif typedef KGenericFactory<KAuPlugin> AuFactory; diff --git a/tdefile-plugins/avi/tdefile_avi.cpp b/tdefile-plugins/avi/tdefile_avi.cpp index 8570365b..38a8e23b 100644 --- a/tdefile-plugins/avi/tdefile_avi.cpp +++ b/tdefile-plugins/avi/tdefile_avi.cpp @@ -33,13 +33,7 @@ #include <tqfile.h> #include <tqdatetime.h> -#if !defined(__osf__) #include <inttypes.h> -#else -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; -#endif typedef KGenericFactory<KAviPlugin> AviFactory; diff --git a/tdefile-plugins/avi/tdefile_avi.h b/tdefile-plugins/avi/tdefile_avi.h index f6718bff..e0d98bdf 100644 --- a/tdefile-plugins/avi/tdefile_avi.h +++ b/tdefile-plugins/avi/tdefile_avi.h @@ -23,13 +23,7 @@ #include <tdefilemetainfo.h> #include <tqfile.h> -#if !defined(__osf__) #include <inttypes.h> -#else -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#endif - class TQStringList; diff --git a/tdefile-plugins/wav/tdefile_wav.cpp b/tdefile-plugins/wav/tdefile_wav.cpp index 3e927365..31b72f1f 100644 --- a/tdefile-plugins/wav/tdefile_wav.cpp +++ b/tdefile-plugins/wav/tdefile_wav.cpp @@ -32,12 +32,7 @@ #include <tqfile.h> #include <tqdatetime.h> -#if !defined(__osf__) #include <inttypes.h> -#else -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#endif typedef KGenericFactory<KWavPlugin> WavFactory; |