<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: setoutsoft</title>
    <description>The latest articles on DEV Community by setoutsoft (@setoutsoft).</description>
    <link>https://dev.to/setoutsoft</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2813693%2F46fd98ad-8332-4b8e-b13b-8573c4dc06f4.png</url>
      <title>DEV Community: setoutsoft</title>
      <link>https://dev.to/setoutsoft</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/setoutsoft"/>
    <language>en</language>
    <item>
      <title>XMusic: A 10MB Cross-Platform Music Player Built with C++</title>
      <dc:creator>setoutsoft</dc:creator>
      <pubDate>Wed, 06 May 2026 03:57:38 +0000</pubDate>
      <link>https://dev.to/setoutsoft/xmusic-a-10mb-cross-platform-music-player-built-with-c-5dgb</link>
      <guid>https://dev.to/setoutsoft/xmusic-a-10mb-cross-platform-music-player-built-with-c-5dgb</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;In an era dominated by Electron and web technologies, we seem to have forgotten that desktop applications should be &lt;strong&gt;lighter&lt;/strong&gt; and &lt;strong&gt;faster&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Have you ever encountered these frustrations?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ Your simple music player takes &lt;strong&gt;200+ MB&lt;/strong&gt; of RAM&lt;/li&gt;
&lt;li&gt;❌ Startup time exceeds &lt;strong&gt;5-10 seconds&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;❌ Distribution requires bundling Chromium or heavy runtime libraries&lt;/li&gt;
&lt;li&gt;❌ Performance feels sluggish on older hardware&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;XMusic&lt;/strong&gt; was born to solve these problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs803ou8xsyhjeumkc9cj.png" alt=" " width="675" height="556"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  🚀 Performance That Speaks for Itself
&lt;/h2&gt;

&lt;p&gt;Here's what makes XMusic stand out:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;XMusic&lt;/th&gt;
&lt;th&gt;Typical Electron App&lt;/th&gt;
&lt;th&gt;Qt Application&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Memory Usage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~10 MB&lt;/td&gt;
&lt;td&gt;200-500 MB&lt;/td&gt;
&lt;td&gt;80-150 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Startup Time&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;710ms*&lt;/td&gt;
&lt;td&gt;5-10s&lt;/td&gt;
&lt;td&gt;2-5s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Binary Size&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;15-25 MB&lt;/td&gt;
&lt;td&gt;100-300 MB&lt;/td&gt;
&lt;td&gt;50-200 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Dependencies&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;None (single file)&lt;/td&gt;
&lt;td&gt;Node.js + Chromium&lt;/td&gt;
&lt;td&gt;Qt runtime libs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff13tkrpsntlhf0jdym2f.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff13tkrpsntlhf0jdym2f.jpg" alt=" " width="800" height="249"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;*Note: 625ms is spent on SDL audio initialization; the UI itself launches in just **85ms&lt;/em&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;All libraries are statically compiled into the final executable — &lt;strong&gt;one file handles everything&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  🎯 Why XMusic Exists
&lt;/h2&gt;
&lt;h3&gt;
  
  
  The Problem with Modern Desktop Development
&lt;/h3&gt;

&lt;p&gt;In today's landscape, developers often reach for Electron or web-based frameworks because:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Rich ecosystem&lt;/strong&gt;: npm packages, React/Vue components&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Familiar technology&lt;/strong&gt;: HTML/CSS/JavaScript&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rapid prototyping&lt;/strong&gt;: Quick to build MVPs&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But this comes at a cost:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bloated binaries&lt;/strong&gt;: Simple apps balloon to 100MB+&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;High memory footprint&lt;/strong&gt;: Chromium instances consume resources&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Slow startup&lt;/strong&gt;: Loading entire browser engine for a music player?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security concerns&lt;/strong&gt;: Larger attack surface with web technologies&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  The Native C++ Alternative
&lt;/h3&gt;

&lt;p&gt;XMusic demonstrates that &lt;strong&gt;modern C++ desktop development&lt;/strong&gt; can be:&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Lightweight&lt;/strong&gt;: 10MB memory footprint&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Fast&lt;/strong&gt;: Sub-second startup&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Cross-platform&lt;/strong&gt;: Windows, Linux, macOS from one codebase&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Simple&lt;/strong&gt;: Single executable, no external dependencies  &lt;/p&gt;


