From: <tom...@us...> - 2007-04-27 22:10:06
|
Revision: 8516 http://svn.sourceforge.net/amsn/?rev=8516&view=rev Author: tomhennigan Date: 2007-04-27 15:10:01 -0700 (Fri, 27 Apr 2007) Log Message: ----------- Change the sndplay path, and add the source to the command. Taken from http://www.powerguardian.com/downloads/free/. Modified Paths: -------------- trunk/amsn/config.tcl Added Paths: ----------- trunk/amsn/utils/macosx/sndplay/ trunk/amsn/utils/macosx/sndplay/Makefile trunk/amsn/utils/macosx/sndplay/sndplay trunk/amsn/utils/macosx/sndplay/sndplay.m Modified: trunk/amsn/config.tcl =================================================================== --- trunk/amsn/config.tcl 2007-04-27 22:05:14 UTC (rev 8515) +++ trunk/amsn/config.tcl 2007-04-27 22:10:01 UTC (rev 8516) @@ -68,7 +68,7 @@ #Some Autodetected options if { [OnDarwin] } { - ::config::setKey soundcommand "./utils/macosx/sndplay \$sound";#Soundplayer for Mac OS 10.3-10.4 + ::config::setKey soundcommand "./utils/macosx/sndplay/sndplay \$sound";#Soundplayer for Mac OS 10.3-10.4 ::config::setKey browser "open \$url" ::config::setKey notifyXoffset 100 ::config::setKey notifyYoffset 75 @@ -634,7 +634,7 @@ # Force the change of the default sound command # For Mac OS X users who used aMSN 0.95 at the beggining if {[::config::getKey soundcommand] == "./sndplay" } { - ::config::setKey soundcommand "./utils/macosx/sndplay \$sound" + ::config::setKey soundcommand "./utils/macosx/sndplay/sndplay \$sound" } } } Added: trunk/amsn/utils/macosx/sndplay/Makefile =================================================================== --- trunk/amsn/utils/macosx/sndplay/Makefile (rev 0) +++ trunk/amsn/utils/macosx/sndplay/Makefile 2007-04-27 22:10:01 UTC (rev 8516) @@ -0,0 +1,24 @@ +CC = gcc +CFLAGS = -framework AppKit +CFLAGS_INTEL = -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk +CFLAGS_PPC = -arch ppc -isysroot /Developer/SDKs/MacOSX10.2.8.sdk +RM = rm + +sndplay: sndplay_intel.o sndplay_ppc.o + lipo -create sndplay_intel.o sndplay_ppc.o -output sndplay + +sndplay_intel.o: + $(CC) $(CFLAGS) $(CFLAGS_INTEL) sndplay.m -o sndplay_intel.o + +sndplay_ppc.o: + $(CC) $(CFLAGS) $(CFLAGS_PPC) sndplay.m -o sndplay_ppc.o + +all: sndplay + +clean_objs: + -$(RM) *.o + +clean_release: clean_objs + +clean: clean_objs + -$(RM) sndplay \ No newline at end of file Added: trunk/amsn/utils/macosx/sndplay/sndplay =================================================================== (Binary files differ) Property changes on: trunk/amsn/utils/macosx/sndplay/sndplay ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: trunk/amsn/utils/macosx/sndplay/sndplay.m =================================================================== --- trunk/amsn/utils/macosx/sndplay/sndplay.m (rev 0) +++ trunk/amsn/utils/macosx/sndplay/sndplay.m 2007-04-27 22:10:01 UTC (rev 8516) @@ -0,0 +1,31 @@ +#import <Foundation/Foundation.h> +#import <AppKit/AppKit.h> + +int main (int argc, const char * argv[]) +{ + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + NSSound *sound; + + if( argc != 2 ) { + fprintf(stderr,"Usage: sndplay sound.[snd][aiff][wav]\n "); + return -1; + } + if( strcmp(argv[1],"-?") == 0) { + fprintf(stderr,"Usage: sndplay sound.[snd][aiff][wav]\n "); + return -1; + } + if( strcmp(argv[1],"--help") == 0) { + fprintf(stderr,"Usage: sndplay sound.[snd][aiff][wav]\n "); + return -1; + } + NS_DURING + NSString *thePath = [NSString stringWithCString:argv[1]]; + NSData *data = [NSData dataWithContentsOfFile:thePath]; + sound = [[NSSound alloc] initWithData:data]; + [sound play]; + while ( [sound isPlaying] ); + NS_HANDLER + NS_ENDHANDLER + [pool release]; + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |