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

/*
 *      main.c -- REALmagic NS2000TV setting GUI test
 *
 *      Copyright (C) 2000 Sigma Designs
 *            written by Pascal Cannenterre <pascal_cannenterre@sdesigns.com>
 *
 *      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.
 */

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

#include "define.h"

#include "ns2ktvgui.h"
#include "ns2ktvgui_cb.h"

GtkWidget *window;

DWORD setOutputMode(DWORD newvgatv)
{
  DWORD vgatv;
  vgatv = FMPGet(FMPI_VIDEOOUT);
  vgatv = vgatv  & (~FMPV_VIDEOOUT_MODE_MASK);
  vgatv = vgatv | newvgatv;
  return FMPSet(FMPI_VIDEOOUT, vgatv);
}

int main (int argc, char *argv[])
{  	
        DWORD dwreturn = FMPE_OK;

        FMPConnectToMSGQUEUE();
	dwreturn = FMPOpen(FMPF_SYSTEM,32*1024,8,NULL,0);
	waitForAnalogOverlayAccess();
	/* in case the EM8400 output is on TV ...  */
	gtk_init (&argc, &argv);
	
	window = get_ns2ktv_setting_panel();

	gtk_widget_show(window);
	gtk_main ();
	
	if(dwreturn == FMPE_OK)
	  {
	    FMPClose();
	    MPEGDriverUnload();
	  }
       
	return 0;
}