&lt;h2&gt;
  
  
  🏗️ Technical Architecture
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Core Technology Stack
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────────────────────┐
│        UI Layer (SOUI4)             │
│  Declarative XML Layout + CSS-like  │
│  Data-driven rendering engine       │
└─────────────────────────────────────┘
                  ↓
┌─────────────────────────────────────┐
│     Audio Engine (SDL3)             │
│  SDL_mixer3 for format decoding     │
│  Ring buffer for low-latency play   │
└─────────────────────────────────────┘
                  ↓
┌─────────────────────────────────────┐
│    Metadata &amp;amp; Encoding              │
│  TagLib (ID3v2 editing)             │
│  LAME (MP3 encoding)                │
│  LRCLIB API (lyrics fetching)       │
└─────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Key Technologies Explained
&lt;/h3&gt;
&lt;h4&gt;
  
  
  1. &lt;strong&gt;SOUI4: Modern Direct UI Framework&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;SOUI4 is a lightweight cross-platform UI framework that uses &lt;strong&gt;declarative XML layouts&lt;/strong&gt; — similar to Android's approach but for desktop applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Separation of concerns&lt;/strong&gt;: UI defined in XML, logic in C++&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No traditional Win32/GDI bottlenecks&lt;/strong&gt;: Direct rendering pipeline&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Built-in high DPI support&lt;/strong&gt;: Crisp on 4K displays&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-language&lt;/strong&gt;: Automatic system locale detection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Animation system&lt;/strong&gt;: Smooth transitions out of the box&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example XML layout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;window&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"800"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"600"&lt;/span&gt; &lt;span class="na"&gt;title=&lt;/span&gt;&lt;span class="s"&gt;"XMusic"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;window&lt;/span&gt; &lt;span class="na"&gt;layout=&lt;/span&gt;&lt;span class="s"&gt;"vbox"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;listView&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"playlist"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;window&lt;/span&gt; &lt;span class="na"&gt;layout=&lt;/span&gt;&lt;span class="s"&gt;"hbox"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"play"&lt;/span&gt; &lt;span class="na"&gt;text=&lt;/span&gt;&lt;span class="s"&gt;"@string/play"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"pause"&lt;/span&gt; &lt;span class="na"&gt;text=&lt;/span&gt;&lt;span class="s"&gt;"@string/pause"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;slider&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"volume"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/window&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/window&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/window&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. &lt;strong&gt;SDL3 + SDL_mixer3: Audio Powerhouse&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Instead of reinventing the wheel, XMusic leverages industry-standard libraries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Format support&lt;/strong&gt;: MP3, FLAC, OGG, WAV, MOD, OPUS, M4A/AAC, WMA&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low-latency playback&lt;/strong&gt;: Optimized ring buffer implementation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-platform audio backends&lt;/strong&gt;: DirectSound, ALSA, PulseAudio, CoreAudio&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. &lt;strong&gt;TagLib: Complete Metadata Management&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Full ID3v2 tag editing capabilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read/write artist, album, year, genre&lt;/li&gt;
&lt;li&gt;Album art extraction and display&lt;/li&gt;
&lt;li&gt;Batch metadata operations&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  4. &lt;strong&gt;LAME Encoder: Industry-Standard MP3 Conversion&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Built-in batch conversion tool:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Convert FLAC/OGG/WAV → MP3&lt;/li&gt;
&lt;li&gt;Configurable bitrate (128-320 kbps)&lt;/li&gt;
&lt;li&gt;Multi-threaded encoding for speed&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  5. &lt;strong&gt;LRCLIB API: Online Lyrics Integration&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Automatic lyrics fetching:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search by artist + title&lt;/li&gt;
&lt;li&gt;LRC format with timestamp synchronization&lt;/li&gt;
&lt;li&gt;Karaoke-style word-by-word highlighting&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌍 True Cross-Platform Support
&lt;/h2&gt;

&lt;p&gt;XMusic runs natively on all major operating systems with &lt;strong&gt;zero code changes&lt;/strong&gt;:&lt;/p&gt;

&lt;h3&gt;
  
  
  Windows (xp/7/8/10/11)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Native Win32 API integration&lt;/li&gt;
