Mercurial > audlegacy-plugins
annotate src/adplug/adplug-xmms.cc @ 1881:8bdede3414cd
Optimize dependency generation.
author | Jonathan Schleifer <js@h3c.de> |
---|---|
date | Wed, 26 Sep 2007 06:38:56 +0200 |
parents | 52d162b0dbd4 |
children | 2ebeb7816c5e |
rev | line source |
---|---|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1 /* |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
2 AdPlug/XMMS - AdPlug XMMS Plugin |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
3 Copyright (C) 2002, 2003 Simon Peter <dn.tlp@gmx.net> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
4 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
5 AdPlug/XMMS is free software; you can redistribute it and/or |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
9 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
10 This plugin is distributed in the hope that it will be useful, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
13 Lesser General Public License for more details. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
14 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
16 License along with this plugin; if not, write to the Free Software |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
18 */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
19 |
1876 | 20 #include "config.h" |
528 | 21 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
22 #include <algorithm> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
23 #include <sstream> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
24 #include <stdlib.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
25 #include <stdio.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
26 #include <sys/types.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
27 #include <gtk/gtk.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
28 #include "adplug.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
29 #include "emuopl.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
30 #include "silentopl.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
31 #include "players.h" |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
32 #include "audacious/i18n.h" |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
33 extern "C" |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
34 { |
1876 | 35 #include "audacious/plugin.h" |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
36 #include "audacious/configdb.h" |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
37 #include "audacious/output.h" |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
38 #include "audacious/util.h" |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
39 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
40 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
41 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
42 /***** Defines *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
43 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
44 // Version string |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
45 #define ADPLUG_NAME "AdPlug (AdLib Sound Player)" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
46 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
47 // Sound buffer size in samples |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
48 #define SNDBUFSIZE 512 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
49 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
50 // AdPlug's 8 and 16 bit audio formats |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
51 #define FORMAT_8 FMT_U8 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
52 #define FORMAT_16 FMT_S16_NE |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
53 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
54 // Default file name of AdPlug's database file |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
55 #define ADPLUGDB_FILE "adplug.db" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
56 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
57 // Default AdPlug user's configuration subdirectory |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
58 #define ADPLUG_CONFDIR ".adplug" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
59 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
60 /***** Global variables *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
61 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
62 extern "C" InputPlugin adplug_ip; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
63 static gboolean audio_error = FALSE; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
64 GtkWidget *about_win = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
65 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
66 // Configuration (and defaults) |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
67 static struct |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
68 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
69 gint freq; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
70 gboolean bit16, stereo, endless; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
71 CPlayers players; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
72 } cfg = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
73 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
74 44100l, true, false, false, CAdPlug::players}; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
75 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
76 // Player variables |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
77 static struct |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
78 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
79 CPlayer *p; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
80 CAdPlugDatabase *db; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
81 unsigned int subsong, songlength; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
82 int seek; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
83 char filename[PATH_MAX]; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
84 char *songtitle; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
85 float time_ms; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
86 bool playing; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
87 GThread *play_thread; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
88 GtkLabel *infobox; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
89 GtkDialog *infodlg; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
90 } plr = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
91 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
92 0, 0, 0, 0, -1, "", NULL, 0.0f, false, 0, NULL, NULL}; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
93 |
559 | 94 static InputPlayback *playback; |
95 | |
703 | 96 // XXX: this function is not in the public API yet. |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
97 extern "C" VFSFile * vfs_buffered_file_new_from_uri (gchar * uri); |
703 | 98 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
99 /***** Debugging *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
100 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
101 #ifdef DEBUG |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
102 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
103 #include <stdarg.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
104 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
105 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
106 dbg_printf (const char *fmt, ...) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
107 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
108 va_list argptr; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
109 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
110 va_start (argptr, fmt); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
111 vfprintf (stderr, fmt, argptr); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
112 va_end (argptr); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
113 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
114 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
115 #else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
116 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
117 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
118 dbg_printf (const char *fmt, ...) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
119 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
120 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
121 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
122 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
123 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
124 /***** [Dialog]: Utility functions *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
125 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
126 static GtkWidget * |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
127 make_framed (GtkWidget * what, const gchar * label) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
128 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
129 GtkWidget *framebox = gtk_frame_new (label); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
130 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
131 gtk_container_add (GTK_CONTAINER (framebox), what); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
132 return framebox; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
133 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
134 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
135 static GtkWidget * |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
136 print_left (const gchar * text) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
137 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
138 GtkLabel *label = GTK_LABEL (gtk_label_new (text)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
139 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
140 gtk_label_set_justify (label, GTK_JUSTIFY_LEFT); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
141 gtk_misc_set_padding (GTK_MISC (label), 2, 2); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
142 return GTK_WIDGET (label); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
143 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
144 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
145 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
146 MessageBox (const char *title, const char *text, const char *button) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
147 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
148 char *tmptitle = (char *) malloc (strlen (title) + 1), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
149 *tmptxt = (char *) malloc (strlen (text) + 1), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
150 *tmpbutton = (char *) malloc (strlen (button) + 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
151 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
152 strcpy (tmptitle, title); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
153 strcpy (tmptxt, text); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
154 strcpy (tmpbutton, button); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
155 |
1677
f6f5603a0954
xmms_show_message() changed to audacious_info_dialog()
Matti Hamalainen <ccr@tnsp.org>
parents:
1676
diff
changeset
|
156 GtkWidget *msgbox = audacious_info_dialog (tmptitle, tmptxt, tmpbutton, FALSE, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
157 G_CALLBACK (gtk_widget_destroyed), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
158 &msgbox); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
159 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
160 free (tmptitle); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
161 free (tmptxt); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
162 free (tmpbutton); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
163 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
164 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
165 /***** Dialog boxes *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
166 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
167 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
168 adplug_about (void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
169 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
170 if (!about_win) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
171 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
172 gchar *about_title = g_strjoin ("", _("About "), ADPLUG_NAME, NULL); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
173 const gchar *version_text = CAdPlug::get_version ().c_str (); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
174 gchar *about_text = g_strjoin ("", ADPLUG_NAME, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
175 _ |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
176 ("\nCopyright (C) 2002, 2003 Simon Peter <dn.tlp@gmx.net>\n\n" |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
177 "This plugin is released under the terms and conditions of the GNU LGPL.\n" |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
178 "See http://www.gnu.org/licenses/lgpl.html for details." |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
179 "\n\nThis plugin uses the AdPlug library, which is copyright (C) Simon Peter, et al.\n" |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
180 "Linked AdPlug library version: "), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
181 version_text, NULL); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
182 about_win = |
1677
f6f5603a0954
xmms_show_message() changed to audacious_info_dialog()
Matti Hamalainen <ccr@tnsp.org>
parents:
1676
diff
changeset
|
183 audacious_info_dialog (about_title, about_text, _("Ok"), FALSE, NULL, NULL); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
184 g_signal_connect (G_OBJECT (about_win), "destroy", |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
185 G_CALLBACK (gtk_widget_destroyed), &about_win); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
186 g_free (about_text); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
187 g_free (about_title); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
188 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
189 gtk_widget_show (about_win); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
190 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
191 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
192 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
193 close_config_box_ok (GtkButton * button, GPtrArray * rblist) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
194 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
195 // Apply configuration settings |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
196 cfg.bit16 = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
197 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
198 (g_ptr_array_index (rblist, 0))); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
199 cfg.stereo = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
200 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
201 (g_ptr_array_index (rblist, 1))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
202 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
203 if (gtk_toggle_button_get_active |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
204 (GTK_TOGGLE_BUTTON (g_ptr_array_index (rblist, 2)))) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
205 cfg.freq = 11025; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
206 if (gtk_toggle_button_get_active |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
207 (GTK_TOGGLE_BUTTON (g_ptr_array_index (rblist, 3)))) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
208 cfg.freq = 22050; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
209 if (gtk_toggle_button_get_active |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
210 (GTK_TOGGLE_BUTTON (g_ptr_array_index (rblist, 4)))) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
211 cfg.freq = 44100; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
212 if (gtk_toggle_button_get_active |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
213 (GTK_TOGGLE_BUTTON (g_ptr_array_index (rblist, 5)))) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
214 cfg.freq = 48000; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
215 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
216 cfg.endless = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
217 !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
218 (g_ptr_array_index (rblist, 6))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
219 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
220 cfg.players = *(CPlayers *) g_ptr_array_index (rblist, 7); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
221 delete (CPlayers *) g_ptr_array_index (rblist, 7); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
222 |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
223 g_ptr_array_free (rblist, FALSE); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
224 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
225 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
226 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
227 close_config_box_cancel (GtkButton * button, GPtrArray * rblist) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
228 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
229 delete (CPlayers *) g_ptr_array_index (rblist, 7); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
230 g_ptr_array_free (rblist, FALSE); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
231 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
232 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
233 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
234 config_fl_row_select (GtkCList * fl, gint row, gint col, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
235 GdkEventButton * event, CPlayers * pl) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
236 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
237 pl->push_back ((CPlayerDesc *) gtk_clist_get_row_data (fl, row)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
238 pl->unique (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
239 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
240 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
241 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
242 config_fl_row_unselect (GtkCList * fl, gint row, gint col, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
243 GdkEventButton * event, CPlayers * pl) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
244 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
245 pl->remove ((CPlayerDesc *) gtk_clist_get_row_data (fl, row)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
246 } |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
247 |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
248 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
249 adplug_config (void) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
250 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
251 GtkDialog *config_dlg = GTK_DIALOG (gtk_dialog_new ()); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
252 GtkNotebook *notebook = GTK_NOTEBOOK (gtk_notebook_new ()); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
253 GtkTable *table; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
254 GtkTooltips *tooltips = gtk_tooltips_new (); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
255 GPtrArray *rblist = g_ptr_array_new (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
256 |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
257 gtk_window_set_title (GTK_WINDOW (config_dlg), _("AdPlug :: Configuration")); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
258 gtk_window_set_policy (GTK_WINDOW (config_dlg), FALSE, FALSE, TRUE); // Window is auto sized |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
259 gtk_window_set_modal (GTK_WINDOW (config_dlg), TRUE); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
260 gtk_container_add (GTK_CONTAINER (config_dlg->vbox), GTK_WIDGET (notebook)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
261 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
262 // Add Ok & Cancel buttons |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
263 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
264 GtkWidget *button; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
265 |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
266 button = gtk_button_new_with_label (_("Ok")); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
267 g_signal_connect (G_OBJECT (button), "clicked", |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
268 G_CALLBACK (close_config_box_ok), (gpointer) rblist); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
269 g_signal_connect_data (G_OBJECT (button), "clicked", |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
270 G_CALLBACK (gtk_widget_destroy), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
271 GTK_OBJECT (config_dlg), NULL, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
272 (GConnectFlags) (G_CONNECT_AFTER | |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
273 G_CONNECT_SWAPPED)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
274 gtk_container_add (GTK_CONTAINER (config_dlg->action_area), button); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
275 |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
276 button = gtk_button_new_with_label (_("Cancel")); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
277 g_signal_connect (G_OBJECT (button), "clicked", |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
278 G_CALLBACK (close_config_box_cancel), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
279 (gpointer) rblist); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
280 g_signal_connect_swapped (G_OBJECT (button), "clicked", |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
281 G_CALLBACK (gtk_widget_destroy), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
282 GTK_OBJECT (config_dlg)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
283 gtk_container_add (GTK_CONTAINER (config_dlg->action_area), button); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
284 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
285 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
286 /***** Page 1: General *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
287 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
288 table = GTK_TABLE (gtk_table_new (1, 2, TRUE)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
289 gtk_table_set_row_spacings (table, 5); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
290 gtk_table_set_col_spacings (table, 5); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
291 gtk_notebook_append_page (notebook, GTK_WIDGET (table), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
292 print_left (_("General"))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
293 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
294 // Add "Sound quality" section |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
295 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
296 GtkTable *sqt = GTK_TABLE (gtk_table_new (2, 2, FALSE)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
297 GtkVBox *fvb; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
298 GtkRadioButton *rb; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
299 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
300 gtk_table_set_row_spacings (sqt, 5); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
301 gtk_table_set_col_spacings (sqt, 5); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
302 gtk_table_attach_defaults (table, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
303 make_framed (GTK_WIDGET (sqt), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
304 _("Sound quality")), 0, 1, 0, 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
305 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
306 // Add "Resolution" section |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
307 fvb = GTK_VBOX (gtk_vbox_new (TRUE, 0)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
308 gtk_table_attach_defaults (sqt, |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
309 make_framed (GTK_WIDGET (fvb), _("Resolution")), |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
310 0, 1, 0, 1); |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
311 rb = GTK_RADIO_BUTTON (gtk_radio_button_new_with_label (NULL, _("8bit"))); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
312 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), !cfg.bit16); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
313 gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
314 rb = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
315 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
316 (rb, _("16bit"))); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
317 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), cfg.bit16); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
318 gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
319 g_ptr_array_add (rblist, (gpointer) rb); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
320 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
321 // Add "Channels" section |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
322 fvb = GTK_VBOX (gtk_vbox_new (TRUE, 0)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
323 gtk_table_attach_defaults (sqt, |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
324 make_framed (GTK_WIDGET (fvb), _("Channels")), 0, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
325 1, 1, 2); |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
326 rb = GTK_RADIO_BUTTON (gtk_radio_button_new_with_label (NULL, _("Mono"))); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
327 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), !cfg.stereo); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
328 gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
329 rb = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
330 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
331 (rb, _("Stereo"))); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
332 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), cfg.stereo); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
333 gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
334 gtk_tooltips_set_tip (tooltips, GTK_WIDGET (rb), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
335 _("Setting stereo is not recommended, unless you need to. " |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
336 "This won't add any stereo effects to the sound - OPL2 " |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
337 "is just mono - but eats up more CPU power!"), NULL); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
338 g_ptr_array_add (rblist, (gpointer) rb); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
339 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
340 // Add "Frequency" section |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
341 fvb = GTK_VBOX (gtk_vbox_new (TRUE, 0)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
342 gtk_table_attach_defaults (sqt, |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
343 make_framed (GTK_WIDGET (fvb), _("Frequency")), 1, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
344 2, 0, 2); |
1529 | 345 rb = GTK_RADIO_BUTTON (gtk_radio_button_new_with_label (NULL, "11025")); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
346 if (cfg.freq == 11025) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
347 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), TRUE); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
348 gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
349 g_ptr_array_add (rblist, (gpointer) rb); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
350 rb = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
351 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget |
1529 | 352 (rb, "22050")); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
353 if (cfg.freq == 22050) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
354 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), TRUE); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
355 gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
356 g_ptr_array_add (rblist, (gpointer) rb); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
357 rb = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
358 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget |
1529 | 359 (rb, "44100")); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
360 if (cfg.freq == 44100) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
361 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), TRUE); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
362 gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
363 g_ptr_array_add (rblist, (gpointer) rb); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
364 rb = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
365 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget |
1529 | 366 (rb, "48000")); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
367 if (cfg.freq == 48000) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
368 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), TRUE); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
369 gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
370 g_ptr_array_add (rblist, (gpointer) rb); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
371 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
372 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
373 // Add "Playback" section |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
374 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
375 GtkVBox *vb = GTK_VBOX (gtk_vbox_new (FALSE, 0)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
376 GtkCheckButton *cb; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
377 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
378 gtk_table_attach_defaults (table, |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
379 make_framed (GTK_WIDGET (vb), _("Playback")), 1, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
380 2, 0, 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
381 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
382 cb = |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
383 GTK_CHECK_BUTTON (gtk_check_button_new_with_label (_("Detect songend"))); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
384 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), !cfg.endless); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
385 gtk_container_add (GTK_CONTAINER (vb), GTK_WIDGET (cb)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
386 gtk_tooltips_set_tip (tooltips, GTK_WIDGET (cb), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
387 _("If enabled, XMMS will detect a song's ending, stop " |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
388 "it and advance in the playlist. If disabled, XMMS " |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
389 "won't take notice of a song's ending and loop it all " |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
390 "over again and again."), NULL); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
391 g_ptr_array_add (rblist, (gpointer) cb); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
392 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
393 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
394 /***** Page 2: Formats *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
395 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
396 table = GTK_TABLE (gtk_table_new (1, 1, TRUE)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
397 gtk_notebook_append_page (notebook, GTK_WIDGET (table), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
398 print_left (_("Formats"))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
399 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
400 // Add "Format selection" section |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
401 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
402 GtkHBox *vb = GTK_HBOX (gtk_hbox_new (FALSE, 0)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
403 gtk_table_attach_defaults (table, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
404 make_framed (GTK_WIDGET (vb), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
405 _("Format selection")), 0, 1, 0, 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
406 // Add scrollable list |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
407 { |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
408 const gchar *rowstr[] = { _("Format"), _("Extension") }; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
409 GtkEventBox *eventbox = GTK_EVENT_BOX (gtk_event_box_new ()); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
410 GtkScrolledWindow *formatswnd = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
411 GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL)); |
1044
b1128efde471
[svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents:
955
diff
changeset
|
412 GtkCList *fl = GTK_CLIST (gtk_clist_new_with_titles (2, (gchar **)rowstr)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
413 CPlayers::const_iterator i; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
414 unsigned int j; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
415 gtk_clist_set_selection_mode (fl, GTK_SELECTION_MULTIPLE); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
416 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
417 // Build list |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
418 for (i = CAdPlug::players.begin (); i != CAdPlug::players.end (); i++) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
419 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
420 gint rownum; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
421 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
422 gchar *rws[2]; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
423 rws[0] = g_strdup ((*i)->filetype.c_str ()); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
424 rws[1] = g_strdup ((*i)->get_extension (0)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
425 for (j = 1; (*i)->get_extension (j); j++) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
426 rws[1] = g_strjoin (", ", rws[1], (*i)->get_extension (j), NULL); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
427 rownum = gtk_clist_append (fl, rws); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
428 g_free (rws[0]); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
429 g_free (rws[1]); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
430 gtk_clist_set_row_data (fl, rownum, (gpointer) (*i)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
431 if (find (cfg.players.begin (), cfg.players.end (), *i) != |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
432 cfg.players.end ()) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
433 gtk_clist_select_row (fl, rownum, 0); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
434 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
435 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
436 gtk_clist_columns_autosize (fl); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
437 gtk_scrolled_window_set_policy (formatswnd, GTK_POLICY_AUTOMATIC, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
438 GTK_POLICY_AUTOMATIC); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
439 gpointer pl = (gpointer) new CPlayers (cfg.players); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
440 g_signal_connect (G_OBJECT (fl), "select-row", |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
441 G_CALLBACK (config_fl_row_select), pl); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
442 g_signal_connect (G_OBJECT (fl), "unselect-row", |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
443 G_CALLBACK (config_fl_row_unselect), pl); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
444 gtk_container_add (GTK_CONTAINER (formatswnd), GTK_WIDGET (fl)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
445 gtk_container_add (GTK_CONTAINER (eventbox), GTK_WIDGET (formatswnd)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
446 gtk_container_add (GTK_CONTAINER (vb), GTK_WIDGET (eventbox)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
447 gtk_tooltips_set_tip (tooltips, GTK_WIDGET (eventbox), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
448 _("Selected file types will be recognized and played " |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
449 "back by this plugin. Deselected types will be " |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
450 "ignored to make room for other plugins to play " |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
451 "these files."), NULL); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
452 g_ptr_array_add (rblist, pl); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
453 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
454 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
455 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
456 // Show window |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
457 gtk_widget_show_all (GTK_WIDGET (config_dlg)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
458 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
459 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
460 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
461 add_instlist (GtkCList * instlist, const char *t1, const char *t2) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
462 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
463 gchar *rowstr[2]; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
464 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
465 rowstr[0] = g_strdup (t1); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
466 rowstr[1] = g_strdup (t2); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
467 gtk_clist_append (instlist, rowstr); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
468 g_free (rowstr[0]); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
469 g_free (rowstr[1]); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
470 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
471 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
472 static CPlayer * |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
473 factory (VFSFile * fd, Copl * newopl) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
474 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
475 CPlayers::const_iterator i; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
476 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
477 dbg_printf ("factory(%p<%s>,opl): ", fd, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
478 fd->uri != NULL ? fd->uri : "unknown"); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
479 return CAdPlug::factory (fd, newopl, cfg.players); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
480 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
481 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
482 static void adplug_stop (InputPlayback * data); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
483 static void adplug_play (InputPlayback * data); |
559 | 484 |
485 | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
486 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
487 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
488 subsong_slider (GtkAdjustment * adj) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
489 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
490 adplug_stop (NULL); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
491 plr.subsong = (unsigned int) adj->value - 1; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
492 adplug_play (playback); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
493 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
494 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
495 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
496 close_infobox (GtkDialog * infodlg) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
497 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
498 // Forget our references to the instance of the "currently playing song" info |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
499 // box. But only if we're really destroying that one... ;) |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
500 if (infodlg == plr.infodlg) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
501 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
502 plr.infobox = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
503 plr.infodlg = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
504 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
505 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
506 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
507 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
508 adplug_info_box (char *filename) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
509 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
510 CSilentopl tmpopl; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
511 VFSFile *fd = vfs_buffered_file_new_from_uri (filename); |
703 | 512 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
513 if (!fd) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
514 return; |
703 | 515 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
516 CPlayer *p = (strcmp (filename, plr.filename) || !plr.p) ? |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
517 factory (fd, &tmpopl) : plr.p; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
518 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
519 if (!p) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
520 return; // bail out if no player could be created |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
521 if (p == plr.p && plr.infodlg) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
522 return; // only one info box for active song |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
523 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
524 std::ostringstream infotext; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
525 unsigned int i; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
526 GtkDialog *infobox = GTK_DIALOG (gtk_dialog_new ()); |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
527 GtkButton *okay_button = GTK_BUTTON (gtk_button_new_with_label (_("Ok"))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
528 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
529 GtkVBox *box = GTK_VBOX (gtk_vbox_new (TRUE, 2)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
530 GtkHBox *hbox = GTK_HBOX (gtk_hbox_new (TRUE, 2)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
531 GtkHBox *hbox2 = GTK_HBOX (gtk_hbox_new (TRUE, 2)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
532 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
533 // Build file info box |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
534 gtk_window_set_title (GTK_WINDOW (infobox), _("AdPlug :: File Info")); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
535 gtk_window_set_policy (GTK_WINDOW (infobox), FALSE, FALSE, TRUE); // Window is auto sized |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
536 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
537 gtk_container_add (GTK_CONTAINER (infobox->vbox), GTK_WIDGET (box)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
538 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
539 // gtk_packer_set_default_border_width(packer, 2); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
540 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
541 gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
542 g_signal_connect_swapped (G_OBJECT (okay_button), "clicked", |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
543 G_CALLBACK (gtk_widget_destroy), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
544 GTK_OBJECT (infobox)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
545 g_signal_connect (G_OBJECT (infobox), "destroy", |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
546 G_CALLBACK (close_infobox), 0); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
547 gtk_container_add (GTK_CONTAINER (infobox->action_area), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
548 GTK_WIDGET (okay_button)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
549 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
550 // Add filename section |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
551 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
552 // gtk_packer_add_defaults(packer, make_framed(print_left(filename), "Filename"), |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
553 // GTK_SIDE_TOP, GTK_ANCHOR_CENTER, GTK_FILL_X); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
554 gtk_box_pack_end (GTK_BOX (box), GTK_WIDGET (hbox2), TRUE, TRUE, 2); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
555 gtk_box_pack_end (GTK_BOX (box), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
556 make_framed (print_left (filename), _("Filename")), TRUE, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
557 TRUE, 2); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
558 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
559 // Add "Song info" section |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
560 infotext << _("Title: ") << p->gettitle () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
561 _("Author: ") << p->getauthor () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
562 _("File Type: ") << p->gettype () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
563 _("Subsongs: ") << p->getsubsongs () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
564 _("Instruments: ") << p->getinstruments (); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
565 if (plr.p == p) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
566 infotext << std::ends; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
567 else |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
568 { |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
569 infotext << std::endl << _("Orders: ") << p->getorders () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
570 _("Patterns: ") << p->getpatterns () << std::ends; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
571 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
572 gtk_container_add (GTK_CONTAINER (hbox), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
573 make_framed (print_left (infotext.str ().c_str ()), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
574 _("Song"))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
575 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
576 // Add "Playback info" section if currently playing |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
577 if (plr.p == p) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
578 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
579 plr.infobox = GTK_LABEL (gtk_label_new ("")); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
580 gtk_label_set_justify (plr.infobox, GTK_JUSTIFY_LEFT); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
581 gtk_misc_set_padding (GTK_MISC (plr.infobox), 2, 2); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
582 gtk_container_add (GTK_CONTAINER (hbox), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
583 make_framed (GTK_WIDGET (plr.infobox), _("Playback"))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
584 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
585 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
586 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
587 // gtk_packer_add_defaults(packer, GTK_WIDGET(hbox), GTK_SIDE_TOP, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
588 // GTK_ANCHOR_CENTER, GTK_FILL_X); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
589 gtk_box_pack_end (GTK_BOX (hbox2), GTK_WIDGET (hbox), TRUE, TRUE, 2); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
590 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
591 // Add instrument names section |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
592 if (p->getinstruments ()) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
593 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
594 GtkScrolledWindow *instwnd = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
595 GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
596 GtkCList *instnames; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
597 gchar tmpstr[10]; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
598 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
599 { |
1532 | 600 const gchar *rowstr[] = { "#", _("Instrument name") }; |
1044
b1128efde471
[svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents:
955
diff
changeset
|
601 instnames = GTK_CLIST (gtk_clist_new_with_titles (2, (gchar **)rowstr)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
602 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
603 gtk_clist_set_column_justification (instnames, 0, GTK_JUSTIFY_RIGHT); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
604 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
605 for (i = 0; i < p->getinstruments (); i++) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
606 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
607 sprintf (tmpstr, "%d", i + 1); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
608 add_instlist (instnames, tmpstr, p->getinstrument (i).c_str ()); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
609 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
610 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
611 gtk_clist_columns_autosize (instnames); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
612 gtk_scrolled_window_set_policy (instwnd, GTK_POLICY_AUTOMATIC, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
613 GTK_POLICY_AUTOMATIC); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
614 gtk_container_add (GTK_CONTAINER (instwnd), GTK_WIDGET (instnames)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
615 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
616 // gtk_packer_add(packer, GTK_WIDGET(instwnd), GTK_SIDE_TOP, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
617 // GTK_ANCHOR_CENTER, GTK_FILL_X, 0, 0, 0, 0, 50); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
618 gtk_box_pack_end (GTK_BOX (hbox2), GTK_WIDGET (instwnd), TRUE, TRUE, 2); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
619 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
620 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
621 // Add "Song message" section |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
622 if (!p->getdesc ().empty ()) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
623 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
624 GtkScrolledWindow *msgwnd = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
625 GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
626 GtkTextView *msg = GTK_TEXT_VIEW (gtk_text_view_new ()); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
627 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
628 gtk_scrolled_window_set_policy (msgwnd, GTK_POLICY_AUTOMATIC, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
629 GTK_POLICY_AUTOMATIC); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
630 gtk_text_view_set_editable (msg, FALSE); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
631 gtk_text_view_set_wrap_mode (msg, GTK_WRAP_WORD_CHAR); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
632 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
633 gtk_text_buffer_set_text (gtk_text_view_get_buffer (msg), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
634 p->getdesc ().c_str (), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
635 p->getdesc ().length ()); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
636 gtk_container_add (GTK_CONTAINER (msgwnd), GTK_WIDGET (msg)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
637 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
638 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
639 // gtk_packer_add(packer, make_framed(GTK_WIDGET(msgwnd), "Song message"), |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
640 // GTK_SIDE_TOP, GTK_ANCHOR_CENTER, GTK_FILL_X, 2, 0, 0, 200, 50); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
641 gtk_box_pack_end (GTK_BOX (hbox2), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
642 make_framed (GTK_WIDGET (msgwnd), _("Song message")), TRUE, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
643 TRUE, 2); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
644 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
645 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
646 // Add subsong slider section |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
647 if (p == plr.p && p->getsubsongs () > 1) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
648 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
649 GtkAdjustment *adj = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
650 GTK_ADJUSTMENT (gtk_adjustment_new (plr.subsong + 1, 1, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
651 p->getsubsongs () + 1, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
652 1, 5, 1)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
653 GtkHScale *slider = GTK_HSCALE (gtk_hscale_new (adj)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
654 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
655 g_signal_connect (G_OBJECT (adj), "value_changed", |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
656 G_CALLBACK (subsong_slider), NULL); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
657 gtk_range_set_update_policy (GTK_RANGE (slider), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
658 GTK_UPDATE_DISCONTINUOUS); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
659 gtk_scale_set_digits (GTK_SCALE (slider), 0); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
660 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
661 // gtk_packer_add_defaults(packer, make_framed(GTK_WIDGET(slider), "Subsong selection"), |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
662 // GTK_SIDE_TOP, GTK_ANCHOR_CENTER, GTK_FILL_X); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
663 gtk_box_pack_end (GTK_BOX (hbox2), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
664 make_framed (GTK_WIDGET (slider), _("Subsong selection")), |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
665 TRUE, TRUE, 2); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
666 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
667 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
668 // Show dialog box |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
669 gtk_widget_show_all (GTK_WIDGET (infobox)); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
670 if (p == plr.p) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
671 { // Remember widget, so we could destroy it later |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
672 plr.infodlg = infobox; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
673 } |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
674 else // Delete temporary player |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
675 delete p; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
676 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
677 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
678 /***** Main player (!! threaded !!) *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
679 |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
680 static Tuple* |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
681 adplug_get_tuple (char *filename) |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
682 { |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
683 CSilentopl tmpopl; |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
684 VFSFile *fd = vfs_buffered_file_new_from_uri (filename); |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
685 |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
686 if (!fd) |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
687 return NULL; |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
688 |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
689 CPlayer *p = factory (fd, &tmpopl); |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
690 |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
691 if (p) |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
692 { |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
693 Tuple *ti = tuple_new_from_filename(filename); |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
694 if (! p->getauthor().empty()) |
1687
d158ce84fda7
Modified for Tuplez/plugin API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
1556
diff
changeset
|
695 tuple_associate_string(ti, FIELD_ARTIST, NULL, p->getauthor().c_str()); |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
696 if (! p->gettitle().empty()) |
1687
d158ce84fda7
Modified for Tuplez/plugin API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
1556
diff
changeset
|
697 tuple_associate_string(ti, FIELD_TITLE, NULL, p->gettitle().c_str()); |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
698 else if (! p->getdesc().empty()) |
1687
d158ce84fda7
Modified for Tuplez/plugin API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
1556
diff
changeset
|
699 tuple_associate_string(ti, FIELD_TITLE, NULL, p->getdesc().c_str()); |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
700 else |
1687
d158ce84fda7
Modified for Tuplez/plugin API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
1556
diff
changeset
|
701 tuple_associate_string(ti, FIELD_TITLE, NULL, g_path_get_basename(filename)); |
d158ce84fda7
Modified for Tuplez/plugin API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
1556
diff
changeset
|
702 tuple_associate_string(ti, FIELD_CODEC, NULL, p->gettype().c_str()); |
d158ce84fda7
Modified for Tuplez/plugin API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
1556
diff
changeset
|
703 tuple_associate_string(ti, FIELD_QUALITY, NULL, "sequenced"); |
d158ce84fda7
Modified for Tuplez/plugin API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
1556
diff
changeset
|
704 tuple_associate_int(ti, FIELD_LENGTH, NULL, p->songlength (plr.subsong)); |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
705 delete p; |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
706 return ti; |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
707 } |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
708 |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
709 return NULL; |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
710 } |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
711 |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
712 static char* format_and_free_ti( Tuple* ti, int* length ) |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
713 { |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
714 char* result = tuple_formatter_make_title_string(ti, get_gentitle_format()); |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
715 if ( result ) |
1687
d158ce84fda7
Modified for Tuplez/plugin API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
1556
diff
changeset
|
716 *length = tuple_get_int(ti, FIELD_LENGTH, NULL); |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
717 tuple_free((void *) ti); |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
718 |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
719 return result; |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
720 } |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
721 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
722 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
723 update_infobox (void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
724 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
725 std::ostringstream infotext; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
726 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
727 // Recreate info string |
1538
da1aa3c38cda
i'm currently "update-po"ing like a madman with a Chainsaw ;-)
mf0102 <0102@gmx.at>
parents:
1532
diff
changeset
|
728 infotext << _("Order: ") << plr.p->getorder () << " / " << plr.p-> |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
729 getorders () << std::endl << _("Pattern: ") << plr.p-> |
1538
da1aa3c38cda
i'm currently "update-po"ing like a madman with a Chainsaw ;-)
mf0102 <0102@gmx.at>
parents:
1532
diff
changeset
|
730 getpattern () << " / " << plr.p-> |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
731 getpatterns () << std::endl << _("Row: ") << plr.p-> |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
732 getrow () << std::endl << _("Speed: ") << plr.p-> |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
733 getspeed () << std::endl << _("Timer: ") << plr.p-> |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
734 getrefresh () << _("Hz") << std::ends; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
735 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
736 GDK_THREADS_ENTER (); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
737 gtk_label_set_text (plr.infobox, infotext.str ().c_str ()); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
738 GDK_THREADS_LEAVE (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
739 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
740 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
741 // Define sampsize macro (only usable inside play_loop()!) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
742 #define sampsize ((bit16 ? 2 : 1) * (stereo ? 2 : 1)) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
743 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
744 static void * |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
745 play_loop (void *data) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
746 /* Main playback thread. Takes the filename to play as argument. */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
747 { |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
748 InputPlayback *playback = (InputPlayback *) data; |
703 | 749 char *filename = (char *) playback->filename; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
750 dbg_printf ("play_loop(\"%s\"): ", filename); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
751 CEmuopl opl (cfg.freq, cfg.bit16, cfg.stereo); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
752 long toadd = 0, i, towrite; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
753 char *sndbuf, *sndbufpos; |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
754 int songlength; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
755 bool playing = true, // Song self-end indicator. |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
756 bit16 = cfg.bit16, // Duplicate config, so it doesn't affect us if |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
757 stereo = cfg.stereo; // the user changes it while we're playing. |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
758 unsigned long freq = cfg.freq; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
759 |
703 | 760 // we use VfsBufferedFile class here because adplug does a lot of |
761 // probing. a short delay before probing begins is better than | |
762 // a lot of delay during probing. | |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
763 VFSFile *fd = vfs_buffered_file_new_from_uri (playback->filename); |
703 | 764 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
765 if (!fd) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
766 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
767 plr.playing = false; |
1410
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
768 return (NULL); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
769 } |
703 | 770 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
771 // Try to load module |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
772 dbg_printf ("factory, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
773 if (!(plr.p = factory (fd, &opl))) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
774 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
775 dbg_printf ("error!\n"); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
776 // MessageBox("AdPlug :: Error", "File could not be opened!", "Ok"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
777 plr.playing = false; |
1410
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
778 return (NULL); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
779 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
780 |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
781 // cache song title & length from tuple |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
782 dbg_printf ("title, "); |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
783 Tuple* ti = adplug_get_tuple(filename); |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
784 if (ti) |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
785 { |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
786 plr.songtitle = format_and_free_ti( ti, &songlength ); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
787 } |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
788 plr.songlength = songlength; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
789 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
790 // reset to first subsong on new file |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
791 dbg_printf ("subsong, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
792 if (strcmp (filename, plr.filename)) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
793 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
794 strcpy (plr.filename, filename); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
795 plr.subsong = 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
796 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
797 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
798 // Allocate audio buffer |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
799 dbg_printf ("buffer, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
800 sndbuf = (char *) malloc (SNDBUFSIZE * sampsize); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
801 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
802 // Set XMMS main window information |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
803 dbg_printf ("xmms, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
804 adplug_ip.set_info (plr.songtitle, plr.songlength, freq * sampsize * 8, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
805 freq, stereo ? 2 : 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
806 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
807 // Rewind player to right subsong |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
808 dbg_printf ("rewind, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
809 plr.p->rewind (plr.subsong); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
810 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
811 // main playback loop |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
812 dbg_printf ("loop.\n"); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
813 while ((playing || cfg.endless) && plr.playing) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
814 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
815 // seek requested ? |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
816 if (plr.seek != -1) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
817 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
818 // backward seek ? |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
819 if (plr.seek < plr.time_ms) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
820 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
821 plr.p->rewind (plr.subsong); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
822 plr.time_ms = 0.0f; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
823 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
824 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
825 // seek to requested position |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
826 while ((plr.time_ms < plr.seek) && plr.p->update ()) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
827 plr.time_ms += 1000 / plr.p->getrefresh (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
828 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
829 // Reset output plugin and some values |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
830 playback->output->flush ((int) plr.time_ms); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
831 plr.seek = -1; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
832 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
833 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
834 // fill sound buffer |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
835 towrite = SNDBUFSIZE; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
836 sndbufpos = sndbuf; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
837 while (towrite > 0) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
838 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
839 while (toadd < 0) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
840 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
841 toadd += freq; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
842 playing = plr.p->update (); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
843 plr.time_ms += 1000 / plr.p->getrefresh (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
844 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
845 i = MIN (towrite, (long) (toadd / plr.p->getrefresh () + 4) & ~3); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
846 opl.update ((short *) sndbufpos, i); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
847 sndbufpos += i * sampsize; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
848 towrite -= i; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
849 toadd -= (long) (plr.p->getrefresh () * i); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
850 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
851 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
852 // write sound buffer |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
853 while (playback->output->buffer_free () < SNDBUFSIZE * sampsize) |
1676
aee4ebea943a
xmms_usleep() was removed, use g_usleep()
Matti Hamalainen <ccr@tnsp.org>
parents:
1634
diff
changeset
|
854 g_usleep (10000); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
855 produce_audio (playback->output->written_time (), |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
856 bit16 ? FORMAT_16 : FORMAT_8, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
857 stereo ? 2 : 1, SNDBUFSIZE * sampsize, sndbuf, NULL); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
858 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
859 // update infobox, if necessary |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
860 if (plr.infobox && plr.playing) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
861 update_infobox (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
862 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
863 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
864 // playback finished - deinit |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
865 dbg_printf ("play_loop(\"%s\"): ", filename); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
866 if (!playing) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
867 { // wait for output plugin to finish if song has self-ended |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
868 dbg_printf ("wait, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
869 while (playback->output->buffer_playing ()) |
1676
aee4ebea943a
xmms_usleep() was removed, use g_usleep()
Matti Hamalainen <ccr@tnsp.org>
parents:
1634
diff
changeset
|
870 g_usleep (10000); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
871 } |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
872 else |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
873 { // or else, flush its output buffers |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
874 dbg_printf ("flush, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
875 playback->output->buffer_free (); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
876 playback->output->buffer_free (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
877 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
878 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
879 // free everything and exit |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
880 dbg_printf ("free"); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
881 delete plr.p; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
882 plr.p = 0; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
883 if (plr.songtitle) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
884 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
885 free (plr.songtitle); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
886 plr.songtitle = NULL; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
887 } |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
888 free (sndbuf); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
889 plr.playing = false; // important! XMMS won't get a self-ended song without it. |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
890 dbg_printf (".\n"); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
891 vfs_fclose (fd); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
892 return (NULL); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
893 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
894 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
895 // sampsize macro not useful anymore. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
896 #undef sampsize |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
897 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
898 /***** Informational *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
899 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
900 static int |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
901 adplug_is_our_fd (gchar * filename, VFSFile * fd) |
703 | 902 { |
903 CSilentopl tmpopl; | |
904 | |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
905 CPlayer *p = factory (fd, &tmpopl); |
703 | 906 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
907 dbg_printf ("adplug_is_our_file(\"%s\"): returned ", filename); |
703 | 908 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
909 if (p) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
910 { |
703 | 911 delete p; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
912 dbg_printf ("TRUE\n"); |
703 | 913 return TRUE; |
914 } | |
915 | |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
916 dbg_printf ("FALSE\n"); |
703 | 917 return FALSE; |
918 } | |
919 | |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
920 static int |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
921 adplug_is_our_file (char *filename) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
922 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
923 CSilentopl tmpopl; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
924 VFSFile *fd = vfs_buffered_file_new_from_uri (filename); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
925 if (!fd) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
926 return FALSE; |
703 | 927 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
928 CPlayer *p = factory (fd, &tmpopl); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
929 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
930 dbg_printf ("adplug_is_our_file(\"%s\"): returned ", filename); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
931 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
932 if (p) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
933 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
934 delete p; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
935 dbg_printf ("TRUE\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
936 return TRUE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
937 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
938 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
939 dbg_printf ("FALSE\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
940 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
941 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
942 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
943 static int |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
944 adplug_get_time (InputPlayback * data) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
945 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
946 if (audio_error) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
947 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
948 dbg_printf ("adplug_get_time(): returned -2\n"); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
949 return -2; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
950 } |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
951 if (!plr.playing) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
952 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
953 dbg_printf ("adplug_get_time(): returned -1\n"); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
954 return -1; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
955 } |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
956 return playback->output->output_time (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
957 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
958 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
959 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
960 adplug_song_info (char *filename, char **title, int *length) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
961 { |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
962 *length = -1; |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
963 *title = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
964 |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
965 Tuple* ti = adplug_get_tuple( filename ); |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
966 if ( ti ) |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
967 *title = format_and_free_ti( ti, length ); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
968 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
969 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
970 /***** Player control *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
971 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
972 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
973 adplug_play (InputPlayback * data) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
974 { |
559 | 975 char *filename = data->filename; |
976 playback = data; | |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
977 dbg_printf ("adplug_play(\"%s\"): ", filename); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
978 audio_error = FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
979 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
980 // On new song, re-open "Song info" dialog, if open |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
981 dbg_printf ("dialog, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
982 if (plr.infobox && strcmp (filename, plr.filename)) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
983 gtk_widget_destroy (GTK_WIDGET (plr.infodlg)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
984 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
985 // open output plugin |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
986 dbg_printf ("open, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
987 if (!playback->output-> |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
988 open_audio (cfg.bit16 ? FORMAT_16 : FORMAT_8, cfg.freq, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
989 cfg.stereo ? 2 : 1)) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
990 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
991 audio_error = TRUE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
992 return; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
993 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
994 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
995 // Initialize global player data (this is here to prevent a race condition |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
996 // between adplug_get_time() returning the playback state and adplug_loop() |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
997 // initializing the playback state) |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
998 dbg_printf ("init, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
999 plr.playing = true; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1000 plr.time_ms = 0.0f; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1001 plr.seek = -1; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1002 |
1410
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
1003 // start player func |
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
1004 dbg_printf ("play"); |
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
1005 plr.play_thread = g_thread_self(); |
1447
195b5657303e
updated input plugins to use set_pb_ready to signal to the core that they're ready for playback
Giacomo Lozito <james@develia.org>
parents:
1410
diff
changeset
|
1006 playback->set_pb_ready(playback); |
1410
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
1007 play_loop(playback); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1008 dbg_printf (".\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1009 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1010 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1011 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1012 adplug_stop (InputPlayback * playback) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1013 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1014 dbg_printf ("adplug_stop(): join, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1015 plr.playing = false; |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1016 g_thread_join (plr.play_thread); // stop player thread |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1017 dbg_printf ("close"); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1018 playback->output->close_audio (); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1019 dbg_printf (".\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1020 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1021 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1022 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1023 adplug_pause (InputPlayback * playback, short paused) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1024 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1025 dbg_printf ("adplug_pause(%d)\n", paused); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1026 playback->output->pause (paused); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1027 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1028 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1029 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1030 adplug_seek (InputPlayback * data, int time) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1031 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1032 dbg_printf ("adplug_seek(%d)\n", time); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1033 plr.seek = time * 1000; // time is in seconds, but we count in ms |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1034 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1035 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1036 /***** Configuration file handling *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1037 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1038 #define CFG_VERSION "AdPlug" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1039 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1040 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1041 adplug_init (void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1042 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1043 dbg_printf ("adplug_init(): open, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1044 ConfigDb *db = bmp_cfg_db_open (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1045 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1046 // Read configuration |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1047 dbg_printf ("read, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1048 bmp_cfg_db_get_bool (db, CFG_VERSION, "16bit", (gboolean *) & cfg.bit16); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1049 bmp_cfg_db_get_bool (db, CFG_VERSION, "Stereo", (gboolean *) & cfg.stereo); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1050 bmp_cfg_db_get_int (db, CFG_VERSION, "Frequency", (gint *) & cfg.freq); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1051 bmp_cfg_db_get_bool (db, CFG_VERSION, "Endless", |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1052 (gboolean *) & cfg.endless); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1053 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1054 // Read file type exclusion list |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1055 dbg_printf ("exclusion, "); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1056 { |
1045 | 1057 gchar *cfgstr = NULL, *exclude = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1058 gboolean cfgread; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1059 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1060 cfgread = bmp_cfg_db_get_string (db, CFG_VERSION, "Exclude", &cfgstr); |
1045 | 1061 if (cfgread) { |
1062 exclude = (char *) malloc (strlen (cfgstr) + 2); | |
1063 strcpy (exclude, cfgstr); | |
1064 exclude[strlen (exclude) + 1] = '\0'; | |
1065 g_strdelimit (exclude, ":", '\0'); | |
1066 for (gchar * p = exclude; *p; p += strlen (p) + 1) | |
1067 cfg.players.remove (cfg.players.lookup_filetype (p)); | |
1068 free (exclude); free (cfgstr); | |
1069 } | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1070 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1071 bmp_cfg_db_close (db); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1072 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1073 // Load database from disk and hand it to AdPlug |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1074 dbg_printf ("database"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1075 plr.db = new CAdPlugDatabase; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1076 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1077 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1078 const char *homedir = getenv ("HOME"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1079 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1080 if (homedir) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1081 { |
1301
df5d07d7ca7c
AdPlug database loading fix by Christian "Joker" Birchinger.
Tony Vroon <chainsaw@gentoo.org>
parents:
1286
diff
changeset
|
1082 std::string userdb; |
df5d07d7ca7c
AdPlug database loading fix by Christian "Joker" Birchinger.
Tony Vroon <chainsaw@gentoo.org>
parents:
1286
diff
changeset
|
1083 userdb = "file://" + std::string(g_get_home_dir()) + "/" ADPLUG_CONFDIR "/" + ADPLUGDB_FILE; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1084 plr.db->load (userdb); // load user's database |
1301
df5d07d7ca7c
AdPlug database loading fix by Christian "Joker" Birchinger.
Tony Vroon <chainsaw@gentoo.org>
parents:
1286
diff
changeset
|
1085 dbg_printf (" (userdb=\"%s\")", userdb.c_str()); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1086 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1087 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1088 CAdPlug::set_database (plr.db); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1089 dbg_printf (".\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1090 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1091 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1092 static void |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1093 adplug_quit (void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1094 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1095 dbg_printf ("adplug_quit(): open, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1096 ConfigDb *db = bmp_cfg_db_open (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1097 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1098 // Close database |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1099 dbg_printf ("db, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1100 if (plr.db) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1101 delete plr.db; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1102 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1103 // Write configuration |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1104 dbg_printf ("write, "); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1105 bmp_cfg_db_set_bool (db, CFG_VERSION, "16bit", cfg.bit16); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1106 bmp_cfg_db_set_bool (db, CFG_VERSION, "Stereo", cfg.stereo); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1107 bmp_cfg_db_set_int (db, CFG_VERSION, "Frequency", cfg.freq); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1108 bmp_cfg_db_set_bool (db, CFG_VERSION, "Endless", cfg.endless); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1109 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1110 dbg_printf ("exclude, "); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1111 std::string exclude; |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1112 for (CPlayers::const_iterator i = CAdPlug::players.begin (); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1113 i != CAdPlug::players.end (); i++) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1114 if (find (cfg.players.begin (), cfg.players.end (), *i) == |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1115 cfg.players.end ()) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1116 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1117 if (!exclude.empty ()) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1118 exclude += ":"; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1119 exclude += (*i)->filetype; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1120 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1121 gchar *cfgval = g_strdup (exclude.c_str ()); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1122 bmp_cfg_db_set_string (db, CFG_VERSION, "Exclude", cfgval); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1123 free (cfgval); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1124 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1125 dbg_printf ("close"); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1126 bmp_cfg_db_close (db); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1127 dbg_printf (".\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1128 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1129 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1130 /***** Plugin (exported) *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1131 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1132 InputPlugin adplug_ip = { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1133 NULL, // handle (filled by XMMS) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1134 NULL, // filename (filled by XMMS) |
1044
b1128efde471
[svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents:
955
diff
changeset
|
1135 (gchar *)ADPLUG_NAME, // plugin description |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1136 adplug_init, // plugin functions... |
1634 | 1137 adplug_quit, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1138 adplug_about, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1139 adplug_config, |
1634 | 1140 FALSE, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1141 adplug_is_our_file, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1142 NULL, // scan_dir (look in Input/cdaudio/cdaudio.c) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1143 adplug_play, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1144 adplug_stop, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1145 adplug_pause, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1146 adplug_seek, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1147 NULL, // set_eq |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1148 adplug_get_time, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1149 NULL, // get_volume (handled by output plugin) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1150 NULL, // set_volume (...) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1151 NULL, // OBSOLETE - DO NOT USE! |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1152 NULL, // add_vis_pcm (filled by XMMS) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1153 NULL, // set_info (filled by XMMS) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1154 NULL, // set_info_text (filled by XMMS) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1155 adplug_song_info, |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
1156 adplug_info_box, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1157 NULL, // output plugin (filled by XMMS) |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
1158 adplug_get_tuple, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1159 NULL, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1160 NULL, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1161 adplug_is_our_fd, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1162 NULL, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1163 }; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1164 |
1096 | 1165 InputPlugin *adplug_iplist[] = { &adplug_ip, NULL }; |
1166 | |
1395
761e17b23e0c
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
1301
diff
changeset
|
1167 DECLARE_PLUGIN(adplug, NULL, NULL, adplug_iplist, NULL, NULL, NULL, NULL,NULL); |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
1168 |