annotate Plugins/Input/modplug/modplugbmp.h @ 412:451d2dc68ba8 trunk

[svn] Support .cmf .sci & .laa without stealing .mid from timidity.
author chainsaw
date Mon, 09 Jan 2006 13:15:02 -0800
parents 4c8545dc17c2
children a540829b188a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
7 #ifndef __MODPLUGXMMS_CMODPLUGXMMS_H_INCLUDED__
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
8 #define __MODPLUGXMMS_CMODPLUGXMMS_H_INCLUDED__
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
9
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
10 #include <string>
330
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
11 #include <glib.h>
278
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 #ifndef __MODPLUGXMMS_STDDEFS_H__INCLUDED__
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
14 #include "stddefs.h"
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
15 #endif
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
16
328
9466f03c92f8 [svn] Remove static plugin.h trickery to cure SIGFPE and related madness.
chainsaw
parents: 278
diff changeset
17 #include "audacious/plugin.h"
278
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 using namespace std;
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 class CSoundFile;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
22 class Archive;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
23
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
24 class ModplugXMMS
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 public:
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
27 struct Settings
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
28 {
330
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
29 gboolean mSurround;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
30 gboolean mOversamp;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
31 gboolean mMegabass;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
32 gboolean mNoiseReduction;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
33 gboolean mVolumeRamp;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
34 gboolean mReverb;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
35 gboolean mFastinfo;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
36 gboolean mUseFilename;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
37 gboolean mPreamp;
278
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
38
330
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
39 gint mChannels;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
40 gint mBits;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
41 gint mFrequency;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
42 gint mResamplingMode;
278
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
43
330
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
44 gint mReverbDepth;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
45 gint mReverbDelay;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
46 gint mBassAmount;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
47 gint mBassRange;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
48 gint mSurroundDepth;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
49 gint mSurroundDelay;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
50 gfloat mPreampLevel;
4c8545dc17c2 [svn] Convert to configdb usage.
chainsaw
parents: 328
diff changeset
51 gint mLoopCount;
278
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
52
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
53 Settings();
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
54 };
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 ModplugXMMS();
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
57 ~ModplugXMMS();
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 void Init(); // Called when the plugin is loaded
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
60 bool CanPlayFile(const string& aFilename);// Return true if the plugin can handle the file
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 CloseConfigureBox();
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 void PlayFile(const string& aFilename);// Play the file.
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
65 void Stop(); // Stop playing.
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
66 void Pause(bool aPaused); // Pause or unpause.
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
67
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
68 void Seek(float32 aTime); // Seek to the specified time.
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
69 float32 GetTime(); // Get the current play time.
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 void GetSongInfo(const string& aFilename, char*& aTitle, int32& aLength); // Function to grab the title string
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
72
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
73 void SetInputPlugin(InputPlugin& aInPlugin);
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
74 void SetOutputPlugin(OutputPlugin& aOutPlugin);
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 const Settings& GetModProps();
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
77 void SetModProps(const Settings& aModProps);
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 private:
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
80 InputPlugin* mInPlug;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
81 OutputPlugin* mOutPlug;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
82
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
83 uchar* mBuffer;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
84 uint32 mBufSize;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
85
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
86 bool mPaused;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
87 volatile bool mStopped;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
88
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
89 Settings mModProps;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
90
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
91 AFormat mFormat;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
92
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
93 uint32 mBufTime; //milliseconds
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
94
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
95 CSoundFile* mSoundFile;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
96 Archive* mArchive;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
97
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
98 uint32 mPlayed;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
99
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
100 GThread* mDecodeThread;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
101
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
102 char mModName[100];
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 float mPreampFactor;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
105
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
106 void PlayLoop();
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
107 static void* PlayThread(void* arg);
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
108 const char* Bool2OnOff(bool aValue);
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
109 };
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 extern ModplugXMMS gModplugXMMS;
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
112
37316876ef6e [svn] Use modplug instead of mikmod. Supports more formats & compressed files.
chainsaw
parents:
diff changeset
113 #endif //included