~ft/aacdec

6779c81f5180956da1103e29ca0d15d6955c578d — menno 17 years ago 58b5f3d
Removed Winamp3 plugin source
15 files changed, 0 insertions(+), 2154 deletions(-)

D plugins/winamp3/CRegistry.cpp
D plugins/winamp3/CRegistry.h
D plugins/winamp3/Copying
D plugins/winamp3/Defines.h
D plugins/winamp3/FAAD.cpp
D plugins/winamp3/FAAD_config.xml
D plugins/winamp3/Readme.txt
D plugins/winamp3/aacInfoLib.dsp
D plugins/winamp3/aacInfoLib.dsw
D plugins/winamp3/cnv_FAAD.cpp
D plugins/winamp3/cnv_FAAD.dsp
D plugins/winamp3/cnv_FAAD.dsw
D plugins/winamp3/cnv_FAAD.h
D plugins/winamp3/faadwa3.h
D plugins/winamp3/resource.h
D plugins/winamp3/CRegistry.cpp => plugins/winamp3/CRegistry.cpp +0 -349
@@ 1,349 0,0 @@
/*
CRegistry class
Copyright (C) 2003 Antonio Foranna

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation.
	
This program 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 General Public License for more details.
		
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
			
The author can be contacted at:
kreel@tiscali.it
*/

#include "CRegistry.h"
//#include <stdlib.h>

//************************************************************************************************

CRegistry::CRegistry()
{
	regKey=NULL;
	path=NULL;
}
//------------------------------------------------------------------------------------------------

CRegistry::~CRegistry()
{
	if(regKey)
		RegCloseKey(regKey);
	if(path)
		free(path);
}
//************************************************************************************************
/*
void CRegistry::ShowLastError(char *Caption)
{
LPVOID MsgBuf;
	if(FormatMessage( 
		FORMAT_MESSAGE_ALLOCATE_BUFFER | 
		FORMAT_MESSAGE_FROM_SYSTEM | 
		FORMAT_MESSAGE_IGNORE_INSERTS,
		NULL,
		GetLastError(),
		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
		(LPTSTR) &MsgBuf,
		0,
		NULL 
	))
		MessageBox(NULL, (LPCTSTR)MsgBuf, Caption, MB_OK|MB_ICONSTOP);
	if(MsgBuf)
		LocalFree(MsgBuf);
}*/
//************************************************************************************************

#define setPath(SubKey) \
	if(path) \
		free(path); \
	path=strdup(SubKey);

BOOL CRegistry::Open(HKEY hKey, char *SubKey)
{
	if(regKey)
		RegCloseKey(regKey);
	if(RegOpenKeyEx(hKey, SubKey, NULL , KEY_ALL_ACCESS , &regKey)==ERROR_SUCCESS)
	{
		setPath(SubKey);
		return TRUE;
	}
	else // can't open the key -> error
	{
		regKey=0;
		setPath("");
		return FALSE;
	}
}
//************************************************************************************************

BOOL CRegistry::OpenCreate(HKEY hKey, char *SubKey)
{
	if(regKey)
		RegCloseKey(regKey);
	if(RegOpenKeyEx(hKey, SubKey, NULL , KEY_ALL_ACCESS , &regKey)==ERROR_SUCCESS)
	{
		setPath(SubKey);
		return TRUE;
	}
	else // open failed -> create the key
	{
	DWORD disp;
		RegCreateKeyEx(hKey , SubKey, NULL , NULL, REG_OPTION_NON_VOLATILE , KEY_ALL_ACCESS , NULL , &regKey , &disp );
		if(disp==REG_CREATED_NEW_KEY) 
		{
			setPath(SubKey);
			return TRUE;
		}
		else // can't create the key -> error
		{
			regKey=0;
			setPath("");
			return FALSE;
		}
	}
}
//************************************************************************************************

void CRegistry::Close()
{
	if(regKey)
		RegCloseKey(regKey);
	regKey=NULL;
	if(path) 
		delete path; 
	path=NULL;
}
//************************************************************************************************
//************************************************************************************************
//************************************************************************************************

void CRegistry::DeleteVal(char *SubKey)
{
	RegDeleteValue(regKey,SubKey);
}
//************************************************************************************************

void CRegistry::DeleteKey(char *SubKey)
{
	RegDeleteKey(regKey,SubKey);
}

//************************************************************************************************
//************************************************************************************************
//************************************************************************************************

void CRegistry::SetBool(char *keyStr , BOOL val)
{
BOOL tempVal;
DWORD len;
	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)&tempVal , &len )!=ERROR_SUCCESS ||
		tempVal!=val)
		RegSetValueEx(regKey , keyStr , NULL , REG_BINARY , (BYTE *)&val , sizeof(BOOL));
}
//************************************************************************************************

void CRegistry::SetByte(char *keyStr , BYTE val)
{
DWORD	t=val;
DWORD	tempVal;
DWORD	len;
	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)&tempVal , &len )!=ERROR_SUCCESS ||
		tempVal!=val)
		RegSetValueEx(regKey , keyStr , NULL , REG_DWORD , (BYTE *)&t , sizeof(DWORD));
}
//************************************************************************************************

void CRegistry::SetWord(char *keyStr , WORD val)
{
DWORD	t=val;
DWORD	tempVal;
DWORD	len;
	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)&tempVal , &len )!=ERROR_SUCCESS ||
		tempVal!=val)
		RegSetValueEx(regKey , keyStr , NULL , REG_DWORD , (BYTE *)&t , sizeof(DWORD));
}
//************************************************************************************************

void CRegistry::SetDword(char *keyStr , DWORD val)
{
DWORD tempVal;
DWORD len;
	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)&tempVal , &len )!=ERROR_SUCCESS ||
		tempVal!=val)
		RegSetValueEx(regKey , keyStr , NULL , REG_DWORD , (BYTE *)&val , sizeof(DWORD));
}
//************************************************************************************************

void CRegistry::SetFloat(char *keyStr , float val)
{
float tempVal;
DWORD len;
	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)&tempVal , &len )!=ERROR_SUCCESS ||
		tempVal!=val)
		RegSetValueEx(regKey , keyStr , NULL , REG_BINARY , (BYTE *)&val , sizeof(float));
}
//************************************************************************************************

void CRegistry::SetStr(char *keyStr , char *valStr)
{
DWORD len;
DWORD slen=strlen(valStr)+1;

	if(!valStr || !*valStr)
		return;

	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, NULL , &len )!=ERROR_SUCCESS ||
		len!=slen)
		RegSetValueEx(regKey , keyStr , NULL , REG_SZ , (BYTE *)valStr , slen);
	else
	{
	char *tempVal=new char[slen];
		if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)tempVal , &len )!=ERROR_SUCCESS ||
			strcmpi(tempVal,valStr))
			RegSetValueEx(regKey , keyStr , NULL , REG_SZ , (BYTE *)valStr , slen);
		delete tempVal;
	}
}
//************************************************************************************************

