~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to mpg123_artsplugin/mpg123/audio.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Audio 'LIB' defines
 
3
 */
 
4
 
 
5
#define AUDIO_OUT_HEADPHONES       0x01
 
6
#define AUDIO_OUT_INTERNAL_SPEAKER 0x02
 
7
#define AUDIO_OUT_LINE_OUT         0x04
 
8
 
 
9
enum { DECODE_TEST, DECODE_AUDIO, DECODE_FILE, DECODE_BUFFER, DECODE_WAV,
 
10
        DECODE_AU,DECODE_CDR,DECODE_AUDIOFILE };
 
11
 
 
12
#define AUDIO_FORMAT_MASK         0x100
 
13
#define AUDIO_FORMAT_16           0x100
 
14
#define AUDIO_FORMAT_8            0x000
 
15
 
 
16
#define AUDIO_FORMAT_SIGNED_16    0x110
 
17
#define AUDIO_FORMAT_UNSIGNED_16  0x120
 
18
#define AUDIO_FORMAT_UNSIGNED_8   0x1
 
19
#define AUDIO_FORMAT_SIGNED_8     0x2
 
20
#define AUDIO_FORMAT_ULAW_8       0x4
 
21
#define AUDIO_FORMAT_ALAW_8       0x8
 
22
 
 
23
/* 3% rate tolerance */
 
24
#define AUDIO_RATE_TOLERANCE      3
 
25
 
 
26
#if 0
 
27
#if defined(HPUX) || defined(SUNOS) || defined(SOLARIS) || defined(OSS) || defined(__NetBSD__) || defined(SPARCLINUX) || defined(__FreeBSD__)
 
28
#endif
 
29
#endif
 
30
 
 
31
#ifndef AIX_UMS
 
32
#define AUDIO_USES_FD
 
33
#endif
 
34
#ifdef AIX_UMS
 
35
#include <UMSAudioDevice.h>
 
36
#endif
 
37
 
 
38
#ifdef SGI
 
39
/* #include <audio.h> */
 
40
#include <dmedia/audio.h>
 
41
#endif
 
42
 
 
43
 
 
44
#ifdef ALSA
 
45
#include <sys/asoundlib.h>
 
46
#endif
 
47
 
 
48
struct audio_info_struct
 
49
{
 
50
#ifdef AUDIO_USES_FD
 
51
  int fn; /* filenumber */
 
52
#endif
 
53
#ifdef SGI
 
54
  ALconfig config;
 
55
  ALport port;
 
56
#endif
 
57
  long rate;
 
58
  long gain;
 
59
  int output;
 
60
#ifdef ALSA
 
61
  snd_pcm_t *handle;
 
62
  snd_pcm_format_t alsa_format;
 
63
#endif
 
64
#ifdef AIX_UMS
 
65
  UMSAudioDevice dev;
 
66
  UMSAudioDeviceMClass class;
 
67
  Environment *ev;
 
68
  UMSAudioDeviceMClass_ErrorCode err;
 
69
  char *errstr;
 
70
  char *fmtal;
 
71
  char *inp;
 
72
  char *out;
 
73
#endif
 
74
  char *device;
 
75
  int channels;
 
76
  int format;
 
77
  int private1;
 
78
  void *private2;
 
79
};
 
80
 
 
81
struct audio_name {
 
82
  int  val;
 
83
  char *name;
 
84
  char *sname;
 
85
};
 
86
 
 
87
extern void audio_capabilities(struct audio_info_struct *);
 
88
extern void audio_fit_capabilities(struct audio_info_struct *ai,int c,int r);
 
89
 
 
90
extern char *audio_encoding_name(int format);
 
91
 
 
92
extern int audio_play_samples(struct audio_info_struct *,unsigned char *,int);
 
93
extern int audio_open(struct audio_info_struct *);
 
94
extern int audio_reset_parameters(struct audio_info_struct *);
 
95
extern int audio_rate_best_match(struct audio_info_struct *ai);
 
96
extern int audio_set_rate(struct audio_info_struct *);
 
97
extern int audio_set_format(struct audio_info_struct *);
 
98
extern int audio_get_formats(struct audio_info_struct *);
 
99
extern int audio_set_channels(struct audio_info_struct *);
 
100
extern int audio_write_sample(struct audio_info_struct *,short *,int);
 
101
extern int audio_close(struct audio_info_struct *);
 
102
extern void audio_info_struct_init(struct audio_info_struct *);
 
103
extern void audio_queueflush(struct audio_info_struct *ai);
 
104