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 #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. // Keyboard layers.
// These must have the same indices as // These must have the same indices as
@ -29,25 +45,32 @@ enum layer_layout_ids {
#define LOOP_SLEEP_MS 20 #define LOOP_SLEEP_MS 20
//#define DISABLE_SPELL
/*
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_AFF_EN "/usr/share/hunspell/en_US.aff"
#define HUNSPELL_DIC_EN "/usr/share/hunspell/en_US.dic" #define HUNSPELL_DIC_EN "/usr/share/hunspell/en_US.dic"
#endif
// USB device params
#define HID_VENDOR_ID 0x3297
#define HID_PRODUCT_ID 0x4976
#define HID_USAGE 0x61
#define HID_USAGE_PAGE 0xFF60
/*
Music Visualizer Animation
*/
#define DISABLE_VISUALIZER #define DISABLE_VISUALIZER
#ifndef DISABLE_VISUALIZER
// 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
// How many keys in a column * resolution per key. // How many keys in a column * resolution per key.
// this MUST fit inside a uint8_t (i.e, <= 255). // this MUST fit inside a uint8_t (i.e, <= 255).
#define KB_RESOLUTION (5 * 50) #define KB_RESOLUTION (5 * 50)
@ -59,3 +82,4 @@ enum layer_layout_ids {
// Spectrum visualizer range // Spectrum visualizer range
#define MIN_HZ 100 #define MIN_HZ 100
#define MAX_HZ 5000 #define MAX_HZ 5000
#endif

View File

@ -59,12 +59,6 @@
// pcm from pulse // 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 // HID interface wrapper
Ergodox Dox = Ergodox::init( Ergodox Dox = Ergodox::init(
HID_VENDOR_ID, HID_VENDOR_ID,

View File

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

View File

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