ref: e9f5e69cb400c9118fab861d176252cd65197d37
parent: 56a143b9e40f3cd419b30b12b00346efe47b25ad
author: menno <menno>
date: Fri Aug 3 07:47:03 EDT 2001
Updated cooledit plugin New winamp output plugin
--- /dev/null
+++ b/cooledit/Config.c
@@ -1,0 +1,42 @@
+#include <windows.h>
+#include <stdio.h>
+
+
+static char app_name[] = "Freeware AAC encoder";
+static char INI_FILE[MAX_PATH];
+
+
+static void _r_s(char *name,char *data, int mlen)
+{
+char buf[2048];
+ strcpy(buf,data);
+ GetPrivateProfileString(app_name,name,buf,data,mlen,INI_FILE);
+}
+
+#define RS(x) (_r_s(#x,x,sizeof(x)))
+#define WS(x) (WritePrivateProfileString(app_name,#x,x,INI_FILE))
+
+
+void config_init()
+{
+ char *p=INI_FILE;
+ GetModuleFileName(NULL,INI_FILE,sizeof(INI_FILE));
+ while (*p) p++;
+ while (p >= INI_FILE && *p != '\\') p--;
+ strcpy(p+1,"plugins.ini");
+}
+
+void config_read(DWORD *dwOptions)
+{
+char Options[512];
+ config_init();
+ RS(Options);
+ *dwOptions=atoi(Options);
+}
+
+void config_write(DWORD dwOptions)
+{
+char Options[512];
+ sprintf(Options,"%lu",dwOptions);
+ WS(Options);
+}
--- a/cooledit/FAAD.DSP
+++ b/cooledit/FAAD.DSP
@@ -43,7 +43,7 @@
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /GB /MT /W3 /GX /O2 /I "..\include" /I "..\..\faad\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\include" /I "..\..\faad\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -69,7 +69,7 @@
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /GB /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\faad\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\faad\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
@@ -94,6 +94,10 @@
# Begin Source File
SOURCE=.\aacinfo.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\Config.c
# End Source File
# Begin Source File
--- a/cooledit/FAAD.rc
+++ b/cooledit/FAAD.rc
@@ -26,11 +26,13 @@
// Dialog
//
-IDD_COMPRESSION DIALOG DISCARDABLE 0, 0, 150, 127
+IDD_COMPRESSION DIALOG DISCARDABLE 0, 0, 176, 127
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION "AAC-MPEG4"
+CAPTION "AAC-MPEG4 options"
FONT 8, "MS Sans Serif"
BEGIN
+ CONTROL "Automatic configuration",IDC_CHK_AUTOCFG,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,4,4,90,10
CONTROL "MPEG4",IDC_RADIO_MPEG4,"Button",BS_AUTORADIOBUTTON |
WS_GROUP,8,29,42,10
CONTROL "MPEG2",IDC_RADIO_MPEG2,"Button",BS_AUTORADIOBUTTON,8,42,
@@ -49,19 +51,18 @@
WS_TABSTOP,59,33,45,10
CONTROL "Use LFE channel",IDC_USELFE,"Button",BS_AUTOCHECKBOX |
WS_DISABLED | WS_TABSTOP,59,46,67,10
- COMBOBOX IDC_CB_BITRATE,98,59,48,30,CBS_DROPDOWN | WS_VSCROLL |
+ COMBOBOX IDC_CB_BITRATE,124,68,48,30,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_CB_BANDWIDTH,124,85,48,30,CBS_DROPDOWN | WS_VSCROLL |
WS_TABSTOP
- COMBOBOX IDC_CB_BANDWIDTH,98,76,48,30,CBS_DROPDOWN | WS_VSCROLL |
- WS_TABSTOP
- DEFPUSHBUTTON "OK",IDOK,110,94,36,14
- PUSHBUTTON "Cancel",IDCANCEL,110,108,36,14
+ DEFPUSHBUTTON "OK",IDOK,64,108,36,14
+ PUSHBUTTON "Cancel",IDCANCEL,100,108,36,14
+ PUSHBUTTON "About",IDC_BTN_ABOUT,136,108,36,14
GROUPBOX "AAC type",IDC_STATIC,4,18,48,38
GROUPBOX "Profile",IDC_STATIC,4,63,48,59
- LTEXT "Bitrate",IDC_STATIC,59,64,21,8
- LTEXT "Bandwidth",IDC_STATIC,59,80,34,8
- CONTROL 104,IDC_STATIC,"Static",SS_BITMAP,58,99,36,23
- CONTROL "Automatic configuration",IDC_CHK_AUTOCFG,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,4,4,90,10
+ LTEXT "Bitrate per channel",IDC_STATIC,59,73,60,8
+ LTEXT "Bandwidth (0=full)",IDC_STATIC,59,89,57,8
+ CONTROL 104,IDC_IMG_LOGO,"Static",SS_BITMAP,136,4,36,23
END
@@ -102,7 +103,7 @@
IDD_COMPRESSION, DIALOG
BEGIN
LEFTMARGIN, 4
- RIGHTMARGIN, 146
+ RIGHTMARGIN, 172
TOPMARGIN, 4
BOTTOMMARGIN, 122
END
--- a/cooledit/Readme.txt
+++ b/cooledit/Readme.txt
@@ -3,4 +3,4 @@
copy FAAC.flt into CoolEdit folder
delete flt.dat
-my e-mail: kreel@interfree.it
+mail: kreel@interfree.it
binary files /dev/null b/cooledit/bitmap1.bmp differ
--- a/cooledit/faac.c
+++ b/cooledit/faac.c
@@ -5,6 +5,14 @@
#include "faac.h"
+#define PI_VER "v1.0beta"
+
+
+extern void config_init();
+extern void config_read(DWORD *dwOptions);
+extern void config_write(DWORD dwOptions);
+
+
typedef struct output_tag // any special vars associated with output file
{
FILE *fFile;
@@ -12,8 +20,8 @@
long lSamprate;
WORD wBitsPerSample;
WORD wChannels;
- DWORD dwDataOffset;
- BOOL bWrittenHeader;
+// DWORD dwDataOffset;
+// BOOL bWrittenHeader;
char szNAME[256];
faacEncHandle hEncoder;
@@ -24,13 +32,17 @@
} MYOUTPUT;
-faacEncConfiguration faacEncCfg;
__declspec(dllexport) BOOL FAR PASCAL DIALOGMsgProc(HWND hWndDlg, UINT Message, WPARAM wParam, LPARAM lParam)
{
+DWORD dwOptions=(DWORD)lParam;
+
switch(Message)
{
case WM_INITDIALOG:
+ {
+ char buf[10];
+
SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"8");
SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"18");
SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"20");
@@ -46,15 +58,70 @@
SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"160");
SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"192");
SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"256");
- SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_SETCURSEL, 11, 0);
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_SETCURSEL, 8, 0);
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"0");
SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"4000");
SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"8000");
SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"16000");
SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"22050");
SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"24000");
- SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_SETCURSEL, 3, 0);
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_SETCURSEL, 0, 0);
+// if(!((dwOptions>>23)&1))
+ {
+ config_init();
+ config_read(&dwOptions);
+ }
+
+ if(dwOptions)
+ {
+ char Enabled=!(dwOptions&1);
+ CheckDlgButton(hWndDlg,IDC_CHK_AUTOCFG, dwOptions&1);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_MPEG4), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_MPEG2), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_MAIN), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_LOW), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_SSR), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_LTP), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_ALLOWMIDSIDE), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_USETNS), Enabled);
+// EnableWindow(GetDlgItem(hWndDlg, IDC_USELFE), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_CB_BITRATE), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), Enabled);
+
+ if(((dwOptions>>29)&7)==MPEG4)
+ CheckDlgButton(hWndDlg,IDC_RADIO_MPEG4,TRUE);
+ else
+ CheckDlgButton(hWndDlg,IDC_RADIO_MPEG2,TRUE);
+
+ switch((dwOptions>>27)&3)
+ {
+ case 0:
+ CheckDlgButton(hWndDlg,IDC_RADIO_MAIN,TRUE);
+ break;
+ case 1:
+ CheckDlgButton(hWndDlg,IDC_RADIO_LOW,TRUE);
+ break;
+ case 2:
+ CheckDlgButton(hWndDlg,IDC_RADIO_SSR,TRUE);
+ break;
+ case 3:
+ CheckDlgButton(hWndDlg,IDC_RADIO_LTP,TRUE);
+ break;
+ }
+
+ CheckDlgButton(hWndDlg, IDC_ALLOWMIDSIDE, (dwOptions>>26)&1);
+ CheckDlgButton(hWndDlg, IDC_USETNS, (dwOptions>>25)&1);
+ CheckDlgButton(hWndDlg, IDC_USELFE, (dwOptions>>24)&1);
+
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_SETCURSEL, (dwOptions>>19)&31, 0);
+// SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_SETCURSEL, (dwOptions>>1)&0x0000ffff, 0);
+ sprintf(buf,"%lu",(dwOptions>>1)&0x0000ffff);
+ SetDlgItemText(hWndDlg, IDC_CB_BANDWIDTH, buf);
+ break;
+ } // End dwOptions
+
CheckDlgButton(hWndDlg, IDC_ALLOWMIDSIDE, TRUE);
CheckDlgButton(hWndDlg, IDC_USETNS, TRUE);
CheckDlgButton(hWndDlg, IDC_USELFE, FALSE);
@@ -61,25 +128,25 @@
switch((long)lParam)
{
- case 1:
+ case IDC_RADIO_MPEG4:
CheckDlgButton(hWndDlg,IDC_RADIO_MPEG4,TRUE);
break;
- case 2:
+ case IDC_RADIO_MPEG2:
CheckDlgButton(hWndDlg,IDC_RADIO_MPEG2,TRUE);
break;
- case 3:
+ case IDC_RADIO_MAIN:
CheckDlgButton(hWndDlg,IDC_RADIO_MAIN,TRUE);
break;
- case 4:
+ case IDC_RADIO_LOW:
CheckDlgButton(hWndDlg,IDC_RADIO_LOW,TRUE);
break;
- case 5:
+ case IDC_RADIO_SSR:
CheckDlgButton(hWndDlg,IDC_RADIO_SSR,TRUE);
break;
- case 6:
+ case IDC_RADIO_LTP:
CheckDlgButton(hWndDlg,IDC_RADIO_LTP,TRUE);
break;
- case 19:
+ case IDC_CHK_AUTOCFG:
CheckDlgButton(hWndDlg,IDC_CHK_AUTOCFG, !IsDlgButtonChecked(hWndDlg,IDC_CHK_AUTOCFG));
break;
default:
@@ -87,6 +154,7 @@
CheckDlgButton(hWndDlg,IDC_RADIO_MAIN,TRUE);
break;
}
+ }
break; // End of WM_INITDIALOG
case WM_CLOSE:
@@ -97,35 +165,56 @@
case WM_COMMAND:
switch(LOWORD(wParam))
{
- case IDOK:
- {
- DWORD retVal=0;
+ case IDC_CHK_AUTOCFG:
+ {
+ char Enabled=!IsDlgButtonChecked(hWndDlg,IDC_CHK_AUTOCFG);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_MPEG4), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_MPEG2), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_MAIN), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_LOW), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_SSR), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_LTP), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_ALLOWMIDSIDE), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_USETNS), Enabled);
+// EnableWindow(GetDlgItem(hWndDlg, IDC_USELFE), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_CB_BITRATE), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), Enabled);
+ }
+ break;
+
+ case IDOK:
+ {
+ DWORD retVal=0;
+ faacEncConfiguration faacEncCfg;
if(IsDlgButtonChecked(hWndDlg,IDC_RADIO_MPEG4))
{
- faacEncCfg.mpegVersion=4;
- retVal|=4<<29;
+ faacEncCfg.mpegVersion=MPEG4;
+ retVal|=MPEG4<<29;
}
if(IsDlgButtonChecked(hWndDlg,IDC_RADIO_MPEG2))
{
- faacEncCfg.mpegVersion=2;
- retVal|=2<<29;
+ faacEncCfg.mpegVersion=MPEG2;
+ retVal|=MPEG2<<29;
}
if(IsDlgButtonChecked(hWndDlg,IDC_RADIO_MAIN))
- faacEncCfg.aacObjectType=0;
+ {
+ faacEncCfg.aacObjectType=MAIN;
+ retVal|=MAIN<<27;
+ }
if(IsDlgButtonChecked(hWndDlg,IDC_RADIO_LOW))
{
- faacEncCfg.aacObjectType=1;
- retVal|=1<<27;
+ faacEncCfg.aacObjectType=LOW;
+ retVal|=LOW<<27;
}
if(IsDlgButtonChecked(hWndDlg,IDC_RADIO_SSR))
{
- faacEncCfg.aacObjectType=2;
- retVal|=2<<27;
+ faacEncCfg.aacObjectType=SSR;
+ retVal|=SSR<<27;
}
if(IsDlgButtonChecked(hWndDlg,IDC_RADIO_LTP))
{
- faacEncCfg.aacObjectType=3;
- retVal|=3<<27;
+ faacEncCfg.aacObjectType=LTP;
+ retVal|=LTP<<27;
}
faacEncCfg.allowMidside=IsDlgButtonChecked(hWndDlg, IDC_ALLOWMIDSIDE) == BST_CHECKED ? 1 : 0;
@@ -136,14 +225,20 @@
retVal|=faacEncCfg.useLfe<<24;
faacEncCfg.bitRate=GetDlgItemInt(hWndDlg, IDC_CB_BITRATE, 0, FALSE);
- retVal|=faacEncCfg.bitRate;
+ retVal|=(SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_GETCURSEL, 0, 0)&31)<<19;
+ //retVal|=faacEncCfg.bitRate;
faacEncCfg.bandWidth=GetDlgItemInt(hWndDlg, IDC_CB_BANDWIDTH, 0, FALSE);
- retVal|=(faacEncCfg.bandWidth/1000)<<16;
+// retVal|=(SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_GETCURSEL, 0, 0)&0x0000ffff)<<1;
+ retVal|=(faacEncCfg.bandWidth&0x0000ffff)<<1;
if(IsDlgButtonChecked(hWndDlg,IDC_CHK_AUTOCFG))
- retVal=1;
+ retVal|=1;
- EndDialog(hWndDlg, retVal);
+ config_write(retVal);
+
+// retVal|=1<<23; // CFG has been written
+
+ EndDialog(hWndDlg, retVal);
}
break;
@@ -152,6 +247,18 @@
// and dismiss the dialog window returning FALSE
EndDialog(hWndDlg, FALSE);
break;
+
+ case IDC_BTN_ABOUT:
+ {
+ char buf[256];
+ sprintf(buf,"AAC-MPEG4 encoder plug-in %s\nThis plugin uses FAAC encoder engine v%g\n\nCompiled on %s\n",
+ PI_VER,
+ FAACENC_VERSION,
+ __DATE__
+ );
+ MessageBox(hWndDlg, buf, "About", MB_OK);
+ }
+ break;
}
break; // End of WM_COMMAND
default: return FALSE;
@@ -165,7 +272,7 @@
FARPROC lpfnDIALOGMsgProc;
lpfnDIALOGMsgProc=GetProcAddress(hInst,(LPCSTR)MAKELONG(20,0));
- nDialogReturn=(long)DialogBoxParam((HINSTANCE)hInst,(LPCSTR)MAKEINTRESOURCE(IDD_COMPRESSION), (HWND)hWnd, (DLGPROC)lpfnDIALOGMsgProc,nDialogReturn);
+ nDialogReturn=(long)DialogBoxParam((HINSTANCE)hInst,(LPCSTR)MAKEINTRESOURCE(IDD_COMPRESSION), (HWND)hWnd, (DLGPROC)lpfnDIALOGMsgProc, dwOptions);
return nDialogReturn;
}
@@ -227,7 +334,13 @@
long samplesInput;
int bytesEncoded;
- /* open the aac output file */
+// if(!((dwOptions>>23)&1))
+ {
+ config_init();
+ config_read(&dwOptions);
+ }
+
+// open the aac output file
if(!(outfile=fopen(lpstrFilename, "wb")))
{
MessageBox(0, "Can't create file", "FAAC interface", MB_OK);
@@ -234,7 +347,7 @@
return 0;
}
- /* open the encoder library */
+// open the encoder library
if(!(hEncoder=faacEncOpen(lSamprate, wChannels, &samplesInput, &maxBytesOutput)))
{
MessageBox(0, "Can't init library", "FAAC interface", MB_OK);
@@ -250,10 +363,6 @@
return 0;
}
- bytesEncoded=faacEncEncode(hEncoder, 0, 0, bitbuf, maxBytesOutput); // initializes the flushing process
- if(bytesEncoded>0)
- fwrite(bitbuf, 1, bytesEncoded, outfile);
-
*lpChunkSize=samplesInput*2;
hOutput=GlobalAlloc(GMEM_MOVEABLE|GMEM_SHARE,sizeof(MYOUTPUT));
@@ -266,8 +375,8 @@
mo->lSamprate=lSamprate;
mo->wBitsPerSample=wBitsPerSample;
mo->wChannels=wChannels;
- mo->dwDataOffset=0; // ???
- mo->bWrittenHeader=0;
+// mo->dwDataOffset=0; // ???
+// mo->bWrittenHeader=0;
strcpy(mo->szNAME,lpstrFilename);
mo->hEncoder=hEncoder;
@@ -287,30 +396,67 @@
return 0;
}
- if(dwOptions && dwOptions!=1)
+ if(dwOptions && !(dwOptions&1))
{
faacEncConfigurationPtr myFormat;
myFormat=faacEncGetCurrentConfiguration(hEncoder);
- myFormat->mpegVersion=(dwOptions>>29)&7;
+ myFormat->mpegVersion=(dwOptions>>29)&7;
myFormat->aacObjectType=(dwOptions>>27)&3;
myFormat->allowMidside=(dwOptions>>26)&1;
myFormat->useTns=(dwOptions>>25)&1;
myFormat->useLfe=(dwOptions>>24)&1;
- myFormat->bitRate=(dwOptions&0x00ff)*1000;
- myFormat->bandWidth=((dwOptions>>16)&127)*1000;
- switch(myFormat->bandWidth)
+ switch((dwOptions>>1)&31)
{
- case 11000:
- myFormat->bandWidth=11025;
- break;
- case 22000:
- myFormat->bandWidth=22050;
- break;
- case 44000:
- myFormat->bandWidth=44100;
- break;
+ case 0:
+ myFormat->bitRate=8000;
+ break;
+ case 1:
+ myFormat->bitRate=18000;
+ break;
+ case 2:
+ myFormat->bitRate=20000;
+ break;
+ case 3:
+ myFormat->bitRate=24000;
+ break;
+ case 4:
+ myFormat->bitRate=32000;
+ break;
+ case 5:
+ myFormat->bitRate=40000;
+ break;
+ case 6:
+ myFormat->bitRate=48000;
+ break;
+ case 7:
+ myFormat->bitRate=56000;
+ break;
+ case 8:
+ myFormat->bitRate=64000;
+ break;
+ case 9:
+ myFormat->bitRate=96000;
+ break;
+ case 10:
+ myFormat->bitRate=112000;
+ break;
+ case 11:
+ myFormat->bitRate=128000;
+ break;
+ case 12:
+ myFormat->bitRate=160000;
+ break;
+ case 13:
+ myFormat->bitRate=192000;
+ break;
+ case 14:
+ myFormat->bitRate=256000;
+ break;
}
+ myFormat->bandWidth=(dwOptions>>1)&0x0000ffff;
+ if(!myFormat->bandWidth)
+ myFormat->bandWidth=lSamprate/2;
if(!faacEncSetConfiguration(hEncoder, myFormat))
{
@@ -321,28 +467,12 @@
GlobalFree(hOutput);
return 0;
}
-/* {
-faacEncConfigurationPtr myFormat;
- myFormat=faacEncGetCurrentConfiguration(hEncoder);
-
- myFormat->mpegVersion=faacEncCfg.mpegVersion;
- myFormat->aacObjectType=faacEncCfg.aacObjectType;
- myFormat->allowMidside=faacEncCfg.allowMidside;
- myFormat->useLfe=faacEncCfg.useLfe;
- myFormat->useTns=faacEncCfg.useTns;
- myFormat->bandWidth=faacEncCfg.bandWidth;
- myFormat->bitRate=faacEncCfg.bitRate;
-
- if(!faacEncSetConfiguration(hEncoder, myFormat))
- {
- MessageBox(0, "Unsupported parameters", "FAAC interface", MB_OK);
- faacEncClose(hEncoder);
- fclose(outfile);
- free(bitbuf);
- GlobalFree(hOutput);
- return 0;
- }*/
}
+
+// init flushing process
+ bytesEncoded=faacEncEncode(hEncoder, 0, 0, bitbuf, maxBytesOutput); // initializes the flushing process
+ if(bytesEncoded>0)
+ fwrite(bitbuf, 1, bytesEncoded, outfile);
return hOutput;
}
--- a/cooledit/faad.c
+++ b/cooledit/faad.c
@@ -12,6 +12,7 @@
{
FILE *fFile;
DWORD lSize;
+ DWORD len_ms;
WORD wChannels;
DWORD dwSamprate;
WORD wBitsPerSample;
@@ -174,13 +175,13 @@
HANDLE hInput;
faacDecHandle hDecoder;
DWORD k,tmp;
-int shift;
+//int shift;
FILE *infile;
DWORD samplerate, channels;
DWORD pos; // into the file. Needed to obtain length of file
DWORD read;
int *seek_table;
-faadAACInfo file_info;
+//faadAACInfo file_info;
unsigned char *buffer;
long tagsize;
@@ -320,10 +321,17 @@
return 0;
}
+ mi->len_ms=1000*(mi->lSize*8)/mi->file_info.bitrate;
+ if(mi->len_ms)
+ mi->full_size=(DWORD)(mi->len_ms*((float)mi->dwSamprate/1000)*mi->wChannels*(16/8));
+ else
+ mi->full_size=mi->lSize; // corrupted stream?
+/*
if(mi->file_info.length)
mi->full_size=(DWORD)(mi->file_info.length*((float)samplerate/1000)*channels*(16/8));
else
mi->full_size=mi->lSize; // corrupted stream?
+*/
/* {
fclose(mi->fFile);
free(mi->buffer);
--- a/cooledit/main.c
+++ b/cooledit/main.c
@@ -2,6 +2,7 @@
#include "filters.h" //CoolEdit
+
BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
{
switch (fdwReason)
--- a/cooledit/resource.h
+++ b/cooledit/resource.h
@@ -25,14 +25,16 @@
#define IDC_CB_BANDWIDTH 1015
#define IDC_CB_BITRATE 1017
#define IDC_CHK_AUTOCFG 1020
+#define IDC_BTN_ABOUT 1021
+#define IDC_IMG_LOGO 1022
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 105
+#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1021
+#define _APS_NEXT_CONTROL_VALUE 1025
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
--- /dev/null
+++ b/winamp/.cvsignore
@@ -1,0 +1,13 @@
+*.o
+*.so
+*.a
+*.ncb
+*.plg
+*.aps
+*.opt
+*.aac
+*.wav
+Release
+Debug
+ReleaseGUI
+DebugGUI
\ No newline at end of file
--- /dev/null
+++ b/winamp/AACINFO.C
@@ -1,0 +1,249 @@
+/*
+ * FAAC - Freeware Advanced Audio Decoder
+ * Copyright (C) 2001 Menno Bakker
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: AACINFO.C,v 1.1 2001/08/03 11:47:03 menno Exp $
+ */
+
+#include <windows.h>
+#include "aacinfo.h"
+
+#define ADIF_MAX_SIZE 30 /* Should be enough */
+#define ADTS_MAX_SIZE 10 /* Should be enough */
+
+const int sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000};
+
+static int read_ADIF_header(HANDLE file, FAACAACInfo *info)
+{
+ unsigned long tmp;
+ int bitstream;
+ unsigned char buffer[ADIF_MAX_SIZE];
+ int skip_size = 0;
+ int sf_idx;
+
+ /* Get ADIF header data */
+
+ info->headertype = 1;
+
+ ReadFile(file, buffer, ADIF_MAX_SIZE, &tmp, 0);
+
+ /* copyright string */
+ if(buffer[4] & 128)
+ skip_size += 9; /* skip 9 bytes */
+
+ bitstream = buffer[4 + skip_size] & 16;
+ info->bitrate = ((unsigned int)(buffer[4 + skip_size] & 0x0F)<<19)|
+ ((unsigned int)buffer[5 + skip_size]<<11)|
+ ((unsigned int)buffer[6 + skip_size]<<3)|
+ ((unsigned int)buffer[7 + skip_size] & 0xE0);
+
+ if (bitstream == 0) {
+ info->object_type = ((buffer[9 + skip_size]&0x01)<<1)|((buffer[10 + skip_size]&0x80)>>7);
+ sf_idx = (buffer[10 + skip_size]&0x78)>>3;
+ info->channels = ((buffer[10 + skip_size]&0x07)<<1)|((buffer[11 + skip_size]&0x80)>>7);
+ } else {
+ info->object_type = (buffer[7 + skip_size] & 0x18)>>3;
+ sf_idx = ((buffer[7 + skip_size] & 0x07)<<1)|((buffer[8 + skip_size] & 0x80)>>7);
+ info->channels = (buffer[8 + skip_size]&0x78)>>3;
+ }
+ info->sampling_rate = sample_rates[sf_idx];
+
+ return 0;
+}
+
+static int read_ADTS_header(HANDLE file, FAACAACInfo *info, int *seek_table,
+ int tagsize)
+{
+ /* Get ADTS header data */
+ unsigned char buffer[ADTS_MAX_SIZE];
+ int frames, t_framelength = 0, frame_length, sr_idx, ID;
+ int second = 0, pos;
+ float frames_per_sec = 0;
+ unsigned long bytes;
+
+ info->headertype = 2;
+
+ /* Seek to the first frame */
+ SetFilePointer(file, tagsize, NULL, FILE_BEGIN);
+
+ /* Read all frames to ensure correct time and bitrate */
+ for(frames=0; /* */; frames++)
+ {
+ /* 12 bit SYNCWORD */
+ ReadFile(file, buffer, ADTS_MAX_SIZE, &bytes, 0);
+ if(bytes != ADTS_MAX_SIZE)
+ {
+ /* Bail out if no syncword found */
+ break;
+ }
+
+ if (!((buffer[0] == 0xFF)&&((buffer[1] & 0xF6) == 0xF0)))
+ break;
+
+ pos = SetFilePointer(file, 0, NULL, FILE_CURRENT) - ADTS_MAX_SIZE;
+
+ if(!frames)
+ {
+ /* fixed ADTS header is the same for every frame, so we read it only once */
+ /* Syncword found, proceed to read in the fixed ADTS header */
+ ID = buffer[1] & 0x08;
+ info->object_type = (buffer[2]&0xC0)>>6;
+ sr_idx = (buffer[2]&0x3C)>>2;
+ info->channels = ((buffer[2]&0x01)<<2)|((buffer[3]&0xC0)>>6);
+
+ frames_per_sec = sample_rates[sr_idx] / 1024.f;
+ }
+
+ /* ...and the variable ADTS header */
+ if (ID == 0) {
+ info->version = 4;
+ frame_length = (((unsigned int)buffer[4]) << 5) |
+ ((unsigned int)buffer[5] >> 3);
+ } else { /* MPEG-2 */
+ info->version = 2;
+ frame_length = ((((unsigned int)buffer[3] & 0x3)) << 11)
+ | (((unsigned int)buffer[4]) << 3) | (buffer[5] >> 5);
+ }
+
+ t_framelength += frame_length;
+
+ if (frames > second*frames_per_sec)
+ {
+ seek_table[second] = pos;
+ second++;
+ }
+
+ SetFilePointer(file, frame_length - ADTS_MAX_SIZE, NULL, FILE_CURRENT);
+ }
+
+ info->sampling_rate = sample_rates[sr_idx];
+ info->bitrate = (int)(((t_framelength / frames) * (info->sampling_rate/1024.0)) +0.5)*8;
+ info->length = (int)((float)(frames/frames_per_sec))*1000;
+
+ return 0;
+}
+
+static int f_id3v2_tag(HANDLE file)
+{
+ unsigned char buffer[10];
+ unsigned long tmp;
+
+ ReadFile(file, buffer, 10, &tmp, 0);
+
+ if (StringComp(buffer, "ID3", 3) == 0) {
+ unsigned long tagsize;
+
+ /* high bit is not used */
+ tagsize = (buffer[6] << 21) | (buffer[7] << 14) |
+ (buffer[8] << 7) | (buffer[9] << 0);
+
+ tagsize += 10;
+
+ SetFilePointer(file, tagsize, NULL, FILE_BEGIN);
+
+ return tagsize;
+ } else {
+ SetFilePointer(file, 0, NULL, FILE_BEGIN);
+
+ return 0;
+ }
+}
+
+int get_AAC_format(char *filename, FAACAACInfo *info, int *seek_table)
+{
+ unsigned int tagsize;
+ HANDLE file;
+ unsigned long file_len;
+ unsigned char adxx_id[5];
+ unsigned long tmp;
+
+ if(StringComp(filename, "http://", 7) == 0)
+ {
+ info->version = 2;
+ info->length = 0;
+ info->bitrate = 128000;
+ info->sampling_rate = 44100;
+ info->channels = 2;
+ info->headertype = 0;
+ info->object_type = 1;
+
+ return 0;
+ }
+
+ file = CreateFile(filename, GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, 0,
+ OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, 0);
+ if (file == INVALID_HANDLE_VALUE)
+ return -1;
+
+ file_len = GetFileSize(file, NULL);
+
+ tagsize = f_id3v2_tag(file); /* Skip the tag, if it's there */
+ file_len -= tagsize;
+
+ ReadFile(file, adxx_id, 4, &tmp, 0);
+ SetFilePointer(file, tagsize, NULL, FILE_BEGIN);
+
+ adxx_id[5-1] = 0;
+
+ info->length = 0;
+
+ if(StringComp(adxx_id, "ADIF", 4) == 0)
+ {
+ read_ADIF_header(file, info);
+ }
+ else
+ {
+ if ((adxx_id[0] == 0xFF)&&((adxx_id[1] & 0xF6) == 0xF0))
+ {
+// SetFilePointer(file, tagsize, NULL, FILE_BEGIN);
+ read_ADTS_header(file, info, seek_table, tagsize);
+ }
+ else
+ {
+ /* Unknown/headerless AAC file, assume format: */
+ info->version = 2;
+ info->bitrate = 128000;
+ info->sampling_rate = 44100;
+ info->channels = 2;
+ info->headertype = 0;
+ info->object_type = 1;
+ }
+ }
+
+ if (info->length == 0)
+ info->length = (int)((file_len/(((info->bitrate*8)/1024)*16))*1000);
+
+ CloseHandle(file);
+
+ return 0;
+}
+
+int StringComp(char const *str1, char const *str2, unsigned long len)
+{
+ signed int c1 = 0, c2 = 0;
+
+ while (len--) {
+ c1 = *str1++;
+ c2 = *str2++;
+
+ if (c1 == 0 || c1 != c2)
+ break;
+ }
+
+ return c1 - c2;
+}
--- /dev/null
+++ b/winamp/AACINFO.H
@@ -1,0 +1,39 @@
+/*
+ * FAAC - Freeware Advanced Audio Decoder
+ * Copyright (C) 2001 Menno Bakker
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: AACINFO.H,v 1.1 2001/08/03 11:47:03 menno Exp $
+ */
+
+typedef struct {
+ int version;
+ int channels;
+ int sampling_rate;
+ int bitrate;
+ int length;
+ int object_type;
+ int headertype;
+} FAACAACInfo;
+
+
+int get_AAC_format(char *filename, FAACAACInfo *info, int *seek_table);
+
+static int f_id3v2_tag(HANDLE file);
+static int read_ADIF_header(HANDLE file, FAACAACInfo *info);
+static int read_ADTS_header(HANDLE file, FAACAACInfo *info, int *seek_table,
+ int tagsize);
+int StringComp(char const *str1, char const *str2, unsigned long len);
--- /dev/null
+++ b/winamp/Config.c
@@ -1,0 +1,47 @@
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+static char app_name[] = "Freeware AAC encoder";
+static char INI_FILE[MAX_PATH];
+extern char config_AACoutdir[MAX_PATH];
+extern DWORD dwOptions;
+
+static void _r_s(char *name,char *data, int mlen)
+{
+char buf[2048];
+ strcpy(buf,data);
+ GetPrivateProfileString(app_name,name,buf,data,mlen,INI_FILE);
+}
+
+#define RS(x) (_r_s(#x,x,sizeof(x)))
+#define WS(x) (WritePrivateProfileString(app_name,#x,x,INI_FILE))
+
+
+
+static void config_init()
+{
+ char *p=INI_FILE;
+ GetModuleFileName(NULL,INI_FILE,sizeof(INI_FILE));
+ while (*p) p++;
+ while (p >= INI_FILE && *p != '.') p--;
+ strcpy(p+1,"ini");
+}
+
+void config_read()
+{
+char Options[512];
+ config_init();
+ RS(config_AACoutdir);
+ RS(Options);
+ dwOptions=atoi(Options);
+}
+
+void config_write()
+{
+char Options[512];
+ WS(config_AACoutdir);
+ sprintf(Options,"%lu",dwOptions);
+ WS(Options);
+}
--- /dev/null
+++ b/winamp/FAAC.H
@@ -1,0 +1,107 @@
+/*
+ * FAAC - Freeware Advanced Audio Coder
+ * Copyright (C) 2001 Menno Bakker
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: FAAC.H,v 1.1 2001/08/03 11:47:03 menno Exp $
+ */
+
+#ifndef FAACLIB_H
+#define FAACLIB_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#ifdef WIN32
+ #pragma pack(push, 8)
+ #ifndef FAACAPI
+ #define FAACAPI __stdcall
+ #endif
+#else
+ #ifndef FAACAPI
+ #define FAACAPI
+ #endif
+#endif
+
+#define FAACENC_VERSION 1.5
+#define FAACENC_VERSIONB 0 /* If 1 this version is still in beta */
+
+/* MPEG ID's */
+#define MPEG2 1
+#define MPEG4 0
+
+/* AAC object types */
+#define MAIN 0
+#define LOW 1
+#define SSR 2
+#define LTP 3
+
+typedef struct faacEncConfiguration
+{
+ /* MPEG version, 2 or 4 */
+ unsigned int mpegVersion;
+
+ /* AAC object type */
+ unsigned int aacObjectType;
+
+ /* Allow mid/side coding */
+ unsigned int allowMidside;
+
+ /* Use one of the channels as LFE channel */
+ unsigned int useLfe;
+
+ /* Use Temporal Noise Shaping */
+ unsigned int useTns;
+
+ /* bitrate / channel of AAC file */
+ unsigned long bitRate;
+
+ /* AAC file frequency bandwidth */
+ unsigned int bandWidth;
+
+} faacEncConfiguration, *faacEncConfigurationPtr;
+
+typedef void *faacEncHandle;
+
+
+faacEncConfigurationPtr FAACAPI faacEncGetCurrentConfiguration(faacEncHandle hEncoder);
+int FAACAPI faacEncSetConfiguration (faacEncHandle hEncoder, faacEncConfigurationPtr config);
+
+faacEncHandle FAACAPI faacEncOpen(unsigned long sampleRate,
+ unsigned int numChannels,
+ unsigned long *inputSamples,
+ unsigned long *maxOutputBytes);
+
+int FAACAPI faacEncEncode(faacEncHandle hEncoder,
+ short *inputBuffer,
+ unsigned int samplesInput,
+ void *outputBuffer,
+ unsigned int bufferSize
+ );
+
+int FAACAPI faacEncClose(faacEncHandle hEncoder);
+
+
+#ifdef WIN32
+ #pragma pack(pop)
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* FAACLIB_H */
\ No newline at end of file
--- /dev/null
+++ b/winamp/FAAC.rc
@@ -1,0 +1,149 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_COMPRESSION DIALOG DISCARDABLE 0, 0, 178, 142
+STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "AAC-MPEG4 options"
+FONT 8, "MS Sans Serif"
+BEGIN
+ CONTROL "Automatic configuration",IDC_CHK_AUTOCFG,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,4,4,90,10
+ CONTROL "MPEG4",IDC_RADIO_MPEG4,"Button",BS_AUTORADIOBUTTON |
+ WS_GROUP,8,29,42,10
+ CONTROL "MPEG2",IDC_RADIO_MPEG2,"Button",BS_AUTORADIOBUTTON,8,42,
+ 41,9
+ CONTROL "Main",IDC_RADIO_MAIN,"Button",BS_AUTORADIOBUTTON |
+ WS_GROUP,12,73,31,10
+ CONTROL "Low",IDC_RADIO_LOW,"Button",BS_AUTORADIOBUTTON,12,85,29,
+ 10
+ CONTROL "SSR",IDC_RADIO_SSR,"Button",BS_AUTORADIOBUTTON |
+ WS_DISABLED,12,97,31,10
+ CONTROL "LTP",IDC_RADIO_LTP,"Button",BS_AUTORADIOBUTTON,12,109,
+ 29,10
+ CONTROL "Allow Mid/Side",IDC_ALLOWMIDSIDE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,59,21,63,10
+ CONTROL "Use TNS",IDC_USETNS,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,59,33,45,10
+ CONTROL "Use LFE channel",IDC_USELFE,"Button",BS_AUTOCHECKBOX |
+ WS_DISABLED | WS_TABSTOP,59,46,67,10
+ COMBOBOX IDC_CB_BITRATE,126,68,48,30,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_CB_BANDWIDTH,126,85,48,30,CBS_DROPDOWN | WS_VSCROLL |
+ WS_TABSTOP
+ EDITTEXT IDC_E_BROWSE,57,103,94,14,ES_AUTOHSCROLL
+ PUSHBUTTON "Browse",IDC_BTN_BROWSE,156,103,18,14,BS_BITMAP
+ DEFPUSHBUTTON "OK",IDOK,65,123,36,14
+ PUSHBUTTON "Cancel",IDCANCEL,101,123,36,14
+ PUSHBUTTON "About",IDC_BTN_ABOUT,138,123,36,14
+ GROUPBOX "AAC type",IDC_STATIC,4,18,48,38
+ GROUPBOX "Profile",IDC_STATIC,4,63,48,59
+ LTEXT "Bitrate per channel",IDC_STATIC,59,73,60,8
+ LTEXT "Bandwidth (0=full)",IDC_STATIC,59,89,57,8
+ CONTROL 104,IDC_IMG_LOGO,"Static",SS_BITMAP,138,4,36,23
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_COMPRESSION, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 174
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 137
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Italian (Italy) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA)
+#ifdef _WIN32
+LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_LOGO BITMAP DISCARDABLE "Logo.bmp"
+IDB_BROWSE BITMAP DISCARDABLE "Open.bmp"
+#endif // Italian (Italy) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
--- /dev/null
+++ b/winamp/FILTERS.H
@@ -1,0 +1,121 @@
+//////////////////////////////////////////////////////
+// GENERAL PURPOSE DEFS FOR CREATING CUSTOM FILTERS //
+//////////////////////////////////////////////////////
+
+
+typedef struct riffspecialdata_t
+{ HANDLE hSpecialData;
+ HANDLE hData; // Actual data handle
+ DWORD dwSize; // size of data in handle
+ DWORD dwExtra; // optional extra data (usually a count)
+ char szListType[8]; // Parent list type (usually "WAVE" or "INFO", or "adtl")
+ char szType[8]; // Usually a four character code for data, but can be up to 7 chars
+} SPECIALDATA;
+
+// "CUE " dwExtra=number of cues, each cue is 8 bytes ([4] name [4] sample offset)
+// "LTXT" dwExtra=number of items, each one is 8 bytes ([4] ltxt len [4] name [4] cue length [4] purpose [n] data)
+// "NOTE" dwExtra=number of strings, each one is n bytes ([4] name [n-4] length zero term)
+// "LABL" dwExtra=number of strings, each one is n bytes ([4] name [n-4] length zero term)
+// "PLST" dwExtra=number if items, each one is 16 bytes ([4] name [4] dwLen [4] dwLoops [4] dwMode)
+
+
+// For special data, .FLT must implement FilterGetFirstSpecialData and FilterGetNextSpecialData
+
+
+typedef DWORD FOURCC; // a four character code
+
+struct cue_type { DWORD dwName;
+ DWORD dwPosition;
+ FOURCC fccChunk;
+ DWORD dwChunkStart;
+ DWORD dwBlockStart;
+ DWORD dwSampleOffset;
+ };
+
+struct play_type {DWORD dwName;
+ DWORD dwLength;
+ DWORD dwLoops;
+ };
+
+
+typedef struct coolquery_tag
+ {char szName[24];
+ char szCopyright[80];
+
+ // rate table, bits are set for modes that can be handled
+ WORD Quad32; // Quads are 3-D encoded
+ WORD Quad16;
+ WORD Quad8;
+ WORD Stereo8; // rates are from lowest bit:
+ WORD Stereo12; // bit 0 set: 5500 (5512.5)
+ WORD Stereo16; // bit 1 set: 11025 (11K)
+ WORD Stereo24; // bit 2 set: 22050 (22K)
+ WORD Stereo32; // bit 3 set: 32075 (32K, or 32000)
+ WORD Mono8; // bit 4 set: 44100 (44K)
+ WORD Mono12; // bit 5 set: 48000 (48K)
+ WORD Mono16; // bit 6 set: 88200 (88K) (future ultra-sonic rates?)
+ WORD Mono24; // bit 7 set: 96000 (96K)
+ WORD Mono32; // bit 8 set: 132300 (132K)
+ // bit 9 set: 176400 (176K)
+ DWORD dwFlags;
+ char szExt[4];
+ long lChunkSize;
+ char szExt2[4];
+ char szExt3[4];
+ char szExt4[4];
+ } COOLQUERY;
+
+#define R_5500 1
+#define R_11025 2
+#define R_22050 4
+#define R_32075 8
+#define R_44100 16
+#define R_48000 32
+#define R_88200 64
+#define R_96000 128
+#define R_132300 256
+#define R_176400 512
+
+#define C_VALIDLIBRARY 1154
+
+#define QF_RATEADJUSTABLE 0x001 // if can handle non-standard sample rates
+ // if not, only rates in bit rate table understood
+#define QF_CANSAVE 0x002
+#define QF_CANLOAD 0x004
+#define QF_UNDERSTANDSALL 0x008 // will read ANYTHING, so it is the last resort if no other
+ // formats match
+#define QF_READSPECIALFIRST 0x010 // read special info before trying to read data
+#define QF_READSPECIALLAST 0x020 // read special info after reading data
+#define QF_WRITESPECIALFIRST 0x040 // when writing a file, special info is sent to DLL before data
+#define QF_WRITESPECIALLAST 0x080 // when writing, special info is sent to DLL after data
+#define QF_HASOPTIONSBOX 0x100 // set if options box implemented
+#define QF_NOASKFORCONVERT 0x200 // set to bypass asking for conversion if original in different rate, auto convert
+#define QF_NOHEADER 0x400 // set if this is a raw data format with no header
+#define QF_CANDO32BITFLOATS 0x800 // set if file format can handle 32-bit sample data for input
+#define QF_CANOPENVIRTUAL 0x1000 // Set if data is in Intel 8-bit or 16-bit sample format, or floats
+ // and the GetDataOffset() function is implemented
+
+// special types are read from and written to DLL in the order below
+/*
+// special types (particular to Windows waveforms)
+#define SP_IART 20
+#define SP_ICMT 21
+#define SP_ICOP 22
+#define SP_ICRD 23
+#define SP_IENG 24
+#define SP_IGNR 25
+#define SP_IKEY 26
+#define SP_IMED 27
+#define SP_INAM 28
+#define SP_ISFT 29
+#define SP_ISRC 30
+#define SP_ITCH 31
+#define SP_ISBJ 32
+#define SP_ISRF 33
+#define SP_DISP 34
+#define SP_CUE 40 // returns number of cues of size cue_type
+#define SP_LTXT 41 // returns number of adtl texts of size 8 (4,id and 4,len)
+#define SP_NOTE 42 // returns LO=size, HI=number of strings (sz sz sz...)
+#define SP_LABL 43 // returns LO=size, HI=number of strings (sz sz sz...)
+#define SP_PLST 44 // returns number of playlist entries size play_type
+*/
\ No newline at end of file
binary files /dev/null b/winamp/Logo.bmp differ
--- /dev/null
+++ b/winamp/OUT.H
@@ -1,0 +1,52 @@
+#define OUT_VER 0x10
+
+typedef struct
+{
+ int version; // module version (OUT_VER)
+ char *description; // description of module, with version string
+ int id; // module id. each input module gets its own. non-nullsoft modules should
+ // be >= 65536.
+
+ HWND hMainWindow; // winamp's main window (filled in by winamp)
+ HINSTANCE hDllInstance; // DLL instance handle (filled in by winamp)
+
+ void (*Config)(HWND hwndParent); // configuration dialog
+ void (*About)(HWND hwndParent); // about dialog
+
+ void (*Init)(); // called when loaded
+ void (*Quit)(); // called when unloaded
+
+ int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms);
+ // returns >=0 on success, <0 on failure
+ // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins.
+ // ... so don't expect the max latency returned to be what you asked for.
+ // returns max latency in ms (0 for diskwriters, etc)
+ // bufferlenms and prebufferms must be in ms. 0 to use defaults.
+ // prebufferms must be <= bufferlenms
+
+ void (*Close)(); // close the ol' output device.
+
+ int (*Write)(char *buf, int len);
+ // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data.
+ // 1 returns not able to write (yet). Non-blocking, always.
+
+ int (*CanWrite)(); // returns number of bytes possible to write at a given time.
+ // Never will decrease unless you call Write (or Close, heh)
+
+ int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be
+ // written (i.e. closing while IsPlaying() returns 1 would truncate the song
+
+ int (*Pause)(int pause); // returns previous pause state
+
+ void (*SetVolume)(int volume); // volume is 0-255
+ void (*SetPan)(int pan); // pan is -128 to 128
+
+ void (*Flush)(int t); // flushes buffers and restarts output at time t (in ms)
+ // (used for seeking)
+
+ int (*GetOutputTime)(); // returns played time in MS
+ int (*GetWrittenTime)(); // returns time written in MS (used for synching up vis stuff)
+
+} Out_Module;
+
+
binary files /dev/null b/winamp/Open.bmp differ
--- /dev/null
+++ b/winamp/Out_faac.c
@@ -1,0 +1,850 @@
+#include <windows.h>
+#include <shlobj.h>
+#include <stdio.h> // FILE *
+#include "resource.h"
+#include "faac.h"
+#include "out.h"
+
+
+#define PI_VER "v1.0beta"
+
+
+extern void config_read();
+extern void config_write();
+
+int getwrittentime();
+
+
+typedef struct output_tag // any special vars associated with output file
+{
+ FILE *fFile;
+ DWORD lSize;
+ long lSamprate;
+ WORD wBitsPerSample;
+ WORD wChannels;
+// DWORD dwDataOffset;
+ //BOOL bWrittenHeader;
+ char szNAME[256];
+
+ faacEncHandle hEncoder;
+ unsigned char *bitbuf;
+ DWORD maxBytesOutput;
+ long samplesInput;
+ BOOL bStopEnc;
+
+ unsigned char *inbuf;
+ DWORD full_size; // size of decoded file needed to set the length of progress bar
+ DWORD tagsize;
+ DWORD bytes_read; // from file
+ DWORD bytes_consumed; // by faadDecDecode
+ DWORD bytes_into_buffer;
+ DWORD bytes_Enc;
+} MYOUTPUT;
+
+Out_Module out;
+char config_AACoutdir[MAX_PATH]="";
+DWORD dwOptions;
+static MYOUTPUT mo0,
+ *mo=&mo0; // this is done to drag'n'drop code from CoolEdit plugin
+static HBITMAP hBmBrowse=NULL;
+static int srate, numchan, bps;
+volatile int writtentime, w_offset;
+static int last_pause=0;
+
+
+
+BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ulReason, LPVOID lpReserved)
+{
+ switch(ulReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(hInst);
+ if(!hBmBrowse)
+ hBmBrowse=LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BROWSE));
+ /* Code from LibMain inserted here. Return TRUE to keep the
+ DLL loaded or return FALSE to fail loading the DLL.
+
+ You may have to modify the code in your original LibMain to
+ account for the fact that it may be called more than once.
+ You will get one DLL_PROCESS_ATTACH for each process that
+ loads the DLL. This is different from LibMain which gets
+ called only once when the DLL is loaded. The only time this
+ is critical is when you are using shared data sections.
+ If you are using shared data sections for statically
+ allocated data, you will need to be careful to initialize it
+ only once. Check your code carefully.
+
+ Certain one-time initializations may now need to be done for
+ each process that attaches. You may also not need code from
+ your original LibMain because the operating system may now
+ be doing it for you.
+ */
+ break;
+
+ case DLL_THREAD_ATTACH:
+ /* Called each time a thread is created in a process that has
+ already loaded (attached to) this DLL. Does not get called
+ for each thread that exists in the process before it loaded
+ the DLL.
+
+ Do thread-specific initialization here.
+ */
+ break;
+
+ case DLL_THREAD_DETACH:
+ /* Same as above, but called when a thread in the process
+ exits.
+
+ Do thread-specific cleanup here.
+ */
+ break;
+
+ case DLL_PROCESS_DETACH:
+ if(hBmBrowse)
+ {
+ DeleteObject(hBmBrowse);
+ hBmBrowse=NULL;
+ }
+ /* Code from _WEP inserted here. This code may (like the
+ LibMain) not be necessary. Check to make certain that the
+ operating system is not doing it for you.
+ */
+ break;
+ }
+
+ /* The return value is only used for DLL_PROCESS_ATTACH; all other
+ conditions are ignored. */
+ return TRUE; // successful DLL_PROCESS_ATTACH
+}
+
+static int CALLBACK WINAPI BrowseCallbackProc( HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
+{
+ if (uMsg == BFFM_INITIALIZED)
+ {
+ SetWindowText(hwnd,"Select Directory");
+ SendMessage(hwnd,BFFM_SETSELECTION,(WPARAM)1,(LPARAM)config_AACoutdir);
+ }
+ return 0;
+}
+
+
+static BOOL CALLBACK DIALOGMsgProc(HWND hWndDlg, UINT Message, WPARAM wParam, LPARAM lParam)
+{
+ switch(Message)
+ {
+ case WM_INITDIALOG:
+ {
+ char buf[10];
+ SendMessage(GetDlgItem(hWndDlg, IDC_BTN_BROWSE), BM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hBmBrowse);
+ SetDlgItemText(hWndDlg, IDC_E_BROWSE, config_AACoutdir);
+
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"8");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"18");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"20");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"24");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"32");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"40");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"48");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"56");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"64");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"96");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"112");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"128");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"160");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"192");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"256");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_SETCURSEL, 8, 0);
+
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"0");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"4000");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"8000");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"16000");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"22050");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"24000");
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_SETCURSEL, 0, 0);
+
+ if(dwOptions)
+ {
+ char Enabled=!(dwOptions&1);
+ CheckDlgButton(hWndDlg,IDC_CHK_AUTOCFG, dwOptions&1);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_MPEG4), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_MPEG2), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_MAIN), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_LOW), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_SSR), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_LTP), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_ALLOWMIDSIDE), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_USETNS), Enabled);
+// EnableWindow(GetDlgItem(hWndDlg, IDC_USELFE), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_CB_BITRATE), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), Enabled);
+
+ if(((dwOptions>>29)&7)==MPEG4)
+ CheckDlgButton(hWndDlg,IDC_RADIO_MPEG4,TRUE);
+ else
+ CheckDlgButton(hWndDlg,IDC_RADIO_MPEG2,TRUE);
+
+ switch((dwOptions>>27)&3)
+ {
+ case 0:
+ CheckDlgButton(hWndDlg,IDC_RADIO_MAIN,TRUE);
+ break;
+ case 1:
+ CheckDlgButton(hWndDlg,IDC_RADIO_LOW,TRUE);
+ break;
+ case 2:
+ CheckDlgButton(hWndDlg,IDC_RADIO_SSR,TRUE);
+ break;
+ case 3:
+ CheckDlgButton(hWndDlg,IDC_RADIO_LTP,TRUE);
+ break;
+ }
+
+ CheckDlgButton(hWndDlg, IDC_ALLOWMIDSIDE, (dwOptions>>26)&1);
+ CheckDlgButton(hWndDlg, IDC_USETNS, (dwOptions>>25)&1);
+ CheckDlgButton(hWndDlg, IDC_USELFE, (dwOptions>>24)&1);
+
+ SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_SETCURSEL, (dwOptions>>19)&31, 0);
+// SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_SETCURSEL, (dwOptions>>6)&31, 0);
+ sprintf(buf,"%lu",(dwOptions>>1)&0x0000ffff);
+ SetDlgItemText(hWndDlg, IDC_CB_BANDWIDTH, buf);
+ break;
+ } // End dwOptions
+
+ CheckDlgButton(hWndDlg, IDC_ALLOWMIDSIDE, TRUE);
+ CheckDlgButton(hWndDlg, IDC_USETNS, TRUE);
+ CheckDlgButton(hWndDlg, IDC_USELFE, FALSE);
+
+ switch((long)lParam)
+ {
+ case IDC_RADIO_MPEG4:
+ CheckDlgButton(hWndDlg,IDC_RADIO_MPEG4,TRUE);
+ break;
+ case IDC_RADIO_MPEG2:
+ CheckDlgButton(hWndDlg,IDC_RADIO_MPEG2,TRUE);
+ break;
+ case IDC_RADIO_MAIN:
+ CheckDlgButton(hWndDlg,IDC_RADIO_MAIN,TRUE);
+ break;
+ case IDC_RADIO_LOW:
+ CheckDlgButton(hWndDlg,IDC_RADIO_LOW,TRUE);
+ break;
+ case IDC_RADIO_SSR:
+ CheckDlgButton(hWndDlg,IDC_RADIO_SSR,TRUE);
+ break;
+ case IDC_RADIO_LTP:
+ CheckDlgButton(hWndDlg,IDC_RADIO_LTP,TRUE);
+ break;
+ case IDC_CHK_AUTOCFG:
+ CheckDlgButton(hWndDlg,IDC_CHK_AUTOCFG, !IsDlgButtonChecked(hWndDlg,IDC_CHK_AUTOCFG));
+ break;
+ default:
+ CheckDlgButton(hWndDlg,IDC_RADIO_MPEG4,TRUE);
+ CheckDlgButton(hWndDlg,IDC_RADIO_MAIN,TRUE);
+ break;
+ }
+ }
+ break; // End of WM_INITDIALOG
+
+ case WM_CLOSE:
+ // Closing the Dialog behaves the same as Cancel
+ PostMessage(hWndDlg, WM_COMMAND, IDCANCEL, 0L);
+ break; // End of WM_CLOSE
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam))
+ {
+ case IDC_CHK_AUTOCFG:
+ {
+ char Enabled=!IsDlgButtonChecked(hWndDlg,IDC_CHK_AUTOCFG);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_MPEG4), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_MPEG2), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_MAIN), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_LOW), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_SSR), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_LTP), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_ALLOWMIDSIDE), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_USETNS), Enabled);
+// EnableWindow(GetDlgItem(hWndDlg, IDC_USELFE), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_CB_BITRATE), Enabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), Enabled);
+ }
+ break;
+
+ case IDC_BTN_BROWSE:
+ {
+ char name[MAX_PATH];
+ BROWSEINFO bi;
+ ITEMIDLIST *idlist;
+ bi.hwndOwner = hWndDlg;
+ bi.pidlRoot = 0;
+ bi.pszDisplayName = name;
+ bi.lpszTitle = "Select a directory for AAC-MPEG4 file output:";
+ bi.ulFlags = BIF_RETURNONLYFSDIRS;
+ bi.lpfn = BrowseCallbackProc;
+ bi.lParam = 0;
+ idlist = SHBrowseForFolder( &bi );
+ if (idlist)
+ SHGetPathFromIDList( idlist, config_AACoutdir );
+
+ SetDlgItemText(hWndDlg, IDC_E_BROWSE, config_AACoutdir);
+ }
+ break;
+
+ case IDC_E_BROWSE:
+ GetDlgItemText(hWndDlg, IDC_E_BROWSE, config_AACoutdir,256);
+ break;
+
+ case IDOK:
+ {
+ DWORD retVal=0;
+ faacEncConfiguration faacEncCfg;
+
+ if(IsDlgButtonChecked(hWndDlg,IDC_RADIO_MPEG4))
+ {
+ faacEncCfg.mpegVersion=MPEG4;
+ retVal|=MPEG4<<29;
+ }
+ if(IsDlgButtonChecked(hWndDlg,IDC_RADIO_MPEG2))
+ {
+ faacEncCfg.mpegVersion=MPEG2;
+ retVal|=MPEG2<<29;
+ }
+ if(IsDlgButtonChecked(hWndDlg,IDC_RADIO_MAIN))
+ faacEncCfg.aacObjectType=0;
+ if(IsDlgButtonChecked(hWndDlg,IDC_RADIO_LOW))
+ {
+ faacEncCfg.aacObjectType=LOW;
+ retVal|=1<<27;
+ }
+ if(IsDlgButtonChecked(hWndDlg,IDC_RADIO_SSR))
+ {
+ faacEncCfg.aacObjectType=2;
+ retVal|=2<<27;
+ }
+ if(IsDlgButtonChecked(hWndDlg,IDC_RADIO_LTP))
+ {
+ faacEncCfg.aacObjectType=3;
+ retVal|=3<<27;
+ }
+
+ faacEncCfg.allowMidside=IsDlgButtonChecked(hWndDlg, IDC_ALLOWMIDSIDE) == BST_CHECKED ? 1 : 0;
+ retVal|=faacEncCfg.allowMidside<<26;
+ faacEncCfg.useTns=IsDlgButtonChecked(hWndDlg, IDC_USETNS) == BST_CHECKED ? 1 : 0;
+ retVal|=faacEncCfg.useTns<<25;
+ faacEncCfg.useLfe=IsDlgButtonChecked(hWndDlg, IDC_USELFE) == BST_CHECKED ? 1 : 0;
+ retVal|=faacEncCfg.useLfe<<24;
+
+ faacEncCfg.bitRate=GetDlgItemInt(hWndDlg, IDC_CB_BITRATE, 0, FALSE);
+ retVal|=(SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_GETCURSEL, 0, 0)&31)<<19;
+ //retVal|=faacEncCfg.bitRate;
+ faacEncCfg.bandWidth=GetDlgItemInt(hWndDlg, IDC_CB_BANDWIDTH, 0, FALSE);
+// retVal|=(SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_GETCURSEL, 0, 0)&31)<<6;
+ retVal|=(faacEncCfg.bandWidth&0x0000ffff)<<1;
+
+ if(IsDlgButtonChecked(hWndDlg,IDC_CHK_AUTOCFG))
+ retVal|=1;
+
+ EndDialog(hWndDlg, retVal);
+ }
+ break;
+
+ case IDCANCEL:
+ // Ignore data values entered into the controls
+ // and dismiss the dialog window returning FALSE
+ EndDialog(hWndDlg, FALSE);
+ break;
+
+ case IDC_BTN_ABOUT:
+ {
+ char buf[256];
+ sprintf(buf,"AAC-MPEG4 encoder plug-in %s\nThis plugin uses FAAC encoder engine v%g\n\nCompiled on %s\n",
+ PI_VER,
+ FAACENC_VERSION,
+ __DATE__
+ );
+ MessageBox(hWndDlg, buf, "About", MB_OK);
+ }
+ break;
+ }
+ break; // End of WM_COMMAND
+ default: return FALSE;
+ }
+ return TRUE;
+} // End of DIALOGSMsgProc
+
+
+
+void config(HWND hWnd)
+{
+ dwOptions=DialogBox(out.hDllInstance, MAKEINTRESOURCE(IDD_COMPRESSION), hWnd, DIALOGMsgProc);
+// dwOptions=DialogBoxParam((HINSTANCE)out.hDllInstance,(LPCSTR)MAKEINTRESOURCE(IDD_COMPRESSION), (HWND)hWnd, (DLGPROC)DIALOGMsgProc, dwOptions);
+ config_write();
+}
+
+void about(HWND hwnd)
+{
+char buf[256];
+ sprintf(buf,"AAC-MPEG4 encoder plug-in %s\nThis plugin uses FAAC encoder engine v%g\n\nCompiled on %s\n",
+ PI_VER,
+ FAACENC_VERSION,
+ __DATE__);
+ MessageBox(hwnd, buf, "About", MB_OK);
+/* MessageBox(hwnd,"AAC-MPEG4 encoder plug-in " PI_VER "\n"
+ "This plugin uses FAAC encoder engine v1.5\n\n"
+ "Compiled on " __DATE__ "\n","About",MB_OK);*/
+}
+
+void init()
+{
+ config_read();
+}
+
+void quit()
+{
+}
+
+static char *scanstr_back(char *str, char *toscan, char *defval)
+{
+ char *s=str+strlen(str)-1;
+ if (strlen(str) < 1) return defval;
+ if (strlen(toscan) < 1) return defval;
+ while (1)
+ {
+ char *t=toscan;
+ while (*t)
+ if (*t++ == *s) return s;
+ t=CharPrev(str,s);
+ if (t==s) return defval;
+ s=t;
+ }
+}
+
+int open(int lSamprate, int wChannels, int wBitsPerSample, int bufferlenms, int prebufferms)
+{
+//HANDLE hOutput;
+faacEncHandle hEncoder;
+FILE *outfile;
+unsigned char *bitbuf;
+DWORD maxBytesOutput;
+long samplesInput;
+int bytesEncoded;
+
+
+ char *t,*p;
+ char temp2[MAX_PATH],lpstrFilename[MAX_PATH];
+ GetWindowText(out.hMainWindow,temp2,sizeof(temp2));
+ t=temp2;
+
+ t=scanstr_back(temp2,"-",NULL);
+ if (t) t[-1]=0;
+
+ if (temp2[0] && temp2[1] == '.')
+ {
+ char *p1,*p2;
+ p1=lpstrFilename;
+ p2=temp2;
+ while (*p2) *p1++=*p2++;
+ *p1=0;
+ p1 = temp2+1;
+ p2 = lpstrFilename;
+ while (*p2)
+ {
+ *p1++ = *p2++;
+ }
+ *p1=0;
+ temp2[0] = '0';
+ }
+ p=temp2;
+ while (*p != '.' && *p) p++;
+ if (*p == '.')
+ {
+ *p = '-';
+ p=CharNext(p);
+ }
+ while (*p)
+ {
+ if (*p == '.' || *p == '/' || *p == '\\' || *p == '*' ||
+ *p == '?' || *p == ':' || *p == '+' || *p == '\"' ||
+ *p == '\'' || *p == '|' || *p == '<' || *p == '>') *p = '_';
+ p=CharNext(p);
+ }
+
+ p=config_AACoutdir;
+ if (p[0]) while (p[1]) p++;
+
+ if (!config_AACoutdir[0] || config_AACoutdir[0] == ' ')
+ config(out.hMainWindow);
+ if (!config_AACoutdir[0])
+ wsprintf(lpstrFilename,"%s.aac",temp2);
+ else if (p[0]=='\\')
+ wsprintf(lpstrFilename,"%s%s.aac",config_AACoutdir,temp2);
+ else
+ wsprintf(lpstrFilename,"%s\\%s.aac",config_AACoutdir,temp2);
+
+ w_offset = writtentime = 0;
+ numchan = wChannels;
+ srate = lSamprate;
+ bps = wBitsPerSample;
+
+
+
+ /* open the aac output file */
+ if(!(outfile=fopen(lpstrFilename, "wb")))
+ {
+ MessageBox(0, "Can't create file", "FAAC interface", MB_OK);
+ return -1;
+ }
+
+ /* open the encoder library */
+ if(!(hEncoder=faacEncOpen(lSamprate, wChannels, &samplesInput, &maxBytesOutput)))
+ {
+ MessageBox(0, "Can't init library", "FAAC interface", MB_OK);
+ fclose(outfile);
+ return -1;
+ }
+
+ if(!(bitbuf=(unsigned char*)malloc(maxBytesOutput*sizeof(unsigned char))))
+ {
+ MessageBox(0, "Memory allocation error: output buffer", "FAAC interface", MB_OK);
+ faacEncClose(hEncoder);
+ fclose(outfile);
+ return -1;
+ }
+
+ if(!(mo->inbuf=(unsigned char*)malloc(sizeof(short)*1024*wChannels)))
+ {
+ MessageBox(0, "Memory allocation error: output buffer", "FAAC interface", MB_OK);
+ faacEncClose(hEncoder);
+ fclose(outfile);
+ free(bitbuf);
+ return -1;
+ }
+
+// *lpChunkSize=samplesInput*2;
+
+/* hOutput=GlobalAlloc(GMEM_MOVEABLE|GMEM_SHARE,sizeof(MYOUTPUT));
+ if(hOutput)
+ {
+ MYOUTPUT *mo;*/
+ //mo=(MYOUTPUT *)GlobalLock(hOutput);
+ mo->fFile=outfile;
+// mo->lSize=lSize;
+ mo->lSamprate=lSamprate;
+ mo->wBitsPerSample=wBitsPerSample;
+ mo->wChannels=wChannels;
+// mo->dwDataOffset=0; // ???
+// mo->bWrittenHeader=0;
+ strcpy(mo->szNAME,lpstrFilename);
+
+ mo->hEncoder=hEncoder;
+ mo->bitbuf=bitbuf;
+ mo->maxBytesOutput=maxBytesOutput;
+ mo->samplesInput=samplesInput*(sizeof(short));
+ mo->bStopEnc=0;
+
+// GlobalUnlock(hOutput);
+/* }
+ else
+ {
+ MessageBox(0, "hOutput=NULL", "FAAC interface", MB_OK);
+ faacEncClose(hEncoder);
+ fclose(outfile);
+ free(bitbuf);
+ free(mo->inbuf);
+ return -1;
+ }*/
+
+ if(dwOptions && !(dwOptions&1))
+ {
+ faacEncConfigurationPtr myFormat;
+ myFormat=faacEncGetCurrentConfiguration(hEncoder);
+
+ myFormat->mpegVersion=(dwOptions>>29)&7;
+ myFormat->aacObjectType=(dwOptions>>27)&3;
+ myFormat->allowMidside=(dwOptions>>26)&1;
+ myFormat->useTns=(dwOptions>>25)&1;
+ myFormat->useLfe=(dwOptions>>24)&1;
+
+ switch((dwOptions>>19)&31)
+ {
+ case 0:
+ myFormat->bitRate=8000;
+ break;
+ case 1:
+ myFormat->bitRate=18000;
+ break;
+ case 2:
+ myFormat->bitRate=20000;
+ break;
+ case 3:
+ myFormat->bitRate=24000;
+ break;
+ case 4:
+ myFormat->bitRate=32000;
+ break;
+ case 5:
+ myFormat->bitRate=40000;
+ break;
+ case 6:
+ myFormat->bitRate=48000;
+ break;
+ case 7:
+ myFormat->bitRate=56000;
+ break;
+ case 8:
+ myFormat->bitRate=64000;
+ break;
+ case 9:
+ myFormat->bitRate=96000;
+ break;
+ case 10:
+ myFormat->bitRate=112000;
+ break;
+ case 11:
+ myFormat->bitRate=128000;
+ break;
+ case 12:
+ myFormat->bitRate=160000;
+ break;
+ case 13:
+ myFormat->bitRate=192000;
+ break;
+ case 14:
+ myFormat->bitRate=256000;
+ break;
+ }
+ myFormat->bandWidth=(dwOptions>>1)&0x0000ffff;
+ if(!myFormat->bandWidth)
+ myFormat->bandWidth=mo->lSamprate/2;
+
+ if(!faacEncSetConfiguration(hEncoder, myFormat))
+ {
+ MessageBox(0, "Unsupported parameters", "FAAC interface", MB_OK);
+ faacEncClose(hEncoder);
+ fclose(outfile);
+ free(bitbuf);
+ free(mo->inbuf);
+// GlobalFree(hOutput);
+ return -1;
+ }
+/* {
+faacEncConfigurationPtr myFormat;
+ myFormat=faacEncGetCurrentConfiguration(hEncoder);
+
+ myFormat->mpegVersion=faacEncCfg.mpegVersion;
+ myFormat->aacObjectType=faacEncCfg.aacObjectType;
+ myFormat->allowMidside=faacEncCfg.allowMidside;
+ myFormat->useLfe=faacEncCfg.useLfe;
+ myFormat->useTns=faacEncCfg.useTns;
+ myFormat->bandWidth=faacEncCfg.bandWidth;
+ myFormat->bitRate=faacEncCfg.bitRate;
+
+ if(!faacEncSetConfiguration(hEncoder, myFormat))
+ {
+ MessageBox(0, "Unsupported parameters", "FAAC interface", MB_OK);
+ faacEncClose(hEncoder);
+ fclose(outfile);
+ free(bitbuf);
+ free(mo->inbuf);
+ GlobalFree(hOutput);
+ return -1;
+ }*/
+ }
+
+ bytesEncoded=faacEncEncode(hEncoder, 0, 0, bitbuf, maxBytesOutput); // initializes the flushing process
+ if(bytesEncoded>0)
+ fwrite(bitbuf, 1, bytesEncoded, outfile);
+
+ return 0;
+}
+
+void close()
+{
+ if(mo->bytes_into_buffer)
+ {
+int bytesEncoded;
+ bytesEncoded=faacEncEncode(mo->hEncoder, (short *)mo->inbuf, mo->bytes_into_buffer/sizeof(short), mo->bitbuf, mo->maxBytesOutput);
+ if(bytesEncoded>0)
+ fwrite(mo->bitbuf, 1, bytesEncoded, mo->fFile);
+ }
+
+ if(mo->hEncoder)
+ faacEncClose(mo->hEncoder);
+ if(mo->fFile)
+ fclose(mo->fFile);
+ if(mo->bitbuf)
+ free(mo->bitbuf);
+ if(mo->inbuf)
+ free(mo->inbuf);
+
+// CloseHandle(outfile);
+}
+
+int write(char *buf, int len)
+{
+int bytesWritten;
+int bytesEncoded;
+int k,i,shift=0;
+
+// int t;
+ writtentime += len;
+
+// WriteFile(outfile,buf,len,&t,NULL);
+
+
+/* if(hOutput)
+ {
+ MYOUTPUT far *mo;
+ mo=(MYOUTPUT far *)GlobalLock(hOutput);*/
+
+ if(!mo->bStopEnc)
+ {
+// if(writtentime>mo->lSize)
+// return 0;
+
+ if(mo->bytes_into_buffer+len<mo->samplesInput)
+ {
+ memcpy(mo->inbuf+mo->bytes_into_buffer, buf, len);
+ mo->bytes_into_buffer+=len;
+ return 0;
+ }
+ else
+ {
+ memcpy(mo->inbuf+mo->bytes_into_buffer, buf, mo->samplesInput-mo->bytes_into_buffer);
+ shift=mo->samplesInput-mo->bytes_into_buffer;
+ mo->bytes_into_buffer+=shift;
+ len-=shift;
+ buf+=shift;
+
+ bytesEncoded=faacEncEncode(mo->hEncoder, (short *)mo->inbuf, mo->samplesInput/sizeof(short), mo->bitbuf, mo->maxBytesOutput);
+ mo->bytes_into_buffer=0;
+ if(bytesEncoded<1) // end of flushing process
+ {
+ if(bytesEncoded<0)
+ MessageBox(0, "faacEncEncode() failed", "FAAC interface", MB_OK);
+ mo->bStopEnc=1;
+// GlobalUnlock(hOutput);
+ return -1;
+ }
+ }
+
+ if(mo->bytes_into_buffer)
+ {
+ if(bytesEncoded<0)
+ MessageBox(0, "bytes_into_buffer>0", "FAAC interface", MB_OK);
+ mo->bStopEnc=1;
+// GlobalUnlock(hOutput);
+ return -1;
+ }
+
+// call the actual encoding routine
+ k=len/mo->samplesInput;
+ for(i=0; i<k; i++)
+ bytesEncoded+=faacEncEncode(mo->hEncoder, (short *)(buf+i*mo->samplesInput), mo->samplesInput/sizeof(short), mo->bitbuf, mo->maxBytesOutput);
+ memcpy(mo->inbuf+mo->bytes_into_buffer, buf, len%mo->samplesInput);
+ mo->bytes_into_buffer+=len%mo->samplesInput;
+ if(bytesEncoded<1) // end of flushing process
+ {
+ if(bytesEncoded<0)
+ MessageBox(0, "faacEncEncode() failed", "FAAC interface", MB_OK);
+ mo->bStopEnc=1;
+// GlobalUnlock(hOutput);
+ return -1;
+ }
+// write bitstream to aac file
+ bytesWritten=fwrite(mo->bitbuf, 1, bytesEncoded, mo->fFile);
+ if(bytesWritten!=bytesEncoded)
+ {
+ MessageBox(0, "bytesWritten and bytesEncoded are different", "FAAC interface", MB_OK);
+ mo->bStopEnc=1;
+// GlobalUnlock(hOutput);
+ return -1;
+ }
+
+// GlobalUnlock(hOutput);
+ }
+// }
+
+
+ Sleep(0);
+ return 0;
+}
+
+int canwrite()
+{
+ return last_pause ? 0 : 16*1024*1024;
+// return last_pause ? 0 : mo->samplesInput;
+// return mo->samplesInput;
+}
+
+int isplaying()
+{
+ return 0;
+}
+
+int pause(int pause)
+{
+ int t=last_pause;
+ last_pause=pause;
+ return t;
+}
+
+void setvolume(int volume)
+{
+}
+
+void setpan(int pan)
+{
+}
+
+void flush(int t)
+{
+ int a;
+ w_offset=0;
+ a = t - getwrittentime();
+ w_offset=a;
+}
+
+int getwrittentime()
+{
+ int t=srate*numchan,l;
+ int ms=writtentime;
+
+ l=ms%t;
+ ms /= t;
+ ms *= 1000;
+ ms += (l*1000)/t;
+
+ if (bps == 16) ms/=2;
+
+ return ms + w_offset;
+}
+
+Out_Module out = {
+ OUT_VER,
+ "Freeware AAC encoder " PI_VER,
+ 33,
+ 0, // hmainwindow
+ 0, // hdllinstance
+ config,
+ about,
+ init,
+ quit,
+ open,
+ close,
+ write,
+ canwrite,
+ isplaying,
+ pause,
+ setvolume,
+ setpan,
+ flush,
+ getwrittentime,
+ getwrittentime
+};
+
+__declspec( dllexport ) Out_Module * winampGetOutModule()
+{
+ return &out;
+}
--- /dev/null
+++ b/winamp/RESOURCE.H
@@ -1,0 +1,44 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by FAAC.rc
+//
+#define IDD_COMPRESSION 101
+#define IDB_LOGO 104
+#define IDB_BROWSE 106
+#define IDB_OPEN 107
+#define IDC_RADIO1 1000
+#define IDC_RADIO_MPEG4 1000
+#define IDC_RADIO2 1001
+#define IDC_RADIO_MPEG2 1001
+#define IDC_RADIO4 1002
+#define IDC_RADIO_LOW 1002
+#define IDC_RADIO3 1003
+#define IDC_RADIO_MAIN 1003
+#define IDC_RADIO5 1004
+#define IDC_RADIO_SSR 1004
+#define IDC_RADIO6 1005
+#define IDC_RADIO_LTP 1005
+#define IDC_RADIO7 1006
+#define IDC_RADIO8 1007
+#define IDC_RADIO9 1008
+#define IDC_ALLOWMIDSIDE 1011
+#define IDC_USETNS 1012
+#define IDC_USELFE 1013
+#define IDC_CB_BANDWIDTH 1015
+#define IDC_CB_BITRATE 1017
+#define IDC_CHK_AUTOCFG 1020
+#define IDC_E_BROWSE 1021
+#define IDC_BTN_BROWSE 1022
+#define IDC_IMG_LOGO 1023
+#define IDC_BTN_ABOUT 1024
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 108
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1025
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
--- /dev/null
+++ b/winamp/ReadMe.txt
@@ -1,0 +1,1 @@
+mail: kreel@interfree.it
--- /dev/null
+++ b/winamp/out_FAAC.dsp
@@ -1,0 +1,140 @@
+# Microsoft Developer Studio Project File - Name="out_FAAC" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=out_FAAC - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "out_FAAC.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "out_FAAC.mak" CFG="out_FAAC - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "out_FAAC - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "out_FAAC - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "out_FAAC - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 1
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "out_FAAC_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MT /W3 /Gi /GX /O2 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "out_FAAC_EXPORTS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+# SUBTRACT RSC /x
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 msvcrt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib /out:"Release\out_AAC.dll" /pdbtype:sept
+# SUBTRACT LINK32 /incremental:no /debug
+
+!ELSEIF "$(CFG)" == "out_FAAC - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 1
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "out_FAAC_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "out_FAAC_EXPORTS" /YX /FD /GZ /c
+# SUBTRACT CPP /WX
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+# SUBTRACT RSC /x
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 msvcrt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /nodefaultlib /out:"C:\Program Files\Sound\Gen\Winamp\Plugins\out_AAC.dll" /pdbtype:sept
+# SUBTRACT LINK32 /incremental:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "out_FAAC - Win32 Release"
+# Name "out_FAAC - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Aacinfo.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\Config.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\FAAC.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\Out_faac.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Main.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Out.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\Logo.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Open.bmp
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null
+++ b/winamp/out_FAAC.dsw
@@ -1,0 +1,44 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "libfaac"=..\LIBFAAC\libfaac.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "out_FAAC"=.\out_FAAC.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libfaac
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+