McSchneidar 2a6be1b3fe Speed up cover loading and keep the cover DB up to date (#905)
* Recreate cover DB on version mismatch instead of throwing

CCoverDB.Init threw NotImplementedException whenever the stored
version was older than CSettings.DatabaseCoverVersion, so any future
schema change would crash the game on start.

The cover DB is only a cache. On any version mismatch, drop all
tables and create an empty DB with the current layout instead.
Covers are rebuilt on the next load.

* Add indexes to cover DB and guard against duplicate entries

Cover.Path and CoverData.CoverId had no index, so every cover lookup
scanned the whole table. With thousands of songs this makes loading
quadratic. Add unique indexes on both columns.

Use INSERT OR IGNORE plus last_insert_rowid() when storing a cover.
This prepares for loading covers outside the lock, where two threads
may store the same cover concurrently.

Bump DatabaseCoverVersion to 2 so existing cover DBs are recreated
with the indexes.

* Decode and resize covers outside of the cover DB lock

The comment in GetCover claimed the lock was released before loading
the bitmap, but the whole method ran inside lock(_Mutex). All cover
tasks started by CSongs._LoadCovers therefore decoded and resized
one after another, and the remaining thread pool threads just waited.

Split GetCover into three steps:
- _ReadCachedCover: DB lookup (locked)
- decoding and resizing (not locked, runs in parallel)
- _StoreCover: DB insert (locked)

The duplicated resize code moves into _FitToMaxSize.

If the DB connection has been closed in the meantime, GetCover now
still returns true, because the texture has already been created.
Before, it returned false, and the caller generated a second cover
while the first texture was still queued.

* Store resized covers and detect changed cover files

The cover DB stored the original cover file. Every later load still
had to decode the full-size image (often 1000-3000 px) and scale it
down to CoverSize, so the cache only saved reading the file from disk.

- Store the cover already scaled to CoverSize: JPEG (quality 90), or
  PNG if the original has transparency. Covers that are already small
  enough are stored unchanged to avoid recompressing them.
- Entries were only keyed by path, so a replaced cover file with the
  same name was never picked up. Also store file size, last write
  time and CoverSize, and drop outdated entries on lookup.
- _FitToMaxSize throws if Resize fails instead of passing null on.
2026-10-16 05:22:44 +02:00
2024-11-01 11:23:51 +01:00
2024-10-13 12:52:36 +02:00
2024-01-08 20:53:06 +01:00
2012-02-24 07:54:24 +01:00
2015-03-05 03:13:53 +01:00
2020-02-10 19:06:47 +01:00
2023-12-28 20:58:13 +01:00
2018-09-17 10:45:23 +02:00

Vocaluxe Logo

Build status Nightly build Latest stable release Known bugs Feature requests License

1. About 2. Download 3. Contributing 4. Help & Support

1. About

Vocaluxe is a free and open source singing game, inspired by the original UltraStar (developed by corvus5) and the great Ultrastar Deluxe project - yet it is an entirely new development in C#. It allows up to six players to sing along with music using microphones in order to score points, depending on the pitch of the voice and the rhythm of singing. It features mouse, keyboard, gamepad and Wiimote navigation, a multi-language interface, and singer profiles with avatars and supports songs in CP1250/52 and UTF8 encodings. Vocaluxe offers diversified party modes and can optionally be controlled via a browser (desktop and mobile supported).

Supported Operating Systems / Requirements:

  • Windows 7, Windows 8, Windows 8.1, Windows 10 and Windows 11 with .NET 4.0
  • Linux (no official support)
  • 1 GHz CPU, 512 MB RAM, Graphics card with OpenGL 2.1 or DirectX 9.0 support
  • Visual C++ Redistributable Package 2010 (Nightly builds additionally require VC++ 2015–2022)

2. Download

You can download precompiled Windows binaries at here: https://vocaluxe.org/#download

3. Contributing

You want to fix a bug or add a cool new feature to Vocaluxe? Awesome! Check out milestones or our Game Design Document!

Build Vocaluxe

Building Vocaluxe is easy: Just follow the guide on our wiki to clone the repository and create your own Vocaluxe build: Build Vocaluxe (Windows)

Submit your change

Upload your changes to your fork and open a new pull request.

The development of Vocaluxe uses this git branching model: http://nvie.com/posts/a-successful-git-branching-model/

Questions

You have a problem or a question implementing your change? Just open an issue or mention @Vocaluxe in a comment on GitHub.

4. Help & Support

General FAQ: https://www.open-music-games.org/help/frequently-asked-questions Discord Help Desk: https://discord.gg/tNEXZw2QJX Homepage: https://vocaluxe.org/ GitHub Wiki: https://github.com/Vocaluxe/Vocaluxe/wiki GitHub Issues Tracker: https://github.com/Vocaluxe/Vocaluxe/issues Translations: https://www.transifex.com/projects/p/vocaluxe/ Song-Database (USDB): http://usdb.animux.de/

S
Description
Vocaluxe is an open source singing game inspired by SingStar™ and Ultrastar Deluxe.
https://vocaluxe.org Readme
761 MiB
0 Stars 2 Watchers 0 Forks
Languages
C# 97.3%
Vue 1.1%
C++ 1%
TypeScript 0.3%
PowerShell 0.1%