1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-07 08:28:57 +00:00

Trimmed and reordered just a little.

This commit is contained in:
Thomas Harte 2016-06-04 16:02:16 -04:00
parent 4a507b375b
commit d6e8cd676a
3 changed files with 4 additions and 27 deletions

View File

@ -784,16 +784,16 @@
4B55CE481C3B3B0C0093A61B /* Wrappers */ = {
isa = PBXGroup;
children = (
4B0EBFB61C487F2F00A11F35 /* AudioQueue.h */,
4B0EBFB71C487F2F00A11F35 /* AudioQueue.m */,
4B55CE491C3B3B0C0093A61B /* CSAtari2600.h */,
4B55CE4A1C3B3B0C0093A61B /* CSAtari2600.mm */,
4B55CE521C3B7ABF0093A61B /* CSElectron.h */,
4B55CE531C3B7ABF0093A61B /* CSElectron.mm */,
4B55CE4C1C3B3BDA0093A61B /* CSMachine.h */,
4B55CE4D1C3B3BDA0093A61B /* CSMachine.mm */,
4B55CE4F1C3B78A80093A61B /* CSMachine+Subclassing.h */,
4B55CE521C3B7ABF0093A61B /* CSElectron.h */,
4B55CE531C3B7ABF0093A61B /* CSElectron.mm */,
4BAE587D1C447B7A005B9AF0 /* KeyCodes.h */,
4B0EBFB61C487F2F00A11F35 /* AudioQueue.h */,
4B0EBFB71C487F2F00A11F35 /* AudioQueue.m */,
);
path = Wrappers;
sourceTree = "<group>";

View File

@ -11,11 +11,7 @@
@interface CSMachine (Subclassing)
- (void)performAsync:(dispatch_block_t)action;
- (void)performSync:(dispatch_block_t)action;
- (CRTMachine::Machine * const)machine;
- (void)setupOutputWithAspectRatio:(float)aspectRatio;
@end

View File

@ -22,23 +22,12 @@ struct SpeakerDelegate: public Outputs::Speaker::Delegate {
@implementation CSMachine {
SpeakerDelegate _speakerDelegate;
dispatch_queue_t _serialDispatchQueue;
}
- (void)speaker:(Outputs::Speaker *)speaker didCompleteSamples:(const int16_t *)samples length:(int)length {
[self.audioQueue enqueueAudioBuffer:samples numberOfSamples:(unsigned int)length];
}
- (instancetype)init {
self = [super init];
if(self) {
_serialDispatchQueue = dispatch_queue_create("Machine queue", DISPATCH_QUEUE_SERIAL);
}
return self;
}
- (void)dealloc {
[_view performWithGLContext:^{
@synchronized(self) {
@ -84,14 +73,6 @@ struct SpeakerDelegate: public Outputs::Speaker::Delegate {
}
}
- (void)performSync:(dispatch_block_t)action {
dispatch_sync(_serialDispatchQueue, action);
}
- (void)performAsync:(dispatch_block_t)action {
dispatch_async(_serialDispatchQueue, action);
}
- (void)setView:(CSOpenGLView *)view aspectRatio:(float)aspectRatio {
_view = view;
[view performWithGLContext:^{