~ubuntu-branches/ubuntu/trusty/vice/trusty-proposed

« back to all changes in this revision

Viewing changes to src/arch/amigaos/ahi.h

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2008-10-16 20:28:53 UTC
  • mfrom: (1.2.1 upstream) (9.1.6 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081016202853-vo9c1g9pd15wl7zu
Tags: 1.22.dfsg1-0.1
* NMU to fix release-critical bugs.
* Add data/PRINTER/mps803 to mangle-source.sh check, it's not a multiple of
  2048. Also fix the bashism in the script by replacing $[ ] with $(( )) in
  the calculation part.
* Mangled the source with above fixed script (closes: #442924, #501143)
* do delete -size 6c files and not -empty, they contain "dummy\n"
* Remove README.Debian entry about Xaw3d and Gnome because it's not valid
  anymore (closes: #501135)
* Remove the following Build-Depends as they aren't used because of no xaw3d
  build: xaw3dg-dev, libxaw7-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * ahi.h
 
3
 *
 
4
 * Written by
 
5
 *  Mathias Roslund <vice.emu@amidog.se>
 
6
 *
 
7
 * This file is part of VICE, the Versatile Commodore Emulator.
 
8
 * See README for copyright notice.
 
9
 *
 
10
 *  This program is free software; you can redistribute it and/or modify
 
11
 *  it under the terms of the GNU General Public License as published by
 
12
 *  the Free Software Foundation; either version 2 of the License, or
 
13
 *  (at your option) any later version.
 
14
 *
 
15
 *  This program is distributed in the hope that it will be useful,
 
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 *  GNU General Public License for more details.
 
19
 *
 
20
 *  You should have received a copy of the GNU General Public License
 
21
 *  along with this program; if not, write to the Free Software
 
22
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
23
 *  02111-1307  USA.
 
24
 *
 
25
 */
 
26
 
 
27
#ifndef _AHI_H_
 
28
#define _AHI_H_
 
29
 
 
30
/* 8bit */
 
31
typedef   signed char s8;
 
32
typedef unsigned char u8;
 
33
 
 
34
/* 16bit */
 
35
typedef   signed short s16;
 
36
typedef unsigned short u16;
 
37
 
 
38
/* 32bit */
 
39
typedef   signed long s32;
 
40
typedef unsigned long u32;
 
41
typedef         float f32;
 
42
 
 
43
/* 64bit */
 
44
typedef   signed long long s64;
 
45
typedef unsigned long long u64;
 
46
typedef             double f64;
 
47
 
 
48
/* format */
 
49
#define AUDIO_MODE_8BIT   (0x00) /*  8 bit */
 
50
#define AUDIO_MODE_16BIT  (0x01) /* 16 bit */
 
51
#define AUDIO_MODE_MONO   (0x00) /*   mono */
 
52
#define AUDIO_MODE_STEREO (0x02) /* stereo */
 
53
 
 
54
/* format helpers */
 
55
#define AUDIO_M8S  (AUDIO_MODE_MONO   | AUDIO_MODE_8BIT ) /*  8 bit signed, mono */
 
56
#define AUDIO_M16S (AUDIO_MODE_MONO   | AUDIO_MODE_16BIT) /* 16 bit signed, mono */
 
57
#define AUDIO_S8S  (AUDIO_MODE_STEREO | AUDIO_MODE_8BIT ) /*  8 bit signed, stereo */
 
58
#define AUDIO_S16S (AUDIO_MODE_STEREO | AUDIO_MODE_16BIT) /* 16 bit signed, stereo */
 
59
 
 
60
/* time */
 
61
#define TIMEBASE (1000000) /* us */
 
62
#define NOTIME   ((s64)-1) /* when no timestamp is available */
 
63
#define NOWAIT   (0)
 
64
#define DOWAIT   (1)
 
65
 
 
66
/* sample functions */
 
67
extern s32 ahi_open(s32 frequency, u32 mode, s32 fragsize, s32 frags, void (*callback)(s64 time));
 
68
extern s32 ahi_samples_to_bytes(s32 samples);
 
69
extern s32 ahi_bytes_to_samples(s32 bytes);
 
70
 
 
71
#ifdef __VBCC__
 
72
extern void ahi_play_samples(SWORD *data, s32 samples, s64 time, s32 wait);
 
73
#else
 
74
extern void ahi_play_samples(void *data, s32 samples, s64 time, s32 wait);
 
75
#endif
 
76
 
 
77
extern s32 ahi_samples_buffered(void);
 
78
extern s32 ahi_samples_free(void);
 
79
extern void ahi_pause(void);
 
80
extern void ahi_close(void);
 
81
 
 
82
/* byte functions */
 
83
#define ahi_play_bytes(data, bytes, time, wait) ahi_play_samples(data, ahi_bytes_to_samples(bytes), time, wait)
 
84
#define ahi_bytes_buffered() ahi_samples_to_bytes(ahi_samples_buffered())
 
85
#define ahi_bytes_free() ahi_samples_to_bytes(ahi_samples_free())
 
86
 
 
87
#endif /* _AHI_H_ */