~ubuntu-branches/ubuntu/utopic/glame/utopic

« back to all changes in this revision

Viewing changes to src/include/glame_types.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2002-04-09 17:14:12 UTC
  • Revision ID: james.westby@ubuntu.com-20020409171412-jzpnov7mbz2w6zsr
Tags: upstream-0.6.2
ImportĀ upstreamĀ versionĀ 0.6.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _GLAME_TYPES_H
 
2
#define _GLAME_TYPES_H
 
3
 
 
4
/*
 
5
 * glame_types.h
 
6
 * $Id: glame_types.h,v 1.19 2001/10/06 23:08:55 richi Exp $
 
7
 * Copyright (C) 2000 Alexander Ehlert, Richard Guenther, Daniel Kobras
 
8
 *
 
9
 * This program is free software; you can redistribute it and/or modify
 
10
 * it under the terms of the GNU General Public License as published by
 
11
 * the Free Software Foundation; either version 2 of the License, or
 
12
 * (at your option) any later version.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program; if not, write to the Free Software
 
21
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
22
 *
 
23
 */
 
24
 
 
25
#ifdef HAVE_CONFIG_H
 
26
#include <config.h>
 
27
#endif
 
28
 
 
29
/* internal SAMPLE format and size.
 
30
 * this should be changable w/o any code breakage!
 
31
 */
 
32
 
 
33
/* The recommended buffer size is GLAME_WBUFSIZE, the minimum
 
34
 * and maximum allowed sizes are GLAME_MIN_BUFSIZE and GLAME_MAX_BUFSIZE.
 
35
 * These numbers are specified in number of samples. */
 
36
extern int _GLAME_WBUFSIZE;
 
37
#define GLAME_MIN_BUFSIZE (GLAME_WBUFSIZE/4)
 
38
#define GLAME_MAX_BUFSIZE (GLAME_WBUFSIZE*4)
 
39
#define GLAME_BULK_BUFSIZE (64*1024)
 
40
 
 
41
#define GLAME_DEFAULT_SAMPLERATE 44100
 
42
 
 
43
/* SAMPLE is defined by config.h now.
 
44
 * typedef float SAMPLE; */
 
45
#define SAMPLE_SIZE ((long)sizeof(SAMPLE))
 
46
 
 
47
/* Sigh! Why is there no portable standard for those types? */
 
48
typedef   signed char   gl_s8;  /* Hope this covers 'char is unsigned' case. */
 
49
typedef unsigned char   gl_u8;
 
50
#if SIZEOF_SHORT == 2
 
51
typedef   signed short  gl_s16;
 
52
typedef unsigned short  gl_u16;
 
53
#elif SIZEOF_INT == 2
 
54
typedef   signed int    gl_s16;
 
55
typedef unsigned int    gl_u16;
 
56
#else
 
57
#error No 16 bit data type available.
 
58
#endif
 
59
#if SIZEOF_INT == 4
 
60
typedef   signed int    gl_s32;
 
61
typedef unsigned int    gl_u32;
 
62
#elif SIZEOF_LONG == 4
 
63
typedef   signed long   gl_s32;
 
64
typedef unsigned long   gl_u32;
 
65
#else
 
66
#error No 32 bit data type available.
 
67
#endif
 
68
/* Add when needed. Beware: long long is a GNU extension! */
 
69
#if SIZEOF_LONG == 8
 
70
typedef   signed long   gl_s64;
 
71
typedef unsigned long   gl_u64;
 
72
#elif SIZEOF_LONG_LONG == 8
 
73
typedef   signed long long      gl_s64;
 
74
typedef unsigned long long      gl_u64;
 
75
#else
 
76
#error No 64 bit data type available.
 
77
#endif 
 
78
 
 
79
#endif
 
80