#import "MyApp.h"
#import <appkit/NXLiveVideoView.h>
#import <appkit/Control.h>
#import <appkit/Button.h>
#import <appkit/Matrix.h>
#import <appkit/Panel.h>

@implementation MyApp

- appDidInit:sender
{
  NXRect winRect;
  int type;
  NXSize vidSize;
  
  [nretWindow getFrame:&winRect];
  [nretWindow setBackgroundGray:NX_WHITE];
  [window setBecomeKeyOnlyIfNeeded:YES];
// Get the screen size.
  if(![NXLiveVideoView doesWindowSupportVideo:bufWindow 
                   standard:&type size:&vidSize])
  {
    NXRunAlertPanel("No Video Present","This machine is not capable of running video applications. Since this program is exclusively for Video, It will now exit","OK",NULL,NULL);
    [self terminate:self];
  }
  [bufWindow sizeWindow:vidSize.width :vidSize.height];
  [bufWindow makeKeyWindow];
  [nretWindow sizeWindow:vidSize.width :vidSize.height];
  [videoView grab];
  buffed=YES;
  mode = NX_FROMINPUT;
  return self;
}


- setInput:sender
{
  int types[] = {NX_VIDEOIN1,NX_VIDEOIN2,NX_VIDEOIN3};
  
  [videoView selectInput:types[[[sender selectedCell] tag]]];
  return self;
}

- setBrightness:sender
{
  [videoView setInputBrightness:[sender floatValue]];
  return self;
}

- setGamma:sender
{
  [videoView setInputGamma:[sender floatValue]];
  return self;
}

- setOutGamma:sender
{
  [videoView setOutputGamma:[sender floatValue]];
  return self;
}

- setHue:sender
{
  [videoView setInputHue:[sender floatValue]];
  return self;
}

- setSaturation:sender
{
  [videoView setInputSaturation:[sender floatValue]];
  return self;
}

- setSharpness:sender
{
  [videoView setInputSharpness:[sender floatValue]];
  return self;
}



@end
