NSSound implementation

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14216 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2002-07-30 21:19:05 +00:00
parent 81632bcf5b
commit aec00d4297
15 changed files with 2571 additions and 6 deletions

View file

@ -47,6 +47,7 @@
#include <AppKit/NSMenu.h>
#include <AppKit/NSControl.h>
#include <AppKit/NSImage.h>
#include <AppKit/NSSound.h>
#include <AppKit/NSView.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSNibConnector.h>
@ -417,6 +418,31 @@ Class gmodel_class(void)
return nil;
}
- (NSString *)pathForSoundResource:(NSString *)name
{
NSString *ext = [name pathExtension];
NSString *path = nil;
if ((ext == nil) || [ext isEqualToString:@""])
{
NSArray *types = [NSSound soundUnfilteredFileTypes];
unsigned c = [types count];
unsigned i;
for (i = 0; path == nil && i < c; i++)
{
ext = [types objectAtIndex: i];
path = [self pathForResource: name ofType: ext];
}
}
else
{
name = [name stringByDeletingPathExtension];
path = [self pathForResource: name ofType: ext];
}
return path;
}
- (BOOL) loadNibFile: (NSString*)fileName
externalNameTable: (NSDictionary*)context
withZone: (NSZone*)zone