Mercurial > audlegacy-plugins
annotate src/modplug/plugin.cxx @ 3126:2d2a50196556
Backed out changeset 617cd51dfee5
This didn't work, and doesn't seem right.
| author | William Pitcock <nenolod@atheme.org> |
|---|---|
| date | Wed, 06 May 2009 14:04:28 -0500 |
| parents | 3134a0987162 |
| children |
| 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 | 18 gModplugXMMS.SetInputPlugin(gModPlug); |
| 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 | 25 if(gModplugXMMS.CanPlayFileFromVFS(aFilename, VFSFile)) |
| 26 return 1; | |
| 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 | 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 | 33 gModplugXMMS.SetOutputPlugin(*data->output); |
| 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 | 37 static void Stop(InputPlayback *data) |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
38 { |
| 1659 | 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 | 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 | 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 | 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 | 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 | 52 static int GetTime(InputPlayback *data) |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
53 { |
| 1659 | 54 float32 lTime; |
| 55 | |
| 56 lTime = gModplugXMMS.GetTime(); | |
| 57 if(lTime == -1) | |
| 58 return -1; | |
| 59 else | |
| 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 | 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 | 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 | 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 | 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 | 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 | 93 NULL, |
| 94 NULL, | |
| 95 (gchar *)"ModPlug Audio Plugin", | |
| 96 Init, | |
| 97 NULL, | |
| 98 ShowAboutBox, | |
| 99 ShowConfigureBox, | |
| 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 | 103 NULL, |
| 104 NULL, | |
| 105 PlayFile, | |
| 106 Stop, | |
| 107 Pause, | |
| 108 Seek, | |
| 109 GetTime, | |
| 110 NULL, | |
| 111 NULL, | |
| 112 NULL, | |
| 113 NULL, | |
| 114 NULL, | |
| 115 NULL, | |
| 116 NULL, | |
| 117 ShowFileInfoBox, | |
| 118 GetSongTuple, | |
| 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 | 127 InputPlugin *modplug_iplist[] = { &gModPlug, NULL }; |
| 128 | |
| 1659 | 129 SIMPLE_INPUT_PLUGIN(modplug, modplug_iplist); |
