2016-01-04 23:12:47 -05: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 14:45:09 -05:00
|
|
|
#import "CSOpenGLView.h"
|
2016-06-15 08:07:25 -04:00
|
|
|
#import "CSAudioQueue.h"
|
2016-01-04 23:12:47 -05:00
|
|
|
|
2016-06-16 20:39:46 -04:00
|
|
|
@class CSMachine;
|
|
|
|
@protocol CSMachineDelegate
|
|
|
|
- (void)machineDidChangeClockRate:(CSMachine *)machine;
|
2016-09-12 22:06:03 -04:00
|
|
|
- (void)machineDidChangeClockIsUnlimited:(CSMachine *)machine;
|
2016-06-16 20:39:46 -04:00
|
|
|
@end
|
|
|
|
|
2016-01-04 23:12:47 -05:00
|
|
|
@interface CSMachine : NSObject
|
|
|
|
|
2017-08-27 16:36:21 -04:00
|
|
|
- (instancetype)init NS_UNAVAILABLE;
|
|
|
|
/*!
|
|
|
|
Initialises an instance of CSMachine.
|
|
|
|
|
|
|
|
@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-04 23:12:47 -05:00
|
|
|
- (void)runForNumberOfCycles:(int)numberOfCycles;
|
2016-05-31 22:16:20 -04:00
|
|
|
|
2016-06-13 19:30:41 -04:00
|
|
|
- (float)idealSamplingRateFromRange:(NSRange)range;
|
2016-06-16 20:51:35 -04:00
|
|
|
- (void)setAudioSamplingRate:(float)samplingRate bufferSize:(NSUInteger)bufferSize;
|
2016-06-01 19:04:07 -04:00
|
|
|
|
2016-04-11 23:12:56 -04:00
|
|
|
- (void)setView:(CSOpenGLView *)view aspectRatio:(float)aspectRatio;
|
2016-05-31 22:16:20 -04:00
|
|
|
- (void)drawViewForPixelSize:(CGSize)pixelSize onlyIfDirty:(BOOL)onlyIfDirty;
|
2016-01-04 23:12:47 -05:00
|
|
|
|
2016-06-15 08:07:59 -04:00
|
|
|
@property (nonatomic, strong) CSAudioQueue *audioQueue;
|
2016-04-24 20:34:25 -04:00
|
|
|
@property (nonatomic, readonly) CSOpenGLView *view;
|
2016-06-16 20:39:46 -04:00
|
|
|
@property (nonatomic, weak) id<CSMachineDelegate> delegate;
|
2016-09-12 22:06:03 -04:00
|
|
|
|
2016-06-16 20:39:46 -04:00
|
|
|
@property (nonatomic, readonly) double clockRate;
|
2016-09-12 22:06:03 -04:00
|
|
|
@property (nonatomic, readonly) BOOL clockIsUnlimited;
|
2016-01-04 23:12:47 -05:00
|
|
|
|
2016-10-02 21:56:50 -04:00
|
|
|
@property (nonatomic, readonly) NSString *userDefaultsPrefix;
|
|
|
|
|
2016-06-19 16:35:04 -04:00
|
|
|
- (void)paste:(NSString *)string;
|
|
|
|
|
2016-01-04 23:12:47 -05:00
|
|
|
@end
|