home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 114 / macaddict114.cdr / Software / Utilities / macam.0.8.4.dmg / macam sources / app_specific / MyController.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-06-03  |  5.1 KB  |  134 lines

  1. /*
  2.     MyController.h - Controller for camera window
  3.  
  4.     Copyright (C) 2002 Matthias Krauss (macam@matthias-krauss.de)
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; either version 2 of the License, or
  9.     (at your option) any later version.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  19.  $Id: MyController.h,v 1.6 2005/06/03 04:49:10 hxr Exp $
  20. */
  21.  
  22. #import <Cocoa/Cocoa.h>
  23. #include "GlobalDefs.h"
  24. #import "MyCameraCentral.h"
  25. #import "MyCameraDriver.h"
  26.  
  27. @class MyCameraInspector,MyMovieRecorder;
  28.  
  29.  
  30. @interface MyController : NSObject
  31. {
  32.     IBOutlet NSWindow* window;
  33.     IBOutlet NSSlider* brightnessSlider;
  34.     IBOutlet NSSlider* contrastSlider;
  35.     IBOutlet NSSlider* gammaSlider;
  36.     IBOutlet NSSlider* sharpnessSlider;
  37.     IBOutlet NSSlider* saturationSlider;
  38.     IBOutlet NSButton* manGainCheckbox;
  39.     IBOutlet NSSlider* gainSlider;
  40.     IBOutlet NSSlider* shutterSlider;
  41.     IBOutlet NSSlider* compressionSlider;
  42.     IBOutlet NSButton* horizontalFlipCheckbox;
  43.     IBOutlet NSImageView* previewView;
  44.     IBOutlet NSTextField* statusText;
  45.     IBOutlet NSPopUpButton* whiteBalancePopup;
  46.     IBOutlet NSPopUpButton* colorModePopup;
  47.     IBOutlet NSPopUpButton* sizePopup;
  48.     IBOutlet NSPopUpButton* fpsPopup;
  49.     IBOutlet MyCameraCentral* central;
  50.     IBOutlet NSWindow* disclaimerWindow;
  51.     IBOutlet NSDrawer* settingsDrawer;
  52.     IBOutlet NSDrawer* inspectorDrawer;
  53.     IBOutlet id blackwhiteCheckbox;
  54.     IBOutlet id ledCheckbox;
  55.     
  56.     MyCameraInspector* inspector;
  57.     MyCameraDriver* driver;
  58.     NSBitmapImageRep* imageRep;
  59.     NSImage* image;
  60.  
  61.     BOOL imageGrabbed;            //If there ever has been a grabbed image
  62.     BOOL cameraGrabbing;        //If camera is currently grabbing
  63.     long cameraMediaCount;        //The (cached) number of images (etc.) stored on the camera
  64.     BOOL terminating;            //For deferred shutting down (shutdown the driver properly)
  65.  
  66.     //Attributes for movie recording
  67.     MyMovieRecorder* movieRecorder;    //The movie recorder object if we're recording
  68.     double movieRecordStart;        //The start time of the recorded movie
  69.     double movieLastCapturedImage;    //The time the last image was captured
  70.     double movieMinCaptureInterval;    //The minimum interval between captured images
  71.     double movieRecordingTimeFactor;    //The time scaling factor for recording the movie
  72. }
  73. - (void) dealloc;
  74. - (void) awakeFromNib;            //Initiates the disclaimer or startup
  75. - (void) startup;            //starts up the main window
  76.  
  77. //Disclaimer handling
  78. - (void) disclaimerOK:(id)sender;    
  79. - (void) disclaimerQuit:(id)sender;
  80.  
  81. //UI: Handlers for control value changes
  82. - (IBAction)brightnessChanged:(id)sender;
  83. - (IBAction)contrastChanged:(id)sender;
  84. - (IBAction)gammaChanged:(id)sender;
  85. - (IBAction)sharpnessChanged:(id)sender;
  86. - (IBAction)saturationChanged:(id)sender;
  87. - (IBAction)manGainChanged:(id)sender;
  88. - (IBAction)gainChanged:(id)sender;
  89. - (IBAction)shutterChanged:(id)sender;
  90. - (IBAction)formatChanged:(id)sender;        //Handles both size and fps popups
  91. - (IBAction)compressionChanged:(id)sender;
  92. - (IBAction)whiteBalanceChanged:(id)sender;
  93. - (IBAction)horizontalFlipChanged:(id)sender;
  94. - (IBAction)blackwhiteCheckboxChanged:(id)sender;
  95. - (IBAction)ledCheckboxChanged:(id)sender;
  96.  
  97. //UI: Actions to do
  98. - (IBAction)doGrab:(id)sender;
  99. - (IBAction)doNextCam:(id)sender;
  100. - (IBAction)doDownloadMedia:(id)sender;
  101. - (IBAction)doSaveImage:(id)sender;
  102. - (IBAction)doDeleteAll:(id)sender;
  103. - (IBAction)doDeleteOne:(id)sender;
  104. - (IBAction)doDeleteLast:(id)sender;
  105. - (IBAction)doTakeStillImage:(id)sender;
  106. - (IBAction)doSavePrefs:(id)sender;
  107. - (IBAction)toggleSettingsDrawer:(id)sender;
  108. - (IBAction)doQuit:(id)sender;
  109.  
  110. //Sheet ended handlers
  111. - (void)askDownloadMediaSheetEnded:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void  *)con;
  112. - (void)downloadSaveSheetEnded:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void  *)con;
  113.  
  114. //delegate calls from camera central
  115. - (void)cameraDetected:(unsigned long)uid;
  116.  
  117. //delegate calls from camera driver
  118. - (void)imageReady:(id)cam;
  119. - (void)grabFinished:(id)cam withError:(CameraError)err;
  120. - (void)cameraHasShutDown:(id)cam;
  121. - (void) cameraEventHappened:(id)sender event:(CameraEvent)evt;
  122. //menu item validation
  123. - (BOOL) validateMenuItem:(NSMenuItem *)item;
  124. //Toolbar stuff
  125. - (void) setupToolbar;
  126. - (NSToolbarItem*) toolbar:(NSToolbar*)toolbar itemForItemIdentifier:(NSString*)itemIdent willBeInsertedIntoToolbar:(BOOL)wbi;
  127. - (NSArray*) toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar;
  128. - (NSArray*) toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar;
  129. - (BOOL) validateToolbarItem:(NSToolbarItem*)toolbarItem;
  130. //Delegates from the application
  131. - (BOOL) applicationOpenUntitledFile:(NSApplication*)theApplication;
  132.  
  133. @end
  134.