annotate src/audacious/input.c @ 3700:81026451b455

fix tuple_get_int declaration
author William Pitcock <nenolod@atheme.org>
date Sun, 07 Oct 2007 00:28:00 -0500
parents b747ad540903
children a575c29cee05 bb709f82068b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1 /* Audacious - Cross-platform multimedia player
3170
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
2 * Copyright (C) 2005-2007 Audacious development team
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
3 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
4 * Based on BMP:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
5 * Copyright (C) 2003-2004 BMP development team
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
6 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
7 * Based on XMMS:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
8 * Copyright (C) 1998-2003 XMMS development team
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
9 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
3121
3b6d316f8b09 GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents: 3110
diff changeset
12 * the Free Software Foundation; under version 3 of the License.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
13 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
17 * GNU General Public License for more details.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
18 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
3121
3b6d316f8b09 GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents: 3110
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses>.
3123
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
21 *
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
22 * The Audacious team does not consider modular code linking to
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
23 * Audacious or using our public API to be a derived work.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
24 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
25
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
26 #ifdef HAVE_CONFIG_H
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
27 # include "config.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
28 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
29
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
30 #include <glib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
31 #include <glib/gi18n.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
32 #include <gtk/gtk.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
33 #include <string.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
34
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
35 #include <mowgli.h>
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
36
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
37 #include "fft.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
38 #include "input.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
39 #include "main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
40 #include "output.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
41 #include "playback.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
42 #include "pluginenum.h"
2420
b23f52fe132f [svn] Removed util.* from libaudacious
mf0102
parents: 2399
diff changeset
43 #include "strings.h"
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
44 #include "tuple.h"
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
45 #include "tuple_formatter.h"
2420
b23f52fe132f [svn] Removed util.* from libaudacious
mf0102
parents: 2399
diff changeset
46 #include "ui_main.h"
b23f52fe132f [svn] Removed util.* from libaudacious
mf0102
parents: 2399
diff changeset
47 #include "util.h"
b23f52fe132f [svn] Removed util.* from libaudacious
mf0102
parents: 2399
diff changeset
48 #include "visualization.h"
3072
84de3244aeaa replace Playstatus with UiSkinnedPlaystatus
Tomasz Mon <desowin@gmail.com>
parents: 3013
diff changeset
49 #include "ui_skinned_playstatus.h"
2505
87c53f0e9e0d [svn] - added set volume hook
giacomo
parents: 2439
diff changeset
50 #include "hook.h"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
51
2347
74bbc3e18cba [svn] - fix W:input.c(422) [input_check_file]:Implicit declaration
nenolod
parents: 2344
diff changeset
52 #include "vfs.h"
74bbc3e18cba [svn] - fix W:input.c(422) [input_check_file]:Implicit declaration
nenolod
parents: 2344
diff changeset
53 #include "vfs_buffer.h"
74bbc3e18cba [svn] - fix W:input.c(422) [input_check_file]:Implicit declaration
nenolod
parents: 2344
diff changeset
54 #include "vfs_buffered_file.h"
74bbc3e18cba [svn] - fix W:input.c(422) [input_check_file]:Implicit declaration
nenolod
parents: 2344
diff changeset
55
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
56 G_LOCK_DEFINE_STATIC(vis_mutex);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
57
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
58 struct _VisNode {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
59 gint time;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
60 gint nch;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
61 gint length; /* number of samples per channel */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
62 gint16 data[2][512];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
63 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
64
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
65 typedef struct _VisNode VisNode;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
66
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
67
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
68 InputPluginData ip_data = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
69 NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
70 NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
71 FALSE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
72 FALSE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
73 FALSE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
74 FALSE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
75 NULL
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
76 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
77
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
78 static GList *vis_list = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
79
2436
f346d30bf5ab [svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents: 2430
diff changeset
80 InputPlayback *
f346d30bf5ab [svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents: 2430
diff changeset
81 get_current_input_playback(void)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
82 {
2436
f346d30bf5ab [svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents: 2430
diff changeset
83 return ip_data.current_input_playback;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
84 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
85
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
86 void
2436
f346d30bf5ab [svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents: 2430
diff changeset
87 set_current_input_playback(InputPlayback * ip)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
88 {
2436
f346d30bf5ab [svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents: 2430
diff changeset
89 ip_data.current_input_playback = ip;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
90 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
91
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
92 GList *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
93 get_input_list(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
94 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
95 return ip_data.input_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
96 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
97
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
98 /*
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
99 * TODO: move this to utility as something like
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
100 * plugin_generate_list(GList *plugin_list, gboolean enabled_state)
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
101 *
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
102 * -nenolod
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
103 */
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
104 gchar *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
105 input_stringify_disabled_list(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
106 {
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
107 GList *node;
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
108 GString *list = g_string_new("");
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
109
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
110 MOWGLI_ITER_FOREACH(node, ip_data.input_list)
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
111 {
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
112 Plugin *plugin = (Plugin *) node->data;
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
113 gchar *filename = g_path_get_basename(plugin->filename);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
114
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
115 if (plugin->enabled)
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
116 continue;
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
117
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
118 if (list->len > 0)
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
119 g_string_append(list, ":");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
120
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
121 g_string_append(list, filename);
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
122 g_free(filename);
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
123 }
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
124
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
125 return g_string_free(list, FALSE);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
126 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
127
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
128 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
129 free_vis_data(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
130 {
3516
0970c745a497 Use GSlice for VisNode structs.
William Pitcock <nenolod@atheme.org>
parents: 3502
diff changeset
131 GList *iter;
0970c745a497 Use GSlice for VisNode structs.
William Pitcock <nenolod@atheme.org>
parents: 3502
diff changeset
132
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
133 G_LOCK(vis_mutex);
3516
0970c745a497 Use GSlice for VisNode structs.
William Pitcock <nenolod@atheme.org>
parents: 3502
diff changeset
134
0970c745a497 Use GSlice for VisNode structs.
William Pitcock <nenolod@atheme.org>
parents: 3502
diff changeset
135 MOWGLI_ITER_FOREACH(iter, vis_list)
0970c745a497 Use GSlice for VisNode structs.
William Pitcock <nenolod@atheme.org>
parents: 3502
diff changeset
136 g_slice_free(VisNode, iter->data);
0970c745a497 Use GSlice for VisNode structs.
William Pitcock <nenolod@atheme.org>
parents: 3502
diff changeset
137
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
138 g_list_free(vis_list);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
139 vis_list = NULL;
3516
0970c745a497 Use GSlice for VisNode structs.
William Pitcock <nenolod@atheme.org>
parents: 3502
diff changeset
140
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
141 G_UNLOCK(vis_mutex);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
142 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
143
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
144 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
145 convert_to_s16_ne(AFormat fmt, gpointer ptr, gint16 * left,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
146 gint16 * right, gint nch, gint max)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
147 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
148 gint16 *ptr16;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
149 guint16 *ptru16;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
150 guint8 *ptru8;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
151 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
152
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
153 switch (fmt) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
154 case FMT_U8:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
155 ptru8 = ptr;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
156 if (nch == 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
157 for (i = 0; i < max; i++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
158 left[i] = ((*ptru8++) ^ 128) << 8;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
159 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
160 for (i = 0; i < max; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
161 left[i] = ((*ptru8++) ^ 128) << 8;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
162 right[i] = ((*ptru8++) ^ 128) << 8;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
163 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
164 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
165 case FMT_S8:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
166 ptru8 = ptr;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
167 if (nch == 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
168 for (i = 0; i < max; i++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
169 left[i] = (*ptru8++) << 8;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
170 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
171 for (i = 0; i < max; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
172 left[i] = (*ptru8++) << 8;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
173 right[i] = (*ptru8++) << 8;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
174 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
175 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
176 case FMT_U16_LE:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
177 ptru16 = ptr;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
178 if (nch == 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
179 for (i = 0; i < max; i++, ptru16++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
180 left[i] = GUINT16_FROM_LE(*ptru16) ^ 32768;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
181 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
182 for (i = 0; i < max; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
183 left[i] = GUINT16_FROM_LE(*ptru16) ^ 32768;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
184 ptru16++;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
185 right[i] = GUINT16_FROM_LE(*ptru16) ^ 32768;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
186 ptru16++;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
187 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
188 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
189 case FMT_U16_BE:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
190 ptru16 = ptr;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
191 if (nch == 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
192 for (i = 0; i < max; i++, ptru16++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
193 left[i] = GUINT16_FROM_BE(*ptru16) ^ 32768;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
194 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
195 for (i = 0; i < max; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
196 left[i] = GUINT16_FROM_BE(*ptru16) ^ 32768;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
197 ptru16++;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
198 right[i] = GUINT16_FROM_BE(*ptru16) ^ 32768;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
199 ptru16++;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
200 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
201 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
202 case FMT_U16_NE:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
203 ptru16 = ptr;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
204 if (nch == 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
205 for (i = 0; i < max; i++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
206 left[i] = (*ptru16++) ^ 32768;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
207 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
208 for (i = 0; i < max; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
209 left[i] = (*ptru16++) ^ 32768;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
210 right[i] = (*ptru16++) ^ 32768;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
211 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
212 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
213 case FMT_S16_LE:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
214 ptr16 = ptr;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
215 if (nch == 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
216 for (i = 0; i < max; i++, ptr16++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
217 left[i] = GINT16_FROM_LE(*ptr16);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
218 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
219 for (i = 0; i < max; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
220 left[i] = GINT16_FROM_LE(*ptr16);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
221 ptr16++;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
222 right[i] = GINT16_FROM_LE(*ptr16);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
223 ptr16++;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
224 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
225 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
226 case FMT_S16_BE:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
227 ptr16 = ptr;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
228 if (nch == 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
229 for (i = 0; i < max; i++, ptr16++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
230 left[i] = GINT16_FROM_BE(*ptr16);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
231 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
232 for (i = 0; i < max; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
233 left[i] = GINT16_FROM_BE(*ptr16);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
234 ptr16++;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
235 right[i] = GINT16_FROM_BE(*ptr16);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
236 ptr16++;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
237 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
238 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
239 case FMT_S16_NE:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
240 ptr16 = ptr;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
241 if (nch == 1)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
242 for (i = 0; i < max; i++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
243 left[i] = (*ptr16++);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
244 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
245 for (i = 0; i < max; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
246 left[i] = (*ptr16++);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
247 right[i] = (*ptr16++);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
248 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
249 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
250 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
251 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
252
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
253 InputVisType
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
254 input_get_vis_type()
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
255 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
256 return INPUT_VIS_OFF;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
257 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
258
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
259 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
260 input_add_vis_pcm(gint time, AFormat fmt, gint nch, gint length, gpointer ptr)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
261 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
262 VisNode *vis_node;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
263 gint max;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
264
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
265 max = length / nch;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
266 if (fmt == FMT_U16_LE || fmt == FMT_U16_BE || fmt == FMT_U16_NE ||
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
267 fmt == FMT_S16_LE || fmt == FMT_S16_BE || fmt == FMT_S16_NE)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
268 max /= 2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
269 max = CLAMP(max, 0, 512);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
270
3516
0970c745a497 Use GSlice for VisNode structs.
William Pitcock <nenolod@atheme.org>
parents: 3502
diff changeset
271 vis_node = g_slice_new0(VisNode);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
272 vis_node->time = time;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
273 vis_node->nch = nch;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
274 vis_node->length = max;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
275 convert_to_s16_ne(fmt, ptr, vis_node->data[0], vis_node->data[1], nch,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
276 max);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
277
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
278 G_LOCK(vis_mutex);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
279 vis_list = g_list_append(vis_list, vis_node);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
280 G_UNLOCK(vis_mutex);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
281 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
282
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
283 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
284 input_dont_show_warning(GtkObject * object, gpointer user_data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
285 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
286 *((gboolean *) user_data) =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
287 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(object));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
288 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
289
3133
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
290 static time_t
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
291 input_get_mtime(const gchar *filename)
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
292 {
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
293 struct stat buf;
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
294 gint rv;
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
295 gchar *realfn = NULL;
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
296
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
297 /* stat() does not accept file:// --yaz */
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
298 realfn = g_filename_from_uri(filename, NULL, NULL);
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
299 rv = stat(realfn ? realfn : filename, &buf);
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
300 g_free(realfn); realfn = NULL;
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
301
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
302 if (rv == 0) {
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
303 return buf.st_mtime;
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
304 } else {
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
305 return 0; //error
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
306 }
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
307 }
25f92bfd50c4 Initialize tuple.mtime.
William Pitcock <nenolod@atheme-project.org>
parents: 3131
diff changeset
308
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
309 /*
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
310 * input_check_file()
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
311 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
312 * Inputs:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
313 * filename to check recursively against input plugins
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
314 * whether or not to show an error
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
315 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
316 * Outputs:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
317 * pointer to input plugin which can handle this file
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
318 * otherwise, NULL
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
319 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
320 * (the previous code returned a boolean of whether or not we can
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
321 * play the file... even WORSE for performance)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
322 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
323 * Side Effects:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
324 * various input plugins open the file and probe it
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
325 * -- this can have very ugly effects performance wise on streams
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
326 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
327 * --nenolod, Dec 31 2005
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
328 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
329 * Rewritten to use NewVFS probing, semantics are still basically the same.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
330 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
331 * --nenolod, Dec 5 2006
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
332 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
333 * Adapted to use the NewVFS extension probing system if enabled.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
334 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
335 * --nenolod, Dec 12 2006
3013
a5f606b01038 Use mimetype system to accelerate detection of network streams.
William Pitcock <nenolod@atheme-project.org>
parents: 2707
diff changeset
336 *
a5f606b01038 Use mimetype system to accelerate detection of network streams.
William Pitcock <nenolod@atheme-project.org>
parents: 2707
diff changeset
337 * Adapted to use the mimetype system.
a5f606b01038 Use mimetype system to accelerate detection of network streams.
William Pitcock <nenolod@atheme-project.org>
parents: 2707
diff changeset
338 *
a5f606b01038 Use mimetype system to accelerate detection of network streams.
William Pitcock <nenolod@atheme-project.org>
parents: 2707
diff changeset
339 * --nenolod, Jul 9 2007
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
340 *
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
341 * Adapted to return ProbeResult structure.
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
342 *
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
343 * --nenolod, Jul 20 2007
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
344 */
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
345 ProbeResult *
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
346 input_check_file(const gchar * filename, gboolean show_warning)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
347 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
348 VFSFile *fd;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
349 GList *node;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
350 InputPlugin *ip;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
351 gchar *filename_proxy;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
352 gint ret = 1;
2430
4e2fc64d95ef [svn] - make vfs_buffered_file_new_from_uri declaration const
nenolod
parents: 2427
diff changeset
353 gchar *ext, *tmp, *tmp_uri;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
354 gboolean use_ext_filter;
3013
a5f606b01038 Use mimetype system to accelerate detection of network streams.
William Pitcock <nenolod@atheme-project.org>
parents: 2707
diff changeset
355 gchar *mimetype;
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
356 ProbeResult *pr = NULL;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
357
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
358 filename_proxy = g_strdup(filename);
2430
4e2fc64d95ef [svn] - make vfs_buffered_file_new_from_uri declaration const
nenolod
parents: 2427
diff changeset
359
4e2fc64d95ef [svn] - make vfs_buffered_file_new_from_uri declaration const
nenolod
parents: 2427
diff changeset
360 /* Some URIs will end in ?<subsong> to determine the subsong requested. */
4e2fc64d95ef [svn] - make vfs_buffered_file_new_from_uri declaration const
nenolod
parents: 2427
diff changeset
361 tmp_uri = g_strdup(filename);
4e2fc64d95ef [svn] - make vfs_buffered_file_new_from_uri declaration const
nenolod
parents: 2427
diff changeset
362
4e2fc64d95ef [svn] - make vfs_buffered_file_new_from_uri declaration const
nenolod
parents: 2427
diff changeset
363 tmp = strrchr(tmp_uri, '?');
4e2fc64d95ef [svn] - make vfs_buffered_file_new_from_uri declaration const
nenolod
parents: 2427
diff changeset
364
3144
2812140dba3f Backed out changeset 4673533d7cc3
Cristi Magherusan <majeru@atheme-project.org>
parents: 3143
diff changeset
365 if (tmp != NULL && g_ascii_isdigit(*(tmp + 1)))
2430
4e2fc64d95ef [svn] - make vfs_buffered_file_new_from_uri declaration const
nenolod
parents: 2427
diff changeset
366 *tmp = '\0';
4e2fc64d95ef [svn] - make vfs_buffered_file_new_from_uri declaration const
nenolod
parents: 2427
diff changeset
367
3341
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
368 /* Check for plugins with custom URI:// strings */
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
369 /* cue:// cdda:// tone:// tact:// */
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
370 if ((ip = uri_get_plugin(filename)) != NULL && ip->enabled)
3341
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
371 {
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
372 if (ip->is_our_file != NULL)
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
373 ret = ip->is_our_file(filename_proxy);
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
374 else
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
375 ret = 0;
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
376 if (ret > 0)
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
377 {
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
378 g_free(filename_proxy);
3517
b747ad540903 proberesult = use g_new0() for now still
William Pitcock <nenolod@atheme.org>
parents: 3516
diff changeset
379 pr = g_new0(ProbeResult, 1);
3341
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
380 pr->ip = ip;
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
381 return pr;
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
382 }
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
383 g_free(filename_proxy);
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
384 return NULL;
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
385 }
3da640de0e99 Check for registered URI://s defined by uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents: 3334
diff changeset
386
2430
4e2fc64d95ef [svn] - make vfs_buffered_file_new_from_uri declaration const
nenolod
parents: 2427
diff changeset
387 fd = vfs_buffered_file_new_from_uri(tmp_uri);
4e2fc64d95ef [svn] - make vfs_buffered_file_new_from_uri declaration const
nenolod
parents: 2427
diff changeset
388 g_free(tmp_uri);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
389
3110
35e560fa183f Added a fd NULL check to avoid probing on none-existing fds
Christian Birchinger <joker@netswarm.net>
parents: 3081
diff changeset
390 if (!fd) {
3125
ed6c6aa50c7c Fixing typo
Christian Birchinger <joker@netswarm.net>
parents: 3123
diff changeset
391 printf("Unable to read from %s, giving up.\n", filename_proxy);
3110
35e560fa183f Added a fd NULL check to avoid probing on none-existing fds
Christian Birchinger <joker@netswarm.net>
parents: 3081
diff changeset
392 g_free(filename_proxy);
35e560fa183f Added a fd NULL check to avoid probing on none-existing fds
Christian Birchinger <joker@netswarm.net>
parents: 3081
diff changeset
393 return NULL;
35e560fa183f Added a fd NULL check to avoid probing on none-existing fds
Christian Birchinger <joker@netswarm.net>
parents: 3081
diff changeset
394 }
35e560fa183f Added a fd NULL check to avoid probing on none-existing fds
Christian Birchinger <joker@netswarm.net>
parents: 3081
diff changeset
395
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
396 ext = strrchr(filename_proxy, '.') + 1;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
397
2569
b3ca1bfcae6c [svn] - Spring clean (removed one function)
mf0102
parents: 2557
diff changeset
398 use_ext_filter =
b3ca1bfcae6c [svn] - Spring clean (removed one function)
mf0102
parents: 2557
diff changeset
399 (fd != NULL && (!g_strncasecmp(filename, "/", 1) ||
b3ca1bfcae6c [svn] - Spring clean (removed one function)
mf0102
parents: 2557
diff changeset
400 !g_strncasecmp(filename, "file://", 7))) ? TRUE : FALSE;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
401
3013
a5f606b01038 Use mimetype system to accelerate detection of network streams.
William Pitcock <nenolod@atheme-project.org>
parents: 2707
diff changeset
402 mimetype = vfs_get_metadata(fd, "content-type");
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
403 if ((ip = mime_get_plugin(mimetype)) != NULL && ip->enabled)
3013
a5f606b01038 Use mimetype system to accelerate detection of network streams.
William Pitcock <nenolod@atheme-project.org>
parents: 2707
diff changeset
404 {
3198
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
405 if (ip->probe_for_tuple != NULL)
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
406 {
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
407 Tuple *tuple = ip->probe_for_tuple(filename_proxy, fd);
3198
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
408
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
409 if (tuple != NULL)
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
410 {
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
411 g_free(filename_proxy);
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
412 vfs_fclose(fd);
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
413
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
414 pr = g_new0(ProbeResult, 1);
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
415 pr->ip = ip;
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
416 pr->tuple = tuple;
3490
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3343
diff changeset
417 tuple_associate_int(pr->tuple, FIELD_MTIME, NULL, input_get_mtime(filename_proxy));
3198
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
418
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
419 return pr;
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
420 }
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
421 }
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
422 else if (fd && ip->is_our_file_from_vfs != NULL)
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
423 {
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
424 ret = ip->is_our_file_from_vfs(filename_proxy, fd);
3128
343504d43afc Fix warnings.
William Pitcock <nenolod@atheme-project.org>
parents: 3127
diff changeset
425
3198
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
426 if (ret > 0)
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
427 {
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
428 g_free(filename_proxy);
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
429 vfs_fclose(fd);
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
430
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
431 pr = g_new0(ProbeResult, 1);
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
432 pr->ip = ip;
3128
343504d43afc Fix warnings.
William Pitcock <nenolod@atheme-project.org>
parents: 3127
diff changeset
433
3198
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
434 return pr;
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
435 }
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
436 }
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
437 else if (ip->is_our_file != NULL)
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
438 {
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
439 ret = ip->is_our_file(filename_proxy);
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
440
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
441 if (ret > 0)
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
442 {
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
443 g_free(filename_proxy);
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
444 vfs_fclose(fd);
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
445
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
446 pr = g_new0(ProbeResult, 1);
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
447 pr->ip = ip;
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
448
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
449 return pr;
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
450 }
7628b2b7a688 Don't explicitly trust the mimetype, still do a probe.
William Pitcock <nenolod@atheme-project.org>
parents: 3171
diff changeset
451 }
3013
a5f606b01038 Use mimetype system to accelerate detection of network streams.
William Pitcock <nenolod@atheme-project.org>
parents: 2707
diff changeset
452 }
a5f606b01038 Use mimetype system to accelerate detection of network streams.
William Pitcock <nenolod@atheme-project.org>
parents: 2707
diff changeset
453
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
454 for (node = get_input_list(); node != NULL; node = g_list_next(node))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
455 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
456 ip = INPUT_PLUGIN(node->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
457
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
458 if (!ip || !ip->enabled)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
459 continue;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
460
2342
f140d0a27093 [svn] - use vfs_rewind() instead of vfs_fseek(fd, 0, seek_set) which was wrong
nenolod
parents: 2331
diff changeset
461 vfs_rewind(fd);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
462
2569
b3ca1bfcae6c [svn] - Spring clean (removed one function)
mf0102
parents: 2557
diff changeset
463 if (cfg.use_extension_probing == TRUE && ip->vfs_extensions != NULL &&
b3ca1bfcae6c [svn] - Spring clean (removed one function)
mf0102
parents: 2557
diff changeset
464 ext != NULL && ext != (gpointer) 0x1 && use_ext_filter == TRUE)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
465 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
466 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
467 gboolean is_our_ext = FALSE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
468
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
469 for (i = 0; ip->vfs_extensions[i] != NULL; i++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
470 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
471 if (str_has_prefix_nocase(ext, ip->vfs_extensions[i]))
2331
d7ccaa59630f [svn] Wiped out some error messages
mf0102
parents: 2313
diff changeset
472 {
d7ccaa59630f [svn] Wiped out some error messages
mf0102
parents: 2313
diff changeset
473 is_our_ext = TRUE;
d7ccaa59630f [svn] Wiped out some error messages
mf0102
parents: 2313
diff changeset
474 break;
d7ccaa59630f [svn] Wiped out some error messages
mf0102
parents: 2313
diff changeset
475 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
476 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
477
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
478 /* not a plugin that supports this extension */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
479 if (is_our_ext == FALSE)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
480 continue;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
481 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
482
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
483 if (fd && ip->probe_for_tuple != NULL)
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
484 {
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
485 Tuple *tuple = ip->probe_for_tuple(filename_proxy, fd);
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
486
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
487 if (tuple != NULL)
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
488 {
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
489 g_free(filename_proxy);
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
490 vfs_fclose(fd);
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
491
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
492 pr = g_new0(ProbeResult, 1);
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
493 pr->ip = ip;
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
494 pr->tuple = tuple;
3490
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3343
diff changeset
495 tuple_associate_int(pr->tuple, FIELD_MTIME, NULL, input_get_mtime(filename_proxy));
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
496
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
497 return pr;
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
498 }
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
499 }
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
500 else if (fd && ip->is_our_file_from_vfs != NULL)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
501 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
502 ret = ip->is_our_file_from_vfs(filename_proxy, fd);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
503
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
504 if (ret > 0)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
505 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
506 g_free(filename_proxy);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
507 vfs_fclose(fd);
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
508
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
509 pr = g_new0(ProbeResult, 1);
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
510 pr->ip = ip;
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
511
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
512 return pr;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
513 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
514 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
515 else if (ip->is_our_file != NULL)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
516 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
517 ret = ip->is_our_file(filename_proxy);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
518
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
519 if (ret > 0)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
520 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
521 g_free(filename_proxy);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
522 vfs_fclose(fd);
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
523
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
524 pr = g_new0(ProbeResult, 1);
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
525 pr->ip = ip;
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
526
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
527 return pr;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
528 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
529 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
530
2331
d7ccaa59630f [svn] Wiped out some error messages
mf0102
parents: 2313
diff changeset
531 if (ret <= -1)
d7ccaa59630f [svn] Wiped out some error messages
mf0102
parents: 2313
diff changeset
532 break;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
533 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
534
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
535 g_free(filename_proxy);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
536
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
537 vfs_fclose(fd);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
538
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
539 return NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
540 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
541
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
542
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
543 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
544 input_set_eq(gint on, gfloat preamp, gfloat * bands)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
545 {
3170
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
546 InputPlayback *playback;
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
547
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
548 if (!ip_data.playing)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
549 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
550
3170
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
551 if ((playback = get_current_input_playback()) == NULL)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
552 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
553
3170
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
554 if (playback->plugin->set_eq)
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
555 playback->plugin->set_eq(on, preamp, bands);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
556 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
557
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
558
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
559 Tuple *
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
560 input_get_song_tuple(const gchar * filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
561 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
562 InputPlugin *ip = NULL;
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
563 Tuple *input;
2394
e2aaa7dca389 [svn] - tuple->file_name coming from input plugins have a string with filename + extension, but tuple->file_name coming from input plugins without a get_song_tuple have a string with filename without extension; fix this incongruency, always pass tuple->filename with a string containing filename + extension
giacomo
parents: 2373
diff changeset
564 gchar *ext = NULL;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
565 gchar *filename_proxy;
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
566 ProbeResult *pr;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
567
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
568 if (filename == NULL)
2331
d7ccaa59630f [svn] Wiped out some error messages
mf0102
parents: 2313
diff changeset
569 return NULL;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
570
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
571 filename_proxy = g_strdup(filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
572
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
573 pr = input_check_file(filename_proxy, FALSE);
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
574
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
575 if (!pr)
3128
343504d43afc Fix warnings.
William Pitcock <nenolod@atheme-project.org>
parents: 3127
diff changeset
576 return NULL;
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
577
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
578 ip = pr->ip;
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
579
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
580 g_free(pr);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
581
2331
d7ccaa59630f [svn] Wiped out some error messages
mf0102
parents: 2313
diff changeset
582 if (ip && ip->get_song_tuple)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
583 input = ip->get_song_tuple(filename_proxy);
2331
d7ccaa59630f [svn] Wiped out some error messages
mf0102
parents: 2313
diff changeset
584 else
d7ccaa59630f [svn] Wiped out some error messages
mf0102
parents: 2313
diff changeset
585 {
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
586 gchar *tmp;
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
587
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
588 input = tuple_new();
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
589
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
590 tmp = g_strdup(filename);
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
591 if ((ext = strrchr(tmp, '.')))
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
592 *ext = '\0';
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
593
3490
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3343
diff changeset
594 tuple_associate_string(input, FIELD_FILE_NAME, NULL, g_path_get_basename(tmp));
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
595
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
596 if (ext)
3490
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3343
diff changeset
597 tuple_associate_string(input, FIELD_FILE_EXT, NULL, ext + 1);
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
598
3490
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3343
diff changeset
599 tuple_associate_string(input, FIELD_FILE_PATH, NULL, g_path_get_dirname(tmp));
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3343
diff changeset
600 tuple_associate_int(input, FIELD_LENGTH, NULL, -1);
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
601
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3251
diff changeset
602 g_free(tmp);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
603 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
604
2569
b3ca1bfcae6c [svn] - Spring clean (removed one function)
mf0102
parents: 2557
diff changeset
605 g_free(filename_proxy);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
606 return input;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
607 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
608
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
609 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
610 input_general_file_info_box(const gchar * filename, InputPlugin * ip)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
611 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
612 GtkWidget *window, *vbox;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
613 GtkWidget *label, *filename_hbox, *filename_entry;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
614 GtkWidget *bbox, *cancel;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
615
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
616 gchar *title, *fileinfo, *basename, *iplugin;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
617 gchar *filename_utf8;
3081
ba2143c1c6f5 unescape url encoded filename where real filename is needed.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3072
diff changeset
618 gchar *realfn = NULL;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
619
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
620 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
621 gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
622 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
623
3081
ba2143c1c6f5 unescape url encoded filename where real filename is needed.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3072
diff changeset
624 realfn = g_filename_from_uri(filename, NULL, NULL);
ba2143c1c6f5 unescape url encoded filename where real filename is needed.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3072
diff changeset
625 basename = g_path_get_basename(realfn ? realfn : filename);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
626 fileinfo = filename_to_utf8(basename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
627 title = g_strdup_printf(_("audacious: %s"), fileinfo);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
628
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
629 gtk_window_set_title(GTK_WINDOW(window), title);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
630
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
631 g_free(title);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
632 g_free(fileinfo);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
633 g_free(basename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
634
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
635 gtk_container_set_border_width(GTK_CONTAINER(window), 10);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
636
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
637 vbox = gtk_vbox_new(FALSE, 10);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
638 gtk_container_add(GTK_CONTAINER(window), vbox);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
639
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
640 filename_hbox = gtk_hbox_new(FALSE, 5);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
641 gtk_box_pack_start(GTK_BOX(vbox), filename_hbox, FALSE, TRUE, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
642
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
643 label = gtk_label_new(_("Filename:"));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
644 gtk_box_pack_start(GTK_BOX(filename_hbox), label, FALSE, TRUE, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
645
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
646 filename_entry = gtk_entry_new();
3081
ba2143c1c6f5 unescape url encoded filename where real filename is needed.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3072
diff changeset
647 filename_utf8 = filename_to_utf8(realfn ? realfn : filename);
ba2143c1c6f5 unescape url encoded filename where real filename is needed.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3072
diff changeset
648 g_free(realfn); realfn = NULL;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
649
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
650 gtk_entry_set_text(GTK_ENTRY(filename_entry), filename_utf8);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
651 gtk_editable_set_editable(GTK_EDITABLE(filename_entry), FALSE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
652 gtk_box_pack_start(GTK_BOX(filename_hbox), filename_entry, TRUE, TRUE, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
653
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
654 g_free(filename_utf8);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
655
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
656 if (ip)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
657 if (ip->description)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
658 iplugin = ip->description;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
659 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
660 iplugin = ip->filename;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
661 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
662 iplugin = _("No input plugin recognized this file");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
663
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
664 title = g_strdup_printf(_("Input plugin: %s"), iplugin);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
665
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
666 label = gtk_label_new(title);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
667 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
668 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
669 g_free(title);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
670 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
671
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
672 bbox = gtk_hbutton_box_new();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
673 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
674 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
675
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
676 cancel = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
677 g_signal_connect_swapped(G_OBJECT(cancel), "clicked",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
678 GTK_SIGNAL_FUNC(gtk_widget_destroy),
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
679 GTK_OBJECT(window));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
680 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
681 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
682
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
683 gtk_widget_show_all(window);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
684 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
685
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
686 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
687 input_file_info_box(const gchar * filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
688 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
689 InputPlugin *ip;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
690 gchar *filename_proxy;
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
691 ProbeResult *pr;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
692
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
693 filename_proxy = g_strdup(filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
694
3127
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
695 pr = input_check_file(filename_proxy, FALSE);
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
696
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
697 if (!pr)
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
698 return;
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
699
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
700 ip = pr->ip;
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
701
c92070f10148 Use ProbeResult (try 1)
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
702 g_free(pr);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
703
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
704 if (ip->file_info_box)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
705 ip->file_info_box(filename_proxy);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
706 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
707 input_general_file_info_box(filename, ip);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
708
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
709 input_general_file_info_box(filename, NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
710 g_free(filename_proxy);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
711 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
712
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
713 GList *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
714 input_scan_dir(const gchar * path)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
715 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
716 GList *node, *result = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
717 InputPlugin *ip;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
718 gchar *path_proxy;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
719
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
720 g_return_val_if_fail(path != NULL, NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
721
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
722 if (*path == '/')
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
723 while (path[1] == '/')
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
724 path++;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
725
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
726 path_proxy = g_strdup(path);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
727
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
728 for (node = get_input_list(); node; node = g_list_next(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
729 ip = INPUT_PLUGIN(node->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
730
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
731 if (!ip)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
732 continue;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
733
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
734 if (!ip->scan_dir)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
735 continue;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
736
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3416
diff changeset
737 if (!ip->enabled)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
738 continue;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
739
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
740 if ((result = ip->scan_dir(path_proxy)))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
741 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
742 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
743
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
744 g_free(path_proxy);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
745
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
746 return result;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
747 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
748
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
749 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
750 input_get_volume(gint * l, gint * r)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
751 {
3170
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
752 InputPlayback *playback;
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
753
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
754 *l = -1;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
755 *r = -1;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
756 if (playback_get_playing()) {
3170
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
757 if ((playback = get_current_input_playback()) != NULL &&
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
758 playback->plugin->get_volume &&
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
759 playback->plugin->get_volume(l, r))
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
760 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
761 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
762 output_get_volume(l, r);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
763 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
764
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
765 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
766 input_set_volume(gint l, gint r)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
767 {
3170
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
768 InputPlayback *playback;
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
769
2505
87c53f0e9e0d [svn] - added set volume hook
giacomo
parents: 2439
diff changeset
770 gint h_vol[2];
3170
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
771
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
772 h_vol[0] = l;
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
773 h_vol[1] = r;
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
774 hook_call("volume set", h_vol);
2505
87c53f0e9e0d [svn] - added set volume hook
giacomo
parents: 2439
diff changeset
775
2569
b3ca1bfcae6c [svn] - Spring clean (removed one function)
mf0102
parents: 2557
diff changeset
776 if (playback_get_playing() &&
3170
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
777 (playback = get_current_input_playback()) != NULL &&
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
778 playback->plugin->set_volume &&
603577228518 get_current_input_playback() cleanups.
William Pitcock <nenolod@atheme-project.org>
parents: 3166
diff changeset
779 playback->plugin->set_volume(l, r))
2569
b3ca1bfcae6c [svn] - Spring clean (removed one function)
mf0102
parents: 2557
diff changeset
780 return;
b3ca1bfcae6c [svn] - Spring clean (removed one function)
mf0102
parents: 2557
diff changeset
781
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
782 output_set_volume(l, r);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
783 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
784
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
785 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
786 input_update_vis(gint time)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
787 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
788 GList *node;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
789 VisNode *vis = NULL, *visnext = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
790 gboolean found = FALSE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
791
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
792 G_LOCK(vis_mutex);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
793 node = vis_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
794 while (g_list_next(node) && !found) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
795 visnext = g_list_next(node)->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
796 vis = node->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
797
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
798 if (vis->time >= time)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
799 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
800
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
801 vis_list = g_list_delete_link(vis_list, node);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
802
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
803 if (visnext->time >= time) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
804 found = TRUE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
805 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
806 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
807 g_free(vis);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
808 node = vis_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
809 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
810 G_UNLOCK(vis_mutex);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
811
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
812 if (found) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
813 vis_send_data(vis->data, vis->nch, vis->length);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
814 g_free(vis);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
815 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
816 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
817 vis_send_data(NULL, 0, 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
818 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
819
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents: 3145
diff changeset
820 /* FIXME: move this somewhere else */
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents: 3145
diff changeset
821 void
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents: 3145
diff changeset
822 input_set_info_text(gchar *text)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
823 {
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents: 3145
diff changeset
824 gchar *title = g_strdup(text);
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents: 3145
diff changeset
825 event_queue("title change", title);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
826 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
827
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
828 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
829 input_set_status_buffering(gboolean status)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
830 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
831 if (!playback_get_playing())
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
832 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
833
2436
f346d30bf5ab [svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents: 2430
diff changeset
834 if (!get_current_input_playback())
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
835 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
836
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
837 ip_data.buffering = status;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
838
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
839 g_return_if_fail(mainwin_playstatus != NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
840
3072
84de3244aeaa replace Playstatus with UiSkinnedPlaystatus
Tomasz Mon <desowin@gmail.com>
parents: 3013
diff changeset
841 if (ip_data.buffering == TRUE && mainwin_playstatus != NULL && UI_SKINNED_PLAYSTATUS(mainwin_playstatus)->status == STATUS_STOP)
84de3244aeaa replace Playstatus with UiSkinnedPlaystatus
Tomasz Mon <desowin@gmail.com>
parents: 3013
diff changeset
842 UI_SKINNED_PLAYSTATUS(mainwin_playstatus)->status = STATUS_PLAY;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
843
3072
84de3244aeaa replace Playstatus with UiSkinnedPlaystatus
Tomasz Mon <desowin@gmail.com>
parents: 3013
diff changeset
844 ui_skinned_playstatus_set_buffering(mainwin_playstatus, ip_data.buffering);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
845 }