annotate src/flacng/tools.h @ 3196:0f7180e3b163

alsa-ng: Enforce a minimum buffer size of 500ms.
author William Pitcock <nenolod@atheme.org>
date Sun, 12 Jul 2009 08:30:13 -0500
parents 2cdf6400594c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
930
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
1 /*
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
2 * A FLAC decoder plugin for the Audacious Media Player
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
3 * Copyright (C) 2005 Ralf Ertzinger
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
4 *
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
8 * (at your option) any later version.
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
9 *
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
13 * GNU General Public License for more details.
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
14 *
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
2835
f1b6f1b2cdb3 fixed FSF address
Andrew O. Shadoura <bugzilla@tut.by>
parents: 2266
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
930
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
18 */
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
19 #ifndef _TOOLS_H
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
20 #define _TOOLS_H
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
21
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
22 #include <glib.h>
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
23 #include <FLAC/all.h>
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
24 #include "flacng.h"
1246
626f78ff2439 - Add FLAC 1.1.2 compatibility
sun@fc5-buildsys
parents: 930
diff changeset
25 #include "flac_compat.h"
1402
ce121ac96279 - Fix locking macros
Ralf Ertzinger <ralf@skytale.net>
parents: 1401
diff changeset
26 #include "debug.h"
930
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
27
1401
263d72004333 - Introduce a mutex for test_info and lock appropriately
Ralf Ertzinger <ralf@skytale.net>
parents: 1272
diff changeset
28 #define INFO_LOCK(__info) \
1402
ce121ac96279 - Fix locking macros
Ralf Ertzinger <ralf@skytale.net>
parents: 1401
diff changeset
29 do { \
1401
263d72004333 - Introduce a mutex for test_info and lock appropriately
Ralf Ertzinger <ralf@skytale.net>
parents: 1272
diff changeset
30 _DEBUG("Trying to lock info %s", (__info)->name); \
263d72004333 - Introduce a mutex for test_info and lock appropriately
Ralf Ertzinger <ralf@skytale.net>
parents: 1272
diff changeset
31 g_mutex_lock((__info)->mutex); \
263d72004333 - Introduce a mutex for test_info and lock appropriately
Ralf Ertzinger <ralf@skytale.net>
parents: 1272
diff changeset
32 _DEBUG("Locked info %s", (__info)->name); \
263d72004333 - Introduce a mutex for test_info and lock appropriately
Ralf Ertzinger <ralf@skytale.net>
parents: 1272
diff changeset
33 } while(0)
263d72004333 - Introduce a mutex for test_info and lock appropriately
Ralf Ertzinger <ralf@skytale.net>
parents: 1272
diff changeset
34
263d72004333 - Introduce a mutex for test_info and lock appropriately
Ralf Ertzinger <ralf@skytale.net>
parents: 1272
diff changeset
35 #define INFO_UNLOCK(__info) \
1402
ce121ac96279 - Fix locking macros
Ralf Ertzinger <ralf@skytale.net>
parents: 1401
diff changeset
36 do { \
1401
263d72004333 - Introduce a mutex for test_info and lock appropriately
Ralf Ertzinger <ralf@skytale.net>
parents: 1272
diff changeset
37 _DEBUG("Unlocking info %s", (__info)->name); \
263d72004333 - Introduce a mutex for test_info and lock appropriately
Ralf Ertzinger <ralf@skytale.net>
parents: 1272
diff changeset
38 g_mutex_unlock((__info)->mutex); \
263d72004333 - Introduce a mutex for test_info and lock appropriately
Ralf Ertzinger <ralf@skytale.net>
parents: 1272
diff changeset
39 _DEBUG("Unlocked info %s", (__info)->name); \
263d72004333 - Introduce a mutex for test_info and lock appropriately
Ralf Ertzinger <ralf@skytale.net>
parents: 1272
diff changeset
40 } while(0)
263d72004333 - Introduce a mutex for test_info and lock appropriately
Ralf Ertzinger <ralf@skytale.net>
parents: 1272
diff changeset
41
930
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
42 callback_info* init_callback_info(gchar* name);
2266
5395c85a8724 Make flacng plugin to clean up after itself (Bugzilla #19)
Jussi Judin <jjudin+audacious@iki.fi>
parents: 1435
diff changeset
43 void clean_callback_info(callback_info* info);
1272
47559538ce3d - stop read_metadata from stomping on the wrong file descriptors
Ralf Ertzinger <ralf@skytale.net>
parents: 1255
diff changeset
44 void reset_info(callback_info* info, gboolean close_fd);
930
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
45 gchar* get_title(const gchar* filename, callback_info* info);
1435
654aa79e43ef flacng: new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1402
diff changeset
46 Tuple *get_tuple(const gchar *filename, callback_info* info);
930
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
47 void add_comment(callback_info* info, gchar* key, gchar* value);
1255
37598c8f4425 - Add flac_is_our_fd()
Ralf Ertzinger <ralf@skytale.net>
parents: 1246
diff changeset
48 gboolean read_metadata(VFSFile* fd, FLAC__StreamDecoder* decoder, callback_info* info);
2991
2cdf6400594c flacng: enable replaygain
Teemu Torma <teemu@torma.org>
parents: 2835
diff changeset
49 ReplayGainInfo get_replay_gain(callback_info *info);
930
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
50
2f742d127b3e [svn] - initial import of flacng from audacious-flacng-0.012
nenolod
parents:
diff changeset
51 #endif