annotate src/adplug/adplug-xmms.cc @ 2239:224ebe9caaac

eliminate warnings
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Mon, 17 Dec 2007 18:35:35 +0900
parents b8da6a0b0da2
children ed6c81bd9016
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
52d162b0dbd4 Fix AdPlug compilation.
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
20 #include "config.h"
528
4d8b92b55acf [svn] - add config.h includes where needed
nenolod
parents: 527
diff changeset
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"
1952
17a6441c71b6 Some missed #include "" to <> changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1950
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 {
1950
2ebeb7816c5e Change from "" to <>-style includes. With thanks to ccr for the correct sed voodoo.
chainsaw@localhost
parents: 1876
diff changeset
35 #include <audacious/plugin.h>
2ebeb7816c5e Change from "" to <>-style includes. With thanks to ccr for the correct sed voodoo.
chainsaw@localhost
parents: 1876
diff changeset
36 #include <audacious/configdb.h>
2ebeb7816c5e Change from "" to <>-style includes. With thanks to ccr for the correct sed voodoo.
chainsaw@localhost
parents: 1876
diff changeset
37 #include <audacious/output.h>
2ebeb7816c5e Change from "" to <>-style includes. With thanks to ccr for the correct sed voodoo.
chainsaw@localhost
parents: 1876
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;
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
72 } conf =
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
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
d5782f3bd760 [svn] Update plugins to the new input plugin API
iabervon
parents: 528
diff changeset
94 static InputPlayback *playback;
d5782f3bd760 [svn] Update plugins to the new input plugin API
iabervon
parents: 528
diff changeset
95
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
96 /***** Debugging *****/
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
97
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
98 #ifdef DEBUG
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
99
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
100 #include <stdarg.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
101
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
102 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
103 dbg_printf (const char *fmt, ...)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
104 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
105 va_list argptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
106
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
107 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
108 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
109 va_end (argptr);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
110 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
111
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
112 #else
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
113
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
114 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
115 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
116 {
4709ce4e209e [svn] Run 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 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
118
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
119 #endif
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
120
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
121 /***** [Dialog]: Utility functions *****/
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
122
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
123 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
124 make_framed (GtkWidget * what, const gchar * label)
0
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 GtkWidget *framebox = gtk_frame_new (label);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
127
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
128 gtk_container_add (GTK_CONTAINER (framebox), what);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
129 return framebox;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
130 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
131
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
132 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
133 print_left (const gchar * text)
0
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 GtkLabel *label = GTK_LABEL (gtk_label_new (text));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
136
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
137 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
138 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
139 return GTK_WIDGET (label);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
140 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
141
2239
224ebe9caaac eliminate warnings
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2124
diff changeset
142 #if 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
143 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
144 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
145 {
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
146 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
147 *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
148 *tmpbutton = (char *) malloc (strlen (button) + 1);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
149
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
150 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
151 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
152 strcpy (tmpbutton, button);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
153
1677
f6f5603a0954 xmms_show_message() changed to audacious_info_dialog()
Matti Hamalainen <ccr@tnsp.org>
parents: 1676
diff changeset
154 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
155 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
156 &msgbox);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
157
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
158 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
159 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
160 free (tmpbutton);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
161 }
2239
224ebe9caaac eliminate warnings
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2124
diff changeset
162 #endif
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 /***** Dialog boxes *****/
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
165
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
166 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
167 adplug_about (void)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
168 {
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
169 if (!about_win)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
170 {
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
171 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
172 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
173 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
174 _
4709ce4e209e [svn] Run 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 ("\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
176 "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
177 "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
178 "\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
179 "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
180 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
181 about_win =
1677
f6f5603a0954 xmms_show_message() changed to audacious_info_dialog()
Matti Hamalainen <ccr@tnsp.org>
parents: 1676
diff changeset
182 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
183 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
184 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
185 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
186 g_free (about_title);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
187 }
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
188 gtk_widget_show (about_win);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
189 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
190
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
191 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
192 close_config_box_ok (GtkButton * button, GPtrArray * rblist)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
193 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
194 // Apply configuration settings
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
195 conf.bit16 =
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 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
197 (g_ptr_array_index (rblist, 0)));
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
198 conf.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
199 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
200 (g_ptr_array_index (rblist, 1)));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
201
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
202 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
203 (GTK_TOGGLE_BUTTON (g_ptr_array_index (rblist, 2))))
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
204 conf.freq = 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
205 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
206 (GTK_TOGGLE_BUTTON (g_ptr_array_index (rblist, 3))))
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
207 conf.freq = 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
208 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
209 (GTK_TOGGLE_BUTTON (g_ptr_array_index (rblist, 4))))
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
210 conf.freq = 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
211 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
212 (GTK_TOGGLE_BUTTON (g_ptr_array_index (rblist, 5))))
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
213 conf.freq = 48000;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
214
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
215 conf.endless =
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 !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
217 (g_ptr_array_index (rblist, 6)));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
218
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
219 conf.players = *(CPlayers *) g_ptr_array_index (rblist, 7);
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 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
221
4709ce4e209e [svn] Run 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 g_ptr_array_free (rblist, FALSE);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
223 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
224
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
225 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
226 close_config_box_cancel (GtkButton * button, GPtrArray * rblist)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
227 {
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
228 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
229 g_ptr_array_free (rblist, FALSE);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
230 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
231
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
232 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
233 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
234 GdkEventButton * event, CPlayers * pl)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
235 {
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
236 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
237 pl->unique ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
238 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
239
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
240 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
241 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
242 GdkEventButton * event, CPlayers * pl)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
243 {
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
244 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
245 }
4709ce4e209e [svn] Run 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 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
248 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
249 {
4709ce4e209e [svn] Run 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 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
251 GtkNotebook *notebook = GTK_NOTEBOOK (gtk_notebook_new ());
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
252 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
253 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
254 GPtrArray *rblist = g_ptr_array_new ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
255
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
256 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
257 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
258 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
259 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
260
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
261 // Add Ok & Cancel buttons
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
262 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
263 GtkWidget *button;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
264
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
265 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
266 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
267 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
268 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
269 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
270 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
271 (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
272 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
273 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
274
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
275 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
276 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
277 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
278 (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
279 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
280 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
281 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
282 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
283 }
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 /***** Page 1: General *****/
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
286
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
287 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
288 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
289 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
290 gtk_notebook_append_page (notebook, GTK_WIDGET (table),
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
291 print_left (_("General")));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
292
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
293 // Add "Sound quality" section
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
294 {
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
295 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
296 GtkVBox *fvb;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
297 GtkRadioButton *rb;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
298
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
299 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
300 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
301 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
302 make_framed (GTK_WIDGET (sqt),
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
303 _("Sound quality")), 0, 1, 0, 1);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
304
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
305 // 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
306 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
307 gtk_table_attach_defaults (sqt,
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
308 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
309 0, 1, 0, 1);
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
310 rb = GTK_RADIO_BUTTON (gtk_radio_button_new_with_label (NULL, _("8bit")));
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
311 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), !conf.bit16);
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_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
313 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 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
315 (rb, _("16bit")));
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
316 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), conf.bit16);
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_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
318 g_ptr_array_add (rblist, (gpointer) rb);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
319
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
320 // 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
321 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
322 gtk_table_attach_defaults (sqt,
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
323 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
324 1, 1, 2);
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
325 rb = GTK_RADIO_BUTTON (gtk_radio_button_new_with_label (NULL, _("Mono")));
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
326 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), !conf.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
327 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
328 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 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
330 (rb, _("Stereo")));
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
331 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), conf.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_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
333 gtk_tooltips_set_tip (tooltips, GTK_WIDGET (rb),
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
334 _("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
335 "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
336 "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
337 g_ptr_array_add (rblist, (gpointer) rb);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
338
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
339 // 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
340 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
341 gtk_table_attach_defaults (sqt,
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
342 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
343 2, 0, 2);
1529
349cae04e455 -continued German translation
mf0102 <0102@gmx.at>
parents: 1447
diff changeset
344 rb = GTK_RADIO_BUTTON (gtk_radio_button_new_with_label (NULL, "11025"));
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
345 if (conf.freq == 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 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
347 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
348 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
349 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 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget
1529
349cae04e455 -continued German translation
mf0102 <0102@gmx.at>
parents: 1447
diff changeset
351 (rb, "22050"));
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
352 if (conf.freq == 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 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
354 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
355 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
356 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 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget
1529
349cae04e455 -continued German translation
mf0102 <0102@gmx.at>
parents: 1447
diff changeset
358 (rb, "44100"));
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
359 if (conf.freq == 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 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
361 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
362 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
363 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 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget
1529
349cae04e455 -continued German translation
mf0102 <0102@gmx.at>
parents: 1447
diff changeset
365 (rb, "48000"));
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
366 if (conf.freq == 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 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
368 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
369 g_ptr_array_add (rblist, (gpointer) rb);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
370 }
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 // Add "Playback" section
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
373 {
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
374 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
375 GtkCheckButton *cb;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
376
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
377 gtk_table_attach_defaults (table,
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
378 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
379 2, 0, 1);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
380
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
381 cb =
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
382 GTK_CHECK_BUTTON (gtk_check_button_new_with_label (_("Detect songend")));
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
383 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), !conf.endless);
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_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
385 gtk_tooltips_set_tip (tooltips, GTK_WIDGET (cb),
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
386 _("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
387 "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
388 "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
389 "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
390 g_ptr_array_add (rblist, (gpointer) cb);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
391 }
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 /***** Page 2: Formats *****/
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
394
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
395 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
396 gtk_notebook_append_page (notebook, GTK_WIDGET (table),
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
397 print_left (_("Formats")));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
398
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
399 // Add "Format selection" section
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
400 {
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
401 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
402 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
403 make_framed (GTK_WIDGET (vb),
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
404 _("Format selection")), 0, 1, 0, 1);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
405 // Add scrollable list
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
406 {
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
407 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
408 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
409 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
410 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
411 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
412 CPlayers::const_iterator i;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
413 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
414 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
415
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
416 // 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
417 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
418 {
4709ce4e209e [svn] Run 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 gint rownum;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
420
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
421 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
422 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
423 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
424 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
425 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
426 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
427 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
428 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
429 gtk_clist_set_row_data (fl, rownum, (gpointer) (*i));
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
430 if (find (conf.players.begin (), conf.players.end (), *i) !=
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
431 conf.players.end ())
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
432 gtk_clist_select_row (fl, rownum, 0);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
433 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
434
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
435 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
436 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
437 GTK_POLICY_AUTOMATIC);
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
438 gpointer pl = (gpointer) new CPlayers (conf.players);
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
439 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
440 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
441 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
442 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
443 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
444 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
445 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
446 gtk_tooltips_set_tip (tooltips, GTK_WIDGET (eventbox),
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
447 _("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
448 "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
449 "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
450 "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
451 g_ptr_array_add (rblist, pl);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
452 }
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 // 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
456 gtk_widget_show_all (GTK_WIDGET (config_dlg));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
457 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
458
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
459 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
460 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
461 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
462 gchar *rowstr[2];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
463
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
464 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
465 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
466 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
467 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
468 g_free (rowstr[1]);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
469 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
470
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
471 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
472 factory (VFSFile * fd, Copl * newopl)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
473 {
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
474 CPlayers::const_iterator i;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
475
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
476 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
477 fd->uri != NULL ? fd->uri : "unknown");
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
478 return CAdPlug::factory (fd, newopl, conf.players);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
479 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
480
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
481 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
482 static void adplug_play (InputPlayback * data);
559
d5782f3bd760 [svn] Update plugins to the new input plugin API
iabervon
parents: 528
diff changeset
483
d5782f3bd760 [svn] Update plugins to the new input plugin API
iabervon
parents: 528
diff changeset
484
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
485
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
486 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
487 subsong_slider (GtkAdjustment * adj)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
488 {
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
489 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
490 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
491 adplug_play (playback);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
492 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
493
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
494 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
495 close_infobox (GtkDialog * infodlg)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
496 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
497 // 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
498 // 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
499 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
500 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
501 plr.infobox = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
502 plr.infodlg = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
503 }
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
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
506 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
507 adplug_info_box (char *filename)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
508 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
509 CSilentopl tmpopl;
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1976
diff changeset
510 VFSFile *fd = aud_vfs_buffered_file_new_from_uri (filename);
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
511
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
512 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
513 return;
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
514
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
515 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
516 factory (fd, &tmpopl) : plr.p;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
517
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
518 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
519 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
520 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
521 return; // only one info box for active song
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
522
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
523 std::ostringstream infotext;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
524 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
525 GtkDialog *infobox = GTK_DIALOG (gtk_dialog_new ());
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
526 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
527
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
528 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
529 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
530 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
531
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
532 // Build file info box
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
533 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
534 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
535
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
536 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
537 // Former packer layout, for future reproduction
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
538 // gtk_packer_set_default_border_width(packer, 2);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
539
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
540 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
541 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
542 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
543 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
544 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
545 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
546 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
547 GTK_WIDGET (okay_button));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
548
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
549 // Add filename section
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
550 // Former packer layout, for future reproduction
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
551 // 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
552 // 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
553 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
554 gtk_box_pack_end (GTK_BOX (box),
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
555 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
556 TRUE, 2);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
557
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
558 // Add "Song info" section
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
559 infotext << _("Title: ") << p->gettitle () << std::endl <<
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
560 _("Author: ") << p->getauthor () << std::endl <<
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
561 _("File Type: ") << p->gettype () << std::endl <<
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
562 _("Subsongs: ") << p->getsubsongs () << std::endl <<
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
563 _("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
564 if (plr.p == p)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
565 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
566 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
567 {
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
568 infotext << std::endl << _("Orders: ") << p->getorders () << std::endl <<
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
569 _("Patterns: ") << p->getpatterns () << std::ends;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
570 }
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
571 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
572 make_framed (print_left (infotext.str ().c_str ()),
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
573 _("Song")));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
574
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
575 // 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
576 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
577 {
4709ce4e209e [svn] Run 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 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
579 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
580 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
581 gtk_container_add (GTK_CONTAINER (hbox),
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
582 make_framed (GTK_WIDGET (plr.infobox), _("Playback")));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
583 }
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 // Former packer layout, for future reproduction
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
586 // 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
587 // 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
588 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
589
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
590 // 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
591 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
592 {
4709ce4e209e [svn] Run 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 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
594 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
595 GtkCList *instnames;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
596 gchar tmpstr[10];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
597
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
598 {
1532
d19b625f9144 - continued German translation
mf0102 <0102@gmx.at>
parents: 1529
diff changeset
599 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
600 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
601 }
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
602 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
603
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
604 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
605 {
4709ce4e209e [svn] Run 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 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
607 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
608 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
609
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
610 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
611 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
612 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_container_add (GTK_CONTAINER (instwnd), GTK_WIDGET (instnames));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
614 // Former packer layout, for future reproduction
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
615 // 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
616 // 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
617 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
618 }
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 // 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
621 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
622 {
4709ce4e209e [svn] Run 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 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
624 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
625 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
626
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
627 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
628 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_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
630 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
631
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
632 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
633 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
634 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
635 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
636
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
637 // Former packer layout, for future reproduction
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
638 // 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
639 // 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
640 gtk_box_pack_end (GTK_BOX (hbox2),
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
641 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
642 TRUE, 2);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
643 }
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 // 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
646 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
647 {
4709ce4e209e [svn] Run 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 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
649 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
650 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
651 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
652 GtkHScale *slider = GTK_HSCALE (gtk_hscale_new (adj));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
653
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
654 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
655 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
656 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
657 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
658 gtk_scale_set_digits (GTK_SCALE (slider), 0);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
659 // Former packer layout, for future reproduction
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
660 // 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
661 // 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
662 gtk_box_pack_end (GTK_BOX (hbox2),
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
663 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
664 TRUE, TRUE, 2);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
665 }
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 // 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
668 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
669 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
670 { // Remember widget, so we could destroy it later
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
671 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
672 }
4709ce4e209e [svn] Run 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 else // Delete temporary player
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
674 delete p;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
675 }
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 /***** Main player (!! threaded !!) *****/
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
678
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
679 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
680 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
681 {
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 CSilentopl tmpopl;
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1976
diff changeset
683 VFSFile *fd = aud_vfs_buffered_file_new_from_uri (filename);
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
684
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 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
686 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
687
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 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
689
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 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
691 {
1976
5fa26178eaef s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents: 1952
diff changeset
692 Tuple *ti = aud_tuple_new_from_filename(filename);
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
693 if (! p->getauthor().empty())
1976
5fa26178eaef s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents: 1952
diff changeset
694 aud_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
695 if (! p->gettitle().empty())
1976
5fa26178eaef s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents: 1952
diff changeset
696 aud_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
697 else if (! p->getdesc().empty())
1976
5fa26178eaef s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents: 1952
diff changeset
698 aud_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
699 else
1976
5fa26178eaef s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents: 1952
diff changeset
700 aud_tuple_associate_string(ti, FIELD_TITLE, NULL, g_path_get_basename(filename));
5fa26178eaef s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents: 1952
diff changeset
701 aud_tuple_associate_string(ti, FIELD_CODEC, NULL, p->gettype().c_str());
5fa26178eaef s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents: 1952
diff changeset
702 aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "sequenced");
5fa26178eaef s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents: 1952
diff changeset
703 aud_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
704 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
705 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
706 }
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 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
709 }
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 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
712 {
2055
2f2ffbc2d04d gentitle changes
William Pitcock <nenolod@atheme.org>
parents: 1998
diff changeset
713 char* result = aud_tuple_formatter_make_title_string(ti, aud_get_gentitle_format());
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
714 if ( result )
1976
5fa26178eaef s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents: 1952
diff changeset
715 *length = aud_tuple_get_int(ti, FIELD_LENGTH, NULL);
5fa26178eaef s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents: 1952
diff changeset
716 aud_tuple_free((void *) ti);
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
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 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
719 }
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
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
721 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
722 update_infobox (void)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
723 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
724 std::ostringstream infotext;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
725
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
726 // 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
727 infotext << _("Order: ") << plr.p->getorder () << " / " << plr.p->
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
728 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
729 getpattern () << " / " << plr.p->
1286
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
730 getpatterns () << std::endl << _("Row: ") << plr.p->
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
731 getrow () << std::endl << _("Speed: ") << plr.p->
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
732 getspeed () << std::endl << _("Timer: ") << plr.p->
4462de7be194 "Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents: 1096
diff changeset
733 getrefresh () << _("Hz") << std::ends;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
734
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
735 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
736 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
737 GDK_THREADS_LEAVE ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
738 }
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 // Define sampsize macro (only usable inside play_loop()!)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
741 #define sampsize ((bit16 ? 2 : 1) * (stereo ? 2 : 1))
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
742
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
743 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
744 play_loop (void *data)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
745 /* 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
746 {
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
747 InputPlayback *playback = (InputPlayback *) data;
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
748 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
749 dbg_printf ("play_loop(\"%s\"): ", filename);
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
750 CEmuopl opl (conf.freq, conf.bit16, conf.stereo);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
751 long toadd = 0, i, towrite;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
752 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
753 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
754 bool playing = true, // Song self-end indicator.
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
755 bit16 = conf.bit16, // Duplicate config, so it doesn't affect us if
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
756 stereo = conf.stereo; // the user changes it while we're playing.
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
757 unsigned long freq = conf.freq;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
758
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
759 // we use VfsBufferedFile class here because adplug does a lot of
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
760 // probing. a short delay before probing begins is better than
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
761 // a lot of delay during probing.
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1976
diff changeset
762 VFSFile *fd = aud_vfs_buffered_file_new_from_uri (playback->filename);
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
763
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
764 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
765 {
4709ce4e209e [svn] Run 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 plr.playing = false;
1410
cc6203a8cc9f Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents: 1395
diff changeset
767 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
768 }
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
769
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
770 // 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
771 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
772 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
773 {
4709ce4e209e [svn] Run 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 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
775 // 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
776 plr.playing = false;
1410
cc6203a8cc9f Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents: 1395
diff changeset
777 return (NULL);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
778 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
779
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
780 // 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
781 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
782 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
783 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
784 {
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
785 plr.songtitle = format_and_free_ti( ti, &songlength );
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
786 }
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
787 plr.songlength = songlength;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
788
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
789 // 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
790 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
791 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
792 {
4709ce4e209e [svn] Run 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 strcpy (plr.filename, filename);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
794 plr.subsong = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
795 }
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 // 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
798 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
799 sndbuf = (char *) malloc (SNDBUFSIZE * sampsize);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
800
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
801 // 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
802 dbg_printf ("xmms, ");
1984
489e32a8e106 change some places to use set_params() instead of set_info() directly
William Pitcock <nenolod@atheme.org>
parents: 1978
diff changeset
803 playback->set_params (playback, plr.songtitle, plr.songlength, freq * sampsize * 8,
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
804 freq, stereo ? 2 : 1);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
805
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
806 // 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
807 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
808 plr.p->rewind (plr.subsong);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
809
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
810 // 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
811 dbg_printf ("loop.\n");
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
812 while ((playing || conf.endless) && plr.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
813 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
814 // 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
815 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
816 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
817 // 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
818 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
819 {
4709ce4e209e [svn] Run 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 plr.p->rewind (plr.subsong);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
821 plr.time_ms = 0.0f;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
822 }
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 // 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
825 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
826 plr.time_ms += 1000 / plr.p->getrefresh ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
827
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
828 // 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
829 playback->output->flush ((int) plr.time_ms);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
830 plr.seek = -1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
831 }
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 // 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
834 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
835 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
836 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
837 {
4709ce4e209e [svn] Run 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 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
839 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
840 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
841 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
842 plr.time_ms += 1000 / plr.p->getrefresh ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
843 }
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
844 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
845 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
846 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
847 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
848 toadd -= (long) (plr.p->getrefresh () * i);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
849 }
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 // write sound buffer
1998
8f3188746b64 chase last changeset in aud
William Pitcock <nenolod@atheme.org>
parents: 1991
diff changeset
852 playback->pass_audio(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
853 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
854 stereo ? 2 : 1, SNDBUFSIZE * sampsize, sndbuf, NULL);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
855
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
856 // 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
857 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
858 update_infobox ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
859 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
860
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
861 // 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
862 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
863 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
864 { // 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
865 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
866 while (playback->output->buffer_playing ())
1676
aee4ebea943a xmms_usleep() was removed, use g_usleep()
Matti Hamalainen <ccr@tnsp.org>
parents: 1634
diff changeset
867 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
868 }
4709ce4e209e [svn] Run 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 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
870 { // 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
871 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
872 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
873 playback->output->buffer_free ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
874 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
875
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
876 // 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
877 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
878 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
879 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
880 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
881 {
4709ce4e209e [svn] Run 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 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
883 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
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 (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
886 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
887 dbg_printf (".\n");
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1976
diff changeset
888 aud_vfs_fclose (fd);
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
889 return (NULL);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
890 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
891
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
892 // sampsize macro not useful anymore.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
893 #undef sampsize
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 /***** Informational *****/
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
896
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
897 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
898 adplug_is_our_fd (gchar * filename, VFSFile * fd)
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
899 {
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
900 CSilentopl tmpopl;
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
901
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
902 CPlayer *p = factory (fd, &tmpopl);
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
903
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
904 dbg_printf ("adplug_is_our_file(\"%s\"): returned ", filename);
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
905
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
906 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
907 {
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
908 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
909 dbg_printf ("TRUE\n");
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
910 return TRUE;
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
911 }
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
912
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
913 dbg_printf ("FALSE\n");
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
914 return FALSE;
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
915 }
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
916
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
917 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
918 adplug_is_our_file (char *filename)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
919 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
920 CSilentopl tmpopl;
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1976
diff changeset
921 VFSFile *fd = aud_vfs_buffered_file_new_from_uri (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
922 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
923 return FALSE;
703
cae46214b8bf [svn] - rework AdPlug to use VFS properly
nenolod
parents: 561
diff changeset
924
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
925 CPlayer *p = factory (fd, &tmpopl);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
926
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
927 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
928
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
929 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
930 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
931 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
932 dbg_printf ("TRUE\n");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
933 return TRUE;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
934 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
935
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
936 dbg_printf ("FALSE\n");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
937 return FALSE;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
938 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
939
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
940 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
941 adplug_get_time (InputPlayback * data)
0
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 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
944 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 703
diff changeset
945 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
946 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
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 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
949 {
4709ce4e209e [svn] Run 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 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
951 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
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 return playback->output->output_time ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
954 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
955
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 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
957 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
958 {
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
959 *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
960 *title = NULL;
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 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
963 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
964 *title = format_and_free_ti( ti, length );
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
965 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
966
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
967 /***** Player control *****/
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
968
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
969 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
970 adplug_play (InputPlayback * data)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
971 {
559
d5782f3bd760 [svn] Update plugins to the new input plugin API
iabervon
parents: 528
diff changeset
972 char *filename = data->filename;
d5782f3bd760 [svn] Update plugins to the new input plugin API
iabervon
parents: 528
diff changeset
973 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
974 dbg_printf ("adplug_play(\"%s\"): ", filename);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
975 audio_error = FALSE;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
976
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
977 // 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
978 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
979 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
980 gtk_widget_destroy (GTK_WIDGET (plr.infodlg));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
981
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
982 // 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
983 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
984 if (!playback->output->
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
985 open_audio (conf.bit16 ? FORMAT_16 : FORMAT_8, conf.freq,
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
986 conf.stereo ? 2 : 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
987 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
988 audio_error = TRUE;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
989 return;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
990 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
991
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
992 // 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
993 // 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
994 // 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
995 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
996 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
997 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
998 plr.seek = -1;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
999
1410
cc6203a8cc9f Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents: 1395
diff changeset
1000 // start player func
cc6203a8cc9f Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents: 1395
diff changeset
1001 dbg_printf ("play");
cc6203a8cc9f Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents: 1395
diff changeset
1002 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
1003 playback->set_pb_ready(playback);
1410
cc6203a8cc9f Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents: 1395
diff changeset
1004 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
1005 dbg_printf (".\n");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1006 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1007
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 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
1009 adplug_stop (InputPlayback * playback)
0
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 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
1012 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
1013 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
1014 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
1015 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
1016 dbg_printf (".\n");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1017 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1018
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
1019 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
1020 adplug_pause (InputPlayback * playback, short paused)
0
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 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
1023 playback->output->pause (paused);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1024 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1025
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
1026 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
1027 adplug_seek (InputPlayback * data, int time)
0
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 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
1030 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
1031 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1032
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1033 /***** Configuration file handling *****/
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 #define CFG_VERSION "AdPlug"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1036
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
1037 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
1038 adplug_init (void)
0
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 dbg_printf ("adplug_init(): open, ");
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1041 ConfigDb *db = aud_cfg_db_open ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1042
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1043 // 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
1044 dbg_printf ("read, ");
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1045 aud_cfg_db_get_bool (db, CFG_VERSION, "16bit", (gboolean *) & conf.bit16);
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1046 aud_cfg_db_get_bool (db, CFG_VERSION, "Stereo", (gboolean *) & conf.stereo);
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1047 aud_cfg_db_get_int (db, CFG_VERSION, "Frequency", (gint *) & conf.freq);
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1048 aud_cfg_db_get_bool (db, CFG_VERSION, "Endless",
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
1049 (gboolean *) & conf.endless);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1050
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1051 // 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
1052 dbg_printf ("exclusion, ");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1053 {
1045
028b7ca16d30 [svn] - fix crash if Exclude does not exist.
yaz
parents: 1044
diff changeset
1054 gchar *cfgstr = NULL, *exclude = NULL;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1055 gboolean cfgread;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1056
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1057 cfgread = aud_cfg_db_get_string (db, CFG_VERSION, "Exclude", &cfgstr);
1045
028b7ca16d30 [svn] - fix crash if Exclude does not exist.
yaz
parents: 1044
diff changeset
1058 if (cfgread) {
028b7ca16d30 [svn] - fix crash if Exclude does not exist.
yaz
parents: 1044
diff changeset
1059 exclude = (char *) malloc (strlen (cfgstr) + 2);
028b7ca16d30 [svn] - fix crash if Exclude does not exist.
yaz
parents: 1044
diff changeset
1060 strcpy (exclude, cfgstr);
028b7ca16d30 [svn] - fix crash if Exclude does not exist.
yaz
parents: 1044
diff changeset
1061 exclude[strlen (exclude) + 1] = '\0';
028b7ca16d30 [svn] - fix crash if Exclude does not exist.
yaz
parents: 1044
diff changeset
1062 g_strdelimit (exclude, ":", '\0');
028b7ca16d30 [svn] - fix crash if Exclude does not exist.
yaz
parents: 1044
diff changeset
1063 for (gchar * p = exclude; *p; p += strlen (p) + 1)
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
1064 conf.players.remove (conf.players.lookup_filetype (p));
1045
028b7ca16d30 [svn] - fix crash if Exclude does not exist.
yaz
parents: 1044
diff changeset
1065 free (exclude); free (cfgstr);
028b7ca16d30 [svn] - fix crash if Exclude does not exist.
yaz
parents: 1044
diff changeset
1066 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1067 }
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1068 aud_cfg_db_close (db);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1069
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1070 // 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
1071 dbg_printf ("database");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1072 plr.db = new CAdPlugDatabase;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1073
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1074 {
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
1075 const char *homedir = getenv ("HOME");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1076
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
1077 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
1078 {
1301
df5d07d7ca7c AdPlug database loading fix by Christian "Joker" Birchinger.
Tony Vroon <chainsaw@gentoo.org>
parents: 1286
diff changeset
1079 std::string userdb;
df5d07d7ca7c AdPlug database loading fix by Christian "Joker" Birchinger.
Tony Vroon <chainsaw@gentoo.org>
parents: 1286
diff changeset
1080 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
1081 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
1082 dbg_printf (" (userdb=\"%s\")", userdb.c_str());
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1083 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1084 }
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
1085 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
1086 dbg_printf (".\n");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1087 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1088
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
1089 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
1090 adplug_quit (void)
0
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 dbg_printf ("adplug_quit(): open, ");
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1093 ConfigDb *db = aud_cfg_db_open ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1094
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1095 // 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
1096 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
1097 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
1098 delete plr.db;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1099
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1100 // 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
1101 dbg_printf ("write, ");
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1102 aud_cfg_db_set_bool (db, CFG_VERSION, "16bit", conf.bit16);
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1103 aud_cfg_db_set_bool (db, CFG_VERSION, "Stereo", conf.stereo);
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1104 aud_cfg_db_set_int (db, CFG_VERSION, "Frequency", conf.freq);
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1105 aud_cfg_db_set_bool (db, CFG_VERSION, "Endless", conf.endless);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1106
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
1107 dbg_printf ("exclude, ");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1108 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
1109 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
1110 i != CAdPlug::players.end (); i++)
2067
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
1111 if (find (conf.players.begin (), conf.players.end (), *i) ==
932ebaba6eca Rename "cfg" struct to "conf" to avoid collision with cfg from audacious/main.h
Christian Birchinger <joker@netswarm.net>
parents: 2055
diff changeset
1112 conf.players.end ())
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
1113 {
4709ce4e209e [svn] Run 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 (!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
1115 exclude += ":";
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1116 exclude += (*i)->filetype;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1117 }
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
1118 gchar *cfgval = g_strdup (exclude.c_str ());
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1119 aud_cfg_db_set_string (db, CFG_VERSION, "Exclude", cfgval);
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
1120 free (cfgval);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1121
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
1122 dbg_printf ("close");
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2067
diff changeset
1123 aud_cfg_db_close (db);
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
1124 dbg_printf (".\n");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1125 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1126
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1127 /***** Plugin (exported) *****/
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1128
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
1129 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
1130 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
1131 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
1132 (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
1133 adplug_init, // plugin functions...
1634
98c9257d0a80 adplug: update
William Pitcock <nenolod@atheme.org>
parents: 1556
diff changeset
1134 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
1135 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
1136 adplug_config,
1634
98c9257d0a80 adplug: update
William Pitcock <nenolod@atheme.org>
parents: 1556
diff changeset
1137 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
1138 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
1139 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
1140 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
1141 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
1142 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
1143 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
1144 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
1145 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
1146 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
1147 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
1148 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
1149 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
1150 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
1151 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
1152 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
1153 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
1154 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
1155 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
1156 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
1157 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
1158 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
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 };
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1161
1096
8b02086025f9 [svn] - adplug: convert to plugin API v2
nenolod
parents: 1045
diff changeset
1162 InputPlugin *adplug_iplist[] = { &adplug_ip, NULL };
8b02086025f9 [svn] - adplug: convert to plugin API v2
nenolod
parents: 1045
diff changeset
1163
1395
761e17b23e0c added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 1301
diff changeset
1164 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
1165