I hereby claim:
- I am tkemp on github.
- I am timkemp (https://keybase.io/timkemp) on keybase.
- I have a public key ASDYIE8BXfz6QnylI0N5fE0CBNafD80Gr5FWOWqXfb9_vAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| AudioStreamBasicDescription _outputASBD; | |
| memset(&_outputASBD, 0, sizeof(_outputASBD)); | |
| _outputASBD.mSampleRate = 44100.0; | |
| _outputASBD.mFormatID = kAudioFormatLinearPCM; | |
| _outputASBD.mFormatFlags = kAudioFormatFlagsCanonical; // Equivalent to kAudioFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked | |
| _outputASBD.mBytesPerPacket = 2 * 2; | |
| _outputASBD.mBytesPerFrame = 2 * 2; | |
| _outputASBD.mFramesPerPacket = 1; | |
| _outputASBD.mChannelsPerFrame = 2; | |
| _outputASBD.mBitsPerChannel = 16; |
| // Get the ASBD from the player unit | |
| UInt32 playerASBDsz; | |
| checkError(AudioUnitGetProperty(_playerUnit, | |
| kAudioUnitProperty_StreamFormat, | |
| kAudioUnitScope_Output, | |
| BUS_PLAYER_OUTPUT, | |
| &_playerASBD, | |
| &playerASBDsz), | |
| "AudioUnitSetProperty failed: getting stream format from the player unit", false); |
| void AUM_printAvailableStreamFormatsForId(AudioFileTypeID fileTypeID, UInt32 mFormatID) | |
| { | |
| AudioFileTypeAndFormatID fileTypeAndFormat; | |
| fileTypeAndFormat.mFileType = fileTypeID; | |
| fileTypeAndFormat.mFormatID = mFormatID; | |
| UInt32 fileTypeIDChar = CFSwapInt32HostToBig(fileTypeID); | |
| UInt32 mFormatChar = CFSwapInt32HostToBig(mFormatID); | |
| OSStatus audioErr = noErr; | |
| UInt32 infoSize = 0; |
| -(void) printASBDforNode:(AUNode) node scope:(int) scope bus:(int) bus { | |
| AudioStreamBasicDescription testASBD; | |
| UInt32 asbdSize = sizeof (AudioStreamBasicDescription); | |
| AudioUnit nodeUnit; | |
| AUGraphNodeInfo(_graph, node, NULL, &nodeUnit); | |
| AudioUnitGetProperty(nodeUnit, | |
| kAudioUnitProperty_StreamFormat, | |
| scope, | |
| bus, // bus |
| // In init or wherever: | |
| [self registerForDraggedTypes: | |
| [NSArray arrayWithObjects:@"public.url-name",nil]]; | |
| // In performDragOperation: | |
| NSString * subject = [[sender draggingPasteboard] stringForType:@"public.url-name"]; | |
| NSURL * url = [NSURL URLFromPasteboard:[sender draggingPasteboard]]; | |
| // The transition table itself | |
| SMTransition MyClass::transitionTable[] = { | |
| { SMStateStart, SMEventAlpha, &MyClass::transToOne }, | |
| { SMStateStart, SMEventBeta, &MyClass::transToTwo }, | |
| ... | |
| { SMStateAny, SMEventAnyEvent, &MyClass::transDoNothing } | |
| }; | |
| // Macro to give us the number of transitions in the table | |
| #define TR_COUNT (sizeof(transitionTable) / sizeof(*transitionTable)) |
| class MyClass; | |
| typedef enum SMState { | |
| SMStateStart, | |
| SMStateOne, | |
| SMStateTwo, | |
| SMStateFinal, | |
| SMStateAny | |
| } SMState; |