Mercurial > audlegacy-plugins
annotate src/adplug/adplug-xmms.cc @ 2504:9fd51b549097
added a cast to suppress warning
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Wed, 02 Apr 2008 12:35:24 +0900 |
parents | ed6c81bd9016 |
children | 769e17da93dd |
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" |
1952
17a6441c71b6
Some missed #include "" to <> changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
1950
diff
changeset
|
32 #include <audacious/i18n.h> |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
33 extern "C" |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
34 { |
1950
2ebeb7816c5e
Change from "" to <>-style includes. With thanks to ccr for the correct sed voodoo.
chainsaw@localhost
parents:
1876
diff
changeset
|
35 #include <audacious/plugin.h> |
2ebeb7816c5e
Change from "" to <>-style includes. With thanks to ccr for the correct sed voodoo.
chainsaw@localhost
parents:
1876
diff
changeset
|
36 #include <audacious/output.h> |
2ebeb7816c5e
Change from "" to <>-style includes. With thanks to ccr for the correct sed voodoo.
chainsaw@localhost
parents:
1876
diff
changeset
|
37 #include <audacious/util.h> |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
41 /***** Defines *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
42 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
43 // Version string |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
44 #define ADPLUG_NAME "AdPlug (AdLib Sound Player)" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
45 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
46 // Sound buffer size in samples |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
47 #define SNDBUFSIZE 512 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
48 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
49 // AdPlug's 8 and 16 bit audio formats |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
50 #define FORMAT_8 FMT_U8 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
51 #define FORMAT_16 FMT_S16_NE |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
52 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
53 // Default file name of AdPlug's database file |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
54 #define ADPLUGDB_FILE "adplug.db" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
55 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
56 // Default AdPlug user's configuration subdirectory |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
57 #define ADPLUG_CONFDIR ".adplug" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
58 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
59 /***** Global variables *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
60 |
955
4709ce4e209e
[svn] Run 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 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
|
62 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
|
63 GtkWidget *about_win = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
64 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
65 // 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
|
66 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
|
67 { |
4709ce4e209e
[svn] Run 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 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
|
69 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
|
70 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
|
71 } 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
|
72 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
73 44100l, true, false, false, CAdPlug::players}; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
74 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
75 // 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
|
76 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
|
77 { |
4709ce4e209e
[svn] Run 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 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
|
79 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
|
80 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
|
81 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
|
82 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
|
83 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
|
84 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
|
85 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
|
86 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
|
87 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
|
88 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
|
89 } 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
|
90 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
91 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
|
92 |
559 | 93 static InputPlayback *playback; |
94 | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
95 /***** Debugging *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
96 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
97 #ifdef DEBUG |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
98 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
99 #include <stdarg.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
100 |
955
4709ce4e209e
[svn] Run 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 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
|
102 dbg_printf (const char *fmt, ...) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
103 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
104 va_list argptr; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
105 |
955
4709ce4e209e
[svn] Run 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 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
|
107 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
|
108 va_end (argptr); |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
111 #else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
112 |
955
4709ce4e209e
[svn] Run 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 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
|
114 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
|
115 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
116 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
117 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
118 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
119 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
120 /***** [Dialog]: Utility functions *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
121 |
955
4709ce4e209e
[svn] Run 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 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
|
123 make_framed (GtkWidget * what, const gchar * label) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
124 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
125 GtkWidget *framebox = gtk_frame_new (label); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
126 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
127 gtk_container_add (GTK_CONTAINER (framebox), what); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
128 return framebox; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
129 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
130 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
131 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
|
132 print_left (const gchar * text) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
133 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
134 GtkLabel *label = GTK_LABEL (gtk_label_new (text)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
135 |
955
4709ce4e209e
[svn] Run 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_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
|
137 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
|
138 return GTK_WIDGET (label); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
139 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
140 |
2239 | 141 #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
|
142 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
|
143 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
|
144 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
145 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
|
146 *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
|
147 *tmpbutton = (char *) malloc (strlen (button) + 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
148 |
955
4709ce4e209e
[svn] Run 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 (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
|
150 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
|
151 strcpy (tmpbutton, button); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
152 |
1677
f6f5603a0954
xmms_show_message() changed to audacious_info_dialog()
Matti Hamalainen <ccr@tnsp.org>
parents:
1676
diff
changeset
|
153 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
|
154 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
|
155 &msgbox); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
156 |
955
4709ce4e209e
[svn] Run 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 (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
|
158 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
|
159 free (tmpbutton); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
160 } |
2239 | 161 #endif |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
162 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
163 /***** Dialog boxes *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
164 |
955
4709ce4e209e
[svn] Run 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 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
|
166 adplug_about (void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
167 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
168 if (!about_win) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
169 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
170 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
|
171 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
|
172 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
|
173 _ |
4709ce4e209e
[svn] Run 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 ("\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
|
175 "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
|
176 "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
|
177 "\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
|
178 "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
|
179 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
|
180 about_win = |
1677
f6f5603a0954
xmms_show_message() changed to audacious_info_dialog()
Matti Hamalainen <ccr@tnsp.org>
parents:
1676
diff
changeset
|
181 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
|
182 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
|
183 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
|
184 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
|
185 g_free (about_title); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
186 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
187 gtk_widget_show (about_win); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
188 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
189 |
955
4709ce4e209e
[svn] Run 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 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
|
191 close_config_box_ok (GtkButton * button, GPtrArray * rblist) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
192 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
193 // 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
|
194 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
|
195 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
|
196 (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
|
197 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
|
198 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
|
199 (g_ptr_array_index (rblist, 1))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
200 |
955
4709ce4e209e
[svn] Run 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 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
|
202 (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
|
203 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
|
204 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
|
205 (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
|
206 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
|
207 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
|
208 (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
|
209 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
|
210 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
|
211 (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
|
212 conf.freq = 48000; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
213 |
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
|
214 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
|
215 !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
|
216 (g_ptr_array_index (rblist, 6))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
217 |
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
|
218 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
|
219 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
|
220 |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
221 g_ptr_array_free (rblist, FALSE); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
222 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
223 |
955
4709ce4e209e
[svn] Run 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 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
|
225 close_config_box_cancel (GtkButton * button, GPtrArray * rblist) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
226 { |
955
4709ce4e209e
[svn] Run 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 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
|
228 g_ptr_array_free (rblist, FALSE); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
229 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
230 |
955
4709ce4e209e
[svn] Run 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 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
|
232 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
|
233 GdkEventButton * event, CPlayers * pl) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
234 { |
955
4709ce4e209e
[svn] Run 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->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
|
236 pl->unique (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
237 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
238 |
955
4709ce4e209e
[svn] Run 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 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
|
240 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
|
241 GdkEventButton * event, CPlayers * pl) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
242 { |
955
4709ce4e209e
[svn] Run 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 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
|
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 |
4709ce4e209e
[svn] Run 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 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
|
247 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
|
248 { |
4709ce4e209e
[svn] Run 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 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
|
250 GtkNotebook *notebook = GTK_NOTEBOOK (gtk_notebook_new ()); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
251 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
|
252 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
|
253 GPtrArray *rblist = g_ptr_array_new (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
254 |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
255 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
|
256 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
|
257 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
|
258 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
|
259 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
260 // Add Ok & Cancel buttons |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
261 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
262 GtkWidget *button; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
263 |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
264 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
|
265 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
|
266 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
|
267 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
|
268 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
|
269 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
|
270 (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
|
271 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
|
272 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
|
273 |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
274 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
|
275 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
|
276 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
|
277 (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
|
278 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
|
279 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
|
280 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
|
281 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
|
282 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
283 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
284 /***** Page 1: General *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
285 |
955
4709ce4e209e
[svn] Run 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 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
|
287 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
|
288 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
|
289 gtk_notebook_append_page (notebook, GTK_WIDGET (table), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
290 print_left (_("General"))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
291 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
292 // Add "Sound quality" section |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
293 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
294 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
|
295 GtkVBox *fvb; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
296 GtkRadioButton *rb; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
297 |
955
4709ce4e209e
[svn] Run 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_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
|
299 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
|
300 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
|
301 make_framed (GTK_WIDGET (sqt), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
302 _("Sound quality")), 0, 1, 0, 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
303 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
304 // 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
|
305 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
|
306 gtk_table_attach_defaults (sqt, |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
307 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
|
308 0, 1, 0, 1); |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
309 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
|
310 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
|
311 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
|
312 rb = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
313 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
|
314 (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
|
315 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
|
316 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
|
317 g_ptr_array_add (rblist, (gpointer) rb); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
318 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
319 // 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
|
320 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
|
321 gtk_table_attach_defaults (sqt, |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
322 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
|
323 1, 1, 2); |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
324 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
|
325 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
|
326 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
|
327 rb = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
328 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
|
329 (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
|
330 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
|
331 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
|
332 gtk_tooltips_set_tip (tooltips, GTK_WIDGET (rb), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
333 _("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
|
334 "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
|
335 "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
|
336 g_ptr_array_add (rblist, (gpointer) rb); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
337 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
338 // 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
|
339 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
|
340 gtk_table_attach_defaults (sqt, |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
341 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
|
342 2, 0, 2); |
1529 | 343 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
|
344 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
|
345 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
|
346 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
|
347 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
|
348 rb = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
349 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget |
1529 | 350 (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
|
351 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
|
352 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
|
353 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
|
354 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
|
355 rb = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
356 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget |
1529 | 357 (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
|
358 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
|
359 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
|
360 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
|
361 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
|
362 rb = |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
363 GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget |
1529 | 364 (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
|
365 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
|
366 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
|
367 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
|
368 g_ptr_array_add (rblist, (gpointer) rb); |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
371 // Add "Playback" section |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
372 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
373 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
|
374 GtkCheckButton *cb; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
375 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
376 gtk_table_attach_defaults (table, |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
377 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
|
378 2, 0, 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
379 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
380 cb = |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
381 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
|
382 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
|
383 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
|
384 gtk_tooltips_set_tip (tooltips, GTK_WIDGET (cb), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
385 _("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
|
386 "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
|
387 "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
|
388 "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
|
389 g_ptr_array_add (rblist, (gpointer) cb); |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
392 /***** Page 2: Formats *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
393 |
955
4709ce4e209e
[svn] Run 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 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
|
395 gtk_notebook_append_page (notebook, GTK_WIDGET (table), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
396 print_left (_("Formats"))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
397 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
398 // Add "Format selection" section |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
399 { |
955
4709ce4e209e
[svn] Run 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 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
|
401 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
|
402 make_framed (GTK_WIDGET (vb), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
403 _("Format selection")), 0, 1, 0, 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
404 // Add scrollable list |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
405 { |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
406 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
|
407 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
|
408 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
|
409 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
|
410 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
|
411 CPlayers::const_iterator i; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
412 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
|
413 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
|
414 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
415 // 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
|
416 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
|
417 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
418 gint rownum; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
419 |
955
4709ce4e209e
[svn] Run 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 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
|
421 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
|
422 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
|
423 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
|
424 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
|
425 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
|
426 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
|
427 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
|
428 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
|
429 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
|
430 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
|
431 gtk_clist_select_row (fl, rownum, 0); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
432 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
433 |
955
4709ce4e209e
[svn] Run 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_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
|
435 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
|
436 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
|
437 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
|
438 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
|
439 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
|
440 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
|
441 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
|
442 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
|
443 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
|
444 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
|
445 gtk_tooltips_set_tip (tooltips, GTK_WIDGET (eventbox), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
446 _("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
|
447 "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
|
448 "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
|
449 "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
|
450 g_ptr_array_add (rblist, pl); |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
454 // 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
|
455 gtk_widget_show_all (GTK_WIDGET (config_dlg)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
456 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
457 |
955
4709ce4e209e
[svn] Run 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 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
|
459 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
|
460 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
461 gchar *rowstr[2]; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
462 |
955
4709ce4e209e
[svn] Run 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[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
|
464 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
|
465 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
|
466 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
|
467 g_free (rowstr[1]); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
468 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
469 |
955
4709ce4e209e
[svn] Run 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 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
|
471 factory (VFSFile * fd, Copl * newopl) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
472 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
473 CPlayers::const_iterator i; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
474 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
475 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
|
476 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
|
477 return CAdPlug::factory (fd, newopl, conf.players); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
478 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
479 |
955
4709ce4e209e
[svn] Run 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_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
|
481 static void adplug_play (InputPlayback * data); |
559 | 482 |
483 | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
484 |
955
4709ce4e209e
[svn] Run 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 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
|
486 subsong_slider (GtkAdjustment * adj) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
487 { |
955
4709ce4e209e
[svn] Run 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 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
|
489 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
|
490 adplug_play (playback); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
491 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
492 |
955
4709ce4e209e
[svn] Run 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 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
|
494 close_infobox (GtkDialog * infodlg) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
495 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
496 // 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
|
497 // 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
|
498 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
|
499 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
500 plr.infobox = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
501 plr.infodlg = NULL; |
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 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
504 |
955
4709ce4e209e
[svn] Run 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 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
|
506 adplug_info_box (char *filename) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
507 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
508 CSilentopl tmpopl; |
1978 | 509 VFSFile *fd = aud_vfs_buffered_file_new_from_uri (filename); |
703 | 510 |
955
4709ce4e209e
[svn] Run 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 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
|
512 return; |
703 | 513 |
955
4709ce4e209e
[svn] Run 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 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
|
515 factory (fd, &tmpopl) : plr.p; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
516 |
955
4709ce4e209e
[svn] Run 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 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
|
518 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
|
519 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
|
520 return; // only one info box for active song |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
521 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
522 std::ostringstream infotext; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
523 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
|
524 GtkDialog *infobox = GTK_DIALOG (gtk_dialog_new ()); |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
525 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
|
526 |
955
4709ce4e209e
[svn] Run 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 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
|
528 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
|
529 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
|
530 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
531 // Build file info box |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
532 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
|
533 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
|
534 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
535 gtk_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
|
536 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
537 // gtk_packer_set_default_border_width(packer, 2); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
538 |
955
4709ce4e209e
[svn] Run 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 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
|
540 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
|
541 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
|
542 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
|
543 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
|
544 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
|
545 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
|
546 GTK_WIDGET (okay_button)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
547 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
548 // Add filename section |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
549 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
550 // 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
|
551 // 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
|
552 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
|
553 gtk_box_pack_end (GTK_BOX (box), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
554 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
|
555 TRUE, 2); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
556 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
557 // Add "Song info" section |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
558 infotext << _("Title: ") << p->gettitle () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
559 _("Author: ") << p->getauthor () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
560 _("File Type: ") << p->gettype () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
561 _("Subsongs: ") << p->getsubsongs () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
562 _("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
|
563 if (plr.p == p) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
564 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
|
565 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
|
566 { |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
567 infotext << std::endl << _("Orders: ") << p->getorders () << std::endl << |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
568 _("Patterns: ") << p->getpatterns () << std::ends; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
569 } |
955
4709ce4e209e
[svn] Run 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 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
|
571 make_framed (print_left (infotext.str ().c_str ()), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
572 _("Song"))); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
573 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
574 // 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
|
575 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
|
576 { |
4709ce4e209e
[svn] Run 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 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
|
578 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
|
579 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
|
580 gtk_container_add (GTK_CONTAINER (hbox), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
581 make_framed (GTK_WIDGET (plr.infobox), _("Playback"))); |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
584 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
585 // 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
|
586 // 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
|
587 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
|
588 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
589 // 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
|
590 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
|
591 { |
4709ce4e209e
[svn] Run 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 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
|
593 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
|
594 GtkCList *instnames; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
595 gchar tmpstr[10]; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
596 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
597 { |
1532 | 598 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
|
599 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
|
600 } |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
601 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
|
602 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
603 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
|
604 { |
4709ce4e209e
[svn] Run 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 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
|
606 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
|
607 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
608 |
955
4709ce4e209e
[svn] Run 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_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
|
610 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
|
611 GTK_POLICY_AUTOMATIC); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
612 gtk_container_add (GTK_CONTAINER (instwnd), GTK_WIDGET (instnames)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
613 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
614 // 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
|
615 // 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
|
616 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
|
617 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
618 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
619 // 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
|
620 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
|
621 { |
4709ce4e209e
[svn] Run 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 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
|
623 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
|
624 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
|
625 |
955
4709ce4e209e
[svn] Run 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_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
|
627 GTK_POLICY_AUTOMATIC); |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
628 gtk_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
|
629 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
|
630 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
631 gtk_text_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
|
632 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
|
633 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
|
634 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
|
635 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
636 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
637 // 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
|
638 // 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
|
639 gtk_box_pack_end (GTK_BOX (hbox2), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
640 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
|
641 TRUE, 2); |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
644 // 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
|
645 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
|
646 { |
4709ce4e209e
[svn] Run 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 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
|
648 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
|
649 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
|
650 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
|
651 GtkHScale *slider = GTK_HSCALE (gtk_hscale_new (adj)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
652 |
955
4709ce4e209e
[svn] Run 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_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
|
654 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
|
655 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
|
656 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
|
657 gtk_scale_set_digits (GTK_SCALE (slider), 0); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
658 // Former packer layout, for future reproduction |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
659 // 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
|
660 // 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
|
661 gtk_box_pack_end (GTK_BOX (hbox2), |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
662 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
|
663 TRUE, TRUE, 2); |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
666 // 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
|
667 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
|
668 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
|
669 { // Remember widget, so we could destroy it later |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
670 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
|
671 } |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
672 else // Delete temporary player |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
673 delete p; |
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
676 /***** Main player (!! threaded !!) *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
677 |
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
|
678 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
|
679 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
|
680 { |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
681 CSilentopl tmpopl; |
1978 | 682 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
|
683 |
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 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
|
685 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
|
686 |
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 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
|
688 |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
689 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
|
690 { |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
691 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
|
692 if (! p->getauthor().empty()) |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
693 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
|
694 if (! p->gettitle().empty()) |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
695 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
|
696 else if (! p->getdesc().empty()) |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
697 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
|
698 else |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
699 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
|
700 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
|
701 aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "sequenced"); |
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
702 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
|
703 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
|
704 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
|
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 |
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 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
|
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 |
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 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
|
711 { |
2055 | 712 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
|
713 if ( result ) |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
714 *length = aud_tuple_get_int(ti, FIELD_LENGTH, NULL); |
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1952
diff
changeset
|
715 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
|
716 |
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 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
|
718 } |
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
719 |
955
4709ce4e209e
[svn] Run 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 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
|
721 update_infobox (void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
722 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
723 std::ostringstream infotext; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
724 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
725 // 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
|
726 infotext << _("Order: ") << plr.p->getorder () << " / " << plr.p-> |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
727 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
|
728 getpattern () << " / " << plr.p-> |
1286
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
729 getpatterns () << std::endl << _("Row: ") << plr.p-> |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
730 getrow () << std::endl << _("Speed: ") << plr.p-> |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
731 getspeed () << std::endl << _("Timer: ") << plr.p-> |
4462de7be194
"Ad-plug" is now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1096
diff
changeset
|
732 getrefresh () << _("Hz") << std::ends; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
733 |
955
4709ce4e209e
[svn] Run 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 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
|
735 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
|
736 GDK_THREADS_LEAVE (); |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
739 // Define sampsize macro (only usable inside play_loop()!) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
740 #define sampsize ((bit16 ? 2 : 1) * (stereo ? 2 : 1)) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
741 |
955
4709ce4e209e
[svn] Run 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 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
|
743 play_loop (void *data) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
744 /* 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
|
745 { |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
746 InputPlayback *playback = (InputPlayback *) data; |
703 | 747 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
|
748 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
|
749 CEmuopl opl (conf.freq, conf.bit16, conf.stereo); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
750 long toadd = 0, i, towrite; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
751 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
|
752 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
|
753 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
|
754 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
|
755 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
|
756 unsigned long freq = conf.freq; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
757 |
703 | 758 // we use VfsBufferedFile class here because adplug does a lot of |
759 // probing. a short delay before probing begins is better than | |
760 // a lot of delay during probing. | |
1978 | 761 VFSFile *fd = aud_vfs_buffered_file_new_from_uri (playback->filename); |
703 | 762 |
955
4709ce4e209e
[svn] Run 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 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
|
764 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
765 plr.playing = false; |
1410
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
766 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
|
767 } |
703 | 768 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
769 // 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
|
770 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
|
771 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
|
772 { |
4709ce4e209e
[svn] Run 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 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
|
774 // 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
|
775 plr.playing = false; |
1410
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
776 return (NULL); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
777 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
778 |
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
|
779 // 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
|
780 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
|
781 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
|
782 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
|
783 { |
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
|
784 plr.songtitle = format_and_free_ti( ti, &songlength ); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
785 } |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
786 plr.songlength = songlength; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
787 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
788 // 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
|
789 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
|
790 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
|
791 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
792 strcpy (plr.filename, filename); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
793 plr.subsong = 0; |
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
796 // 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
|
797 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
|
798 sndbuf = (char *) malloc (SNDBUFSIZE * sampsize); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
799 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
800 // 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
|
801 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
|
802 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
|
803 freq, stereo ? 2 : 1); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
804 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
805 // 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
|
806 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
|
807 plr.p->rewind (plr.subsong); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
808 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
809 // 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
|
810 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
|
811 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
|
812 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
813 // 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
|
814 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
|
815 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
816 // 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
|
817 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
|
818 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
819 plr.p->rewind (plr.subsong); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
820 plr.time_ms = 0.0f; |
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
823 // 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
|
824 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
|
825 plr.time_ms += 1000 / plr.p->getrefresh (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
826 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
827 // 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
|
828 playback->output->flush ((int) plr.time_ms); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
829 plr.seek = -1; |
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
832 // 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
|
833 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
|
834 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
|
835 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
|
836 { |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
837 while (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
|
838 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
839 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
|
840 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
|
841 plr.time_ms += 1000 / plr.p->getrefresh (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
842 } |
955
4709ce4e209e
[svn] Run 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 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
|
844 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
|
845 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
|
846 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
|
847 toadd -= (long) (plr.p->getrefresh () * i); |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
850 // write sound buffer |
1998
8f3188746b64
chase last changeset in aud
William Pitcock <nenolod@atheme.org>
parents:
1991
diff
changeset
|
851 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
|
852 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
|
853 stereo ? 2 : 1, SNDBUFSIZE * sampsize, sndbuf, NULL); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
854 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
855 // 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
|
856 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
|
857 update_infobox (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
858 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
859 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
860 // 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
|
861 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
|
862 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
|
863 { // 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
|
864 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
|
865 while (playback->output->buffer_playing ()) |
1676
aee4ebea943a
xmms_usleep() was removed, use g_usleep()
Matti Hamalainen <ccr@tnsp.org>
parents:
1634
diff
changeset
|
866 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
|
867 } |
4709ce4e209e
[svn] Run 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 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
|
869 { // 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
|
870 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
|
871 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
|
872 playback->output->buffer_free (); |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
875 // 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
|
876 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
|
877 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
|
878 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
|
879 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
|
880 { |
4709ce4e209e
[svn] Run 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 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
|
882 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
|
883 } |
4709ce4e209e
[svn] Run 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 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
|
885 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
|
886 dbg_printf (".\n"); |
1978 | 887 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
|
888 return (NULL); |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
891 // sampsize macro not useful anymore. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
892 #undef sampsize |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
893 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
894 /***** Informational *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
895 |
955
4709ce4e209e
[svn] Run 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 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
|
897 adplug_is_our_fd (gchar * filename, VFSFile * fd) |
703 | 898 { |
899 CSilentopl tmpopl; | |
900 | |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
901 CPlayer *p = factory (fd, &tmpopl); |
703 | 902 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
903 dbg_printf ("adplug_is_our_file(\"%s\"): returned ", filename); |
703 | 904 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
905 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
|
906 { |
703 | 907 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
|
908 dbg_printf ("TRUE\n"); |
703 | 909 return TRUE; |
910 } | |
911 | |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
912 dbg_printf ("FALSE\n"); |
703 | 913 return FALSE; |
914 } | |
915 | |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
916 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
|
917 adplug_is_our_file (char *filename) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
918 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
919 CSilentopl tmpopl; |
1978 | 920 VFSFile *fd = aud_vfs_buffered_file_new_from_uri (filename); |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
921 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
|
922 return FALSE; |
703 | 923 |
955
4709ce4e209e
[svn] Run 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 CPlayer *p = factory (fd, &tmpopl); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
925 |
955
4709ce4e209e
[svn] Run 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 dbg_printf ("adplug_is_our_file(\"%s\"): returned ", filename); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
927 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
928 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
|
929 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
930 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
|
931 dbg_printf ("TRUE\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
932 return TRUE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
933 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
934 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
935 dbg_printf ("FALSE\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
936 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
937 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
938 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
939 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
|
940 adplug_get_time (InputPlayback * data) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
941 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
942 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
|
943 { |
4709ce4e209e
[svn] Run 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 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
|
945 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
|
946 } |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
947 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
|
948 { |
4709ce4e209e
[svn] Run 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_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
|
950 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
|
951 } |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
952 return playback->output->output_time (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
953 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
954 |
955
4709ce4e209e
[svn] Run 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 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
|
956 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
|
957 { |
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
|
958 *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
|
959 *title = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
960 |
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
|
961 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
|
962 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
|
963 *title = format_and_free_ti( ti, length ); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
964 } |
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 /***** Player control *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
967 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
968 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
|
969 adplug_play (InputPlayback * data) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
970 { |
559 | 971 char *filename = data->filename; |
972 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
|
973 dbg_printf ("adplug_play(\"%s\"): ", filename); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
974 audio_error = FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
975 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
976 // 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
|
977 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
|
978 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
|
979 gtk_widget_destroy (GTK_WIDGET (plr.infodlg)); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
980 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
981 // 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
|
982 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
|
983 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
|
984 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
|
985 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
|
986 { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
987 audio_error = TRUE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
988 return; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
989 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
990 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
991 // 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
|
992 // 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
|
993 // 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
|
994 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
|
995 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
|
996 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
|
997 plr.seek = -1; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
998 |
1410
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
999 // start player func |
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
1000 dbg_printf ("play"); |
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
1001 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
|
1002 playback->set_pb_ready(playback); |
1410
cc6203a8cc9f
Switched to new threading model
Christian Birchinger <joker@netswarm.net>
parents:
1395
diff
changeset
|
1003 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
|
1004 dbg_printf (".\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1005 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1006 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1007 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
|
1008 adplug_stop (InputPlayback * playback) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1009 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1010 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
|
1011 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
|
1012 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
|
1013 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
|
1014 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
|
1015 dbg_printf (".\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1016 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1017 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1018 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
|
1019 adplug_pause (InputPlayback * playback, short paused) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1020 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1021 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
|
1022 playback->output->pause (paused); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1023 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1024 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1025 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
|
1026 adplug_seek (InputPlayback * data, int time) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1027 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1028 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
|
1029 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
|
1030 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1031 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1032 /***** Configuration file handling *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1033 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1034 #define CFG_VERSION "AdPlug" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1035 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1036 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
|
1037 adplug_init (void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1038 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1039 dbg_printf ("adplug_init(): open, "); |
2124 | 1040 ConfigDb *db = aud_cfg_db_open (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1041 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1042 // 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
|
1043 dbg_printf ("read, "); |
2124 | 1044 aud_cfg_db_get_bool (db, CFG_VERSION, "16bit", (gboolean *) & conf.bit16); |
1045 aud_cfg_db_get_bool (db, CFG_VERSION, "Stereo", (gboolean *) & conf.stereo); | |
1046 aud_cfg_db_get_int (db, CFG_VERSION, "Frequency", (gint *) & conf.freq); | |
1047 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
|
1048 (gboolean *) & conf.endless); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1049 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1050 // 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
|
1051 dbg_printf ("exclusion, "); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1052 { |
1045 | 1053 gchar *cfgstr = NULL, *exclude = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1054 gboolean cfgread; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1055 |
2124 | 1056 cfgread = aud_cfg_db_get_string (db, CFG_VERSION, "Exclude", &cfgstr); |
1045 | 1057 if (cfgread) { |
1058 exclude = (char *) malloc (strlen (cfgstr) + 2); | |
1059 strcpy (exclude, cfgstr); | |
1060 exclude[strlen (exclude) + 1] = '\0'; | |
1061 g_strdelimit (exclude, ":", '\0'); | |
1062 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
|
1063 conf.players.remove (conf.players.lookup_filetype (p)); |
1045 | 1064 free (exclude); free (cfgstr); |
1065 } | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1066 } |
2124 | 1067 aud_cfg_db_close (db); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1068 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1069 // 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
|
1070 dbg_printf ("database"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1071 plr.db = new CAdPlugDatabase; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1072 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1073 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1074 const char *homedir = getenv ("HOME"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1075 |
955
4709ce4e209e
[svn] Run 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 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
|
1077 { |
1301
df5d07d7ca7c
AdPlug database loading fix by Christian "Joker" Birchinger.
Tony Vroon <chainsaw@gentoo.org>
parents:
1286
diff
changeset
|
1078 std::string userdb; |
df5d07d7ca7c
AdPlug database loading fix by Christian "Joker" Birchinger.
Tony Vroon <chainsaw@gentoo.org>
parents:
1286
diff
changeset
|
1079 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
|
1080 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
|
1081 dbg_printf (" (userdb=\"%s\")", userdb.c_str()); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1082 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1083 } |
955
4709ce4e209e
[svn] Run 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 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
|
1085 dbg_printf (".\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1086 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1087 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1088 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
|
1089 adplug_quit (void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1090 { |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1091 dbg_printf ("adplug_quit(): open, "); |
2124 | 1092 ConfigDb *db = aud_cfg_db_open (); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1093 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1094 // 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
|
1095 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
|
1096 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
|
1097 delete plr.db; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1098 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1099 // 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
|
1100 dbg_printf ("write, "); |
2124 | 1101 aud_cfg_db_set_bool (db, CFG_VERSION, "16bit", conf.bit16); |
1102 aud_cfg_db_set_bool (db, CFG_VERSION, "Stereo", conf.stereo); | |
1103 aud_cfg_db_set_int (db, CFG_VERSION, "Frequency", conf.freq); | |
1104 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
|
1105 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1106 dbg_printf ("exclude, "); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1107 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
|
1108 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
|
1109 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
|
1110 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
|
1111 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
|
1112 { |
4709ce4e209e
[svn] Run 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 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
|
1114 exclude += ":"; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1115 exclude += (*i)->filetype; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1116 } |
955
4709ce4e209e
[svn] Run 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 gchar *cfgval = g_strdup (exclude.c_str ()); |
2124 | 1118 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
|
1119 free (cfgval); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1120 |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1121 dbg_printf ("close"); |
2124 | 1122 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
|
1123 dbg_printf (".\n"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1124 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1125 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1126 /***** Plugin (exported) *****/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1127 |
955
4709ce4e209e
[svn] Run 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 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
|
1129 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
|
1130 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
|
1131 (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
|
1132 adplug_init, // plugin functions... |
1634 | 1133 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
|
1134 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
|
1135 adplug_config, |
1634 | 1136 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
|
1137 adplug_is_our_file, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1138 NULL, // scan_dir (look in Input/cdaudio/cdaudio.c) |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1139 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
|
1140 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
|
1141 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
|
1142 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
|
1143 NULL, // set_eq |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1144 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
|
1145 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
|
1146 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
|
1147 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
|
1148 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
|
1149 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
|
1150 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
|
1151 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
|
1152 adplug_info_box, |
955
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1153 NULL, // output plugin (filled by XMMS) |
1556
16b2bc9b9763
Add a tuple builder. With thanks to ccr for the fallback logic; I hate C++.
Tony Vroon <chainsaw@gentoo.org>
parents:
1538
diff
changeset
|
1154 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
|
1155 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
|
1156 NULL, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1157 adplug_is_our_fd, |
4709ce4e209e
[svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents:
703
diff
changeset
|
1158 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
|
1159 }; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1160 |
1096 | 1161 InputPlugin *adplug_iplist[] = { &adplug_ip, NULL }; |
1162 | |
1395
761e17b23e0c
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
1301
diff
changeset
|
1163 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
|
1164 |