├── .clang-format ├── .devcontainer └── devcontainer.json ├── .github └── workflows │ ├── build.yml │ ├── clang-format-check.yml │ └── ghpages-hosting-merge.yml ├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── docs ├── BUILD-portable.md ├── BUILD.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── DEV.md ├── RELEASES.md └── img │ ├── DIY_schematic.png │ ├── all-done.jpg │ ├── back-look.jpg │ ├── component_placement.jpg │ ├── components-portable.jpg │ ├── components.jpg │ ├── final.jpg │ ├── keynames.jpg │ ├── keypad-back.jpg │ ├── keypad-front.jpg │ ├── m8-style-keymap.png │ ├── main-done.jpg │ ├── pcm5102.jpg │ ├── pico-style-keymap.png │ └── picotracker-ports-1.png ├── doxygen └── Doxyfile ├── fritzing ├── parts │ ├── 2.8 SPI TFT Module.fzpz │ ├── AUDIO_I2S_DAC_GY_PCM5102.svg │ ├── Adafruit MIDI FeatherWing Kit.fzpz │ ├── Adafruit SDIO microSD Breakout.fzpz │ ├── Cherry MX Blue.fzpz │ ├── Pico-R3-Fritzing-official.fzpz │ ├── PicoH-Fritzing-SMD.fzpz │ └── PicoW-Fritzing-official.fzpz └── picoTracker.fzz ├── sources ├── Adapters │ └── picoTracker │ │ ├── CMakeLists.txt │ │ ├── audio │ │ ├── CMakeLists.txt │ │ ├── audio_i2s.pio │ │ ├── picoTrackerAudio.cpp │ │ ├── picoTrackerAudio.h │ │ ├── picoTrackerAudioDriver.cpp │ │ └── picoTrackerAudioDriver.h │ │ ├── display │ │ ├── CMakeLists.txt │ │ ├── chargfx.c │ │ ├── chargfx.h │ │ ├── font.h │ │ ├── ili9341.c │ │ └── ili9341.h │ │ ├── filesystem │ │ ├── CMakeLists.txt │ │ ├── picoTrackerFileSystem.cpp │ │ └── picoTrackerFileSystem.h │ │ ├── gui │ │ ├── CMakeLists.txt │ │ ├── GUIFactory.cpp │ │ ├── GUIFactory.h │ │ ├── SerialDebugUI.cpp │ │ ├── SerialDebugUI.h │ │ ├── picoRemoteUI.cpp │ │ ├── picoRemoteUI.h │ │ ├── picoTrackerEventManager.cpp │ │ ├── picoTrackerEventManager.h │ │ ├── picoTrackerGUIWindowImp.cpp │ │ └── picoTrackerGUIWindowImp.h │ │ ├── main │ │ ├── CMakeLists.txt │ │ └── picoTrackerMain.cpp │ │ ├── midi │ │ ├── CMakeLists.txt │ │ ├── picoTrackerMidiInDevice.cpp │ │ ├── picoTrackerMidiInDevice.h │ │ ├── picoTrackerMidiOutDevice.cpp │ │ ├── picoTrackerMidiOutDevice.h │ │ ├── picoTrackerMidiService.cpp │ │ ├── picoTrackerMidiService.h │ │ ├── picoTrackerUSBMidiInDevice.cpp │ │ ├── picoTrackerUSBMidiInDevice.h │ │ ├── picoTrackerUSBMidiOutDevice.cpp │ │ └── picoTrackerUSBMidiOutDevice.h │ │ ├── mutex │ │ ├── CMakeLists.txt │ │ ├── picoTrackerMutex.cpp │ │ └── picoTrackerMutex.h │ │ ├── platform │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── gpio.h │ │ ├── platform.cpp │ │ ├── platform.h │ │ └── tusb_config.h │ │ ├── sdcard │ │ ├── CMakeLists.txt │ │ ├── sd_card_sdio.cpp │ │ ├── sdcard.h │ │ ├── sdio.cpp │ │ ├── sdio.h │ │ └── sdio.pio │ │ ├── system │ │ ├── CMakeLists.txt │ │ ├── critical_error_message.c │ │ ├── critical_error_message.h │ │ ├── input.cpp │ │ ├── input.h │ │ ├── picoTrackerEventQueue.cpp │ │ ├── picoTrackerEventQueue.h │ │ ├── picoTrackerSamplePool.cpp │ │ ├── picoTrackerSamplePool.h │ │ ├── picoTrackerSystem.cpp │ │ └── picoTrackerSystem.h │ │ ├── timer │ │ ├── CMakeLists.txt │ │ ├── picoTrackerTimer.cpp │ │ └── picoTrackerTimer.h │ │ ├── usb │ │ ├── CMakeLists.txt │ │ ├── usb_descriptors.c │ │ ├── usb_utils.cpp │ │ └── usb_utils.h │ │ └── utils │ │ ├── CMakeLists.txt │ │ ├── utils.cpp │ │ └── utils.h ├── Application │ ├── AppWindow.cpp │ ├── AppWindow.h │ ├── Application.cpp │ ├── Application.h │ ├── Audio │ │ ├── AudioFileStreamer.cpp │ │ ├── AudioFileStreamer.h │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── Commands │ │ ├── ApplicationCommandDispatcher.cpp │ │ ├── ApplicationCommandDispatcher.h │ │ ├── CMakeLists.txt │ │ ├── EventDispatcher.cpp │ │ ├── EventDispatcher.h │ │ └── NodeList.h │ ├── Controllers │ │ ├── CMakeLists.txt │ │ ├── ControlRoom.cpp │ │ └── ControlRoom.h │ ├── Instruments │ │ ├── CMakeLists.txt │ │ ├── CommandList.cpp │ │ ├── CommandList.h │ │ ├── Filters.cpp │ │ ├── Filters.h │ │ ├── I_Instrument.cpp │ │ ├── I_Instrument.h │ │ ├── I_SRPUpdater.h │ │ ├── InstrumentBank.cpp │ │ ├── InstrumentBank.h │ │ ├── InstrumentNameVariable.cpp │ │ ├── InstrumentNameVariable.h │ │ ├── MacroInstrument.cpp │ │ ├── MacroInstrument.h │ │ ├── MidiInstrument.cpp │ │ ├── MidiInstrument.h │ │ ├── NoneInstrument.cpp │ │ ├── NoneInstrument.h │ │ ├── OpalInstrument.cpp │ │ ├── OpalInstrument.h │ │ ├── SIDInstrument.cpp │ │ ├── SIDInstrument.h │ │ ├── SRPUpdaters.cpp │ │ ├── SRPUpdaters.h │ │ ├── SampleInstrument.cpp │ │ ├── SampleInstrument.h │ │ ├── SampleInstrumentDatas.h │ │ ├── SamplePool.cpp │ │ ├── SamplePool.h │ │ ├── SampleRenderingParams.h │ │ ├── SampleVariable.cpp │ │ ├── SampleVariable.h │ │ ├── SoundSource.cpp │ │ ├── SoundSource.h │ │ ├── WavFile.cpp │ │ ├── WavFile.h │ │ ├── WavFileWriter.cpp │ │ └── WavFileWriter.h │ ├── Mixer │ │ ├── CMakeLists.txt │ │ ├── MixBus.cpp │ │ ├── MixBus.h │ │ ├── MixerService.cpp │ │ └── MixerService.h │ ├── Model │ │ ├── BuildNumber.h │ │ ├── CMakeLists.txt │ │ ├── Chain.cpp │ │ ├── Chain.h │ │ ├── Config.cpp │ │ ├── Config.h │ │ ├── Groove.cpp │ │ ├── Groove.h │ │ ├── Mixer.cpp │ │ ├── Mixer.h │ │ ├── Phrase.cpp │ │ ├── Phrase.h │ │ ├── Project.cpp │ │ ├── Project.h │ │ ├── Scale.cpp │ │ ├── Scale.h │ │ ├── Song.cpp │ │ ├── Song.h │ │ ├── Table.cpp │ │ ├── Table.h │ │ └── ThemeConstants.h │ ├── Persistency │ │ ├── CMakeLists.txt │ │ ├── PersistenceConstants.h │ │ ├── PersistencyDocument.cpp │ │ ├── PersistencyDocument.h │ │ ├── PersistencyService.cpp │ │ ├── PersistencyService.h │ │ ├── Persistent.cpp │ │ └── Persistent.h │ ├── Player │ │ ├── CMakeLists.txt │ │ ├── Player.cpp │ │ ├── Player.h │ │ ├── PlayerChannel.cpp │ │ ├── PlayerChannel.h │ │ ├── PlayerMixer.cpp │ │ ├── PlayerMixer.h │ │ ├── SyncMaster.cpp │ │ ├── SyncMaster.h │ │ ├── TablePlayback.cpp │ │ └── TablePlayback.h │ ├── Utils │ │ ├── CMakeLists.txt │ │ ├── HelpLegend.h │ │ ├── HexBuffers.cpp │ │ ├── HexBuffers.h │ │ ├── bit.h │ │ ├── char.cpp │ │ ├── char.h │ │ ├── fixed.cpp │ │ ├── fixed.h │ │ ├── mathutils.h │ │ ├── randomnames.h │ │ ├── stringutils.cpp │ │ └── stringutils.h │ └── Views │ │ ├── BaseClasses │ │ ├── CMakeLists.txt │ │ ├── I_Action.cpp │ │ ├── I_Action.h │ │ ├── ModalView.cpp │ │ ├── ModalView.h │ │ ├── UIActionField.cpp │ │ ├── UIActionField.h │ │ ├── UIBigHexVarField.cpp │ │ ├── UIBigHexVarField.h │ │ ├── UIBitmaskVarField.cpp │ │ ├── UIBitmaskVarField.h │ │ ├── UIField.cpp │ │ ├── UIField.h │ │ ├── UIIntField.cpp │ │ ├── UIIntField.h │ │ ├── UIIntVarField.cpp │ │ ├── UIIntVarField.h │ │ ├── UIIntVarOffField.cpp │ │ ├── UIIntVarOffField.h │ │ ├── UINoteVarField.cpp │ │ ├── UINoteVarField.h │ │ ├── UISortedVarList.cpp │ │ ├── UISortedVarList.h │ │ ├── UIStaticField.cpp │ │ ├── UIStaticField.h │ │ ├── UISwatchField.cpp │ │ ├── UISwatchField.h │ │ ├── UITempoField.cpp │ │ ├── UITempoField.h │ │ ├── UITextField.h │ │ ├── UITextField.ipp │ │ ├── View.cpp │ │ ├── View.h │ │ ├── ViewEvent.cpp │ │ └── ViewEvent.h │ │ ├── CMakeLists.txt │ │ ├── ChainView.cpp │ │ ├── ChainView.h │ │ ├── ConsoleView.cpp │ │ ├── ConsoleView.h │ │ ├── DeviceView.cpp │ │ ├── DeviceView.h │ │ ├── FieldView.cpp │ │ ├── FieldView.h │ │ ├── GrooveView.cpp │ │ ├── GrooveView.h │ │ ├── ImportView.cpp │ │ ├── ImportView.h │ │ ├── InstrumentImportView.cpp │ │ ├── InstrumentImportView.h │ │ ├── InstrumentView.cpp │ │ ├── InstrumentView.h │ │ ├── MixerView.cpp │ │ ├── MixerView.h │ │ ├── ModalDialogs │ │ ├── CMakeLists.txt │ │ ├── MessageBox.cpp │ │ ├── MessageBox.h │ │ ├── RenderProgressModal.cpp │ │ ├── RenderProgressModal.h │ │ ├── TextInputModalView.cpp │ │ └── TextInputModalView.h │ │ ├── NullView.cpp │ │ ├── NullView.h │ │ ├── PhraseView.cpp │ │ ├── PhraseView.h │ │ ├── ProjectView.cpp │ │ ├── ProjectView.h │ │ ├── ScreenView.cpp │ │ ├── ScreenView.h │ │ ├── SelectProjectView.cpp │ │ ├── SelectProjectView.h │ │ ├── SongView.cpp │ │ ├── SongView.h │ │ ├── TableView.cpp │ │ ├── TableView.h │ │ ├── ThemeImportView.cpp │ │ ├── ThemeImportView.h │ │ ├── ThemeView.cpp │ │ ├── ThemeView.h │ │ ├── UIController.cpp │ │ ├── UIController.h │ │ ├── ViewData.cpp │ │ └── ViewData.h ├── CMakeLists.txt ├── Externals │ ├── CMakeLists.txt │ ├── SdFat │ │ ├── CMakeLists.txt │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── doc │ │ │ ├── Doxyfile │ │ │ ├── SdErrorCodes.txt │ │ │ ├── SdFat.html │ │ │ ├── ZipMsg │ │ │ │ └── index.html │ │ │ ├── clean_html.bat │ │ │ ├── del_html.bat │ │ │ ├── html.zip │ │ │ ├── html │ │ │ │ └── index.html │ │ │ └── mainpage.h │ │ ├── examples │ │ │ ├── AvrAdcLogger │ │ │ │ ├── AvrAdcLogger.h │ │ │ │ └── AvrAdcLogger.ino │ │ │ ├── BackwardCompatibility │ │ │ │ └── BackwardCompatibility.ino │ │ │ ├── BufferedPrint │ │ │ │ └── BufferedPrint.ino │ │ │ ├── DirectoryFunctions │ │ │ │ └── DirectoryFunctions.ino │ │ │ ├── ExFatLogger │ │ │ │ ├── ExFatLogger.h │ │ │ │ └── ExFatLogger.ino │ │ │ ├── MinimumSizeSdReader │ │ │ │ └── MinimumSizeSdReader.ino │ │ │ ├── OpenNext │ │ │ │ └── OpenNext.ino │ │ │ ├── QuickStart │ │ │ │ └── QuickStart.ino │ │ │ ├── ReadCsvFile │ │ │ │ └── ReadCsvFile.ino │ │ │ ├── RtcTimestampTest │ │ │ │ └── RtcTimestampTest.ino │ │ │ ├── SdErrorCodes │ │ │ │ └── SdErrorCodes.ino │ │ │ ├── SdFormatter │ │ │ │ └── SdFormatter.ino │ │ │ ├── SdInfo │ │ │ │ └── SdInfo.ino │ │ │ ├── SoftwareSpi │ │ │ │ └── SoftwareSpi.ino │ │ │ ├── TeensyDmaAdcLogger │ │ │ │ └── TeensyDmaAdcLogger.ino │ │ │ ├── TeensyRtcTimestamp │ │ │ │ └── TeensyRtcTimestamp.ino │ │ │ ├── TeensySdioDemo │ │ │ │ └── TeensySdioDemo.ino │ │ │ ├── TeensySdioLogger │ │ │ │ └── TeensySdioLogger.ino │ │ │ ├── UnicodeFilenames │ │ │ │ └── UnicodeFilenames.ino │ │ │ ├── UserChipSelectFunction │ │ │ │ └── UserChipSelectFunction.ino │ │ │ ├── UserSPIDriver │ │ │ │ └── UserSPIDriver.ino │ │ │ ├── bench │ │ │ │ └── bench.ino │ │ │ ├── examplesV1 │ │ │ │ ├── #attic │ │ │ │ │ ├── AnalogLogger │ │ │ │ │ │ └── AnalogLogger.ino │ │ │ │ │ ├── BaseExtCaseTest │ │ │ │ │ │ └── BaseExtCaseTest.ino │ │ │ │ │ ├── HelloWorld │ │ │ │ │ │ └── HelloWorld.ino │ │ │ │ │ ├── MiniSerial │ │ │ │ │ │ └── MiniSerial.ino │ │ │ │ │ ├── PrintBenchmarkSD │ │ │ │ │ │ └── PrintBenchmarkSD.ino │ │ │ │ │ ├── SD_Size │ │ │ │ │ │ └── SD_Size.ino │ │ │ │ │ ├── SdFatSize │ │ │ │ │ │ └── SdFatSize.ino │ │ │ │ │ ├── StreamParseInt │ │ │ │ │ │ └── StreamParseInt.ino │ │ │ │ │ ├── append │ │ │ │ │ │ └── append.ino │ │ │ │ │ ├── average │ │ │ │ │ │ └── average.ino │ │ │ │ │ ├── benchSD │ │ │ │ │ │ └── benchSD.ino │ │ │ │ │ ├── bufstream │ │ │ │ │ │ └── bufstream.ino │ │ │ │ │ ├── cin_cout │ │ │ │ │ │ └── cin_cout.ino │ │ │ │ │ ├── eventlog │ │ │ │ │ │ └── eventlog.ino │ │ │ │ │ ├── fgetsRewrite │ │ │ │ │ │ └── fgetsRewrite.ino │ │ │ │ │ ├── readlog │ │ │ │ │ │ └── readlog.ino │ │ │ │ │ └── readme.txt │ │ │ │ ├── AnalogBinLogger │ │ │ │ │ ├── AnalogBinLogger.h │ │ │ │ │ └── AnalogBinLogger.ino │ │ │ │ ├── LongFileName │ │ │ │ │ ├── LongFileName.ino │ │ │ │ │ └── testFiles │ │ │ │ │ │ ├── A long name can be 255 characters.txt │ │ │ │ │ │ ├── LFN,NAME.TXT │ │ │ │ │ │ ├── MIXCASE.txt │ │ │ │ │ │ ├── Not_8_3.txt │ │ │ │ │ │ ├── OK%83.TXT │ │ │ │ │ │ ├── STD_8_3.TXT │ │ │ │ │ │ ├── With Blank.txt │ │ │ │ │ │ ├── With.Two dots.txt │ │ │ │ │ │ ├── lower.txt │ │ │ │ │ │ └── mixed.TXT │ │ │ │ ├── LowLatencyLogger │ │ │ │ │ ├── LowLatencyLogger.ino │ │ │ │ │ ├── UserFunctions.cpp │ │ │ │ │ └── UserTypes.h │ │ │ │ ├── LowLatencyLoggerADXL345 │ │ │ │ │ ├── LowLatencyLogger.ino │ │ │ │ │ ├── LowLatencyLoggerADXL345.ino │ │ │ │ │ ├── UserFunctions.cpp │ │ │ │ │ ├── UserTypes.h │ │ │ │ │ └── readme.txt │ │ │ │ ├── LowLatencyLoggerMPU6050 │ │ │ │ │ ├── LowLatencyLogger.ino │ │ │ │ │ ├── LowLatencyLoggerMPU6050.ino │ │ │ │ │ ├── UserFunctions.cpp │ │ │ │ │ └── UserTypes.h │ │ │ │ ├── PrintBenchmark │ │ │ │ │ └── PrintBenchmark.ino │ │ │ │ ├── RawWrite │ │ │ │ │ └── RawWrite.ino │ │ │ │ ├── ReadCsv │ │ │ │ │ └── ReadCsv.ino │ │ │ │ ├── ReadCsvArray │ │ │ │ │ └── ReadCsvArray.ino │ │ │ │ ├── ReadCsvStream │ │ │ │ │ └── ReadCsvStream.ino │ │ │ │ ├── ReadWrite │ │ │ │ │ └── ReadWrite.ino │ │ │ │ ├── STM32Test │ │ │ │ │ └── STM32Test.ino │ │ │ │ ├── StdioBench │ │ │ │ │ └── StdioBench.ino │ │ │ │ ├── Timestamp │ │ │ │ │ └── Timestamp.ino │ │ │ │ ├── TwoCards │ │ │ │ │ └── TwoCards.ino │ │ │ │ ├── VolumeFreeSpace │ │ │ │ │ └── VolumeFreeSpace.ino │ │ │ │ ├── dataLogger │ │ │ │ │ └── dataLogger.ino │ │ │ │ ├── fgets │ │ │ │ │ └── fgets.ino │ │ │ │ ├── formatting │ │ │ │ │ └── formatting.ino │ │ │ │ ├── getline │ │ │ │ │ └── getline.ino │ │ │ │ └── wipe │ │ │ │ │ └── wipe.ino │ │ │ └── rename │ │ │ │ └── rename.ino │ │ ├── extras │ │ │ ├── USB_Host_Shield │ │ │ │ ├── USB_Host_Shield_2.0.zip │ │ │ │ ├── UsbHostShieldDiff.txt │ │ │ │ └── readme.txt │ │ │ ├── attic │ │ │ │ ├── PrintBasic.cpp │ │ │ │ ├── PrintBasic.h │ │ │ │ ├── PrintTemplates.h │ │ │ │ └── SysCallBareUno.cpp │ │ │ ├── cpplint.bat │ │ │ ├── cpplint.py │ │ │ └── cpplint.sh │ │ ├── library.properties │ │ └── src │ │ │ ├── BufferedPrint.h │ │ │ ├── CMakeLists.txt │ │ │ ├── DigitalIO │ │ │ ├── DigitalPin.h │ │ │ ├── SoftSPI.h │ │ │ ├── boards │ │ │ │ ├── AvrDevelopersGpioPinMap.h │ │ │ │ ├── BobuinoGpioPinMap.h │ │ │ │ ├── GpioPinMap.h │ │ │ │ ├── LeonardoGpioPinMap.h │ │ │ │ ├── MegaGpioPinMap.h │ │ │ │ ├── SleepingBeautyGpioPinMap.h │ │ │ │ ├── Standard1284GpioPinMap.h │ │ │ │ ├── Teensy2GpioPinMap.h │ │ │ │ ├── Teensy2ppGpioPinMap.h │ │ │ │ └── UnoGpioPinMap.h │ │ │ └── readme.txt │ │ │ ├── ExFatLib │ │ │ ├── CMakeLists.txt │ │ │ ├── ExFatConfig.h │ │ │ ├── ExFatDbg.cpp │ │ │ ├── ExFatFile.cpp │ │ │ ├── ExFatFile.h │ │ │ ├── ExFatFilePrint.cpp │ │ │ ├── ExFatFileWrite.cpp │ │ │ ├── ExFatFormatter.cpp │ │ │ ├── ExFatFormatter.h │ │ │ ├── ExFatLib.h │ │ │ ├── ExFatName.cpp │ │ │ ├── ExFatPartition.cpp │ │ │ ├── ExFatPartition.h │ │ │ ├── ExFatVolume.cpp │ │ │ └── ExFatVolume.h │ │ │ ├── FatLib │ │ │ ├── CMakeLists.txt │ │ │ ├── FatDbg.cpp │ │ │ ├── FatFile.cpp │ │ │ ├── FatFile.h │ │ │ ├── FatFileLFN.cpp │ │ │ ├── FatFilePrint.cpp │ │ │ ├── FatFileSFN.cpp │ │ │ ├── FatFormatter.cpp │ │ │ ├── FatFormatter.h │ │ │ ├── FatLib.h │ │ │ ├── FatName.cpp │ │ │ ├── FatPartition.cpp │ │ │ ├── FatPartition.h │ │ │ ├── FatVolume.cpp │ │ │ └── FatVolume.h │ │ │ ├── FreeStack.cpp │ │ │ ├── FreeStack.h │ │ │ ├── FsLib │ │ │ ├── CMakeLists.txt │ │ │ ├── FsFile.cpp │ │ │ ├── FsFile.h │ │ │ ├── FsFormatter.h │ │ │ ├── FsLib.h │ │ │ ├── FsNew.cpp │ │ │ ├── FsNew.h │ │ │ ├── FsVolume.cpp │ │ │ └── FsVolume.h │ │ │ ├── MinimumSerial.cpp │ │ │ ├── MinimumSerial.h │ │ │ ├── RingBuf.h │ │ │ ├── SdCard │ │ │ ├── CMakeLists.txt │ │ │ ├── CPPLINT.cfg │ │ │ ├── SdCard.h │ │ │ ├── SdCardInfo.cpp │ │ │ ├── SdCardInfo.h │ │ │ ├── SdCardInterface.h │ │ │ ├── SdSpiCard.cpp │ │ │ ├── SdSpiCard.h │ │ │ ├── SdioCard.h │ │ │ ├── SdioTeensy.cpp │ │ │ └── SdioTeensy.h │ │ │ ├── SdFat.h │ │ │ ├── SdFatConfig.h │ │ │ ├── SpiDriver │ │ │ ├── SdSpiArduinoDriver.h │ │ │ ├── SdSpiArtemis.cpp │ │ │ ├── SdSpiAvr.h │ │ │ ├── SdSpiBareUnoDriver.h │ │ │ ├── SdSpiBaseClass.h │ │ │ ├── SdSpiChipSelect.cpp │ │ │ ├── SdSpiDriver.h │ │ │ ├── SdSpiDue.cpp │ │ │ ├── SdSpiESP.cpp │ │ │ ├── SdSpiLibDriver.h │ │ │ ├── SdSpiParticle.cpp │ │ │ ├── SdSpiSTM32.cpp │ │ │ ├── SdSpiSTM32Core.cpp │ │ │ ├── SdSpiSoftDriver.h │ │ │ └── SdSpiTeensy3.cpp │ │ │ ├── common │ │ │ ├── ArduinoFiles.h │ │ │ ├── CMakeLists.txt │ │ │ ├── CPPLINT.cfg │ │ │ ├── CompileDateTime.h │ │ │ ├── DebugMacros.h │ │ │ ├── FmtNumber.cpp │ │ │ ├── FmtNumber.h │ │ │ ├── FsApiConstants.h │ │ │ ├── FsBlockDevice.h │ │ │ ├── FsBlockDeviceInterface.h │ │ │ ├── FsCache.cpp │ │ │ ├── FsCache.h │ │ │ ├── FsDateTime.cpp │ │ │ ├── FsDateTime.h │ │ │ ├── FsName.cpp │ │ │ ├── FsName.h │ │ │ ├── FsStructs.cpp │ │ │ ├── FsStructs.h │ │ │ ├── FsUtf.cpp │ │ │ ├── FsUtf.h │ │ │ ├── PrintBasic.cpp │ │ │ ├── PrintBasic.h │ │ │ ├── SysCall.h │ │ │ ├── upcase.cpp │ │ │ └── upcase.h │ │ │ ├── iostream │ │ │ ├── ArduinoStream.h │ │ │ ├── StdioStream.cpp │ │ │ ├── StdioStream.h │ │ │ ├── StreamBaseClass.cpp │ │ │ ├── bufstream.h │ │ │ ├── fstream.h │ │ │ ├── ios.h │ │ │ ├── iostream.h │ │ │ ├── istream.cpp │ │ │ ├── istream.h │ │ │ ├── ostream.cpp │ │ │ └── ostream.h │ │ │ └── sdios.h │ ├── TinyXML2 │ │ ├── CMakeLists.txt │ │ ├── LICENSE.txt │ │ ├── tinyxml2.cpp │ │ ├── tinyxml2.h │ │ ├── tinyxml2adapter.cpp │ │ └── tinyxml2adapter.h │ ├── braids │ │ ├── CMakeLists.txt │ │ ├── LICENSE │ │ ├── README.md │ │ ├── analog_oscillator.cc │ │ ├── analog_oscillator.h │ │ ├── braids.cc │ │ ├── data │ │ │ ├── map.bin │ │ │ └── waves.bin │ │ ├── digital_oscillator.cc │ │ ├── digital_oscillator.h │ │ ├── drivers │ │ │ ├── adc.cc │ │ │ ├── adc.h │ │ │ ├── dac.cc │ │ │ ├── dac.h │ │ │ ├── debug_pin.cc │ │ │ ├── debug_pin.h │ │ │ ├── display.cc │ │ │ ├── display.h │ │ │ ├── encoder.cc │ │ │ ├── encoder.h │ │ │ ├── gate_input.cc │ │ │ ├── gate_input.h │ │ │ ├── internal_adc.cc │ │ │ ├── internal_adc.h │ │ │ ├── system.cc │ │ │ ├── system.h │ │ │ ├── uart_logger.cc │ │ │ └── uart_logger.h │ │ ├── dsp.h │ │ ├── envelope.h │ │ ├── excitation.h │ │ ├── macro_oscillator.cc │ │ ├── macro_oscillator.h │ │ ├── macros.h │ │ ├── parameter_interpolation.h │ │ ├── quantizer.cc │ │ ├── quantizer.h │ │ ├── quantizer_scales.h │ │ ├── random.cc │ │ ├── random.h │ │ ├── resources.cc │ │ ├── resources.h │ │ ├── settings.cc │ │ ├── settings.h │ │ ├── signature_waveshaper.h │ │ ├── stmlib.h │ │ ├── svf.h │ │ ├── ui.cc │ │ ├── ui.h │ │ └── vco_jitter_source.h │ ├── cRSID │ │ ├── CMakeLists.txt │ │ ├── README.txt │ │ ├── SID.cpp │ │ ├── SID.h │ │ ├── SIDfilter.h │ │ └── SIDwaves.h │ ├── opal │ │ ├── CMakeLists.txt │ │ ├── opal.cpp │ │ └── opal.h │ └── yxml │ │ ├── CMakeLists.txt │ │ ├── COPYING │ │ ├── yxml.c │ │ └── yxml.h ├── Foundation │ ├── CMakeLists.txt │ ├── I_Iterator.h │ ├── I_List.h │ ├── IteratorPtr.h │ ├── Observable.cpp │ ├── Observable.h │ ├── Services │ │ ├── CMakeLists.txt │ │ ├── Service.cpp │ │ ├── Service.h │ │ ├── ServiceRegistry.cpp │ │ ├── ServiceRegistry.h │ │ ├── SubService.cpp │ │ └── SubService.h │ ├── SingletonRegistry.cpp │ ├── SingletonRegistry.h │ ├── T_Factory.cpp │ ├── T_Factory.h │ ├── T_SimpleList.cpp │ ├── T_SimpleList.h │ ├── T_Singleton.cpp │ ├── T_Singleton.h │ ├── T_Stack.cpp │ ├── T_Stack.h │ ├── Types │ │ └── Types.h │ └── Variables │ │ ├── CMakeLists.txt │ │ ├── Variable.cpp │ │ ├── Variable.h │ │ ├── VariableContainer.cpp │ │ ├── VariableContainer.h │ │ ├── WatchedVariable.cpp │ │ └── WatchedVariable.h ├── Services │ ├── Audio │ │ ├── Audio.cpp │ │ ├── Audio.h │ │ ├── AudioDriver.cpp │ │ ├── AudioDriver.h │ │ ├── AudioMixer.cpp │ │ ├── AudioMixer.h │ │ ├── AudioModule.h │ │ ├── AudioOut.cpp │ │ ├── AudioOut.h │ │ ├── AudioOutDriver.cpp │ │ ├── AudioOutDriver.h │ │ ├── AudioSettings.h │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── Controllers │ │ ├── ButtonControllerSource.cpp │ │ ├── ButtonControllerSource.h │ │ ├── CMakeLists.txt │ │ ├── Channel.cpp │ │ ├── Channel.h │ │ ├── ControlNode.cpp │ │ ├── ControlNode.h │ │ ├── ControllableVariable.cpp │ │ ├── ControllableVariable.h │ │ ├── ControllerService.cpp │ │ ├── ControllerService.h │ │ ├── ControllerSource.cpp │ │ ├── ControllerSource.h │ │ ├── HatControllerSource.cpp │ │ ├── HatControllerSource.h │ │ ├── JoystickControllerSource.cpp │ │ ├── JoystickControllerSource.h │ │ ├── KeyboardControllerSource.cpp │ │ ├── KeyboardControllerSource.h │ │ ├── MultiChannelAdapter.cpp │ │ └── MultiChannelAdapter.h │ ├── Midi │ │ ├── CMakeLists.txt │ │ ├── MidiChannel.cpp │ │ ├── MidiChannel.h │ │ ├── MidiEvent.cpp │ │ ├── MidiEvent.h │ │ ├── MidiInDevice.cpp │ │ ├── MidiInDevice.h │ │ ├── MidiInMerger.cpp │ │ ├── MidiInMerger.h │ │ ├── MidiMessage.h │ │ ├── MidiNoteTracker.cpp │ │ ├── MidiNoteTracker.h │ │ ├── MidiOutDevice.cpp │ │ ├── MidiOutDevice.h │ │ ├── MidiService.cpp │ │ └── MidiService.h │ └── Time │ │ └── CMakeLists.txt ├── System │ ├── CMakeLists.txt │ ├── Console │ │ ├── CMakeLists.txt │ │ ├── Trace.cpp │ │ ├── Trace.h │ │ ├── n_assert.cpp │ │ ├── n_assert.h │ │ └── nanoprintf.h │ ├── Errors │ │ ├── CMakeLists.txt │ │ ├── Result.cpp │ │ └── Result.h │ ├── FileSystem │ │ ├── CMakeLists.txt │ │ ├── FileSystem.h │ │ └── I_File.h │ ├── Process │ │ ├── CMakeLists.txt │ │ ├── SysMutex.cpp │ │ └── SysMutex.h │ ├── Profiler │ │ ├── CMakeLists.txt │ │ ├── Profiler.cpp │ │ └── Profiler.h │ ├── System │ │ ├── CMakeLists.txt │ │ ├── System.h │ │ └── typedefs.h │ ├── Timer │ │ ├── CMakeLists.txt │ │ ├── Timer.cpp │ │ └── Timer.h │ ├── _Midi │ │ ├── Midi.cpp │ │ └── Midi.h │ └── io │ │ ├── CMakeLists.txt │ │ ├── Status.cpp │ │ └── Status.h ├── UIFramework │ ├── BasicDatas │ │ ├── CMakeLists.txt │ │ ├── GUIBitmap.cpp │ │ ├── GUIBitmap.h │ │ ├── GUICreateWindowParams.h │ │ ├── GUIEvent.cpp │ │ ├── GUIEvent.h │ │ ├── GUIPoint.h │ │ ├── GUIRect.cpp │ │ └── GUIRect.h │ ├── CMakeLists.txt │ ├── Framework │ │ ├── CMakeLists.txt │ │ ├── GUIColor.h │ │ ├── GUIParentGraphics.cpp │ │ ├── GUIParentGraphics.h │ │ └── GUITextProperties.h │ ├── Interfaces │ │ ├── CMakeLists.txt │ │ ├── I_GUIGraphics.h │ │ ├── I_GUIWindowFactory.h │ │ ├── I_GUIWindowImp.cpp │ │ └── I_GUIWindowImp.h │ └── SimpleBaseClasses │ │ ├── CMakeLists.txt │ │ ├── EventManager.cpp │ │ ├── EventManager.h │ │ ├── GUIWindow.cpp │ │ └── GUIWindow.h ├── config │ └── etl_profile.h └── pico_sdk_import.cmake ├── tools └── wokwi │ ├── diagram.json │ └── wokwi.toml ├── usermanual ├── Readme.md ├── build.sh ├── content │ ├── includes │ │ ├── footer │ │ ├── header │ │ ├── redirectheader │ │ └── sidepanel │ ├── pages │ │ ├── appendix-remoteui.md │ │ ├── chains.md │ │ ├── commands.md │ │ ├── device.md │ │ ├── frontcover.md │ │ ├── getting-started.md │ │ ├── grooves.md │ │ ├── index.md │ │ ├── instruments.md │ │ ├── introduction.md │ │ ├── keypadcombos.md │ │ ├── midi.md │ │ ├── mixer.md │ │ ├── phrases.md │ │ ├── projects.md │ │ ├── renders.md │ │ ├── scales.md │ │ ├── songs.md │ │ ├── tables.md │ │ ├── theindex.md │ │ ├── theme.md │ │ └── tipstricks.md │ ├── static │ │ ├── 404.html │ │ ├── css │ │ │ └── main.css │ │ ├── font │ │ │ ├── PROJEKTBlackbird.ttf │ │ │ └── square.ttf │ │ ├── image │ │ │ ├── browser-dirs-screen-small.png │ │ │ ├── browser-dirs-screen.png │ │ │ ├── browser-files-screen-small.png │ │ │ ├── browser-files-screen.png │ │ │ ├── chain-screen-small.png │ │ │ ├── chain-screen.png │ │ │ ├── confirm-load-proj-screen-small.png │ │ │ ├── confirm-load-proj-screen.png │ │ │ ├── device-screen-small.png │ │ │ ├── device-screen.png │ │ │ ├── groove-screen-small.png │ │ │ ├── groove-screen.png │ │ │ ├── io-portslayout.png │ │ │ ├── midi-screen-small.png │ │ │ ├── midi-screen.png │ │ │ ├── mixer-screen-small.png │ │ │ ├── mixer-screen.png │ │ │ ├── opal-screen-small.png │ │ │ ├── opal-screen.png │ │ │ ├── opal-waveforms-small.png │ │ │ ├── opal-waveforms.png │ │ │ ├── pT-buttonMap.png │ │ │ ├── pT-render.png │ │ │ ├── phrase-screen-small.png │ │ │ ├── phrase-screen.png │ │ │ ├── picotracker-assembled-small.png │ │ │ ├── proj-browser-screen-small.png │ │ │ ├── proj-browser-screen.png │ │ │ ├── project-screen-small.png │ │ │ ├── project-screen.png │ │ │ ├── rendering-dialog-small.png │ │ │ ├── rendering-dialog.png │ │ │ ├── sample-screen-small.png │ │ │ ├── sample-screen.png │ │ │ ├── screenmap.png │ │ │ ├── sid-screen-small.png │ │ │ ├── sid-screen.png │ │ │ ├── song-screen-small.png │ │ │ ├── song-screen.png │ │ │ ├── table-screen-small.png │ │ │ ├── table-screen.png │ │ │ ├── theme-screen-small.png │ │ │ ├── traced-case_exploded.png │ │ │ └── traced-picotracker-assembled.png │ │ └── js │ │ │ └── main.js │ └── templates │ │ ├── cover.html │ │ ├── cover_pdf.html │ │ ├── page.html │ │ └── page_pdf.html ├── data │ └── config.json ├── docs │ └── screenmap.excalidraw ├── pdfconfig.yaml └── preview.sh └── util └── lgptconvert.py /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/debian 3 | { 4 | "name": "Debian with RP2040 dev toolchain", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/maks/rp2040-devcontainer:latest" 7 | // Features to add to the dev container. More info: https://containers.dev/features. 8 | // "features": {}, 9 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 10 | // "forwardPorts": [], 11 | // Configure tool-specific properties. 12 | // "customizations": {}, 13 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. 14 | // "remoteUser": "root" 15 | } -------------------------------------------------------------------------------- /.github/workflows/clang-format-check.yml: -------------------------------------------------------------------------------- 1 | name: clang-format Check 2 | on: 3 | push: 4 | paths: 5 | - sources/** 6 | pull_request: 7 | paths: 8 | - sources/** 9 | 10 | jobs: 11 | formatting-check: 12 | name: Formatting Check 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v3 16 | - name: Run clang-format style check for C/C++/Protobuf programs. 17 | uses: jidicula/clang-format-action@v4.11.0 18 | with: 19 | clang-format-version: '17' 20 | check-path: 'sources' 21 | fallback-style: 'llvm' 22 | exclude-regex: 'sources/Externals/.*' 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/** 2 | build-opt/** 3 | ref/** 4 | doxygen/html/** 5 | projects/buildOSX/** 6 | projects/lgpt 7 | lgpt.log 8 | 9 | # OSX 10 | ## General 11 | .DS_Store 12 | .AppleDouble 13 | .LSOverride 14 | 15 | ## Icon must end with two \r 16 | Icon 17 | 18 | ## Thumbnails 19 | ._* 20 | 21 | ## Files that might appear in the root of a volume 22 | .DocumentRevisions-V100 23 | .fseventsd 24 | .Spotlight-V100 25 | .TemporaryItems 26 | .Trashes 27 | .VolumeIcon.icns 28 | .com.apple.timemachine.donotpresent 29 | 30 | ## Directories potentially created on remote AFP share 31 | .AppleDB 32 | .AppleDesktop 33 | Network Trash Folder 34 | Temporary Items 35 | .apdisk 36 | 37 | # usermanual output 38 | usermanual/output 39 | usermanual/bin 40 | 41 | optbuild/** -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "sources/Externals/pico-sdk"] 2 | path = sources/Externals/pico-sdk 3 | url = https://github.com/raspberrypi/pico-sdk.git 4 | tag = 1.5.1 5 | [submodule "sources/Externals/etl"] 6 | path = sources/Externals/etl 7 | url = https://github.com/ETLCPP/etl.git 8 | -------------------------------------------------------------------------------- /docs/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## General house rules: 2 | 3 | * Have respect for everyone on the server! Don't be a dick! 4 | * No harsh language towards members of the community! (If it's a joke, make sure you let the person know) 5 | * Do not spam, you will be muted! 6 | * No NSFW or (porno)graphic content allowed! 7 | * Discussions in English only 8 | * Posting any harmful material such as viruses, harmful links and/or files results in an immediate and permanent ban! 9 | * Sharing or exchanging pirated/cracked software is NOT allowed. -------------------------------------------------------------------------------- /docs/RELEASES.md: -------------------------------------------------------------------------------- 1 | ## How to make a new release 2 | 3 | While all releases are built on CI using GitHub Actions on the `master` branch, some manual steps are still required to create a new release: 4 | 5 | 1. Update the build number (`PROJECT_NUMBER` define) in `sources/Application/Model/Project.h` 6 | 1. Create a PR to merge into `master` branch and have it merged 7 | 1. Wait for the build to finish and then download the artifacts, note they will be zip files containing the actual firmware uf2 files 8 | 1. [Draft a new release on GitHub](https://github.com/xiphonics/picoTracker/releases/new) 9 | 1. When you do "Choose a tag", make sure you select to "create a tag on publish" with the name of the release, eg. `v2.0.0` 10 | 1. Title the release with the version number, eg. `v2.0.0` 11 | 1. Rename the artifacts to `picoTracker_ili9341.uf2` and `picoTracker_st7789.uf2` and upload them to the release 12 | 1. Click the "Generate release notes" button 13 | 1. Publish the release 14 | 1. Notify users in the Discord channel #announcements of the new release 15 | 16 | -------------------------------------------------------------------------------- /docs/img/DIY_schematic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/DIY_schematic.png -------------------------------------------------------------------------------- /docs/img/all-done.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/all-done.jpg -------------------------------------------------------------------------------- /docs/img/back-look.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/back-look.jpg -------------------------------------------------------------------------------- /docs/img/component_placement.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/component_placement.jpg -------------------------------------------------------------------------------- /docs/img/components-portable.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/components-portable.jpg -------------------------------------------------------------------------------- /docs/img/components.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/components.jpg -------------------------------------------------------------------------------- /docs/img/final.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/final.jpg -------------------------------------------------------------------------------- /docs/img/keynames.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/keynames.jpg -------------------------------------------------------------------------------- /docs/img/keypad-back.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/keypad-back.jpg -------------------------------------------------------------------------------- /docs/img/keypad-front.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/keypad-front.jpg -------------------------------------------------------------------------------- /docs/img/m8-style-keymap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/m8-style-keymap.png -------------------------------------------------------------------------------- /docs/img/main-done.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/main-done.jpg -------------------------------------------------------------------------------- /docs/img/pcm5102.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/pcm5102.jpg -------------------------------------------------------------------------------- /docs/img/pico-style-keymap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/pico-style-keymap.png -------------------------------------------------------------------------------- /docs/img/picotracker-ports-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/docs/img/picotracker-ports-1.png -------------------------------------------------------------------------------- /fritzing/parts/2.8 SPI TFT Module.fzpz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/fritzing/parts/2.8 SPI TFT Module.fzpz -------------------------------------------------------------------------------- /fritzing/parts/Adafruit MIDI FeatherWing Kit.fzpz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/fritzing/parts/Adafruit MIDI FeatherWing Kit.fzpz -------------------------------------------------------------------------------- /fritzing/parts/Adafruit SDIO microSD Breakout.fzpz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/fritzing/parts/Adafruit SDIO microSD Breakout.fzpz -------------------------------------------------------------------------------- /fritzing/parts/Cherry MX Blue.fzpz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/fritzing/parts/Cherry MX Blue.fzpz -------------------------------------------------------------------------------- /fritzing/parts/Pico-R3-Fritzing-official.fzpz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/fritzing/parts/Pico-R3-Fritzing-official.fzpz -------------------------------------------------------------------------------- /fritzing/parts/PicoH-Fritzing-SMD.fzpz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/fritzing/parts/PicoH-Fritzing-SMD.fzpz -------------------------------------------------------------------------------- /fritzing/parts/PicoW-Fritzing-official.fzpz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/fritzing/parts/PicoW-Fritzing-official.fzpz -------------------------------------------------------------------------------- /fritzing/picoTracker.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/fritzing/picoTracker.fzz -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(main) 2 | add_subdirectory(system) 3 | add_subdirectory(gui) 4 | add_subdirectory(timer) 5 | add_subdirectory(display) 6 | add_subdirectory(sdcard) 7 | add_subdirectory(audio) 8 | add_subdirectory(utils) 9 | add_subdirectory(midi) 10 | add_subdirectory(platform) 11 | add_subdirectory(usb) 12 | add_subdirectory(filesystem) 13 | add_subdirectory(mutex) 14 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/audio/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(platform_audio 2 | picoTrackerAudio.cpp 3 | picoTrackerAudioDriver.cpp 4 | ) 5 | 6 | pico_generate_pio_header(platform_audio ${CMAKE_CURRENT_LIST_DIR}/audio_i2s.pio) 7 | 8 | target_link_libraries(platform_audio PUBLIC 9 | platform_utils 10 | ) 11 | 12 | target_include_directories(platform_audio PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 13 | include_directories(${PROJECT_SOURCE_DIR}) 14 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/audio/picoTrackerAudio.h: -------------------------------------------------------------------------------- 1 | #ifndef _PICOTRACKERAUDIO_H_ 2 | #define _PICOTRACKERAUDIO_H_ 3 | 4 | #include "Services/Audio/Audio.h" 5 | 6 | class picoTrackerAudio : public Audio { 7 | public: 8 | picoTrackerAudio(AudioSettings &hints); 9 | ~picoTrackerAudio(); 10 | virtual void Init(); 11 | virtual void Close(); 12 | virtual int GetMixerVolume(); 13 | virtual void SetMixerVolume(int volume); 14 | 15 | private: 16 | AudioSettings hints_; 17 | }; 18 | #endif 19 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/display/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(platform_display 2 | ili9341.c 3 | chargfx.c 4 | ) 5 | 6 | target_include_directories(platform_display PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 7 | 8 | include_directories(${PROJECT_SOURCE_DIR}) 9 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/filesystem/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(platform_filesystem 2 | picoTrackerFileSystem.cpp 3 | ) 4 | 5 | target_link_libraries(platform_filesystem PUBLIC 6 | system_filesystem 7 | system_errors 8 | sdfat 9 | platform_sdcard 10 | etl 11 | ) 12 | 13 | target_include_directories(platform_filesystem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 14 | 15 | include_directories(${PROJECT_SOURCE_DIR}) 16 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/gui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(platform_gui 2 | GUIFactory.cpp 3 | picoTrackerGUIWindowImp.cpp 4 | picoTrackerEventManager.cpp 5 | SerialDebugUI.cpp 6 | picoRemoteUI.cpp 7 | ) 8 | 9 | target_link_libraries(platform_gui PUBLIC 10 | uiframework_simplebaseclasses 11 | system_console 12 | uiframework_basicdatas 13 | application 14 | platform_display 15 | platform_system 16 | platform_usb 17 | ) 18 | 19 | target_include_directories(platform_gui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 20 | 21 | include_directories(${PROJECT_SOURCE_DIR}) 22 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/gui/GUIFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GUIFactory.h" 2 | #include "picoTrackerEventManager.h" 3 | #include "picoTrackerGUIWindowImp.h" 4 | 5 | GUIFactory::GUIFactory(){}; 6 | 7 | I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { 8 | alignas(picoTrackerGUIWindowImp) static char 9 | guiImpMemBuf[sizeof(picoTrackerGUIWindowImp)]; 10 | return *(new (guiImpMemBuf) picoTrackerGUIWindowImp(p)); 11 | } 12 | 13 | EventManager *GUIFactory::GetEventManager() { 14 | return picoTrackerEventManager::GetInstance(); 15 | } 16 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/gui/GUIFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef GUI_FACTORY_H_ 2 | #define GUI_FACTORY_H_ 3 | 4 | #include "UIFramework/Interfaces/I_GUIWindowFactory.h" 5 | 6 | class GUIFactory : public I_GUIWindowFactory { 7 | 8 | public: 9 | GUIFactory(); 10 | virtual I_GUIWindowImp &CreateWindowImp(GUICreateWindowParams &); 11 | virtual EventManager *GetEventManager(); 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/gui/SerialDebugUI.h: -------------------------------------------------------------------------------- 1 | #ifndef SERIAL_DEBUG_UI_H_ 2 | #define SERIAL_DEBUG_UI_H_ 3 | 4 | #include "pico/stdlib.h" 5 | 6 | class SerialDebugUI { 7 | public: 8 | SerialDebugUI(); 9 | bool readSerialIn(char *buffer, short size); 10 | void dispatchCmd(char *cmd); 11 | void catFile(const char *path); 12 | void listFiles(const char *path); 13 | void rmFile(const char *path); 14 | void saveConfig(); 15 | void mkdir(const char *path); 16 | void rmdir(const char *path); 17 | 18 | private: 19 | int lp_ = 0; 20 | }; 21 | 22 | #endif -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(picoTracker 2 | picoTrackerMain.cpp 3 | ) 4 | 5 | target_link_libraries(picoTracker PUBLIC 6 | platform_system 7 | platform 8 | tinyusb_board 9 | tinyusb_device 10 | platform_usb 11 | platform_filesystem 12 | ) 13 | 14 | target_include_directories(picoTracker PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 15 | 16 | include_directories(${PROJECT_SOURCE_DIR}) 17 | 18 | 19 | # create map/bin/hex/uf2 file etc. 20 | pico_add_extra_outputs(picoTracker) 21 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/midi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(platform_midi 2 | picoTrackerMidiService.cpp 3 | picoTrackerUSBMidiOutDevice.cpp 4 | picoTrackerMidiInDevice.cpp 5 | picoTrackerMidiOutDevice.cpp 6 | picoTrackerUSBMidiInDevice.cpp 7 | ) 8 | 9 | target_link_libraries(platform_midi PRIVATE 10 | platform_usb 11 | ) 12 | 13 | target_include_directories(platform_midi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 14 | 15 | include_directories(${PROJECT_SOURCE_DIR}) 16 | 17 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/midi/picoTrackerMidiInDevice.h: -------------------------------------------------------------------------------- 1 | // picoTrackerMidiInDevice.h 2 | #pragma once 3 | #include "Services/Midi/MidiInDevice.h" 4 | 5 | class picoTrackerMidiInDevice : public MidiInDevice { 6 | public: 7 | picoTrackerMidiInDevice(const char *name); 8 | virtual ~picoTrackerMidiInDevice(); 9 | 10 | // Poll the MIDI input buffer for new messages 11 | virtual void poll(); 12 | 13 | virtual bool Start(); 14 | virtual void Stop(); 15 | 16 | protected: 17 | // Driver specific implementation 18 | virtual bool initDriver(); 19 | virtual void closeDriver(); 20 | virtual bool startDriver(); 21 | virtual void stopDriver(); 22 | }; -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/midi/picoTrackerMidiOutDevice.cpp: -------------------------------------------------------------------------------- 1 | #include "picoTrackerMidiOutDevice.h" 2 | #include "Adapters/picoTracker/platform/platform.h" 3 | #include "System/Console/Trace.h" 4 | #include "hardware/uart.h" 5 | #include "pico/stdlib.h" 6 | 7 | picoTrackerMidiOutDevice::picoTrackerMidiOutDevice(const char *name) 8 | : MidiOutDevice(name) {} 9 | 10 | bool picoTrackerMidiOutDevice::Init() { return true; } 11 | 12 | void picoTrackerMidiOutDevice::Close(){}; 13 | 14 | bool picoTrackerMidiOutDevice::Start() { return true; }; 15 | 16 | void picoTrackerMidiOutDevice::Stop() {} 17 | 18 | void picoTrackerMidiOutDevice::SendMessage(MidiMessage &msg) { 19 | uart_putc_raw(MIDI_UART, msg.status_); 20 | 21 | if (msg.status_ < 0xF0) { 22 | uart_putc_raw(MIDI_UART, msg.data1_); 23 | if (msg.data2_ != MidiMessage::UNUSED_BYTE) { 24 | uart_putc_raw(MIDI_UART, msg.data2_); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/midi/picoTrackerMidiOutDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef _PICOTRACKERMIDIDEVICE_H_ 2 | #define _PICOTRACKERMIDIDEVICE_H_ 3 | 4 | #include "Services/Midi/MidiOutDevice.h" 5 | 6 | class picoTrackerMidiOutDevice : public MidiOutDevice { 7 | public: 8 | picoTrackerMidiOutDevice(const char *name); 9 | virtual bool Init(); 10 | virtual void Close(); 11 | virtual bool Start(); 12 | virtual void Stop(); 13 | 14 | protected: 15 | virtual void SendMessage(MidiMessage &); 16 | 17 | private: 18 | }; 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/midi/picoTrackerMidiService.cpp: -------------------------------------------------------------------------------- 1 | #include "picoTrackerMidiService.h" 2 | 3 | picoTrackerMidiService::picoTrackerMidiService() 4 | : // Initialize static member variables with their respective names 5 | midiOutDevice_("MIDI OUT"), usbMidiOutDevice_("USB"), 6 | midiInDevice_("MIDI IN"), usbMidiInDevice_("USB MIDI IN") { 7 | // Add MIDI output devices to the output device list 8 | outList_.insert(outList_.end(), &midiOutDevice_); 9 | outList_.insert(outList_.end(), &usbMidiOutDevice_); 10 | 11 | // Add MIDI input devices to the input device list 12 | inList_.insert(inList_.end(), &midiInDevice_); 13 | inList_.insert(inList_.end(), &usbMidiInDevice_); 14 | }; 15 | 16 | picoTrackerMidiService::~picoTrackerMidiService(){}; 17 | 18 | void picoTrackerMidiService::poll() { 19 | // Poll all MIDI input devices 20 | for (auto dev : inList_) { 21 | picoTrackerMidiInDevice *ptDev = (picoTrackerMidiInDevice *)dev; 22 | if (ptDev) { 23 | ptDev->poll(); 24 | } 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/midi/picoTrackerMidiService.h: -------------------------------------------------------------------------------- 1 | #ifndef _PICOTRACKERMIDISERVICE_H_ 2 | #define _PICOTRACKERMIDISERVICE_H_ 3 | 4 | #include "Services/Midi/MidiService.h" 5 | #include "picoTrackerMidiInDevice.h" 6 | #include "picoTrackerMidiOutDevice.h" 7 | #include "picoTrackerUSBMidiInDevice.h" 8 | #include "picoTrackerUSBMidiOutDevice.h" 9 | 10 | class picoTrackerMidiService : public MidiService { 11 | public: 12 | picoTrackerMidiService(); 13 | ~picoTrackerMidiService(); 14 | 15 | // Poll MIDI input devices for new messages 16 | void poll(); 17 | 18 | private: 19 | picoTrackerMidiOutDevice midiOutDevice_; 20 | picoTrackerUSBMidiOutDevice usbMidiOutDevice_; 21 | picoTrackerMidiInDevice midiInDevice_; 22 | picoTrackerUSBMidiInDevice usbMidiInDevice_; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/midi/picoTrackerUSBMidiInDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef _PICOTRACKERUSBMIDIINDEVICE_H_ 2 | #define _PICOTRACKERUSBMIDIINDEVICE_H_ 3 | 4 | #include "Services/Midi/MidiInDevice.h" 5 | #include "tusb.h" 6 | 7 | class picoTrackerUSBMidiInDevice : public MidiInDevice { 8 | public: 9 | picoTrackerUSBMidiInDevice(const char *name); 10 | virtual ~picoTrackerUSBMidiInDevice(); 11 | 12 | virtual bool Init(); 13 | virtual void Close(); 14 | virtual bool Start(); 15 | virtual void Stop(); 16 | 17 | // Process any pending USB MIDI messages 18 | virtual void poll(); 19 | 20 | protected: 21 | virtual bool initDriver() { return true; }; 22 | virtual bool startDriver() { return true; }; 23 | virtual void stopDriver() {} 24 | virtual void closeDriver() {} 25 | }; 26 | 27 | #endif -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/midi/picoTrackerUSBMidiOutDevice.cpp: -------------------------------------------------------------------------------- 1 | #include "picoTrackerUSBMidiOutDevice.h" 2 | #include "Adapters/picoTracker/platform/platform.h" 3 | #include "System/Console/Trace.h" 4 | #include "pico/stdlib.h" 5 | #include "usb_utils.h" 6 | 7 | picoTrackerUSBMidiOutDevice::picoTrackerUSBMidiOutDevice(const char *name) 8 | : MidiOutDevice(name) {} 9 | 10 | bool picoTrackerUSBMidiOutDevice::Init() { return true; } 11 | 12 | void picoTrackerUSBMidiOutDevice::Close(){}; 13 | 14 | bool picoTrackerUSBMidiOutDevice::Start() { return true; }; 15 | 16 | void picoTrackerUSBMidiOutDevice::Stop() {} 17 | 18 | void picoTrackerUSBMidiOutDevice::SendMessage(MidiMessage &msg) { 19 | uint8_t midicmd[3] = {0, 0, 0}; 20 | 21 | midicmd[0] = msg.status_; 22 | if (msg.status_ < 0xF0) { 23 | midicmd[1] = msg.data1_; 24 | midicmd[2] = msg.data2_; 25 | sendUSBMidiMessage(midicmd, 3); 26 | } else { 27 | sendUSBMidiMessage(midicmd, 1); 28 | } 29 | } -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/midi/picoTrackerUSBMidiOutDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef _PICOTRACKERUSBMIDIDEVICE_H_ 2 | #define _PICOTRACKERUSBMIDIDEVICE_H_ 3 | 4 | #include "Services/Midi/MidiOutDevice.h" 5 | 6 | class picoTrackerUSBMidiOutDevice : public MidiOutDevice { 7 | public: 8 | picoTrackerUSBMidiOutDevice(const char *name); 9 | virtual bool Init(); 10 | virtual void Close(); 11 | virtual bool Start(); 12 | virtual void Stop(); 13 | 14 | protected: 15 | virtual void SendMessage(MidiMessage &); 16 | 17 | private: 18 | }; 19 | #endif -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/mutex/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(platform_mutex 2 | picoTrackerMutex.cpp 3 | ) 4 | 5 | target_link_libraries(platform_mutex PRIVATE pico_stdlib 6 | ) 7 | 8 | target_include_directories(platform_mutex PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 9 | 10 | include_directories(${PROJECT_SOURCE_DIR}) 11 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/mutex/picoTrackerMutex.cpp: -------------------------------------------------------------------------------- 1 | #include "picoTrackerMutex.h" 2 | 3 | picoTrackerMutex::picoTrackerMutex() { mutex_init(&mutex_); } 4 | 5 | inline bool picoTrackerMutex::Lock() { 6 | mutex_enter_blocking(&mutex_); 7 | return true; 8 | } 9 | 10 | inline void picoTrackerMutex::Unlock() { mutex_exit(&mutex_); } 11 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/mutex/picoTrackerMutex.h: -------------------------------------------------------------------------------- 1 | #ifndef _PICOTRACKER_MUTEX_H_ 2 | #define _PICOTRACKER_MUTEX_H_ 3 | 4 | #include "System/Process/SysMutex.h" 5 | #include "pico/mutex.h" 6 | 7 | class picoTrackerMutex : public SysMutex { 8 | public: 9 | picoTrackerMutex(); 10 | virtual ~picoTrackerMutex(){}; 11 | virtual bool Lock() override; 12 | virtual void Unlock() override; 13 | 14 | private: 15 | mutex_t mutex_; 16 | }; 17 | 18 | #endif // _PICOTRACKER_MUTEX_H_ 19 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/platform/.gitignore: -------------------------------------------------------------------------------- 1 | DSP.h -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/platform/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(platform 2 | platform.cpp 3 | ) 4 | 5 | target_link_libraries(platform PUBLIC 6 | platform_mutex 7 | ) 8 | 9 | target_include_directories(platform PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 10 | 11 | include_directories(${PROJECT_SOURCE_DIR}) 12 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/platform/platform.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLATFORM_PICO_H_ 2 | #define _PLATFORM_PICO_H_ 3 | 4 | #include "System/Process/SysMutex.h" 5 | #include "gpio.h" 6 | #include "pico/stdlib.h" 7 | 8 | void platform_init(); 9 | 10 | int32_t platform_get_rand(); 11 | 12 | void platform_reboot(); 13 | 14 | void platform_bootloader(); 15 | 16 | SysMutex *platform_mutex(); 17 | 18 | void platform_brightness(uint8_t value); 19 | 20 | void pt_uart_putc(int c, void *context); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/sdcard/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(platform_sdcard 2 | sdio.cpp 3 | sd_card_sdio.cpp 4 | ) 5 | 6 | pico_generate_pio_header(platform_sdcard ${CMAKE_CURRENT_LIST_DIR}/sdio.pio) 7 | 8 | target_link_libraries(platform_sdcard PUBLIC 9 | sdfat 10 | ) 11 | 12 | target_include_directories(platform_sdcard PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 13 | 14 | include_directories(${PROJECT_SOURCE_DIR}) 15 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/sdcard/sdcard.h: -------------------------------------------------------------------------------- 1 | #ifndef SDCARD_H_ 2 | #define SDCARD_H_ 3 | 4 | // SD card driver for SdFat 5 | 6 | class SdioConfig; 7 | extern SdioConfig g_sd_sdio_config; 8 | #define SD_CONFIG g_sd_sdio_config 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/system/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(platform_system 2 | picoTrackerSystem.cpp 3 | picoTrackerEventQueue.cpp 4 | input.cpp 5 | critical_error_message.c 6 | picoTrackerSamplePool.cpp 7 | ) 8 | 9 | target_link_libraries(platform_system INTERFACE system_system PUBLIC 10 | uiframework_simplebaseclasses 11 | platform_timer 12 | platform_audio 13 | services_audio 14 | platform_midi 15 | platform_gui 16 | platform_display 17 | etl 18 | platform_usb 19 | ) 20 | 21 | 22 | target_include_directories(platform_system PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 23 | 24 | include_directories(${PROJECT_SOURCE_DIR}) 25 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/system/critical_error_message.h: -------------------------------------------------------------------------------- 1 | #ifndef _CRITICALERRORMESSAGE_H_ 2 | #define _CRITICALERRORMESSAGE_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void critical_error_message(const char *message, int guruId); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | #endif -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/system/input.h: -------------------------------------------------------------------------------- 1 | #ifndef _PICOTRACKERINPUT_H_ 2 | #define _PICOTRACKERINPUT_H_ 3 | #include "pico/stdlib.h" 4 | 5 | #define BIT(n) (1 << (n)) 6 | 7 | typedef enum KEYPAD_BITS { 8 | KEY_LEFT = BIT(0), //!< Keypad LEFT button. 9 | KEY_DOWN = BIT(1), //!< Keypad DOWN button. 10 | KEY_RIGHT = BIT(2), //!< Keypad RIGHT button. 11 | KEY_UP = BIT(3), //!< Keypad UP button. 12 | KEY_L = BIT(4), //!< Left shoulder button. 13 | KEY_B = BIT(5), //!< Keypad B button. 14 | KEY_A = BIT(6), //!< Keypad A button. 15 | KEY_R = BIT(7), //!< Right shoulder button. 16 | KEY_START = BIT(8), //!< Keypad START button. 17 | KEY_SELECT = BIT(9), //!< Keypad SELECT button. 18 | } KEYPAD_BITS; 19 | 20 | uint16_t scanKeys(); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/system/picoTrackerEventQueue.cpp: -------------------------------------------------------------------------------- 1 | #include "picoTrackerEventQueue.h" 2 | 3 | picoTrackerEventQueue::picoTrackerEventQueue(){}; 4 | 5 | void picoTrackerEventQueue::push(picoTrackerEvent event) { 6 | if (!queue_.full()) { 7 | queue_.push(event); 8 | } 9 | }; 10 | 11 | void picoTrackerEventQueue::pop_into(picoTrackerEvent &event) { 12 | if (!queue_.empty()) { 13 | event.type_ = queue_.front().type_; 14 | queue_.pop(); 15 | } 16 | }; 17 | 18 | bool picoTrackerEventQueue::empty() { return queue_.empty(); } 19 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/system/picoTrackerEventQueue.h: -------------------------------------------------------------------------------- 1 | #ifndef _PICOTRACKEREVENTQUEUE_H_ 2 | #define _PICOTRACKEREVENTQUEUE_H_ 3 | 4 | #include "Externals/etl/include/etl/queue_spsc_atomic.h" 5 | #include "Foundation/T_Singleton.h" 6 | 7 | enum picoTrackerEventType { PICO_REDRAW, PICO_FLUSH, PICO_CLOCK, LAST }; 8 | 9 | class picoTrackerEvent { 10 | public: 11 | picoTrackerEvent(picoTrackerEventType type) : type_(type) {} 12 | picoTrackerEventType type_; 13 | }; 14 | 15 | inline bool operator==(const picoTrackerEvent &lhs, 16 | const picoTrackerEvent &rhs) { 17 | return lhs.type_ == rhs.type_; 18 | }; 19 | 20 | class picoTrackerEventQueue : public T_Singleton { 21 | public: 22 | picoTrackerEventQueue(); 23 | void push(picoTrackerEvent event); 24 | void pop_into(picoTrackerEvent &event); 25 | bool empty(); 26 | 27 | private: 28 | static const size_t EVENT_QUEUE_SIZE = 256; 29 | etl::queue_spsc_atomic queue_; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/system/picoTrackerSamplePool.h: -------------------------------------------------------------------------------- 1 | #ifndef _PICOTRACKERSAMPLEPOOL_H_ 2 | #define _PICOTRACKERSAMPLEPOOL_H_ 3 | #include "Application/Instruments/SamplePool.h" 4 | #include "Application/Instruments/WavFile.h" 5 | #include "System/Console/Trace.h" 6 | 7 | class picoTrackerSamplePool : public SamplePool { 8 | public: 9 | picoTrackerSamplePool(); 10 | virtual void Reset(); 11 | ~picoTrackerSamplePool() {} 12 | 13 | protected: 14 | virtual bool loadSample(const char *name); 15 | virtual bool unloadSample(); 16 | 17 | private: 18 | bool LoadInFlash(WavFile *wave); 19 | 20 | static uint32_t flashEraseOffset_; 21 | static uint32_t flashWriteOffset_; 22 | static uint32_t flashLimit_; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/timer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(platform_timer 2 | picoTrackerTimer.cpp 3 | ) 4 | 5 | target_link_libraries(platform_timer PUBLIC 6 | system_timer 7 | foundation 8 | ) 9 | 10 | target_include_directories(platform_timer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 11 | 12 | include_directories( 13 | ${PROJECT_SOURCE_DIR} 14 | ) 15 | 16 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/timer/picoTrackerTimer.h: -------------------------------------------------------------------------------- 1 | #ifndef _PICOTRACKERTIMER_H_ 2 | #define _PICOTRACKERTIMER_H_ 3 | 4 | #include "System/Timer/Timer.h" 5 | #include "pico/stdlib.h" 6 | 7 | class picoTrackerTimer : public I_Timer { 8 | public: 9 | picoTrackerTimer(); 10 | virtual ~picoTrackerTimer(); 11 | virtual void SetPeriod(float msec); 12 | virtual bool Start(); 13 | virtual void Stop(); 14 | virtual float GetPeriod(); 15 | int64_t OnTimerTick(); 16 | 17 | private: 18 | float period_; 19 | float offset_; // Float offset taking into account 20 | // period is an int 21 | alarm_id_t timer_; // NULL if not running 22 | long lastTick_; 23 | bool running_; 24 | }; 25 | 26 | class picoTrackerTimerService : public TimerService { 27 | public: 28 | virtual I_Timer *CreateTimer(); // Returns a timer 29 | virtual void TriggerCallback(int msec, timerCallback cb); 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/usb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(platform_usb 2 | usb_utils.cpp 3 | usb_descriptors.c 4 | ) 5 | target_link_libraries(platform_usb PUBLIC 6 | tinyusb_device 7 | ) 8 | 9 | target_include_directories(platform_usb PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 10 | 11 | include_directories(${PROJECT_SOURCE_DIR}) 12 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/usb/usb_utils.cpp: -------------------------------------------------------------------------------- 1 | #include "usb_utils.h" 2 | 3 | void sendUSBMidiMessage(uint8_t const *midicmd, uint8_t len) { 4 | tud_midi_n_stream_write(0, 0, midicmd, len); 5 | }; 6 | 7 | // need to call this *very* regularly to allow tinyusb to 8 | // service usb interupts 9 | void handleUSBInterrupts() { tud_task(); }; 10 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/usb/usb_utils.h: -------------------------------------------------------------------------------- 1 | #ifndef _USB_UTILS_H_ 2 | #define _USB_UTILS_H_ 3 | #include "tusb.h" 4 | void sendUSBMidiMessage(const uint8_t *midicmd, uint8_t len); 5 | void handleUSBInterrupts(); 6 | #endif -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(platform_utils 2 | utils.cpp 3 | ) 4 | 5 | target_link_libraries(platform_utils PUBLIC 6 | sdfat 7 | ) 8 | 9 | target_include_directories(platform_utils PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 10 | 11 | include_directories(${PROJECT_SOURCE_DIR}) 12 | -------------------------------------------------------------------------------- /sources/Adapters/picoTracker/utils/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef _PICOTRACKERUTIL_H_ 2 | #define _PICOTRACKERUTIL_H_ 3 | 4 | #include "pico/stdlib.h" 5 | 6 | /* 7 | ** Bit set, clear, and test operations 8 | ** 9 | ** public domain snippet by Bob Stout 10 | */ 11 | 12 | typedef enum { ERROR = -1, FALSE, TRUE } LOGICAL; 13 | 14 | #define BOOL(x) (!(!(x))) 15 | 16 | #define BitSet(arg, posn) ((arg) | (1L << (posn))) 17 | #define BitClr(arg, posn) ((arg) & ~(1L << (posn))) 18 | #define BitTst(arg, posn) BOOL((arg) & (1L << (posn))) 19 | #define BitFlp(arg, posn) ((arg) ^ (1L << (posn))) 20 | 21 | uint32_t millis(void); 22 | uint32_t micros(void); 23 | uint32_t measure_free_mem(void); 24 | void measure_freqs(void); 25 | #ifdef SDIO_BENCH 26 | void sd_bench(); 27 | #endif 28 | #endif 29 | -------------------------------------------------------------------------------- /sources/Application/Application.h: -------------------------------------------------------------------------------- 1 | #ifndef _APPLICATION_H_ 2 | #define _APPLICATION_H_ 3 | 4 | #include "Foundation/T_Singleton.h" 5 | #include "System/FileSystem/FileSystem.h" 6 | #include "UIFramework/SimpleBaseClasses/GUIWindow.h" 7 | 8 | class Application : public T_Singleton { 9 | 10 | public: 11 | Application(); 12 | ~Application(); 13 | bool Init(GUICreateWindowParams ¶ms); 14 | 15 | GUIWindow *GetWindow(); 16 | 17 | protected: 18 | bool initProject(char *projectName); 19 | void ensurePTDirsExist(); 20 | 21 | private: 22 | GUIWindow *window_; 23 | static Application *instance_; 24 | void createIfNotExists(FileSystem *fs, const char *path); 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /sources/Application/Audio/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application_audio 2 | AudioFileStreamer.cpp 3 | ) 4 | 5 | target_link_libraries(application_audio PUBLIC 6 | system_process 7 | application_model 8 | ) 9 | 10 | target_include_directories(application_audio PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 11 | 12 | include_directories(${PROJECT_SOURCE_DIR}) 13 | -------------------------------------------------------------------------------- /sources/Application/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application 2 | AppWindow.cpp 3 | Application.cpp 4 | ) 5 | 6 | target_link_libraries(application PUBLIC 7 | uiframework_simplebaseclasses 8 | application_mixer 9 | system_process 10 | application_commands 11 | services_midi 12 | application_controllers 13 | application_instruments 14 | application_model 15 | application_persistency 16 | application_player 17 | application_views_baseclasses 18 | application_views 19 | application_views_modaldialogs 20 | uiframework_basicdatas 21 | foundation_variables 22 | ) 23 | 24 | target_include_directories(application PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 25 | 26 | include_directories(${PROJECT_SOURCE_DIR}) 27 | 28 | add_subdirectory(Model) 29 | add_subdirectory(Instruments) 30 | add_subdirectory(Player) 31 | add_subdirectory(Mixer) 32 | add_subdirectory(Utils) 33 | add_subdirectory(Controllers) 34 | add_subdirectory(Commands) 35 | add_subdirectory(Persistency) 36 | add_subdirectory(Views) 37 | add_subdirectory(Audio) 38 | -------------------------------------------------------------------------------- /sources/Application/Commands/ApplicationCommandDispatcher.h: -------------------------------------------------------------------------------- 1 | #ifndef _APPLICATION_COMMAND_DISPATCHER_H_ 2 | #define _APPLICATION_COMMAND_DISPATCHER_H_ 3 | 4 | #include "Application/Model/Project.h" 5 | #include "Foundation/T_Singleton.h" 6 | 7 | class CommandExecuter { 8 | public: 9 | CommandExecuter(){}; 10 | virtual ~CommandExecuter(){}; 11 | virtual void Execute(FourCC id, float value) = 0; 12 | }; 13 | 14 | class ApplicationCommandDispatcher 15 | : public T_Singleton, 16 | public CommandExecuter { 17 | public: 18 | ApplicationCommandDispatcher(); 19 | ~ApplicationCommandDispatcher(); 20 | void Init(Project *project); 21 | void Close(); 22 | virtual void Execute(FourCC id, float value); 23 | void OnTempoTap(); 24 | void OnQueueRow(); 25 | void OnNudgeDown(); 26 | void OnNudgeUp(); 27 | 28 | private: 29 | Project *project_; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /sources/Application/Commands/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application_commands 2 | ApplicationCommandDispatcher.cpp 3 | EventDispatcher.cpp 4 | ) 5 | 6 | target_link_libraries(application_commands PUBLIC 7 | system_process 8 | ) 9 | 10 | target_include_directories(application_commands PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 11 | 12 | include_directories(${PROJECT_SOURCE_DIR}) 13 | -------------------------------------------------------------------------------- /sources/Application/Commands/EventDispatcher.h: -------------------------------------------------------------------------------- 1 | #ifndef _EVENT_DISPATCHER_H_ 2 | #define _EVENT_DISPATCHER_H_ 3 | 4 | #include "Application/AppWindow.h" 5 | #include "ApplicationCommandDispatcher.h" 6 | #include "Foundation/Observable.h" 7 | #include "Foundation/T_Singleton.h" 8 | #include "System/Timer/Timer.h" 9 | 10 | class EventDispatcher : public T_Singleton, 11 | public CommandExecuter, 12 | public I_Observer { 13 | public: 14 | EventDispatcher(); 15 | ~EventDispatcher(); 16 | void SetWindow(GUIWindow *window); 17 | virtual void Execute(FourCC id, float value); 18 | unsigned int OnTimerTick(); 19 | int GetEventMask() { return eventMask_; }; 20 | virtual void Update(Observable &o, I_ObservableData *d); 21 | 22 | private: 23 | GUIWindow *window_; 24 | static int keyRepeat_; 25 | static int keyDelay_; 26 | unsigned int eventMask_; 27 | unsigned int repeatMask_; 28 | I_Timer *timer_; 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /sources/Application/Commands/NodeList.h: -------------------------------------------------------------------------------- 1 | #ifndef _NODE_LIST_H_ 2 | #define _NODE_LIST_H_ 3 | 4 | #define URL_VOLUME_INCREASE "/mixer/volume/increase" 5 | #define URL_VOLUME_DECREASE "/mixer/volume/decrease" 6 | 7 | #define URL_EVENT_PLAY "/event/play" 8 | 9 | #define URL_TEMPO_TAP "/tempo/tap" 10 | #define URL_QUEUE_ROW "/sequencer/current/all/queue" 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /sources/Application/Controllers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application_controllers 2 | ControlRoom.cpp 3 | ) 4 | 5 | target_link_libraries(application_controllers PUBLIC 6 | services_controllers 7 | ) 8 | 9 | target_include_directories(application_controllers PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 10 | 11 | include_directories(${PROJECT_SOURCE_DIR}) 12 | -------------------------------------------------------------------------------- /sources/Application/Controllers/ControlRoom.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CONTROLROOM_H_ 3 | #define _CONTROLROOM_H_ 4 | 5 | #include "Foundation/T_Singleton.h" 6 | #include "Services/Controllers/ControlNode.h" 7 | 8 | class ControlRoom : public T_Singleton, public ControlNode { 9 | public: 10 | ControlRoom(); 11 | ~ControlRoom(); 12 | 13 | bool Init(); 14 | void Close(); 15 | 16 | bool Attach(const char *nodeUrl, const char *controllerUrl); 17 | AssignableControlNode *GetControlNode(const std::string url); 18 | 19 | void Dump(); 20 | }; 21 | #endif 22 | -------------------------------------------------------------------------------- /sources/Application/Instruments/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application_instruments 2 | CommandList.cpp 3 | Filters.cpp 4 | I_Instrument.cpp 5 | InstrumentBank.cpp 6 | InstrumentNameVariable.cpp 7 | MidiInstrument.cpp 8 | OpalInstrument.cpp 9 | NoneInstrument.cpp 10 | SRPUpdaters.cpp 11 | SampleInstrument.cpp 12 | SamplePool.cpp 13 | SampleVariable.cpp 14 | SIDInstrument.cpp 15 | SoundSource.cpp 16 | WavFile.cpp 17 | WavFileWriter.cpp 18 | ) 19 | 20 | target_link_libraries(application_instruments PUBLIC 21 | foundation_services 22 | system_io 23 | crsid 24 | opal 25 | etl 26 | application_utils 27 | profiler 28 | ) 29 | 30 | target_include_directories(application_instruments PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 31 | 32 | include_directories(${PROJECT_SOURCE_DIR}) 33 | -------------------------------------------------------------------------------- /sources/Application/Instruments/CommandList.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _COMMAND_LIST_H_ 3 | #define _COMMAND_LIST_H_ 4 | 5 | #include "Foundation/Types/Types.h" 6 | 7 | class CommandList { 8 | public: 9 | static FourCC GetNext(FourCC current); 10 | static FourCC GetPrev(FourCC current); 11 | static FourCC GetNextAlpha(FourCC current); 12 | static FourCC GetPrevAlpha(FourCC current); 13 | 14 | // Applies command-specific range limits to parameter values 15 | // Currently handles: 16 | // - VEL: Ensures MIDI velocity values don't exceed 127 (0x7F) 17 | // Can be extended to handle other commands in the future 18 | // Returns the range-limited parameter value 19 | static ushort RangeLimitCommandParam(FourCC command, ushort paramValue); 20 | }; 21 | #endif 22 | -------------------------------------------------------------------------------- /sources/Application/Instruments/I_SRPUpdater.h: -------------------------------------------------------------------------------- 1 | #ifndef _I_SRP_UPDATER_H_ 2 | #define _I_SRP_UPDATER_H_ 3 | 4 | #include "Application/Utils/fixed.h" 5 | 6 | struct RUParams { 7 | fixed volumeOffset_; 8 | fixed speedOffset_; 9 | fixed cutOffset_; 10 | fixed resOffset_; 11 | fixed panOffset_; 12 | fixed fbMixOffset_; 13 | fixed fbTunOffset_; 14 | }; 15 | 16 | class I_SRPUpdater { 17 | public: 18 | I_SRPUpdater(){}; 19 | virtual ~I_SRPUpdater(){}; 20 | virtual void Trigger(bool tableTick) = 0; 21 | virtual void UpdateSRP(struct RUParams &rup) = 0; 22 | void Enable() { enabled_ = true; }; 23 | void Disable() { enabled_ = false; }; 24 | bool Enabled() { return enabled_; }; 25 | 26 | protected: 27 | bool enabled_ = false; 28 | }; 29 | #endif 30 | -------------------------------------------------------------------------------- /sources/Application/Instruments/InstrumentNameVariable.cpp: -------------------------------------------------------------------------------- 1 | #include "InstrumentNameVariable.h" 2 | 3 | InstrumentNameVariable::InstrumentNameVariable(I_Instrument *instrument) 4 | : Variable(FourCC::InstrumentName, instrument->GetUserSetName().c_str()), 5 | instrument_(instrument) { 6 | // Initialize with the instrument's user-set name only, not the display name 7 | // This ensures we don't automatically populate the name field with the sample 8 | // filename 9 | } 10 | 11 | InstrumentNameVariable::~InstrumentNameVariable() {} 12 | 13 | etl::string InstrumentNameVariable::GetString() { 14 | // Get the name directly from the instrument 15 | return instrument_->GetUserSetName(); 16 | } 17 | 18 | void InstrumentNameVariable::SetString(const char *string, bool notify) { 19 | // Set the name directly on the instrument 20 | instrument_->SetName(string); 21 | 22 | // Notify observers if requested 23 | if (notify) { 24 | SetChanged(); 25 | NotifyObservers(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sources/Application/Instruments/InstrumentNameVariable.h: -------------------------------------------------------------------------------- 1 | #ifndef _INSTRUMENT_NAME_VARIABLE_H_ 2 | #define _INSTRUMENT_NAME_VARIABLE_H_ 3 | 4 | #include "Foundation/Observable.h" 5 | #include "Foundation/Variables/Variable.h" 6 | #include "I_Instrument.h" 7 | 8 | // A special Variable class that bridges between UITextField and I_Instrument's 9 | // name_ field 10 | class InstrumentNameVariable : public Variable, public Observable { 11 | public: 12 | InstrumentNameVariable(I_Instrument *instrument); 13 | virtual ~InstrumentNameVariable(); 14 | 15 | // Reimplement Variable methods to interact with the instrument's name 16 | etl::string GetString(); 17 | void SetString(const char *string, bool notify = true); 18 | 19 | private: 20 | I_Instrument *instrument_; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /sources/Application/Instruments/SampleVariable.cpp: -------------------------------------------------------------------------------- 1 | #include "SampleVariable.h" 2 | #include "SamplePool.h" 3 | 4 | SampleVariable::SampleVariable(FourCC id) : WatchedVariable(id, 0, 0, -1) { 5 | SamplePool *pool = SamplePool::GetInstance(); 6 | list_.char_ = pool->GetNameList(); 7 | listSize_ = pool->GetNameListSize(); 8 | pool->AddObserver(*this); 9 | }; 10 | 11 | SampleVariable::~SampleVariable() { 12 | SamplePool *pool = SamplePool::GetInstance(); 13 | pool->RemoveObserver(*this); 14 | }; 15 | 16 | void SampleVariable::Update(Observable &o, I_ObservableData *d) { 17 | SamplePoolEvent *e = (SamplePoolEvent *)d; 18 | // if we recieved notification that an element has been removed 19 | // we shift down all the index above the removed element 20 | if (e->type_ == SPET_DELETE) { 21 | NAssert(e->index_ != value_.index_); 22 | if (value_.index_ > e->index_) { 23 | value_.index_--; 24 | }; 25 | }; 26 | SamplePool *pool = (SamplePool *)&o; 27 | list_.char_ = pool->GetNameList(); 28 | listSize_ = pool->GetNameListSize(); 29 | }; 30 | -------------------------------------------------------------------------------- /sources/Application/Instruments/SampleVariable.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SAMPLE_VARIABLE_H_ 3 | #define _SAMPLE_VARIABLE_H_ 4 | 5 | #include "Foundation/Observable.h" 6 | #include "Foundation/Variables/WatchedVariable.h" 7 | 8 | class SampleVariable : public WatchedVariable, public I_Observer { 9 | public: 10 | SampleVariable(FourCC id); 11 | ~SampleVariable(); 12 | 13 | protected: 14 | virtual void Update(Observable &o, I_ObservableData *d); 15 | }; 16 | #endif 17 | -------------------------------------------------------------------------------- /sources/Application/Instruments/SoundSource.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/sources/Application/Instruments/SoundSource.cpp -------------------------------------------------------------------------------- /sources/Application/Instruments/SoundSource.h: -------------------------------------------------------------------------------- 1 | #ifndef _SOUND_SOURCE_H_ 2 | #define _SOUND_SOURCE_H_ 3 | 4 | class SoundSource { 5 | public: 6 | SoundSource(){}; 7 | virtual ~SoundSource(){}; 8 | virtual int GetLoopStart(int note) { return -1; }; 9 | virtual int GetLoopEnd(int note) { return -1; }; 10 | virtual int GetSize(int note) = 0; 11 | virtual int GetSampleRate(int note) = 0; 12 | virtual int GetChannelCount(int note) = 0; 13 | virtual void *GetSampleBuffer(int note) = 0; 14 | virtual bool IsMulti() = 0; 15 | virtual int GetRootNote(int note) = 0; 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /sources/Application/Instruments/WavFileWriter.h: -------------------------------------------------------------------------------- 1 | #ifndef _WAV_FILE_WRITER_H_ 2 | #define _WAV_FILE_WRITER_H_ 3 | 4 | #include "Application/Utils/fixed.h" 5 | #include "System/FileSystem/FileSystem.h" 6 | 7 | class WavFileWriter { 8 | public: 9 | WavFileWriter(const char *path); 10 | ~WavFileWriter(); 11 | void AddBuffer(fixed *, int size); // size in samples 12 | void Close(); 13 | 14 | private: 15 | int sampleCount_; 16 | short *buffer_; 17 | int bufferSize_; 18 | I_File *file_; 19 | }; 20 | #endif 21 | -------------------------------------------------------------------------------- /sources/Application/Mixer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application_mixer 2 | MixBus.cpp 3 | MixerService.cpp 4 | ) 5 | 6 | target_link_libraries(application_mixer PUBLIC 7 | application_audio 8 | system_console 9 | platform 10 | ) 11 | 12 | target_include_directories(application_mixer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 13 | 14 | include_directories(${PROJECT_SOURCE_DIR}) 15 | -------------------------------------------------------------------------------- /sources/Application/Mixer/MixBus.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "MixBus.h" 3 | -------------------------------------------------------------------------------- /sources/Application/Mixer/MixBus.h: -------------------------------------------------------------------------------- 1 | #ifndef _MIX_BUS_H_ 2 | #define _MIX_BUS_H_ 3 | 4 | #include "Services/Audio/AudioMixer.h" 5 | 6 | class MixBus : public AudioMixer { 7 | public: 8 | MixBus() : AudioMixer("bus"){}; 9 | virtual ~MixBus(){}; 10 | }; 11 | #endif 12 | -------------------------------------------------------------------------------- /sources/Application/Model/BuildNumber.h: -------------------------------------------------------------------------------- 1 | #define BUILD_COUNT "003" 2 | -------------------------------------------------------------------------------- /sources/Application/Model/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application_model 2 | Chain.cpp 3 | Config.cpp 4 | Groove.cpp 5 | Mixer.cpp 6 | Phrase.cpp 7 | Project.cpp 8 | Scale.cpp 9 | Song.cpp 10 | Table.cpp 11 | ) 12 | 13 | target_link_libraries(application_model PUBLIC 14 | system_system 15 | foundation_variables 16 | application_utils 17 | ) 18 | 19 | target_include_directories(application_model PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 20 | 21 | include_directories(${PROJECT_SOURCE_DIR}) 22 | -------------------------------------------------------------------------------- /sources/Application/Model/Chain.cpp: -------------------------------------------------------------------------------- 1 | #include "Chain.h" 2 | #include "System/System/System.h" 3 | #include 4 | #include 5 | 6 | Chain::Chain() { 7 | 8 | for (int i = 0; i < CHAIN_COUNT * 16; i++) { 9 | data_[i] = 0xFF; 10 | transpose_[i] = 0x00; 11 | } 12 | for (int i = 0; i < CHAIN_COUNT; i++) { 13 | isUsed_[i] = false; 14 | } 15 | }; 16 | 17 | Chain::~Chain(){}; 18 | 19 | unsigned short Chain::GetNext() { 20 | for (int i = 0; i < CHAIN_COUNT; i++) { 21 | if (!isUsed_[i]) { 22 | isUsed_[i] = true; 23 | return i; 24 | } 25 | } 26 | return NO_MORE_CHAIN; 27 | }; 28 | 29 | void Chain::SetUsed(unsigned char c) { isUsed_[c] = true; } 30 | 31 | void Chain::ClearAllocation() { 32 | 33 | for (int i = 0; i < CHAIN_COUNT; i++) { 34 | isUsed_[i] = false; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /sources/Application/Model/Chain.h: -------------------------------------------------------------------------------- 1 | #ifndef _CHAIN_H_ 2 | #define _CHAIN_H_ 3 | 4 | #include 5 | 6 | #define CHAIN_COUNT 0xFF 7 | #define NO_MORE_CHAIN 0x100 8 | 9 | class Chain { 10 | public: 11 | Chain(); 12 | ~Chain(); 13 | unsigned short GetNext(); 14 | bool IsUsed(unsigned char i) { return isUsed_[i]; }; 15 | void SetUsed(unsigned char c); 16 | void ClearAllocation(); 17 | 18 | unsigned char data_[CHAIN_COUNT * 16]; 19 | unsigned char transpose_[CHAIN_COUNT * 16]; 20 | 21 | private: 22 | std::bitset isUsed_; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /sources/Application/Model/Mixer.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Mixer.h" 3 | 4 | Mixer::Mixer() : Persistent("MIXER") { Clear(); }; 5 | 6 | Mixer::~Mixer(){}; 7 | 8 | void Mixer::Clear() { 9 | 10 | for (int i = 0; i < SONG_CHANNEL_COUNT; i++) { 11 | channelBus_[i] = i; 12 | } 13 | }; 14 | 15 | void Mixer::SaveContent(tinyxml2::XMLPrinter *printer){}; 16 | 17 | void Mixer::RestoreContent(PersistencyDocument *doc) {} 18 | -------------------------------------------------------------------------------- /sources/Application/Model/Mixer.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MIXER_H_ 3 | #define _MIXER_H_ 4 | 5 | #include "Application/Persistency/Persistent.h" 6 | #include "Foundation/T_Singleton.h" 7 | 8 | #include "Application/Utils/fixed.h" 9 | #include "Song.h" 10 | 11 | class Mixer : public T_Singleton, Persistent { 12 | public: 13 | Mixer(); 14 | ~Mixer(); 15 | void Clear(); 16 | 17 | inline int GetBus(int i) { return channelBus_[i]; }; 18 | 19 | virtual void SaveContent(tinyxml2::XMLPrinter *printer); 20 | virtual void RestoreContent(PersistencyDocument *doc); 21 | 22 | private: 23 | char channelBus_[SONG_CHANNEL_COUNT]; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /sources/Application/Model/Phrase.cpp: -------------------------------------------------------------------------------- 1 | #include "Phrase.h" 2 | #include "System/System/System.h" 3 | #include 4 | #include 5 | 6 | Phrase::Phrase() { 7 | for (int i = 0; i < PHRASE_COUNT * 16; i++) { 8 | note_[i] = 0xFF; 9 | instr_[i] = 0xFF; 10 | cmd1_[i] = FourCC::InstrumentCommandNone; 11 | param1_[i] = 0x00; 12 | cmd2_[i] = FourCC::InstrumentCommandNone; 13 | param2_[i] = 0x00; 14 | } 15 | for (int i = 0; i < PHRASE_COUNT; i++) { 16 | isUsed_[i] = false; 17 | } 18 | }; 19 | 20 | Phrase::~Phrase(){}; 21 | 22 | unsigned short Phrase::GetNext() { 23 | for (int i = 0; i < PHRASE_COUNT; i++) { 24 | if (!isUsed_[i]) { 25 | isUsed_[i] = true; 26 | return i; 27 | } 28 | } 29 | return NO_MORE_PHRASE; 30 | }; 31 | 32 | void Phrase::SetUsed(unsigned char c) { isUsed_[c] = true; } 33 | 34 | void Phrase::ClearAllocation() { 35 | 36 | for (int i = 0; i < PHRASE_COUNT; i++) { 37 | isUsed_[i] = false; 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /sources/Application/Model/Phrase.h: -------------------------------------------------------------------------------- 1 | #ifndef _PHRASE_H_ 2 | #define _PHRASE_H_ 3 | 4 | #include "Foundation/Types/Types.h" 5 | #define PHRASE_COUNT 0x80 6 | #define NO_MORE_PHRASE 0x81 7 | 8 | class Phrase { 9 | public: 10 | Phrase(); 11 | ~Phrase(); 12 | unsigned short GetNext(); 13 | bool IsUsed(uchar i) { return isUsed_[i]; }; 14 | void SetUsed(uchar c); 15 | void ClearAllocation(); 16 | 17 | uchar note_[PHRASE_COUNT * 16]; 18 | uchar instr_[PHRASE_COUNT * 16]; 19 | FourCC cmd1_[PHRASE_COUNT * 16]; 20 | ushort param1_[PHRASE_COUNT * 16]; 21 | FourCC cmd2_[PHRASE_COUNT * 16]; 22 | ushort param2_[PHRASE_COUNT * 16]; 23 | 24 | private: 25 | bool isUsed_[PHRASE_COUNT]; 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /sources/Application/Model/Scale.h: -------------------------------------------------------------------------------- 1 | #ifndef SCALE_VIEW_H 2 | #define SCALE_VIEW_H 3 | 4 | #include "Application/Utils/char.h" 5 | #include 6 | 7 | const int numScales = 44; 8 | extern const char *scaleNames[numScales]; 9 | extern const bool scaleSteps[numScales][12]; 10 | 11 | // Function that calculates semitone offset based on scale, position in scale, 12 | // and root note 13 | uint8_t getSemitonesOffset(uint8_t scale, uint8_t number, uint8_t root); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /sources/Application/Model/Song.h: -------------------------------------------------------------------------------- 1 | #ifndef _SONG_H_ 2 | #define _SONG_H_ 3 | 4 | #include "Application/Persistency/Persistent.h" 5 | #include "Chain.h" 6 | #include "Phrase.h" 7 | 8 | #define SONG_CHANNEL_COUNT 8 9 | #define SONG_ROW_COUNT 128 10 | 11 | #define MAX_SAMPLEINSTRUMENT_COUNT 0x10 12 | #define MAX_SIDINSTRUMENT_COUNT 0x03 13 | #define MAX_MIDIINSTRUMENT_COUNT 0x10 14 | #define MAX_OPALINSTRUMENT_COUNT 0x03 15 | #define MAX_MACROINSTRUMENT_COUNT 0x01 16 | 17 | #define MAX_INSTRUMENT_COUNT \ 18 | (MAX_SAMPLEINSTRUMENT_COUNT + MAX_MIDIINSTRUMENT_COUNT + \ 19 | MAX_SIDINSTRUMENT_COUNT + MAX_OPALINSTRUMENT_COUNT + \ 20 | MAX_MACROINSTRUMENT_COUNT) 21 | 22 | class Song : Persistent { 23 | public: 24 | Song(); 25 | ~Song(); 26 | 27 | virtual void SaveContent(tinyxml2::XMLPrinter *printer); 28 | virtual void RestoreContent(PersistencyDocument *doc); 29 | 30 | unsigned char data_[SONG_CHANNEL_COUNT * SONG_ROW_COUNT]; 31 | Chain chain_; 32 | Phrase phrase_; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /sources/Application/Persistency/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application_persistency 2 | Persistent.cpp 3 | PersistencyService.cpp 4 | PersistencyDocument.cpp 5 | ) 6 | 7 | target_link_libraries(application_persistency PUBLIC 8 | foundation_services 9 | yxml 10 | tinyxml2 11 | etl 12 | application_model 13 | ) 14 | 15 | target_include_directories(application_persistency PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 16 | 17 | include_directories(${PROJECT_SOURCE_DIR}) 18 | -------------------------------------------------------------------------------- /sources/Application/Persistency/PersistenceConstants.h: -------------------------------------------------------------------------------- 1 | #ifndef _PERSISTENCE_CONSTANTS_H_ 2 | #define _PERSISTENCE_CONSTANTS_H_ 3 | 4 | #define MAX_PROJECT_NAME_LENGTH 16 5 | #define MAX_INSTRUMENT_FILENAME_LENGTH 24 6 | #define MAX_THEME_NAME_LENGTH 16 7 | #define MAX_THEME_EXPORT_PATH_LENGTH \ 8 | (MAX_THEME_NAME_LENGTH + strlen(THEMES_DIR) + 1 + \ 9 | strlen(THEME_FILE_EXTENSION)) 10 | // accounts for .pti extension 11 | #define MAX_INSTRUMENT_NAME_LENGTH (MAX_INSTRUMENT_FILENAME_LENGTH - 4) 12 | 13 | #define PROJECTS_DIR "/projects" 14 | #define PROJECT_SAMPLES_DIR "samples" 15 | #define SAMPLES_LIB_DIR "/samples" 16 | #define INSTRUMENTS_DIR "/instruments" 17 | #define RENDERS_DIR "/renders" 18 | #define THEMES_DIR "/themes" 19 | #define INSTRUMENT_FILE_EXTENSION ".pti" 20 | #define THEME_FILE_EXTENSION ".ptt" 21 | 22 | #endif // _PERSISTENCE_CONSTANTS_H_ -------------------------------------------------------------------------------- /sources/Application/Persistency/PersistencyDocument.h: -------------------------------------------------------------------------------- 1 | #ifndef _PERSISTENCY_DOCUMENT_H_ 2 | #define _PERSISTENCY_DOCUMENT_H_ 3 | 4 | #include "Externals/yxml/yxml.h" 5 | #include "System/FileSystem/FileSystem.h" 6 | #include "System/FileSystem/I_File.h" 7 | 8 | class PersistencyDocument { 9 | public: 10 | PersistencyDocument(); 11 | bool Load(const char *filename); 12 | 13 | bool FirstChild(); 14 | bool NextSibling(); 15 | bool NextAttribute(); 16 | bool HasContent(); 17 | char *ElemName(); 18 | 19 | char attrname_[64]; 20 | char attrval_[64]; 21 | char content_[129]; // 128 + \0 22 | yxml_ret_t r_; 23 | 24 | int version_; 25 | 26 | private: 27 | inline static char stack_[1024]; 28 | inline static yxml_t state_[1]; 29 | I_File *fp_; 30 | }; 31 | #endif 32 | -------------------------------------------------------------------------------- /sources/Application/Persistency/Persistent.cpp: -------------------------------------------------------------------------------- 1 | #include "Persistent.h" 2 | #include "Foundation/Types/Types.h" 3 | 4 | Persistent::Persistent(const char *nodeName) 5 | : SubService(FourCC::ServicePersistency) { 6 | nodeName_ = nodeName; 7 | }; 8 | 9 | void Persistent::Save(tinyxml2::XMLPrinter *printer) { 10 | printer->OpenElement(nodeName_); 11 | SaveContent(printer); 12 | printer->CloseElement(); 13 | }; 14 | 15 | bool Persistent::Restore(PersistencyDocument *doc) { 16 | if (!strcmp(doc->ElemName(), nodeName_)) { 17 | RestoreContent(doc); 18 | return true; 19 | } 20 | return false; 21 | }; 22 | -------------------------------------------------------------------------------- /sources/Application/Persistency/Persistent.h: -------------------------------------------------------------------------------- 1 | #ifndef _PERSISTENT_H_ 2 | #define _PERSISTENT_H_ 3 | 4 | #include "Application/Persistency/PersistencyDocument.h" 5 | #include "Externals/TinyXML2/tinyxml2.h" 6 | #include "Foundation/Services/SubService.h" 7 | 8 | class Persistent : SubService { 9 | public: 10 | Persistent(const char *nodeName); 11 | void Save(tinyxml2::XMLPrinter *printer); 12 | bool Restore(PersistencyDocument *doc); 13 | 14 | protected: 15 | virtual void SaveContent(tinyxml2::XMLPrinter *printer) = 0; 16 | virtual void RestoreContent(PersistencyDocument *doc) = 0; 17 | 18 | private: 19 | const char *nodeName_; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /sources/Application/Player/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application_player 2 | Player.cpp 3 | PlayerChannel.cpp 4 | PlayerMixer.cpp 5 | SyncMaster.cpp 6 | TablePlayback.cpp 7 | ) 8 | 9 | target_link_libraries(application_player PUBLIC 10 | application_mixer 11 | application_audio 12 | application_model 13 | ) 14 | 15 | target_include_directories(application_player PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 16 | 17 | include_directories(${PROJECT_SOURCE_DIR}) 18 | -------------------------------------------------------------------------------- /sources/Application/Player/PlayerChannel.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PLAYER_CHANNEL_H_ 3 | #define _PLAYER_CHANNEL_H_ 4 | 5 | #include "Application/Instruments/I_Instrument.h" 6 | #include "Application/Mixer/MixBus.h" 7 | #include "Services/Audio/AudioModule.h" 8 | 9 | class PlayerChannel : public AudioModule { 10 | public: 11 | PlayerChannel(int index); 12 | virtual ~PlayerChannel(); 13 | virtual bool Render(fixed *buffer, int samplecount); 14 | void StartInstrument(I_Instrument *instr, unsigned char note, 15 | bool cleanStart); 16 | void StopInstrument(); 17 | I_Instrument *GetInstrument(); 18 | void SetMute(bool muted); 19 | bool IsMuted(); 20 | void SetMixBus(int i); 21 | void Reset(); 22 | 23 | private: 24 | int index_; 25 | I_Instrument *instr_; 26 | bool muted_; 27 | int busIndex_; 28 | MixBus *mixBus_; 29 | }; 30 | 31 | #endif -------------------------------------------------------------------------------- /sources/Application/Player/SyncMaster.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYNC_MASTER_H_ 2 | #define _SYNC_MASTER_H_ 3 | 4 | #include "Foundation/T_Singleton.h" 5 | 6 | // Provide basic functionalities to compute various 7 | // setting regarding tempo, buffer sizes, ticks 8 | 9 | class SyncMaster : public T_Singleton { 10 | public: 11 | SyncMaster(); 12 | void Start(); 13 | void Stop(); 14 | void SetTempo(int tempo); 15 | int GetTempo(); 16 | void NextSlice(); 17 | bool MajorSlice(); 18 | bool TableSlice(); 19 | bool MidiSlice(); 20 | float GetPlaySampleCount(); 21 | float GetTickSampleCount(); 22 | int GetTableRatio(); 23 | void SetTableRatio(int ratio); 24 | unsigned int GetBeatCount(); 25 | float GetTickTime(); 26 | 27 | private: 28 | int tempo_; 29 | int currentSlice_; 30 | int tableRatio_; 31 | unsigned int beatCount_; 32 | float playSampleCount_; 33 | float tickSampleCount_; 34 | }; 35 | #endif 36 | -------------------------------------------------------------------------------- /sources/Application/Utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application_utils 2 | HexBuffers.cpp 3 | char.cpp 4 | fixed.cpp 5 | stringutils.cpp 6 | ) 7 | 8 | target_link_libraries(application_utils PUBLIC 9 | etl 10 | ) 11 | 12 | target_include_directories(application_utils PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 13 | 14 | include_directories(${PROJECT_SOURCE_DIR}) 15 | -------------------------------------------------------------------------------- /sources/Application/Utils/HexBuffers.h: -------------------------------------------------------------------------------- 1 | #ifndef _HEX_BUFFERS_H_ 2 | #define _HEX_BUFFERS_H_ 3 | 4 | #include "Application/Persistency/PersistencyDocument.h" 5 | #include "Externals/TinyXML2/tinyxml2.h" 6 | #include "Foundation/Types/Types.h" 7 | 8 | void saveHexBuffer(tinyxml2::XMLPrinter *printer, const char *nodeName, 9 | unsigned char *src, unsigned len); 10 | void saveHexBuffer(tinyxml2::XMLPrinter *printer, const char *nodeName, 11 | unsigned short *src, unsigned len); 12 | void saveHexBuffer(tinyxml2::XMLPrinter *printer, const char *nodeName, 13 | unsigned int *src, unsigned len); 14 | void saveHexBuffer(tinyxml2::XMLPrinter *printer, const char *nodeName, 15 | FourCC *src, unsigned len); 16 | void restoreHexBuffer(PersistencyDocument *doc, unsigned char *dst); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /sources/Application/Utils/bit.h: -------------------------------------------------------------------------------- 1 | #ifndef BIT_H 2 | #define BIT_H 3 | 4 | #define BitSet(arg, posn) ((arg) | (1L << (posn))) 5 | #define BitClr(arg, posn) ((arg) & ~(1L << (posn))) 6 | #define BitTst(arg, posn) BOOL((arg) & (1L << (posn))) 7 | #define BitFlp(arg, posn) ((arg) ^ (1L << (posn))) 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /sources/Application/Utils/char.cpp: -------------------------------------------------------------------------------- 1 | #include "char.h" 2 | 3 | char h2c__[16] = {'0', '1', '2', '3', '4', '5', '6', '7', 4 | '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; 5 | 6 | const char *noteNames[12] = {"C ", "C#", "D ", "D#", "E ", "F ", 7 | "F#", "G ", "G#", "A ", "A#", "B "}; 8 | -------------------------------------------------------------------------------- /sources/Application/Utils/fixed.cpp: -------------------------------------------------------------------------------- 1 | // fixed point numbers 2 | 3 | #include "fixed.h" 4 | -------------------------------------------------------------------------------- /sources/Application/Utils/mathutils.h: -------------------------------------------------------------------------------- 1 | // Helper function to convert linear amplitude to dB 2 | inline int amplitudeToDb(int amplitude) { 3 | if (amplitude <= 0) { 4 | return -100; // Or some other minimum value for silence 5 | } 6 | return static_cast(20.0 * 7 | log10(static_cast(amplitude) / 32767.0)); 8 | } -------------------------------------------------------------------------------- /sources/Application/Utils/stringutils.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char getNext(char c, bool reverse) { 5 | // Valid characters in order 6 | const char validChars[] = 7 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._"; 8 | const int numChars = sizeof(validChars) - 1; // Exclude null terminator 9 | 10 | // Find the index of the current character 11 | for (int i = 0; i < numChars; ++i) { 12 | if (validChars[i] == c) { 13 | // Calculate next index based on direction (forward or reverse) 14 | int nextIndex = 15 | reverse ? (i - 1 + numChars) % numChars : (i + 1) % numChars; 16 | return validChars[nextIndex]; 17 | } 18 | } 19 | 20 | // If character is not valid, return the first valid character in the list 21 | return reverse ? validChars[numChars - 1] : validChars[0]; 22 | }; -------------------------------------------------------------------------------- /sources/Application/Utils/stringutils.h: -------------------------------------------------------------------------------- 1 | char getNext(char c, bool reverse); -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application_views_baseclasses 2 | I_Action.cpp 3 | ModalView.cpp 4 | UIActionField.cpp 5 | UIBigHexVarField.cpp 6 | UIField.cpp 7 | UIIntField.cpp 8 | UIIntVarField.cpp 9 | UIIntVarOffField.cpp 10 | UINoteVarField.cpp 11 | UISortedVarList.cpp 12 | UIStaticField.cpp 13 | UITempoField.cpp 14 | UISwatchField.cpp 15 | UIBitmaskVarField.cpp 16 | View.cpp 17 | ViewEvent.cpp 18 | ) 19 | 20 | target_link_libraries(application_views_baseclasses PUBLIC 21 | application_utils 22 | system_console 23 | ) 24 | 25 | target_include_directories(application_views_baseclasses PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 26 | 27 | include_directories(${PROJECT_SOURCE_DIR}) 28 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/I_Action.cpp: -------------------------------------------------------------------------------- 1 | #include "I_Action.h" 2 | 3 | I_Action::I_Action(char *name) { name_ = name; }; 4 | 5 | I_Action::~I_Action(){}; 6 | 7 | char *I_Action::GetName() { return name_; }; 8 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/I_Action.h: -------------------------------------------------------------------------------- 1 | #ifndef _I_ACTION_H_ 2 | #define _I_ACTION_H_ 3 | 4 | class I_Action { 5 | public: 6 | I_Action(char *name); 7 | virtual ~I_Action(); 8 | char *GetName(); 9 | virtual void Do() = 0; 10 | 11 | private: 12 | char *name_; 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/ModalView.h: -------------------------------------------------------------------------------- 1 | #ifndef _MODAL_VIEW_H_ 2 | #define _MODAL_VIEW_H_ 3 | 4 | #include "View.h" 5 | 6 | class ModalView : public View { 7 | public: 8 | ModalView(View &); 9 | virtual ~ModalView(); 10 | 11 | bool IsFinished(); 12 | int GetReturnCode(); 13 | 14 | protected: 15 | void SetWindow(int width, int height); 16 | virtual void ClearRect(int x, int y, int w, int h); 17 | virtual void DrawString(int x, int y, const char *txt, 18 | GUITextProperties &props); 19 | void EndModal(int returnCode); 20 | 21 | // Override GetAnchor to account for modal window position 22 | virtual GUIPoint GetAnchor(); 23 | 24 | private: 25 | bool finished_; 26 | int returnCode_; 27 | int left_; 28 | int top_; 29 | }; 30 | #endif -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIActionField.cpp: -------------------------------------------------------------------------------- 1 | #include "UIActionField.h" 2 | #include "Application/AppWindow.h" 3 | 4 | UIActionField::UIActionField(const char *name, unsigned int fourcc, 5 | GUIPoint &position) 6 | : UIField(position) { 7 | name_ = name; 8 | fourcc_ = fourcc; 9 | }; 10 | 11 | UIActionField::~UIActionField(){ 12 | 13 | }; 14 | void UIActionField::Draw(GUIWindow &w, int offset) { 15 | 16 | GUITextProperties props; 17 | GUIPoint position(x_, y_ + offset); 18 | 19 | if (focus_) { 20 | ((AppWindow &)w).SetColor(CD_HILITE2); 21 | props.invert_ = true; 22 | } else { 23 | ((AppWindow &)w).SetColor(CD_NORMAL); 24 | } 25 | 26 | w.DrawString(name_, position, props); 27 | }; 28 | 29 | void UIActionField::OnClick() { 30 | SetChanged(); 31 | NotifyObservers((I_ObservableData *)fourcc_); 32 | }; 33 | 34 | const char *UIActionField::GetString() { return name_; }; 35 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIActionField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_ACTION_FIELD_ 2 | #define _UI_ACTION_FIELD_ 3 | 4 | #include "Foundation/Observable.h" 5 | #include "UIField.h" 6 | 7 | class UIActionField : public UIField, public Observable { 8 | public: 9 | UIActionField(const char *name, unsigned int fourcc, GUIPoint &position); 10 | 11 | virtual ~UIActionField(); 12 | virtual void Draw(GUIWindow &w, int offset = 0); 13 | virtual void ProcessArrow(unsigned short mask){}; 14 | virtual void OnClick(); 15 | const char *GetString(); 16 | 17 | protected: 18 | const char *name_; 19 | unsigned int fourcc_; 20 | }; 21 | #endif 22 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIBigHexVarField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_BIG_HEX_VAR_FIELD_H_ 2 | #define _UI_BIG_HEX_VAR_FIELD_H_ 3 | 4 | #include "Foundation/Observable.h" 5 | #include "UIIntVarField.h" 6 | 7 | class UIBigHexVarField : public UIIntVarField { 8 | 9 | public: 10 | UIBigHexVarField(GUIPoint &position, Variable &v, int precision, 11 | const char *format, int min, int max, int power, 12 | bool wrap = false); 13 | virtual ~UIBigHexVarField(){}; 14 | virtual void Draw(GUIWindow &w, int offset = 0); 15 | virtual void ProcessArrow(unsigned short mask); 16 | 17 | private: 18 | unsigned int precision_; 19 | unsigned int power_; 20 | unsigned int position_; 21 | bool wrap_; 22 | }; 23 | #endif 24 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIBitmaskVarField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_BITMASK_VAR_FIELD_H_ 2 | #define _UI_BITMASK_VAR_FIELD_H_ 3 | 4 | #include "Foundation/Observable.h" 5 | #include "UIIntVarField.h" 6 | 7 | // Display a UI field of boolean flags stored as an integer representing a 8 | // bitmask, ie. each bit in the byte of the variable is a single boolean flag 9 | class UIBitmaskVarField : public UIIntVarField { 10 | 11 | public: 12 | UIBitmaskVarField(GUIPoint &position, Variable &v, const char *format, 13 | int len); 14 | virtual ~UIBitmaskVarField(){}; 15 | virtual void Draw(GUIWindow &w, int offset = 0); 16 | virtual void ProcessArrow(unsigned short mask); 17 | 18 | private: 19 | unsigned int len_; 20 | unsigned int position_ = 0; 21 | }; 22 | #endif 23 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIField.cpp: -------------------------------------------------------------------------------- 1 | #include "UIField.h" 2 | 3 | UIField::UIField(GUIPoint &position) { 4 | x_ = position._x; 5 | y_ = position._y; 6 | focus_ = false; 7 | }; 8 | 9 | UIField::~UIField(){}; 10 | 11 | GUIPoint UIField::GetPosition() { 12 | GUIPoint point(x_, y_); 13 | return point; 14 | } 15 | 16 | void UIField::SetPosition(GUIPoint &p) { 17 | x_ = p._x; 18 | y_ = p._y; 19 | }; 20 | 21 | void UIField::ClearFocus() { focus_ = false; }; 22 | 23 | void UIField::SetFocus() { focus_ = true; }; 24 | 25 | bool UIField::HasFocus() { return focus_; }; 26 | 27 | bool UIField::IsStatic() { return false; }; 28 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_FIELD_H_ 2 | #define _UI_FIELD_H_ 3 | 4 | #include "System/Console/Trace.h" 5 | #include "UIFramework/BasicDatas/GUIPoint.h" 6 | #include "UIFramework/SimpleBaseClasses/GUIWindow.h" 7 | #include "View.h" 8 | 9 | class UIField { 10 | public: 11 | UIField(GUIPoint &position); 12 | virtual ~UIField(); 13 | virtual void Draw(GUIWindow &w, int offset = 0) = 0; 14 | virtual void OnClick() = 0; // ENTER pressed 15 | virtual void ProcessArrow(unsigned short mask) = 0; 16 | virtual void OnEditClick(){}; // EDIT pressed 17 | virtual void ProcessEditArrow(unsigned short mask){}; 18 | void SetFocus(); 19 | void ClearFocus(); 20 | bool HasFocus(); 21 | void SetPosition(GUIPoint &); 22 | GUIPoint GetPosition(); 23 | GUIColor GetColor(); 24 | 25 | virtual bool IsStatic(); 26 | 27 | protected: 28 | uint8_t x_; 29 | uint8_t y_; 30 | bool focus_; 31 | }; 32 | #endif 33 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIIntField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_INT_FIELD_H_ 2 | #define _UI_INT_FIELD_H_ 3 | 4 | #include "UIField.h" 5 | 6 | class UIIntField : public UIField { 7 | 8 | public: 9 | UIIntField(GUIPoint &position, int *src, const char *format, int min, int max, 10 | int xOffset, int yOffset); 11 | virtual ~UIIntField(){}; 12 | virtual void Draw(GUIWindow &w); 13 | virtual void ProcessArrow(unsigned short mask); 14 | virtual void OnClick(){}; 15 | 16 | protected: 17 | protected: 18 | int *src_; 19 | const char *format_; 20 | int min_; 21 | int max_; 22 | int xOffset_; 23 | int yOffset_; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIIntVarField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_INT_VAR_FIELD_H_ 2 | #define _UI_INT_VAR_FIELD_H_ 3 | 4 | #include "Foundation/Variables/Variable.h" 5 | #include "UIField.h" 6 | 7 | class UIIntVarField : public UIField, public Observable { 8 | 9 | public: 10 | UIIntVarField(GUIPoint &position, Variable &v, const char *format, int min, 11 | int max, int xOffset, int yOffset, int displayOffset = 0); 12 | 13 | virtual ~UIIntVarField(){}; 14 | virtual void Draw(GUIWindow &w, int offset = 0); 15 | virtual void ProcessArrow(unsigned short mask); 16 | virtual void OnClick(){}; 17 | 18 | FourCC GetVariableID(); 19 | Variable &GetVariable(); 20 | 21 | protected: 22 | Variable &src_; 23 | const char *format_; 24 | int min_; 25 | int max_; 26 | int xOffset_; 27 | int yOffset_; 28 | int displayOffset_; 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIIntVarOffField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_INT_VAR_OFF_FIELD_H_ 2 | #define _UI_INT_VAR_OFF_FIELD_H_ 3 | 4 | #include "UIIntVarField.h" 5 | 6 | class UIIntVarOffField : public UIIntVarField { 7 | public: 8 | UIIntVarOffField(GUIPoint &position, Variable &v, const char *format, int min, 9 | int max, int xOffset, int yOffset); 10 | virtual void ProcessArrow(unsigned short mask); 11 | virtual void Draw(GUIWindow &w, int offset = 0); 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UINoteVarField.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "UINoteVarField.h" 3 | #include "Application/AppWindow.h" 4 | #include "Application/Utils/char.h" 5 | #include 6 | 7 | UINoteVarField::UINoteVarField(GUIPoint &position, Variable &v, 8 | const char *format, int min, int max, 9 | int xOffset, int yOffset) 10 | : UIIntVarField(position, v, format, min, max, xOffset, yOffset){}; 11 | 12 | void UINoteVarField::Draw(GUIWindow &w, int offset) { 13 | 14 | GUITextProperties props; 15 | GUIPoint position = GetPosition(); 16 | position._y += offset; 17 | 18 | if (focus_) { 19 | ((AppWindow &)w).SetColor(CD_HILITE2); 20 | props.invert_ = true; 21 | } else { 22 | ((AppWindow &)w).SetColor(CD_NORMAL); 23 | } 24 | 25 | char buffer[MAX_FIELD_WIDTH + 1]; 26 | char note[5]; 27 | 28 | unsigned char pitch = src_.GetInt(); 29 | note2char(pitch, note); 30 | note[4] = 0; 31 | npf_snprintf(buffer, sizeof(buffer), format_, note); 32 | w.DrawString(buffer, position, props); 33 | }; 34 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UINoteVarField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_VAR_NOTE_FIELD_H_ 2 | #define _UI_VAR_NOTE_FIELD_H_ 3 | 4 | #include "UIIntVarField.h" 5 | 6 | class UINoteVarField : public UIIntVarField { 7 | 8 | public: 9 | UINoteVarField(GUIPoint &position, Variable &v, const char *format, int min, 10 | int max, int xOffset, int yOffset); 11 | virtual void Draw(GUIWindow &w, int offset = 0); 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UISortedVarList.cpp: -------------------------------------------------------------------------------- 1 | #include "UISortedVarList.h" 2 | 3 | UISortedVarList::UISortedVarList(GUIPoint &position, Variable &v, 4 | const char *format) 5 | : UIIntVarField(position, v, format, 0, v.GetListSize(), 0, 6 | 0 /*dummy 4 last*/) { 7 | NAssert(v.GetType() == Variable::CHAR_LIST); 8 | }; 9 | 10 | void UISortedVarList::ProcessArrow(unsigned short mask) { 11 | int value = src_.GetInt(); 12 | 13 | switch (mask) { 14 | case EPBM_UP: 15 | // HERE 16 | /* // Look for the first in next alphabet 17 | char search=src_.GetString()[0] ; 18 | 19 | value+=yOffset_ ; 20 | */ 21 | break; 22 | case EPBM_DOWN: 23 | /* value-=yOffset_ ; 24 | break ; 25 | */ 26 | case EPBM_LEFT: 27 | value -= 1; 28 | break; 29 | case EPBM_RIGHT: 30 | value += 1; 31 | break; 32 | }; 33 | if (value < min_) { 34 | value = min_; 35 | }; 36 | if (value > max_) { 37 | value = max_; 38 | } 39 | 40 | src_.SetInt(value); 41 | }; 42 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UISortedVarList.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_SORTED_VAR_LIST_H_ 2 | #define _UI_SORTED_VAR_LIST_H_ 3 | 4 | #include "UIIntVarField.h" 5 | 6 | class UISortedVarList : public UIIntVarField { 7 | 8 | public: 9 | UISortedVarList(GUIPoint &position, Variable &v, const char *format); 10 | virtual ~UISortedVarList(){}; 11 | virtual void ProcessArrow(unsigned short mask); 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIStaticField.cpp: -------------------------------------------------------------------------------- 1 | #include "UIStaticField.h" 2 | #include "Application/AppWindow.h" 3 | 4 | UIStaticField::UIStaticField(GUIPoint &position, const char *string) 5 | : UIField(position) { 6 | string_ = string; 7 | }; 8 | 9 | void UIStaticField::Draw(GUIWindow &w, int offset) { 10 | 11 | GUITextProperties props; 12 | GUIPoint position = GetPosition(); 13 | position._y += offset; 14 | 15 | ((AppWindow &)w).SetColor(CD_NORMAL); 16 | w.DrawString(string_, position, props); 17 | }; 18 | 19 | void UIStaticField::ProcessArrow(unsigned short mask){}; 20 | 21 | bool UIStaticField::IsStatic() { return true; }; 22 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UIStaticField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_STATIC_FIELD_H_ 2 | #define _UI_STATIC_FIELD_H_ 3 | 4 | #include "UIField.h" 5 | 6 | class UIStaticField : public UIField { 7 | 8 | public: 9 | UIStaticField(GUIPoint &position, const char *string); 10 | virtual ~UIStaticField(){}; 11 | virtual void Draw(GUIWindow &w, int offset = 0); 12 | virtual void ProcessArrow(unsigned short mask); 13 | virtual void OnClick(){}; 14 | 15 | virtual bool IsStatic(); 16 | 17 | protected: 18 | protected: 19 | const char *string_; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UISwatchField.cpp: -------------------------------------------------------------------------------- 1 | #include "UISwatchField.h" 2 | #include "Application/AppWindow.h" 3 | 4 | UISwatchField::UISwatchField(GUIPoint &position, const ColorDefinition color) 5 | : UIField(position) { 6 | color_ = color; 7 | }; 8 | 9 | void UISwatchField::Draw(GUIWindow &w, int offset) { 10 | 11 | GUITextProperties props; 12 | GUIPoint position = GetPosition(); 13 | position._y += offset; 14 | 15 | props.invert_ = true; 16 | position._x += 1; 17 | 18 | ((AppWindow &)w).SetColor(color_); 19 | w.DrawString(" ", position, props); 20 | ((AppWindow &)w).SetColor(CD_NORMAL); 21 | }; 22 | 23 | void UISwatchField::ProcessArrow(unsigned short mask){}; 24 | 25 | bool UISwatchField::IsStatic() { return true; }; 26 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UISwatchField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_SWATCH_FIELD_H_ 2 | #define _UI_SWATCH_FIELD_H_ 3 | 4 | #include "UIField.h" 5 | 6 | class UISwatchField : public UIField { 7 | 8 | public: 9 | UISwatchField(GUIPoint &position, const ColorDefinition color); 10 | virtual ~UISwatchField(){}; 11 | virtual void Draw(GUIWindow &w, int offset = 0); 12 | virtual void ProcessArrow(unsigned short mask); 13 | virtual void OnClick(){}; 14 | 15 | virtual bool IsStatic(); 16 | 17 | protected: 18 | protected: 19 | ColorDefinition color_; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UITempoField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_TEMPOFIELD_H_ 2 | #define _UI_TEMPOFIELD_H_ 3 | 4 | #include "Foundation/Observable.h" 5 | #include "UIIntVarField.h" 6 | 7 | class UITempoField : public UIIntVarField, public I_Observer { 8 | public: 9 | UITempoField(FourCC action, GUIPoint &position, Variable &variable, 10 | const char *format, int min, int max, int xOffset, int yOffset); 11 | virtual void OnEditClick(); 12 | void Update(Observable &, I_ObservableData *); 13 | void ProcessArrow(unsigned short mask); 14 | void ProcessEditArrow(unsigned short mask); 15 | 16 | private: 17 | FourCC action_; 18 | }; 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/UITextField.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_TEXT_FIELD_ 2 | #define _UI_TEXT_FIELD_ 3 | 4 | #include "Foundation/Observable.h" 5 | #include "UIField.h" 6 | #include "stdint.h" 7 | 8 | #define MAX_UITEXTFIELD_LABEL_LENGTH 8 9 | 10 | template 11 | class UITextField : public UIField, public Observable { 12 | public: 13 | UITextField(Variable &v, GUIPoint &position, 14 | const etl::string &label, 15 | uint8_t fourcc, etl::string &defaultValue_); 16 | 17 | virtual ~UITextField(); 18 | void Draw(GUIWindow &w, int offset = 0); 19 | void ProcessArrow(unsigned short mask); 20 | void OnClick(); 21 | void OnEditClick(); 22 | etl::string GetString(); 23 | 24 | // Set the variable this UITextField is bound to 25 | void SetVariable(Variable &v); 26 | 27 | private: 28 | int selected_; 29 | uint8_t currentChar_ = 0; 30 | Variable *src_; // Pointer instead of reference 31 | const etl::string<8> label_; 32 | uint8_t fourcc_; 33 | etl::string defaultValue_; 34 | }; 35 | 36 | #include "UITextField.ipp" 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/ViewEvent.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "ViewEvent.h" 3 | 4 | ViewEvent::ViewEvent(ViewEventType type, void *data) { 5 | type_ = type; 6 | data_ = data; 7 | }; 8 | 9 | ViewEventType ViewEvent::GetType() { return type_; }; 10 | 11 | void *ViewEvent::GetData() { return data_; }; 12 | -------------------------------------------------------------------------------- /sources/Application/Views/BaseClasses/ViewEvent.h: -------------------------------------------------------------------------------- 1 | #ifndef _VIEW_EVENT_H_ 2 | #define _VIEW_EVENT_H_ 3 | 4 | #include "Foundation/Observable.h" 5 | 6 | enum ViewEventType { 7 | VET_SWITCH_VIEW, 8 | VET_PLAYER_POSITION_UPDATE, 9 | VET_LIST_SELECT, 10 | VET_QUIT_PROJECT, 11 | VET_UPDATE, 12 | VET_QUIT_APP 13 | }; 14 | 15 | class ViewEvent : public I_ObservableData { 16 | public: 17 | ViewEvent(ViewEventType type, void *data = 0); 18 | ViewEventType GetType(); 19 | void *GetData(); 20 | 21 | private: 22 | ViewEventType type_; 23 | void *data_; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /sources/Application/Views/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application_views 2 | FieldView.cpp 3 | ChainView.cpp 4 | ConsoleView.cpp 5 | GrooveView.cpp 6 | ImportView.cpp 7 | InstrumentImportView.cpp 8 | InstrumentView.cpp 9 | ThemeImportView.cpp 10 | DeviceView.cpp 11 | NullView.cpp 12 | PhraseView.cpp 13 | ProjectView.cpp 14 | SelectProjectView.cpp 15 | SongView.cpp 16 | TableView.cpp 17 | ThemeView.cpp 18 | UIController.cpp 19 | ViewData.cpp 20 | ScreenView.cpp 21 | MixerView.cpp 22 | ) 23 | 24 | target_link_libraries(application_views PUBLIC 25 | application_views_baseclasses 26 | application_instruments 27 | etl 28 | application_utils 29 | ) 30 | 31 | target_include_directories(application_views PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 32 | 33 | include_directories(${PROJECT_SOURCE_DIR}) 34 | 35 | add_subdirectory(BaseClasses) 36 | add_subdirectory(ModalDialogs) 37 | -------------------------------------------------------------------------------- /sources/Application/Views/ConsoleView.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "ConsoleView.h" 3 | #include 4 | 5 | ConsoleView::ConsoleView(GUIWindow &w, ViewData *viewData) : View(w, viewData) { 6 | currentLine_ = 0; 7 | for (int i = 0; i < CONSOLE_HEIGHT; i++) { 8 | lines_[i][0] = 0; 9 | } 10 | isDirty_ = true; 11 | }; 12 | 13 | void ConsoleView::ProcessButtonMask(unsigned short mask, bool pressed){}; 14 | 15 | void ConsoleView::DrawView() { 16 | 17 | GUITextProperties props; 18 | 19 | SetColor(CD_NORMAL); 20 | GUIPoint pos(0, 0); 21 | for (int i = 0; i < CONSOLE_HEIGHT; i++) { 22 | w_.DrawString(lines_[(currentLine_ + i) % CONSOLE_HEIGHT], pos, props); 23 | pos._y += 8; 24 | } 25 | }; 26 | 27 | bool ConsoleView::IsDirty() { return isDirty_; }; 28 | 29 | void ConsoleView::AddBuffer(char *buffer){}; 30 | -------------------------------------------------------------------------------- /sources/Application/Views/ConsoleView.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CONSOLE_H_ 3 | #define _CONSOLE_H_ 4 | 5 | #include "BaseClasses/View.h" 6 | #include "System/Console/Trace.h" 7 | 8 | #define CONSOLE_WIDTH 40 9 | #define CONSOLE_HEIGHT 25 10 | 11 | class ConsoleView : public View, public Trace { 12 | public: 13 | ConsoleView(GUIWindow &w, ViewData *viewData); 14 | 15 | // View implementation 16 | 17 | virtual void ProcessButtonMask(unsigned short mask, bool pressed); 18 | virtual void DrawView(); 19 | virtual void OnPlayerUpdate(PlayerEventType, unsigned int){}; 20 | virtual void OnFocus(){}; 21 | 22 | // Trace Implementation 23 | 24 | virtual void AddBuffer(char *buffer); 25 | 26 | // Additional 27 | 28 | bool IsDirty(); 29 | 30 | private: 31 | char lines_[CONSOLE_HEIGHT][CONSOLE_WIDTH]; 32 | int currentLine_; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /sources/Application/Views/FieldView.h: -------------------------------------------------------------------------------- 1 | #ifndef _FIELD_VIEW_H_ 2 | #define _FIELD_VIEW_H_ 3 | 4 | #include "BaseClasses/UIField.h" 5 | #include "Foundation/T_SimpleList.h" 6 | #include "ScreenView.h" 7 | 8 | class FieldView : public ScreenView { 9 | public: 10 | FieldView(GUIWindow &w, ViewData *viewData); 11 | 12 | virtual void Redraw(); 13 | virtual void ProcessButtonMask(unsigned short mask, bool pressed) override; 14 | 15 | void SetFocus(UIField *); 16 | UIField *GetFocus(); 17 | void ClearFocus(); 18 | int GetFocusIndex(); 19 | void SetSize(int size); 20 | 21 | etl::list fieldList_; // adjust to maximum fields on one screen 22 | // curretly max usage is themeview which has 38 fields 23 | 24 | private: 25 | UIField *focus_; 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /sources/Application/Views/GrooveView.h: -------------------------------------------------------------------------------- 1 | #ifndef _GROOVE_VIEW_H_ 2 | #define _GROOVE_VIEW_H_ 3 | 4 | #include "ScreenView.h" 5 | #include "ViewData.h" 6 | 7 | class GrooveView : public ScreenView { 8 | public: 9 | GrooveView(GUIWindow &w, ViewData *viewData); 10 | ~GrooveView(); 11 | virtual void ProcessButtonMask(unsigned short mask, bool pressed); 12 | virtual void DrawView(); 13 | virtual void OnPlayerUpdate(PlayerEventType, unsigned int tick = 0); 14 | virtual void OnFocus(); 15 | 16 | protected: 17 | void updateCursorValue(int val, bool sync = false); 18 | void updateCursor(int dir); 19 | void initCursorValue(); 20 | void clearCursorValue(); 21 | void warpGroove(int dir); 22 | void processNormalButtonMask(unsigned short mask); 23 | void processSelectionButtonMask(unsigned short mask); 24 | 25 | private: 26 | int position_; 27 | int lastPosition_; 28 | }; 29 | #endif -------------------------------------------------------------------------------- /sources/Application/Views/InstrumentImportView.h: -------------------------------------------------------------------------------- 1 | #ifndef _INSTRUMENT_IMPORT_VIEW_H_ 2 | #define _INSTRUMENT_IMPORT_VIEW_H_ 3 | 4 | #include "Foundation/T_SimpleList.h" 5 | #include "ScreenView.h" 6 | #include "System/FileSystem/FileSystem.h" 7 | #include "ViewData.h" 8 | #include 9 | 10 | class InstrumentImportView : public ScreenView { 11 | public: 12 | InstrumentImportView(GUIWindow &w, ViewData *viewData); 13 | ~InstrumentImportView(); 14 | virtual void ProcessButtonMask(unsigned short mask, bool pressed); 15 | virtual void DrawView(); 16 | virtual void OnPlayerUpdate(PlayerEventType, unsigned int tick = 0); 17 | virtual void OnFocus(); 18 | 19 | protected: 20 | void setCurrentFolder(FileSystem *fs, const char *name); 21 | void warpToNextInstrument(bool goUp); 22 | void importInstrument(char *name); 23 | 24 | private: 25 | size_t topIndex_ = 0; 26 | size_t currentIndex_ = 0; 27 | short selected_ = 0; 28 | int toInstrID_ = 0; 29 | etl::vector fileIndexList_; 30 | }; 31 | #endif 32 | -------------------------------------------------------------------------------- /sources/Application/Views/ModalDialogs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(application_views_modaldialogs 2 | MessageBox.cpp 3 | TextInputModalView.cpp 4 | RenderProgressModal.cpp 5 | ) 6 | 7 | target_link_libraries(application_views_modaldialogs PUBLIC 8 | application_views_baseclasses 9 | system_filesystem 10 | ) 11 | 12 | target_include_directories(application_views_modaldialogs PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 13 | 14 | include_directories(${PROJECT_SOURCE_DIR}) 15 | -------------------------------------------------------------------------------- /sources/Application/Views/NullView.cpp: -------------------------------------------------------------------------------- 1 | #include "NullView.h" 2 | #include 3 | #include 4 | 5 | NullView::NullView(GUIWindow &w, ViewData *viewData) : View(w, viewData) {} 6 | 7 | NullView::~NullView() {} 8 | 9 | void NullView::ProcessButtonMask(unsigned short mask, bool pressed){ 10 | 11 | }; 12 | 13 | void NullView::DrawView() { 14 | 15 | Clear(); 16 | 17 | GUITextProperties props; 18 | SetColor(CD_HILITE2); 19 | 20 | char buildString[SCREEN_WIDTH + 1]; 21 | npf_snprintf(buildString, sizeof(buildString), "picoTracker build %s%s_%s", 22 | PROJECT_NUMBER, PROJECT_RELEASE, BUILD_COUNT); 23 | GUIPoint pos; 24 | pos._y = 22; 25 | pos._x = (32 - strlen(buildString)) / 2; 26 | DrawString(pos._x, pos._y, buildString, props); 27 | }; 28 | 29 | void NullView::OnPlayerUpdate(PlayerEventType, unsigned int tick){ 30 | 31 | }; 32 | 33 | void NullView::OnFocus(){}; 34 | -------------------------------------------------------------------------------- /sources/Application/Views/NullView.h: -------------------------------------------------------------------------------- 1 | #ifndef _NULL_VIEW_H_ 2 | #define _NULL_VIEW_H_ 3 | 4 | #include "BaseClasses/View.h" 5 | #include "ViewData.h" 6 | 7 | class NullView : public View { 8 | public: 9 | NullView(GUIWindow &w, ViewData *viewData); 10 | ~NullView(); 11 | virtual void ProcessButtonMask(unsigned short mask, bool pressed); 12 | virtual void DrawView(); 13 | virtual void OnPlayerUpdate(PlayerEventType, unsigned int tick = 0); 14 | virtual void OnFocus(); 15 | virtual void AnimationUpdate(){}; 16 | 17 | private: 18 | }; 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Application/Views/ScreenView.cpp: -------------------------------------------------------------------------------- 1 | #include "ScreenView.h" 2 | #include 3 | #include 4 | 5 | ScreenView::ScreenView(GUIWindow &w, ViewData *viewData) : View(w, viewData) {} 6 | 7 | ScreenView::~ScreenView() {} 8 | 9 | /// Updates the animation by redrawing the battery gauge on every clock tick 10 | void ScreenView::AnimationUpdate() { 11 | GUITextProperties props; 12 | drawBattery(props); 13 | }; -------------------------------------------------------------------------------- /sources/Application/Views/ScreenView.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCREEN_VIEW_H_ 2 | #define _SCREEN_VIEW_H_ 3 | 4 | #include "BaseClasses/View.h" 5 | #include "ViewData.h" 6 | 7 | class ScreenView : public View { 8 | public: 9 | ScreenView(GUIWindow &w, ViewData *viewData); 10 | ~ScreenView(); 11 | virtual void ProcessButtonMask(unsigned short mask, bool pressed){}; 12 | virtual void DrawView(){}; 13 | virtual void OnPlayerUpdate(PlayerEventType, unsigned int tick = 0){}; 14 | virtual void OnFocus(){}; 15 | virtual void AnimationUpdate() override; 16 | 17 | private: 18 | }; 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Application/Views/SelectProjectView.h: -------------------------------------------------------------------------------- 1 | #ifndef _SELECTPROJECT_VIEW_H_ 2 | #define _SELECTPROJECT_VIEW_H_ 3 | 4 | #include "Foundation/T_SimpleList.h" 5 | #include "ScreenView.h" 6 | #include "System/FileSystem/FileSystem.h" 7 | #include "ViewData.h" 8 | #include 9 | 10 | class SelectProjectView : public ScreenView { 11 | public: 12 | SelectProjectView(GUIWindow &w, ViewData *viewData); 13 | ~SelectProjectView(); 14 | 15 | virtual void ProcessButtonMask(unsigned short mask, bool pressed); 16 | virtual void DrawView(); 17 | virtual void OnPlayerUpdate(PlayerEventType, unsigned int tick = 0); 18 | virtual void OnFocus(); 19 | void getSelectedProjectName(char *name); 20 | 21 | protected: 22 | void setCurrentFolder(); 23 | void warpToNextProject(bool goUp); 24 | 25 | private: 26 | size_t topIndex_ = 0; 27 | size_t currentIndex_ = 0; 28 | char selection_[MAX_PROJECT_NAME_LENGTH]; 29 | etl::vector fileIndexList_; 30 | }; 31 | #endif 32 | -------------------------------------------------------------------------------- /sources/Application/Views/ThemeImportView.h: -------------------------------------------------------------------------------- 1 | #ifndef _THEME_IMPORT_VIEW_H_ 2 | #define _THEME_IMPORT_VIEW_H_ 3 | 4 | #include "Foundation/T_SimpleList.h" 5 | #include "ScreenView.h" 6 | #include "System/FileSystem/FileSystem.h" 7 | #include "ViewData.h" 8 | #include 9 | 10 | class ThemeImportView : public ScreenView { 11 | public: 12 | ThemeImportView(GUIWindow &w, ViewData *viewData); 13 | ~ThemeImportView(); 14 | virtual void ProcessButtonMask(unsigned short mask, bool pressed); 15 | virtual void DrawView(); 16 | virtual void OnPlayerUpdate(PlayerEventType, unsigned int tick = 0); 17 | virtual void OnFocus(); 18 | 19 | protected: 20 | void setCurrentFolder(FileSystem *fs, const char *name); 21 | void warpToNextTheme(bool goUp); 22 | void onImportTheme(const char *filename); 23 | 24 | private: 25 | size_t topIndex_ = 0; 26 | size_t currentIndex_ = 0; 27 | etl::vector fileIndexList_; 28 | }; 29 | #endif 30 | -------------------------------------------------------------------------------- /sources/Application/Views/UIController.h: -------------------------------------------------------------------------------- 1 | #ifndef _UI_CONTROLLER_H 2 | #define _UI_CONTROLLER_H 3 | 4 | #include "Foundation/T_Singleton.h" 5 | #include "ViewData.h" 6 | 7 | class UIController : public T_Singleton { 8 | private: // Singleton 9 | UIController(); 10 | 11 | public: 12 | static UIController *GetInstance(); 13 | void Init(Project *, ViewData *); 14 | void Reset(); 15 | 16 | // Muting functions 17 | 18 | void UnMuteAll(); 19 | void ToggleMute(int from, int to); 20 | void SwitchSoloMode(int from, int to, bool clear); 21 | 22 | private: 23 | Project *project_; 24 | ViewData *viewData_; 25 | 26 | bool soloMask_[SONG_CHANNEL_COUNT]; 27 | }; 28 | #endif 29 | -------------------------------------------------------------------------------- /sources/Externals/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(TinyXML2) 2 | add_subdirectory(yxml) 3 | add_subdirectory(etl) 4 | target_include_directories(etl INTERFACE "${PROJECT_SOURCE_DIR}/config") 5 | add_subdirectory(cRSID) 6 | add_subdirectory(opal) 7 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(src) 2 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/doc/SdFat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | A web page that points a browser to a different page 4 | 5 | 6 | 7 | 8 | Your browser didn't automatically redirect. Open html/index.html manually. 9 | 10 | 11 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/doc/ZipMsg/index.html: -------------------------------------------------------------------------------- 1 |

