//
//  main.m
//  SIDPLAY
//
//  Created by Andreas Varga on 15.11.07.
//  Copyright __MyCompanyName__ 2007. All rights reserved.
//

#import <Cocoa/Cocoa.h>
//#import <Carbon/Carbon.h>


SInt32 gSysvGestaltValue;


int main(int argc, char *argv[])
{
	// check for minimum required OS version
	Gestalt('sysv', &gSysvGestaltValue);

#if 0
	if (gSysvGestaltValue < 0x1050)
	{
		/*
		NSAlert* alert = [NSAlert alertWithMessageText:@"SIDPLAY requires Mac OS X 10.5 or later!"
										 defaultButton:@"OK"
									   alternateButton:nil
										   otherButton:nil
							 informativeTextWithFormat:@"Please consider upgrading your version of Mac OS X, to be able to run SIDPLAY"];

		[alert runModal];
		*/
	
		short		itemHit;
		AlertStdAlertParamRec alertparams;

		alertparams.movable 		= TRUE;
		alertparams.helpButton 		= FALSE;
		alertparams.filterProc  	= NULL;
		alertparams.defaultText 	= 0;
		alertparams.cancelText 		= 0;
		alertparams.otherText 		= 0;
		alertparams.defaultButton	= kAlertStdAlertOKButton;
		alertparams.cancelButton	= 0;
		alertparams.position		= kWindowDefaultPosition;

		StandardAlert(kAlertStopAlert, "\pSIDPLAY requires Mac OS X 10.5 or later!", "\pPlease consider upgrading your version of Mac OS X, to be able to run SIDPLAY", &alertparams, &itemHit);
		return 0;
	}
#endif

    time_t seed;
    time(&seed);
    srandom(seed);

    return NSApplicationMain(argc,  (const char **) argv);
}
