#include	<libraries/gadtools.h>

#include	<proto/intuition.h>

#include	"TV.h"
#include	"cs_sup.h"

struct EasyStruct es = {
	sizeof(struct EasyStruct), 0, "TV-Video Module",
	"Created for the Computer'97 show Cologne\nby Alexander Kneer and Tobias Abt ©1997",
	"Ok"
};

int ShowAbout(void)
{
	EasyRequestArgs(wd, &es, NULL, NULL);
	return(1);
}

int Quit(void)
{
	return(0);
}

int UseTV(void)
{
	ActivateTuner();
	return(1);
}

int UseFBAS(void)
{
	ActivateFBAS();
	return(1);
}

int UsePABLO(void)
{
	ActivatePABLO();
	return(1);
}

int UseSVHS(void)
{
	ActivateSVHS();
	return(1);
}

int OneToOne(void)
{
	ChangeWindowBox(wd, wd->LeftEdge, wd->TopEdge, VideoWidth+wd->BorderLeft+wd->BorderRight, VideoHeight+wd->BorderTop+wd->BorderBottom);
	return(1);
}

int TwoToTwo(void)
{
	ChangeWindowBox(wd, wd->LeftEdge, wd->TopEdge, VideoWidth*2+wd->BorderLeft+wd->BorderRight, VideoHeight*2+wd->BorderTop+wd->BorderBottom);
	return(1);
}

int HalveToHalve(void)
{
	ChangeWindowBox(wd, wd->LeftEdge, wd->TopEdge, VideoWidth/2+wd->BorderLeft+wd->BorderRight, VideoHeight/2+wd->BorderTop+wd->BorderBottom);
	return(1);
}

int QuarterToQuarter(void)
{
	ChangeWindowBox(wd, wd->LeftEdge, wd->TopEdge, VideoWidth/4+wd->BorderLeft+wd->BorderRight, VideoHeight/4+wd->BorderTop+wd->BorderBottom);
	return(1);
}


struct NewMenu newMenu[] = {
	NM_TITLE,	(STRPTR)"Project",			NULL,				0,	NULL,	NULL,
	NM_ITEM,		(STRPTR)"Read Channels",	(STRPTR)"R",	0,	0L,	(APTR)ReadSettings,
	NM_ITEM,		(STRPTR)"Write Channels",	(STRPTR)"W",	0,	0L,	(APTR)WriteSettings,
	
//	NM_ITEM,		(STRPTR)"About",				(STRPTR)"?",	0, 0L,   (APTR)ShowAbout,
//	NM_ITEM,		(STRPTR)NM_BARLABEL,			NULL,				0,	0L,	NULL,
	NM_ITEM,		(STRPTR)"Quit",				(STRPTR)"Q",	0,	0L,	(APTR)Quit,

	NM_TITLE,	(STRPTR)"VideoSource",		NULL,				0,	NULL,	NULL,
	NM_ITEM,		(STRPTR)"TV",					(STRPTR)"T",	0,	0L,	(APTR)UseTV,
	NM_ITEM,		(STRPTR)"AUX/FBAS",			(STRPTR)"F",	0,	0L,	(APTR)UseFBAS,
	NM_ITEM,		(STRPTR)"AUX/S-VHS",			(STRPTR)"S",	0,	0L,	(APTR)UseSVHS,
	NM_ITEM,		(STRPTR)"PABLO/FBAS2",		(STRPTR)"P",	0,	0L,	(APTR)UsePABLO,

	NM_TITLE,	(STRPTR)"Picture",			NULL,				0,	NULL,	NULL,
	NM_ITEM,		(STRPTR)"0.25:0.25",			(STRPTR)"0",	0,	0L,	(APTR)QuarterToQuarter,
	NM_ITEM,		(STRPTR)"0.5:0.5",			(STRPTR)"1",	0,	0L,	(APTR)HalveToHalve,
	NM_ITEM,		(STRPTR)"1:1",					(STRPTR)"2",	0,	0L,	(APTR)OneToOne,
	NM_ITEM,		(STRPTR)"2:2",					(STRPTR)"3",	0,	0L,	(APTR)TwoToTwo,

	NM_TITLE,	(STRPTR)"Tuner",				NULL,				0,	NULL,	NULL,
	NM_ITEM,		(STRPTR)"Setup",				(STRPTR)"U",	0,	0L,	(APTR)Setup,
	NM_ITEM,		(STRPTR)"Channel up",		(STRPTR)".",	0,	0L,	(APTR)NextChannel,
	NM_ITEM,		(STRPTR)"Channel down",		(STRPTR)",",	0,	0L,	(APTR)PrevChannel,
	NM_END,		NULL, NULL, 0, 0L, NULL
};
