This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//I often want to typedef shared_pts to classes like: | |
typedef std::shared_ptr<CThing> TThingPtr; | |
//Figured it'd be easy to wrap this in a macro like: | |
#define SHARED_PTR(Name) typedef std::shared_ptr<C##Name> T##NamePtr; | |
//but: | |
SHARED_PTR(Thing) | |
TThingPtr p; //ERROR: Unknown type TThingPtr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <AudioToolbox/AudioToolbox.h> | |
#include <Foundation/NSData.h> | |
#include <Foundation/NSAutoreleasePool.h> | |
// generic error handler - if result is nonzero, prints error message and exits program. | |
static void CheckResult(OSStatus result, const char *operation) | |
{ | |
if (result == noErr) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ViewController.h" | |
#import <AudioToolbox/AudioToolbox.h> | |
#import <AudioUnit/AudioUnit.h> | |
const int loop_length = 4; | |
@interface ViewController() | |
-(OSStatus) InitMIDI; |