Skip to content

Instantly share code, notes, and snippets.

@merf
merf / gist:8730815
Created January 31, 2014 12:03
Can't figure out whats wrong here...
//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
@merf
merf / main.c
Created May 8, 2012 23:52
Adding instrument metadata to a caf file
#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;
@merf
merf / ViewController.m
Created January 21, 2012 14:11
MusicTrack Problem
#import "ViewController.h"
#import <AudioToolbox/AudioToolbox.h>
#import <AudioUnit/AudioUnit.h>
const int loop_length = 4;
@interface ViewController()
-(OSStatus) InitMIDI;