Mercurial > audlegacy
annotate Plugins/Input/modplug/plugin.cpp @ 553:82346a6312c2 trunk
[svn] make WMA plugin strings translatable
author | nenolod |
---|---|
date | Wed, 01 Feb 2006 13:09:00 -0800 |
parents | 9466f03c92f8 |
children |
rev | line source |
---|---|
278
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
1 /* Modplug XMMS Plugin |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
2 * Authors: Kenton Varda <temporal@gauge3d.org> |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
3 * |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
4 * This source code is public domain. |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
5 */ |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
6 |
328
9466f03c92f8
[svn] Remove static plugin.h trickery to cure SIGFPE and related madness.
chainsaw
parents:
278
diff
changeset
|
7 #include "audacious/plugin.h" |
278
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
8 #include <libmodplug/modplug.h> |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
9 #include "gui/main.h" |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
10 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
11 extern InputPlugin gModPlug; |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
12 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
13 static void Init(void) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
14 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
15 gModplugXMMS.SetInputPlugin(gModPlug); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
16 gModplugXMMS.Init(); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
17 } |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
18 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
19 static int CanPlayFile(char* aFilename) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
20 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
21 if(gModplugXMMS.CanPlayFile(aFilename)) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
22 return 1; |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
23 return 0; |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
24 } |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
25 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
26 static void PlayFile(char* aFilename) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
27 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
28 gModplugXMMS.SetOutputPlugin(*gModPlug.output); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
29 gModplugXMMS.PlayFile(aFilename); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
30 } |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
31 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
32 static void Stop(void) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
33 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
34 gModplugXMMS.Stop(); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
35 } |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
36 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
37 static void Pause(short aPaused) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
38 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
39 gModplugXMMS.Pause((bool)aPaused); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
40 } |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
41 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
42 static void Seek(int aTime) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
43 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
44 gModplugXMMS.Seek(float32(aTime)); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
45 } |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
46 static int GetTime(void) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
47 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
48 float32 lTime; |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
49 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
50 lTime = gModplugXMMS.GetTime(); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
51 if(lTime == -1) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
52 return -1; |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
53 else |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
54 return (int)(lTime * 1000); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
55 } |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
56 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
57 static void GetSongInfo(char* aFilename, char** aTitle, int* aLength) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
58 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
59 gModplugXMMS.GetSongInfo(aFilename, *aTitle, *aLength); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
60 } |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
61 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
62 void ShowAboutBox(void) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
63 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
64 ShowAboutWindow(); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
65 } |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
66 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
67 void ShowConfigureBox(void) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
68 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
69 ShowConfigureWindow(gModplugXMMS.GetModProps()); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
70 } |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
71 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
72 void ShowFileInfoBox(char* aFilename) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
73 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
74 ShowInfoWindow(aFilename); |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
75 } |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
76 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
77 InputPlugin gModPlug = |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
78 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
79 NULL, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
80 NULL, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
81 "ModPlug Player", |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
82 Init, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
83 ShowAboutBox, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
84 ShowConfigureBox, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
85 CanPlayFile, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
86 NULL, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
87 PlayFile, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
88 Stop, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
89 Pause, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
90 Seek, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
91 NULL, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
92 GetTime, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
93 NULL, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
94 NULL, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
95 NULL, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
96 NULL, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
97 NULL, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
98 NULL, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
99 NULL, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
100 GetSongInfo, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
101 ShowFileInfoBox, |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
102 NULL |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
103 }; |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
104 |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
105 extern "C" |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
106 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
107 InputPlugin* get_iplugin_info (void) |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
108 { |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
109 return &gModPlug; |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
110 } |
37316876ef6e
[svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff
changeset
|
111 } |