A sophisticated dual-process splash screen system for Delphi applications featuring automatic progress calculation through adaptive learning algorithms.
- π Dual-Process Architecture: Splash screen runs in a separate process, ensuring smooth 60 FPS animations even during blocking operations
- π§ Adaptive Learning: Automatically learns loading patterns and calculates progress percentages from timing data
- β¨ Modern UI: Skia-powered graphics with gradients, shadows, and smooth animations
- π Zero Configuration: Works out-of-the-box without predefined progress values
- π Self-Improving: Becomes more accurate with each application run
- πΎ Persistent Learning: Stores learning data between sessions for consistent user experience
- π‘οΈ Robust IPC: Inter-process communication using memory-mapped files with mutex synchronization
- π― Auto-Termination: Splash screen automatically closes if parent process dies unexpectedly
The splash screen features a modern design with:
- Gradient logo and text
- Smooth progress bar animations
- Dynamic status messages
- Optional beta badge
- RAD Studio 12 (Delphi 29.0) or later
- Windows 7 or later
- Skia for Delphi (for graphics rendering)
- Clone the repository:
git clone https://github.com/JavierusTk/splash-screen-delphi.git
cd splash-screen-delphi-
Open
SplashGroup.groupprojin RAD Studio -
Install Skia for Delphi from GetIt Package Manager if not already installed
-
Build both projects:
- First build
SplashScreen.dproj(the splash screen executable) - Then build
Test.dprojorTestAuto.dproj(the main applications)
- First build
Just add AutoSplash to your uses clause and the splash screen starts automatically:
program MyApp;
uses
AutoSplash, // β Just add this! Splash starts automatically
Forms,
MainForm;
begin
Application.Initialize;
// Update splash status anywhere in your code
Splash.UpdateStatus('Loading database...');
// ... your initialization code ...
Application.CreateForm(TMainForm, MainForm);
Application.Run;
// Splash closes automatically
end.Create a configuration unit (e.g., MyAppConfig.pas):
unit MyAppConfig;
interface
implementation
uses AutoSplashConfig;
initialization
Config.AppName := 'My Application';
Config.Version := '2.0';
Config.ShowBeta := False;
end.Then in your main program:
uses
MyAppConfig, // Your config (must be first!)
AutoSplash, // Reads Config during initialization
Forms;Note: Config changes in the main program have no effect since AutoSplash reads the configuration during unit initialization.
- Copy the
src/IPCShared.pasunit to your project - Add IPC manager initialization to your main application:
uses
IPCShared;
var
IPCManager: TIPCManager;
begin
// Create IPC manager and launch splash screen
IPCManager := TIPCManager.Create;
try
IPCManager.LaunchSplashScreen;
// Your initialization code here
IPCManager.UpdateStatus('Loading configuration');
// ... more initialization ...
IPCManager.UpdateStatus('Loading modules');
// ... more initialization ...
// Close splash when ready
IPCManager.CloseSplash;
// Start your main application
Application.Run;
finally
IPCManager.Free;
end;
end.The splash screen executable supports several command line parameters:
SplashScreen.exe /pid:1234 [options]Required:
/pid:xxxxx- Parent process ID (required for auto-termination)
Optional:
/APP:name- Application name (default: exe filename without extension)/VER:version- Version string (default: "1.0")/LOAD:text- Loading caption (default: "Loading")/START:text- Starting status message/BETA- Show beta badge/LOGO:path- Path to custom logo file/DEBUG- Enable debug logging toprogress_debug.log/DEBUG:filepath- Enable debug logging to custom file
Let the system automatically calculate progress:
IPCManager.UpdateStatus('Initializing database');
IPCManager.UpdateStatus('Loading user preferences');
IPCManager.UpdateStatus('Preparing interface');Optionally provide explicit progress values:
IPCManager.UpdateProgress(25, 'Loading configuration');
IPCManager.UpdateProgress(50, 'Connecting to database');
IPCManager.UpdateProgress(75, 'Loading modules');The system follows the Single Responsibility Principle with specialized managers:
- TfrmModernSplash: Thin form coordinator (~250 lines)
- SplashRenderingManager: All visual rendering logic
- SplashStyleProvider: Colors, fonts, and visual constants
- SplashLayoutCalculator: Element positioning and layout
- SplashLifecycleManager: Process lifecycle management
- SplashAnimationController: Animation timing and interpolation
- SplashProgressManager: Progress tracking and learning coordination
The splash screen implements two learning systems that work together:
-
Timing-Based Learning (
ProgressLearning.pas)- Records duration of each loading phase
- Calculates average durations and standard deviations
- Automatically assigns progress percentages based on time ratios
- Formula:
Progress% = (PhaseDuration / TotalDuration) Γ 100
-
Progress-Based Learning (
AdaptiveLearning.pas)- Maps status messages to progress values
- Learns typical sequences and transitions
- Handles variations in loading order
- Provides statistical confidence scoring
Learning data is stored in JSON format. The storage location is automatically determined by the executable name:
%APPDATA%\[YourAppName]\splash_history.json- Timing history%APPDATA%\[YourAppName]\splash_learning.json- Progress mappings
For example:
MyApp.exestores data in%APPDATA%\MyApp\Test.exestores data in%APPDATA%\Test\
The progress bar uses a two-stage animation system:
- Primary Stage (0-75% of phase time): Fast movement to reach target percentage
- Creep Stage (75-100% of phase time): Gentle movement for smooth transitions
This ensures each phase visually reaches its target while maintaining fluid transitions between phases.
splash-screen-delphi/
βββ src/ # Source files
β βββ IPCShared.pas # Inter-process communication
β βββ AutoSplash.pas # Auto-start splash unit (NEW!)
β βββ AutoSplashConfig.pas # Auto-splash configuration (NEW!)
β βββ ModernSplashForm.pas # Splash screen UI
β βββ ProgressLearning.pas # Timing-based learning
β βββ AdaptiveLearning.pas # Progress-based learning
β βββ DebugManager.pas # Debug logging system
β βββ SplashConfig.pas # Configuration management
βββ Test.dpr # Manual control example
βββ TestAuto.dpr # Auto-start example (NEW!)
βββ SplashScreen.dpr # Splash screen project
βββ SplashGroup.groupproj # Group project file
βββ SPLASH_SYSTEM.md # Detailed system documentation
βββ LEARNING_SYSTEM.md # Learning system documentation
βββ README.md # This file
Enable debug logging to troubleshoot issues:
- Run with debug flag:
YourApp.exe(splash will inherit debug mode) - Check
progress_debug.login the application directory - Review learning data in
%APPDATA%\[YourAppName]\*.json
To reset learning data (replace YourAppName with your exe name):
del "%APPDATA%\YourAppName\*.json"Example for Test.exe:
del "%APPDATA%\Test\*.json"- SPLASH_SYSTEM.md - Complete system architecture and technical details
- LEARNING_SYSTEM.md - Deep dive into the adaptive learning algorithms
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Skia for Delphi for modern graphics rendering
- Inspired by modern application loading screens with intelligent progress tracking
For issues, questions, or suggestions, please open an issue on GitHub.