~ubuntu-branches/ubuntu/vivid/oss4/vivid

« back to all changes in this revision

Viewing changes to tutorials/sndkit/dsp/vplay/fmtheaders.h

  • Committer: Bazaar Package Importer
  • Author(s): Romain Beauxis, Samuel Thibault, Romain Beauxis, Sebastien NOEL
  • Date: 2011-06-14 10:06:56 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110614100656-cx4oc7u426zn812z
Tags: 4.2-build2004-1
[ Samuel Thibault ]
* debian/control: Add liboss4-salsa2, liboss4-salsa-dev and
  liboss4-salsa-asound2 packages, equivalent to (and will replace) those from
  the oss-libsalsa package (Closes: #589127).
* debian/patches/liboss4-salsa.patch: New patch to rename libsalsa into
  liboss4-salsa to avoid conflicts in the archive for no good reason.
* debian/rules: Make in libOSSlib and libsalsa.
* debian/liboss4-salsa-dev.install, debian/liboss4-salsa2.install,
  debian/liboss4-salsa-asound2.links, debian/liboss4-salsa-dev.links:
  Install liboss4-salsa libraries like was done in the oss-libsalsa package.
* include-alsa: Add a copy of ALSA 1.0.5 headers: Cf ALSA_1.0.* symbols in
  libsalsa, this is the roughly supported version.
* debian/copyright: Update for new include-alsa files.
* alsa.pc: New file for compatibility with libasound-dev.
* debian/control:
  - Add Vcs-Browser and Vcs-Svn fields.
  - Use linux-any instead of the list of Linux archs (Closes: #604679).
  - Make dkms dependency linux-any only.
* debian/patches/hurd_iot.patch: New patch to fix soundcard.h usage in
  libsalsa on hurd-i386.
* debian/patches/libsalsa_fixes.patch: New patch to fix some printf usages
  and ioctl declaration in libsalsa.
* debian/patches/no_EBADE.patch: New patch to cope with hurd-i386 not having
  EBADE.
* debian/patches/CFLAGS.patch: New patch to make oss4 take debian/rules
  CFLAGS into account.
* debian/patches/snd_asoundlib_version.patch: New patch to add
  snd_asoundlib_version().
* debian/patches/generic_srccconf.patch: New patch to fix source
  configuration on unknown archs.

[ Romain Beauxis ]
* Fixed README.Debian to only mention dkms' modules.
* Switch to dpkg-source 3.0 (quilt) format
* Added DM-Upload-Allowed: yes

[ Sebastien NOEL ]
* New upstream release (Closes: #595298, #619272).
* Fix typo in initscript (Closes: #627149).
* debian/control: adjust linux-headers dependencies (Closes: #628879).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _FMTHEADERS_H
 
2
#define _FMTHEADERS_H   1
 
3
 
 
4
#include <sys/types.h>
 
5
 
 
6
/* Definitions for .VOC files */
 
7
 
 
8
#define MAGIC_STRING    "Creative Voice File\x1A"
 
9
#define ACTUAL_VERSION  0x010A
 
10
#define VOC_SAMPLESIZE  8
 
11
 
 
12
#define MODE_MONO       0
 
13
#define MODE_STEREO     1
 
14
 
 
15
#define DATALEN(bp)     ((u_long)(bp->datalen) | \
 
16
                         ((u_long)(bp->datalen_m) << 8) | \
 
17
                         ((u_long)(bp->datalen_h) << 16) )
 
18
 
 
19
typedef struct _vocheader
 
20
{
 
21
  u_char magic[20];             /* must be MAGIC_STRING */
 
22
  u_short headerlen;            /* Headerlength, should be 0x1A */
 
23
  u_short version;              /* VOC-file version */
 
24
  u_short coded_ver;            /* 0x1233-version */
 
25
}
 
26
VocHeader;
 
27
 
 
28
typedef struct _blocktype
 
29
{
 
30
  u_char type;
 
31
  u_char datalen;               /* low-byte    */
 
32
  u_char datalen_m;             /* medium-byte */
 
33
  u_char datalen_h;             /* high-byte   */
 
34
}
 
35
BlockType;
 
36
 
 
37
typedef struct _voice_data
 
38
{
 
39
  u_char tc;
 
40
  u_char pack;
 
41
}
 
42
Voice_data;
 
43
 
 
44
typedef struct _ext_block
 
45
{
 
46
  u_short tc;
 
47
  u_char pack;
 
48
  u_char mode;
 
49
}
 
50
Ext_Block;
 
51
 
 
52
 
 
53
/* Definitions for Microsoft WAVE format */
 
54
 
 
55
#define RIFF            0x46464952
 
56
#define WAVE            0x45564157
 
57
#define FMT             0x20746D66
 
58
#define DATA            0x61746164
 
59
#define PCM_CODE        1
 
60
#define WAVE_MONO       1
 
61
#define WAVE_STEREO     2
 
62
 
 
63
/* it's in chunks like .voc and AMIGA iff, but my source say there
 
64
   are in only in this combination, so I combined them in one header;
 
65
   it works on all WAVE-file I have
 
66
*/
 
67
typedef struct _waveheader
 
68
{
 
69
  u_long main_chunk;            /* 'RIFF' */
 
70
  u_long length;                /* filelen */
 
71
  u_long chunk_type;            /* 'WAVE' */
 
72
 
 
73
  u_long sub_chunk;             /* 'fmt ' */
 
74
  u_long sc_len;                /* length of sub_chunk, =16 */
 
75
  u_short format;               /* should be 1 for PCM-code */
 
76
  u_short modus;                /* 1 Mono, 2 Stereo */
 
77
  u_long sample_fq;             /* frequence of sample */
 
78
  u_long byte_p_sec;
 
79
  u_short byte_p_spl;           /* samplesize; 1 or 2 bytes */
 
80
  u_short bit_p_spl;            /* 8, 12 or 16 bit */
 
81
 
 
82
  u_long data_chunk;            /* 'data' */
 
83
  u_long data_length;           /* samplecount */
 
84
}
 
85
WaveHeader;
 
86
 
 
87
typedef struct
 
88
{
 
89
  long magic;                   /* must be equal to SND_MAGIC */
 
90
  long dataLocation;            /* Offset or pointer to the raw data */
 
91
  long dataSize;                /* Number of bytes of data in the raw data */
 
92
  long dataFormat;              /* The data format code */
 
93
  long samplingRate;            /* The sampling rate */
 
94
  long channelCount;            /* The number of channels */
 
95
}
 
96
SndHeader;
 
97
 
 
98
#define SND_MAGIC ((long int)0x2e736e64)
 
99
 
 
100
#define SND_FORMAT_UNSPECIFIED          (0)
 
101
#define SND_FORMAT_MULAW_8              (1)
 
102
#define SND_FORMAT_LINEAR_8             (2)
 
103
#define SND_FORMAT_LINEAR_16            (3)
 
104
#define SND_FORMAT_LINEAR_24            (4)
 
105
#define SND_FORMAT_LINEAR_32            (5)
 
106
#define SND_FORMAT_FLOAT                (6)
 
107
 
 
108
#endif