annotate src/madplug/plugin.h @ 854:aac49941ee8f trunk

[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
author giacomo
date Wed, 14 Mar 2007 07:44:00 -0700
parents 0f9c8d4d3ac4
children a8494c2a87eb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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
656
3d734efe82d0 [svn] - disable debugging in preparation for alpha5 release
nenolod
parents: 611
diff changeset
25 /* #define DEBUG 1 */
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
26 /* #define DEBUG_INTENSIVELY 1 */
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
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>
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
39 #include <audacious/plugin.h>
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
40 #include <audacious/titlestring.h>
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
41 #include <audacious/util.h>
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
42 #include <audacious/strings.h>
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
43 #include <audacious/vfs.h>
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
44 #include <audacious/i18n.h>
660
9b4e01053d5c [svn] - id3tag.h -> audacious/id3tag.h
nenolod
parents: 656
diff changeset
45 #include <audacious/id3tag.h>
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
46 #include <mad.h>
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
47
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
48 #include "xing.h"
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
49
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
50 struct mad_info_t
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
51 {
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
52 /* InputPlayback */
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
53 InputPlayback *playback;
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
54
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
55 /* flags */
807
0f9c8d4d3ac4 [svn] - make use of new millisecond seek API.
yaz
parents: 797
diff changeset
56 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
57
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
58 /* state */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
59 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
60 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
61
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
62 /* song info */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
63 guint vbr; /**< bool: is vbr? */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
64 guint bitrate; /**< avg. bitrate */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
65 guint freq; /**< sample freq. */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
66 guint mpeg_layer; /**< mpeg layer */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
67 guint mode; /**< mpeg stereo mode */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
68 guint channels;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
69 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
70 gint fmt; /**< sample format */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
71 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
72 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
73 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
74 struct id3_tag *tag;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
75 struct id3_file *id3file;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
76 struct xing xing;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
77 TitleInput *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
78 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
79
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
80 /* replay parameters */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
81 gboolean has_replaygain;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
82 double replaygain_album_scale; // -1 if not set
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
83 double replaygain_track_scale;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
84 gchar *replaygain_album_str;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
85 gchar *replaygain_track_str;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
86 double replaygain_album_peak; // -1 if not set
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
87 double replaygain_track_peak;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
88 gchar *replaygain_album_peak_str;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
89 gchar *replaygain_track_peak_str;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
90 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
91 double mp3gain_minmax;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
92 gchar *mp3gain_undo_str;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
93 gchar *mp3gain_minmax_str;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
94
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
95 /* data access */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
96 gchar *url;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
97 gchar *filename;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
98 VFSFile *infile;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
99 gint offset;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
100
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
101 gboolean remote;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
102
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
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
105 struct audmad_config_t
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
106 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
107 gint http_buffer_size;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
108 gboolean fast_play_time_calc;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
109 gboolean use_xing;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
110 gboolean dither;
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
111 gboolean sjis;
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
112 gboolean hard_limit;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
113 gchar *pregain_db; // gain applied to samples at decoding stage.
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
114 gdouble pregain_scale; // pow(10, pregain/20)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
115 struct
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
116 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
117 gboolean enable;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
118 gboolean track_mode;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
119 gchar *default_db; // gain used if no RG.
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
120 gdouble default_scale;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
121 } replaygain;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
122 gboolean title_override;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
123 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
124 gboolean show_avg_vbr_bitrate;
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
125 };
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
126
773
22c82f3c0411 [svn] - reduce connection latency to http stream.
yaz
parents: 768
diff changeset
127 // global variables
22c82f3c0411 [svn] - reduce connection latency to http stream.
yaz
parents: 768
diff changeset
128 InputPlugin *mad_plugin;
22c82f3c0411 [svn] - reduce connection latency to http stream.
yaz
parents: 768
diff changeset
129 struct audmad_config_t audmad_config;
22c82f3c0411 [svn] - reduce connection latency to http stream.
yaz
parents: 768
diff changeset
130
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
131 // gcond
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
132 extern GMutex *mad_mutex;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
133 extern GMutex *pb_mutex;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
134 extern GCond *mad_cond;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
135
773
22c82f3c0411 [svn] - reduce connection latency to http stream.
yaz
parents: 768
diff changeset
136 // prototypes
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
137 void audmad_config_compute(struct audmad_config_t *config);
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
138 gboolean audmad_is_remote(gchar *url);
773
22c82f3c0411 [svn] - reduce connection latency to http stream.
yaz
parents: 768
diff changeset
139 void input_process_remote_metadata(struct mad_info_t *info);
22c82f3c0411 [svn] - reduce connection latency to http stream.
yaz
parents: 768
diff changeset
140 gpointer decode_loop(gpointer arg);
22c82f3c0411 [svn] - reduce connection latency to http stream.
yaz
parents: 768
diff changeset
141 void audmad_error(gchar * fmt, ...);
22c82f3c0411 [svn] - reduce connection latency to http stream.
yaz
parents: 768
diff changeset
142 void audmad_configure(void);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
143
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
144 #endif /* !AUD_MAD_H */