How ioma8/littlegptracker works
Main Components
• Core Application Layer – This is where the tracking functionality lives. It includes modules for:
• Application logic (see sources/Application, with subdirectories like Controllers, Instruments, Mixer, Model, Persistency, Player, and Views)
• UI Framework and Views (found in sources/UIFramework and sources/Application/Views)
• Services Layer – This layer provides system-wide capabilities such as:
• Audio Services: Drivers and mixers (sources/Services/Audio, sources/Application/Audio)
• MIDI Services: Message handling and device management (sources/Services/Midi, sources/Application/Instruments for MIDI instruments)
• Controller Services: Input handling via various controllers (sources/Services/Controllers)
• Time Services and other utilities (sources/Services/Time, Foundation utilities)
• Adapters/Platform Abstraction Layer – Given the extensive set of adapters in sources/Adapters for different target platforms (e.g., CAANOO, DINGOO, GP2X, Jack, NDS, OSX, PSP, W32, etc.), this layer abstracts platform-specific functionality. It should also include any specialized audio, filesystem, and user interface implementations for each platform.
• Foundation and System Layer – This includes core utilities, error handling, memory management, logging, file systems, and process control (see sources/Foundation, sources/System). This layer supports both the Application and Services layers.
• External Libraries Integration – Components like SDL, RtAudio, RtMidi, and TinyXML (maintained under sources/Externals) interact with both the adapters and the core services, providing third-party functionality such as sound, MIDI communication, and XML parsing.
• Separation of concerns:
• The Core Application layer uses the Services layer to handle business logic (audio mixing, MIDI, UI updates) without depending directly on platform-specific details.
• The Adapters layer provides a bridge between the generic services and the low-level, platform-specific implementations.
• External libraries are “plugged into” the Services and Adapters layers, showing how third-party tools (SDL, RtAudio, etc.) are leveraged.
• From Adapters to Services (e.g., platform-specific Audio input/output channels flowing into the Audio Service)
• From Services to Application (e.g., processed MIDI events triggering UI or model updates)
• Between Foundation/System Utilities and all higher layers (providing common support like logging, error handling, and file I/O)
Architectural Patterns and Design Principles
• The Adapter Pattern – This is central to the project, as each “sources/Adapters/*” directory houses platform-specific code that implements abstract interfaces expected by the rest of the system.
• Separation of Concerns – Each subdirectory (for instruments, controllers, persistency, etc.) handles a distinct function, supporting easier maintainability and testing.
• Layered Architecture – The project is clearly structured from low-level system components upward to application-specific business logic and presentation.
Specific Technologies/Frameworks
• SDL and its variants (GP2XSDL, WSDL, etc.) for cross-platform graphics, audio, and event handling.
• RtAudio and RtMidi for real-time audio and MIDI services.
• TinyXML for XML parsing (configuration, project persistence, mapping specifications).