LOTimingThread.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #import <Cocoa/Cocoa.h>
00037
00038 #define LOTIMING_THREAD_STOP 0x01
00039 #define LOTIMING_THREAD_INVOKE 0x02
00040
00041 #define LOTimingThreadDidCatchExceptionNotification @"LOTimingThreadDidCatchExceptionNotification"
00042 #define LOTimingThreadTapIntervalDidChange @"LOTimingThreadTapIntervalDidChange"
00043 #define LOTimingThreadDidCrash @"LOTimingThreadDidCrash"
00044
00051 @interface LOTimingThread : NSObject
00052 {
00053 BOOL timingThreadRunning;
00054 NSLock *threadRunningLock;
00055 NSPort *timingPort;
00056 NSThread *timingThread;
00057 NSLock *lock;
00058 NSLock *restartLock;
00059 NSMutableArray *invocations;
00060
00061 NSDate *lastTap;
00062 unsigned tapCount;
00063 NSTimeInterval tapProgress[4];
00064 NSTimeInterval tapInterval;
00065 }
00066
00067
00073 - (void)stopThread;
00074
00075
00081 - (NSThread *)timingThread;
00082
00083
00092 - (BOOL)tap;
00093
00094
00102 - (NSTimeInterval)tapInterval;
00103
00104
00112 - (unsigned)tapBPM;
00113
00114
00120 + (LOTimingThread *)sharedTimingThread;
00121
00122
00128 - (void)performSelector:(SEL)aSelector onObject:(id)anObject;
00129
00130
00137 - (void)performSelector:(SEL)aSelector withObject:(id)anObject onObject:(id)theObject;
00138
00139
00146 - (void)performSelector:(SEL)aSelector withObject:(id)anObject withObject:(id)anotherObject onObject:(id)theObject;
00147
00148
00156 - (void)performSelector:(SEL)aSelector onObject:(id)theObject withParams:(void *)firstParam, ...;
00157
00158
00164 - (void)invoke:(NSInvocation *)invocation;
00165
00166
00167 @end