mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 19:23:59 +00:00
Nonblocking sound
This commit is contained in:
parent
cbc2b31da8
commit
e28e10045b
17
Sources/VLSoundSched.h
Normal file
17
Sources/VLSoundSched.h
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
//
|
||||||
|
// VLSoundSched.h
|
||||||
|
// Vocalese
|
||||||
|
//
|
||||||
|
// Created by Matthias Neeracher on 10/7/06.
|
||||||
|
// Copyright 2006 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
@interface VLSoundSched : NSObject {
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void) setup;
|
||||||
|
+ (void) performSoundEvent:(id)soundEvent;
|
||||||
|
|
||||||
|
@end
|
35
Sources/VLSoundSched.mm
Normal file
35
Sources/VLSoundSched.mm
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
//
|
||||||
|
// VLSoundSched.mm
|
||||||
|
// Vocalese
|
||||||
|
//
|
||||||
|
// Created by Matthias Neeracher on 10/7/06.
|
||||||
|
// Copyright 2006 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "VLSoundSched.h"
|
||||||
|
#import "VLSoundOut.h"
|
||||||
|
|
||||||
|
class VLSS: public VLSoundScheduler {
|
||||||
|
virtual void Schedule(VLSoundEvent * what, float when);
|
||||||
|
};
|
||||||
|
|
||||||
|
void VLSS::Schedule(VLSoundEvent * what, float when)
|
||||||
|
{
|
||||||
|
[[VLSoundSched class] performSelector:@selector(performSoundEvent:)
|
||||||
|
withObject:[NSNumber numberWithUnsignedLong:(unsigned long)what]
|
||||||
|
afterDelay:when];
|
||||||
|
}
|
||||||
|
|
||||||
|
@implementation VLSoundSched
|
||||||
|
|
||||||
|
+ (void) setup
|
||||||
|
{
|
||||||
|
VLSoundOut::SetScheduler(new VLSS);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void) performSoundEvent:(id)soundEvent
|
||||||
|
{
|
||||||
|
((VLSoundEvent *)[soundEvent unsignedLongValue])->Perform();
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
Loading…
Reference in New Issue
Block a user