void CRegistry::SetValN(char *keyStr , BYTE *addr,  DWORD size)
{
DWORD len;
	if(!addr || !size)
		return;

	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, NULL , &len )!=ERROR_SUCCESS ||
		len!=size)
		RegSetValueEx(regKey , keyStr , NULL , REG_BINARY , addr , size);
	else
	{
	BYTE *tempVal=new BYTE[size];
		if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)tempVal , &len )!=ERROR_SUCCESS ||
			memcmp(tempVal,addr,len))
			RegSetValueEx(regKey , keyStr , NULL , REG_BINARY , addr , size);
		delete tempVal;
	}
}



//************************************************************************************************
//************************************************************************************************
//************************************************************************************************



BOOL CRegistry::GetSetBool(char *keyStr, BOOL val)
{
BOOL tempVal;
DWORD len=sizeof(BOOL);

	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)&tempVal , &len )!=ERROR_SUCCESS)
	{
		RegSetValueEx(regKey , keyStr , NULL , REG_BINARY , (BYTE *)&val , sizeof(BOOL));
		return val;
	}
	return tempVal;
}
//************************************************************************************************

BYTE CRegistry::GetSetByte(char *keyStr, BYTE val)
{
DWORD tempVal;
DWORD len=sizeof(DWORD);

	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)&tempVal , &len )!=ERROR_SUCCESS)
	{
		tempVal=val;
		RegSetValueEx(regKey , keyStr , NULL , REG_DWORD , (BYTE *)&tempVal , sizeof(DWORD));
		return val;
	}
	return (BYTE)tempVal;
}
//************************************************************************************************

WORD CRegistry::GetSetWord(char *keyStr, WORD val)
{
DWORD tempVal;
DWORD len=sizeof(DWORD);

	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)&tempVal , &len )!=ERROR_SUCCESS)
	{
		tempVal=val;
		RegSetValueEx(regKey , keyStr , NULL , REG_DWORD , (BYTE *)&tempVal , sizeof(DWORD));
		return val;
	}
	return (WORD)tempVal;
}
//************************************************************************************************

DWORD CRegistry::GetSetDword(char *keyStr, DWORD val)
{
DWORD tempVal;
DWORD len=sizeof(DWORD);

	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)&tempVal , &len )!=ERROR_SUCCESS)
	{
		RegSetValueEx(regKey , keyStr , NULL , REG_DWORD , (BYTE *)&val , sizeof(DWORD));
		return val;
	}
	return (DWORD)tempVal;
}
//************************************************************************************************

float CRegistry::GetSetFloat(char *keyStr, float val)
{
float tempVal;
DWORD len=sizeof(float);

	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)&tempVal , &len )!=ERROR_SUCCESS)
	{
		RegSetValueEx(regKey , keyStr , NULL , REG_BINARY , (BYTE *)&val , sizeof(float));
		return val;
	}
	return tempVal;
}
//************************************************************************************************

int CRegistry::GetSetStr(char *keyStr, char *tempString, char *dest, int maxLen)
{
DWORD tempLen=maxLen;
	
	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *) dest , &tempLen )!=ERROR_SUCCESS)
	{
		if(!tempString)
		{
			*dest=0;
			return 0;
		}
		strcpy(dest,tempString);
		tempLen=strlen(tempString)+1;
		RegSetValueEx(regKey , keyStr , NULL , REG_SZ , (BYTE *)tempString , tempLen);
	}
	return tempLen;
}
//************************************************************************************************

int CRegistry::GetSetValN(char *keyStr, BYTE *tempAddr, BYTE *addr, DWORD size)
{
DWORD tempLen=size;

	if(RegQueryValueEx(regKey , keyStr , NULL , NULL, (BYTE *)addr , &tempLen )!=ERROR_SUCCESS)
	{
		if(!tempAddr)
		{
			*addr=0;
			return 0;
		}
		memcpy(addr,tempAddr,size);
		RegSetValueEx(regKey , keyStr , NULL , REG_BINARY , (BYTE *)addr , size);
	}
	return tempLen;
}

D plugins/winamp3/CRegistry.h => plugins/winamp3/CRegistry.h +0 -43
@@ 1,43 0,0 @@
//---------------------------------------------------------------------------
#ifndef CRegistryH
#define CRegistryH
//---------------------------------------------------------------------------

#include <windows.h>
#include <stdlib.h>
//#include <string.h>
//#include <memory.h>

class CRegistry 
{
public:
			CRegistry();
			~CRegistry();

	BOOL	Open(HKEY hKey, char *SubKey);
	BOOL	OpenCreate(HKEY hKey, char *SubKey);
	void	Close();
	void	DeleteVal(char *SubKey);
	void	DeleteKey(char *SubKey);

	void	SetBool(char *keyStr , BOOL val);
	void	SetByte(char *keyStr , BYTE val);
	void	SetWord(char *keyStr , WORD val);
	void	SetDword(char *keyStr , DWORD val);
	void	SetFloat(char *keyStr , float val);
	void	SetStr(char *keyStr , char *valStr);
	void	SetValN(char *keyStr , BYTE *addr,  DWORD size);

	BOOL	GetSetBool(char *keyStr, BOOL var);
	BYTE	GetSetByte(char *keyStr, BYTE var);
	WORD	GetSetWord(char *keyStr, WORD var);
	DWORD	GetSetDword(char *keyStr, DWORD var);
	float	GetSetFloat(char *keyStr, float var);
	int		GetSetStr(char *keyStr, char *tempString, char *dest, int maxLen);
	int		GetSetValN(char *keyStr, BYTE *tempAddr, BYTE *addr, DWORD size);

	HKEY	regKey;
	char	*path;
};

#endif
\ No newline at end of file

D plugins/winamp3/Copying => plugins/winamp3/Copying +0 -339
@@ 1,339 0,0 @@
		    GNU GENERAL PUBLIC LICENSE
		       Version 2, June 1991

 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
                          675 Mass Ave, Cambridge, MA 02139, USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

			    Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.)  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

  Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

  The precise terms and conditions for copying, distribution and
