rnd-20020428-1-src
[rocksndiamonds.git] / src / libgame / sound.h
index ebca45f5eb6be619b2ed1a69998ca7d654ea8dea..146623433f4c2a997e19ee20c99e3be41a3236a4 100644 (file)
 #define AUDIO_MONO_CHANNEL                     1
 #define AUDIO_STEREO_CHANNELS                  2
 
+#define AUDIO_FORMAT_U8                                (1 << 0)
+#define AUDIO_FORMAT_S16                       (1 << 1)
+#define AUDIO_FORMAT_LE                                (1 << 2)
+#define AUDIO_FORMAT_BE                                (1 << 3)
+
 #if defined(TARGET_SDL)
 /* one second fading interval == 1000 ticks (milliseconds) */
 #define SOUND_FADING_INTERVAL                  1000
@@ -92,7 +97,7 @@
 #if !defined(PLATFORM_MSDOS)
 
 #define PSND_SILENCE           0
-#define PSND_MAX_VOLUME_BITS   7
+#define PSND_MAX_VOLUME_BITS   15
 #define PSND_MIN_VOLUME                0
 #define PSND_MAX_VOLUME                (1 << PSND_MAX_VOLUME_BITS)
 #define PSND_MIDDLE            0
@@ -179,14 +184,22 @@ struct SoundHeader_8SVX
 };
 #endif
 
+struct AudioFormatInfo
+{
+  boolean stereo;              /* availability of stereo sound */
+  int format;                  /* size and endianess of sample data */
+  int sample_rate;             /* sample frequency */
+  int fragment_size;           /* audio device fragment size in bytes */
+};
+
 struct SampleInfo
 { 
-  char *source_filename;
-
   int type;
+  char *source_filename;
 
-  void *data_ptr;
   long data_len;
+  void *data_ptr;
+  int format;
 };
 
 typedef struct SampleInfo      SoundInfo;
@@ -210,8 +223,9 @@ struct SoundControl
   int playingtime;
   long playingpos;
 
-  unsigned long data_len;
-  byte *data_ptr;
+  long data_len;
+  void *data_ptr;
+  int format;
 
 #if defined(PLATFORM_MSDOS)
   int voice;