comparison src/flacng/flacng.h @ 930:2f742d127b3e trunk

[svn] - initial import of flacng from audacious-flacng-0.012
author nenolod
date Mon, 09 Apr 2007 10:55:23 -0700
parents
children 7d7f77129c75
comparison
equal deleted inserted replaced
929:9631824411bf 930:2f742d127b3e
1 /*
2 * A FLAC decoder plugin for the Audacious Media Player
3 * Copyright (C) 2005 Ralf Ertzinger
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19 #ifndef FLACNG_H
20 #define FLACNG_H
21
22 #include <glib.h>
23 #include <audacious/plugin.h>
24 #include <audacious/vfs.h>
25
26 #define OUTPUT_BLOCK_SIZE (8192u)
27 #define MAX_SUPPORTED_CHANNELS (2u)
28 #define BUFFER_SIZE_SAMP (FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS)
29 #define BUFFER_SIZE_BYTE (BUFFER_SIZE_SAMP * (FLAC__MAX_BITS_PER_SAMPLE/8))
30
31 /*
32 * Audio information about the stream as a whole, gathered from
33 * the metadata header
34 */
35 struct stream_info {
36 guint bits_per_sample;
37 guint samplerate;
38 guint channels;
39 gulong samples;
40 gboolean has_seektable;
41 };
42
43 /*
44 * Information about the last decoded audio frame.
45 * Also describes the format of the audio currently contained
46 * in the stream buffer.
47 */
48 struct frame_info {
49 guint bits_per_sample;
50 guint samplerate;
51 guint channels;
52 };
53
54 /*
55 * Information about the stream content, from the metadata
56 */
57 struct stream_comment {
58 gchar* artist;
59 gchar* album;
60 gchar* title;
61 gchar* tracknumber;
62 gchar* genre;
63 gchar* date;
64 };
65
66 /*
67 * Replaygain information, from the metadata
68 */
69 struct stream_replaygain {
70 gboolean has_rg;
71 gchar* ref_loud;
72 gchar* track_gain;
73 gchar* track_peak;
74 gchar* album_gain;
75 gchar* album_peak;
76 };
77
78
79 typedef struct callback_info {
80 gint32* output_buffer;
81 gint32* write_pointer;
82 guint buffer_free;
83 guint buffer_used;
84 VFSFile* input_stream;
85 struct stream_info stream;
86 struct stream_comment comment;
87 struct stream_replaygain replaygain;
88 gboolean metadata_changed;
89 struct frame_info frame;
90 glong read_max;
91 gchar* name;
92 } callback_info;
93
94 #endif