This file contains 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
// This is a quick example of how to use the CoreAudio API and the new Tapping | |
// API to create a tap on the default audio device. You need macOS 14.2 or | |
// later. | |
// Build command: | |
// clang -framework Foundation -framework CoreAudio main.m -o tapping | |
// License: You're welcome to do whatever you want with this code. If you do | |
// something cool please tell me though. I would love to hear about it! |
This file contains 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
#pragma once | |
#include <iostream> | |
#include <thread> | |
#ifdef _DEBUG | |
static std::thread::id YOULEAN_ALLOCATOR_MAIN_THREAD_ID = std::thread::id(); | |
static std::thread::id YOULEAN_ALLOCATOR_AUDIO_THREAD_ID = std::thread::id(); |
This file contains 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
// Required code | |
#define STRING2(x) #x | |
#define STRING(x) STRING2(x) | |
#define warning_vs(t) message(__FILE__ "(" STRING(__LINE__) "): warning: " STRING(t)) | |
// Example Usage | |
#pragma warning_vs("This is my custom warning") |
This file contains 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
// Easing | |
const float PI2 = PI * 2; | |
inline float LinearEase(float p) | |
{ | |
return p; | |
} | |
inline float QuadraticEaseIn(float p) |
This file contains 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
#pragma once | |
#include <fstream> | |
#include <codecvt> | |
class Windows_UTF_Converter | |
{ | |
public: | |
#ifdef WIN32 | |
std::string utf8_to_ansi(std::string s) |