Update of /cvsroot/artoolkit/artoolkit/lib/SRC/VideoMacOSX
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6203
Modified Files:
videoInternal.h video.c ARVideoSettingsController.h
ARVideoSettingsController.m
Log Message:
Provide -standarddialog option.
Index: ARVideoSettingsController.h
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/lib/SRC/VideoMacOSX/ARVideoSettingsController.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ARVideoSettingsController.h 22 May 2006 22:18:25 -0000 1.2
--- ARVideoSettingsController.h 18 Jun 2006 22:52:27 -0000 1.3
***************
*** 40,44 ****
- (id)initInput:(int)inInputIndex withSeqGrabComponent:(SeqGrabComponent)inSeqGrab withSGChannel:(SGChannel)inSgchanVideo;
- (void)dealloc;
! - (IBAction)sgConfigurationDialog:(id)sender;
- (OSErr)loadUserData:(UserData *)outUserData fromDefaults:(NSUserDefaults *)inDefaults forKey:(NSString *)inKey;
- (OSErr)saveUserData:(UserData)inUserData toDefaults:(NSUserDefaults *)inDefaults withKey:(NSString *)outKey;
--- 40,44 ----
- (id)initInput:(int)inInputIndex withSeqGrabComponent:(SeqGrabComponent)inSeqGrab withSGChannel:(SGChannel)inSgchanVideo;
- (void)dealloc;
! - (IBAction)sgConfigurationDialog:(id)sender withStandardDialog:(int)standardDialog;
- (OSErr)loadUserData:(UserData *)outUserData fromDefaults:(NSUserDefaults *)inDefaults forKey:(NSString *)inKey;
- (OSErr)saveUserData:(UserData)inUserData toDefaults:(NSUserDefaults *)inDefaults withKey:(NSString *)outKey;
Index: video.c
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/lib/SRC/VideoMacOSX/video.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** video.c 8 Jun 2006 22:05:08 -0000 1.18
--- video.c 18 Jun 2006 22:52:27 -0000 1.19
***************
*** 348,357 ****
}
! static ComponentResult vdgRequestSettings(VdigGrab* pVdg, const int showDialog, const int inputIndex)
{
ComponentResult err;
// Use the SG Dialog to allow the user to select device and compression settings
! if (err = RequestSGSettings(inputIndex, pVdg->seqGrab, pVdg->sgchanVideo, showDialog)) {
fprintf(stderr, "RequestSGSettings err=%ld\n", err);
goto endFunc;
--- 348,357 ----
}
! static ComponentResult vdgRequestSettings(VdigGrab* pVdg, const int showDialog, const int standardDialog, const int inputIndex)
{
ComponentResult err;
// Use the SG Dialog to allow the user to select device and compression settings
! if (err = RequestSGSettings(inputIndex, pVdg->seqGrab, pVdg->sgchanVideo, showDialog, standardDialog)) {
fprintf(stderr, "RequestSGSettings err=%ld\n", err);
goto endFunc;
***************
*** 1201,1204 ****
--- 1201,1205 ----
int showFPS = 0;
int showDialog = 1;
+ int standardDialog = 0;
OSErr err_s = noErr;
ComponentResult err = noErr;
***************
*** 1243,1246 ****
--- 1244,1249 ----
} else if (strncmp(a, "-nodialog", 9) == 0) {
showDialog = 0;
+ } else if (strncmp(a, "-standarddialog", 15) == 0) {
+ standardDialog = 1;
} else {
err_i = 1;
***************
*** 1376,1380 ****
}
! if (err = vdgRequestSettings(vid->pVdg, showDialog, gVidCount)) {
fprintf(stderr, "ar2VideoOpen(): vdgRequestSettings err=%ld.\n", err);
goto out2;
--- 1379,1383 ----
}
! if (err = vdgRequestSettings(vid->pVdg, showDialog, standardDialog, gVidCount)) {
fprintf(stderr, "ar2VideoOpen(): vdgRequestSettings err=%ld.\n", err);
goto out2;
Index: ARVideoSettingsController.m
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/lib/SRC/VideoMacOSX/ARVideoSettingsController.m,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ARVideoSettingsController.m 22 May 2006 22:18:25 -0000 1.5
--- ARVideoSettingsController.m 18 Jun 2006 22:52:27 -0000 1.6
***************
*** 78,116 ****
// NOTE: There is a know bug in QuickTime 6.4 in which the
// Settings Dialog pops up in random locations...sigh...
! - (IBAction) sgConfigurationDialog:(id)sender
{
- ComponentResult err;
- Component *PanelListPtr = NULL;
- long PanelCount;
-
// Set up the settings panel list removing the "Compression" panel.
! ComponentDescription cDesc;
! Component c;
! long cCount;
! Component *cPtr;
!
! cDesc.componentType = SeqGrabPanelType;
! cDesc.componentSubType = VideoMediaType;
! cDesc.componentManufacturer = cDesc.componentFlags = cDesc.componentFlagsMask = 0L;
! cCount = CountComponents(&cDesc);
! if (cCount == 0) {
! fprintf(stderr, "-sgConfigurationDialog: error in CountComponents().\n");
! goto bail;
! }
! PanelListPtr = (Component *)NewPtr(sizeof(Component) * (cCount + 1));
! if (err = MemError() || NULL == PanelListPtr) {
! fprintf(stderr, "-sgConfigurationDialog: error in NewPtr().\n");
! goto bail;
! }
!
! PanelCount = 0;
! cPtr = PanelListPtr;
! c = 0L;
! do {
! ComponentDescription compInfo;
! c = FindNextComponent(c, &cDesc);
! if (c) {
! Handle hName = NewHandle(0);
if (err = MemError() || NULL == hName) {
fprintf(stderr, "-sgConfigurationDialog: error in NewHandle().\n");
--- 78,112 ----
// NOTE: There is a know bug in QuickTime 6.4 in which the
// Settings Dialog pops up in random locations...sigh...
! - (IBAction) sgConfigurationDialog:(id)sender withStandardDialog:(int)standardDialog
{
// Set up the settings panel list removing the "Compression" panel.
! ComponentResult err;
! if (standardDialog) {
! err = SGSettingsDialog(seqGrab, sgchanVideo, 0, 0, seqGrabSettingsPreviewOnly, NULL, 0L);
! } else {
! ComponentDescription cDesc;
! long cCount;
! ComponentDescription cDesc2;
!
! cDesc.componentType = SeqGrabPanelType;
! cDesc.componentSubType = VideoMediaType;
! cDesc.componentManufacturer = cDesc.componentFlags = cDesc.componentFlagsMask = 0L;
! cCount = CountComponents(&cDesc);
! if (cCount == 0) {
! fprintf(stderr, "-sgConfigurationDialog: error in CountComponents().\n");
! goto bail;
! }
!
! Component *PanelListPtr = (Component *)NewPtr(sizeof(Component) * (cCount + 1));
! if (err = MemError() || NULL == PanelListPtr) {
! fprintf(stderr, "-sgConfigurationDialog: error in NewPtr().\n");
! goto bail;
! }
! Component *cPtr = PanelListPtr;
! long PanelCount = 0L;
! Component c = NULL;
! while ((c = FindNextComponent(c, &cDesc)) != NULL) {
! Handle hName = NewHandleClear(0);
if (err = MemError() || NULL == hName) {
fprintf(stderr, "-sgConfigurationDialog: error in NewHandle().\n");
***************
*** 118,133 ****
}
! GetComponentInfo(c, &compInfo, hName, NULL, NULL);
if (PLstrcmp(*(unsigned char **)hName, "\pCompression") != 0) {
! *cPtr++ = c;
PanelCount++;
}
DisposeHandle(hName);
}
! } while (c);
!
! // Bring up the dialog and if the user didn't cancel
! // save the new channel settings for later.
! err = SGSettingsDialog(seqGrab, sgchanVideo, PanelCount, PanelListPtr, 0, NULL, 0L);
if (err == noErr) {
// Dispose the old settings and get the new channel settings.
--- 114,133 ----
}
! GetComponentInfo(c, &cDesc2, hName, NULL, NULL);
if (PLstrcmp(*(unsigned char **)hName, "\pCompression") != 0) {
! *cPtr = c;
! cPtr++;
PanelCount++;
}
DisposeHandle(hName);
}
!
! // Bring up the dialog and if the user didn't cancel
! // save the new channel settings for later.
! err = SGSettingsDialog(seqGrab, sgchanVideo, PanelCount, PanelListPtr, seqGrabSettingsPreviewOnly, NULL, 0L);
! bail:
! DisposePtr((Ptr)PanelListPtr);
! }
!
if (err == noErr) {
// Dispose the old settings and get the new channel settings.
***************
*** 147,153 ****
fprintf(stderr, "-sgConfigurationDialog: error %ld in SGSettingsDialog().\n", err);
}
-
- bail:
- DisposePtr((Ptr)PanelListPtr);
}
--- 147,150 ----
***************
*** 212,216 ****
@end
! OSStatus RequestSGSettings(const int inputIndex, SeqGrabComponent seqGrab, SGChannel sgchanVideo, const int showDialog)
{
NSAutoreleasePool *localPool;
--- 209,213 ----
@end
! OSStatus RequestSGSettings(const int inputIndex, SeqGrabComponent seqGrab, SGChannel sgchanVideo, const int showDialog, const int standardDialog)
{
NSAutoreleasePool *localPool;
***************
*** 224,228 ****
localController = [[ARVideoSettingsController alloc] initInput:inputIndex withSeqGrabComponent:seqGrab withSGChannel:sgchanVideo];
! if (showDialog) [localController sgConfigurationDialog:NULL];
[localController release];
--- 221,225 ----
localController = [[ARVideoSettingsController alloc] initInput:inputIndex withSeqGrabComponent:seqGrab withSGChannel:sgchanVideo];
! if (showDialog) [localController sgConfigurationDialog:NULL withStandardDialog:standardDialog];
[localController release];
Index: videoInternal.h
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/lib/SRC/VideoMacOSX/videoInternal.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** videoInternal.h 22 May 2006 22:18:25 -0000 1.2
--- videoInternal.h 18 Jun 2006 22:52:27 -0000 1.3
***************
*** 36,40 ****
#endif
! OSStatus RequestSGSettings(const int inputIndex, SeqGrabComponent seqGrab, SGChannel sgchanVideo, const int showDialog);
#ifdef __cplusplus
--- 36,40 ----
#endif
! OSStatus RequestSGSettings(const int inputIndex, SeqGrabComponent seqGrab, SGChannel sgchanVideo, const int showDialog, const int standardDialog);
#ifdef __cplusplus
|