Mercurial > audlegacy-plugins
annotate src/adplug/adplug-xmms.cc @ 3052:95b34f46a231
Comment out MPEG2/MPEG4 determination using the variable id. It is not used anywhere. Code analysis run, unique ID 6nYoHM.
author | Tony Vroon <chainsaw@gentoo.org> |
---|---|
date | Sat, 18 Apr 2009 19:06:20 +0100 |
parents | d116c0d61dd2 |
children |
rev | line source |
---|---|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1 /* |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
2 AdPlug/XMMS - AdPlug XMMS Plugin |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
3 Copyright (C) 2002, 2003 Simon Peter <dn.tlp@gmx.net> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
4 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
5 AdPlug/XMMS is free software; you can redistribute it and/or |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
9 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
10 This plugin is distributed in the hope that it will be useful, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
13 Lesser General Public License for more details. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
14 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
16 License along with this plugin; if not, write to the Free Software |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
18 */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
19 |
1876 | 20 #include "config.h" |
528 | 21 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
22 #include <algorithm> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
23 #include <sstream> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
24 #include <stdlib.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
25 #include <stdio.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
26 #include <sys/types.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
27 #include <gtk/gtk.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
28 #include "adplug.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
29 #include "emuopl.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
30 #include "silentopl.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
31 #include "players.h" |
2974 | 32 #include <audlegacy/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 { |
2974 | 35 #include <audlegacy/plugin.h> |
36 #include <audlegacy/output.h> | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
37 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
38 |
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 /***** Defines *****/ |
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 // Version string |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
43 #define ADPLUG_NAME "AdPlug (AdLib Sound Player)" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
44 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
45 // Sound buffer size in samples |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
46 #define SNDBUFSIZE 512 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
47 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
48 // AdPlug's 8 and 16 bit audio formats |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
49 #define FORMAT_8 FMT_U8 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
50 #define FORMAT_16 FMT_S16_NE |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
51 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
52 // Default file name of AdPlug's database file |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
53 #define ADPLUGDB_FILE "adplug.db" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
54 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
55 // Default AdPlug user's configuration subdirectory |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
56 #define ADPLUG_CONFDIR ".adplug" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
57 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
58 /***** Global variables *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
59 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
60 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
|
61 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
|
62 GtkWidget *about_win = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
63 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
64 // 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
|
65 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
|
66 { |
4709ce4e209e
[svn] Run 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 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
|
68 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
|
69 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
|
70 } 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
|
71 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
72 44100l, true, false, false, CAdPlug::players}; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
73 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
74 // 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
|
75 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
|
76 { |
4709ce4e209e
[svn] Run 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 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
|
78 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
|
79 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
|
80 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
|
81 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
|
82 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
|
83 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
|
84 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
|
85 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
|
86 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
|
87 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
|
88 } 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
|
89 { |
4709ce4e209e
[svn] Run 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 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
|
91 |
559 | 92 static InputPlayback *playback; |
93 | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
94 /***** Debugging *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
95 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
96 #ifdef DEBUG |
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 #include <stdarg.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
99 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
100 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
|
101 dbg_printf (const char *fmt, ...) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
102 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
103 va_list argptr; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
104 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
105 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
|
106 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
|
107 va_end (argptr); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
108 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
109 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
110 #else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
111 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
112 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
|
113 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
|
114 { |
4709ce4e209e
[svn] Run 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 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
116 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
117 #endif |
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 /***** [Dialog]: Utility functions *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
120 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
121 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
|
122 make_framed (GtkWidget * what, const gchar * label) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
123 { |
955
4709ce4e209e
[svn] Run 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 GtkWidget *framebox = gtk_frame_new (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 gtk_container_add (GTK_CONTAINER (framebox), what); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
127 return framebox; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
128 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
129 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
130 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
|
131 print_left (const gchar * text) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
132 { |
955
4709ce4e209e
[svn] Run 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 GtkLabel *label = GTK_LABEL (gtk_label_new (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 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
|
136 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
|
137 return GTK_WIDGET (label); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
138 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
139 |
2239 | 140 #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
|
141 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
|
142 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
|
143 { |
955
4709ce4e209e
[svn] Run 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 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
|
145 *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
|
146 *tmpbutton = (char *) malloc (strlen (button) + 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
147 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
148 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
|
149 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
|
150 strcpy (tmpbutton, button); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
151 |
1677
f6f5603a0954
xmms_show_message() changed to audacious_info_dialog()
Matti Hamalainen <ccr@tnsp.org>
parents:
1676
diff
changeset
|
152 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
|
153 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
|
154 &msgbox); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
155 |
955
4709ce4e209e
[svn] Run 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 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
|
157 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
|
158 free (tmpbutton); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
159 } |
2239 | 160 #endif |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
161 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
162 /***** Dialog boxes *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
163 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
164 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
|
165 adplug_about (void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
166 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
167 if (!about_win) |
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 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
|
170 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
|
171 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
|
172 _ |
4709ce4e209e
[svn] Run 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 ("\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
|
174 "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
|
175 "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
|
176 "\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
|
177 "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
|
178 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
|
179 about_win = |
1677
f6f5603a0954
xmms_show_message() changed to audacious_info_dialog()
Matti Hamalainen <ccr@tnsp.org>
parents:
1676
diff
changeset
|
180 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
|
181 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
|
182 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
|
183 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
|
184 g_free (about_title); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
185 } |
955
4709ce4e209e
[svn] Run 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 gtk_widget_show (about_win); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
187 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
188 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
189 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
|
190 close_config_box_ok (GtkButton * button, GPtrArray * rblist) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
191 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
192 // 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
|
193 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
|
194 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
|
195 (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
|
196 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
|
197 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
198 (g_ptr_array_index (rblist, 1))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
199 |
955
4709ce4e209e
[svn] Run 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 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
|
201 (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
|
202 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
|
203 if (gtk_toggle_button_get_active |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
204 (GTK_TOGGLE_BUTTON (g_ptr_array_index (rblist, 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
|
205 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
|
206 if (gtk_toggle_button_get_active |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
207 (GTK_TOGGLE_BUTTON (g_ptr_array_index (rblist, 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
|
208 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
|
209 if (gtk_toggle_button_get_active |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
210 (GTK_TOGGLE_BUTTON (g_ptr_array_index (rblist, 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
|
211 conf.freq = 48000; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
212 |
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.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
|
214 !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
|
215 (g_ptr_array_index (rblist, 6))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
216 |
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
|
217 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
|
218 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
|
219 |
4709ce4e209e
[svn] Run 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 g_ptr_array_free (rblist, FALSE); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
221 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
222 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
223 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
|
224 close_config_box_cancel (GtkButton * button, GPtrArray * rblist) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
225 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
226 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
|
227 g_ptr_array_free (rblist, FALSE); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
228 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
229 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
230 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
|
231 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
|
232 GdkEventButton * event, CPlayers * pl) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
233 { |
955
4709ce4e209e
[svn] Run 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 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
|
235 pl->unique (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
236 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
237 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
238 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
|
239 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
|
240 GdkEventButton * event, CPlayers * pl) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
241 { |
955
4709ce4e209e
[svn] Run 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 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
|
243 } |
4709ce4e209e
[svn] Run 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 |
4709ce4e209e
[svn] Run 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 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
|
246 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
|
247 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
248 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
|
249 GtkNotebook *notebook = GTK_NOTEBOOK (gtk_notebook_new ()); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
250 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
|
251 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
|
252 GPtrArray *rblist = g_ptr_array_new (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
253 |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
254 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
|
255 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
|
256 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
|
257 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
|
258 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
259 // Add Ok & Cancel buttons |
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 GtkWidget *button; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
262 |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
263 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
|
264 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
|
265 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
|
266 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
|
267 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
|
268 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
|
269 (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
|
270 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
|
271 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
|
272 |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
273 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
|
274 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
|
275 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
|
276 (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
|
277 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
|
278 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
|
279 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
|
280 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
|
281 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
282 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
283 /***** Page 1: General *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
284 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
285 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
|
286 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
|
287 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
|
288 gtk_notebook_append_page (notebook, GTK_WIDGET (table), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
289 print_left (_("General"))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
290 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
291 // Add "Sound quality" section |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
292 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
293 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
|
294 GtkVBox *fvb; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
295 GtkRadioButton *rb; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
296 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
297 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
|
298 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
|
299 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
|
300 make_framed (GTK_WIDGET (sqt), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
301 _("Sound quality")), 0, 1, 0, 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
302 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
303 // 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
|
304 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
|
305 gtk_table_attach_defaults (sqt, |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
306 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
|
307 0, 1, 0, 1); |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
308 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
|
309 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
|
310 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
|
311 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
|
312 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
|
313 (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
|
314 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
|
315 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
|
316 g_ptr_array_add (rblist, (gpointer) rb); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
317 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
318 // 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
|
319 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
|
320 gtk_table_attach_defaults (sqt, |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
321 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
|
322 1, 1, 2); |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
323 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
|
324 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
|
325 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
|
326 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
|
327 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
|
328 (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
|
329 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
|
330 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
|
331 gtk_tooltips_set_tip (tooltips, GTK_WIDGET (rb), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
332 _("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
|
333 "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
|
334 "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
|
335 g_ptr_array_add (rblist, (gpointer) rb); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
336 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
337 // 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
|
338 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
|
339 gtk_table_attach_defaults (sqt, |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
340 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
|
341 2, 0, 2); |
1529 | 342 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
|
343 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
|
344 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
|
345 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
|
346 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
|
347 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 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget |
1529 | 349 (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
|
350 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
|
351 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
|
352 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
|
353 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
|
354 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 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget |
1529 | 356 (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
|
357 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
|
358 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
|
359 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
|
360 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
|
361 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 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget |
1529 | 363 (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
|
364 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
|
365 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
|
366 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
|
367 g_ptr_array_add (rblist, (gpointer) rb); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
368 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
369 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
370 // Add "Playback" section |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
371 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
372 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
|
373 GtkCheckButton *cb; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
374 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
375 gtk_table_attach_defaults (table, |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
376 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
|
377 2, 0, 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
378 |
955
4709ce4e209e
[svn] Run 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 cb = |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
380 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
|
381 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
|
382 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
|
383 gtk_tooltips_set_tip (tooltips, GTK_WIDGET (cb), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
384 _("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
|
385 "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
|
386 "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
|
387 "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
|
388 g_ptr_array_add (rblist, (gpointer) cb); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
389 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
390 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
391 /***** Page 2: Formats *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
392 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
393 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
|
394 gtk_notebook_append_page (notebook, GTK_WIDGET (table), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
395 print_left (_("Formats"))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
396 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
397 // Add "Format selection" section |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
398 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
399 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
|
400 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
|
401 make_framed (GTK_WIDGET (vb), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
402 _("Format selection")), 0, 1, 0, 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
403 // Add scrollable list |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
404 { |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
405 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
|
406 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
|
407 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
|
408 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
|
409 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
|
410 CPlayers::const_iterator i; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
411 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
|
412 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
|
413 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
414 // 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
|
415 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
|
416 { |
4709ce4e209e
[svn] Run 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 gint rownum; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
418 |
955
4709ce4e209e
[svn] Run 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 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
|
420 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
|
421 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
|
422 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
|
423 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
|
424 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
|
425 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
|
426 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
|
427 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
|
428 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
|
429 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
|
430 gtk_clist_select_row (fl, rownum, 0); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
431 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
432 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
433 gtk_clist_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
|
434 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
|
435 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
|
436 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
|
437 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
|
438 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
|
439 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
|
440 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
|
441 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
|
442 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
|
443 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
|
444 gtk_tooltips_set_tip (tooltips, GTK_WIDGET (eventbox), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
445 _("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
|
446 "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
|
447 "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
|
448 "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
|
449 g_ptr_array_add (rblist, pl); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
450 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
451 } |
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 // 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
|
454 gtk_widget_show_all (GTK_WIDGET (config_dlg)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
455 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
456 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
457 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
|
458 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
|
459 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
460 gchar *rowstr[2]; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
461 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
462 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
|
463 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
|
464 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
|
465 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
|
466 g_free (rowstr[1]); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
467 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
468 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
469 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
|
470 factory (VFSFile * fd, Copl * newopl) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
471 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
472 CPlayers::const_iterator i; |
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 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
|
475 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
|
476 return CAdPlug::factory (fd, newopl, conf.players); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
477 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
478 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
479 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
|
480 static void adplug_play (InputPlayback * data); |
559 | 481 |
482 | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
483 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
484 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
|
485 subsong_slider (GtkAdjustment * adj) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
486 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
487 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
|
488 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
|
489 adplug_play (playback); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
490 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
491 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
492 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
|
493 close_infobox (GtkDialog * infodlg) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
494 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
495 // 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
|
496 // 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
|
497 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
|
498 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
499 plr.infobox = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
500 plr.infodlg = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
501 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
502 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
503 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
504 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
|
505 adplug_info_box (char *filename) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
506 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
507 CSilentopl tmpopl; |
1978 | 508 VFSFile *fd = aud_vfs_buffered_file_new_from_uri (filename); |
703 | 509 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
510 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
|
511 return; |
703 | 512 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
513 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
|
514 factory (fd, &tmpopl) : plr.p; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
515 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
516 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
|
517 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
|
518 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
|
519 return; // only one info box for active song |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
520 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
521 std::ostringstream infotext; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
522 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
|
523 GtkDialog *infobox = GTK_DIALOG (gtk_dialog_new ()); |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
524 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
|
525 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
526 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
|
527 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
|
528 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
|
529 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
530 // Build file info box |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
531 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
|
532 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
|
533 |
955
4709ce4e209e
[svn] Run 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_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
|
535 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
536 // gtk_packer_set_default_border_width(packer, 2); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
537 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
538 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
|
539 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
|
540 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
|
541 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
|
542 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
|
543 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
|
544 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
|
545 GTK_WIDGET (okay_button)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
546 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
547 // Add filename section |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
548 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
549 // 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
|
550 // 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
|
551 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
|
552 gtk_box_pack_end (GTK_BOX (box), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
553 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
|
554 TRUE, 2); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
555 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
556 // Add "Song info" section |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
557 infotext << _("Title: ") << p->gettitle () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
558 _("Author: ") << p->getauthor () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
559 _("File Type: ") << p->gettype () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
560 _("Subsongs: ") << p->getsubsongs () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
561 _("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
|
562 if (plr.p == p) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
563 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
|
564 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
|
565 { |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
566 infotext << std::endl << _("Orders: ") << p->getorders () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
567 _("Patterns: ") << p->getpatterns () << std::ends; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
568 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
569 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
|
570 make_framed (print_left (infotext.str ().c_str ()), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
571 _("Song"))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
572 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
573 // 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
|
574 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
|
575 { |
4709ce4e209e
[svn] Run 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 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
|
577 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
|
578 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
|
579 gtk_container_add (GTK_CONTAINER (hbox), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
580 make_framed (GTK_WIDGET (plr.infobox), _("Playback"))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
581 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
582 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
583 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
584 // 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
|
585 // 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
|
586 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
|
587 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
588 // 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
|
589 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
|
590 { |
4709ce4e209e
[svn] Run 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 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
|
592 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
|
593 GtkCList *instnames; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
594 gchar tmpstr[10]; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
595 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
596 { |
1532 | 597 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
|
598 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
|
599 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
600 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
|
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 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
|
603 { |
4709ce4e209e
[svn] Run 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 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
|
605 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
|
606 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
607 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
608 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
|
609 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
|
610 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
|
611 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
|
612 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
613 // 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
|
614 // 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
|
615 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
|
616 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
617 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
618 // 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
|
619 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
|
620 { |
4709ce4e209e
[svn] Run 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 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
|
622 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
|
623 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
|
624 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
625 gtk_scrolled_window_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
|
626 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
|
627 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
|
628 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
|
629 |
955
4709ce4e209e
[svn] Run 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_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
|
631 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
|
632 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
|
633 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
|
634 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
635 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
636 // 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
|
637 // 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
|
638 gtk_box_pack_end (GTK_BOX (hbox2), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
639 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
|
640 TRUE, 2); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
641 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
642 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
643 // 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
|
644 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
|
645 { |
4709ce4e209e
[svn] Run 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 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
|
647 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
|
648 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
|
649 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
|
650 GtkHScale *slider = GTK_HSCALE (gtk_hscale_new (adj)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
651 |
955
4709ce4e209e
[svn] Run 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 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
|
653 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
|
654 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
|
655 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
|
656 gtk_scale_set_digits (GTK_SCALE (slider), 0); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
657 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
658 // 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
|
659 // 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
|
660 gtk_box_pack_end (GTK_BOX (hbox2), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
661 make_framed (GTK_WIDGET (slider), _("Subsong selection")), |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
662 TRUE, TRUE, 2); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
663 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
664 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
665 // 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
|
666 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
|
667 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
|
668 { // Remember widget, so we could destroy it later |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
669 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
|
670 } |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
671 else // Delete temporary player |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
672 delete p; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
673 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
674 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
675 /***** Main player (!! threaded !!) *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
676 |
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
|
677 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
|
678 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
|
679 { |
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 CSilentopl tmpopl; |
1978 | 681 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
|
682 |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
683 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
|
684 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
|
685 |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
686 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
|
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 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
|
689 { |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
690 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
|
691 if (! p->getauthor().empty()) |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
692 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
|
693 if (! p->gettitle().empty()) |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
694 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
|
695 else if (! p->getdesc().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->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
|
697 else |
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, g_path_get_basename(filename)); |
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
699 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
|
700 aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "sequenced"); |
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
701 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
|
702 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
|
703 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
|
704 } |
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 |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
706 return 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
|
707 } |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
708 |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
709 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
|
710 { |
2055 | 711 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
|
712 if ( result ) |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
713 *length = aud_tuple_get_int(ti, FIELD_LENGTH, NULL); |
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
714 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
|
715 |
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
|
716 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
|
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 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
719 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
|
720 update_infobox (void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
721 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
722 std::ostringstream infotext; |
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 // 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
|
725 infotext << _("Order: ") << plr.p->getorder () << " / " << plr.p-> |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
726 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
|
727 getpattern () << " / " << plr.p-> |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
728 getpatterns () << std::endl << _("Row: ") << plr.p-> |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
729 getrow () << std::endl << _("Speed: ") << plr.p-> |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
730 getspeed () << std::endl << _("Timer: ") << plr.p-> |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
731 getrefresh () << _("Hz") << std::ends; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
732 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
733 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
|
734 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
|
735 GDK_THREADS_LEAVE (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
736 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
737 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
738 // Define sampsize macro (only usable inside play_loop()!) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
739 #define sampsize ((bit16 ? 2 : 1) * (stereo ? 2 : 1)) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
740 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
741 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
|
742 play_loop (void *data) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
743 /* 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
|
744 { |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
745 InputPlayback *playback = (InputPlayback *) data; |
703 | 746 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
|
747 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
|
748 CEmuopl opl (conf.freq, conf.bit16, conf.stereo); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
749 long toadd = 0, i, towrite; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
750 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
|
751 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
|
752 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
|
753 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
|
754 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
|
755 unsigned long freq = conf.freq; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
756 |
703 | 757 // we use VfsBufferedFile class here because adplug does a lot of |
758 // probing. a short delay before probing begins is better than | |
759 // a lot of delay during probing. | |
1978 | 760 VFSFile *fd = aud_vfs_buffered_file_new_from_uri (playback->filename); |
703 | 761 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
762 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
|
763 { |
4709ce4e209e
[svn] Run 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 plr.playing = false; |
1410
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
765 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
|
766 } |
703 | 767 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
768 // 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
|
769 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
|
770 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
|
771 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
772 dbg_printf ("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
|
773 // 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
|
774 plr.playing = false; |
1410
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
775 return (NULL); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
776 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
777 |
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
|
778 // 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
|
779 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
|
780 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
|
781 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
|
782 { |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
783 plr.songtitle = format_and_free_ti( ti, &songlength ); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
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.songlength = songlength; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
786 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
787 // 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
|
788 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
|
789 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
|
790 { |
4709ce4e209e
[svn] Run 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 strcpy (plr.filename, filename); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
792 plr.subsong = 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
793 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
794 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
795 // 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
|
796 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
|
797 sndbuf = (char *) malloc (SNDBUFSIZE * sampsize); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
798 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
799 // 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
|
800 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
|
801 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
|
802 freq, stereo ? 2 : 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
803 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
804 // 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
|
805 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
|
806 plr.p->rewind (plr.subsong); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
807 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
808 // 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
|
809 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
|
810 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
|
811 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
812 // 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
|
813 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
|
814 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
815 // 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
|
816 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
|
817 { |
4709ce4e209e
[svn] Run 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 plr.p->rewind (plr.subsong); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
819 plr.time_ms = 0.0f; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
820 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
821 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
822 // 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
|
823 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
|
824 plr.time_ms += 1000 / plr.p->getrefresh (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
825 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
826 // 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
|
827 playback->output->flush ((int) plr.time_ms); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
828 plr.seek = -1; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
829 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
830 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
831 // 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
|
832 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
|
833 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
|
834 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
|
835 { |
4709ce4e209e
[svn] Run 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 (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
|
837 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
838 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
|
839 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
|
840 plr.time_ms += 1000 / plr.p->getrefresh (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
841 } |
955
4709ce4e209e
[svn] Run 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 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
|
843 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
|
844 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
|
845 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
|
846 toadd -= (long) (plr.p->getrefresh () * i); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
847 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
848 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
849 // write sound buffer |
1998
8f3188746b64
chase last changeset in aud
William Pitcock <nenolod@atheme.org>
parents:
1991
diff
changeset
|
850 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
|
851 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
|
852 stereo ? 2 : 1, SNDBUFSIZE * sampsize, sndbuf, NULL); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
853 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
854 // 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
|
855 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
|
856 update_infobox (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
857 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
858 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
859 // 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
|
860 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
|
861 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
|
862 { // 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
|
863 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
|
864 while (playback->output->buffer_playing ()) |
1676
aee4ebea943a
xmms_usleep() was removed, use g_usleep()
Matti Hamalainen <ccr@tnsp.org>
parents:
1634
diff
changeset
|
865 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
|
866 } |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
867 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
|
868 { // 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
|
869 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
|
870 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
|
871 playback->output->buffer_free (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
872 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
873 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
874 // 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
|
875 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
|
876 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
|
877 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
|
878 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
|
879 { |
4709ce4e209e
[svn] Run 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 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
|
881 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
|
882 } |
4709ce4e209e
[svn] Run 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 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
|
884 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
|
885 dbg_printf (".\n"); |
1978 | 886 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
|
887 return (NULL); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
888 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
889 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
890 // sampsize macro not useful anymore. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
891 #undef sampsize |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
892 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
893 /***** Informational *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
894 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
895 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
|
896 adplug_is_our_fd (gchar * filename, VFSFile * fd) |
703 | 897 { |
898 CSilentopl tmpopl; | |
899 | |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
900 CPlayer *p = factory (fd, &tmpopl); |
703 | 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 dbg_printf ("adplug_is_our_file(\"%s\"): returned ", filename); |
703 | 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 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
|
905 { |
703 | 906 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
|
907 dbg_printf ("TRUE\n"); |
703 | 908 return TRUE; |
909 } | |
910 | |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
911 dbg_printf ("FALSE\n"); |
703 | 912 return FALSE; |
913 } | |
914 | |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
915 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
|
916 adplug_get_time (InputPlayback * data) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
917 { |
955
4709ce4e209e
[svn] Run 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 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
|
919 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
920 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
|
921 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
|
922 } |
4709ce4e209e
[svn] Run 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 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
|
924 { |
4709ce4e209e
[svn] Run 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 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
|
926 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
|
927 } |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
928 return playback->output->output_time (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
929 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
930 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
931 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
|
932 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
|
933 { |
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
|
934 *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
|
935 *title = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
936 |
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
|
937 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
|
938 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
|
939 *title = format_and_free_ti( ti, length ); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
940 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
941 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
942 /***** Player control *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
943 |
955
4709ce4e209e
[svn] Run 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 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
|
945 adplug_play (InputPlayback * data) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
946 { |
559 | 947 char *filename = data->filename; |
948 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
|
949 dbg_printf ("adplug_play(\"%s\"): ", filename); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
950 audio_error = FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
951 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
952 // 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
|
953 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
|
954 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
|
955 gtk_widget_destroy (GTK_WIDGET (plr.infodlg)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
956 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
957 // 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
|
958 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
|
959 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
|
960 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
|
961 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
|
962 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
963 audio_error = TRUE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
964 return; |
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 // 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
|
968 // 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
|
969 // 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
|
970 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
|
971 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
|
972 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
|
973 plr.seek = -1; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
974 |
1410
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
975 // start player func |
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
976 dbg_printf ("play"); |
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
977 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
|
978 playback->set_pb_ready(playback); |
1410
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
979 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
|
980 dbg_printf (".\n"); |
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 |
955
4709ce4e209e
[svn] Run 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 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
|
984 adplug_stop (InputPlayback * playback) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
985 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
986 dbg_printf ("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
|
987 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
|
988 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
|
989 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
|
990 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
|
991 dbg_printf (".\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
992 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
993 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
994 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
|
995 adplug_pause (InputPlayback * playback, short paused) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
996 { |
955
4709ce4e209e
[svn] Run 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 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
|
998 playback->output->pause (paused); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
999 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1000 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1001 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
|
1002 adplug_seek (InputPlayback * data, int time) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1003 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1004 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
|
1005 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
|
1006 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1007 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1008 /***** Configuration file handling *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1009 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1010 #define CFG_VERSION "AdPlug" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1011 |
955
4709ce4e209e
[svn] Run 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 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
|
1013 adplug_init (void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1014 { |
955
4709ce4e209e
[svn] Run 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 dbg_printf ("adplug_init(): open, "); |
2523
769e17da93dd
Replaced s/ConfigDb/mcs_handle_t/g, as per changes in the core.
Matti Hamalainen <ccr@tnsp.org>
parents:
2497
diff
changeset
|
1016 mcs_handle_t *db = aud_cfg_db_open (); |
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 // 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
|
1019 dbg_printf ("read, "); |
2124 | 1020 aud_cfg_db_get_bool (db, CFG_VERSION, "16bit", (gboolean *) & conf.bit16); |
1021 aud_cfg_db_get_bool (db, CFG_VERSION, "Stereo", (gboolean *) & conf.stereo); | |
1022 aud_cfg_db_get_int (db, CFG_VERSION, "Frequency", (gint *) & conf.freq); | |
1023 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
|
1024 (gboolean *) & conf.endless); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1025 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1026 // 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
|
1027 dbg_printf ("exclusion, "); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1028 { |
1045 | 1029 gchar *cfgstr = NULL, *exclude = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1030 gboolean cfgread; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1031 |
2124 | 1032 cfgread = aud_cfg_db_get_string (db, CFG_VERSION, "Exclude", &cfgstr); |
1045 | 1033 if (cfgread) { |
1034 exclude = (char *) malloc (strlen (cfgstr) + 2); | |
1035 strcpy (exclude, cfgstr); | |
1036 exclude[strlen (exclude) + 1] = '\0'; | |
1037 g_strdelimit (exclude, ":", '\0'); | |
1038 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
|
1039 conf.players.remove (conf.players.lookup_filetype (p)); |
1045 | 1040 free (exclude); free (cfgstr); |
1041 } | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1042 } |
2124 | 1043 aud_cfg_db_close (db); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1044 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1045 // 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
|
1046 dbg_printf ("database"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1047 plr.db = new CAdPlugDatabase; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1048 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1049 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1050 const char *homedir = getenv ("HOME"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1051 |
955
4709ce4e209e
[svn] Run 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 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
|
1053 { |
1301
df5d07d7ca7c
AdPlug database loading fix by Christian "Joker" Birchinger.
Tony Vroon <chainsaw@gentoo.org>
parents:
1286
diff
changeset
|
1054 std::string userdb; |
df5d07d7ca7c
AdPlug database loading fix by Christian "Joker" Birchinger.
Tony Vroon <chainsaw@gentoo.org>
parents:
1286
diff
changeset
|
1055 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
|
1056 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
|
1057 dbg_printf (" (userdb=\"%s\")", userdb.c_str()); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1058 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1059 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1060 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
|
1061 dbg_printf (".\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1062 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1063 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1064 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
|
1065 adplug_quit (void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1066 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1067 dbg_printf ("adplug_quit(): open, "); |
2523
769e17da93dd
Replaced s/ConfigDb/mcs_handle_t/g, as per changes in the core.
Matti Hamalainen <ccr@tnsp.org>
parents:
2497
diff
changeset
|
1068 mcs_handle_t *db = aud_cfg_db_open (); |
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 // 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
|
1071 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
|
1072 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
|
1073 delete plr.db; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1074 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1075 // 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
|
1076 dbg_printf ("write, "); |
2124 | 1077 aud_cfg_db_set_bool (db, CFG_VERSION, "16bit", conf.bit16); |
1078 aud_cfg_db_set_bool (db, CFG_VERSION, "Stereo", conf.stereo); | |
1079 aud_cfg_db_set_int (db, CFG_VERSION, "Frequency", conf.freq); | |
1080 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
|
1081 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1082 dbg_printf ("exclude, "); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1083 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
|
1084 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
|
1085 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
|
1086 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
|
1087 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
|
1088 { |
4709ce4e209e
[svn] Run 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 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
|
1090 exclude += ":"; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1091 exclude += (*i)->filetype; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1092 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1093 gchar *cfgval = g_strdup (exclude.c_str ()); |
2124 | 1094 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
|
1095 free (cfgval); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1096 |
955
4709ce4e209e
[svn] Run 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 dbg_printf ("close"); |
2124 | 1098 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
|
1099 dbg_printf (".\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1100 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1101 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1102 /***** Plugin (exported) *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1103 |
2559
a3fecbacf65d
Add fmts gchar array of supported extensions.
Tony Vroon <chainsaw@gentoo.org>
parents:
2523
diff
changeset
|
1104 const gchar *fmts[] = |
a3fecbacf65d
Add fmts gchar array of supported extensions.
Tony Vroon <chainsaw@gentoo.org>
parents:
2523
diff
changeset
|
1105 { "a2m", "adl", "amd", "bam", "cff", "cmf", "d00", "dfm", "dmo", "dro", |
a3fecbacf65d
Add fmts gchar array of supported extensions.
Tony Vroon <chainsaw@gentoo.org>
parents:
2523
diff
changeset
|
1106 "dtm", "hsc", "hsp", "ins", "jbm", "ksm", "laa", "lds", "m", "mad", |
a3fecbacf65d
Add fmts gchar array of supported extensions.
Tony Vroon <chainsaw@gentoo.org>
parents:
2523
diff
changeset
|
1107 "mkj", "msc", "rad", "raw", "rix", "rol", "s3m", "sa2", "sat", "sci", |
a3fecbacf65d
Add fmts gchar array of supported extensions.
Tony Vroon <chainsaw@gentoo.org>
parents:
2523
diff
changeset
|
1108 "sng", "wlf", "xad", "xsm", |
a3fecbacf65d
Add fmts gchar array of supported extensions.
Tony Vroon <chainsaw@gentoo.org>
parents:
2523
diff
changeset
|
1109 NULL }; |
a3fecbacf65d
Add fmts gchar array of supported extensions.
Tony Vroon <chainsaw@gentoo.org>
parents:
2523
diff
changeset
|
1110 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1111 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
|
1112 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
|
1113 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
|
1114 (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
|
1115 adplug_init, // plugin functions... |
1634 | 1116 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
|
1117 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
|
1118 adplug_config, |
1634 | 1119 FALSE, |
2725
603b242c7bae
Remove is_our_file() from AdPlug (using tuple and vfs versions instead).
Matti Hamalainen <ccr@tnsp.org>
parents:
2712
diff
changeset
|
1120 NULL, |
603b242c7bae
Remove is_our_file() from AdPlug (using tuple and vfs versions instead).
Matti Hamalainen <ccr@tnsp.org>
parents:
2712
diff
changeset
|
1121 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
|
1122 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
|
1123 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
|
1124 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
|
1125 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
|
1126 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
|
1127 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
|
1128 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
|
1129 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
|
1130 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
|
1131 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
|
1132 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
|
1133 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
|
1134 adplug_info_box, |
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
|
1135 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
|
1136 adplug_is_our_fd, |
2559
a3fecbacf65d
Add fmts gchar array of supported extensions.
Tony Vroon <chainsaw@gentoo.org>
parents:
2523
diff
changeset
|
1137 (gchar **)fmts, |
955
4709ce4e209e
[svn] Run 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 }; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1139 |
1096 | 1140 InputPlugin *adplug_iplist[] = { &adplug_ip, NULL }; |
1141 | |
1395
761e17b23e0c
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
1301
diff
changeset
|
1142 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
|
1143 |