Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Including QuickTime.h

Including QuickTime.h
Thread Tools
Fresh-Faced Recruit
Join Date: Dec 2001
Location: Wisconsin
Status: Offline
Reply With Quote
Oct 20, 2002, 01:27 PM
 
I have been including the quicktime framework in one of my programs. Since installing QuickTime 6.0.2, whenever I compile after cleaning the program, I receive warnings in every class I have. These are the warnings:
/System/Library/Frameworks/QuickTime.framework/Headers/QuickTime.h:20: warning: could not use precompiled header '/System/Library/Frameworks/Carbon.framework/Headers/Carbon-gcc3.p', because:

/System/Library/Frameworks/QuickTime.framework/Headers/QuickTime.h:20: warning: 'CarbonSound/CarbonSound.h' has different date than in precomp

Everything works fine when it runs but having errors everytime is annoying. Also, I am including QuickTime just for this function:
void playSound(void)
{
NSString * soundPath;
NSMovie * movie;
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
float volume = [defaults floatForKey:SoundLevelKey];
soundPath = [[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Contents/Resources/Alert.aiff"] stringByExpandingTildeInPath];
movie = [[NSMovie alloc] initWithURL:[NSURL fileURLWithPath:soundPath] byReference:YES];
if(movie != nil) {
SetMovieVolume([movie QTMovie], volume);
StartMovie([movie QTMovie]);
while (!IsMovieDone([movie QTMovie])) continue;
}
[movie release];
}

This plays a simple beep and allows to set the volume. Perhaps there is a better way to do this because the volume isn't consistent. The is the application is here. Disregard the terrible graphics and such...Thanks for any help.
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Oct 20, 2002, 03:22 PM
 
Installing QuickTime 6.0.2 invalidates the precompiled headers. Run sudo fixPrecomps and you won't get those warnings anymore (your compile times will be faster, too).


Also, an unrelated tip... you might do well to replace this line:
Code:
soundPath = [[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Contents/Resources/Alert.aiff"] stringByExpandingTildeInPath];
with this:
Code:
soundPath = [[NSBundle mainBundle] pathForResource:@"Alert" ofType:@"aiff"]
It's shorter, guaranteed to give you an absolute path, and will still work if Apple changes the bundle layout.

Kind of silly there's no -setVolume: on NSSound, eh?
Rick Roe
icons.cx | weblog
     
seppak  (op)
Fresh-Faced Recruit
Join Date: Dec 2001
Location: Wisconsin
Status: Offline
Reply With Quote
Oct 21, 2002, 03:35 PM
 
Thanks, that fixed all the warnings. It would be a lot easier if NSSound let you set the volume...
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:14 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2