&lt;li&gt;System tray support&lt;/li&gt;
&lt;li&gt;Dark/light theme adaptation&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Linux (Ubuntu, Fedora, Arch, etc.)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;X11/Wayland compatibility&lt;/li&gt;
&lt;li&gt;PulseAudio/PipeWire support&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single-file deployment&lt;/strong&gt;: No &lt;code&gt;.so&lt;/code&gt; dependencies to distribute&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  macOS (10.15+)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Native Cocoa integration via swinx compatibility layer&lt;/li&gt;
&lt;li&gt;Metal-accelerated rendering&lt;/li&gt;
&lt;li&gt;Retina display support&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Secret Sauce: Swinx
&lt;/h3&gt;

&lt;p&gt;SOUI4's &lt;strong&gt;swinx&lt;/strong&gt; module provides a Windows API compatibility layer for Linux/macOS, allowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reuse existing Windows code without modification&lt;/li&gt;
&lt;li&gt;Consistent behavior across platforms&lt;/li&gt;
&lt;li&gt;Avoid platform-specific &lt;code&gt;#ifdef&lt;/code&gt; spaghetti&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is similar to a lightweight Wine implementation, but designed specifically for GUI applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 Deployment Simplicity
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Traditional Approach
&lt;/h3&gt;

&lt;p&gt;A typical cross-platform app requires distributing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MyApp/
├── MyApp.exe
├── qt5core.dll
├── qt5gui.dll
├── qt5widgets.dll
├── libssl.so.1.1
├── libcrypto.so.1.1
├── plugins/
│   ├── platforms/
│   ├── imageformats/
│   └── ...
└── translations/
    └── qt_en.qm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  XMusic Approach
&lt;/h3&gt;

&lt;p&gt;Just &lt;strong&gt;one file&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;XMusic.exe  (or xmusic_player on Linux/macOS)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How It Works
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Resource embedding&lt;/strong&gt;: All UI assets (XML, images, fonts) compiled into the binary via &lt;code&gt;.rc&lt;/code&gt; files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Static linking&lt;/strong&gt;: Every dependency (SDL3, TagLib, LAME, SOUI4) linked statically&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Runtime extraction&lt;/strong&gt;: Resources automatically extracted from PE/ELF sections at startup&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This not only simplifies deployment but also &lt;strong&gt;improves security&lt;/strong&gt; — resource files can't be tampered with or lost.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤔 Why Not Qt or Electron?
&lt;/h2&gt;

&lt;p&gt;Great question! Let's break it down:&lt;/p&gt;

&lt;h3&gt;
  
  
  Electron: Pros and Cons
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Massive frontend ecosystem (React, Vue, Angular)&lt;/li&gt;
&lt;li&gt;Rapid development with web technologies&lt;/li&gt;
&lt;li&gt;Easy to hire developers (everyone knows JavaScript)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Huge binary size&lt;/strong&gt;: 100-300 MB for simple apps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory hog&lt;/strong&gt;: 200-500 MB RAM usage&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Slow startup&lt;/strong&gt;: 5-10 seconds to load Chromium&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Overkill&lt;/strong&gt;: Do you really need a full browser for a music player?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to use Electron:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complex web-based features needed&lt;/li&gt;
&lt;li&gt;Team already skilled in web development&lt;/li&gt;
&lt;li&gt;Rapid prototyping prioritized over performance&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Qt: Pros and Cons
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mature, battle-tested framework&lt;/li&gt;
&lt;li&gt;Excellent documentation&lt;/li&gt;
&lt;li&gt;Powerful QML for declarative UI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Steep learning curve&lt;/strong&gt;: Hundreds of classes to master&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Large binaries&lt;/strong&gt;: 50-200 MB even for simple apps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complex dependencies&lt;/strong&gt;: Multiple &lt;code&gt;.dll&lt;/code&gt;/&lt;code&gt;.so&lt;/code&gt; files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Licensing concerns&lt;/strong&gt;: LGPL/commercial licenses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to use Qt:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Large-scale enterprise applications&lt;/li&gt;
&lt;li&gt;Need extensive widget library&lt;/li&gt;
&lt;li&gt;Team experienced with C++/Qt&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  SOUI4: The Sweet Spot
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lightweight&lt;/strong&gt;: 15-25 MB binary, 10-50 MB RAM&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy to learn&lt;/strong&gt;: Familiar to Win32/MFC developers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast development&lt;/strong&gt;: XML layouts + C++ logic&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero dependencies&lt;/strong&gt;: Single-file deployment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free for commercial use&lt;/strong&gt;: No licensing headaches&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Smaller community than Qt/Electron&lt;/li&gt;
&lt;li&gt;Fewer third-party plugins&lt;/li&gt;
&lt;li&gt;Documentation primarily in Chinese (improving!)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to use SOUI4:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Medium-sized desktop applications&lt;/li&gt;
&lt;li&gt;Performance and size matter&lt;/li&gt;
&lt;li&gt;Existing Windows codebase to port to Linux/macOS&lt;/li&gt;
&lt;li&gt;Prefer native C++ over web technologies&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 What XMusic Demonstrates
&lt;/h2&gt;

