master
Mark 2022-11-20 20:48:53 -08:00
parent 40f6ddee8a
commit 2c9131f197
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
4 changed files with 58 additions and 32 deletions

View File

@ -1,6 +1,22 @@
#pragma once
/*
General Setup
*/
// USB device params
#define HID_VENDOR_ID 0x3297
#define HID_PRODUCT_ID 0x4976
#define HID_USAGE 0x61
#define HID_USAGE_PAGE 0xFF60
// USB packet size, in bytes.
// Usually 32, but depends on keyboard.
#define RAW_EPSIZE 32
// How many milliseconds to wait between reconnect attempts
#define RECONNECT_SLEEP_MS 500
// Keyboard layers.
// These must have the same indices as
@ -29,33 +45,41 @@ enum layer_layout_ids {
#define LOOP_SLEEP_MS 20
//#define DISABLE_SPELL
#define HUNSPELL_AFF_EN "/usr/share/hunspell/en_US.aff"
#define HUNSPELL_DIC_EN "/usr/share/hunspell/en_US.dic"
// USB device params
#define HID_VENDOR_ID 0x3297
#define HID_PRODUCT_ID 0x4976
#define HID_USAGE 0x61
#define HID_USAGE_PAGE 0xFF60
/*
Autotype Special Characters
*/
//#define DISABLE_SPECIAL_CHAR
/*
Spellcheck
*/
#define DISABLE_SPELL
#ifndef DISABLE_SPELL
#define HUNSPELL_AFF_EN "/usr/share/hunspell/en_US.aff"
#define HUNSPELL_DIC_EN "/usr/share/hunspell/en_US.dic"
#endif
/*
Music Visualizer Animation
*/
#define DISABLE_VISUALIZER
#ifndef DISABLE_VISUALIZER
// How many keys in a column * resolution per key.
// this MUST fit inside a uint8_t (i.e, <= 255).
#define KB_RESOLUTION (5 * 50)
// USB packet size, in bytes.
// Usually 32, but depends on keyboard.
#define RAW_EPSIZE 32
// How many resolution steps to skip at the top and bottom.
#define BOTTOM_SKIP 100
#define TOP_SKIP 0
// How many milliseconds to wait between reconnect attempts
#define RECONNECT_SLEEP_MS 500
// How many keys in a column * resolution per key.
// this MUST fit inside a uint8_t (i.e, <= 255).
#define KB_RESOLUTION (5 * 50)
// How many resolution steps to skip at the top and bottom.
#define BOTTOM_SKIP 100
#define TOP_SKIP 0
// Spectrum visualizer range
#define MIN_HZ 100
#define MAX_HZ 5000
// Spectrum visualizer range
#define MIN_HZ 100
#define MAX_HZ 5000
#endif

View File

@ -59,12 +59,6 @@
// pcm from pulse
// buffer size for waveform:
// (44100 / fps * 10), make 10 bigger for slower scrolling
//
// Double both buffer sizes if stereo
// HID interface wrapper
Ergodox Dox = Ergodox::init(
HID_VENDOR_ID,

View File

@ -7,6 +7,10 @@
namespace SpecialChars {
const std::string special_chars[] = {
// These characters are used to type
// symbols on layouts that don't have
// them.
"\\`",
"~",
"'",

View File

@ -19,7 +19,11 @@ namespace Visualizer {
std::chrono::nanoseconds
> last_fifo_sync;
Buffer buf = Buffer(
// buffer size for waveform:
// (44100 / fps * 10), make 10 bigger for slower scrolling
//
// Double both buffer sizes if stereo
Buffer buf = Buffer(
"/tmp/mpd.fifo",
44100 / 2, // Keep 500ms of data in buffer
fft.compute_buffer_output_size()