From 77893f3e1e1c12c3480068aed74b98010fede446 Mon Sep 17 00:00:00 2001 From: Christian Colglazier Date: Fri, 28 May 2021 12:11:57 -0400 Subject: [PATCH] Updated libs --- Makefile | 3 +++ lib/daisySP | 2 +- lib/libDaisy | 2 +- src/droplets/droplet.cpp | 2 +- src/droplets/droplet.h | 4 ++-- src/droplets/noise_droplet.cpp | 2 +- src/droplets/noise_droplet.h | 4 ++-- src/droplets/vco_droplet.cpp | 6 +++--- src/droplets/vco_droplet.h | 4 ++-- src/main.cpp | 4 ++-- src/main.h | 4 ++-- src/menu.cpp | 6 +++--- src/util.cpp | 20 ++++++++++---------- src/util.h | 16 +++++++++------- 14 files changed, 42 insertions(+), 37 deletions(-) diff --git a/Makefile b/Makefile index 7a649e8..3bce291 100644 --- a/Makefile +++ b/Makefile @@ -15,3 +15,6 @@ daisysp: cd $(DAISYSP_DIR) && make lib: libdaisy daisysp deploy: lib all program +updatelib: + cd $(LIBDAISY_DIR) && make clean && git pull origin master + cd $(DAISYSP_DIR) && make clean && git pull origin master diff --git a/lib/daisySP b/lib/daisySP index 3ca6b0a..bb80c4c 160000 --- a/lib/daisySP +++ b/lib/daisySP @@ -1 +1 @@ -Subproject commit 3ca6b0a73d835f568d9260e8110f7595f219f133 +Subproject commit bb80c4c10b87dfce3835f6dfb42e7c789f91eef6 diff --git a/lib/libDaisy b/lib/libDaisy index 73213d4..7a5ea84 160000 --- a/lib/libDaisy +++ b/lib/libDaisy @@ -1 +1 @@ -Subproject commit 73213d45086bee6d88533752740acdf01e1a9dda +Subproject commit 7a5ea84dbe0f64ac5dc9d93c40ad68bebaa9ec75 diff --git a/src/droplets/droplet.cpp b/src/droplets/droplet.cpp index 4dba2bc..011fb8a 100644 --- a/src/droplets/droplet.cpp +++ b/src/droplets/droplet.cpp @@ -34,7 +34,7 @@ size_t Droplet::GetChannelMax() { } void Droplet::DrawName(std::string name) { - WriteCenteredString(*patch, (screen_min + screen_max) / 2, 0, + WriteCenteredString(patch, (screen_min + screen_max) / 2, 0, Font_6x8, name); } diff --git a/src/droplets/droplet.h b/src/droplets/droplet.h index 0fe779e..31db0a1 100644 --- a/src/droplets/droplet.h +++ b/src/droplets/droplet.h @@ -52,8 +52,8 @@ public: * @param out the audio outputs for the patch * @param size the number of inputs and outputs */ - virtual void Process(float** in, - float** out, + virtual void Process(AudioHandle::InputBuffer in, + AudioHandle::OutputBuffer out, size_t size)=0; /* diff --git a/src/droplets/noise_droplet.cpp b/src/droplets/noise_droplet.cpp index efb038c..fb65f8f 100644 --- a/src/droplets/noise_droplet.cpp +++ b/src/droplets/noise_droplet.cpp @@ -9,7 +9,7 @@ NoiseDroplet::NoiseDroplet(DaisyPatch* m_patch, void NoiseDroplet::Control() {} -void NoiseDroplet::Process(float** in, float** out, size_t size) { +void NoiseDroplet::Process(AudioHandle::InputBuffer in, AudioHandle::OutputBuffer out, size_t size) { for (size_t i = 0; i < size; i += 2) { float sig = noise.Process(); for (size_t chn = GetChannelMin(); chn < GetChannelMax(); chn++) { diff --git a/src/droplets/noise_droplet.h b/src/droplets/noise_droplet.h index 804432f..9c402cc 100644 --- a/src/droplets/noise_droplet.h +++ b/src/droplets/noise_droplet.h @@ -33,8 +33,8 @@ public: * @param out the audio outputs for the patch * @param size the number of inputs and outputs */ - void Process(float** in, - float** out, + void Process(AudioHandle::InputBuffer in, + AudioHandle::OutputBuffer out, size_t size); /* diff --git a/src/droplets/vco_droplet.cpp b/src/droplets/vco_droplet.cpp index a9a08f5..01b4d2d 100644 --- a/src/droplets/vco_droplet.cpp +++ b/src/droplets/vco_droplet.cpp @@ -48,7 +48,7 @@ void VCODroplet::Control() { AdjustWaveShape(Patch()->encoder.Increment()); } -void VCODroplet::Process(float** in, float** out, size_t size) { +void VCODroplet::Process(AudioHandle::InputBuffer in, AudioHandle::OutputBuffer out, size_t size) { float sig, freq, amp = 1.0; Patch()->ProcessAnalogControls(); @@ -79,13 +79,13 @@ void VCODroplet::Process(float** in, float** out, size_t size) { void VCODroplet::Draw() { SetWaveState(wave); if (GetState() == DropletState::kFull) { - WriteCenteredString(*Patch(), + WriteCenteredString(Patch(), (GetScreenMax()-GetScreenMin())/2, 54, Font_6x8, WaveToString(wave)); } else { - WriteDoubleCentered(*Patch(), + WriteDoubleCentered(Patch(), GetScreenMin() + (GetScreenMax()-GetScreenMin())/2, 54, diff --git a/src/droplets/vco_droplet.h b/src/droplets/vco_droplet.h index 8c576a2..921d4fe 100644 --- a/src/droplets/vco_droplet.h +++ b/src/droplets/vco_droplet.h @@ -67,8 +67,8 @@ public: * @param out the audio outputs for the patch * @param size the number of inputs and outputs */ - void Process(float** in, - float** out, + void Process(AudioHandle::InputBuffer in, + AudioHandle::OutputBuffer out, size_t size); /* diff --git a/src/main.cpp b/src/main.cpp index 6f83dd0..84372e6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -73,8 +73,8 @@ void ProcessOled() { patch.display.Update(); } -static void AudioThrough(float **in, - float **out, +static void AudioThrough(AudioHandle::InputBuffer in, + AudioHandle::OutputBuffer out, size_t size) { droplet_left->Process(in, out, size); if (manager->GetSplitMode()) { diff --git a/src/main.h b/src/main.h index 7b3143b..daac4ad 100644 --- a/src/main.h +++ b/src/main.h @@ -46,8 +46,8 @@ void ProcessOutputs(); * @param out the audio outputs for the patch * @param size the number of inputs and outputs */ -static void AudioThrough(float** in, - float** out, +static void AudioThrough(AudioHandle::InputBuffer in, + AudioHandle::OutputBuffer out, size_t size); /* diff --git a/src/menu.cpp b/src/menu.cpp index 2384a45..004eb22 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -56,12 +56,12 @@ void Menu::CreateMenuItem(std::string text, bool highlighted) { text.insert(text.end(), MAX_CHAR_LENGTH-text.size(), ' '); if (highlighted) { - DrawSolidRect(*patch, 0, MENU_Y[2], + DrawSolidRect(patch, 0, MENU_Y[2], SSD1309_WIDTH, MENU_Y[2]+17, true); - WriteString(*patch, MENU_X[position-1], MENU_Y[position-1], + WriteString(patch, MENU_X[position-1], MENU_Y[position-1], Font_11x18, text, !highlighted); } else { - WriteString(*patch, MENU_X[position-1], MENU_Y[position-1], + WriteString(patch, MENU_X[position-1], MENU_Y[position-1], Font_7x10, text, !highlighted); } } diff --git a/src/util.cpp b/src/util.cpp index b23031b..c08d188 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,27 +1,27 @@ #include "util.h" -void DrawSolidRect(DaisyPatch patch, +void DrawSolidRect(DaisyPatch* patch, uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, bool on) { for (int i = std::min(y1, y2); i <= std::max(y1, y2); i++) { - patch.display.DrawLine(x1, i, x2, i, on); + patch->display.DrawLine(x1, i, x2, i, on); } } -void WriteString(DaisyPatch patch, +void WriteString(DaisyPatch* patch, int x, int y, FontDef font, std::string text, bool on) { - patch.display.SetCursor(x, y); - patch.display.WriteString(&text[0], font, on); + patch->display.SetCursor(x, y); + patch->display.WriteString(&text[0], font, on); } -void WriteString(DaisyPatch patch, +void WriteString(DaisyPatch* patch, int x, int y, FontDef font, @@ -29,7 +29,7 @@ void WriteString(DaisyPatch patch, WriteString(patch, x, y, font, text, true); } -void WriteCenteredString(DaisyPatch patch, +void WriteCenteredString(DaisyPatch* patch, int x, int y, FontDef font, @@ -40,7 +40,7 @@ void WriteCenteredString(DaisyPatch patch, WriteString(patch, x - (text_width / 2), y, font, text, on); } -void WriteCenteredString(DaisyPatch patch, +void WriteCenteredString(DaisyPatch* patch, int x, int y, FontDef font, @@ -48,7 +48,7 @@ void WriteCenteredString(DaisyPatch patch, WriteCenteredString(patch, x, y, font, text, true); } -void WriteDoubleCentered(DaisyPatch patch, +void WriteDoubleCentered(DaisyPatch* patch, int x, int y, int width, @@ -85,7 +85,7 @@ void WriteDoubleCentered(DaisyPatch patch, } } -void WriteDoubleCentered(DaisyPatch patch, +void WriteDoubleCentered(DaisyPatch* patch, int x, int y, int width, diff --git a/src/util.h b/src/util.h index 155bd3d..fda2a6d 100644 --- a/src/util.h +++ b/src/util.h @@ -9,6 +9,8 @@ using namespace daisy; +#define SSD1309_WIDTH 128 + /* * Draws a solid rectangle on screen. * @@ -19,7 +21,7 @@ using namespace daisy; * @param y2 y coordinate of the second point * @param on draw screen on or off */ -void DrawSolidRect(DaisyPatch patch, +void DrawSolidRect(DaisyPatch* patch, uint8_t x1, uint8_t y1, uint8_t x2, @@ -36,7 +38,7 @@ void DrawSolidRect(DaisyPatch patch, * @param text text to be written * @param on draw screen on or off */ -void WriteString(DaisyPatch patch, +void WriteString(DaisyPatch* patch, int x, int y, FontDef font, @@ -52,7 +54,7 @@ void WriteString(DaisyPatch patch, * @param font text font * @param text text to be written */ -void WriteString(DaisyPatch patch, +void WriteString(DaisyPatch* patch, int x, int y, FontDef font, @@ -68,7 +70,7 @@ void WriteString(DaisyPatch patch, * @param text text to be written * @param on draw screen on or off */ -void WriteCenteredString(DaisyPatch patch, +void WriteCenteredString(DaisyPatch* patch, int x, int y, FontDef font, @@ -84,7 +86,7 @@ void WriteCenteredString(DaisyPatch patch, * @param font text font * @param text text to be written */ -void WriteCenteredString(DaisyPatch patch, +void WriteCenteredString(DaisyPatch* patch, int x, int y, FontDef font, @@ -101,7 +103,7 @@ void WriteCenteredString(DaisyPatch patch, * @param text text to be written * @param on draw screen on or off */ -void WriteDoubleCentered(DaisyPatch patch, +void WriteDoubleCentered(DaisyPatch* patch, int x, int y, int width, @@ -119,7 +121,7 @@ void WriteDoubleCentered(DaisyPatch patch, * @param font text font * @param text text to be written */ -void WriteDoubleCentered(DaisyPatch patch, +void WriteDoubleCentered(DaisyPatch* patch, int x, int y, int width,