/* $Id$
 * 
 * This file is a part of Amp2p.  Amp2p is Copyright 2004 Joseph
 * Curtis.  jocurtis@gmail.com
 *
 *
 *  Amp2p 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.
 *
 *  Amp2p 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 Amp2p; if not, write to the Free Software Foundation,
 *  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

/* Contains all of the Winamp/Windows specific code. */

#include <windows.h>
#include <process.h>
//#include <conio.h>

#include "winamp_include/gen.h"
#include "resource.h"

#include "amp2p.h"
#include "winamp-amp2p.h"
#include "hashtable.h"


BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
{
	return TRUE;
}


void amp2p_config()
{
	ui();
}

void amp2p_cleanup()
{

}


int amp2p_init()
{

	return 0;
}


BOOL CALLBACK search_callback(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {

	switch(uMsg) {
	case WM_INITDIALOG:	
	break;
	case WM_COMMAND:

		switch (LOWORD(wParam)) {
		case ID_CLOSE:
			EndDialog(hwndDlg,0);
		break;
		case ID_DOWNLOAD:
		break;
		case ID_SEARCH:
			winamp_search(0);
		break;
		}


	break;
	default:
	break;
	}


	return 0;
}


void winamp_search(char * query) {
	//cprintf("SEARCHING!\n");
	return;
}

void ui() {
	
	DialogBox(plugin.hDllInstance,MAKEINTRESOURCE(SEARCH_DIALOG),plugin.hwndParent,search_callback);
}


__declspec( dllexport ) winampGeneralPurposePlugin * winampGetGeneralPurposePlugin()
{
	return &plugin;
}