&lt;p&gt;XMusic proves that &lt;strong&gt;modern C++ desktop development&lt;/strong&gt; is still viable and advantageous for certain use cases:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Performance Matters&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;For applications where responsiveness is critical (audio playback, real-time visualization), native code wins:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Low-latency audio&lt;/strong&gt;: Direct hardware access via SDL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smooth animations&lt;/strong&gt;: GPU-accelerated rendering&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant startup&lt;/strong&gt;: No VM or interpreter overhead&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Resource Efficiency&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Not every user has a beefy machine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Runs smoothly on &lt;strong&gt;older hardware&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Doesn't monopolize system RAM&lt;/li&gt;
&lt;li&gt;Suitable for &lt;strong&gt;embedded systems&lt;/strong&gt; or &lt;strong&gt;thin clients&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Simplified Distribution&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;One file to rule them all:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No installer needed&lt;/li&gt;
&lt;li&gt;Portable (run from USB drive)&lt;/li&gt;
&lt;li&gt;Easy to version control and distribute&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Developer Productivity&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Despite being C++, development is fast:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Declarative UI&lt;/strong&gt;: Change XML, see results immediately&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hot reload&lt;/strong&gt;: Some SOUI4 setups support live UI updates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modular architecture&lt;/strong&gt;: Easy to extend with new features&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Building XMusic
&lt;/h2&gt;

&lt;p&gt;Getting started is straightforward:&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;CMake 3.16+&lt;/li&gt;
&lt;li&gt;C++17 compiler (MSVC, GCC, Clang)&lt;/li&gt;
&lt;li&gt;Git (for submodules)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Build Steps
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clone with submodules&lt;/span&gt;
git clone &lt;span class="nt"&gt;--recursive&lt;/span&gt; https://gitee.com/setoutsoft/xmusic.git
&lt;span class="nb"&gt;cd &lt;/span&gt;XMusic

&lt;span class="c"&gt;# Build&lt;/span&gt;
&lt;span class="nb"&gt;mkdir &lt;/span&gt;build &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;build
cmake .. &lt;span class="nt"&gt;-DCMAKE_BUILD_TYPE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Release
cmake &lt;span class="nt"&gt;--build&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;--config&lt;/span&gt; Release