Replace the content of the html folder by unzipping html.zip.

2 |

I have zipped the documentation since Doxygen changes every file each time it runs.

3 |

This makes viewing changes on GitHub difficult.

4 |

 

-------------------------------------------------------------------------------- /sources/Externals/SdFat/doc/clean_html.bat: -------------------------------------------------------------------------------- 1 | del html\*.md5 2 | del html\*.map 3 | pause -------------------------------------------------------------------------------- /sources/Externals/SdFat/doc/del_html.bat: -------------------------------------------------------------------------------- 1 | rm html/*.* 2 | rm html/search/*.* 3 | pause -------------------------------------------------------------------------------- /sources/Externals/SdFat/doc/html.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/sources/Externals/SdFat/doc/html.zip -------------------------------------------------------------------------------- /sources/Externals/SdFat/doc/html/index.html: -------------------------------------------------------------------------------- 1 |

Replace the content of the html folder by unzipping html.zip.

2 |

I have zipped the documentation since Doxygen changes every file each time it runs.

3 |

This makes viewing changes on GitHub difficult.

4 |

 

-------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/ExFatLogger/ExFatLogger.h: -------------------------------------------------------------------------------- 1 | // Avoid IDE problems by defining struct in septate .h file. 2 | // Pad record so size is a power of two for best write performance. 3 | #ifndef ExFatLogger_h 4 | #define ExFatLogger_h 5 | const size_t ADC_COUNT = 4; 6 | struct data_t { 7 | uint16_t adc[ADC_COUNT]; 8 | }; 9 | #endif // ExFatLogger_h -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/SdErrorCodes/SdErrorCodes.ino: -------------------------------------------------------------------------------- 1 | // Print a list of error codes, symbols, and comments. 2 | #include "SdFat.h" 3 | void setup() { 4 | Serial.begin(9600); 5 | while (!Serial) {} 6 | delay(1000); 7 | Serial.println(); 8 | Serial.println(F("Code,Symbol - failed operation")); 9 | for (uint8_t code = 0; code <= SD_CARD_ERROR_UNKNOWN; code++) { 10 | Serial.print(code < 16 ? "0X0" : "0X"); 11 | Serial.print(code, HEX); 12 | Serial.print(","); 13 | printSdErrorSymbol(&Serial, code); 14 | Serial.print(" - "); 15 | printSdErrorText(&Serial, code); 16 | Serial.println(); 17 | } 18 | } 19 | void loop() {} -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/#attic/HelloWorld/HelloWorld.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SdFat.h" 3 | #include "sdios.h" 4 | 5 | // create a serial output stream 6 | ArduinoOutStream cout(Serial); 7 | 8 | void setup() { 9 | Serial.begin(9600); 10 | 11 | // Wait for USB Serial 12 | while (!Serial) { 13 | yield(); 14 | } 15 | delay(2000); 16 | 17 | cout << "Hello, World!\n"; 18 | } 19 | 20 | void loop() {} 21 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/#attic/MiniSerial/MiniSerial.ino: -------------------------------------------------------------------------------- 1 | // This example illustrates use of SdFat's 2 | // minimal unbuffered AVR Serial support. 3 | // 4 | // This is useful for debug and saves RAM 5 | // Will not work on Due, Leonardo, or Teensy 6 | 7 | #include 8 | #include "SdFat.h" 9 | #include "FreeStack.h" 10 | #ifdef UDR0 // Must be AVR with serial port zero. 11 | #include "MinimumSerial.h" 12 | 13 | MinimumSerial MiniSerial; 14 | 15 | void setup() { 16 | MiniSerial.begin(9600); 17 | MiniSerial.println(FreeStack()); 18 | } 19 | void loop() { 20 | int c; 21 | MiniSerial.println(F("Type any Character")); 22 | while ((c = MiniSerial.read()) < 0) {} 23 | MiniSerial.print(F("Read: ")); 24 | MiniSerial.println((char)c); 25 | while (MiniSerial.read() >= 0) {} 26 | } 27 | #else // UDR0 28 | #error no AVR serial port 0 29 | #endif // UDR0 -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/#attic/SD_Size/SD_Size.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * Program to compare size of Arduino SD library with SdFat. 3 | * See SdFatSize.ino for SdFat program. 4 | */ 5 | #include 6 | #include 7 | 8 | File file; 9 | //------------------------------------------------------------------------------ 10 | void setup() { 11 | Serial.begin(9600); 12 | 13 | // Wait for USB Serial 14 | while (!Serial) { 15 | yield(); 16 | } 17 | 18 | if (!SD.begin()) { 19 | Serial.println("begin failed"); 20 | return; 21 | } 22 | file = SD.open("TEST_SD.TXT", FILE_WRITE); 23 | 24 | file.println("Hello"); 25 | 26 | file.close(); 27 | Serial.println("Done"); 28 | } 29 | //------------------------------------------------------------------------------ 30 | void loop() {} 31 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/#attic/SdFatSize/SdFatSize.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * Program to compare size of SdFat with Arduino SD library. 3 | * See SD_Size.ino for Arduino SD program. 4 | * 5 | */ 6 | #include 7 | #include "SdFat.h" 8 | 9 | SdFat sd; 10 | 11 | SdFile file; 12 | //------------------------------------------------------------------------------ 13 | void setup() { 14 | Serial.begin(9600); 15 | 16 | // Wait for USB Serial 17 | while (!Serial) { 18 | yield(); 19 | } 20 | 21 | if (!sd.begin()) { 22 | Serial.println("begin failed"); 23 | return; 24 | } 25 | file.open("SizeTest.txt", O_RDWR | O_CREAT | O_AT_END); 26 | 27 | file.println("Hello"); 28 | 29 | file.close(); 30 | Serial.println("Done"); 31 | } 32 | //------------------------------------------------------------------------------ 33 | void loop() {} 34 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/#attic/bufstream/bufstream.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * Use of ibufsteam to parse a line and obufstream to format a line 3 | */ 4 | #include 5 | #include "SdFat.h" 6 | #include "sdios.h" 7 | 8 | // create a serial output stream 9 | ArduinoOutStream cout(Serial); 10 | //------------------------------------------------------------------------------ 11 | void setup() { 12 | char buf[20]; // buffer for formatted line 13 | int i, j, k; // values from parsed line 14 | 15 | Serial.begin(9600); 16 | 17 | // Wait for USB Serial 18 | while (!Serial) { 19 | yield(); 20 | } 21 | delay(2000); 22 | 23 | // initialize input string 24 | ibufstream bin("123 456 789"); 25 | 26 | // parse the string "123 456 789" 27 | bin >> i >> j >> k; 28 | 29 | // initialize output buffer 30 | obufstream bout(buf, sizeof(buf)); 31 | 32 | // format the output string 33 | bout << k << ',' << j << ',' << i << endl; 34 | 35 | // write the string to serial 36 | cout << buf; 37 | } 38 | 39 | void loop() {} 40 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/#attic/cin_cout/cin_cout.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * Demo of ArduinoInStream and ArduinoOutStream 3 | */ 4 | #include 5 | #include "SdFat.h" 6 | #include "sdios.h" 7 | 8 | // create serial output stream 9 | ArduinoOutStream cout(Serial); 10 | 11 | // input line buffer 12 | char cinBuf[40]; 13 | 14 | // create serial input stream 15 | ArduinoInStream cin(Serial, cinBuf, sizeof(cinBuf)); 16 | //------------------------------------------------------------------------------ 17 | void setup() { 18 | Serial.begin(9600); 19 | // Wait for USB Serial 20 | while (!Serial) { 21 | yield(); 22 | } 23 | } 24 | //------------------------------------------------------------------------------ 25 | void loop() { 26 | int32_t n = 0; 27 | 28 | cout << "\nenter an integer\n"; 29 | 30 | cin.readline(); 31 | 32 | if (cin >> n) { 33 | cout << "The number is: " << n; 34 | } else { 35 | // will fail if no digits or not in range [-2147483648, 2147483647] 36 | cout << "Invalid input: " << cinBuf; 37 | } 38 | cout << endl; 39 | } 40 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LongFileName/testFiles/A long name can be 255 characters.txt: -------------------------------------------------------------------------------- 1 | This is "A long name can be 255 characters.txt" 2 | This file has a typical Long File Name. 3 | 4 | The maximum length of a Long File Name is 255 characters. 5 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LongFileName/testFiles/LFN,NAME.TXT: -------------------------------------------------------------------------------- 1 | LFN,NAME.TXT is not 8.3 since it has a comma. -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LongFileName/testFiles/MIXCASE.txt: -------------------------------------------------------------------------------- 1 | MIXCASE.txt does not have a Long File Name. 2 | 3 | Starting with NT, file names of this form, 4 | have the basename and extension character case 5 | encoded in two bits of the 8.3 directory entry. 6 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LongFileName/testFiles/Not_8_3.txt: -------------------------------------------------------------------------------- 1 | Not_8_3.txt has a Long File Name 2 | since the basename is mixed case. -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LongFileName/testFiles/OK%83.TXT: -------------------------------------------------------------------------------- 1 | OK%83.TXT is a valid 8.3 name. -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LongFileName/testFiles/STD_8_3.TXT: -------------------------------------------------------------------------------- 1 | STD_8_3.TXT - a vanilla 8.3 name. -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LongFileName/testFiles/With Blank.txt: -------------------------------------------------------------------------------- 1 | With Blank.txt 2 | Just another example of a Long File Name. 3 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LongFileName/testFiles/With.Two dots.txt: -------------------------------------------------------------------------------- 1 | "With Two.dots.txt" 2 | Lots of reasons this is a Long File Name. 3 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LongFileName/testFiles/lower.txt: -------------------------------------------------------------------------------- 1 | lower.txt does not have a Long File Name. 2 | 3 | Starting with NT, file names of this form, 4 | have the basename and extension character case 5 | encoded in two bits of the 8.3 directory entry. 6 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LongFileName/testFiles/mixed.TXT: -------------------------------------------------------------------------------- 1 | mixed.TXT does not have a Long File Name. 2 | 3 | Starting with NT, file names of this form, 4 | have the basename and extension character case 5 | encoded in two bits of the 8.3 directory entry. -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LowLatencyLogger/UserFunctions.cpp: -------------------------------------------------------------------------------- 1 | #include "UserTypes.h" 2 | // User data functions. Modify these functions for your data items. 3 | 4 | // Start time for data 5 | static uint32_t startMicros; 6 | 7 | // Acquire a data record. 8 | void acquireData(data_t* data) { 9 | data->time = micros(); 10 | for (int i = 0; i < ADC_DIM; i++) { 11 | data->adc[i] = analogRead(i); 12 | } 13 | } 14 | 15 | // Print a data record. 16 | void printData(Print* pr, data_t* data) { 17 | if (startMicros == 0) { 18 | startMicros = data->time; 19 | } 20 | pr->print(data->time - startMicros); 21 | for (int i = 0; i < ADC_DIM; i++) { 22 | pr->write(','); 23 | pr->print(data->adc[i]); 24 | } 25 | pr->println(); 26 | } 27 | 28 | // Print data header. 29 | void printHeader(Print* pr) { 30 | startMicros = 0; 31 | pr->print(F("micros")); 32 | for (int i = 0; i < ADC_DIM; i++) { 33 | pr->print(F(",adc")); 34 | pr->print(i); 35 | } 36 | pr->println(); 37 | } 38 | 39 | // Sensor setup 40 | void userSetup() { 41 | } 42 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LowLatencyLogger/UserTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef UserTypes_h 2 | #define UserTypes_h 3 | #include "Arduino.h" 4 | // User data types. Modify for your data items. 5 | #define FILE_BASE_NAME "adc4pin" 6 | const uint8_t ADC_DIM = 4; 7 | struct data_t { 8 | uint32_t time; 9 | uint16_t adc[ADC_DIM]; 10 | }; 11 | void acquireData(data_t* data); 12 | void printData(Print* pr, data_t* data); 13 | void printHeader(Print* pr); 14 | void userSetup(); 15 | #endif // UserTypes_h 16 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LowLatencyLoggerADXL345/LowLatencyLoggerADXL345.ino: -------------------------------------------------------------------------------- 1 | // Empty file with name LowLatencyLoggerADXL345.ino to make IDE happy. -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LowLatencyLoggerADXL345/UserTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef UserTypes_h 2 | #define UserTypes_h 3 | #include "Arduino.h" 4 | #include "SPI.h" 5 | #define USE_SHARED_SPI 1 6 | #define FILE_BASE_NAME "ADXL4G" 7 | // User data types. Modify for your data items. 8 | const uint8_t ACCEL_DIM = 3; 9 | struct data_t { 10 | uint32_t time; 11 | int16_t accel[ACCEL_DIM]; 12 | }; 13 | void acquireData(data_t* data); 14 | void printData(Print* pr, data_t* data); 15 | void printHeader(Print* pr); 16 | void userSetup(); 17 | #endif // UserTypes_h 18 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LowLatencyLoggerADXL345/readme.txt: -------------------------------------------------------------------------------- 1 | Test of shared SPI for LowLatencyLogger. -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LowLatencyLoggerMPU6050/LowLatencyLoggerMPU6050.ino: -------------------------------------------------------------------------------- 1 | // Empty file with name LowLatencyLoggerMPU6050.ino to make IDE happy. 2 | 3 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/examples/examplesV1/LowLatencyLoggerMPU6050/UserTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef UserTypes_h 2 | #define UserTypes_h 3 | #include "Arduino.h" 4 | #define FILE_BASE_NAME "mpuraw" 5 | struct data_t { 6 | unsigned long time; 7 | int16_t ax; 8 | int16_t ay; 9 | int16_t az; 10 | int16_t gx; 11 | int16_t gy; 12 | int16_t gz; 13 | }; 14 | void acquireData(data_t* data); 15 | void printData(Print* pr, data_t* data); 16 | void printHeader(Print* pr); 17 | void userSetup(); 18 | #endif // UserTypes_h 19 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/extras/USB_Host_Shield/USB_Host_Shield_2.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/sources/Externals/SdFat/extras/USB_Host_Shield/USB_Host_Shield_2.0.zip -------------------------------------------------------------------------------- /sources/Externals/SdFat/extras/USB_Host_Shield/UsbHostShieldDiff.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | +++ "C:\\Users\\bill\\Documents\\ArduinoSdFat\\libraries\\USB_Host_Shield_2.0/masstorage.cpp" 2020-02-20 06:02:48.567008200 -0800 4 | @@ -796,6 +796,7 @@ 5 | buf[i] = 0x00; 6 | } 7 | WriteOk[lun] = true; 8 | + return 0; // WHG - Many USB keys don't respond. 9 | uint8_t rc = ModeSense6(lun, 0, 0x3f, 0, 192, buf); 10 | if(!rc) { 11 | WriteOk[lun] = ((buf[2] & 0x80) == 0); 12 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/extras/USB_Host_Shield/readme.txt: -------------------------------------------------------------------------------- 1 | This zip file was downloaded on 2/20/2020 from 2 | 3 | https://github.com/felis/USB_Host_Shield_2.0 4 | 5 | A line was added to fix a problem with sensing read only status, 6 | see UsbHostShieldDiff.txt. -------------------------------------------------------------------------------- /sources/Externals/SdFat/extras/cpplint.bat: -------------------------------------------------------------------------------- 1 | sh cpplint.sh 2 | pause -------------------------------------------------------------------------------- /sources/Externals/SdFat/extras/cpplint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export PATH=/cygdrive/c/Python27:/cygdrive/c/Python27/DLLs:/cygdrive/c/Python27/Scripts:$PATH 3 | echo $PATH 4 | python cpplint.py --filter=-build/include,-runtime/references,-build/header_guard ../src/*.* ../src/*/*.* 2>cpplint.txt -------------------------------------------------------------------------------- /sources/Externals/SdFat/library.properties: -------------------------------------------------------------------------------- 1 | name=SdFat 2 | version=2.2.0 3 | license=MIT 4 | author=Bill Greiman 5 | maintainer=Bill Greiman 6 | sentence=Provides access to SD memory cards. 7 | paragraph=The SdFat library supports FAT16, FAT32, and exFAT file systems on Standard SD, SDHC, and SDXC cards. 8 | category=Data Storage 9 | url=https://github.com/greiman/SdFat 10 | repository=https://github.com/greiman/SdFat.git 11 | architectures=* 12 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(sdfat 2 | FreeStack.h FreeStack.cpp 3 | MinimumSerial.h MinimumSerial.cpp 4 | RingBuf.h 5 | SdFat.h 6 | SdFatConfig.h 7 | sdios.h 8 | ) 9 | 10 | target_link_libraries(sdfat PUBLIC sdfat_fslib 11 | ) 12 | 13 | #target_compile_definitions(sdfat PRIVATE SPI_DRIVER_SELECT=3 SD_CHIP_SELECT_MODE=2 ENABLE_DEDICATED_SPI=1 HAS_SDIO_CLASS) 14 | #add_compile_definitions(SPI_DRIVER_SELECT=3) 15 | #set(SPI_DRIVER_SELECT 3) 16 | 17 | #add_definitions(SD_CHIP_SELECT_MODE=2) 18 | #set(SD_CHIP_SELECT_MODE "2") 19 | #add_definitions(ENABLE_DEDICATED_SPI=1) 20 | #set(ENABLE_DEDICATED_SPI "1") 21 | #add_definitions(-DHAS_SDIO_CLASS) 22 | 23 | target_include_directories(sdfat PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 24 | 25 | include_directories( 26 | ${PROJECT_SOURCE_DIR} 27 | ${CMAKE_CURRENT_SOURCE_DIR} # Add in order to create a new root for this subproject 28 | ) 29 | 30 | add_subdirectory(common) 31 | add_subdirectory(SdCard) 32 | add_subdirectory(FsLib) 33 | add_subdirectory(ExFatLib) 34 | add_subdirectory(FatLib) 35 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/src/DigitalIO/boards/LeonardoGpioPinMap.h: -------------------------------------------------------------------------------- 1 | #ifndef LeonardoGpioPinMap_h 2 | #define LeonardoGpioPinMap_h 3 | static const GpioPinMap_t GpioPinMap[] = { 4 | GPIO_PIN(D, 2), // D0 5 | GPIO_PIN(D, 3), // D1 6 | GPIO_PIN(D, 1), // D2 7 | GPIO_PIN(D, 0), // D3 8 | GPIO_PIN(D, 4), // D4 9 | GPIO_PIN(C, 6), // D5 10 | GPIO_PIN(D, 7), // D6 11 | GPIO_PIN(E, 6), // D7 12 | GPIO_PIN(B, 4), // D8 13 | GPIO_PIN(B, 5), // D9 14 | GPIO_PIN(B, 6), // D10 15 | GPIO_PIN(B, 7), // D11 16 | GPIO_PIN(D, 6), // D12 17 | GPIO_PIN(C, 7), // D13 18 | GPIO_PIN(B, 3), // D14 19 | GPIO_PIN(B, 1), // D15 20 | GPIO_PIN(B, 2), // D16 21 | GPIO_PIN(B, 0), // D17 22 | GPIO_PIN(F, 7), // D18 23 | GPIO_PIN(F, 6), // D19 24 | GPIO_PIN(F, 5), // D20 25 | GPIO_PIN(F, 4), // D21 26 | GPIO_PIN(F, 1), // D22 27 | GPIO_PIN(F, 0), // D23 28 | GPIO_PIN(D, 4), // D24 29 | GPIO_PIN(D, 7), // D25 30 | GPIO_PIN(B, 4), // D26 31 | GPIO_PIN(B, 5), // D27 32 | GPIO_PIN(B, 6), // D28 33 | GPIO_PIN(D, 6) // D29 34 | }; 35 | #endif // LeonardoGpioPinMap_h 36 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/src/DigitalIO/boards/Teensy2GpioPinMap.h: -------------------------------------------------------------------------------- 1 | #ifndef Teensy2GpioPinMap_h 2 | #define Teensy2GpioPinMap_h 3 | static const GpioPinMap_t GpioPinMap[] = { 4 | GPIO_PIN(B, 0), // D0 5 | GPIO_PIN(B, 1), // D1 6 | GPIO_PIN(B, 2), // D2 7 | GPIO_PIN(B, 3), // D3 8 | GPIO_PIN(B, 7), // D4 9 | GPIO_PIN(D, 0), // D5 10 | GPIO_PIN(D, 1), // D6 11 | GPIO_PIN(D, 2), // D7 12 | GPIO_PIN(D, 3), // D8 13 | GPIO_PIN(C, 6), // D9 14 | GPIO_PIN(C, 7), // D10 15 | GPIO_PIN(D, 6), // D11 16 | GPIO_PIN(D, 7), // D12 17 | GPIO_PIN(B, 4), // D13 18 | GPIO_PIN(B, 5), // D14 19 | GPIO_PIN(B, 6), // D15 20 | GPIO_PIN(F, 7), // D16 21 | GPIO_PIN(F, 6), // D17 22 | GPIO_PIN(F, 5), // D18 23 | GPIO_PIN(F, 4), // D19 24 | GPIO_PIN(F, 1), // D20 25 | GPIO_PIN(F, 0), // D21 26 | GPIO_PIN(D, 4), // D22 27 | GPIO_PIN(D, 5), // D23 28 | GPIO_PIN(E, 6), // D24 29 | }; 30 | #endif // Teensy2GpioPinMap_h 31 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/src/DigitalIO/boards/UnoGpioPinMap.h: -------------------------------------------------------------------------------- 1 | #ifndef UnoGpioPinMap_h 2 | #define UnoGpioPinMap_h 3 | static const GpioPinMap_t GpioPinMap[] = { 4 | GPIO_PIN(D, 0), // D0 5 | GPIO_PIN(D, 1), // D1 6 | GPIO_PIN(D, 2), // D2 7 | GPIO_PIN(D, 3), // D3 8 | GPIO_PIN(D, 4), // D4 9 | GPIO_PIN(D, 5), // D5 10 | GPIO_PIN(D, 6), // D6 11 | GPIO_PIN(D, 7), // D7 12 | GPIO_PIN(B, 0), // D8 13 | GPIO_PIN(B, 1), // D9 14 | GPIO_PIN(B, 2), // D10 15 | GPIO_PIN(B, 3), // D11 16 | GPIO_PIN(B, 4), // D12 17 | GPIO_PIN(B, 5), // D13 18 | GPIO_PIN(C, 0), // D14 19 | GPIO_PIN(C, 1), // D15 20 | GPIO_PIN(C, 2), // D16 21 | GPIO_PIN(C, 3), // D17 22 | GPIO_PIN(C, 4), // D18 23 | GPIO_PIN(C, 5) // D19 24 | }; 25 | #endif // UnoGpioPinMap_h -------------------------------------------------------------------------------- /sources/Externals/SdFat/src/DigitalIO/readme.txt: -------------------------------------------------------------------------------- 1 | Selected files from the DigitalIO library. 2 | 3 | https://github.com/greiman/DigitalIO -------------------------------------------------------------------------------- /sources/Externals/SdFat/src/ExFatLib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(sdfat_exfatlib 2 | ExFatFileWrite.cpp 3 | ExFatPartition.h ExFatPartition.cpp 4 | ExFatFile.h ExFatFile.cpp 5 | ExFatVolume.h ExFatVolume.cpp 6 | ExFatName.cpp 7 | ExFatFilePrint.cpp 8 | ) 9 | 10 | target_link_libraries(sdfat_exfatlib PUBLIC sdfat_common) 11 | 12 | target_include_directories(sdfat_exfatlib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 13 | 14 | include_directories(${PROJECT_SOURCE_DIR}) 15 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/src/FatLib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(sdfat_fatlib 2 | FatFile.h FatFile.cpp 3 | FatPartition.h FatPartition.cpp 4 | FatFileLFN.cpp 5 | FatFileSFN.cpp 6 | FatName.cpp 7 | FatVolume.h FatVolume.cpp 8 | FatFilePrint.cpp 9 | ) 10 | 11 | target_link_libraries(sdfat_fatlib PUBLIC pico_stdlib) 12 | 13 | target_include_directories(sdfat_fatlib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 14 | 15 | include_directories(${PROJECT_SOURCE_DIR}) 16 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/src/FsLib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(sdfat_fslib 2 | FsVolume.h FsVolume.cpp 3 | FsFile.h FsFile.cpp 4 | FsNew.h FsNew.cpp 5 | ) 6 | 7 | target_link_libraries(sdfat_fslib PUBLIC sdfat_exfatlib 8 | PUBLIC sdfat_fatlib 9 | ) 10 | 11 | target_include_directories(sdfat_fslib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 12 | 13 | include_directories(${PROJECT_SOURCE_DIR}) 14 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/src/SdCard/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(sdfat_sdcard 2 | SdCard.h 3 | SdSpiCard.h SdSpiCard.cpp 4 | SdCardInfo.h SdCardInfo.cpp 5 | ) 6 | 7 | target_link_libraries(sdfat_sdcard PUBLIC platform_utils 8 | PUBLIC pico_stdlib 9 | ) 10 | 11 | target_include_directories(sdfat_sdcard PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 12 | 13 | include_directories(${PROJECT_SOURCE_DIR}) 14 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/src/SdCard/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | exclude_files=SdioTeensy.h -------------------------------------------------------------------------------- /sources/Externals/SdFat/src/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(sdfat_common 2 | PrintBasic.h PrintBasic.cpp 3 | SysCall.h 4 | FsBlockDevice.h 5 | FsCache.h FsCache.cpp 6 | FsDateTime.h FsDateTime.cpp 7 | FsUtf.h FsUtf.cpp 8 | FmtNumber.h FmtNumber.cpp 9 | ) 10 | 11 | target_link_libraries(sdfat_common PUBLIC sdfat_sdcard) 12 | 13 | target_include_directories(sdfat_common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} 14 | ) 15 | 16 | include_directories(${PROJECT_SOURCE_DIR}) 17 | -------------------------------------------------------------------------------- /sources/Externals/SdFat/src/common/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | exclude_files=PrintBasic.cpp 2 | exclude_files=PrintBasic.h 3 | exclude_files=PrintTemplates.h -------------------------------------------------------------------------------- /sources/Externals/TinyXML2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(tinyxml2 2 | tinyxml2.cpp 3 | tinyxml2adapter.cpp 4 | ) 5 | 6 | target_link_libraries(tinyxml2 PUBLIC 7 | system_filesystem 8 | ) 9 | 10 | target_include_directories(tinyxml2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 11 | 12 | include_directories(${PROJECT_SOURCE_DIR}) 13 | -------------------------------------------------------------------------------- /sources/Externals/TinyXML2/LICENSE.txt: -------------------------------------------------------------------------------- 1 | This software is provided 'as-is', without any express or implied 2 | warranty. In no event will the authors be held liable for any 3 | damages arising from the use of this software. 4 | 5 | Permission is granted to anyone to use this software for any 6 | purpose, including commercial applications, and to alter it and 7 | redistribute it freely, subject to the following restrictions: 8 | 9 | 1. The origin of this software must not be misrepresented; you must 10 | not claim that you wrote the original software. If you use this 11 | software in a product, an acknowledgment in the product documentation 12 | would be appreciated but is not required. 13 | 14 | 2. Altered source versions must be plainly marked as such, and 15 | must not be misrepresented as being the original software. 16 | 17 | 3. This notice may not be removed or altered from any source 18 | distribution. 19 | -------------------------------------------------------------------------------- /sources/Externals/TinyXML2/tinyxml2adapter.cpp: -------------------------------------------------------------------------------- 1 | #include "tinyxml2adapter.h" 2 | #include "System/Console/Trace.h" 3 | #include "System/FileSystem/I_File.h" 4 | #include 5 | #include 6 | 7 | void fprintf(I_File *f, const char *fmt, ...) { 8 | char buffer[256]; 9 | va_list args; 10 | va_start(args, fmt); 11 | 12 | vsprintf(buffer, fmt, args); 13 | int len = strlen(buffer); 14 | f->Write(buffer, 1, len); 15 | }; 16 | -------------------------------------------------------------------------------- /sources/Externals/TinyXML2/tinyxml2adapter.h: -------------------------------------------------------------------------------- 1 | #ifndef _TINY2NOSSTUP_H_ 2 | #define _TINY2NOSSTUP_H_ 3 | #include "System/Console/n_assert.h" 4 | #include "System/FileSystem/FileSystem.h" 5 | #include "System/FileSystem/I_File.h" 6 | #include 7 | 8 | #ifdef FILE 9 | #undef FILE 10 | #endif 11 | #define FILE I_File 12 | #define fopen(a, b) FileSystem::GetInstance()->Open(a, b) 13 | #define fclose(a) \ 14 | a->Close(); \ 15 | delete (a) 16 | #ifdef __APPLE__ 17 | #define fseeko(a, b, c) a->Seek(b, c) 18 | #define ftello(a) a->Tell() 19 | #else 20 | #define fseek(a, b, c) a->Seek(b, c) 21 | #define ftell(a) a->Tell() 22 | #endif 23 | #define fputs(a, b) b->Write(a, 1, strlen(a)) 24 | #define fputc(a, b) b->Write(&a, 1, 1) 25 | #define fread(a, b, c, d) d->Read(a, b) 26 | #define fwrite(a, b, c, d) d->Write(a, b, c) 27 | #define fgetc(a) a->GetC() 28 | #define ferror(a) a->Error() 29 | extern void fprintf(FILE *f, const char *fmt, ...); 30 | #define vfprintf(a, b, c) fprintf(a, b, c) 31 | #endif 32 | -------------------------------------------------------------------------------- /sources/Externals/braids/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(braids 2 | macro_oscillator.h macro_oscillator.cc 3 | analog_oscillator.h analog_oscillator.cc 4 | digital_oscillator.h digital_oscillator.cc 5 | resources.h resources.cc 6 | settings.h settings.cc 7 | excitation.h 8 | svf.h 9 | parameter_interpolation.h 10 | envelope.h 11 | dsp.h 12 | macros.h 13 | random.h random.cc 14 | quantizer.h quantizer.cc 15 | signature_waveshaper.h 16 | vco_jitter_source.h 17 | ) 18 | 19 | target_link_libraries(braids PUBLIC pico_stdlib 20 | ) 21 | 22 | target_include_directories(braids PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 23 | 24 | include_directories(${PROJECT_SOURCE_DIR}) 25 | -------------------------------------------------------------------------------- /sources/Externals/braids/LICENSE: -------------------------------------------------------------------------------- 1 | MIT -------------------------------------------------------------------------------- /sources/Externals/braids/data/map.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/sources/Externals/braids/data/map.bin -------------------------------------------------------------------------------- /sources/Externals/braids/data/waves.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiphonics/picoTracker/a59ba73616b1afd811e320683217d7b81fd190f6/sources/Externals/braids/data/waves.bin -------------------------------------------------------------------------------- /sources/Externals/braids/macros.h: -------------------------------------------------------------------------------- 1 | #ifndef MACROS_H_ 2 | #define MACROS_H_ 3 | 4 | #define CLIP(x) \ 5 | if (x < -32767) \ 6 | x = -32767; \ 7 | if (x > 32767) \ 8 | x = 32767; 9 | 10 | #define CONSTRAIN(var, min, max) \ 11 | if (var < (min)) { \ 12 | var = (min); \ 13 | } else if (var > (max)) { \ 14 | var = (max); \ 15 | } 16 | 17 | #endif // MACROS_H_ 18 | -------------------------------------------------------------------------------- /sources/Externals/cRSID/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(crsid 2 | SID.cpp 3 | ) 4 | 5 | target_include_directories(crsid PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 6 | 7 | include_directories(${PROJECT_SOURCE_DIR}) 8 | -------------------------------------------------------------------------------- /sources/Externals/opal/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(opal 2 | opal.cpp 3 | ) 4 | 5 | # Disable the aggressive-loop-optimizations warning that can cause build errors with GCC14 6 | # this is causeed only by the code changes in opal.cpp lines 241-247 due to code for 4-Op 7 | # which would cause out of bounds access but doesnt because 4-Op are currently disabled 8 | target_compile_options(opal PRIVATE -Wno-aggressive-loop-optimizations) 9 | 10 | target_link_libraries(opal 11 | PUBLIC application_utils 12 | PRIVATE profiler 13 | ) 14 | 15 | target_include_directories(opal PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 16 | 17 | include_directories(${PROJECT_SOURCE_DIR}) 18 | -------------------------------------------------------------------------------- /sources/Externals/yxml/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(yxml 2 | yxml.c 3 | ) 4 | 5 | target_include_directories(yxml PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 6 | 7 | include_directories(${PROJECT_SOURCE_DIR}) 8 | -------------------------------------------------------------------------------- /sources/Externals/yxml/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Yoran Heling 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /sources/Foundation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(foundation 2 | Observable.cpp 3 | SingletonRegistry.cpp 4 | ) 5 | 6 | target_link_libraries(foundation PUBLIC system_console 7 | ) 8 | 9 | target_include_directories(foundation PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 10 | 11 | include_directories(${PROJECT_SOURCE_DIR}) 12 | 13 | add_subdirectory(Variables) 14 | add_subdirectory(Services) 15 | -------------------------------------------------------------------------------- /sources/Foundation/Observable.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "Externals/etl/include/etl/vector.h" 5 | 6 | // Data to be passed from the observable to the observer 7 | 8 | class I_ObservableData {}; 9 | 10 | // The observer: Simply allows to be notified with data 11 | 12 | class Observable; 13 | 14 | class I_Observer { 15 | public: 16 | virtual ~I_Observer(){}; 17 | virtual void Update(Observable &o, I_ObservableData *d) = 0; 18 | }; 19 | 20 | // The observable 21 | 22 | class Observable { 23 | public: 24 | Observable(); 25 | Observable(etl::ivector *list); 26 | virtual ~Observable(); 27 | void AddObserver(I_Observer &o); 28 | void RemoveObserver(I_Observer &o); 29 | void RemoveAllObservers(); 30 | int CountObservers(); 31 | 32 | inline void NotifyObservers() { NotifyObservers(0); }; 33 | 34 | void NotifyObservers(I_ObservableData *d); 35 | 36 | void SetChanged(); 37 | inline void ClearChanged() { _hasChanged = false; }; 38 | bool HasChanged(); 39 | 40 | private: 41 | etl::ivector *_list = NULL; 42 | I_Observer *_variable = NULL; 43 | bool _hasChanged; 44 | }; 45 | -------------------------------------------------------------------------------- /sources/Foundation/Services/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(foundation_services 2 | Service.cpp 3 | ServiceRegistry.cpp 4 | SubService.cpp 5 | ) 6 | 7 | target_include_directories(foundation_services PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 8 | 9 | include_directories(${PROJECT_SOURCE_DIR}) 10 | -------------------------------------------------------------------------------- /sources/Foundation/Services/Service.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Service.h" 3 | #include "ServiceRegistry.h" 4 | 5 | Service::Service(int fourCC) { 6 | fourCC_ = fourCC; 7 | ServiceRegistry::GetInstance()->Register(this); 8 | }; 9 | 10 | Service::~Service(){}; 11 | 12 | void Service::Register(SubService *sub) { Insert(sub); }; 13 | 14 | void Service::Unregister(SubService *sub) { Remove(*sub); }; 15 | -------------------------------------------------------------------------------- /sources/Foundation/Services/Service.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SERVICE_H_ 3 | #define _SERVICE_H_ 4 | 5 | #include "Foundation/T_SimpleList.h" 6 | #include "SubService.h" 7 | 8 | class Service : protected T_SimpleList { 9 | public: 10 | Service(int fourCC); 11 | virtual ~Service(); 12 | virtual void Register(SubService *); 13 | virtual void Unregister(SubService *); 14 | int GetFourCC() { return fourCC_; }; 15 | 16 | private: 17 | int fourCC_; 18 | }; 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Foundation/Services/ServiceRegistry.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "ServiceRegistry.h" 3 | 4 | void ServiceRegistry::Register(Service *s) { services_.Insert(s); }; 5 | 6 | void ServiceRegistry::Register(SubService *s) { 7 | for (services_.Begin(); !services_.IsDone(); services_.Next()) { 8 | Service ¤t = services_.CurrentItem(); 9 | if (current.GetFourCC() == s->GetFourCC()) { 10 | current.Register(s); 11 | }; 12 | }; 13 | }; 14 | 15 | void ServiceRegistry::Unregister(SubService *s) { 16 | for (services_.Begin(); !services_.IsDone(); services_.Next()) { 17 | Service ¤t = services_.CurrentItem(); 18 | if (current.GetFourCC() == s->GetFourCC()) { 19 | current.Unregister(s); 20 | }; 21 | }; 22 | }; 23 | -------------------------------------------------------------------------------- /sources/Foundation/Services/ServiceRegistry.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SERVICE_REGISTRY_H_ 3 | #define _SERVICE_REGISTRY_H_ 4 | 5 | #include "Foundation/T_Singleton.h" 6 | #include "Service.h" 7 | #include "SubService.h" 8 | 9 | class ServiceRegistry : public T_Singleton { 10 | public: 11 | void Register(Service *); 12 | void Register(SubService *); 13 | void Unregister(SubService *); 14 | 15 | protected: 16 | T_SimpleList services_; 17 | }; 18 | #endif 19 | -------------------------------------------------------------------------------- /sources/Foundation/Services/SubService.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "SubService.h" 3 | #include "ServiceRegistry.h" 4 | 5 | SubService::SubService(int fourCC) { 6 | fourCC_ = fourCC; 7 | ServiceRegistry::GetInstance()->Register(this); 8 | }; 9 | 10 | SubService::~SubService() { ServiceRegistry::GetInstance()->Unregister(this); }; 11 | -------------------------------------------------------------------------------- /sources/Foundation/Services/SubService.h: -------------------------------------------------------------------------------- 1 | #ifndef _SUBSERVICE_H_ 2 | #define _SUBSERVICE_H_ 3 | 4 | class SubService { 5 | public: 6 | SubService(int fourCC); 7 | virtual ~SubService(); 8 | int GetFourCC() { return fourCC_; }; 9 | 10 | private: 11 | int fourCC_; 12 | }; 13 | #endif 14 | -------------------------------------------------------------------------------- /sources/Foundation/SingletonRegistry.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "SingletonRegistry.h" 3 | 4 | SingletonRegistry _instance; 5 | 6 | SingletonRegistry::SingletonRegistry() : T_SimpleList(true){}; 7 | 8 | SingletonRegistry::~SingletonRegistry(){}; 9 | 10 | SingletonRegistry *SingletonRegistry::GetInstance() { return &_instance; }; 11 | -------------------------------------------------------------------------------- /sources/Foundation/SingletonRegistry.h: -------------------------------------------------------------------------------- 1 | #ifndef _SINGLETON_REGISTRY_H_ 2 | #define _SINGLETON_REGISTRY_H_ 3 | 4 | #include "T_SimpleList.h" 5 | 6 | class I_Singleton { 7 | public: 8 | virtual ~I_Singleton(){}; 9 | }; 10 | 11 | class SingletonRegistry : public T_SimpleList { 12 | public: 13 | static SingletonRegistry *GetInstance(); 14 | 15 | SingletonRegistry(); 16 | ~SingletonRegistry(); 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /sources/Foundation/T_Factory.cpp: -------------------------------------------------------------------------------- 1 | 2 | template Item *T_Factory::instance_ = 0; 3 | 4 | template void T_Factory::Install(Item *instance) { 5 | instance_ = instance; 6 | } 7 | template Item *T_Factory::GetInstance() { return instance_; } 8 | -------------------------------------------------------------------------------- /sources/Foundation/T_Factory.h: -------------------------------------------------------------------------------- 1 | #ifndef _T_FACTORY_H_ 2 | #define _T_FACTORY_H_ 3 | 4 | // 5 | // Encapsulate a Factory pattern allowing the installation 6 | // of different factories matching one given interface with 7 | // only one available at the time 8 | // 9 | 10 | template class T_Factory { 11 | protected: 12 | virtual ~T_Factory(){}; 13 | 14 | public: 15 | // Install the factory to use 16 | 17 | static void Install(Item *); 18 | 19 | // Get the currently installed factory 20 | 21 | static Item *GetInstance(); 22 | 23 | protected: 24 | // The static instance of the singleton 25 | 26 | static Item *instance_; 27 | }; 28 | 29 | #include "T_Factory.cpp" 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /sources/Foundation/T_Singleton.cpp: -------------------------------------------------------------------------------- 1 | 2 | template Item *T_Singleton::instance_ = 0; 3 | 4 | template T_Singleton::T_Singleton() {} 5 | 6 | template T_Singleton::~T_Singleton() {} 7 | 8 | template Item *T_Singleton::GetInstance() { 9 | if (instance_ == 0) { 10 | instance_ = new Item; 11 | }; 12 | return instance_; 13 | } 14 | -------------------------------------------------------------------------------- /sources/Foundation/T_Singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef _T_SINGLETON_H_ 2 | #define _T_SINGLETON_H_ 3 | 4 | #include "SingletonRegistry.h" 5 | 6 | template class T_Singleton : public I_Singleton { 7 | protected: 8 | T_Singleton(); 9 | virtual ~T_Singleton(); 10 | 11 | public: 12 | // Get the currently installed factory 13 | 14 | static Item *GetInstance(); 15 | 16 | protected: 17 | // The static instance of the singleton 18 | 19 | static Item *instance_; 20 | }; 21 | 22 | #include "T_Singleton.cpp" // Include the implementation file. 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /sources/Foundation/T_Stack.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "T_Stack.h" 3 | 4 | template 5 | T_Stack::T_Stack(bool isOwner) : T_SimpleList(isOwner) { 6 | _size = 0; 7 | }; 8 | 9 | template void T_Stack::Push(Item &i) { this->Insert(i); } 10 | 11 | template Item *T_Stack::Pop(bool lifo) { 12 | Item *i; 13 | if (lifo) { // Last in first out 14 | i = this->GetFirst(); 15 | } else { 16 | i = this->GetLast(); 17 | } 18 | if (i != NULL) { // First in first out 19 | this->Remove(*i, false); 20 | _size--; 21 | } 22 | return i; 23 | } 24 | 25 | template void T_Stack::Insert(Item &i) { 26 | T_SimpleList::Insert(i); 27 | _size++; 28 | } 29 | 30 | template void T_Stack::Insert(Item *i) { 31 | T_SimpleList::Insert(*i); 32 | _size++; 33 | } 34 | 35 | template void T_Stack::Empty() { 36 | T_SimpleList::Empty(); 37 | } 38 | -------------------------------------------------------------------------------- /sources/Foundation/T_Stack.h: -------------------------------------------------------------------------------- 1 | #ifndef _T_STACK_H_ 2 | #define _T_STACK_H_ 3 | 4 | #include "T_SimpleList.h" 5 | 6 | template class T_Stack : protected T_SimpleList { 7 | public: 8 | T_Stack(bool isOwner = false); 9 | virtual ~T_Stack(){}; 10 | void Push(Item &); 11 | Item *Pop(bool lifo = false); 12 | virtual void Insert(Item &); 13 | virtual void Insert(Item *); 14 | void Empty(); 15 | int Size() { return _size; }; 16 | 17 | private: 18 | int _size; 19 | bool _lifo; 20 | }; 21 | 22 | #include "T_Stack.cpp" // Include the implementation file. 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /sources/Foundation/Variables/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(foundation_variables 2 | Variable.cpp 3 | VariableContainer.cpp 4 | WatchedVariable.cpp 5 | ) 6 | 7 | target_include_directories(foundation_variables PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 8 | 9 | include_directories(${PROJECT_SOURCE_DIR}) 10 | -------------------------------------------------------------------------------- /sources/Foundation/Variables/VariableContainer.cpp: -------------------------------------------------------------------------------- 1 | #include "VariableContainer.h" 2 | #include 3 | 4 | VariableContainer::VariableContainer(etl::ilist *list) 5 | : list_(list){}; 6 | 7 | VariableContainer::~VariableContainer(){}; 8 | 9 | Variable *VariableContainer::FindVariable(FourCC id) { 10 | auto it = list_->begin(); 11 | for (size_t i = 0; i < list_->size(); i++) { 12 | if ((*it)->GetID() == id) { 13 | return *it; 14 | } 15 | it++; 16 | } 17 | return NULL; 18 | }; 19 | 20 | Variable *VariableContainer::FindVariable(const char *name) { 21 | auto it = list_->begin(); 22 | for (size_t i = 0; i < list_->size(); i++) { 23 | if (!strcmp((*it)->GetName(), name)) { 24 | return *it; 25 | } 26 | it++; 27 | } 28 | return NULL; 29 | }; 30 | -------------------------------------------------------------------------------- /sources/Foundation/Variables/VariableContainer.h: -------------------------------------------------------------------------------- 1 | #ifndef _VARIABLE_CONTAINER_H_ 2 | #define _VARIABLE_CONTAINER_H_ 3 | 4 | #include "Externals/etl/include/etl/list.h" 5 | #include "Foundation/T_SimpleList.h" 6 | #include "Variable.h" 7 | 8 | class VariableContainer { 9 | public: 10 | VariableContainer(etl::ilist *list); 11 | virtual ~VariableContainer(); 12 | Variable *FindVariable(FourCC id); 13 | Variable *FindVariable(const char *name); 14 | 15 | private: 16 | etl::ilist *list_; 17 | }; 18 | #endif 19 | -------------------------------------------------------------------------------- /sources/Foundation/Variables/WatchedVariable.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WATCHED_VARIABLE_H_ 3 | #define _WATCHED_VARIABLE_H_ 4 | 5 | #include "Foundation/Observable.h" 6 | #include "Variable.h" 7 | 8 | class WatchedVariable : public Variable, public Observable { 9 | public: 10 | WatchedVariable(FourCC id, int value = 0); 11 | WatchedVariable(FourCC id, bool value); 12 | WatchedVariable(FourCC id, const char *const *list, int size, int index = 0); 13 | WatchedVariable(FourCC id, const char *value); 14 | virtual ~WatchedVariable(){}; 15 | static void Enable(); 16 | static void Disable(); 17 | 18 | protected: 19 | virtual void onChange(); 20 | 21 | private: 22 | bool updating_; 23 | static bool enabled_; 24 | }; 25 | #endif 26 | -------------------------------------------------------------------------------- /sources/Services/Audio/Audio.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _AUDIO_H_ 3 | #define _AUDIO_H_ 4 | 5 | #include "AudioOut.h" 6 | #include "AudioSettings.h" 7 | #include "Foundation/T_Factory.h" 8 | #include "Foundation/T_SimpleList.h" 9 | 10 | class Audio : public T_Factory