00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #if !defined(_AOUT_H__INCLUDED_)
00031 #define _AOUT_H__INCLUDED_
00032
00033 #if _MSC_VER >= 1000
00034 #pragma once
00035 #endif // _MSC_VER >= 1000
00036
00037 #include <windows.h>
00038 #include <string>
00039
00040
00041 #include "Out.h"
00042
00043
00044 #include "ADbg/ADbg.h"
00045 #include "AEncodeProperties.h"
00046 #include "ALameDLL.h"
00047
00051 class AOut
00052 {
00053 public:
00057 AOut();
00058
00062 virtual ~AOut();
00063
00064
00070 static void config(HWND hwndParent);
00076 static void about(HWND hwndParent);
00080 static void init();
00084 static void quit();
00088 static int open(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms);
00092 static void close();
00096 static int write(char *buf, int len);
00100 static int canwrite();
00104 static int isplaying();
00108 static int pause(int pause);
00112 static void setvolume(int volume);
00116 static void setpan(int pan);
00120 static void flush(int t);
00124 static int getoutputtime();
00128 static int getwrittentime();
00129
00133 static Out_Module * GetOutModule();
00134
00139 static inline HINSTANCE GetInstance() { return the_Module.hDllInstance; }
00140
00144 static inline const char * GetVersion() {return the_version_name;}
00145
00149 static bool GetLameVersion(BE_VERSION * ver);
00150
00154 static int MyMessageBox(const char * the_output, const UINT the_type, const HWND the_parent = NULL);
00155
00159 static const ALameDLL & LameDLL() { return the_LameDLL; }
00160
00161 private:
00165 static AEncodeProperties my_Properties;
00166
00167 static int my_EncodingChannels;
00168
00169 static ADbg the_Debug;
00170 static HANDLE the_OutputFile;
00171 static DWORD the_MaxBuffer;
00172 static DWORD the_Channels;
00173 static DWORD the_SamplesPerSec;
00174 static unsigned int the_WorkingBufferUseSize;
00175
00176 static char the_WorkingBuffer[];
00177 static DWORD the_SamplesPerBlock;
00178 static DWORD the_SamplesUsed;
00179 static Out_Module the_Module;
00180 static ALameDLL the_LameDLL;
00181 static std::string my_Filename;
00182
00186 static char the_version_name[10];
00187 static char the_complete_name[31];
00188
00192 static void replaceAllChar(std::string & the_string, const char src, const char dst);
00193
00199 static void UpMixToStereo(SHORT* psData,SHORT* psOutData,DWORD dwNumSamples);
00200
00206 static void MixToMono(SHORT* psData,SHORT* psOutData,DWORD dwNumSamples);
00207
00212 static AOut * the_AOut;
00213
00214 };
00215
00216 #endif // !defined(_AOUT_H__INCLUDED_)