Mercurial > audlegacy-plugins
annotate src/modplug/plugin.cxx @ 1539:488f7e6c36ed
Tuple builder for modplug. Someone do me a favour and fix getinfo to do something like the one in console.
author | Tony Vroon <chainsaw@gentoo.org> |
---|---|
date | Thu, 30 Aug 2007 23:38:01 +0100 |
parents | 195b5657303e |
children | 58f03e54b97a |
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 |
161 | 7 #include "modplug.h" |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
8 #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
|
9 extern "C" { |
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 #include "audacious/plugin.h" |
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 #include "audacious/tuple.h" |
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 #include "audacious/tuple_formatter.h" |
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 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
19 gModplugXMMS.SetInputPlugin(gModPlug); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
20 gModplugXMMS.Init(); |
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 { |
704
94b22cc75eb8
[svn] - VFS probing support patch by Christian Birchinger (joker).
nenolod
parents:
561
diff
changeset
|
25 if(gModplugXMMS.CanPlayFileFromVFS(aFilename, VFSFile)) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
26 return 1; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
27 return 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 { |
559 | 32 char* aFilename = data->filename; |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
33 gModplugXMMS.SetOutputPlugin(*data->output); |
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:
1395
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 | 37 static void Stop(InputPlayback *data) |
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 gModplugXMMS.Stop(); |
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 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
44 gModplugXMMS.Pause((bool)aPaused); |
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 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
49 gModplugXMMS.Seek(float32(aTime)); |
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 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
54 float32 lTime; |
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 lTime = gModplugXMMS.GetTime(); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
57 if(lTime == -1) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
58 return -1; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
59 else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
60 return (int)(lTime * 1000); |
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
63 static void GetSongInfo(char* aFilename, char** aTitle, int* aLength) |
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 gModplugXMMS.GetSongInfo(aFilename, *aTitle, *aLength); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
66 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
67 |
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
|
68 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
|
69 { |
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
|
70 return gModplugXMMS.GetSongTuple(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
|
71 } |
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
|
72 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
73 void ShowAboutBox(void) |
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 ShowAboutWindow(); |
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 ShowConfigureBox(void) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
79 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
80 ShowConfigureWindow(gModplugXMMS.GetModProps()); |
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
83 void ShowFileInfoBox(char* aFilename) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
84 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
85 ShowInfoWindow(aFilename); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
86 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
87 |
1044
b1128efde471
[svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents:
704
diff
changeset
|
88 const gchar *fmts[] = |
372
a157306caf03
[svn] - finalize the plugin-side of the extension-assist ABI
nenolod
parents:
371
diff
changeset
|
89 { "amf", "ams", "dbm", "dbf", "dsm", "far", "mdl", "stm", "ult", "j2b", "mt2", |
400 | 90 "mdz", "mdr", "mdgz", "mdbz", "mod", "s3z", "s3r", "s3gz", "s3m", "xmz", "xmr", "xmgz", |
372
a157306caf03
[svn] - finalize the plugin-side of the extension-assist ABI
nenolod
parents:
371
diff
changeset
|
91 "itz", "itr", "itgz", "dmf", "umx", "it", "669", "xm", "mtm", "psm", "ft2", NULL }; |
a157306caf03
[svn] - finalize the plugin-side of the extension-assist ABI
nenolod
parents:
371
diff
changeset
|
92 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
93 InputPlugin gModPlug = |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
94 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
95 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
96 NULL, |
1081 | 97 (gchar *)"ModPlug Audio Plugin", |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
98 Init, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
99 ShowAboutBox, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
100 ShowConfigureBox, |
704
94b22cc75eb8
[svn] - VFS probing support patch by Christian Birchinger (joker).
nenolod
parents:
561
diff
changeset
|
101 NULL, |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
102 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
103 PlayFile, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
104 Stop, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
105 Pause, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
106 Seek, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
107 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
108 GetTime, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
109 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
110 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
111 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
112 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
113 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
114 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
115 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
116 GetSongInfo, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
117 ShowFileInfoBox, |
370 | 118 NULL, // output |
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
|
119 GetSongTuple, |
370 | 120 NULL, |
372
a157306caf03
[svn] - finalize the plugin-side of the extension-assist ABI
nenolod
parents:
371
diff
changeset
|
121 NULL, |
704
94b22cc75eb8
[svn] - VFS probing support patch by Christian Birchinger (joker).
nenolod
parents:
561
diff
changeset
|
122 CanPlayFileFromVFS, // vfs |
1044
b1128efde471
[svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents:
704
diff
changeset
|
123 (gchar **)fmts, |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
124 }; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
125 |
1081 | 126 InputPlugin *modplug_iplist[] = { &gModPlug, NULL }; |
127 | |
1395
761e17b23e0c
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
1081
diff
changeset
|
128 DECLARE_PLUGIN(modplug, NULL, NULL, modplug_iplist, NULL, NULL, NULL, NULL,NULL); |