~ubuntu-branches/ubuntu/lucid/mpg123/lucid

« back to all changes in this revision

Viewing changes to src/audio.h

Tags: upstream-0.60
ImportĀ upstreamĀ versionĀ 0.60

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
        audio: audio output interface
 
3
 
 
4
        copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
 
5
        see COPYING and AUTHORS files in distribution or http://mpg123.de
 
6
        initially written by Michael Hipp
 
7
*/
 
8
 
 
9
/* 
 
10
 * Audio 'LIB' defines
 
11
 */
 
12
 
 
13
 
 
14
#ifndef _MPG123_AUDIO_H_
 
15
#define _MPG123_AUDIO_H_
 
16
 
 
17
#define AUDIO_OUT_HEADPHONES       0x01
 
18
#define AUDIO_OUT_INTERNAL_SPEAKER 0x02
 
19
#define AUDIO_OUT_LINE_OUT         0x04
 
20
 
 
21
enum {
 
22
        DECODE_TEST,
 
23
        DECODE_AUDIO,
 
24
        DECODE_FILE,
 
25
        DECODE_BUFFER,
 
26
        DECODE_WAV,
 
27
        DECODE_AU,
 
28
        DECODE_CDR,
 
29
        DECODE_AUDIOFILE
 
30
};
 
31
 
 
32
#define AUDIO_FORMAT_MASK         0x100
 
33
#define AUDIO_FORMAT_16           0x100
 
34
#define AUDIO_FORMAT_8            0x000
 
35
 
 
36
#define AUDIO_FORMAT_SIGNED_16    0x110
 
37
#define AUDIO_FORMAT_UNSIGNED_16  0x120
 
38
#define AUDIO_FORMAT_UNSIGNED_8   0x1
 
39
#define AUDIO_FORMAT_SIGNED_8     0x2
 
40
#define AUDIO_FORMAT_ULAW_8       0x4
 
41
#define AUDIO_FORMAT_ALAW_8       0x8
 
42
 
 
43
/* 3% rate tolerance */
 
44
#define AUDIO_RATE_TOLERANCE      3
 
45
 
 
46
 
 
47
 
 
48
struct audio_info_struct
 
49
{
 
50
  int fn; /* filenumber */
 
51
  void *handle; /* driver specific pointer */
 
52
 
 
53
  long rate;
 
54
  long gain;
 
55
  int output;
 
56
 
 
57
  char *device;
 
58
  int channels;
 
59
  int format;
 
60
 
 
61
};
 
62
 
 
63
struct audio_name {
 
64
  int  val;
 
65
  char *name;
 
66
  char *sname;
 
67
};
 
68
 
 
69
 
 
70
/* ------ Declarations from "audio.c" ------ */
 
71
 
 
72
extern void audio_info_struct_init(struct audio_info_struct *);
 
73
extern void audio_info_struct_dump(struct audio_info_struct *ai);
 
74
extern void audio_capabilities(struct audio_info_struct *);
 
75
extern void audio_fit_capabilities(struct audio_info_struct *ai,int c,int r);
 
76
extern char *audio_encoding_name(int format);
 
77
 
 
78
 
 
79
/* ------ Declarations from "audio_*.c" ------ */
 
80
 
 
81
extern int audio_open(struct audio_info_struct *);
 
82
extern int audio_get_formats(struct audio_info_struct *);
 
83
extern int audio_play_samples(struct audio_info_struct *, unsigned char *,int);
 
84
extern void audio_queueflush(struct audio_info_struct *ai);
 
85
extern int audio_close(struct audio_info_struct *);
 
86
 
 
87
#endif
 
88