[Scopeapp-cvs]scopeapp/src ScopeAppGlobals.h,NONE,1.1 QuicktimeSampler.m,1.3,1.4
Status: Alpha
Brought to you by:
narge
From: <sco...@li...> - 2002-07-19 07:55:22
|
Update of /cvsroot/scopeapp/scopeapp/src In directory usw-pr-cvs1:/tmp/cvs-serv5537/src Modified Files: QuicktimeSampler.m Added Files: ScopeAppGlobals.h Log Message: Use new macro (borrowed from GNUMail) to mark localizable strings in source code --- NEW FILE: ScopeAppGlobals.h --- /* * ScopeAppGlobals.h * MacCRO X * * Created by Philip Derrin on Fri Jul 19 2002. * Copyright (c) 2002 Philip Derrin. All rights reserved. * */ // Macro to use on strings which can be localised // Based on similar macro from GNUMail // Strings labelled this way are easy to find using // a perl script, to auto-generate Localizable.strings #define _(key) [[NSBundle mainBundle] localizedStringForKey:(key) value:key table:nil] Index: QuicktimeSampler.m =================================================================== RCS file: /cvsroot/scopeapp/scopeapp/src/QuicktimeSampler.m,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** QuicktimeSampler.m 25 Jun 2002 01:41:30 -0000 1.3 --- QuicktimeSampler.m 19 Jul 2002 07:55:18 -0000 1.4 *************** *** 25,28 **** --- 25,30 ---- // + #import "ScopeAppGlobals.h" + #import "QuicktimeSampler.h" *************** *** 282,294 **** { OSErr err; - NSString* errorString; - NSBundle* thisBundle = [NSBundle bundleForClass:[self class]]; mySGComp = OpenDefaultComponent(SeqGrabComponentType, 0); if(mySGComp == NULL) { ! errorString = [thisBundle localizedStringForKey:@"QTNotFound" ! value: nil table: nil]; ! NSRunCriticalAlertPanel(@"Error", errorString, nil, nil, nil); return nil; } --- 284,292 ---- { OSErr err; mySGComp = OpenDefaultComponent(SeqGrabComponentType, 0); if(mySGComp == NULL) { ! NSRunCriticalAlertPanel(_(@"Error"), _(@"Another application may be using QuickTime Capture, or it may not be installed."), nil, nil, nil); return nil; } *************** *** 297,303 **** if(err) { ! errorString = [thisBundle localizedStringForKey:@"QTUnknown" ! value: nil table: nil]; ! NSRunCriticalAlertPanel(@"Error", errorString, nil, nil, nil); return nil; } --- 295,299 ---- if(err) { ! NSRunCriticalAlertPanel(_(@"Error"), _(@"An unknown error occurred while initialising QuickTime Capture."), nil, nil, nil); return nil; } *************** *** 306,313 **** if(err) { fprintf(stderr, "SGNewChannel returned %d\n", err); ! errorString = [thisBundle localizedStringForKey:@"QTBusy" ! value: nil table: nil]; ! NSRunCriticalAlertPanel(@"Error", errorString, nil, nil, nil); return false; } --- 302,309 ---- if(err) { + #ifdef DEBUG_CODE fprintf(stderr, "SGNewChannel returned %d\n", err); ! #endif ! NSRunCriticalAlertPanel(_(@"Error"), _(@"Another application may be recording sound, or this computer may not have sound input hardware."), nil, nil, nil); return false; } *************** *** 320,325 **** long theRefNum; OSErr err; - NSString* errorString; - NSBundle* thisBundle = [NSBundle bundleForClass:[self class]]; char* theSampleRates; int i; unsigned long highestRate = 0; --- 316,319 ---- *************** *** 366,372 **** if(err) { ! errorString = [thisBundle localizedStringForKey:@"QTPetulant" ! value: nil table: nil]; ! NSRunCriticalAlertPanel(@"Error", errorString, nil, nil, nil); return nil; } --- 360,364 ---- if(err) { ! NSRunCriticalAlertPanel(_(@"Error"), _(@"Could not record sound, because the channel usage could not be set."), nil, nil, nil); return nil; } *************** *** 374,380 **** err = SGSetSoundRecordChunkSize(mySGCh, -6554); if(err) { ! errorString = [thisBundle localizedStringForKey:@"QTInitErr" ! value: nil table: nil]; ! NSRunCriticalAlertPanel(@"Error", errorString, nil, nil, nil); return nil; } --- 366,370 ---- err = SGSetSoundRecordChunkSize(mySGCh, -6554); if(err) { ! NSRunCriticalAlertPanel(_(@"Error"), _(@"An unknown error occurred while initialising Quicktime Capture."), nil, nil, nil); return nil; } *************** *** 382,388 **** err = SGStartRecord(mySGComp); if(err) { ! errorString = [thisBundle localizedStringForKey:@"QTRecErr" ! value: nil table: nil]; ! NSRunCriticalAlertPanel(@"Error", errorString, nil, nil, nil); return nil; } --- 372,376 ---- err = SGStartRecord(mySGComp); if(err) { ! NSRunCriticalAlertPanel(_(@"Error"), _(@"An unknown error occurred while trying to record sound."), nil, nil, nil); return nil; } |