/
mpg123app.h
157 lines (133 loc) · 3.92 KB
/
mpg123app.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*
mpg123: main code of the program (not of the decoder...)
copyright 1995-2015 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp
mpg123 defines
used source: musicout.h from mpegaudio package
*/
#ifndef MPG123_H
#define MPG123_H
#include "config.h"
/* everyone needs it */
#include "compat.h"
/* import DLL symbols on windows */
#include "httpget.h"
#if WIN32
#include "win32_support.h"
#endif
#if defined(WIN32) && defined(DYNAMIC_BUILD)
#define LINK_MPG123_DLL
#endif
#include "mpg123.h"
#define MPG123_REMOTE
#define REMOTE_BUFFER_SIZE 2048
#define MAXOUTBURST 32768
#ifdef __GNUC__
#define INLINE inline
#else
#define INLINE
#endif
#include "local.h"
#define VERBOSE_MAX 3
extern char* binpath; /* argv[0], actually... */
struct parameter
{
int aggressive; /* renice to max. priority */
int shuffle; /* shuffle/random play */
int remote; /* remote operation */
int remote_err; /* remote operation to stderr */
int quiet; /* shut up! */
int xterm_title; /* Change xterm title to song names? */
long usebuffer; /* second level buffer size */
int verbose; /* verbose level */
const char* output_module; /* audio output module to use */
const char* output_device; /* audio output device to use */
long output_flags; /* out123 flags */
#ifdef HAVE_TERMIOS
int term_ctrl;
int term_visual;
/* Those are supposed to be single characters. */
char* term_usr1;
char* term_usr2;
#endif
int checkrange;
int force_reopen;
int test_cpu;
long realtime;
#ifdef HAVE_WINDOWS_H
int w32_priority;
#endif
long listentry; /* possibility to choose playback of one entry in playlist (0: off, > 0 : select, < 0; just show list*/
char* listname; /* name of playlist */
int long_id3;
int list_cpu;
char *cpu;
#ifdef FIFO
char* fifo;
#endif
long timeout; /* timeout for reading in seconds */
long loop; /* looping of tracks */
int delay;
int index; /* index / scan through files before playback */
/* parameters for mpg123 handle */
int down_sample;
long rva; /* (which) rva to do: 0: nothing, 1: radio/mix/track 2: album/audiophile */
long halfspeed;
long doublespeed;
long start_frame; /* frame offset to begin with */
long frame_number; /* number of frames to decode */
long outscale;
int flags;
long force_rate;
int talk_icy;
long resync_limit;
int smooth;
double pitch; /* <0 or >0, 0.05 for 5% speedup. */
unsigned long appflags; /* various switches for mpg123 application */
char *proxyurl;
int keep_open; /* Whether to keep files open after end reached, for remote control mode, perhaps terminal control, too. */
int force_utf8; /* Regardless of environment, always print out verbatim UTF for metadata. */
long index_size; /* size of frame index */
char *force_encoding;
double preload; /* buffer preload size (fraction of full buffer) */
long preframes;
long gain; /* audio output gain, for selected outputs */
char* streamdump;
long icy_interval;
const char* name; /* name for this player instance */
double device_buffer; /* output device buffer */
};
enum mpg123app_flags
{
MPG123APP_IGNORE_MIME = 0x01
,MPG123APP_LYRICS = 0x02
,MPG123APP_CONTINUE = 0x04
};
/* shortcut to check application flags */
#define APPFLAG(a) (param.appflags & (a))
extern char *equalfile;
extern off_t framenum;
extern struct httpdata htd;
extern int OutputDescriptor;
extern int intflag;
#ifdef VARMODESUPPORT
extern int varmode;
extern int playlimit;
#endif
/* why extern? */
extern int play_frame(void);
extern int control_generic(mpg123_handle *fr);
extern struct parameter param;
/* avoid the SIGINT in terminal control */
void next_track(void);
void prev_track(void);
void next_dir(void);
void prev_dir(void);
int open_track(char *fname);
void close_track(void);
void set_intflag(void);
/* equalizer... success is 0, failure -1 */
int load_equalizer(mpg123_handle *mh);
void continue_msg(const char *name);
#endif