&lt;span class="c"&gt;# Run&lt;/span&gt;
./bin/xmusic_player  &lt;span class="c"&gt;# Linux/macOS&lt;/span&gt;
..&lt;span class="se"&gt;\b&lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="se"&gt;\R&lt;/span&gt;elease&lt;span class="se"&gt;\X&lt;/span&gt;Music.exe  &lt;span class="c"&gt;# Windows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! CMake automatically handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Downloading SDL3, SDL_mixer, TagLib, LAME, SOUI4&lt;/li&gt;
&lt;li&gt;Compiling all dependencies as static libraries&lt;/li&gt;
&lt;li&gt;Embedding UI resources into the binary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;No manual dependency installation required.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🎨 Feature Showcase
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Core Playback
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Multi-format support (MP3, FLAC, OGG, WAV, etc.)&lt;/li&gt;
&lt;li&gt;Gapless playback&lt;/li&gt;
&lt;li&gt;Playlist management with drag-and-drop&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Advanced Audio
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multi-band equalizer&lt;/strong&gt;: Presets for Pop, Rock, Classical&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spectrum visualization&lt;/strong&gt;: Real-time FFT animation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Volume normalization&lt;/strong&gt;: Consistent loudness across tracks&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Metadata &amp;amp; Tags
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;ID3v2 tag editor&lt;/li&gt;
&lt;li&gt;Album art display&lt;/li&gt;
&lt;li&gt;Batch metadata operations&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Lyrics System
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Auto-detect &lt;code&gt;.lrc&lt;/code&gt; files&lt;/li&gt;
&lt;li&gt;Online search via LRCLIB API&lt;/li&gt;
&lt;li&gt;Karaoke-mode word highlighting&lt;/li&gt;
&lt;li&gt;Smooth scale-fade transitions between lines&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  User Experience
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Modern dark theme (#1a1a1a background, #e60026 accent)&lt;/li&gt;
&lt;li&gt;System tray integration&lt;/li&gt;
&lt;li&gt;Global hotkeys&lt;/li&gt;
&lt;li&gt;Multi-language (auto-detects system locale)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📊 Real-World Use Cases
&lt;/h2&gt;

&lt;p&gt;XMusic's architecture makes it suitable for:&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Personal Music Players
&lt;/h3&gt;

&lt;p&gt;Lightweight alternative to bloated commercial players&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Digital Signage
&lt;/h3&gt;

&lt;p&gt;Low-resource audio playback for kiosks&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Embedded Systems
&lt;/h3&gt;

&lt;p&gt;Runs on Raspberry Pi, embedded Linux devices&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Educational Projects
&lt;/h3&gt;

&lt;p&gt;Demonstrates modern C++ best practices&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Legacy App Modernization
&lt;/h3&gt;

&lt;p&gt;Template for porting old Win32 apps to cross-platform&lt;/p&gt;




&lt;h2&gt;
  
  
  🚧 Future Roadmap
&lt;/h2&gt;

&lt;p&gt;Planned enhancements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] &lt;strong&gt;Podcast support&lt;/strong&gt;: RSS feed integration&lt;/li&gt;
&lt;li&gt;[ ] &lt;strong&gt;Streaming&lt;/strong&gt;: Internet radio stations&lt;/li&gt;
&lt;li&gt;[ ] &lt;strong&gt;Cloud sync&lt;/strong&gt;: Playlist backup to cloud storage&lt;/li&gt;
&lt;li&gt;[ ] &lt;strong&gt;Mobile ports&lt;/strong&gt;: iOS/Android via SOUI4 mobile backend&lt;/li&gt;
&lt;li&gt;[ ] &lt;strong&gt;Plugin system&lt;/strong&gt;: Third-party visualizations and effects&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🤝 Contributing
&lt;/h2&gt;

&lt;p&gt;XMusic is open-source and welcomes contributions!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ways to help:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Report bugs on &lt;a href="https://gitee.com/setoutsoft/xmusic/issues" rel="noopener noreferrer"&gt;Gitee Issues&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Submit pull requests for new features&lt;/li&gt;
&lt;li&gt;Improve documentation and translations&lt;/li&gt;
&lt;li&gt;Test on different Linux distributions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Development guidelines:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Follow C++11 standards&lt;/li&gt;
&lt;li&gt;Maintain cross-platform compatibility&lt;/li&gt;
&lt;li&gt;Add comments for complex logic&lt;/li&gt;
&lt;li&gt;Test on Windows + Linux before submitting&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📚 Learn More
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;XMusic Repository&lt;/strong&gt;: &lt;a href="https://gitee.com/setoutsoft/xmusic" rel="noopener noreferrer"&gt;Gitee&lt;/a&gt; | &lt;a href="https://github.com/setoutsoft/XMusic" rel="noopener noreferrer"&gt;GitHub Mirror&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SOUI4 Framework&lt;/strong&gt;: &lt;a href="https://soui.com.cn" rel="noopener noreferrer"&gt;Official Site&lt;/a&gt; | &lt;a href="https://github.com/soui-sys/soui4" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SDL3 Documentation&lt;/strong&gt;: &lt;a href="https://wiki.libsdl.org/SDL3/" rel="noopener noreferrer"&gt;libsdl.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build Guide&lt;/strong&gt;: &lt;a href="https://gitee.com/setoutsoft/xmusic/blob/master/BUILD_GUIDE.md" rel="noopener noreferrer"&gt;BUILD_GUIDE.md&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🎯 Conclusion
&lt;/h2&gt;

&lt;p&gt;XMusic demonstrates that &lt;strong&gt;native C++ desktop development&lt;/strong&gt; is far from dead. In fact, for applications prioritizing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⚡ &lt;strong&gt;Performance&lt;/strong&gt;: Low latency, smooth animations&lt;/li&gt;
&lt;li&gt;💾 &lt;strong&gt;Efficiency&lt;/strong&gt;: Minimal memory and disk usage&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Simplicity&lt;/strong&gt;: Single-file deployment&lt;/li&gt;
&lt;li&gt;🌍 &lt;strong&gt;Portability&lt;/strong&gt;: True cross-platform support&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...there's no better choice than going native.&lt;/p&gt;

