annotate Plugins/Input/wav/wav.h @ 1485:eff9a84c54bf trunk

[svn] use -1 to indicate "drop the original nsf/gbs/nsfe file, but silently error" (not implemented in 1.1.x, but is backwards compatible -- also not yet implemented here. keyword YET)
author nenolod
date Thu, 03 Aug 2006 01:03:55 -0700
parents 705d4c089fce
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1 /* XMMS - Cross-platform multimedia player
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
2 * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
3 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or modify
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
7 * (at your option) any later version.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
8 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
12 * GNU General Public License for more details.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
13 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
15 * along with this program; if not, write to the Free Software
1459
705d4c089fce [svn] Fix postal code.
chainsaw
parents: 1458
diff changeset
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
17 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
18 #ifndef WAV_H
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
19 #define WAV_H
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
20
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
21 #ifdef HAVE_CONFIG_H
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
22 # include "config.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
23 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
24
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
25 #include <glib.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
26
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
27 #include <sys/types.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
28
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
29 #include <libaudacious/vfs.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
30 #include "audacious/plugin.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
31
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
32 #define WAVE_FORMAT_UNKNOWN (0x0000)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
33 #define WAVE_FORMAT_PCM (0x0001)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
34 #define WAVE_FORMAT_ADPCM (0x0002)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
35 #define WAVE_FORMAT_ALAW (0x0006)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
36 #define WAVE_FORMAT_MULAW (0x0007)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
37 #define WAVE_FORMAT_OKI_ADPCM (0x0010)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
38 #define WAVE_FORMAT_DIGISTD (0x0015)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
39 #define WAVE_FORMAT_DIGIFIX (0x0016)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
40 #define IBM_FORMAT_MULAW (0x0101)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
41 #define IBM_FORMAT_ALAW (0x0102)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
42 #define IBM_FORMAT_ADPCM (0x0103)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
43
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
44 extern InputPlugin wav_ip;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
45
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
46 typedef struct {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
47 VFSFile *file;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
48 short format_tag, channels, block_align, bits_per_sample, eof;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
49 long samples_per_sec, avg_bytes_per_sec;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
50 unsigned long position, length;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
51 int seek_to, data_offset, going;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
52 pid_t pid;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
53 } WaveFile;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
54
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
55 static void wav_init(void);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
56 static int is_our_file(char *filename);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
57 static void play_file(char *filename);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
58 static void stop(void);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
59 static void seek(int time);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
60 static void wav_pause(short p);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
61 static int get_time(void);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
62 static void get_song_info(char *filename, char **title, int *length);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
63
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
64 #endif