Mercurial > audlegacy-plugins
annotate src/madplug/plugin.h @ 3184:b009fad90e92
alsa-ng: buffer timing cleanups
author | Joris van Rantwijk <joris2822@xs4all.nl> |
---|---|
date | Sun, 14 Jun 2009 23:10:04 -0500 |
parents | 3134a0987162 |
children |
rev | line source |
---|---|
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
1 /* |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
2 * mad plugin for audacious |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
3 * Copyright (C) 2005-2007 William Pitcock, Yoshiki Yazawa |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
4 * |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
5 * Portions derived from xmms-mad: |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
6 * Copyright (C) 2001-2002 Sam Clegg - See COPYING |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
7 * |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
8 * This program is free software; you can redistribute it and/or modify |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
10 * the Free Software Foundation; under version 2 of the License. |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
11 * |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
15 * GNU General Public License for more details. |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
16 * |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
18 * along with this program; if not, write to the Free Software |
2835 | 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
20 */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
21 |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
22 #ifndef AUD_MAD_H |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
23 #define AUD_MAD_H |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
24 |
2214
9a869d4bb0d3
make use of AUDDBG() for debug print out.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1961
diff
changeset
|
25 /* #define AUD_DEBUG 1 */ |
611 | 26 /* #define DEBUG_INTENSIVELY 1 */ |
27 /* #define DEBUG_DITHER 1 */ | |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
28 |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
29 #undef G_LOG_DOMAIN |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
30 #define G_LOG_DOMAIN "MADPlug" |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
31 |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
32 #undef PACKAGE |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
33 #define PACKAGE "audacious-plugins" |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
34 |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
35 #include <stdlib.h> |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
36 #include <stdio.h> |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
37 #include <string.h> |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
38 #include <unistd.h> |
2971
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2835
diff
changeset
|
39 #include <audlegacy/plugin.h> |
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2835
diff
changeset
|
40 #include <audlegacy/i18n.h> |
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2835
diff
changeset
|
41 #include <audlegacy/id3tag.h> |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
42 #include <mad.h> |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
43 |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
44 #include "xing.h" |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
45 |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
46 struct mad_info_t |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
47 { |
611 | 48 /* InputPlayback */ |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
49 InputPlayback *playback; |
611 | 50 |
997
e46b98155d5d
[svn] - fix a bug which counts number of frames twice in handling xing header.
yaz
parents:
916
diff
changeset
|
51 /* seek time */ |
807 | 52 gulong seek; /**< seek time in milliseconds */ |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
53 |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
54 /* state */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
55 guint current_frame;/**< current mp3 frame */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
56 mad_timer_t pos; /**< current play position */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
57 |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
58 /* song info */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
59 guint vbr; /**< bool: is vbr? */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
60 guint bitrate; /**< avg. bitrate */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
61 guint freq; /**< sample freq. */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
62 guint mpeg_layer; /**< mpeg layer */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
63 guint mode; /**< mpeg stereo mode */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
64 guint channels; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
65 gint frames; /**< total mp3 frames or -1 */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
66 gint fmt; /**< sample format */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
67 gint size; /**< file size in bytes or -1 */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
68 gchar *title; /**< title for xmms */ |
768
1d3f70ac6b31
[svn] - remote metadata handling is moved into input_process_remote_metadata(). this function converts string into utf-8 if necessary (mainly for zina).
yaz
parents:
727
diff
changeset
|
69 mad_timer_t duration; /**< total play time */ |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
70 struct id3_tag *tag; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
71 struct id3_file *id3file; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
72 struct xing xing; |
1428
4993976d7ed0
madplug: tuple API changes
William Pitcock <nenolod@atheme-project.org>
parents:
997
diff
changeset
|
73 Tuple *tuple; /* audacious tuple data */ |
797
19e08e104ba6
[svn] - madplug: do not call set_info repeatedly in input_process_remote_metadata, only call it when the built title string actually differs from the previous one
giacomo
parents:
773
diff
changeset
|
74 gchar *prev_title; /* used to optimize set_info calls */ |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
75 |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
76 /* replay parameters */ |
2392
4ad6e7dfb389
imported 5298b10777b3 by Eugene Zagidullin.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2390
diff
changeset
|
77 double replaygain_album_scale; |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
78 double replaygain_track_scale; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
79 gchar *replaygain_album_str; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
80 gchar *replaygain_track_str; |
2392
4ad6e7dfb389
imported 5298b10777b3 by Eugene Zagidullin.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2390
diff
changeset
|
81 double replaygain_album_peak; /* 0 if gain/peak pair not set */ |
4ad6e7dfb389
imported 5298b10777b3 by Eugene Zagidullin.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2390
diff
changeset
|
82 double replaygain_track_peak; /* 0 if gain/peak pair not set */ |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
83 gchar *replaygain_album_peak_str; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
84 gchar *replaygain_track_peak_str; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
85 double mp3gain_undo; // -1 if not set |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
86 double mp3gain_minmax; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
87 gchar *mp3gain_undo_str; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
88 gchar *mp3gain_minmax_str; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
89 |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
90 /* data access */ |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
91 gchar *url; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
92 gchar *filename; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
93 VFSFile *infile; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
94 gint offset; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
95 |
997
e46b98155d5d
[svn] - fix a bug which counts number of frames twice in handling xing header.
yaz
parents:
916
diff
changeset
|
96 /* flags */ |
611 | 97 gboolean remote; |
997
e46b98155d5d
[svn] - fix a bug which counts number of frames twice in handling xing header.
yaz
parents:
916
diff
changeset
|
98 gboolean fileinfo_request; |
611 | 99 |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
100 }; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
101 |
2341
59addab003d7
- reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2291
diff
changeset
|
102 typedef struct audmad_config_t |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
103 { |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
104 gboolean fast_play_time_calc; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
105 gboolean use_xing; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
106 gboolean dither; |
611 | 107 gboolean sjis; |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
108 gboolean title_override; |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
109 gchar *id3_format; |
676
1733b12ef974
[svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents:
660
diff
changeset
|
110 gboolean show_avg_vbr_bitrate; |
916
a8494c2a87eb
[svn] revise reopen output code for #880. time count would be reset if output was closed. so I took two measures for it.
yaz
parents:
807
diff
changeset
|
111 gboolean force_reopen_audio; |
2341
59addab003d7
- reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2291
diff
changeset
|
112 } audmad_config_t; |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
113 |
773 | 114 // global variables |
1570
85788238cbf5
madplug: remove rpath. PUT THIS IN CONFIGURE.AC. -Wl,rpath= IS NOT PORTABLE. I WILL KEEP REMOVING THIS.
William Pitcock <nenolod@atheme.org>
parents:
1428
diff
changeset
|
115 extern InputPlugin *mad_plugin; |
2341
59addab003d7
- reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2291
diff
changeset
|
116 extern audmad_config_t *audmad_config; |
773 | 117 |
611 | 118 // gcond |
119 extern GMutex *mad_mutex; | |
120 extern GMutex *pb_mutex; | |
121 extern GCond *mad_cond; | |
122 | |
773 | 123 // prototypes |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
124 void audmad_config_compute(struct audmad_config_t *config); |
773 | 125 void input_process_remote_metadata(struct mad_info_t *info); |
126 gpointer decode_loop(gpointer arg); | |
127 void audmad_error(gchar * fmt, ...); | |
128 void audmad_configure(void); | |
610
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
129 |
862190d39e00
[svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff
changeset
|
130 #endif /* !AUD_MAD_H */ |