&lt;p&gt;While Electron and web technologies dominate the conversation, projects like XMusic prove that &lt;strong&gt;traditional approaches, modernized&lt;/strong&gt;, still have their place.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you're building a desktop application where performance matters, consider giving native C++ another look.&lt;/strong&gt; You might be surprised by how productive and enjoyable it can be with the right framework.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Enjoyed this article?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;⭐ Star the &lt;a href="https://gitee.com/setoutsoft/xmusic" rel="noopener noreferrer"&gt;XMusic repository&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🐦 Share on Twitter&lt;br&gt;&lt;br&gt;
💬 Leave a comment below  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Happy coding!&lt;/em&gt; 🎵&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Related Articles
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SOUI4: A Lightweight Alternative to Qt&lt;/li&gt;
&lt;li&gt;Why I Chose C++ Over Electron for My Desktop App&lt;/li&gt;
&lt;li&gt;Building Cross-Platform Apps Without JavaScript&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Tags&lt;/strong&gt;: &lt;code&gt;#cpp&lt;/code&gt; &lt;code&gt;#crossplatform&lt;/code&gt; &lt;code&gt;#desktop&lt;/code&gt; &lt;code&gt;#opensource&lt;/code&gt; &lt;code&gt;#performance&lt;/code&gt; &lt;code&gt;#soui4&lt;/code&gt; &lt;code&gt;#sdl&lt;/code&gt; &lt;code&gt;#linux&lt;/code&gt; &lt;code&gt;#windows&lt;/code&gt; &lt;code&gt;#macos&lt;/code&gt;&lt;/p&gt;

</description>
      <category>crossplatform</category>
      <category>green</category>
      <category>musicplayer</category>
      <category>soui</category>
    </item>
    <item>
      <title>A new cross-platform GUI framework</title>
      <dc:creator>setoutsoft</dc:creator>
      <pubDate>Tue, 04 Feb 2025 08:58:56 +0000</pubDate>
      <link>https://dev.to/setoutsoft/a-new-cross-platform-gui-framework-419f</link>
      <guid>https://dev.to/setoutsoft/a-new-cross-platform-gui-framework-419f</guid>
      <description>&lt;p&gt;I'm going to introduce my work to you here. After 8 monthes hard work, the project SwinX can be run perfectly now, you can treat it as a minimal Wine. I published it to github (&lt;a href="https://github.com/soui4/swinx" rel="noopener noreferrer"&gt;https://github.com/soui4/swinx&lt;/a&gt;). SwinX means simple windows APIs for cross platforms. Most windows APIs which are commonly used in a GUI program were implemented in SwinX, including HWND relevent APIs, message APIs, gdi APIs and kenerl objects (event, mutex, semaphore etc.). The other GUI project SOUI that also owned by me was used to verify SwinX. SOUI is an GUI open source project (repo: &lt;a href="https://github.com/soui4/soui" rel="noopener noreferrer"&gt;https://github.com/soui4/soui&lt;/a&gt;) used for windows.&lt;br&gt;
After few of modifications, by linked to SwinX, almost all of functions implemented in SOUI can work for Linux now, including Ubuntu, Debian, Centos, Fedora. &lt;/p&gt;

&lt;p&gt;For now, we had very few options when one want to develop a cross platform GUI program. except for Qt, GTK and Electron. However, if one need transplant an existed project that built for Windows to Linux, we almost has no option (Wine may be an option, but it can't work for large scale project at most time.) &lt;/p&gt;

&lt;p&gt;To build the project, I suggest you starting from cloning SOUI from github (using the master branch). SOUI references SwinX using git submodule. As I'm an Chinese, the submodule reference by SOUI is owned by Gitee that is commonly used in China. If you can't visit Gitee, you can change the submodule to Github manually. SwinX depends on including XCB, cairo and other packages. You can find build.md in SwinX repo. After install the necessary packages, you can build SOUI on Linux and run all of demos. &lt;br&gt;
Any questions or suggestions you can ask me here or send me mail: &lt;a href="mailto:setoutsoft@qq.com"&gt;setoutsoft@qq.com&lt;/a&gt;.&lt;br&gt;
Thank you very much!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
