Skip to content

Instantly share code, notes, and snippets.

View Oleksiy-Yakovenko's full-sized avatar

Oleksiy Yakovenko Oleksiy-Yakovenko

View GitHub Profile
@Oleksiy-Yakovenko
Oleksiy-Yakovenko / MetalViewExample.swift
Last active July 14, 2024 10:34
Minimalistic example of Metal NSView with CAMetalLayer
// A simple view with CAMetalLayer
protocol MetalViewDelegate: AnyObject {
func viewDidResize()
}
class MetalView: NSView {
weak var delegate: MetalViewDelegate?
override var acceptsFirstResponder: Bool {
@Oleksiy-Yakovenko
Oleksiy-Yakovenko / ddb-commandline-to-plugins.md
Last active September 17, 2021 06:28
Deadbeef Proposal: passing command line arguments to plugins

Introduction

Some developers are interested in extending Deadbeef command line with more options.
Currently it's not supported, but the API is there, and it should be relatively easy to implement without breaking the existing plugins.

The proposal

  • Reuse the existing API: int (*exec_cmdline) (const char *cmdline, int cmdline_size);
  • Use it only with the plugins which use the API, which corresponds to deadbeef release which adds the feature.
@Oleksiy-Yakovenko
Oleksiy-Yakovenko / fft.c
Last active September 4, 2021 10:30
FFT implementation for embedded (arduino, teensy)
/*
* fft.c
* Copyright 2011 John Lindgren
* Copyright 2021 Alexey Yakovenko
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions, and the following disclaimer.
@Oleksiy-Yakovenko
Oleksiy-Yakovenko / pipe.cpp
Created January 25, 2018 16:39
cross platform pipe IPC implementation in C++
#include "stdafx.h"
#define USE_POPEN 1
#if PLATFORM_WINDOWS
#define popen _popen
#define pclose _pclose
#endif
class Pipe
@Oleksiy-Yakovenko
Oleksiy-Yakovenko / gist:89aaadde6c1be6344475ce2a1a7c601e
Last active August 21, 2017 13:48
Swap option and command, map fn->ins in MS Remote Desktop
# add to profiles -> complex_modifications
# in the file ~/.config/karabiner/karabiner.json
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 1000
},
"rules": [
@Oleksiy-Yakovenko
Oleksiy-Yakovenko / libsupcpp-patching.md
Created December 6, 2016 09:51
How to patch libsupc++.a to link against older glibc
ar x libsupc++.a
for i in *.o ; do mv $i new_$i ; objcopy new_$i $i --redefine-sym memcpy=memcpy@GLIBC_2.2.5 ; rm new_$i ; done
ar rcs libsupc++.a *.o
@Oleksiy-Yakovenko
Oleksiy-Yakovenko / rg_scanner_data.md
Last active October 5, 2016 09:22
ReplayGain Scanner Temp Data Storage

The Problem

After the scanner finished, the user may decide to close the scan results window, and write the calculated RG info to the file tags later, via the context menu.

This requires storing the data in some temporary storage.

E.g. store as hidden fields in track metadata, and transfer from there to the "real" RG info storage when applied.

There are complications here:

@Oleksiy-Yakovenko
Oleksiy-Yakovenko / float32_rendering.md
Last active October 5, 2016 09:09
Floating point processing proposal

The problem

On desktop / high performance CPUs, it is highly desirable to render audio stream in floating point from the decoder, apply DSP, do visualizations, apply the volume, replaygain, etc, and only then convert to the final output format, which could be configured in the Playback Output Settings.

We want to be able to get the original stream through the visualization and DSP for stuff like VU-meters,

@Oleksiy-Yakovenko
Oleksiy-Yakovenko / snapcraft.yml
Last active June 19, 2017 20:22
WIP snapcraft.yml
# This is an attempt to create a snapcraft script
# for packaging prebuilt deadbeef binaries into a snap package,
# similar to what we do with Debian and ArchLinux packages.
#
# The research has shown, that snap packaging is not capable of doing this,
# and the sandboxing system of Snap prevents deadbeef from functioning correctly.
#
# Therefore this script is left here for reference only, but doesn't have any real use.
name: deadbeef