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
// Yeah, global variables suck, but it's kind of a necessary evil here | |
AudioUnit *audioUnit = NULL; | |
float *convertedSampleBuffer = NULL; | |
int initAudioSession() { | |
audioUnit = (AudioUnit*)malloc(sizeof(AudioUnit)); | |
if(AudioSessionInitialize(NULL, NULL, NULL, NULL) != noErr) { | |
return 1; | |
} |
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
#!/bin/bash | |
if [ "$#" -eq "0" ] ; then | |
printf "Usage: %s [content] [overlay image] [output image]\n" "$0" | |
exit 1 | |
fi | |
content="$1" | |
overlayImage="$2" | |
outputImage="$3" |
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
https://extensions.gnome.org/extension/3780/ddterm/ | |
https://extensions.gnome.org/extension/1162/emoji-selector/ | |
https://extensions.gnome.org/extension/1125/github-notifications/ | |
https://extensions.gnome.org/extension/1399/pop-theme-toggle/ | |
https://extensions.gnome.org/extension/120/system-monitor/ |
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
function git-branch-current() { | |
printf "%s\n" $(git branch 2> /dev/null | grep -e ^* | tr -d "\* ") | |
} | |
function git-branch-cleanup() { | |
local currentBranch=$(git-branch-current) | |
local otherBranch= | |
for otherBranch in $(git branch | grep -v $currentBranch) ; do | |
printf "Branch %s:\n" "$otherBranch" | |
printf " HEAD commit is: %s\n" "$(git log --oneline -n 1 $otherBranch)" |
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
void resumePlugin(AEffect *plugin) { | |
dispatcher(plugin, effMainsChanged, 0, 1, NULL, 0.0f); | |
} | |
void suspendPlugin(AEffect *plugin) { | |
dispatcher(plugin, effMainsChanged, 0, 0, NULL, 0.0f); | |
} |
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
Why have a sample rate as a floating point number? | |
Many audio API's, such as the VST and CoreAudio SDK's, represent the sampling | |
rate of the audio hardware as a floating point number. This may seem rather | |
silly at first, given that it's impossible to have a sample rate of 44100.5. | |
Thus it would seem that an unsigned integer (ie, uint32_t), would be an ideal | |
container for sample rate. | |
However, there is a reason that many audio API's use float (or better yet, | |
double) for sample rate. The reason is because that most DSP algorithms rely on |
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
#!/bin/bash | |
function git-branch-current() { | |
printf "%s\n" $(git branch 2> /dev/null | grep -e ^* | tr -d "\* ") | |
} | |
function git-log-last-pushed-hash() { | |
local currentBranch=$(git-branch-current); | |
git log --format="%h" -n 1 origin/${currentBranch} | |
} |
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
Day | |
--- | |
%a weekday, abbreviated Tue | |
%A weekday, full Tuesday | |
%d day of the month (dd), zero padded 22 | |
%e day of the month (dd) 22 | |
%j day of year, zero padded 001-366 | |
%u day of week starting with Monday (1), i.e. mtwtfss 2 | |
%w day of week starting with Sunday (0), i.e. smtwtfs 2 |
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
#include "YourProjectName.h" | |
AudioEffect* createEffectInstance(audioMasterCallback audioMaster) { | |
return new YourProjectName(audioMaster); | |
} | |
YourProjectName::YourProjectName(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, 0, NUM_PARAMS) { | |
} | |
YourProjectName::~YourProjectName() { |
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
public static void sendFeedbackScreenshot(final Activity activity) { | |
try { | |
final View rootView = activity.getWindow().getDecorView().findViewById(android.R.id.content); | |
rootView.setDrawingCacheEnabled(true); | |
Bitmap bitmap = rootView.getDrawingCache(); | |
// Activity.getCacheDir() won't work here, because the email intent can't | |
// access your app's internal storage. So you need to find a good temporary | |
// location in SD card storage. | |
File outputDir = new File(android.os.Environment.getExternalStorageDirectory(), "tmp"); | |
File outputFile = new File(outputDir, "screenshot.png"); |
NewerOlder