2016-01-05 04:12:47 +00:00
|
|
|
//
|
|
|
|
// CSMachine.h
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 04/01/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
2016-03-05 19:45:09 +00:00
|
|
|
#import "CSOpenGLView.h"
|
2016-06-15 12:07:25 +00:00
|
|
|
#import "CSAudioQueue.h"
|
2016-01-05 04:12:47 +00:00
|
|
|
|
2016-06-17 00:39:46 +00:00
|
|
|
@class CSMachine;
|
|
|
|
@protocol CSMachineDelegate
|
|
|
|
- (void)machineDidChangeClockRate:(CSMachine *)machine;
|
2016-09-13 02:06:03 +00:00
|
|
|
- (void)machineDidChangeClockIsUnlimited:(CSMachine *)machine;
|
2016-06-17 00:39:46 +00:00
|
|
|
@end
|
|
|
|
|
2016-01-05 04:12:47 +00:00
|
|
|
@interface CSMachine : NSObject
|
|
|
|
|
2017-08-27 20:36:21 +00:00
|
|
|
- (instancetype)init NS_UNAVAILABLE;
|
|
|
|
/*!
|
|
|
|
Initialises an instance of CSMachine.
|
2017-11-08 03:51:06 +00:00
|
|
|
|
2017-08-27 20:36:21 +00:00
|
|
|
@param machine The pointer to an instance of @c CRTMachine::Machine* . C++ type is omitted because
|
|
|
|
this header is visible to Swift, and the designated initialiser cannot be placed into a category.
|
|
|
|
*/
|
|
|
|
- (instancetype)initWithMachine:(void *)machine NS_DESIGNATED_INITIALIZER;
|
|
|
|
|
2016-01-05 04:12:47 +00:00
|
|
|
- (void)runForNumberOfCycles:(int)numberOfCycles;
|
2016-06-01 02:16:20 +00:00
|
|
|
|
2016-06-13 23:30:41 +00:00
|
|
|
- (float)idealSamplingRateFromRange:(NSRange)range;
|
2016-06-17 00:51:35 +00:00
|
|
|
- (void)setAudioSamplingRate:(float)samplingRate bufferSize:(NSUInteger)bufferSize;
|
2016-06-01 23:04:07 +00:00
|
|
|
|
2016-04-12 03:12:56 +00:00
|
|
|
- (void)setView:(CSOpenGLView *)view aspectRatio:(float)aspectRatio;
|
2016-06-01 02:16:20 +00:00
|
|
|
- (void)drawViewForPixelSize:(CGSize)pixelSize onlyIfDirty:(BOOL)onlyIfDirty;
|
2016-01-05 04:12:47 +00:00
|
|
|
|
2017-10-16 01:25:56 +00:00
|
|
|
- (void)setKey:(uint16_t)key isPressed:(BOOL)isPressed;
|
|
|
|
- (void)clearAllKeys;
|
|
|
|
|
2016-06-15 12:07:59 +00:00
|
|
|
@property (nonatomic, strong) CSAudioQueue *audioQueue;
|
2016-04-25 00:34:25 +00:00
|
|
|
@property (nonatomic, readonly) CSOpenGLView *view;
|
2016-06-17 00:39:46 +00:00
|
|
|
@property (nonatomic, weak) id<CSMachineDelegate> delegate;
|
2016-09-13 02:06:03 +00:00
|
|
|
|
2016-06-17 00:39:46 +00:00
|
|
|
@property (nonatomic, readonly) double clockRate;
|
2016-09-13 02:06:03 +00:00
|
|
|
@property (nonatomic, readonly) BOOL clockIsUnlimited;
|
2016-01-05 04:12:47 +00:00
|
|
|
|
2016-10-03 01:56:50 +00:00
|
|
|
@property (nonatomic, readonly) NSString *userDefaultsPrefix;
|
|
|
|
|
2016-06-19 20:35:04 +00:00
|
|
|
- (void)paste:(NSString *)string;
|
|
|
|
|
2016-01-05 04:12:47 +00:00
|
|
|
@end
|