mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Trimmed and reordered just a little.
This commit is contained in:
parent
4a507b375b
commit
d6e8cd676a
@ -784,16 +784,16 @@
|
|||||||
4B55CE481C3B3B0C0093A61B /* Wrappers */ = {
|
4B55CE481C3B3B0C0093A61B /* Wrappers */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
4B0EBFB61C487F2F00A11F35 /* AudioQueue.h */,
|
||||||
|
4B0EBFB71C487F2F00A11F35 /* AudioQueue.m */,
|
||||||
4B55CE491C3B3B0C0093A61B /* CSAtari2600.h */,
|
4B55CE491C3B3B0C0093A61B /* CSAtari2600.h */,
|
||||||
4B55CE4A1C3B3B0C0093A61B /* CSAtari2600.mm */,
|
4B55CE4A1C3B3B0C0093A61B /* CSAtari2600.mm */,
|
||||||
|
4B55CE521C3B7ABF0093A61B /* CSElectron.h */,
|
||||||
|
4B55CE531C3B7ABF0093A61B /* CSElectron.mm */,
|
||||||
4B55CE4C1C3B3BDA0093A61B /* CSMachine.h */,
|
4B55CE4C1C3B3BDA0093A61B /* CSMachine.h */,
|
||||||
4B55CE4D1C3B3BDA0093A61B /* CSMachine.mm */,
|
4B55CE4D1C3B3BDA0093A61B /* CSMachine.mm */,
|
||||||
4B55CE4F1C3B78A80093A61B /* CSMachine+Subclassing.h */,
|
4B55CE4F1C3B78A80093A61B /* CSMachine+Subclassing.h */,
|
||||||
4B55CE521C3B7ABF0093A61B /* CSElectron.h */,
|
|
||||||
4B55CE531C3B7ABF0093A61B /* CSElectron.mm */,
|
|
||||||
4BAE587D1C447B7A005B9AF0 /* KeyCodes.h */,
|
4BAE587D1C447B7A005B9AF0 /* KeyCodes.h */,
|
||||||
4B0EBFB61C487F2F00A11F35 /* AudioQueue.h */,
|
|
||||||
4B0EBFB71C487F2F00A11F35 /* AudioQueue.m */,
|
|
||||||
);
|
);
|
||||||
path = Wrappers;
|
path = Wrappers;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -11,11 +11,7 @@
|
|||||||
|
|
||||||
@interface CSMachine (Subclassing)
|
@interface CSMachine (Subclassing)
|
||||||
|
|
||||||
- (void)performAsync:(dispatch_block_t)action;
|
|
||||||
- (void)performSync:(dispatch_block_t)action;
|
|
||||||
|
|
||||||
- (CRTMachine::Machine * const)machine;
|
- (CRTMachine::Machine * const)machine;
|
||||||
|
|
||||||
- (void)setupOutputWithAspectRatio:(float)aspectRatio;
|
- (void)setupOutputWithAspectRatio:(float)aspectRatio;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -22,23 +22,12 @@ struct SpeakerDelegate: public Outputs::Speaker::Delegate {
|
|||||||
|
|
||||||
@implementation CSMachine {
|
@implementation CSMachine {
|
||||||
SpeakerDelegate _speakerDelegate;
|
SpeakerDelegate _speakerDelegate;
|
||||||
dispatch_queue_t _serialDispatchQueue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)speaker:(Outputs::Speaker *)speaker didCompleteSamples:(const int16_t *)samples length:(int)length {
|
- (void)speaker:(Outputs::Speaker *)speaker didCompleteSamples:(const int16_t *)samples length:(int)length {
|
||||||
[self.audioQueue enqueueAudioBuffer:samples numberOfSamples:(unsigned 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 {
|
- (void)dealloc {
|
||||||
[_view performWithGLContext:^{
|
[_view performWithGLContext:^{
|
||||||
@synchronized(self) {
|
@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 {
|
- (void)setView:(CSOpenGLView *)view aspectRatio:(float)aspectRatio {
|
||||||
_view = view;
|
_view = view;
|
||||||
[view performWithGLContext:^{
|
[view performWithGLContext:^{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user