Remove unused class OOALConcreteSound

master
Jens Ayton 2013-11-05 14:49:00 +01:00
parent 4a3dff18c3
commit 1547fa5ea8
3 changed files with 0 additions and 180 deletions

View File

@ -724,7 +724,6 @@
1A9FCF2615DAC9BC00E965D5 /* GameController+FullScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A9FCF2515DAC9BC00E965D5 /* GameController+FullScreen.m */; };
1AA085FE182578AF007CCAEB /* OOALBufferedSound.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA085EE182578AF007CCAEB /* OOALBufferedSound.h */; };
1AA085FF182578AF007CCAEB /* OOALBufferedSound.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AA085EF182578AF007CCAEB /* OOALBufferedSound.m */; };
1AA08600182578AF007CCAEB /* OOALConcreteSound.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA085F0182578AF007CCAEB /* OOALConcreteSound.h */; };
1AA08602182578AF007CCAEB /* OOALMusic.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA085F2182578AF007CCAEB /* OOALMusic.h */; };
1AA08603182578AF007CCAEB /* OOALMusic.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AA085F3182578AF007CCAEB /* OOALMusic.m */; };
1AA08604182578AF007CCAEB /* OOALSound.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA085F4182578AF007CCAEB /* OOALSound.h */; };
@ -2311,8 +2310,6 @@
1A9FCF2515DAC9BC00E965D5 /* GameController+FullScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GameController+FullScreen.m"; sourceTree = "<group>"; };
1AA085EE182578AF007CCAEB /* OOALBufferedSound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOALBufferedSound.h; sourceTree = "<group>"; };
1AA085EF182578AF007CCAEB /* OOALBufferedSound.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOALBufferedSound.m; sourceTree = "<group>"; };
1AA085F0182578AF007CCAEB /* OOALConcreteSound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOALConcreteSound.h; sourceTree = "<group>"; };
1AA085F1182578AF007CCAEB /* OOALConcreteSound.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOALConcreteSound.m; sourceTree = "<group>"; };
1AA085F2182578AF007CCAEB /* OOALMusic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOALMusic.h; sourceTree = "<group>"; };
1AA085F3182578AF007CCAEB /* OOALMusic.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOALMusic.m; sourceTree = "<group>"; };
1AA085F4182578AF007CCAEB /* OOALSound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOALSound.h; sourceTree = "<group>"; };
@ -3829,8 +3826,6 @@
1AA08610182578B8007CCAEB /* OOOpenALController.m */,
1AA085EE182578AF007CCAEB /* OOALBufferedSound.h */,
1AA085EF182578AF007CCAEB /* OOALBufferedSound.m */,
1AA085F0182578AF007CCAEB /* OOALConcreteSound.h */,
1AA085F1182578AF007CCAEB /* OOALConcreteSound.m */,
1AA085F2182578AF007CCAEB /* OOALMusic.h */,
1AA085F3182578AF007CCAEB /* OOALMusic.m */,
1AA085F4182578AF007CCAEB /* OOALSound.h */,
@ -4158,7 +4153,6 @@
1A2DA2B00CB4CB5C00DE6823 /* OOTCPStreamDecoder.h in Headers */,
1A2DA34D0CB4D0D800DE6823 /* OOJSConsole.h in Headers */,
1A2DA34E0CB4D0D800DE6823 /* OODebugMonitor.h in Headers */,
1AA08600182578AF007CCAEB /* OOALConcreteSound.h in Headers */,
1A2DA3550CB4D10800DE6823 /* OODebuggerInterface.h in Headers */,
1A2DA3EF0CB4E84900DE6823 /* OODebugSupport.h in Headers */,
1A43A0CC0CB91D2C00D0E239 /* OOJSPlanet.h in Headers */,

View File

@ -1,43 +0,0 @@
/*
OOALConcreteSound.h
OOALSound - OpenAL sound implementation for Oolite.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#import "OOALSound.h"
#import "OOOpenALController.h"
@interface OOALConcreteSound: OOSound
{
ALuint *_buffer;
NSString *_name;
}
- (ALuint) buffer;
@end

View File

@ -1,131 +0,0 @@
/*
OOALConcreteSound.m
OOALSound - OpenAL sound implementation for Oolite.
Copyright (C) 2006-2013 Jens Ayton
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDEDAS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include <ogg/ogg.h>
#include <vorbis/vorbisfile.h>
#include <vorbis/codec.h>
#import "OOALConcreteSound.h"
#import "OOLogging.h"
#import "NSDataOOExtensions.h"
size_t OOReadVorbis (void *ptr, size_t size, size_t nmemb, void *datasource);
typedef struct {
NSData *file;
size_t seek;
} OOOggBytes;
@implementation OOALConcreteSound
- (id) initWithContentsOfFile:(NSString *)path
{
if ((self = [super init]))
{
NSData *fileData = [NSData oo_dataWithOXZFile:path];
OggVorbis_File _vf;
ov_callbacks _callbacks = {
OOReadVorbis, // read sequentially
NULL, // no seek
NULL, // no close
NULL, // no tell
};
OOOggBytes bitData = {
fileData,
0
};
ov_open_callbacks(bitData, _vf, NULL, 0, _callbacks);
SDL_RWops *soundData = SDL_RWFromConstMem([fileData bytes],[fileData length]);
_chunk = Mix_LoadWAV_RW(soundData, 0);
SDL_RWclose(soundData);
if (_chunk != NULL)
{
#ifndef NDEBUG
OOLog(@"sound.load.success", @"Loaded a sound from \"%@\".", path);
#endif
_name = [[path lastPathComponent] copy];
}
else
{
OOLog(@"sound.load.failed", @"Could not load a sound from \"%@\".", path);
[self release];
self = nil;
}
}
return self;
}
- (void) dealloc
{
if (_chunk != NULL) Mix_FreeChunk(_chunk);
[_name autorelease];
[super dealloc];
}
- (NSString *) descriptionComponents
{
return [NSString stringWithFormat:@"\"%@\"", _name];
}
- (NSString *)name
{
return _name;
}
- (ALuint) buffer
{
return _buffer;
}
@end
// wants size*nmemb bytes from datasource transferred to ptr
size_t OOReadVorbis (void *ptr, size_t size, size_t nmemb, void *datasource)
{
size_t toRead = size*nmemb;
NSData *file = (OOOggBytes)datasource.file;
size_t seek = (OOOggBytes)datasource.seek;
if (seek+toRead > [file length])
{
toRead = [file length] - seek;
}
[file getBytes:ptr range:((NSRange){seek, toRead})];
(OOOggBytes)datasource.seek += toRead;
return toRead;
}