annotate src/filewriter/filewriter.h @ 3085:ac0af6b39272

Introduce new GIO plugin to buildsystem. stdio is now deprecated. Thoughts: - getc()/ungetc() should be moved to VFS core now
author William Pitcock <nenolod@atheme.org>
date Wed, 29 Apr 2009 20:58:36 -0500
parents 3134a0987162
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
984
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
1 /* FileWriter-Plugin
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
2 * (C) copyright 2007 merging of Disk Writer and Out-Lame by Michael Färber
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
3 *
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
4 * Original Out-Lame-Plugin:
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
5 * (C) copyright 2002 Lars Siebold <khandha5@gmx.net>
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
6 * (C) copyright 2006-2007 porting to audacious by Yoshiki Yazawa <yaz@cc.rim.or.jp>
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
7 *
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
11 * (at your option) any later version.
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
12 *
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
16 * GNU General Public License for more details.
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
17 *
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
2835
f1b6f1b2cdb3 fixed FSF address
Andrew O. Shadoura <bugzilla@tut.by>
parents: 2775
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
984
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
21 */
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
22
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
23 #ifndef FILEWRITER_H
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
24 #define FILEWRITER_H
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
25
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
26 #include "config.h"
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
27
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
28 #include <gtk/gtk.h>
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
29 #include <stdio.h>
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
30 #include <string.h>
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
31
2971
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2950
diff changeset
32 #include <audlegacy/main.h>
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2950
diff changeset
33 #include <audlegacy/plugin.h>
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2950
diff changeset
34 #include <audlegacy/playlist.h>
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2950
diff changeset
35 #include <audlegacy/configdb.h>
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2950
diff changeset
36 #include <audlegacy/i18n.h>
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2950
diff changeset
37 #include <audlegacy/util.h>
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2950
diff changeset
38 #include <audlegacy/vfs.h>
984
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
39
2971
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2950
diff changeset
40 #include <audlegacy/libSAD.h>
2874
11ef2164d90b re-written format conversion using libSAD;
Andrew O. Shadoura <bugzilla@tut.by>
parents: 2873
diff changeset
41
2950
dcd8d93ba781 - mp3: adapted to lame-3.98. now filewriter writes valid TLEN.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2874
diff changeset
42 struct format_info {
984
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
43 AFormat format;
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
44 int frequency;
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
45 int channels;
1569
25ea2127eefa filewriter: fix symbol collisions
William Pitcock <nenolod@atheme.org>
parents: 1441
diff changeset
46 };
25ea2127eefa filewriter: fix symbol collisions
William Pitcock <nenolod@atheme.org>
parents: 1441
diff changeset
47
25ea2127eefa filewriter: fix symbol collisions
William Pitcock <nenolod@atheme.org>
parents: 1441
diff changeset
48 extern struct format_info input;
984
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
49
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
50 extern VFSFile *output_file;
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
51 extern guint64 offset;
1441
1b52e7eacd4c filewriter: new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1011
diff changeset
52 extern Tuple *tuple;
984
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
53
2766
6d08e3120615 make some file filewriter backends use callbacks instead of calling VFS directly
Andrew O. Shadoura <bugzilla@tut.by>
parents: 1569
diff changeset
54 typedef gint (*write_output_callback)(void *ptr, gint length);
6d08e3120615 make some file filewriter backends use callbacks instead of calling VFS directly
Andrew O. Shadoura <bugzilla@tut.by>
parents: 1569
diff changeset
55
2950
dcd8d93ba781 - mp3: adapted to lame-3.98. now filewriter writes valid TLEN.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2874
diff changeset
56 typedef struct _FileWriter
984
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
57 {
2766
6d08e3120615 make some file filewriter backends use callbacks instead of calling VFS directly
Andrew O. Shadoura <bugzilla@tut.by>
parents: 1569
diff changeset
58 void (*init)(write_output_callback write_output_func);
984
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
59 void (*configure)(void);
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
60 gint (*open)(void);
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
61 void (*write)(void *ptr, gint length);
2774
f1f7ee810de8 add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents: 2766
diff changeset
62 void (*flush)(void);
984
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
63 void (*close)(void);
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
64 gint (*free)(void);
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
65 gint (*playing)(void);
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
66 gint (*get_written_time)(void);
2873
31d6c44ffef2 most of encoder backends require GINT16_NE;
Andrew O. Shadoura <bugzilla@tut.by>
parents: 2835
diff changeset
67 AFormat format_required;
2950
dcd8d93ba781 - mp3: adapted to lame-3.98. now filewriter writes valid TLEN.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2874
diff changeset
68 } FileWriter;
984
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
69
df7b09989aee [svn] - We got a new plugin, captain!
mf0102
parents:
diff changeset
70 #endif