annotate src/modplug/plugin.cxx @ 3030:c442f8407dcb

Show playlist popup information reliably (Debian bug #460802)
author John Lindgren <john.lindgren@tds.net>
date Fri, 10 Apr 2009 01:46:08 -0400
parents 3134a0987162
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1 /* Modplug XMMS Plugin
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2 * Authors: Kenton Varda <temporal@gauge3d.org>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
3 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
4 * This source code is public domain.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
5 */
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
6
2456
e67bce91d70c revive support for zip and other archive formats. T.M aka teknocat pointed out this problem and provided preliminary patch.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 1946
diff changeset
7 // #define AUD_DEBUG 1
e67bce91d70c revive support for zip and other archive formats. T.M aka teknocat pointed out this problem and provided preliminary patch.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 1946
diff changeset
8
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
9 #include "gui/main.h"
1539
488f7e6c36ed Tuple builder for modplug. Someone do me a favour and fix getinfo to do something like the one in console.
Tony Vroon <chainsaw@gentoo.org>
parents: 1447
diff changeset
10 extern "C" {
2971
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2712
diff changeset
11 #include <audlegacy/plugin.h>
1539
488f7e6c36ed Tuple builder for modplug. Someone do me a favour and fix getinfo to do something like the one in console.
Tony Vroon <chainsaw@gentoo.org>
parents: 1447
diff changeset
12 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
13
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
14 extern InputPlugin gModPlug;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
15
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
16 static void Init(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
17 {
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
18 gModplugXMMS.SetInputPlugin(gModPlug);
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
19 gModplugXMMS.Init();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
20 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
21
704
94b22cc75eb8 [svn] - VFS probing support patch by Christian Birchinger (joker).
nenolod
parents: 561
diff changeset
22 static int CanPlayFileFromVFS(char* aFilename, VFSFile *VFSFile)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
23 {
2456
e67bce91d70c revive support for zip and other archive formats. T.M aka teknocat pointed out this problem and provided preliminary patch.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 1946
diff changeset
24 AUDDBG("aFilename=%s\n", aFilename);
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
25 if(gModplugXMMS.CanPlayFileFromVFS(aFilename, VFSFile))
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
26 return 1;
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
27 return 0;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
28 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
29
559
d5782f3bd760 [svn] Update plugins to the new input plugin API
iabervon
parents: 400
diff changeset
30 static void PlayFile(InputPlayback *data)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
31 {
2456
e67bce91d70c revive support for zip and other archive formats. T.M aka teknocat pointed out this problem and provided preliminary patch.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 1946
diff changeset
32 char* aFilename = data->filename;
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
33 gModplugXMMS.SetOutputPlugin(*data->output);
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
34 gModplugXMMS.PlayFile(aFilename, data);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
35 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
36
559
d5782f3bd760 [svn] Update plugins to the new input plugin API
iabervon
parents: 400
diff changeset
37 static void Stop(InputPlayback *data)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
38 {
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
39 gModplugXMMS.Stop();
0
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
559
d5782f3bd760 [svn] Update plugins to the new input plugin API
iabervon
parents: 400
diff changeset
42 static void Pause(InputPlayback *data, short aPaused)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
43 {
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
44 gModplugXMMS.Pause((bool)aPaused);
0
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
559
d5782f3bd760 [svn] Update plugins to the new input plugin API
iabervon
parents: 400
diff changeset
47 static void Seek(InputPlayback *data, int aTime)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
48 {
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
49 gModplugXMMS.Seek(float32(aTime));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
50 }
1539
488f7e6c36ed Tuple builder for modplug. Someone do me a favour and fix getinfo to do something like the one in console.
Tony Vroon <chainsaw@gentoo.org>
parents: 1447
diff changeset
51
559
d5782f3bd760 [svn] Update plugins to the new input plugin API
iabervon
parents: 400
diff changeset
52 static int GetTime(InputPlayback *data)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
53 {
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
54 float32 lTime;
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
55
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
56 lTime = gModplugXMMS.GetTime();
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
57 if(lTime == -1)
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
58 return -1;
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
59 else
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
60 return (int)(lTime * 1000);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
61 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
62
1539
488f7e6c36ed Tuple builder for modplug. Someone do me a favour and fix getinfo to do something like the one in console.
Tony Vroon <chainsaw@gentoo.org>
parents: 1447
diff changeset
63 static Tuple* GetSongTuple(char* aFilename)
488f7e6c36ed Tuple builder for modplug. Someone do me a favour and fix getinfo to do something like the one in console.
Tony Vroon <chainsaw@gentoo.org>
parents: 1447
diff changeset
64 {
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
65 return gModplugXMMS.GetSongTuple(aFilename);
1539
488f7e6c36ed Tuple builder for modplug. Someone do me a favour and fix getinfo to do something like the one in console.
Tony Vroon <chainsaw@gentoo.org>
parents: 1447
diff changeset
66 }
488f7e6c36ed Tuple builder for modplug. Someone do me a favour and fix getinfo to do something like the one in console.
Tony Vroon <chainsaw@gentoo.org>
parents: 1447
diff changeset
67
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
68 void ShowAboutBox(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
69 {
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
70 ShowAboutWindow();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
71 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
72
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
73 void ShowConfigureBox(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
74 {
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
75 ShowConfigureWindow(gModplugXMMS.GetModProps());
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
76 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
77
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
78 void ShowFileInfoBox(char* aFilename)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
79 {
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
80 ShowInfoWindow(aFilename);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
81 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
82
1044
b1128efde471 [svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents: 704
diff changeset
83 const gchar *fmts[] =
2536
f791c889f74c We have never actually supported J2B (Jazz Jackrabbit 2) modules (the loader
Matti Hamalainen <ccr@tnsp.org>
parents: 2533
diff changeset
84 { "amf", "ams", "dbm", "dbf", "dsm", "far", "mdl", "stm", "ult", "mt2",
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
85 "mdz", "mdr", "mdgz", "mdbz", "mod", "s3z", "s3r", "s3gz", "s3m", "xmz", "xmr", "xmgz",
2456
e67bce91d70c revive support for zip and other archive formats. T.M aka teknocat pointed out this problem and provided preliminary patch.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 1946
diff changeset
86 "itz", "itr", "itgz", "dmf", "umx", "it", "669", "xm", "mtm", "psm", "ft2",
e67bce91d70c revive support for zip and other archive formats. T.M aka teknocat pointed out this problem and provided preliminary patch.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 1946
diff changeset
87 "zip", "gz", "bz2", "rar", "rb",
e67bce91d70c revive support for zip and other archive formats. T.M aka teknocat pointed out this problem and provided preliminary patch.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 1946
diff changeset
88 NULL };
372
a157306caf03 [svn] - finalize the plugin-side of the extension-assist ABI
nenolod
parents: 371
diff changeset
89
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
90 InputPlugin gModPlug =
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
91 {
2544
97d0ed3b2631 Mark common fields and input-plugin specific fields via comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 2536
diff changeset
92 /* Common plugin fields */
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
93 NULL,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
94 NULL,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
95 (gchar *)"ModPlug Audio Plugin",
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
96 Init,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
97 NULL,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
98 ShowAboutBox,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
99 ShowConfigureBox,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
100 FALSE,
2544
97d0ed3b2631 Mark common fields and input-plugin specific fields via comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 2536
diff changeset
101
97d0ed3b2631 Mark common fields and input-plugin specific fields via comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 2536
diff changeset
102 /* Input plugin fields */
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
103 NULL,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
104 NULL,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
105 PlayFile,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
106 Stop,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
107 Pause,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
108 Seek,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
109 GetTime,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
110 NULL,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
111 NULL,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
112 NULL,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
113 NULL,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
114 NULL,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
115 NULL,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
116 NULL,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
117 ShowFileInfoBox,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
118 GetSongTuple,
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
119 CanPlayFileFromVFS, // vfs
2459
a336fe28b63a exclude zip etc which doesn't contain any mod file.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2456
diff changeset
120 (gchar **)fmts,
a336fe28b63a exclude zip etc which doesn't contain any mod file.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2456
diff changeset
121 NULL,
a336fe28b63a exclude zip etc which doesn't contain any mod file.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2456
diff changeset
122 NULL,
a336fe28b63a exclude zip etc which doesn't contain any mod file.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2456
diff changeset
123 TRUE, // subtune. to exclude .zip etc which doesn't contain any mod file --yaz
a336fe28b63a exclude zip etc which doesn't contain any mod file.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2456
diff changeset
124 NULL
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
125 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
126
1081
1233d2efceab [svn] - modplug: transition to plugin API v2
nenolod
parents: 1044
diff changeset
127 InputPlugin *modplug_iplist[] = { &gModPlug, NULL };
1233d2efceab [svn] - modplug: transition to plugin API v2
nenolod
parents: 1044
diff changeset
128
1659
53adc480f9a7 fixed some more plugins
mf0102 <0102@gmx.at>
parents: 1649
diff changeset
129 SIMPLE_INPUT_PLUGIN(modplug, modplug_iplist);