diff options
Diffstat (limited to 'kscd/libwm/include')
-rw-r--r-- | kscd/libwm/include/wm_cdda.h | 203 | ||||
-rw-r--r-- | kscd/libwm/include/wm_cddb.h | 36 | ||||
-rw-r--r-- | kscd/libwm/include/wm_cdinfo.h | 76 | ||||
-rw-r--r-- | kscd/libwm/include/wm_cdrom.h | 114 | ||||
-rw-r--r-- | kscd/libwm/include/wm_cdtext.h | 105 | ||||
-rw-r--r-- | kscd/libwm/include/wm_config.h | 377 | ||||
-rw-r--r-- | kscd/libwm/include/wm_database.h | 42 | ||||
-rw-r--r-- | kscd/libwm/include/wm_helpers.h | 109 | ||||
-rw-r--r-- | kscd/libwm/include/wm_index.h | 36 | ||||
-rw-r--r-- | kscd/libwm/include/wm_platform.h | 51 | ||||
-rw-r--r-- | kscd/libwm/include/wm_scsi.h | 50 | ||||
-rw-r--r-- | kscd/libwm/include/wm_struct.h | 198 | ||||
-rw-r--r-- | kscd/libwm/include/wm_version.h | 35 | ||||
-rw-r--r-- | kscd/libwm/include/workman.h | 52 | ||||
-rw-r--r-- | kscd/libwm/include/workman_defs.h | 30 |
15 files changed, 1514 insertions, 0 deletions
diff --git a/kscd/libwm/include/wm_cdda.h b/kscd/libwm/include/wm_cdda.h new file mode 100644 index 00000000..11c8eb3e --- /dev/null +++ b/kscd/libwm/include/wm_cdda.h @@ -0,0 +1,203 @@ +#ifndef WM_CDDA_H +#define WM_CDDA_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +/* + * Information about a particular block of CDDA data. + */ +struct cdda_block { + unsigned char status; + unsigned char track; + unsigned char index; + unsigned char reserved; + + int frame; + char *buf; + long buflen; +}; + +struct cdda_device { + int fd; + const char *devname; + + unsigned char status; + unsigned char track; + unsigned char index; + unsigned char command; + + int frame; + int frames_at_once; + + /* Average volume levels, for level meters */ + unsigned char lev_chan0; + unsigned char lev_chan1; + + /* Current volume setting (0-255) */ + unsigned char volume; + + /* Current balance setting (0-255, 128 = balanced) */ + unsigned char balance; + + struct cdda_block *blocks; + int numblocks; +}; + +#include "wm_cdrom.h" +#include "wm_config.h" +#include "wm_struct.h" +/* + * cdda_block status codes. + */ + +/* + * Enable or disable CDDA building depending on platform capabilities, and + * determine endianness based on architecture. (Gross!) + * + * For header-comfort, the macros LITTLE_ENDIAN and BIG_ENDIAN had to be + * renamed. At least Linux does have bytesex.h and endian.h for easy + * byte-order examination. + */ + +#ifdef HAVE_MACHINE_ENDIAN_H + #include <machine/endian.h> + #if BYTE_ORDER == LITTLE_ENDIAN + #define WM_LITTLE_ENDIAN 1 + #define WM_BIG_ENDIAN 0 + #else + #define WM_LITTLE_ENDIAN 0 + #define WM_BIG_ENDIAN 1 + #endif +#elif defined(__sun) || defined(sun) +# ifdef SYSV +# include <sys/types.h> +# include <sys/cdio.h> +# ifndef CDROMCDDA +# undef BUILD_CDDA +# endif +# ifdef i386 +# define WM_LITTLE_ENDIAN 1 +# define WM_BIG_ENDIAN 0 +# else +# define WM_BIG_ENDIAN 1 +# define WM_LITTLE_ENDIAN 0 +# endif +# else +# undef BUILD_CDDA +# endif + +/* Linux only allows definition of endianness, because there's no + * standard interface for CDROM CDDA functions that aren't available + * if there is no support. + */ +#elif defined(__linux__) +/*# include <bytesex.h>*/ +# include <endian.h> +/* + * XXX could this be a problem? The results are only 0 and 1 because + * of the ! operator. How about other linux compilers than gcc ? + */ +# define WM_LITTLE_ENDIAN !(__BYTE_ORDER - __LITTLE_ENDIAN) +# define WM_BIG_ENDIAN !(__BYTE_ORDER - __BIG_ENDIAN) +#elif defined WORDS_BIGENDIAN + #define WM_LITTLE_ENDIAN 0 + #define WM_BIG_ENDIAN 1 +#else + #define WM_LITTLE_ENDIAN 1 + #define WM_BIG_ENDIAN 0 +#endif + +/* + * The following code shouldn't take effect now. + * In 1998, the WorkMan platforms don't support __PDP_ENDIAN + * architectures. + * + */ + +#if !defined(WM_LITTLE_ENDIAN) +# if !defined(WM_BIG_ENDIAN) +# error yet unsupported architecture + foo bar this is to stop the compiler. +# endif +#endif + +#if defined(BUILD_CDDA) +/* + * The following code support us by optimize cdda operations + */ +#define CDDARETURN(x) if(x && x->cdda == 1) return +#define IFCDDA(x) if(x && x->cdda == 1) +int cdda_get_drive_status(struct wm_drive *d, int oldmode, + int *mode, int *pos, int *track, int *ind); +int cdda_play(struct wm_drive *d, int start, int end, int realstart); +int cdda_pause(struct wm_drive *d); +int cdda_stop(struct wm_drive *d); +int cdda_eject(struct wm_drive *d); +int cdda_set_volume(struct wm_drive *d, int left, int right); +int cdda_get_volume(struct wm_drive *d, int *left, int *right); +void cdda_kill(struct wm_drive *d); +void cdda_save(struct wm_drive *d, char *filename); +int cdda_get_ack(int); +int gen_cdda_init(struct wm_drive *d ); + +void cdda_set_direction(struct wm_drive *d, int newdir); +void cdda_set_speed(struct wm_drive *d, int speed); +void cdda_set_loudness(struct wm_drive *d, int loud); + + +int wmcdda_init(struct cdda_device*); +int wmcdda_open(const char*); +int wmcdda_close(struct cdda_device*); +int wmcdda_setup(int start, int end, int realstart); +long wmcdda_read(struct cdda_device*, struct cdda_block *block); +void wmcdda_speed(int speed); +void wmcdda_direction(int newdir); + +#else + #define CDDARETURN(x) + #define IFCDDA(x) + #define cdda_get_drive_status + #define cdda_play + #define cdda_pause + #define cdda_resume + #define cdda_stop + #define cdda_eject + #define cdda_set_volume + #define cdda_get_volume + #define cdda_kill + #define cdda_save + #define cdda_get_ack +#endif /* defined(BUILD_CDDA) */ + +#include <stdio.h> + +#ifdef DEBUG + #define DEBUGLOG(fmt, args...) fprintf(stderr, fmt, ##args) +#else + #define DEBUGLOG(fmt, args...) +#endif +#define ERRORLOG(fmt, args...) fprintf(stderr, fmt, ##args) + +#endif /* WM_CDDA_H */ diff --git a/kscd/libwm/include/wm_cddb.h b/kscd/libwm/include/wm_cddb.h new file mode 100644 index 00000000..26a0c2d9 --- /dev/null +++ b/kscd/libwm/include/wm_cddb.h @@ -0,0 +1,36 @@ +#ifndef WM_CDDB_H +#define WM_CDDB_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +unsigned long cddb_discid(void); +void cddb_struct2cur(void); +void cddb_cur2struct(void); +void cddb_select(void); +void connect_cddb(void); +void update_cddbserver(void); +void cddb_request(void); + +#endif /* WM_CDDB_H */ diff --git a/kscd/libwm/include/wm_cdinfo.h b/kscd/libwm/include/wm_cdinfo.h new file mode 100644 index 00000000..dbb8e949 --- /dev/null +++ b/kscd/libwm/include/wm_cdinfo.h @@ -0,0 +1,76 @@ +#ifndef WM_CDINFO_H +#define WM_CDINFO_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Prototypes from cdinfo.c + * + * This is just one more step to a more modular and understandable code. + */ + +#include "wm_struct.h" +extern char *cur_trackname; /* Take a guess */ +extern int cur_index; /* Current index mark */ +extern int cur_frame; /* Current frame number */ +extern struct wm_play *playlist; /* = NULL */ + +/*extern int cur_track;*/ /* Current track number, starting at 1 */ +extern char *cur_artist; /* Name of current CD's artist */ +extern char cur_avoid; /* Avoid flag */ +extern char cur_contd; /* Continued flag */ +extern char *cur_cdname; /* Album name */ +extern int cur_nsections; /* Number of sections currently defined */ +extern int exit_on_eject; +extern int cur_pos_abs; +extern int cur_pos_rel; +extern int cur_cdlen; + +extern int cur_ntracks; +extern int cur_lasttrack; +extern int cur_firsttrack; +extern int cur_listno; +extern int cur_stopmode; + +void wipe_cdinfo( void ); +void play_next_entry( int forward ); +void make_playlist( int playmode, int starttrack ); +int get_autoplay( void ); +int get_playmode( void ); +void pl_find_track( int track ); +void play_prev_track( int forward ); +void play_next_track( int forward ); +int tracklen( int num ); +int get_default_volume( int track ); +int split_trackinfo( int pos ); +int remove_trackinfo( int num ); +void freeup( char **x ); +int get_runtime( void ); +const char *trackname( int num ); +void stash_cdinfo( char *artist, char *cdname, int autoplay, int playmode ); +void stash_trkinfo( int track, char *songname, int contd, int avoid ); +int get_avoid( int num ); +int get_contd( int num ); +void default_volume( int track, int vol ); +char *listentry( int num ); + +#endif /* WM_CDINFO_H */ diff --git a/kscd/libwm/include/wm_cdrom.h b/kscd/libwm/include/wm_cdrom.h new file mode 100644 index 00000000..d38f8b68 --- /dev/null +++ b/kscd/libwm/include/wm_cdrom.h @@ -0,0 +1,114 @@ +#ifndef WM_CDROM_H +#define WM_CDROM_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Prototypes from cdrom.c + * + * This is just one more step to a more modular and understandable code. + */ +#define WM_CDS_NO_DISC(status) (status == WM_CDM_UNKNOWN ||\ + status == WM_CDM_EJECTED ||\ + status == WM_CDM_NO_DISC) + +#define WM_CDS_DISC_READY(status)(status == WM_CDM_TRACK_DONE ||\ + status == WM_CDM_PLAYING ||\ + status == WM_CDM_FORWARD ||\ + status == WM_CDM_PAUSED ||\ + status == WM_CDM_STOPPED) + +#define WM_CDS_DISC_PLAYING(status)(status == WM_CDM_TRACK_DONE ||\ + status == WM_CDM_PLAYING ||\ + status == WM_CDM_FORWARD ||\ + status == WM_CDM_PAUSED) +#define WM_CDM_BACK 1 +#define WM_CDM_TRACK_DONE 1 +#define WM_CDM_PLAYING 2 +#define WM_CDM_FORWARD 3 +#define WM_CDM_PAUSED 4 +#define WM_CDM_STOPPED 5 +#define WM_CDM_EJECTED 6 +#define WM_CDM_DEVICECHANGED 9 /* deprecated */ +#define WM_CDM_NO_DISC 10 +#define WM_CDM_UNKNOWN 11 +#define WM_CDM_CDDAERROR 12 +#define WM_CDM_CDDAACK 0xF0 + +#define WM_CDIN 0 +#define WM_CDDA 1 + +#define WM_ENDTRACK 0 + +#define WM_BALANCE_SYMMETRED 0 +#define WM_BALANCE_ALL_LEFTS -10 +#define WM_BALANCE_ALL_RIGHTS 10 + +#define WM_VOLUME_MUTE 0 +#define WM_VOLUME_MAXIMAL 100 + +int wm_cd_init( int cdin, const char *cd_device, const char *soundsystem, + const char *sounddevice, const char *ctldevice ); +int wm_cd_destroy( void ); + +int wm_cd_status( void ); + +int wm_cd_getcurtrack( void ); +int wm_cd_getcurtracklen( void ); +int wm_cd_getcountoftracks( void ); + +int wm_cd_gettracklen( int track ); + +int wm_cd_play( int start, int pos, int end ); +int wm_cd_play_chunk( int start, int end, int realstart ); +int wm_cd_play_from_pos( int pos ); +int wm_cd_pause( void ); +int wm_cd_stop( void ); +int wm_cd_eject( void ); +int wm_cd_closetray( void ); + +int wm_find_trkind( int, int, int ); + +/* + * for vaild values see wm_helpers.h + */ +int wm_cd_set_verbosity( int ); + +const char * wm_drive_vendor( void ); +const char * wm_drive_model( void ); +const char * wm_drive_revision( void ); +const char * wm_drive_device( void ); + +/* + * volume is valid WM_VOLUME_MUTE <= vol <= WM_VOLUME_MAXIMAL, + * balance is valid WM_BALANCE_ALL_LEFTS <= balance <= WM_BALANCE_ALL_RIGHTS + */ +int wm_cd_volume( int volume, int balance); + +/* + * please notice, that more OSs don't allow to read balance and volume + * in this case you get -1 for volume and WM_BALANCE_SYMMETRED for balance + */ +int wm_cd_getvolume( void ); +int wm_cd_getbalance( void ); + +#endif /* WM_CDROM_H */ diff --git a/kscd/libwm/include/wm_cdtext.h b/kscd/libwm/include/wm_cdtext.h new file mode 100644 index 00000000..e843ee95 --- /dev/null +++ b/kscd/libwm/include/wm_cdtext.h @@ -0,0 +1,105 @@ +#ifndef WM_CDTEXT_H +#define WM_CDTEXT_H + +/*************************************************************************** + wm_cdtext.h - description + ------------------- + begin : Mon Feb 12 2001 + copyright : (C) 2001 by Alex Kern + email : alex.kern@gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +/* + * cdtext base structure and defines + */ + +#define MAX_LENGHT_OF_CDTEXT_STRING 162 /* max 160 bytes + 2 * 0x00 by UNICODES */ +#define DATAFIELD_LENGHT_IN_PACK 12 +#define MAX_LANGUAGE_BLOCKS 8 + +struct cdtext_pack_data_header { + unsigned char header_field_id1_typ_of_pack; + unsigned char header_field_id2_tracknumber; + unsigned char header_field_id3_sequence; + unsigned char header_field_id4_block_no; + unsigned char text_data_field[DATAFIELD_LENGHT_IN_PACK]; + unsigned char crc_byte1; + unsigned char crc_byte2; +}; + +typedef unsigned char cdtext_string[MAX_LENGHT_OF_CDTEXT_STRING]; + +/* meke it more generic + it can be up to 8 blocks with different encoding */ + +struct cdtext_info_block { + /* management */ + unsigned char block_code; + unsigned char block_unicode; /* 0 - single chars, 1 - doublebytes */ + unsigned char block_encoding; /* orange book -? */ + cdtext_string* block_encoding_text; + + /* variable part of cdtext */ + cdtext_string* name; + cdtext_string* performer; + cdtext_string* songwriter; + cdtext_string* composer; + cdtext_string* arranger; + cdtext_string* message; + cdtext_string* UPC_EAN_ISRC_code; + + /* fix part of cdtext */ + unsigned char binary_disc_identification_info[DATAFIELD_LENGHT_IN_PACK]; + unsigned char binary_genreidentification_info[DATAFIELD_LENGHT_IN_PACK]; + unsigned char binary_size_information[DATAFIELD_LENGHT_IN_PACK]; +}; + +struct cdtext_info { + /* somethimes i get hunderts of bytes, without anyone valid pack + my CDU-561 for example */ + int count_of_entries; /* one more because album need one too */ + int count_of_valid_packs; + int count_of_invalid_packs; + int valid; + + struct cdtext_info_block *blocks[MAX_LANGUAGE_BLOCKS]; +}; + +#ifndef IGNORE_FEATURE_LIST + +struct feature_list_header { + unsigned char lenght_msb; + unsigned char lenght_1sb; + unsigned char lenght_2sb; + unsigned char lenght_lsb; + unsigned char reserved1; + unsigned char reserved2; + unsigned char profile_msb; + unsigned char profile_lsb; +}; + +struct feature_descriptor_cdread { + unsigned char feature_code_msb; + unsigned char feature_code_lsb; + unsigned char settings; + unsigned char add_lenght; + unsigned char add_settings; + unsigned char reserved1; + unsigned char reserved2; + unsigned char reserved3; +}; + +#endif /* IGNORE_FEATURE_LIST */ + +struct cdtext_info* wm_cd_get_cdtext( void ); + +#endif /* WM_CDTEXT_H */ diff --git a/kscd/libwm/include/wm_config.h b/kscd/libwm/include/wm_config.h new file mode 100644 index 00000000..b04027f4 --- /dev/null +++ b/kscd/libwm/include/wm_config.h @@ -0,0 +1,377 @@ +#ifndef WM_CONFIG_H +#define WM_CONFIG_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + ********************************************************************** + * + * This file consists of several parts. First, there's a generic, + * platform independent part. Set needed options there. + * The following parts are platform dependent. You may search for the + * names listed below and then set your OS specific options there. + * Don't be surprised, if there are no options for your OS. They aren't + * needed in any case. + * + * The default values should produce a functional WorkMan on every + * platform. + * + ********************* + * Current platforms: + ********************* + * BSD386 + * FreeBSD + * HP-UX + * Irix (SGI) + * Linux + * News (Sony NewsOS) + * OpenBSD + * OSF1 + * Sun (SunOS/Solaris, Sparc or x86) + * SVR4 + * Ultrix + * AIX + * + * The above order corresponds with the order of the platform specific + * options below. + */ + +#include <config.h> +/****************************************************************** + * generic options + ****************************************************************** + ** ** *** **** ** **** ** * ** ** ** * ** + * * * *** **** * * *** * ** ** *** * * * * * * ** + * * *** **** ** *** ** ** ** * * ** * * ** + * * * *** **** **** *** * ** ** *** * * * * *** ** + * * * * ** **** * * ** ** **** ** * * *** ** + ******************************************************************/ + +/* + * This option is obvious. But please do not forget the original + * WorkMan version string if you need support. + */ + +#define WORKMAN_NAME "LibWorkMan" +#define WORKMAN_VERSION "1.4.0" + +/* + * If your CD-ROM drive closes its tray if the device is opened, then + * the next define can make WorkMans "Eject" button an "open/close" + * button. If it disturbs you, just comment it out. + * + * ### this is preliminary. It may have no effect for you ### + */ +#define CAN_CLOSE 1 + +/* + * Define the following if you want the balance slider to + * decrease one channel's volume while increasing the other's + */ +/* #define SYMETRIC_BALANCE 1 */ + + +/* + * Define this if you want CDDA support. Supported systems are: + * + * - Solaris (2.4 or newer) + * --> Linux is on the way. Don't define it now. It would lead to errors only. + */ +/*#define BUILD_CDDA 1*/ + + + +/****************************************************************** + * BSD386 + ****************************************************************** + *** **** *** ******* ** **** **** ************ + *** ** ** ****** * ***** ****** ** ** ** *************** + *** ****** **** ** *** ***** ***** *** ************ + *** ** ****** ** * *** ******** ** ** ** ** *********** + *** **** *** *** ****** **** **** ************ + ******************************************************************/ +#if defined(__bsdi__) || defined(__bsdi) + +/* + * This lets you use the SoundBlaster Mixer on BSD/386 + */ +#define SOUNDBLASTER 1 + +#define DEFAULT_CD_DEVICE "/dev/rsr2c" + +#endif /* __bsdi__ (BSD/386) */ + +/****************************************************************** + * FreeBSD + ****************************************************************** + *** ** *** ** ** **** *** *********** + *** ****** ** ** ****** ****** ** ** ****** * ********** + *** **** *** **** **** ****** **** ** ********* + *** ****** ** ** ****** ****** ** ****** ** * ********** + *** ****** ** ** ** ** **** *** *********** + ******************************************************************/ +#if defined(__FreeBSD__) || defined(__FreeBSD) + +#if __FreeBSD_version >= 500100 +#define DEFAULT_CD_DEVICE "/dev/acd0" +#else +#define DEFAULT_CD_DEVICE "/dev/acd0c" +#endif + +#endif /* freebsd */ + +/* DragonFly */ +#if defined(__DragonFly__) +#define DEFAULT_CD_DEVICE "/dev/acd0c" +#endif + +/****************************************************************** + * NetBSD + ****************************************************************** + *** *** ** ** ** **** *** ***************** + *** ** ** ******** **** ** ** ****** * **************** + *** * * ** ****** **** ****** **** ** *************** + *** ** ** ******** **** ** ****** ** * **************** + *** *** ** **** **** **** *** ***************** + ******************************************************************/ +#if defined(__NetBSD__) || defined(__NetBSD) + +#if defined(__i386__) + #define DEFAULT_CD_DEVICE "/dev/rcd0d" +#else + #define DEFAULT_CD_DEVICE "/dev/rcd0c" +#endif + +#endif /* netbsd */ + +/****************************************************************** + * HP-UX + ****************************************************************** + *** ** ** ********* ** ** ** *************************** + *** ** ** ** ******** ** *** **************************** + *** ** *** ** ** **** ***************************** + *** ** ** ************ ** *** **************************** + *** ** ** ************* *** ** *************************** + ******************************************************************/ +#if defined(hpux) || defined (__hpux) + +#define DEFAULT_CD_DEVICE "/dev/rscsi" + +#endif /* hpux */ + +/****************************************************************** + * Irix + ****************************************************************** + *** ** *** ** ** ********************************* + ***** **** ** **** ***** ********************************** + ***** **** ***** ****** *********************************** + ***** **** ** **** ***** ********************************** + *** ** ** ** ** ** ********************************* + ******************************************************************/ +#if defined(sgi) || defined(__sgi) + +#define DEFAULT_CD_DEVICE "/dev/scsi/sc0d6l0" + +#endif /* sgi IRIX */ + +/****************************************************************** + * Linux + ****************************************************************** + *** ****** ** *** ** ** ** ** *********************** + *** ******** **** ** ** ** *** ************************ + *** ******** **** * * ** ** **** ************************* + *** ******** **** ** ** ** *** ************************ + *** ** ** *** *** *** ** *********************** + ******************************************************************/ +#if defined(__linux__) + +/* + * Uncomment the following line to have WorkMan send SCSI commands + * directly to the CD-ROM drive. If you have a SCSI drive you + * probably want this, but it will cause WorkMan to not work on IDE + * drives. + */ +/*#define LINUX_SCSI_PASSTHROUGH 1*/ + +/* + * Which device should be opened by WorkMan at default? + */ +#define DEFAULT_CD_DEVICE "/dev/cdrom" + +/* + * Uncomment the following if you use the sbpcd or mcdx device driver. + * It shouldn't hurt if you use it on other devices. It'll be nice to + * hear from non-sbpcd (or mcdx) users if this is right. + */ +/*#define SBPCD_HACK 1*/ + +/* + * Linux Soundcard support + * Disabled by default, because some people rely on it + */ +/* #define OSS_SUPPORT 1 */ + +/* + * This has nothing to do with the above. + */ + +/* #define CURVED_VOLUME */ + +/* + * Uncomment the following if you want to try out a better responding + * WorkMan, especially with IDE drives. This may work with non-IDE + * drives as well. But it may be possible, that it doesn't work at all. + * If your drive/driver combination cannot handle the faster access, + * the driver will usually hang and you have to reboot your machine. + */ +/* #define FAST_IDE 1 */ + +/* + * There are two alternative ways of checking a device containing a + * mounted filesystem. Define BSD_MOUNTTEST for the test using + * getmntent(). Undefine it for using the SVR4 ustat(). + * I built in the choice, because it's not clear which method should + * be used in Linux. The ustat manpage tells us since 1995, that + * fstat() should be used, but I'm too dumb to do so. + */ + +#define BSD_MOUNTTEST + +#endif /* __linux */ + +/****************************************************************** + * Sony NewsOS + ****************************************************************** + *** *** ** ** ***** *** ***************************** + *** ** ** ****** ***** ** ******************************** + *** * * ** **** ** ** **** ****************************** + *** ** ** ****** * * ****** **************************** + *** *** ** ** * *** ***************************** + ******************************************************************/ +#if defined(__sony_news) || defined(sony_news) + +#define DEFAULT_CD_DEVICE "/dev/rsd/b0i6u0p2\0" + +#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 + ****************************************************************** + **** *** ** ** *** *************************************** + *** ****** ** ** ** *************************************** + ***** **** ** ** * * *************************************** + ******* ** ** ** ** *************************************** + **** **** *** *** *************************************** + ******************************************************************/ +#if defined(sun) || defined(__sun) + +/* + * Define the following for Solaris 2.x + * If you don't want WorkMan to try to activate the SPARCstation 5 + * internal audio input so you get sound from the workstation, comment + * out the CODEC define. + */ + +#define SYSV 1 +#define CODEC 1 +#define DEFAULT_CD_DEVICE "/vol/dev/aliases/cdrom0" + +/* + * set the following to "SUNW,CS4231" for Sun and to "SUNW,sb16" + * for PC (with SoundBlaster 16) running Solaris x86 + * (only important if you define CODEC above) + */ +#define SUN_AUD_DEV "SUNW,CS4231" +/*#define SUN_AUD_DEV "SUNW,sbpro"*/ + + +#endif + +/****************************************************************** + * SVR4 + ****************************************************************** + **** *** **** ** *** * ******************************** + *** ****** **** ** ** ** * ******************************** + ***** ***** ** *** *** ******************************* + ******* *** ** *** ** ***** ******************************** + **** ***** **** ** ***** ******************************** + ******************************************************************/ +#if (defined(SVR4) || defined(__SVR4)) && !defined(sun) && !defined(__sun) && !defined(sony_news) && !defined(__sony_news) + +#define DEFAULT_CD_DEVICE "/dev/rcdrom/cd0" + +#endif + +/****************************************************************** + * Ultrix + ****************************************************************** + *** ** ** ***** ** *** ** ** ****************** + *** ** ** ******* **** ** **** ***** ******************* + *** ** ** ******* **** ***** ****** ******************** + *** ** ** ******* **** ** **** ***** ******************* + **** *** *** **** ** ** ** ** ****************** + ******************************************************************/ +#if defined(ultrix) || defined(__ultrix) + +#endif + +/****************************************************************** + * IBM AIX + ****************************************************************** + **** *** ** ** ***************************************** + *** ** **** ***** ****************************************** + *** **** ****** ******************************************* + *** ** **** ***** ****************************************** + *** ** ** ** ** ***************************************** + ******************************************************************/ +#if defined(AIXV3) || defined(__AIXV3) + +#define DEFAULT_CD_DEVICE "/dev/cd0" + +#endif /* IBM AIX */ + +/******************************************************************/ +#endif /* WM_CONFIG_H */ + + + + + + + + diff --git a/kscd/libwm/include/wm_database.h b/kscd/libwm/include/wm_database.h new file mode 100644 index 00000000..401f12bc --- /dev/null +++ b/kscd/libwm/include/wm_database.h @@ -0,0 +1,42 @@ +#ifndef WM_DATABASE_H +#define WM_DATABASE_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Prototypes for WorkMan database + * + * This is just one more step to a more modular and understandable code. + */ + + +#define WM_DB_SAVE_ERROR 1 +#define WM_DB_SAVE_DISABLED 2 + +int wm_db_get_playnew( void ); +void split_workmandb( void ); +int save( void ); +void load( void ); +void load_settings( void ); + + +#endif /* WM_DATABASE_H */ diff --git a/kscd/libwm/include/wm_helpers.h b/kscd/libwm/include/wm_helpers.h new file mode 100644 index 00000000..ad98a365 --- /dev/null +++ b/kscd/libwm/include/wm_helpers.h @@ -0,0 +1,109 @@ +#ifndef WM_HELPERS_H +#define WM_HELPERS_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Here to be found: Prototypes. Including variable names to be easier + * to read. + * This is just one more step to a more modular and understandable code. + * + */ + +/* + * LibWorkMan message levels. I'm not sure how to call them all and which + * use they should fulfill. This is not very urgent now, because there + * aren't many messages in LibWorkMan now. + */ +#define WM_MSG_LEVEL_NONE 0 /**/ +#define WM_MSG_LEVEL_ERROR 1 /**/ +#define WM_MSG_LEVEL_TWO 2 +#define WM_MSG_LEVEL_THREE 3 +#define WM_MSG_LEVEL_FOUR 4 +#define WM_MSG_LEVEL_INFO 5 /**/ +#define WM_MSG_LEVEL_SIX 6 +#define WM_MSG_LEVEL_VERB 7 /**/ +#define WM_MSG_LEVEL_EIGHT 8 +#define WM_MSG_LEVEL_DEBUG 9 /**/ + +/* + * Message classes. This is somehow a definition of + * the message's source. + */ + +#define WM_MSG_CLASS_PLATFORM 0x010 +#define WM_MSG_CLASS_SCSI 0x020 +#define WM_MSG_CLASS_CDROM 0x040 +#define WM_MSG_CLASS_DB 0x080 +#define WM_MSG_CLASS_MISC 0x100 + +#define WM_MSG_CLASS_ALL 0xff0 + +extern int wm_lib_verbosity; + +/* + * I did not know any better place... + */ +#ifdef DEBUG +#define CHECKPOINT(t) fprintf(stderr, "%s (%d): %s\n", __FILE__, __LINE__, t ); +#else +#define CHECKPOINT(t) +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifdef __linux__ +#include <signal.h> +/* Linux doesn't have a SIGEMT */ +#if !defined( SIGEMT ) +# define SIGEMT SIGUNUSED +#endif +#endif /* linux */ + +void freeup( char **x ); +void wm_strmcat( char **t, const char *s); +void wm_strmcpy( char **t, const char *s ); +char * wm_strdup( char *s ); +/* Somebody's version query unsatisfied? */ +int wm_libver_major( void ); /* return major internal version number */ +int wm_libver_minor( void ); /* return minor internal version number */ +int wm_libver_pl( void ); /* return internal patchlevel number */ +char * wm_libver_name( void ); /* return internal name (LibWorkMan) */ +char * wm_libver_number( void ); /* returns string: "<major>.<minor>.<pl>" */ +char * wm_libver_string( void ); /* returns string: "<name> <number>" */ +char * wm_libver_date( void ); /* returns string: date of compilation */ +void wm_lib_set_verbosity( int level ); /* set verbosity level */ +int wm_lib_get_verbosity( void ); /* get verbosity level */ +void wm_lib_message( unsigned int level, const char *format, ... ) +#ifdef __GNUC__ + __attribute__ ((format(printf,2,3))) +#endif + ; /* put out a message on stderr */ +int wm_susleep( int usec ); + +#endif /* WM_HELPERS_H */ diff --git a/kscd/libwm/include/wm_index.h b/kscd/libwm/include/wm_index.h new file mode 100644 index 00000000..7c348b75 --- /dev/null +++ b/kscd/libwm/include/wm_index.h @@ -0,0 +1,36 @@ +#ifndef WM_INDEX_H +#define WM_INDEX_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Prototypes for wm_index.c + * + * This is just one more step to a more modular and understandable code. + */ + +int idx_find_entry( char *file, int ntracks, int *tracks, + int len, int fuzz, unsigned long *pos ); +int idx_delete_entry(char *file, int track, int fuzz, unsigned long pos ); +int idx_write_entry( char *file, int track, unsigned long pos ); + +#endif /* WM_INDEX_H */ diff --git a/kscd/libwm/include/wm_platform.h b/kscd/libwm/include/wm_platform.h new file mode 100644 index 00000000..edce8119 --- /dev/null +++ b/kscd/libwm/include/wm_platform.h @@ -0,0 +1,51 @@ +#ifndef WM_PLATFORM_H +#define WM_PLATFORM_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * The platform interface + * + * This is just one more step to a more modular and understandable code. + */ + +#include "wm_struct.h" + +int wmcd_open( struct wm_drive *d ); +int wmcd_reopen( struct wm_drive *d ); + +/* + * void keep_cd_open( void ); + */ +int wm_scsi( struct wm_drive *d, unsigned char *cdb, int cdblen, + void *retbuf, int retbuflen, int getreply ); + +/**************************************** + * + * The drive prototypes. + * + */ +extern struct wm_drive_proto generic_proto; +extern struct wm_drive_proto sony_proto; +extern struct wm_drive_proto toshiba_proto; + +#endif /* WM_PLATFORM_H */ diff --git a/kscd/libwm/include/wm_scsi.h b/kscd/libwm/include/wm_scsi.h new file mode 100644 index 00000000..0acc62ef --- /dev/null +++ b/kscd/libwm/include/wm_scsi.h @@ -0,0 +1,50 @@ +#ifndef WM_SCSI_H +#define WM_SCSI_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * SCSI prototypes (scsi.c) + * + * This is just one more step to a more modular and understandable code. + */ + +#include "wm_struct.h" + +#define WM_ERR_SCSI_INQUIRY_FAILED -1 + +int wm_scsi_mode_sense( struct wm_drive *d, unsigned char page, + unsigned char *buf ); +int sendscsi( struct wm_drive *d, void *buf, + unsigned int len, int dir, + unsigned char a0, unsigned char a1, + unsigned char a2, unsigned char a3, + unsigned char a4, unsigned char a5, + unsigned char a6, unsigned char a7, + unsigned char a8, unsigned char a9, + unsigned char a10, unsigned char a11 ); + int wm_scsi_get_drive_type( struct wm_drive *d, char *vendor, + char *model, char *rev ); +int wm_scsi_get_cdtext( struct wm_drive *d, + unsigned char **pp_buffer, int *p_buffer_length ); + +#endif /* WM_SCSI_H */ diff --git a/kscd/libwm/include/wm_struct.h b/kscd/libwm/include/wm_struct.h new file mode 100644 index 00000000..790de3b0 --- /dev/null +++ b/kscd/libwm/include/wm_struct.h @@ -0,0 +1,198 @@ +#ifndef WM_STRUCT_H +#define WM_STRUCT_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + + + +/* + * Structure for a single track. This is pretty much self-explanatory -- + * one of these exists for each track on the current CD. + */ +struct wm_trackinfo +{ + char *songname; /* Name of song, dynamically allocated */ + char *otherdb; /* Unrecognized info for this track */ + char *otherrc; + int length; /* Length of track in seconds or Kbytes */ + int start; /* Starting position (f+s*75+m*60*75) */ + int volume; /* Per-track volume (1-32, 0 to disable) */ + int track; /* Physical track number */ + int section; /* Section number (0 if track not split) */ + int contd; /* Flag: continuation of previous track */ + int avoid; /* Flag: don't play this track. */ + int data; /* Flag: data track */ +}; + +/* + * Structure for internal playlist management. The internal playlist is + * simply the list of track ranges that are being played currently. This + * is built whenever the CD starts playing; it's used in normal and shuffle + * modes as well as playlist mode. + * + * The "starttime" element represents how much time has elapsed by the time + * we get to this entry. For instance, if the list begins with a 5-minute + * track and a 3-minute track, the third entry would have a starttime of 8 + * minutes. This is used so that the elapsed play time can be displayed + * even in shuffle or playlist modes. + * + * The last member of the list has a start track of 0, and its starttime is + * the total playing time of the playlist (which will usually be overestimated, + * since we don't play leadouts in some cases.) + */ +struct wm_play +{ + int start; /* Start track, or 0 if end of list */ + int end; /* last track plus 1 */ + int starttime; /* Number of seconds elapsed previously */ +}; + +/* + * Structure for playlists (as seen by the user.) This is simply a name + * followed by a zero-terminated list of track numbers to play. The list + * is terminated by a NULL name. + */ +struct wm_playlist +{ + char *name; /* Name of this playlist */ + int *list; /* List of tracks */ +}; + +struct wm_cdinfo +{ + char artist[84]; /* Artist's name */ + char cdname[84]; /* Disc's name */ + int ntracks; /* Number of tracks on the disc */ + int curtrack; + int curtracklen; + int length; /* Total running time in seconds */ + int autoplay; /* Start playing CD immediately */ + int playmode; /* How to play the CD */ + int volume; /* Default volume (1-32, 0 for none) */ + struct wm_trackinfo *trk; /* struct wm_trackinfo[ntracks] */ + struct wm_playlist *lists; /* User-specified playlists */ + char *whichdb; /* Which database is this entry from? */ + char *otherdb; /* Unrecognized lines from this entry */ + char *otherrc; + char *user; /* Name of originating user */ + unsigned int cddbid; /* CDDB-ID of the current disc */ + struct cdinfo *next; /* For browsers, etc. */ +}; + +/* The global variable "cd" points to the struct for the CD that's playing. */ +extern struct wm_cdinfo *cd; + +extern struct wm_playlist *new_playlist(); + +#define WM_STR_GENVENDOR "Generic" +#define WM_STR_GENMODEL "drive" +#define WM_STR_GENREV "type" + + +/* + * Drive descriptor structure. Used for access to low-level routines. + */ +struct wm_drive_proto +{ + int (*gen_init)(); + int (*gen_close)(); + int (*gen_get_trackcount)(); + int (*gen_get_cdlen)(); + int (*gen_get_trackinfo)(); + int (*gen_get_drive_status)(); + int (*gen_get_volume)(); + int (*gen_set_volume)(); + int (*gen_pause)(); + int (*gen_resume)(); + int (*gen_stop)(); + int (*gen_play)(); + int (*gen_eject)(); + int (*gen_closetray)(); + int (*gen_get_cdtext)(); +}; + +struct wm_drive +{ + int cdda; /* cdda 1, cdin 0 */ + const char *cd_device; + char *soundsystem; + char *sounddevice; + char *ctldevice; + int fd; /* File descriptor, if used by platform */ + int cdda_slave; /* File descriptor for CDDA */ + + char *vendor; /* Vendor name */ + char *model; /* Drive model */ + char *revision; /* Revision of the drive */ + void *aux; /* Pointer to optional platform-specific info */ + void *daux; /* Pointer to optional drive-specific info */ + + struct wm_drive_proto *proto; +}; + +/* + * Structure for information of the usage of cddb. + */ +struct wm_cddb { + int protocol; /* 0-off, 1-cddbp, 2-http, 3-htproxy */ + char cddb_server[84]; /* host.domain.name:port */ + char mail_adress[84]; /* user@domain.name */ + char path_to_cgi[84]; /* (/)path/to/cddb.cgi */ + char proxy_server[84]; /* host.domain.name:port */ +}; +extern struct wm_cddb cddb; + + +/* + * Each platform has to define generic functions, so may as well declare + * them all here to save space. + * These functions should never be seen outside libworkman. So I don't care + * about the wm_ naming convention here. + */ +int gen_init( struct wm_drive *d ); +int gen_close( struct wm_drive *d ); +int gen_get_trackcount(struct wm_drive *d, int *tracks); +int gen_get_cdlen(struct wm_drive *d, int *frames); +int gen_get_trackinfo(struct wm_drive *d, int track, int *data, int *startframe); +int gen_get_drive_status( struct wm_drive *d, int oldmode, + int *mode, int *pos, int *track, int *ind ); +int gen_set_volume( struct wm_drive *d, int left, int right ); +int gen_get_volume( struct wm_drive *d, int *left, int *right ); +int gen_pause(struct wm_drive *d); +int gen_resume(struct wm_drive *d); +int gen_stop(struct wm_drive *d); +int gen_play(struct wm_drive *d, int start, int end, int realstart); +int gen_eject(struct wm_drive *d); +int gen_closetray(struct wm_drive *d); +int gen_get_cdtext(struct wm_drive *d, unsigned char **pp_buffer, int *p_buffer_lenght); + +int find_drive_struct(const char *vendor, const char *model, const char *rev); + + +struct cdtext_info* get_glob_cdtext(struct wm_drive*, int); +void free_cdtext(void); +const char* gen_status(int); + +#endif /* WM_STRUCT_H */ diff --git a/kscd/libwm/include/wm_version.h b/kscd/libwm/include/wm_version.h new file mode 100644 index 00000000..82e500c5 --- /dev/null +++ b/kscd/libwm/include/wm_version.h @@ -0,0 +1,35 @@ +#ifndef WM_VERSION_H +#define WM_VERSION_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Version information + * + */ + +#define WM_LIBVER_MAJOR 1 +#define WM_LIBVER_MINOR 4 +#define WM_LIBVER_PL 3 +#define WM_LIBVER_NAME "LibWorkMan" + +#endif /* WM_VERSION_H */ diff --git a/kscd/libwm/include/workman.h b/kscd/libwm/include/workman.h new file mode 100644 index 00000000..e7c3807d --- /dev/null +++ b/kscd/libwm/include/workman.h @@ -0,0 +1,52 @@ +#ifndef WORKMAN_H +#define WORKMAN_H +/* + * $Id$ + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * all-in-one libworkman include file. + * + */ + + +/* + * wm_config should always be included first + */ +#include "wm_config.h" + +#include "workman_defs.h" +#ifdef BUILD_CDDA +#include "wm_cdda.h" +#endif +#include "wm_cddb.h" +#include "wm_cdinfo.h" +#include "wm_cdrom.h" +#include "wm_database.h" +#include "wm_helpers.h" +#include "wm_index.h" +#include "wm_platform.h" +#include "wm_scsi.h" +#include "wm_struct.h" +#include "wm_cdtext.h" + +#endif /* WORKMAN_H */ + diff --git a/kscd/libwm/include/workman_defs.h b/kscd/libwm/include/workman_defs.h new file mode 100644 index 00000000..9da47f8f --- /dev/null +++ b/kscd/libwm/include/workman_defs.h @@ -0,0 +1,30 @@ +#ifndef WORKMAN_DEFS_H +#define WORKMAN_DEFS_H +/* + * $Id$ + * + * This file is part of WorkMan, the civilized CD player program + * (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 program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * #defined CONSTANTS + * + * Too bad this file seems to be so empty... + * + */ + +#include "wm_version.h" + +#endif /* WORKMAN_DEFS_H */ |