modification follow.

		    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term "modification".)  Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

  1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

  2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

    a) You must cause the modified files to carry prominent notices
    stating that you changed the files and the date of any change.

    b) You must cause any work that you distribute or publish, that in
    whole or in part contains or is derived from the Program or any
    part thereof, to be licensed as a whole at no charge to all third
    parties under the terms of this License.

    c) If the modified program normally reads commands interactively
    when run, you must cause it, when started running for such
    interactive use in the most ordinary way, to print or display an
    announcement including an appropriate copyright notice and a
    notice that there is no warranty (or else, saying that you provide
    a warranty) and that users may redistribute the program under
    these conditions, and telling the user how to view a copy of this
    License.  (Exception: if the Program itself is interactive but
    does not normally print such an announcement, your work based on
    the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

  3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

    a) Accompany it with the complete corresponding machine-readable
    source code, which must be distributed under the terms of Sections
    1 and 2 above on a medium customarily used for software interchange; or,

    b) Accompany it with a written offer, valid for at least three
    years, to give any third party, for a charge no more than your
    cost of physically performing source distribution, a complete
    machine-readable copy of the corresponding source code, to be
    distributed under the terms of Sections 1 and 2 above on a medium
    customarily used for software interchange; or,

    c) Accompany it with the information you received as to the offer
    to distribute corresponding source code.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form with such
    an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

  4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

  5. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

  7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.

  9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

  10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

			    NO WARRANTY

  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

		     END OF TERMS AND CONDITIONS

	Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy  <name of author>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program 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 General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

    Gnomovision version 69, Copyright (C) 19yy name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here is a sample; alter the names:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  `Gnomovision' (which makes passes at compilers) written by James Hacker.

  <signature of Ty Coon>, 1 April 1989
  Ty Coon, President of Vice

This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Library General
Public License instead of this License.

D plugins/winamp3/Defines.h => plugins/winamp3/Defines.h +0 -4
@@ 1,4 0,0 @@
#define FILES_SUPPORT "MP4-AAC"
#define APP_NAME "MPEG4-AAC"
#define REGISTRY_PROGRAM_NAME "SOFTWARE\\4N\\Winamp3\\" APP_NAME
#define APP_VER "v1.1"

D plugins/winamp3/FAAD.cpp => plugins/winamp3/FAAD.cpp +0 -502
@@ 1,502 0,0 @@
/*
cnv_FAAD - MP4-AAC decoder plugin for Winamp3
Copyright (C) 2002 Antonio Foranna

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation.
	
This program 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 General Public License for more details.
		
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
			
The author can be contacted at:
kreel@tiscali.it
*/

#include <windows.h>
#include <stdio.h>
#include <process.h>
#include "resource.h"
#include "faadwa3.h"
#include "cnv_FAAD.h"
#include "CRegistry.h"
#include "Defines.h"



// *********************************************************************************************



#define MAX_Channels	2
#define	FAAD_STREAMSIZE	(FAAD_MIN_STREAMSIZE*MAX_Channels)
/*
#define RAW		0
#define ADIF	1
#define ADTS	2
*/
// -----------------------------------------------------------------------------------------------

#define FREE_ARRAY(ptr) \
{ \
	if(ptr) \
		free(ptr); \
	ptr=0; \
}

// *********************************************************************************************

int id3v2_tag(unsigned char *buffer)
{
	if(StringComp((const char *)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;
		return tagsize;
	}
	return 0;
}
// *********************************************************************************************

int GetAACTrack(MP4FileHandle infile)
{
// find AAC track
int i, rc;
int numTracks = MP4GetNumberOfTracks(infile, NULL, 0);

	for (i = 0; i < numTracks; i++)
    {
    MP4TrackId trackId = MP4FindTrackId(infile, i, NULL, 0);
    const char* trackType = MP4GetTrackType(infile, trackId);

        if (!strcmp(trackType, MP4_AUDIO_TRACK_TYPE))
        {
        unsigned char *buff = NULL;
        unsigned __int32 buff_size = 0;
        mp4AudioSpecificConfig mp4ASC;

			MP4GetTrackESConfiguration(infile, trackId, (unsigned __int8 **)&buff, &buff_size);

            if (buff)
            {
                rc = AudioSpecificConfig(buff, buff_size, &mp4ASC);
                free(buff);

                if (rc < 0)
                    return -1;
                return trackId;
            }
        }
    }

    // can't decode this
    return -1;
}
// *********************************************************************************************

AacPcm::AacPcm()
{
	mp4File=0;
	aacFile=0;
    hDecoder=0;
    buffer=0;
	bytes_read=0;
	bps=16;
	newpos_ms=-1;
	seek_table=0;
	seek_table_length=0;
	FindBitrate=FALSE;
	BlockSeeking=false;
}
// -----------------------------------------------------------------------------------------------

AacPcm::~AacPcm()
{
	if(mp4File)
		MP4Close(mp4File);
	if(aacFile)
		fclose(aacFile);
	if(hDecoder)
		faacDecClose(hDecoder);
	FREE_ARRAY(buffer);
	FREE_ARRAY(seek_table);
}

// *********************************************************************************************

#define STRING_MONO		"%i kbit/s %i khz %i bps Mono"
#define STRING_STEREO	"%i kbit/s %i khz %i bps Stereo"

#define SHOW_INFO() \
{ \
	infos->setInfo(StringPrintf(Channels==1 ? STRING_MONO : STRING_STEREO, \
								(int)file_info.bitrate/1000, (int)Samplerate/1000, (int)bps)); \
	infos->setTitle(Std::filename(infos->getFilename())); \
	infos->setLength(len_ms); \
}

// -----------------------------------------------------------------------------------------------

#define ERROR_getInfos(str) \
{ \
	bytes_into_buffer=-1; \
	if(str) \
		infos->warning(str); \
	return 1; \
}
// -----------------------------------------------------------------------------------------------

int AacPcm::getInfos(MediaInfo *infos)
{
	if(!infos)
		return 1;

	if(hDecoder)
	{
		SHOW_INFO()
	    return 0;
	}

	IsAAC=strcmpi(infos->getFilename()+lstrlen(infos->getFilename())-4,".aac")==0;

	if(!IsAAC) // MP4 file ---------------------------------------------------------------------
	{
	MP4Duration			length;
	unsigned __int32	buffer_size;
    mp4AudioSpecificConfig mp4ASC;

		if(!(mp4File=MP4Read(infos->getFilename(), 0)))
			ERROR_getInfos("Error opening file");

		if((track=GetAACTrack(mp4File))<0)
			ERROR_getInfos(0); //"Unable to find correct AAC sound track");

		if(!(hDecoder=faacDecOpen()))
			ERROR_getInfos("Error initializing decoder library");

		MP4GetTrackESConfiguration(mp4File, track, (unsigned __int8 **)&buffer, &buffer_size);
		if(!buffer)
			ERROR_getInfos("MP4GetTrackESConfiguration");
		AudioSpecificConfig(buffer, buffer_size, &mp4ASC);
        Channels=mp4ASC.channelsConfiguration;

		if(faacDecInit2(hDecoder, buffer, buffer_size, &Samplerate, &Channels) < 0)
			ERROR_getInfos("Error initializing decoder library");
		FREE_ARRAY(buffer);

		length=MP4GetTrackDuration(mp4File, track);
		len_ms=(DWORD)MP4ConvertFromTrackDuration(mp4File, track, length, MP4_MSECS_TIME_SCALE);
		file_info.bitrate=MP4GetTrackBitRate(mp4File, track);
		file_info.version=MP4GetTrackAudioType(mp4File, track)==MP4_MPEG4_AUDIO_TYPE ? 4 : 2;
		numSamples=MP4GetTrackNumberOfSamples(mp4File, track);
		sampleId=1;
	}
	else // AAC file ------------------------------------------------------------------------------
	{   
	DWORD			read,
					tmp;
	BYTE			Channels4Raw=0;

		if(!(aacFile=fopen(infos->getFilename(),"rb")))
			ERROR_getInfos("Error opening file"); 

		// use bufferized stream
		setvbuf(aacFile,NULL,_IOFBF,32767);

		// get size of file
		fseek(aacFile, 0, SEEK_END);
		src_size=ftell(aacFile);
		fseek(aacFile, 0, SEEK_SET);

		if(!(buffer=(BYTE *)malloc(FAAD_STREAMSIZE)))
			ERROR_getInfos("Memory allocation error: buffer")

		tmp=src_size<FAAD_STREAMSIZE ? src_size : FAAD_STREAMSIZE;
		read=fread(buffer, 1, tmp, aacFile);
		if(read==tmp)
		{
			bytes_read=read;
			bytes_into_buffer=read;
		}
		else
			ERROR_getInfos("Read failed!")

		if(tagsize=id3v2_tag(buffer))
		{
			if(tagsize>(long)src_size)
				ERROR_getInfos("Corrupt stream!");
			if(tagsize<bytes_into_buffer)
			{
				bytes_into_buffer-=tagsize;
				memcpy(buffer,buffer+tagsize,bytes_into_buffer);
			}
			else
			{
				bytes_read=tagsize;
				bytes_into_buffer=0;
				if(tagsize>bytes_into_buffer)
					fseek(aacFile, tagsize, SEEK_SET);
			}
			if(src_size<bytes_read+FAAD_STREAMSIZE-bytes_into_buffer)
				tmp=src_size-bytes_read;
			else
				tmp=FAAD_STREAMSIZE-bytes_into_buffer;
			read=fread(buffer+bytes_into_buffer, 1, tmp, aacFile);
			if(read==tmp)
			{
				bytes_read+=read;
				bytes_into_buffer+=read;
			}
			else
				ERROR_getInfos("Read failed!");
		}

		if(get_AAC_format((char *)infos->getFilename(), &file_info, &seek_table, &seek_table_length, 0))
			ERROR_getInfos("get_AAC_format");
		IsSeekable=file_info.headertype==ADTS && seek_table && seek_table_length>0;
		BlockSeeking=!IsSeekable;

		if(!(hDecoder=faacDecOpen()))
			ERROR_getInfos("Can't open library");

		if(file_info.headertype==RAW)
		{
		faacDecConfiguration	config;

			config.defSampleRate=atoi(cfg_samplerate);
			switch(cfg_profile[1])
			{
			case 'a':
				config.defObjectType=MAIN;
				break;
			case 'o':
				config.defObjectType=LOW;
				break;
			case 'S':
				config.defObjectType=SSR;
				break;
			case 'T':
				config.defObjectType=LTP;
				break;
			}
			switch(cfg_bps[0])
			{
			case '1':
				config.outputFormat=FAAD_FMT_16BIT;
				break;
			case '2':
				config.outputFormat=FAAD_FMT_24BIT;
				break;
			case '3':
				config.outputFormat=FAAD_FMT_32BIT;
				break;
			case 'F':
				config.outputFormat=FAAD_FMT_24BIT;
				break;
			}
			faacDecSetConfiguration(hDecoder, &config);

			if(!FindBitrate)
			{
			AacPcm *NewInst;
				if(!(NewInst=new AacPcm()))
					ERROR_getInfos("Memory allocation error: NewInst");

				NewInst->FindBitrate=TRUE;
				if(NewInst->getInfos(infos))
					ERROR_getInfos(0);
				Channels4Raw=NewInst->frameInfo.channels;
				file_info.bitrate=NewInst->file_info.bitrate*Channels4Raw;
				delete NewInst;
			}
			else
			{
			DWORD	Samples,
					BytesConsumed;

				if((bytes_consumed=faacDecInit(hDecoder,buffer,bytes_into_buffer,&Samplerate,&Channels))<0)
					ERROR_getInfos("Can't init library");
				bytes_into_buffer-=bytes_consumed;
				if(!processData(infos,0,0))
					ERROR_getInfos(0);
				Samples=frameInfo.samples/sizeof(short);
				BytesConsumed=frameInfo.bytesconsumed;
				processData(infos,0,0);
				if(BytesConsumed<frameInfo.bytesconsumed)
					BytesConsumed=frameInfo.bytesconsumed;
				file_info.bitrate=(BytesConsumed*8*Samplerate)/Samples;
				if(!file_info.bitrate)
					file_info.bitrate=1000; // try to continue decoding
				return 0;
			}
		}

		if((bytes_consumed=faacDecInit(hDecoder, buffer, bytes_into_buffer, &Samplerate, &Channels))<0)
			ERROR_getInfos("faacDecInit failed!")
		bytes_into_buffer-=bytes_consumed;

		if(Channels4Raw)
			Channels=Channels4Raw;

		len_ms=(DWORD)((1000*((float)src_size*8))/file_info.bitrate);
	}

	SHOW_INFO();
    return 0;
}
// *********************************************************************************************

#define ERROR_processData(str) \
{ \
	bytes_into_buffer=-1; \
	if(str) \
		infos->warning(str); \
	if(chunk_list) \
		chunk_list->setChunk("PCM", bufout, 0, ci); \
	return 0; \
}
// -----------------------------------------------------------------------------------------------

int AacPcm::processData(MediaInfo *infos, ChunkList *chunk_list, bool *killswitch)
{
DWORD			BytesDecoded=0;
char			*bufout=0;
ChunkInfosI		*ci=0;
svc_fileReader	*reader=0;

	if(!FindBitrate && !chunk_list)
		ERROR_processData("chunk_list==NULL"); // is this case possible?

	if(!(reader=infos->getReader()))
		ERROR_processData("File doesn\'t exists");

	if(chunk_list)
	{
		if(!(ci=new ChunkInfosI()))
			ERROR_processData("Memory allocation error: ci");

		ci->addInfo("srate", Samplerate);
		ci->addInfo("bps", bps);
		ci->addInfo("nch", Channels);
	}

	if(!IsAAC) // MP4 file --------------------------------------------------------------------------
	{   
	unsigned __int32 buffer_size=0;
    int rc;

		if(newpos_ms>-1)
		{
		MP4Duration duration=MP4ConvertToTrackDuration(mp4File,track,newpos_ms,MP4_MSECS_TIME_SCALE);
            sampleId=MP4GetSampleIdFromTime(mp4File,track,duration,0);
			bytes_read=(DWORD)(((float)newpos_ms*file_info.bitrate)/(8*1000));
			reader->seek(bytes_read);  // updates slider
			newpos_ms=-1;
		}
		do
		{
			buffer=NULL;
			if(sampleId>=numSamples)
				ERROR_processData(0);

			rc=MP4ReadSample(mp4File, track, sampleId++, (unsigned __int8 **)&buffer, &buffer_size, NULL, NULL, NULL, NULL);
			if(rc==0 || buffer==NULL)
			{
				FREE_ARRAY(buffer);
				ERROR_processData("MP4ReadSample")
			}

			bufout=(char *)faacDecDecode(hDecoder,&frameInfo,buffer,buffer_size);
			BytesDecoded=frameInfo.samples*sizeof(short);
			FREE_ARRAY(buffer);
			// to update the slider
			bytes_read+=buffer_size;
			reader->seek(bytes_read);
		}while(!BytesDecoded && !frameInfo.error);
	}
	else // AAC file --------------------------------------------------------------------------
	{   
	DWORD	read,
			tmp;

		if(BlockSeeking)
		{
			infos->setLength(-1);
			BlockSeeking=false;
		}
		if(newpos_ms>-1)
		{
			if(IsSeekable)
			{
			DWORD normalized=len_ms/(seek_table_length-1);
				if(normalized<1000)
					normalized=1000;
				bytes_read=seek_table[newpos_ms/normalized];
				fseek(aacFile, bytes_read, SEEK_SET);
				reader->seek(bytes_read); // updates slider
				bytes_into_buffer=0;
				bytes_consumed=FAAD_STREAMSIZE;
			}
			newpos_ms=-1;
		}
		do
		{
			if(bytes_consumed>0 && bytes_into_buffer>=0)
			{
				if(bytes_into_buffer)
					memcpy(buffer,buffer+bytes_consumed,bytes_into_buffer);

				if(bytes_read<src_size)
				{
					if(bytes_read+bytes_consumed<src_size)
						tmp=bytes_consumed;
					else
						tmp=src_size-bytes_read;
					read=fread(buffer+bytes_into_buffer, 1, tmp, aacFile);
					if(read==tmp)
					{
						bytes_read+=read;
						bytes_into_buffer+=read;
					}
					else
						infos->status("Read failed!"); // continue until bytes_into_buffer<1
				}
				else
					if(bytes_into_buffer)
						memset(buffer+bytes_into_buffer, 0, bytes_consumed);

				bytes_consumed=0;
			}

			if(bytes_into_buffer<1)
				if(bytes_read<src_size)
					ERROR_processData("Buffer empty!")
				else
					ERROR_processData(0);

			bufout=(char *)faacDecDecode(hDecoder,&frameInfo,buffer,bytes_into_buffer);
			BytesDecoded=frameInfo.samples*sizeof(short);
			bytes_consumed+=frameInfo.bytesconsumed;
			bytes_into_buffer-=bytes_consumed;
			// to update the slider
			reader->seek(bytes_read-bytes_into_buffer+bytes_consumed); // updates slider
		}while(!BytesDecoded && !frameInfo.error);
	} // END AAC file --------------------------------------------------------------------------

	if(frameInfo.error)
		ERROR_processData((char *)faacDecGetErrorMessage(frameInfo.error));

	if(chunk_list)
		chunk_list->setChunk("PCM", bufout, BytesDecoded, ci);
    return 1;
}

D plugins/winamp3/FAAD_config.xml => plugins/winamp3/FAAD_config.xml +0 -34
@@ 1,34 0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<WinampAbstractionLayer version="0.7">
   <groupdef id="FAAD.Config.Content">
	<Wasabi:Text id="static" text="Profile" x="0" y="0" w="80" h="15" />
	<Wasabi:Dropdownlist id="profile" feed="PROFILE" x="70" y="0" w="-80" relatw="1" h="20" cfgattrib="{3AF667AD-3CF8-459e-8C7C-BD8CD1D6F8C2};Profile" />
	<Wasabi:Text id="static" text="Samplerate" x="0" y="28" w="80" h="15" />
	<Wasabi:Combobox id="samplerate" feed="SAMPLERATE" x="70" y="28" w="-80" relatw="1" h="20" cfgattrib="{3AF667AD-3CF8-459e-8C7C-BD8CD1D6F8C2};Samplerate" />
	<Wasabi:Text id="static" text="Bps" x="0" y="56" w="80" h="15" />
	<Wasabi:Dropdownlist id="bps" feed="BPS" x="70" y="56" w="-80" relatw="1" h="20" cfgattrib="{3AF667AD-3CF8-459e-8C7C-BD8CD1D6F8C2};Bps" />
   </groupdef>

   <groupdef id="FAAD.About.Content">
	<Wasabi:Text id="About.Title" text="MP4-AAC decoder by Antonio Foranna" x="0" y="0" w="0" h="16" relatw="1" />
	<Wasabi:Text id="About.Copyright" text="Parts based on FAAD2 and MPEG4IP" x="0" y="20" w="0" h="16" relatw="1" />
	<Wasabi:Text id="About.URL" text="FAAD home: http://www.audiocoding.com" x="0" y="40" w="0" h="16" relatw="1" />
	<Wasabi:Text id="About.URL2" text="MPEG4IP home: http://www.mpeg4ip.net" x="0" y="60" w="0" h="16" relatw="1" />
	<Wasabi:Text id="About.Email" text="You can contact me at: kreel@tiscali.it" x="0" y="80" w="0" h="16" relatw="1" />
   </groupdef>

   <groupdef id="FAAD.About">
	
   </groupdef>
  
   <groupdef id="FAAD.Options">
	<Wasabi:TitleBox x="0" y="0" w="0" h="0" relatw="1" relath="1" title="MP4-AAC decoder" content="FAAD.Options.Content" />
   </groupdef>

   <groupdef id="FAAD.Options.Content">
	<Wasabi:TitleBox x="0" y="0" w="0" h="100" relatw="1" relath="0" title="Options" content="FAAD.Config.Content" />
	<Wasabi:TitleBox x="0" y="108" w="0" h="120" relatw="1" relath="0" title="About" content="FAAD.About.Content" />
   </groupdef>

</WinampAbstractionLayer>

D plugins/winamp3/Readme.txt => plugins/winamp3/Readme.txt +0 -32
@@ 1,32 0,0 @@
+-----------------------------------------------------------------+
|                                                                 |
|                          cnv_FAAD Readme                        |
|                          ---------------                        |
|                                                                 |
+-----------------------------------------------------------------+

This code is given with FAAD package and does not contain executables.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.

----------------------------------------------------------------------------

cnv_FAAD is a decoder plugin for Winamp3;
it supports .aac/.mp4 files.

To use it:
----------
1) Copy "Wasabi SDK\Studio" folder into the folder where my sources are placed and rename it "SDK";

2) Build it;

3) Copy cnv_FAAD.wac into "Winamp3\Wacs" folder;

4) Copy FAAD_config.xml into "Winamp3\Wacs\xml\FAAD" folder.

----------------------------------------------------------------------------

For suggestions, bugs report, etc., you can contact me at
kreel@tiscali.it

D plugins/winamp3/aacInfoLib.dsp => plugins/winamp3/aacInfoLib.dsp +0 -110
@@ 1,110 0,0 @@
# Microsoft Developer Studio Project File - Name="aacInfoLib" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Static Library" 0x0104

CFG=aacInfoLib - 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 "aacInfoLib.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 "aacInfoLib.mak" CFG="aacInfoLib - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "aacInfoLib - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "aacInfoLib - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE 

# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=xicl6.exe
RSC=rc.exe

!IF  "$(CFG)" == "aacInfoLib - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "aacInfoLib___Win32_Release"
# PROP BASE Intermediate_Dir "aacInfoLib___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../faad2/common/faad" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x410 /d "NDEBUG"
# ADD RSC /l 0x410 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo

!ELSEIF  "$(CFG)" == "aacInfoLib - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "aacInfoLib___Win32_Debug"
# PROP BASE Intermediate_Dir "aacInfoLib___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../faad2/common/faad" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x410 /d "_DEBUG"
# ADD RSC /l 0x410 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo

!ENDIF 

# Begin Target

# Name "aacInfoLib - Win32 Release"
# Name "aacInfoLib - Win32 Debug"
# Begin Group "Source Files"

# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File

SOURCE=..\..\common\faad\aacinfo.c
# End Source File
# Begin Source File

SOURCE=..\..\common\faad\filestream.c
# End Source File
# End Group
# Begin Group "Header Files"

# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File

SOURCE=..\..\common\faad\aacinfo.h
# End Source File
# Begin Source File

SOURCE=..\..\common\faad\filestream.h
# End Source File
# End Group
# End Target
# End Project

D plugins/winamp3/aacInfoLib.dsw => plugins/winamp3/aacInfoLib.dsw +0 -29
@@ 1,29 0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!

###############################################################################

Project: "aacInfoLib"=.\aacInfoLib.dsp - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Global:

Package=<5>
{{{
}}}

Package=<3>
{{{
}}}

###############################################################################


D plugins/winamp3/cnv_FAAD.cpp => plugins/winamp3/cnv_FAAD.cpp +0 -200
@@ 1,200 0,0 @@
/*
cnv_FAAD - MP4-AAC decoder plugin for Winamp3
Copyright (C) 2002 Antonio Foranna

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation.
	
This program 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 General Public License for more details.
		
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
			
The author can be contacted at:
kreel@tiscali.it
*/

#include <stdlib.h>
#include "cnv_FAAD.h"
#include "faadwa3.h"
#include "CRegistry.h"
#include "Defines.h"

// *********************************************************************************************

void ReadCfgDec(faacDecConfiguration *cfg) 
{ 
CRegistry reg;

	if(reg.OpenCreate(HKEY_CURRENT_USER,REGISTRY_PROGRAM_NAME  "\\FAAD"))
	{
		cfg->defObjectType=reg.GetSetByte("Profile",LOW);
		cfg->defSampleRate=reg.GetSetDword("SampleRate",44100);
		cfg->outputFormat=reg.GetSetByte("Bps",FAAD_FMT_16BIT);
	}
	else
		MessageBox(0,"Can't open registry!",0,MB_OK|MB_ICONSTOP);
}
// -----------------------------------------------------------------------------------------------

void WriteCfgDec(faacDecConfiguration *cfg)
{ 
CRegistry reg;

	if(reg.OpenCreate(HKEY_CURRENT_USER,REGISTRY_PROGRAM_NAME  "\\FAAD"))
	{
		reg.SetByte("Profile",cfg->defObjectType); 
		reg.SetDword("SampleRate",cfg->defSampleRate); 
		reg.SetByte("Bps",cfg->outputFormat);
	}
	else
		MessageBox(0,"Can't open registry!",0,MB_OK|MB_ICONSTOP);
}

// *********************************************************************************************



static WACNAME wac;
WAComponentClient *the = &wac;

#include <studio/services/servicei.h>
static waServiceT<svc_mediaConverter, AacPcm> aacpcm;

// {3AF667AD-3CF8-459e-8C7C-BD8CD1D6F8C2}
static const GUID guid = 
{ 0x3af667ad, 0x3cf8, 0x459e, { 0x8c, 0x7c, 0xbd, 0x8c, 0xd1, 0xd6, 0xf8, 0xc2 } };

#include <attribs/attrstr.h>
#define FEEDID_PROFILE "PROFILE"
_string cfg_profile("Profile", "Low Complexity");
#define FEEDID_SAMPLERATE "SAMPLERATE"
_string cfg_samplerate("Samplerate", "44100");
#define FEEDID_BPS "BPS"
_string cfg_bps("Bps", "16");



// *********************************************************************************************

#include <studio/services/svc_textfeed.h>

class TextFeed : public svc_textFeedI
{
 public:
  TextFeed()
  {
    registerFeed(FEEDID_PROFILE);
    registerFeed(FEEDID_SAMPLERATE);
    registerFeed(FEEDID_BPS);
  }
  static const char *getServiceName() { return "FAAD TextFeed Service"; }
};

static waServiceTSingle<svc_textFeed, TextFeed> svc_feed;




// *********************************************************************************************



WACNAME::WACNAME() : WAComponentClient(FILES_SUPPORT " files support")
{
#ifdef FORTIFY
    FortifySetName("cnv_FAAD.wac");
    FortifyEnterScope();
#endif
}

WACNAME::~WACNAME()
{
#ifdef FORTIFY
    FortifyLeaveScope();
#endif
}

GUID WACNAME::getGUID()
{
    return guid;
}

void WACNAME::onRegisterServices()
{
    api->service_register(&aacpcm);
    api->core_registerExtension("*.aac;*.mp4", FILES_SUPPORT " Files");

    api->service_register(&svc_feed);
//	following line is long and causes a crash
//	svc_feed.getSingleService()->sendFeed(FEEDID_SAMPLERATE,"6000;8000;11025;16000;22050;32000;44100;48000;64000;88200;96000;192000");
	svc_feed.getSingleService()->sendFeed(FEEDID_PROFILE,"Main;Low Complexity;SSR;LTP");
	svc_feed.getSingleService()->sendFeed(FEEDID_SAMPLERATE,"8000;11025;16000;22050;32000;44100;48000;96000");
	svc_feed.getSingleService()->sendFeed(FEEDID_BPS,"16;24;32;FLOAT");
}

void WACNAME::onDestroy()
{
    api->service_deregister(&aacpcm);
    api->service_deregister(&svc_feed);

    WAComponentClient::onDestroy();

faacDecConfiguration	Cfg;
	Cfg.defObjectType=atoi(cfg_profile);
	Cfg.defSampleRate=atoi(cfg_samplerate);
	Cfg.outputFormat=atoi(cfg_bps);
	WriteCfgDec(&Cfg);
}

void WACNAME::onCreate()
{
static const GUID cfg_audio_guid = // {EDAA0599-3E43-4eb5-A65D-C0A0484240E7}
{ 0xedaa0599, 0x3e43, 0x4eb5, { 0xa6, 0x5d, 0xc0, 0xa0, 0x48, 0x42, 0x40, 0xe7 } };
// following line adds this module to the list of Audio modules
	api->preferences_registerGroup("FAAD.Options", FILES_SUPPORT " decoder", getGUID(), cfg_audio_guid);
	registerSkinFile("Wacs/xml/FAAD/FAAD_config.xml");

faacDecConfiguration	Cfg;
char					buf[50];
	ReadCfgDec(&Cfg);
	cfg_samplerate=itoa(Cfg.defSampleRate,buf,10);
	switch(Cfg.defObjectType)
	{
	case MAIN:
		cfg_profile="Main";
		break;
	case LOW:
		cfg_profile="Low Complexity";
		break;
	case SSR:
		cfg_profile="SSR";
		break;
	case LTP:
		cfg_profile="LTP";
		break;
	}
	switch(Cfg.outputFormat)
	{
	case FAAD_FMT_16BIT:
		cfg_bps="16";
		break;
	case FAAD_FMT_24BIT:
		cfg_bps="24";
		break;
	case FAAD_FMT_32BIT:
		cfg_bps="32";
		break;
	case FAAD_FMT_FLOAT:
		cfg_bps="FLOAT";
		break;
	}
	registerAttribute(&cfg_profile);
	registerAttribute(&cfg_samplerate);
	registerAttribute(&cfg_bps);
}

D plugins/winamp3/cnv_FAAD.dsp => plugins/winamp3/cnv_FAAD.dsp +0 -216
@@ 1,216 0,0 @@
# Microsoft Developer Studio Project File - Name="cnv_FAAD" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102

CFG=cnv_FAAD - 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 "cnv_FAAD.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 "cnv_FAAD.mak" CFG="cnv_FAAD - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "cnv_FAAD - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "cnv_FAAD - 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)" == "cnv_FAAD - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "cnv_FAAD___Win32_Release"
# PROP BASE Intermediate_Dir "cnv_FAAD___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CNV_FAAD_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../common/faad" /I "../../common/mp4v2" /I "../../include" /I "SDK" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CNV_FAAD_EXPORTS" /D "WIN32_LEAN_AND_MEAN" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x410 /d "NDEBUG"
# ADD RSC /l 0x410 /d "NDEBUG"
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 /machine:I386
# ADD LINK32 ws2_32.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 /incremental:yes /machine:I386 /out:"Release/cnv_FAAD.wac"

!ELSEIF  "$(CFG)" == "cnv_FAAD - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "cnv_FAAD___Win32_Debug"
# PROP BASE Intermediate_Dir "cnv_FAAD___Win32_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 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CNV_FAAD_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../faad2/common/faad" /I "../../../faad2/common/mp4v2" /I "../../common/faad" /I "../../include" /I "../../common/mp4v2" /I "SDK" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CNV_FAAD_EXPORTS" /D "WIN32_LEAN_AND_MEAN" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x410 /d "_DEBUG"
# ADD RSC /l 0x410 /d "_DEBUG"
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 ws2_32.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 /out:"C:\Programmi\Winamp3\Wacs\cnv_FAAD.wac" /pdbtype:sept
# SUBTRACT LINK32 /force

!ENDIF 

# Begin Target

# Name "cnv_FAAD - Win32 Release"
# Name "cnv_FAAD - Win32 Debug"
# Begin Group "Source Files"

# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Group "wa3sdk"

# PROP Default_Filter ""
# Begin Source File

SOURCE=.\SDK\studio\assert.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\attribs\attribute.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\attribs\attrstr.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\attribs\cfgitemi.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\studio\corecb.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\bfc\depend.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\bfc\encodedstr.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\bfc\foreach.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\bfc\memblock.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\common\nsGUID.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\bfc\util\pathparse.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\bfc\ptrlist.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\studio\services\servicei.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\bfc\std.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\bfc\string.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\bfc\svc_enum.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\studio\services\svc_mediaconverter.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\studio\services\svc_textfeed.cpp
# End Source File
# Begin Source File

SOURCE=.\SDK\studio\waclient.cpp
# End Source File
# End Group
# Begin Source File

SOURCE=.\cnv_FAAD.cpp
# End Source File
# Begin Source File

SOURCE=.\CRegistry.cpp
# End Source File
# Begin Source File

SOURCE=.\FAAD.cpp
# End Source File
# End Group
# Begin Group "Header Files"

# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File

SOURCE=.\cnv_FAAD.h
# End Source File
# Begin Source File

SOURCE=.\CRegistry.h
# End Source File
# Begin Source File

SOURCE=.\Defines.h
# End Source File
# Begin Source File

SOURCE=.\faadwa3.h
# End Source File
# Begin Source File

SOURCE=.\resource.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"
# End Group
# End Target
# End Project

D plugins/winamp3/cnv_FAAD.dsw => plugins/winamp3/cnv_FAAD.dsw +0 -74
@@ 1,74 0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!

###############################################################################

Project: "aacInfoLib"=".\aacInfoLib.dsp" - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Project: "cnv_FAAD"=".\cnv_FAAD.dsp" - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
    Begin Project Dependency
    Project_Dep_Name aacInfoLib
    End Project Dependency
    Begin Project Dependency
    Project_Dep_Name libfaad
    End Project Dependency
    Begin Project Dependency
    Project_Dep_Name libmp4v2_st
    End Project Dependency
}}}

###############################################################################

Project: "libfaad"="..\..\libfaad\libfaad.dsp" - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Project: "libmp4v2_st"="..\..\common\mp4v2\libmp4v2_st60.dsp" - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Global:

Package=<5>
{{{
}}}

Package=<3>
{{{
}}}

###############################################################################


D plugins/winamp3/cnv_FAAD.h => plugins/winamp3/cnv_FAAD.h +0 -59
@@ 1,59 0,0 @@
/*
cnv_FAAD - MP4-AAC decoder plugin for Winamp3
Copyright (C) 2002 Antonio Foranna

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation.
	
This program 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 General Public License for more details.
		
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
			
The author can be contacted at:
kreel@tiscali.it
*/

#ifndef _CNV_FAAD_H
#define _CNV_FAAD_H

#include <studio/wac.h>
#include <common/rootcomp.h>
#include <attribs/cfgitemi.h>
#include <attribs/attrint.h>
#include "Defines.h"

#define WACNAME WACcnv_FAAD



#include <attribs/attrstr.h>
extern _string cfg_samplerate;
extern _string cfg_profile;
extern _string cfg_bps;


class WACNAME : public WAComponentClient
{
public:
    WACNAME();
    virtual ~WACNAME();

    virtual const char *getName() { return FILES_SUPPORT " to PCM converter"; };
    virtual GUID getGUID();

	virtual void onRegisterServices();
    virtual void onDestroy();
	virtual void onCreate();
    
    virtual int getDisplayComponent() { return FALSE; };

    virtual CfgItem *getCfgInterface(int n) { return this; }
};

#endif

D plugins/winamp3/faadwa3.h => plugins/winamp3/faadwa3.h +0 -118
@@ 1,118 0,0 @@
/*
cnv_FAAD - MP4-AAC decoder plugin for Winamp3
Copyright (C) 2002 Antonio Foranna

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

The author can be contacted at:
kreel@tiscali.it
*/

#ifndef _AACPCM_H
#define _AACPCM_H

#include <studio/services/svc_mediaconverter.h>
#include <studio/services/servicei.h>
#include <studio/corecb.h>
#include <studio/wac.h>
#include <attribs/cfgitemi.h>
#include <attribs/attrint.h>

#include <mp4.h>
#include "..\..\..\faac\include\faac.h"
#include <faad.h>
extern "C" {
#include <aacinfo.h>    // get_AAC_format()
}
#include "Defines.h"



// -----------------------------------------------------------------------------------------------



class AacPcm : public svc_mediaConverterI
{
public:
    AacPcm();
    virtual ~AacPcm();

    // service
    static const char *getServiceName() { return FILES_SUPPORT " to PCM converter"; }

    virtual int canConvertFrom(svc_fileReader *reader, const char *name, const char *chunktype) {
        if(name && (!STRICMP(Std::extension(name),"aac")|| !STRICMP(Std::extension(name),"mp4"))) return 1; // only accepts *.aac and *.mp4 files
        return 0;
    }
    virtual const char *getConverterTo() { return "PCM"; }

    virtual int getInfos(MediaInfo *infos);

    virtual int processData(MediaInfo *infos, ChunkList *chunk_list, bool *killswitch);

    virtual int getLatency(void) { return 0; }

    // callbacks

    virtual int corecb_onSeeked(int newpos)
    {
/*      if(!IsSeekable)
        {
            newpos_ms=-1;
            return 0;
        }*/
        newpos_ms=newpos;
        return 0;
    }

// Raw AAC
    BOOL            FindBitrate;

private:

//MP4
    MP4FileHandle   mp4File;
    MP4SampleId     sampleId,
                    numSamples;
    int             track;
    BYTE            type;

// AAC
    FILE            *aacFile;
    DWORD           Samplerate;
    BYTE            Channels;
    DWORD           bps;
    DWORD           src_size; // aac filesize
    BYTE            *buffer;
    long            tagsize;
    DWORD           *seek_table;
    int             seek_table_length;
    bool            BlockSeeking;

// GLOBAL
    faacDecHandle   hDecoder;
    faadAACInfo     file_info;
    faacDecFrameInfo    frameInfo;
    DWORD           len_ms;         // length of file in milliseconds
    DWORD           bytes_read;     // from file
    DWORD           bytes_consumed; // by faadDecDecode
    long            bytes_into_buffer;
//  DWORD           dst_size;
    long            newpos_ms;
    BOOL            IsSeekable;
    bool            IsAAC;
};
#endif


D plugins/winamp3/resource.h => plugins/winamp3/resource.h +0 -45
@@ 1,45 0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by FAAD.rc
//
#define IDD_ENCODER                     101
#define IDD_DECODER                     102
#define IDD_ABOUT                       103
#define IDB_AUDIOCODING                 104
#define IDB_EMAIL                       106
#define IDB_MPEG4IP                     107
#define IDC_RADIO_MPEG4                 1000
#define IDC_RADIO_MPEG2                 1001
#define IDC_RADIO_LOW                   1002
#define IDC_RADIO_MAIN                  1003
#define IDC_RADIO_SSR                   1004
#define IDC_RADIO_LTP                   1005
#define IDC_RADIO_RAW                   1006
#define IDC_RADIO_ADTS                  1007
#define IDC_CB_BANDWIDTH                1008
#define IDC_CB_SAMPLERATE               1008
#define IDC_CB_BITRATE                  1009
#define IDC_CHK_ALLOWMIDSIDE            1010
#define IDC_CHK_USETNS                  1011
#define IDC_CHK_USELFE                  1012
#define IDC_CHK_AUTOCFG                 1013
#define IDC_BTN_ABOUT                   1014
#define IDC_L_ABOUT                     1015
#define IDC_AUDIOCODING                 1016
#define IDC_EMAIL                       1017
#define IDC_MPEG4IP                     1018
#define IDC_RADIO_16                    1019
#define IDC_RADIO_24                    1020
#define IDC_RADIO_32                    1021
#define IDC_RADIO_FLOAT                 1022

// 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         1023
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif