diff --git a/examples/BA1_TGA_Pro_demo/BA1_TGA_Pro_demo.ino b/examples/BA1_TGA_Pro_demo/BA1_TGA_Pro_demo.ino index d4d19d1..c66cf6c 100644 --- a/examples/BA1_TGA_Pro_demo/BA1_TGA_Pro_demo.ino +++ b/examples/BA1_TGA_Pro_demo/BA1_TGA_Pro_demo.ino @@ -21,7 +21,8 @@ using namespace midi; //#define ENABLE_MEM_TEST // uncomment this line and 'Save As' to a new location to test the SPI memory -using namespace BAGuitar; +using namespace BALibrary; +using namespace BAEffects; AudioInputI2S i2sIn; AudioOutputI2S i2sOut; diff --git a/examples/BA2_TGA_Pro_1MEM/BA2_TGA_Pro_1MEM.ino b/examples/BA2_TGA_Pro_1MEM/BA2_TGA_Pro_1MEM.ino index 2649ae1..8e1211f 100644 --- a/examples/BA2_TGA_Pro_1MEM/BA2_TGA_Pro_1MEM.ino +++ b/examples/BA2_TGA_Pro_1MEM/BA2_TGA_Pro_1MEM.ino @@ -23,7 +23,8 @@ MIDI_CREATE_DEFAULT_INSTANCE(); using namespace midi; -using namespace BAGuitar; +using namespace BALibrary; +using namespace BAEffects; AudioInputI2S i2sIn; AudioOutputI2S i2sOut; diff --git a/examples/BA3_TGA_Pro_2MEM/BA3_TGA_Pro_2MEM.ino b/examples/BA3_TGA_Pro_2MEM/BA3_TGA_Pro_2MEM.ino index 49a83a5..40f0adb 100644 --- a/examples/BA3_TGA_Pro_2MEM/BA3_TGA_Pro_2MEM.ino +++ b/examples/BA3_TGA_Pro_2MEM/BA3_TGA_Pro_2MEM.ino @@ -24,7 +24,8 @@ MIDI_CREATE_DEFAULT_INSTANCE(); using namespace midi; -using namespace BAGuitar; +using namespace BAEffects; +using namespace BALibrary; AudioInputI2S i2sIn; AudioOutputI2S i2sOut; diff --git a/examples/BA4_TGA_Pro_delay_reverb/BA4_TGA_Pro_delay_reverb.ino b/examples/BA4_TGA_Pro_delay_reverb/BA4_TGA_Pro_delay_reverb.ino index 3cc7190..0eb2353 100644 --- a/examples/BA4_TGA_Pro_delay_reverb/BA4_TGA_Pro_delay_reverb.ino +++ b/examples/BA4_TGA_Pro_delay_reverb/BA4_TGA_Pro_delay_reverb.ino @@ -14,7 +14,8 @@ #include #include "BAGuitar.h" -using namespace BAGuitar; +using namespace BAEffects; +using namespace BALibrary; BAAudioControlWM8731 codecControl; diff --git a/examples/BA5_TGA_Pro_ExternalDelay_demo/BA5_TGA_Pro_ExternalDelay_demo.ino b/examples/BA5_TGA_Pro_ExternalDelay_demo/BA5_TGA_Pro_ExternalDelay_demo.ino index 717a9a5..1f3618f 100644 --- a/examples/BA5_TGA_Pro_ExternalDelay_demo/BA5_TGA_Pro_ExternalDelay_demo.ino +++ b/examples/BA5_TGA_Pro_ExternalDelay_demo/BA5_TGA_Pro_ExternalDelay_demo.ino @@ -14,7 +14,8 @@ #include "BAGuitar.h" -using namespace BAGuitar; +using namespace BAEffects; +using namespace BALibrary; AudioInputI2S i2sIn; AudioOutputI2S i2sOut; diff --git a/examples/Delay/AnalogDelayDemo/AnalogDelayDemo.ino b/examples/Delay/AnalogDelayDemo/AnalogDelayDemo.ino index bb6a910..d057c5a 100644 --- a/examples/Delay/AnalogDelayDemo/AnalogDelayDemo.ino +++ b/examples/Delay/AnalogDelayDemo/AnalogDelayDemo.ino @@ -2,7 +2,8 @@ #include "BAGuitar.h" using namespace midi; -using namespace BAGuitar; +using namespace BAEffects; +using namespace BALibrary; AudioInputI2S i2sIn; AudioOutputI2S i2sOut; diff --git a/src/AudioEffectAnalogDelay.h b/src/AudioEffectAnalogDelay.h index 49b6e90..e094a8d 100644 --- a/src/AudioEffectAnalogDelay.h +++ b/src/AudioEffectAnalogDelay.h @@ -22,13 +22,13 @@ * along with this program. If not, see . *****************************************************************************/ -#ifndef __BAGUITAR_BAAUDIOEFFECTANALOGDELAY_H -#define __BAGUITAR_BAAUDIOEFFECTANALOGDELAY_H +#ifndef __BAEFFECTS_BAAUDIOEFFECTANALOGDELAY_H +#define __BAEFFECTS_BAAUDIOEFFECTANALOGDELAY_H #include #include "LibBasicFunctions.h" -namespace BAGuitar { +namespace BAEffects { /**************************************************************************//** * AudioEffectAnalogDelay models BBD based analog delays. It provides controls @@ -72,7 +72,7 @@ public: /// Construct an analog delay using external SPI via an ExtMemSlot. The amount of /// delay will be determined by the amount of memory in the slot. /// @param slot A pointer to the ExtMemSlot to use for the delay. - AudioEffectAnalogDelay(ExtMemSlot *slot); // requires sufficiently sized pre-allocated memory + AudioEffectAnalogDelay(BALibrary::ExtMemSlot *slot); // requires sufficiently sized pre-allocated memory virtual ~AudioEffectAnalogDelay(); ///< Destructor @@ -163,11 +163,11 @@ private: bool m_bypass = true; bool m_enable = false; bool m_externalMemory = false; - AudioDelay *m_memory = nullptr; + BALibrary::AudioDelay *m_memory = nullptr; size_t m_maxDelaySamples = 0; audio_block_t *m_previousBlock = nullptr; audio_block_t *m_blockToRelease = nullptr; - IirBiQuadFilterHQ *m_iir = nullptr; + BALibrary::IirBiQuadFilterHQ *m_iir = nullptr; // Controls int m_midiConfig[NUM_CONTROLS][2]; // stores the midi parameter mapping @@ -185,4 +185,4 @@ private: } -#endif /* __BAGUITAR_BAAUDIOEFFECTANALOGDELAY_H */ +#endif /* __BAEFFECTS_BAAUDIOEFFECTANALOGDELAY_H */ diff --git a/src/AudioEffectSOS.h b/src/AudioEffectSOS.h index 1a252a8..14b43bf 100644 --- a/src/AudioEffectSOS.h +++ b/src/AudioEffectSOS.h @@ -19,8 +19,8 @@ * along with this program. If not, see . *****************************************************************************/ -#ifndef __BAGUITAR_BAAUDIOEFFECTSOS_H -#define __BAGUITAR_BAAUDIOEFFECTSOS_H +#ifndef __BAEFFECTS_BAAUDIOEFFECTSOS_H +#define __BAEFFECTS_BAAUDIOEFFECTSOS_H #include #include "LibBasicFunctions.h" @@ -53,7 +53,7 @@ public: /// Construct an analog delay using external SPI via an ExtMemSlot. The amount of /// delay will be determined by the amount of memory in the slot. /// @param slot A pointer to the ExtMemSlot to use for the delay. - AudioEffectSOS(BAGuitar::ExtMemSlot *slot); // requires sufficiently sized pre-allocated memory + AudioEffectSOS(BALibrary::ExtMemSlot *slot); // requires sufficiently sized pre-allocated memory virtual ~AudioEffectSOS(); ///< Destructor @@ -116,7 +116,7 @@ private: bool m_isOmni = false; bool m_bypass = true; bool m_enable = false; - BAGuitar::AudioDelay *m_memory = nullptr; + BALibrary::AudioDelay *m_memory = nullptr; bool m_externalMemory = true; audio_block_t *m_previousBlock = nullptr; audio_block_t *m_blockToRelease = nullptr; @@ -133,7 +133,7 @@ private: // Automated Controls BALibrary::ParameterAutomationSequence m_inputGateAuto = - BALibrary::ParameterAutomationSequence(3); + BALibrary::ParameterAutomationSequence(3); // Private functions void m_preProcessing (audio_block_t *out, audio_block_t *input, audio_block_t *delayedSignal); @@ -142,4 +142,4 @@ private: } -#endif /* __BAGUITAR_BAAUDIOEFFECTANALOGDELAY_H */ +#endif /* __BAEFFECTS_BAAUDIOEFFECTSOS_H */ diff --git a/src/BAAudioControlWM8731.h b/src/BAAudioControlWM8731.h index 18b3de9..6a38797 100644 --- a/src/BAAudioControlWM8731.h +++ b/src/BAAudioControlWM8731.h @@ -22,10 +22,10 @@ * along with this program. If not, see . *****************************************************************************/ -#ifndef __BAGUITAR__BAAUDIOCONTROLWM8731_H -#define __BAGUITAR__BAAUDIOCONTROLWM8731_H +#ifndef __BALIBRARY_BAAUDIOCONTROLWM8731_H +#define __BALIBRARY_BAAUDIOCONTROLWM8731_H -namespace BAGuitar { +namespace BALibrary { constexpr int WM8731_NUM_REGS = 10; // Number of registers in the internal shadow array @@ -126,6 +126,6 @@ private: }; -} /* namespace BAGuitar */ +} /* namespace BALibrary */ -#endif /* __BAGUITAR__BAAUDIOCONTROLWM8731_H */ +#endif /* __BALIBRARY_BAAUDIOCONTROLWM8731_H */ diff --git a/src/BAAudioEffectDelayExternal.h b/src/BAAudioEffectDelayExternal.h index 587efbf..9e88b21 100644 --- a/src/BAAudioEffectDelayExternal.h +++ b/src/BAAudioEffectDelayExternal.h @@ -22,15 +22,15 @@ * along with this program. If not, see . *****************************************************************************/ -#ifndef __BAGUITAR_BAAUDIOEFFECTDELAYEXTERNAL_H -#define __BAGUITAR_BAAUDIOEFFECTDELAYEXTERNAL_H +#ifndef __BAEFFECTS_BAAUDIOEFFECTDELAYEXTERNAL_H +#define __BAEFFECTS_BAAUDIOEFFECTDELAYEXTERNAL_H #include #include "AudioStream.h" #include "BAHardware.h" -namespace BAGuitar { +namespace BAEffects { /**************************************************************************//** * BAAudioEffectDelayExternal can use external SPI RAM for delay rather than @@ -45,12 +45,12 @@ public: /// Specifiy which external memory to use /// @param type specify which memory to use - BAAudioEffectDelayExternal(BAGuitar::MemSelect type); + BAAudioEffectDelayExternal(BALibrary::MemSelect type); /// Specify external memory, and how much of the memory to use /// @param type specify which memory to use /// @param delayLengthMs maximum delay length in milliseconds - BAAudioEffectDelayExternal(BAGuitar::MemSelect type, float delayLengthMs); + BAAudioEffectDelayExternal(BALibrary::MemSelect type, float delayLengthMs); virtual ~BAAudioEffectDelayExternal(); /// set the actual amount of delay on a given delay tap @@ -67,7 +67,7 @@ public: static unsigned m_usingSPICount[2]; // internal use for all instances private: - void initialize(BAGuitar::MemSelect mem, unsigned delayLength = 1e6); + void initialize(BALibrary::MemSelect mem, unsigned delayLength = 1e6); void read(uint32_t address, uint32_t count, int16_t *data); void write(uint32_t address, uint32_t count, const int16_t *data); void zero(uint32_t address, uint32_t count); @@ -79,7 +79,7 @@ private: static unsigned m_allocated[2]; audio_block_t *m_inputQueueArray[1]; - BAGuitar::MemSelect m_mem; + BALibrary::MemSelect m_mem; SPIClass *m_spi = nullptr; int m_spiChannel = 0; int m_misoPin = 0; @@ -92,6 +92,6 @@ private: }; -} /* namespace BAGuitar */ +} /* namespace BAEffects */ -#endif /* __BAGUITAR_BAAUDIOEFFECTDELAYEXTERNAL_H */ +#endif /* __BAEFFECTS_BAAUDIOEFFECTDELAYEXTERNAL_H */ diff --git a/src/BAGpio.h b/src/BAGpio.h index 53ade35..f7766af 100644 --- a/src/BAGpio.h +++ b/src/BAGpio.h @@ -20,12 +20,12 @@ * along with this program. If not, see . *****************************************************************************/ -#ifndef __BAGUITAR_BAGPIO_H -#define __BAGUITAR_BAGPIO_H +#ifndef __BALIBRARY_BAGPIO_H +#define __BALIBRARY_BAGPIO_H #include "BAHardware.h" -namespace BAGuitar { +namespace BALibrary { /**************************************************************************//** * BAGpio provides a convince class to easily control the direction and state @@ -71,6 +71,6 @@ private: uint8_t m_ledState; }; -} /* namespace BAGuitar */ +} /* namespace BALibrary */ -#endif /* __BAGUITAR_BAGPIO_H */ +#endif /* __BALIBRARY_BAGPIO_H */ diff --git a/src/BAHardware.h b/src/BAHardware.h index bb3670d..a609731 100644 --- a/src/BAHardware.h +++ b/src/BAHardware.h @@ -20,15 +20,15 @@ * along with this program. If not, see . *****************************************************************************/ -#ifndef __BAGUTIAR_BAHARDWARE_H -#define __BAGUTIAR_BAHARDWARE_H +#ifndef __BALIBRARY_BAHARDWARE_H +#define __BALIBRARY_BAHARDWARE_H #include /**************************************************************************//** * BAGuitar is a namespace/Library for Guitar processing from Blackaddr Audio. *****************************************************************************/ -namespace BAGuitar { +namespace BALibrary { // uncomment the line that corresponds to your hardware #define TGA_PRO_REVA @@ -93,7 +93,7 @@ constexpr size_t SPI_MEM1_MAX_AUDIO_SAMPLES = SPI_MEM1_SIZE_BYTES/sizeof(int16_t #endif -} // namespace BAGuitar +} // namespace BALibrary -#endif /* __BAGUTIAR_BAHARDWARE_H */ +#endif /* __BALIBRARY_BAHARDWARE_H */ diff --git a/src/BASpiMemory.h b/src/BASpiMemory.h index d5395bb..92e83fc 100644 --- a/src/BASpiMemory.h +++ b/src/BASpiMemory.h @@ -20,8 +20,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . *****************************************************************************/ -#ifndef __BAGUITAR_BASPIMEMORY_H -#define __BAGUITAR_BASPIMEMORY_H +#ifndef __BALIBRARY_BASPIMEMORY_H +#define __BALIBRARY_BASPIMEMORY_H #include #include @@ -29,7 +29,7 @@ #include "BATypes.h" #include "BAHardware.h" -namespace BAGuitar { +namespace BALibrary { /**************************************************************************//** * This wrapper class uses the Arduino SPI (Wire) library to access the SPI ram. @@ -139,35 +139,41 @@ public: /// initialize and configure the SPI peripheral void begin() override; - /// Write a block of 8-bit data to the specified address + /// Write a block of 8-bit data to the specified address. Be check + /// isWriteBusy() before sending the next DMA transfer. /// @param address the address in the SPI RAM to write to /// @param src pointer to the source data block /// @param numBytes size of the data block in bytes void write(size_t address, uint8_t *src, size_t numBytes) override; - /// Write a block of zeros to the specified address + /// Write a block of zeros to the specified address. Be check + /// isWriteBusy() before sending the next DMA transfer. /// @param address the address in the SPI RAM to write to /// @param numBytes size of the data block in bytes void zero(size_t address, size_t numBytes) override; - /// Write a block of 16-bit data to the specified address + /// Write a block of 16-bit data to the specified address. Be check + /// isWriteBusy() before sending the next DMA transfer. /// @param address the address in the SPI RAM to write to /// @param src pointer to the source data block /// @param numWords size of the data block in 16-bit words void write16(size_t address, uint16_t *src, size_t numWords) override; - /// Write a block of 16-bit zeros to the specified address + /// Write a block of 16-bit zeros to the specified address. Be check + /// isWriteBusy() before sending the next DMA transfer. /// @param address the address in the SPI RAM to write to /// @param numWords size of the data block in 16-bit words void zero16(size_t address, size_t numWords) override; - /// Read a block of 8-bit data from the specified address + /// Read a block of 8-bit data from the specified address. Be check + /// isReadBusy() before sending the next DMA transfer. /// @param address the address in the SPI RAM to write to /// @param dest pointer to the destination /// @param numBytes size of the data block in bytes void read(size_t address, uint8_t *dest, size_t numBytes) override; - /// read a block 16-bit data word from the specified address + /// read a block 16-bit data word from the specified address. Be check + /// isReadBusy() before sending the next DMA transfer. /// @param address the address in the SPI RAM to read from /// @param dest the pointer to the destination /// @param numWords the number of 16-bit words to transfer @@ -210,6 +216,6 @@ private: }; -} /* namespace BAGuitar */ +} /* namespace BALibrary */ -#endif /* __BAGUITAR_BASPIMEMORY_H */ +#endif /* __BALIBRARY_BASPIMEMORY_H */ diff --git a/src/BATypes.h b/src/BATypes.h index 294cb42..01bdc1f 100644 --- a/src/BATypes.h +++ b/src/BATypes.h @@ -19,10 +19,10 @@ * along with this program. If not, see . *****************************************************************************/ -#ifndef __BAGUITAR_BATYPES_H -#define __BAGUITAR_BATYPES_H +#ifndef __BALIBRARY_BATYPES_H +#define __BALIBRARY_BATYPES_H -namespace BAGuitar { +namespace BALibrary { #define UNUSED(x) (void)(x) @@ -152,7 +152,7 @@ private: const size_t m_maxSize; ///< maximum size of the queue }; -} // BAGuitar +} // BALibrary -#endif /* __BAGUITAR_BATYPES_H */ +#endif /* __BALIBRARY_BATYPES_H */ diff --git a/src/LibBasicFunctions.h b/src/LibBasicFunctions.h index 381b2f8..25439c2 100644 --- a/src/LibBasicFunctions.h +++ b/src/LibBasicFunctions.h @@ -30,10 +30,10 @@ #include "BATypes.h" #include "LibMemoryManagement.h" -#ifndef __BAGUITAR_LIBBASICFUNCTIONS_H -#define __BAGUITAR_LIBBASICFUNCTIONS_H +#ifndef __BALIBRARY_LIBBASICFUNCTIONS_H +#define __BALIBRARY_LIBBASICFUNCTIONS_H -namespace BAGuitar { +namespace BALibrary { /**************************************************************************//** * QueuePosition is used for storing the index (in an array of queues) and the @@ -134,7 +134,7 @@ public: /// @param maxDelayTimeMs max length of time you want in the buffer specified in milliseconds AudioDelay(float maxDelayTimeMs); - /// Construct an audio buffer using a slot configured with the BAGuitar::ExternalSramManager + /// Construct an audio buffer using a slot configured with the BALibrary::ExternalSramManager /// @param slot a pointer to the slot representing the memory you wish to use for the buffer. AudioDelay(ExtMemSlot *slot); @@ -312,7 +312,7 @@ private: }; -} // namespace BAGuitar +} // namespace BALibrary namespace BALibrary { @@ -399,4 +399,4 @@ private: } // BALibrary -#endif /* __BAGUITAR_LIBBASICFUNCTIONS_H */ +#endif /* __BALIBRARY_LIBBASICFUNCTIONS_H */ diff --git a/src/LibMemoryManagement.h b/src/LibMemoryManagement.h index bb450d1..288e581 100644 --- a/src/LibMemoryManagement.h +++ b/src/LibMemoryManagement.h @@ -26,15 +26,15 @@ * along with this program. If not, see . *****************************************************************************/ -#ifndef __BAGUITAR_LIBMEMORYMANAGEMENT_H -#define __BAGUITAR_LIBMEMORYMANAGEMENT_H +#ifndef __BALIBRARY_LIBMEMORYMANAGEMENT_H +#define __BALIBRARY_LIBMEMORYMANAGEMENT_H #include #include "BAHardware.h" #include "BASpiMemory.h" -namespace BAGuitar { +namespace BALibrary { /**************************************************************************//** * MemConfig contains the configuration information associated with a particular @@ -182,7 +182,7 @@ public: /// @details note that currently, memory cannot be allocated. /// @param mem specifies which memory to query, default is memory 0 /// @returns the available memory in bytes - size_t availableMemory(BAGuitar::MemSelect mem = BAGuitar::MemSelect::MEM0); + size_t availableMemory(BALibrary::MemSelect mem = BALibrary::MemSelect::MEM0); /// Request memory be allocated for the provided slot /// @param slot a pointer to the global slot object to which memory will be allocated @@ -190,7 +190,7 @@ public: /// @param mem specify which external memory to allocate from /// @param useDma when true, DMA is used for SPI port, else transfers block until complete /// @returns true on success, otherwise false on error - bool requestMemory(ExtMemSlot *slot, float delayMilliseconds, BAGuitar::MemSelect mem = BAGuitar::MemSelect::MEM0, bool useDma = false); + bool requestMemory(ExtMemSlot *slot, float delayMilliseconds, BALibrary::MemSelect mem = BALibrary::MemSelect::MEM0, bool useDma = false); /// Request memory be allocated for the provided slot /// @param slot a pointer to the global slot object to which memory will be allocated @@ -198,15 +198,15 @@ public: /// @param mem specify which external memory to allocate from /// @param useDma when true, DMA is used for SPI port, else transfers block until complete /// @returns true on success, otherwise false on error - bool requestMemory(ExtMemSlot *slot, size_t sizeBytes, BAGuitar::MemSelect mem = BAGuitar::MemSelect::MEM0, bool useDma = false); + bool requestMemory(ExtMemSlot *slot, size_t sizeBytes, BALibrary::MemSelect mem = BALibrary::MemSelect::MEM0, bool useDma = false); private: static bool m_configured; ///< there should only be one instance of ExternalSramManager in the whole project - static MemConfig m_memConfig[BAGuitar::NUM_MEM_SLOTS]; ///< store the configuration information for each external memory + static MemConfig m_memConfig[BALibrary::NUM_MEM_SLOTS]; ///< store the configuration information for each external memory }; -} +} // BALibrary -#endif /* __LIBMEMORYMANAGEMENT_H */ +#endif /* __BALIBRARY_LIBMEMORYMANAGEMENT_H */ diff --git a/src/common/AudioDelay.cpp b/src/common/AudioDelay.cpp index f830cc4..9fec4ea 100644 --- a/src/common/AudioDelay.cpp +++ b/src/common/AudioDelay.cpp @@ -21,7 +21,7 @@ #include "Audio.h" #include "LibBasicFunctions.h" -namespace BAGuitar { +namespace BALibrary { //////////////////////////////////////////////////// // AudioDelay diff --git a/src/common/AudioHelpers.cpp b/src/common/AudioHelpers.cpp index 785e5db..49e2a31 100644 --- a/src/common/AudioHelpers.cpp +++ b/src/common/AudioHelpers.cpp @@ -21,7 +21,7 @@ #include "Audio.h" #include "LibBasicFunctions.h" -namespace BAGuitar { +namespace BALibrary { size_t calcAudioSamples(float milliseconds) { diff --git a/src/common/ExtMemSlot.cpp b/src/common/ExtMemSlot.cpp index 57385d7..c857cbe 100644 --- a/src/common/ExtMemSlot.cpp +++ b/src/common/ExtMemSlot.cpp @@ -23,7 +23,7 @@ #include "Audio.h" #include "LibMemoryManagement.h" -namespace BAGuitar { +namespace BALibrary { ///////////////////////////////////////////////////////////////////////////// // MEM SLOT diff --git a/src/common/ExternalSramManager.cpp b/src/common/ExternalSramManager.cpp index 98465fc..7083e0c 100644 --- a/src/common/ExternalSramManager.cpp +++ b/src/common/ExternalSramManager.cpp @@ -23,13 +23,13 @@ #include "Audio.h" #include "LibMemoryManagement.h" -namespace BAGuitar { +namespace BALibrary { ///////////////////////////////////////////////////////////////////////////// // EXTERNAL SRAM MANAGER ///////////////////////////////////////////////////////////////////////////// bool ExternalSramManager::m_configured = false; -MemConfig ExternalSramManager::m_memConfig[BAGuitar::NUM_MEM_SLOTS]; +MemConfig ExternalSramManager::m_memConfig[BALibrary::NUM_MEM_SLOTS]; ExternalSramManager::ExternalSramManager(unsigned numMemories) @@ -60,19 +60,19 @@ ExternalSramManager::~ExternalSramManager() } } -size_t ExternalSramManager::availableMemory(BAGuitar::MemSelect mem) +size_t ExternalSramManager::availableMemory(BALibrary::MemSelect mem) { return m_memConfig[mem].totalAvailable; } -bool ExternalSramManager::requestMemory(ExtMemSlot *slot, float delayMilliseconds, BAGuitar::MemSelect mem, bool useDma) +bool ExternalSramManager::requestMemory(ExtMemSlot *slot, float delayMilliseconds, BALibrary::MemSelect mem, bool useDma) { // convert the time to numer of samples size_t delayLengthInt = (size_t)((delayMilliseconds*(AUDIO_SAMPLE_RATE_EXACT/1000.0f))+0.5f); return requestMemory(slot, delayLengthInt * sizeof(int16_t), mem, useDma); } -bool ExternalSramManager::requestMemory(ExtMemSlot *slot, size_t sizeBytes, BAGuitar::MemSelect mem, bool useDma) +bool ExternalSramManager::requestMemory(ExtMemSlot *slot, size_t sizeBytes, BALibrary::MemSelect mem, bool useDma) { if (m_memConfig[mem].totalAvailable >= sizeBytes) { @@ -86,10 +86,10 @@ bool ExternalSramManager::requestMemory(ExtMemSlot *slot, size_t sizeBytes, BAGu if (!m_memConfig[mem].m_spi) { if (useDma) { - m_memConfig[mem].m_spi = new BAGuitar::BASpiMemoryDMA(static_cast(mem)); + m_memConfig[mem].m_spi = new BALibrary::BASpiMemoryDMA(static_cast(mem)); slot->m_useDma = true; } else { - m_memConfig[mem].m_spi = new BAGuitar::BASpiMemory(static_cast(mem)); + m_memConfig[mem].m_spi = new BALibrary::BASpiMemory(static_cast(mem)); slot->m_useDma = false; } if (!m_memConfig[mem].m_spi) { diff --git a/src/common/IirBiquadFilter.cpp b/src/common/IirBiquadFilter.cpp index f2ae1c7..82eec80 100644 --- a/src/common/IirBiquadFilter.cpp +++ b/src/common/IirBiquadFilter.cpp @@ -21,7 +21,7 @@ #include "Audio.h" #include "LibBasicFunctions.h" -namespace BAGuitar { +namespace BALibrary { //////////////////////////////////////////////////// // IirBiQuadFilter diff --git a/src/common/ParameterAutomation.cpp b/src/common/ParameterAutomation.cpp index deb9c3d..bc3e4d2 100644 --- a/src/common/ParameterAutomation.cpp +++ b/src/common/ParameterAutomation.cpp @@ -20,8 +20,6 @@ #include "LibBasicFunctions.h" -using namespace BAGuitar; - namespace BALibrary { /////////////////////////////////////////////////////////////////////////////// diff --git a/src/effects/AudioEffectAnalogDelay.cpp b/src/effects/AudioEffectAnalogDelay.cpp index 5a15d4d..52a0438 100644 --- a/src/effects/AudioEffectAnalogDelay.cpp +++ b/src/effects/AudioEffectAnalogDelay.cpp @@ -8,7 +8,9 @@ #include "AudioEffectAnalogDelayFilters.h" #include "AudioEffectAnalogDelay.h" -namespace BAGuitar { +using namespace BALibrary; + +namespace BAEffects { constexpr int MIDI_CHANNEL = 0; constexpr int MIDI_CONTROL = 1; diff --git a/src/effects/AudioEffectAnalogDelayFilters.h b/src/effects/AudioEffectAnalogDelayFilters.h index 71f70bd..473f9cd 100644 --- a/src/effects/AudioEffectAnalogDelayFilters.h +++ b/src/effects/AudioEffectAnalogDelayFilters.h @@ -21,7 +21,7 @@ *****************************************************************************/ #include -namespace BAGuitar { +namespace BAEffects { // The number of stages in the analog-response Biquad filter constexpr unsigned MAX_NUM_FILTER_STAGES = 4; diff --git a/src/effects/AudioEffectSOS.cpp b/src/effects/AudioEffectSOS.cpp index 594fd6d..40ae3a6 100644 --- a/src/effects/AudioEffectSOS.cpp +++ b/src/effects/AudioEffectSOS.cpp @@ -8,7 +8,6 @@ #include "AudioEffectSOS.h" #include "LibBasicFunctions.h" -using namespace BAGuitar; using namespace BALibrary; namespace BAEffects { diff --git a/src/effects/BAAudioEffectDelayExternal.cpp b/src/effects/BAAudioEffectDelayExternal.cpp index acdf3d2..1f1c215 100644 --- a/src/effects/BAAudioEffectDelayExternal.cpp +++ b/src/effects/BAAudioEffectDelayExternal.cpp @@ -20,7 +20,9 @@ #include "BAAudioEffectDelayExternal.h" -namespace BAGuitar { +using namespace BALibrary; + +namespace BAEffects { #define SPISETTING SPISettings(20000000, MSBFIRST, SPI_MODE0) @@ -49,7 +51,7 @@ BAAudioEffectDelayExternal::BAAudioEffectDelayExternal(MemSelect mem) initialize(mem); } -BAAudioEffectDelayExternal::BAAudioEffectDelayExternal(BAGuitar::MemSelect type, float delayLengthMs) +BAAudioEffectDelayExternal::BAAudioEffectDelayExternal(BALibrary::MemSelect type, float delayLengthMs) : AudioStream(1, m_inputQueueArray) { unsigned delayLengthInt = (delayLengthMs*(AUDIO_SAMPLE_RATE_EXACT/1000.0f))+0.5f; @@ -289,4 +291,4 @@ inline void BAAudioEffectDelayExternal::m_stopUsingSPI(int spiBus) { #endif -} /* namespace BAGuitar */ +} /* namespace BAEffects */ diff --git a/src/peripherals/BAAudioControlWM8731.cpp b/src/peripherals/BAAudioControlWM8731.cpp index f5b2ae4..e1960e3 100644 --- a/src/peripherals/BAAudioControlWM8731.cpp +++ b/src/peripherals/BAAudioControlWM8731.cpp @@ -21,7 +21,7 @@ #include #include "BAAudioControlWM8731.h" -namespace BAGuitar { +namespace BALibrary { // use const instead of define for proper scoping constexpr int WM8731_I2C_ADDR = 0x1A; @@ -341,4 +341,4 @@ bool BAAudioControlWM8731::write(unsigned int reg, unsigned int val) return true; } -} /* namespace BAGuitar */ +} /* namespace BALibrary */ diff --git a/src/peripherals/BAGpio.cpp b/src/peripherals/BAGpio.cpp index ccf09c4..e2d3c79 100644 --- a/src/peripherals/BAGpio.cpp +++ b/src/peripherals/BAGpio.cpp @@ -21,7 +21,7 @@ #include "Arduino.h" #include "BAGpio.h" -namespace BAGuitar { +namespace BALibrary { BAGpio::BAGpio() { @@ -85,4 +85,4 @@ int BAGpio::toggleLed() } -} /* namespace BAGuitar */ +} /* namespace BALibrary */ diff --git a/src/peripherals/BASpiMemory.cpp b/src/peripherals/BASpiMemory.cpp index 05d006d..d91d7a7 100644 --- a/src/peripherals/BASpiMemory.cpp +++ b/src/peripherals/BASpiMemory.cpp @@ -21,7 +21,7 @@ #include "Arduino.h" #include "BASpiMemory.h" -namespace BAGuitar { +namespace BALibrary { // MEM0 Settings constexpr int SPI_CS_MEM0 = 15; @@ -468,4 +468,4 @@ bool BASpiMemoryDMA::isReadBusy(void) const return (m_rxTransfer[0].busy() or m_rxTransfer[1].busy()); } -} /* namespace BAGuitar */ +} /* namespace BALibrary */