Mercurial > audlegacy-plugins
annotate src/modplug/plugin.cxx @ 2456:e67bce91d70c
revive support for zip and other archive formats. T.M aka teknocat pointed out this problem and provided preliminary patch.
| author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
|---|---|
| date | Thu, 20 Mar 2008 01:37:46 +0900 |
| parents | 7ee1bc4d5f5b |
| children | a336fe28b63a |
| 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 |
| 161 | 9 #include "modplug.h" |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
10 #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
|
11 extern "C" { |
|
1946
7ee1bc4d5f5b
Remove useless #includes, use <>
Matti Hamalainen <ccr@tnsp.org>
parents:
1659
diff
changeset
|
12 #include <audacious/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
|
13 } |
|
0
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 extern InputPlugin gModPlug; |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
16 |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
17 static void Init(void) |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
18 { |
| 1659 | 19 gModplugXMMS.SetInputPlugin(gModPlug); |
| 20 gModplugXMMS.Init(); | |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
21 } |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
22 |
|
704
94b22cc75eb8
[svn] - VFS probing support patch by Christian Birchinger (joker).
nenolod
parents:
561
diff
changeset
|
23 static int CanPlayFileFromVFS(char* aFilename, VFSFile *VFSFile) |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
24 { |
|
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
|
25 AUDDBG("aFilename=%s\n", aFilename); |
| 1659 | 26 if(gModplugXMMS.CanPlayFileFromVFS(aFilename, VFSFile)) |
| 27 return 1; | |
| 28 return 0; | |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
29 } |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
30 |
| 559 | 31 static void PlayFile(InputPlayback *data) |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
32 { |
|
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
|
33 char* aFilename = data->filename; |
| 1659 | 34 gModplugXMMS.SetOutputPlugin(*data->output); |
| 35 gModplugXMMS.PlayFile(aFilename, data); | |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
36 } |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
37 |
| 559 | 38 static void Stop(InputPlayback *data) |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
39 { |
| 1659 | 40 gModplugXMMS.Stop(); |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
41 } |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
42 |
| 559 | 43 static void Pause(InputPlayback *data, short aPaused) |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
44 { |
| 1659 | 45 gModplugXMMS.Pause((bool)aPaused); |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
46 } |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
47 |
| 559 | 48 static void Seek(InputPlayback *data, int aTime) |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
49 { |
| 1659 | 50 gModplugXMMS.Seek(float32(aTime)); |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
51 } |
|
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
|
52 |
| 559 | 53 static int GetTime(InputPlayback *data) |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
54 { |
| 1659 | 55 float32 lTime; |
| 56 | |
| 57 lTime = gModplugXMMS.GetTime(); | |
| 58 if(lTime == -1) | |
| 59 return -1; | |
| 60 else | |
| 61 return (int)(lTime * 1000); | |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
62 } |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
63 |
|
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
|
64 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
|
65 { |
| 1659 | 66 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
|
67 } |
|
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
|
68 |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
69 void ShowAboutBox(void) |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
70 { |
| 1659 | 71 ShowAboutWindow(); |
|
0
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 |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
74 void ShowConfigureBox(void) |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
75 { |
| 1659 | 76 ShowConfigureWindow(gModplugXMMS.GetModProps()); |
|
0
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 |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
79 void ShowFileInfoBox(char* aFilename) |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
80 { |
| 1659 | 81 ShowInfoWindow(aFilename); |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
82 } |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
83 |
|
1044
b1128efde471
[svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents:
704
diff
changeset
|
84 const gchar *fmts[] = |
| 1659 | 85 { "amf", "ams", "dbm", "dbf", "dsm", "far", "mdl", "stm", "ult", "j2b", "mt2", |
| 86 "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
|
87 "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
|
88 "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
|
89 NULL }; |
|
372
a157306caf03
[svn] - finalize the plugin-side of the extension-assist ABI
nenolod
parents:
371
diff
changeset
|
90 |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
91 InputPlugin gModPlug = |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
92 { |
| 1659 | 93 NULL, |
| 94 NULL, | |
| 95 (gchar *)"ModPlug Audio Plugin", | |
| 96 Init, | |
| 97 NULL, | |
| 98 ShowAboutBox, | |
| 99 ShowConfigureBox, | |
| 100 FALSE, | |
| 101 NULL, | |
| 102 NULL, | |
| 103 PlayFile, | |
| 104 Stop, | |
| 105 Pause, | |
| 106 Seek, | |
| 107 NULL, | |
| 108 GetTime, | |
| 109 NULL, | |
| 110 NULL, | |
| 111 NULL, | |
| 112 NULL, | |
| 113 NULL, | |
| 114 NULL, | |
| 115 NULL, | |
| 116 ShowFileInfoBox, | |
| 117 NULL, // output | |
| 118 GetSongTuple, | |
| 119 NULL, | |
| 120 NULL, | |
| 121 CanPlayFileFromVFS, // vfs | |
| 122 (gchar **)fmts | |
|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
123 }; |
|
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
124 |
| 1081 | 125 InputPlugin *modplug_iplist[] = { &gModPlug, NULL }; |
| 126 | |
| 1659 | 127 SIMPLE_INPUT_PLUGIN(modplug, modplug_iplist); |
