From 4dca5ba713a9ec0a551aedcdcff098e8e9e36a3e Mon Sep 17 00:00:00 2001 From: James De Ricco Date: Tue, 10 Oct 2023 18:39:35 -0400 Subject: [PATCH] Display author, title, license in the level editor music browser (#2617) Whenever any of author, title and license fields are defined for music files, help text showing this music metadata is displayed when hovering over ".music" files in the level editor music object file browser. This commit adds both the software implementation and author, title, and license values added to SuperTux music files in data/music. The game credits and data/AUTHORS are updated in some cases where there is new authorship data. Fixes #2617. --- data/AUTHORS | 17 ++++--- data/credits.stxt | 28 ++++++++++- data/music/antarctic/airship_remix-2.music | 3 ++ data/music/antarctic/airship_remix.music | 3 ++ data/music/antarctic/arctic_breeze.music | 3 ++ data/music/antarctic/arctic_cave.music | 3 ++ data/music/antarctic/bossattack.music | 3 ++ data/music/antarctic/cave.music | 3 ++ data/music/antarctic/chipdisko.music | 3 ++ data/music/antarctic/jewels.music | 3 ++ data/music/antarctic/salcon.music | 3 ++ data/music/antarctic/voc-boss.music | 2 + data/music/antarctic/voc-dark.music | 2 + data/music/antarctic/voc-daytime.music | 2 + data/music/antarctic/voc-daytime2.music | 2 + data/music/antarctic/voc-night.music | 2 + data/music/castle/darkforestkeep.music | 3 ++ data/music/castle/fortress.music | 3 ++ .../forest/beneath_the_rabbit_hole.music | 3 ++ data/music/forest/bright_thunders.music | 2 + .../forest/call_of_the_winding_path.music | 2 + data/music/forest/clavelian_march.music | 2 + data/music/forest/forest-cave.music | 2 + data/music/forest/forest-sprint.music | 2 + data/music/forest/forest.music | 3 ++ data/music/forest/forest2.music | 3 ++ data/music/forest/forest3.music | 3 ++ data/music/forest/forest_theme.music | 3 ++ data/music/forest/ghostforest.music | 3 ++ data/music/forest/ghostforest2.music | 3 ++ data/music/forest/ghostforest_map.music | 2 + data/music/forest/greatgigantic.music | 3 ++ .../forest/march_of_the_malevolent.music | 3 ++ data/music/forest/new_forest_map.music | 2 + data/music/forest/shallow-green.music | 3 ++ data/music/forest/treeboss.music | 2 + data/music/forest/wisphunt.music | 2 + data/music/misc/battle_theme.music | 3 ++ data/music/misc/bonuscave.music | 3 ++ data/music/misc/credits.music | 3 ++ data/music/misc/halloween_1.music | 2 + data/music/misc/intro.music | 3 ++ data/music/misc/theme.music | 3 ++ data/music/retro/cave_old.music | 3 ++ data/music/retro/classic.music | 1 + data/music/retro/fortress_old.music | 3 ++ data/music/retro/ice_music.music | 2 + data/music/retro/worldmap_old.music | 2 + data/music/tropical/saharan_penguin.music | 2 + data/music/tropical/tropicalbreeze.music | 3 ++ src/audio/sound_file.cpp | 47 +++++++++++++++---- src/audio/sound_file.hpp | 8 +++- src/editor/object_option.cpp | 8 ++-- src/editor/object_option.hpp | 4 +- src/editor/object_settings.cpp | 37 +++++++++++++-- src/editor/object_settings.hpp | 3 +- src/gui/item_file.cpp | 8 ++-- src/gui/item_file.hpp | 4 +- src/gui/menu.cpp | 7 ++- src/gui/menu.hpp | 3 +- src/gui/menu_filesystem.cpp | 16 +++++-- src/gui/menu_filesystem.hpp | 3 +- 62 files changed, 279 insertions(+), 38 deletions(-) diff --git a/data/AUTHORS b/data/AUTHORS index d5344db9716..f049de6c48e 100644 --- a/data/AUTHORS +++ b/data/AUTHORS @@ -27,18 +27,19 @@ License should be included with them. == Music == All files in data/music created by wansti and licensed under GPLv2+CC-by-sa, unless stated otherwise. -* airship_remix.ogg - from remaxim at OpenGameArt.org, permission to release under CC-BY-SA and GPL version 2 or later +* airship_remix.ogg - by Bart Kelsey submitted by remaxim at OpenGameArt.org, permission to release under CC-BY-SA and GPL version 2 or later * airship_2.ogg - Jason Lavallée, dual-licensed: GPL version 2 or later and CC-BY-SA * arctic_cave.ogg - Jason Lavallée, dual-licensed: GPL version 2 or later and CC-BY-SA -* battle_theme.ogg - from remaxim at OpenGameArt.org, permission to release under CC-BY-SA and GPL version 2 or later +* battle_theme.ogg - from remaxim at OpenGameArt.org, permission to release under CC-BY-SA 3.0 and GPL version 2 or later * beneath_the_rabbit_hole.ogg - Jason Lavallée, dual-licensed: GPL version 2 or later and CC-BY-SA * bonuscave.ogg * bossattack.ogg -* bright_thunders.ogg - by Krobonil, licensed under CC-BY-SA +* bright_thunders.ogg - by Chris "Krobonil" Leutwyler, licensed under CC-BY-SA * cave.ogg +* cave_old.ogg * call_of_the_winding_path.ogg - Jason Lavallée, dual-licensed: GPL version 2 or later and CC-BY-SA * chipdisko.ogg - Mortimer's Chipdisko by Lukas Nystrand as Mortimer Twang - explicit permission granted to release unter GPL and CC-by-sa. -* clavelian_march.ogg +* clavelian_march.ogg by Treskalle * credits.ogg * darkforestkeep.ogg * forest-cave.ogg - Jason Lavallée, dual-licensed: GPL version 2 or later and CC-BY-SA @@ -49,20 +50,22 @@ All files in data/music created by wansti and licensed under GPLv2+CC-by-sa, unl * forest_theme.ogg - Forest Prophecy reEducated, by Wansti and Tobias "ToBeFree" Frei (GPLv2+CC-by-sa) * forest-sprint.ogg - Jason Lavallée, dual-licensed: GPL version 2 or later and CC-BY-SA * fortress.ogg +* fortress_old.ogg * ghostforest_map.ogg - Jason Lavallée, dual-licensed: GPL version 2 or later and CC-BY-SA * ghostforest.ogg * ghostforest2.ogg -* greatgigantic.ogg - Based on a work by Chris Huelsbeck - We have his permission to release this under GPL. +* greatgigantic.ogg - by Wansti based on a work by Chris Huelsbeck - We have his permission to release this under GPL. * shallow-green.ogg - Jason Lavallée, dual-licensed: GPL version 2 or later and CC-BY-SA * halloween_1.ogg - By Forty-Two - licensed under CC-BY-SA 4.0 * ice_music.ogg - By ZhayTee * intro.ogg * invincible.ogg * arctic_breeze.ogg - Jason Lavallée, dual-licensed: GPL version 2 or later and CC-BY-SA -* jewels.ogg - By cynicmusic/congusbongus - - CC-BY 3.0/CC-BY-SA 3.0/GPL 3.0 +* jewels.ogg - By Alex \"cynicmusic\" Smith edited by congusbongus - - CC-BY 3.0/CC-BY-SA 3.0/GPL 3.0 * leveldone.ogg +* march_of_the_malevolent.ogg - Servalot, Wansti (original forest/'ghost' forest theme), licensed CC-BY-SA 4.0 * new_forest_map.ogg - Jason Lavallée, dual-licensed: GPL version 2 or later and CC-BY-SA -* salcon.ogg - Salsa Con Carne by Mystical - Replaced due to licensing issues (some non-free samples are used) +* salcon.ogg - Salsa Con Carne by DJ Gentoo based on work by Asbjorn \"Mystical\" Andersen - Replaced due to licensing issues (some non-free samples are used) by a work-in-progress remix in trunk and the 0.3.x branch (r4585), for which we have permission to release under GPL and CC-by-sa. - wansti * saharan_penguin.ogg - by Enol "Meji" Monte, licensed CC BY-SA * theme.ogg diff --git a/data/credits.stxt b/data/credits.stxt index 5d64d1b9a33..a1903b43633 100644 --- a/data/credits.stxt +++ b/data/credits.stxt @@ -343,7 +343,7 @@ ) (text (type "normal") - (string "Bart K.") + (string "Bart Kelsey") ) (text (type "normal") @@ -355,7 +355,7 @@ ) (text (type "normal") - (string "Chris Leutwyler") + (string "Chris \"Krobonil\" Leutwyler") ) (text (type "normal") @@ -365,6 +365,30 @@ (type "normal") (string "Tobias \"ToBeFree\" Frei") ) + (text + (type "normal") + (string "Alex \"cynicmusic\" Smith") + ) + (text + (type "normal") + (string "congusbongus") + ) + (text + (type "normal") + (string "Enol \"Meji\" Monte") + ) + (text + (type "normal") + (string "Flan") + ) + (text + (type "normal") + (string "Alasdair \"Servalot\"") + ) + (text + (type "normal") + (string "ZhayTee") + ) (blank) (blank) (text diff --git a/data/music/antarctic/airship_remix-2.music b/data/music/antarctic/airship_remix-2.music index 92246ccca97..cb6105bcca4 100644 --- a/data/music/antarctic/airship_remix-2.music +++ b/data/music/antarctic/airship_remix-2.music @@ -1,5 +1,8 @@ (supertux-music (file "airship_2.ogg") + (title "Airship 2") + (author "Jason Lavallée") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at 202) ) diff --git a/data/music/antarctic/airship_remix.music b/data/music/antarctic/airship_remix.music index 65fc926d7b5..44363c74a21 100644 --- a/data/music/antarctic/airship_remix.music +++ b/data/music/antarctic/airship_remix.music @@ -1,5 +1,8 @@ (supertux-music (file "airship_remix.ogg") + (title "Airship Song Orchestral Mix") + (author "Bart Kelsey") + (license "CC-BY-SA 3.0 / GPL 3.0 / GPL 2.0") (loop-begin 4) (loop-at 58) ) diff --git a/data/music/antarctic/arctic_breeze.music b/data/music/antarctic/arctic_breeze.music index 870a1eac9d8..53010f4806f 100644 --- a/data/music/antarctic/arctic_breeze.music +++ b/data/music/antarctic/arctic_breeze.music @@ -1,5 +1,8 @@ (supertux-music (file "arctic_breeze.ogg") + (title "Antarctic Breeze") + (author "Jason Lavallée") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at 197) ) \ No newline at end of file diff --git a/data/music/antarctic/arctic_cave.music b/data/music/antarctic/arctic_cave.music index 6cd8706def1..7d3181fc819 100644 --- a/data/music/antarctic/arctic_cave.music +++ b/data/music/antarctic/arctic_cave.music @@ -1,5 +1,8 @@ (supertux-music (file "arctic_cave.ogg") + (title "Eyes in the Deep") + (author "Jason Lavallée") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at 267) ) diff --git a/data/music/antarctic/bossattack.music b/data/music/antarctic/bossattack.music index 31c98c3b897..387e7340938 100644 --- a/data/music/antarctic/bossattack.music +++ b/data/music/antarctic/bossattack.music @@ -1,5 +1,8 @@ (supertux-music (file "bossattack.ogg") + (title "Boss Attack") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") (loop-begin 0.5) (loop-at -1) ) diff --git a/data/music/antarctic/cave.music b/data/music/antarctic/cave.music index 343374d7731..59a85bdcac8 100644 --- a/data/music/antarctic/cave.music +++ b/data/music/antarctic/cave.music @@ -1,5 +1,8 @@ (supertux-music (file "cave.ogg") + (title "The Cave (Milestone 2 Version)") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at -1) ) diff --git a/data/music/antarctic/chipdisko.music b/data/music/antarctic/chipdisko.music index af56b72bd6c..db8874ae549 100644 --- a/data/music/antarctic/chipdisko.music +++ b/data/music/antarctic/chipdisko.music @@ -1,5 +1,8 @@ (supertux-music (file "chipdisko.ogg") + (title "Mortimer's Chipdisko") + (author "Lukas Nystrand (as Mortimer Twang)") + (license "CC-BY-SA / GPL") (loop-begin 0) (loop-at 158) ) diff --git a/data/music/antarctic/jewels.music b/data/music/antarctic/jewels.music index ed2342e1489..9f261a17042 100644 --- a/data/music/antarctic/jewels.music +++ b/data/music/antarctic/jewels.music @@ -1,5 +1,8 @@ (supertux-music (file "jewels.ogg") + (author "Alex \"cynicmusic\" Smith edited by congusbongus") + (title "Crystal Cave + Mysterious Ambience (seamless loop)") + (license "CC-BY 3.0 / CC-BY-SA 3.0 / GPL 3.0") (loop-begin 0) (loop-at -1) ) diff --git a/data/music/antarctic/salcon.music b/data/music/antarctic/salcon.music index 06d4adb4fbd..cd09a8b5120 100644 --- a/data/music/antarctic/salcon.music +++ b/data/music/antarctic/salcon.music @@ -1,5 +1,8 @@ (supertux-music (file "salcon.ogg") + (author "DJ Gentoo based on work by Asbjorn \"Mystical\" Andersen") + (title "Salsa Con Carne (remix)") + (license "CC-BY-SA / GPL") (loop-begin 0) (loop-at 56) ) \ No newline at end of file diff --git a/data/music/antarctic/voc-boss.music b/data/music/antarctic/voc-boss.music index c10981308ba..46c54be6cdd 100644 --- a/data/music/antarctic/voc-boss.music +++ b/data/music/antarctic/voc-boss.music @@ -1,5 +1,7 @@ (supertux-music (file "voc-boss.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at -1) ) diff --git a/data/music/antarctic/voc-dark.music b/data/music/antarctic/voc-dark.music index 6939f43b32d..f13521c03e1 100644 --- a/data/music/antarctic/voc-dark.music +++ b/data/music/antarctic/voc-dark.music @@ -1,5 +1,7 @@ (supertux-music (file "voc-dark.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at -1) ) diff --git a/data/music/antarctic/voc-daytime.music b/data/music/antarctic/voc-daytime.music index 60110cd742f..fd87ccaa8b8 100644 --- a/data/music/antarctic/voc-daytime.music +++ b/data/music/antarctic/voc-daytime.music @@ -1,5 +1,7 @@ (supertux-music (file "voc-daytime.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at -1) ) diff --git a/data/music/antarctic/voc-daytime2.music b/data/music/antarctic/voc-daytime2.music index 7567c1405fd..29673d95171 100644 --- a/data/music/antarctic/voc-daytime2.music +++ b/data/music/antarctic/voc-daytime2.music @@ -1,5 +1,7 @@ (supertux-music (file "voc-daytime2.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at -1) ) diff --git a/data/music/antarctic/voc-night.music b/data/music/antarctic/voc-night.music index b065c811431..0c7d1202b9a 100644 --- a/data/music/antarctic/voc-night.music +++ b/data/music/antarctic/voc-night.music @@ -1,5 +1,7 @@ (supertux-music (file "voc-night.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") (loop-begin 4.648) (loop-at 73.231) ) diff --git a/data/music/castle/darkforestkeep.music b/data/music/castle/darkforestkeep.music index d93fae2398d..99be23277d7 100644 --- a/data/music/castle/darkforestkeep.music +++ b/data/music/castle/darkforestkeep.music @@ -1,5 +1,8 @@ (supertux-music (file "darkforestkeep.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "Dark Forest Keep") (loop-begin 0) (loop-at 199) ) diff --git a/data/music/castle/fortress.music b/data/music/castle/fortress.music index b7fbc9e3e6e..0b18373b934 100644 --- a/data/music/castle/fortress.music +++ b/data/music/castle/fortress.music @@ -1,5 +1,8 @@ (supertux-music (file "fortress.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "The Fortress (Milestone 2 Version)") (loop-begin 11.37) (loop-at -1) ) diff --git a/data/music/forest/beneath_the_rabbit_hole.music b/data/music/forest/beneath_the_rabbit_hole.music index 8f19b5f9096..de211192f0a 100644 --- a/data/music/forest/beneath_the_rabbit_hole.music +++ b/data/music/forest/beneath_the_rabbit_hole.music @@ -1,5 +1,8 @@ (supertux-music (file "beneath_the_rabbit_hole.ogg") + (author "Jason Lavallée") + (license "CC-BY-SA / GPL 2+") + (title "Beneath the Rabbit Holes") (loop-begin 0) (loop-at 178) ) diff --git a/data/music/forest/bright_thunders.music b/data/music/forest/bright_thunders.music index e14a7768dce..fa0bc737679 100644 --- a/data/music/forest/bright_thunders.music +++ b/data/music/forest/bright_thunders.music @@ -1,5 +1,7 @@ (supertux-music (file "bright_thunders.ogg") + (author "Chris \"Krobonil\" Leutwyler") + (license "CC-BY-SA") (loop-begin 0) (loop-at -1) ) diff --git a/data/music/forest/call_of_the_winding_path.music b/data/music/forest/call_of_the_winding_path.music index 7cffe5aea13..c5aa1df7eab 100644 --- a/data/music/forest/call_of_the_winding_path.music +++ b/data/music/forest/call_of_the_winding_path.music @@ -1,5 +1,7 @@ (supertux-music (file "call_of_the_winding_path.ogg") + (author "Jason Lavallée") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at 394) ) diff --git a/data/music/forest/clavelian_march.music b/data/music/forest/clavelian_march.music index d31bcffc976..4bf995c56f0 100644 --- a/data/music/forest/clavelian_march.music +++ b/data/music/forest/clavelian_march.music @@ -1,5 +1,7 @@ (supertux-music (file "clavelian_march.ogg") + (author "Treskalle") + (title "Clavelian March") (loop-begin 0.5) (loop-at -1) ) diff --git a/data/music/forest/forest-cave.music b/data/music/forest/forest-cave.music index 5ff3074f8f9..a575556ed63 100644 --- a/data/music/forest/forest-cave.music +++ b/data/music/forest/forest-cave.music @@ -1,5 +1,7 @@ (supertux-music (file "forest-cave.ogg") + (author "Jason Lavallée") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at 149) ) \ No newline at end of file diff --git a/data/music/forest/forest-sprint.music b/data/music/forest/forest-sprint.music index 8d2536ecbb6..c23c4b49418 100644 --- a/data/music/forest/forest-sprint.music +++ b/data/music/forest/forest-sprint.music @@ -1,5 +1,7 @@ (supertux-music (file "forest-sprint.ogg") + (author "Jason Lavallée") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at 207) ) \ No newline at end of file diff --git a/data/music/forest/forest.music b/data/music/forest/forest.music index a5503a1bfe6..be17cd3a7e1 100644 --- a/data/music/forest/forest.music +++ b/data/music/forest/forest.music @@ -1,5 +1,8 @@ (supertux-music (file "forest.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "Forest Dance") (loop-begin 54.818) (loop-at 95.955) ) diff --git a/data/music/forest/forest2.music b/data/music/forest/forest2.music index 206ae9e1234..a61916b5d2d 100644 --- a/data/music/forest/forest2.music +++ b/data/music/forest/forest2.music @@ -1,5 +1,8 @@ (supertux-music (file "forest2.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "Rabbit Holes") (loop-begin 0) (loop-at 143) ) \ No newline at end of file diff --git a/data/music/forest/forest3.music b/data/music/forest/forest3.music index cae89201777..34861db34f4 100644 --- a/data/music/forest/forest3.music +++ b/data/music/forest/forest3.music @@ -1,5 +1,8 @@ (supertux-music (file "forest3.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "Riding The Wind") (loop-begin 0) (loop-at 99) ) \ No newline at end of file diff --git a/data/music/forest/forest_theme.music b/data/music/forest/forest_theme.music index 1431a78002c..f51aab89f11 100644 --- a/data/music/forest/forest_theme.music +++ b/data/music/forest/forest_theme.music @@ -1,5 +1,8 @@ (supertux-music (file "forest_theme.ogg") + (author "Marek \"Wansti\" Moeckel and Tobias \"ToBeFree\" Frei") + (license "CC-BY-SA / GPL 2+") + (title "Forest Prophecy reEducated") (loop-begin 0) (loop-at -1) ) diff --git a/data/music/forest/ghostforest.music b/data/music/forest/ghostforest.music index 2bd02201995..60912bc0b84 100644 --- a/data/music/forest/ghostforest.music +++ b/data/music/forest/ghostforest.music @@ -1,5 +1,8 @@ (supertux-music (file "ghostforest.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "Ghost Forest") (loop-begin 0) (loop-at -1) ) diff --git a/data/music/forest/ghostforest2.music b/data/music/forest/ghostforest2.music index 05e2ea58add..481b3231c88 100644 --- a/data/music/forest/ghostforest2.music +++ b/data/music/forest/ghostforest2.music @@ -1,5 +1,8 @@ (supertux-music (file "ghostforest2.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "Ghost Forest 2") (loop-begin 0) (loop-at 91) ) diff --git a/data/music/forest/ghostforest_map.music b/data/music/forest/ghostforest_map.music index 25b52953474..aeb36254223 100644 --- a/data/music/forest/ghostforest_map.music +++ b/data/music/forest/ghostforest_map.music @@ -1,5 +1,7 @@ (supertux-music (file "ghostforest_map.ogg") + (author "Jason Lavallée") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at 236) ) \ No newline at end of file diff --git a/data/music/forest/greatgigantic.music b/data/music/forest/greatgigantic.music index 63dec8b0043..aeac40b526b 100644 --- a/data/music/forest/greatgigantic.music +++ b/data/music/forest/greatgigantic.music @@ -1,5 +1,8 @@ (supertux-music (file "greatgigantic.ogg") + (author "Marek \"Wansti\" Moeckel based on \"Giana Sisters Title Theme\" by Chris Huelsbeck") + (license "GPL") + (title "The Great Gigantic Secret (with kind permission from Chris Huelsbeck)") (loop-begin 0) (loop-at -1) ) diff --git a/data/music/forest/march_of_the_malevolent.music b/data/music/forest/march_of_the_malevolent.music index cd63e90034c..281fd541cee 100644 --- a/data/music/forest/march_of_the_malevolent.music +++ b/data/music/forest/march_of_the_malevolent.music @@ -1,5 +1,8 @@ (supertux-music (file "march_of_the_malevolent.ogg") + (author "Servalot, Marek \"Wansti\" Moeckel (original forest/'ghost' forest theme)") + (license "CC-BY-SA 4.0") + (title "March of the Malevolent") (loop-begin 0) (loop-at 109.09) ) diff --git a/data/music/forest/new_forest_map.music b/data/music/forest/new_forest_map.music index e2b33054aa2..b3dfda35683 100644 --- a/data/music/forest/new_forest_map.music +++ b/data/music/forest/new_forest_map.music @@ -1,5 +1,7 @@ (supertux-music (file "new_forest_map.ogg") + (author "Jason Lavallée") + (license "CC-BY-SA / GPL 2+") (loop-begin 0) (loop-at 105) ) diff --git a/data/music/forest/shallow-green.music b/data/music/forest/shallow-green.music index e18c84346b1..0955f00b032 100644 --- a/data/music/forest/shallow-green.music +++ b/data/music/forest/shallow-green.music @@ -1,5 +1,8 @@ (supertux-music (file "shallow-green.ogg") + (author "Jason Lavallée") + (license "CC-BY-SA / GPL 2+") + (title "Forest Stroll") (loop-begin 0) (loop-at 255) ) diff --git a/data/music/forest/treeboss.music b/data/music/forest/treeboss.music index a54cef0861e..f54678a6e1d 100644 --- a/data/music/forest/treeboss.music +++ b/data/music/forest/treeboss.music @@ -1,5 +1,7 @@ (supertux-music (file "treeboss.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") (loop-begin 32.15) (loop-at -1) ) diff --git a/data/music/forest/wisphunt.music b/data/music/forest/wisphunt.music index 70719bdea1b..ef6e009ab64 100644 --- a/data/music/forest/wisphunt.music +++ b/data/music/forest/wisphunt.music @@ -1,5 +1,7 @@ (supertux-music (file "wisphunt.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") (loop-begin 21.08) (loop-at -1) ) diff --git a/data/music/misc/battle_theme.music b/data/music/misc/battle_theme.music index 5c43b1ef269..b56e393b5bb 100644 --- a/data/music/misc/battle_theme.music +++ b/data/music/misc/battle_theme.music @@ -1,5 +1,8 @@ (supertux-music (file "battle_theme.ogg") + (author "remaxim") + (license "CC-BY-SA 3.0 / GPL 2+") + (title "Battle Theme") (loop-begin 30) (loop-at 200) ) diff --git a/data/music/misc/bonuscave.music b/data/music/misc/bonuscave.music index 456fc199678..e1a07fe37e5 100644 --- a/data/music/misc/bonuscave.music +++ b/data/music/misc/bonuscave.music @@ -1,5 +1,8 @@ (supertux-music (file "bonuscave.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "Bonus Cave") (loop-begin 0) (loop-at 10) ) diff --git a/data/music/misc/credits.music b/data/music/misc/credits.music index b5da39b9508..6ddd1c5ae80 100644 --- a/data/music/misc/credits.music +++ b/data/music/misc/credits.music @@ -1,5 +1,8 @@ (supertux-music (file "credits.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "SuperTux Credits Theme") (loop-begin 0) (loop-at 107) ) diff --git a/data/music/misc/halloween_1.music b/data/music/misc/halloween_1.music index 97a033bcfbb..57900fb4612 100644 --- a/data/music/misc/halloween_1.music +++ b/data/music/misc/halloween_1.music @@ -1,5 +1,7 @@ (supertux-music (file "halloween_1.ogg") + (author "Forty-Two") + (license "CC-BY-SA 4.0") (loop-begin 37.60) (loop-at 124.95) ) diff --git a/data/music/misc/intro.music b/data/music/misc/intro.music index da774dbaeb2..8e2cc51e18a 100644 --- a/data/music/misc/intro.music +++ b/data/music/misc/intro.music @@ -1,5 +1,8 @@ (supertux-music (file "intro.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "Intro Theme") (loop-begin 0) (loop-at 34) ) diff --git a/data/music/misc/theme.music b/data/music/misc/theme.music index 36335bd0747..59e859024d9 100644 --- a/data/music/misc/theme.music +++ b/data/music/misc/theme.music @@ -1,5 +1,8 @@ (supertux-music (file "theme.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "SuperTux Theme (Milestone 2 Version)") (loop-begin 9) (loop-at 135) ) diff --git a/data/music/retro/cave_old.music b/data/music/retro/cave_old.music index d1eab70114e..d3957596724 100644 --- a/data/music/retro/cave_old.music +++ b/data/music/retro/cave_old.music @@ -1,5 +1,8 @@ (supertux-music (file "cave_old.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "Super Tux - The Cave") (loop-begin 0) (loop-at 77) ) diff --git a/data/music/retro/classic.music b/data/music/retro/classic.music index c4f62a06c77..4b085919e66 100644 --- a/data/music/retro/classic.music +++ b/data/music/retro/classic.music @@ -1,5 +1,6 @@ (supertux-music (file "classic.ogg") + (title "SuperTux 0.0.4 music") (loop-begin 0) (loop-at 97) ) diff --git a/data/music/retro/fortress_old.music b/data/music/retro/fortress_old.music index 1eaa3cfb4aa..5f713187ae1 100644 --- a/data/music/retro/fortress_old.music +++ b/data/music/retro/fortress_old.music @@ -1,5 +1,8 @@ (supertux-music (file "fortress_old.ogg") + (author "Marek \"Wansti\" Moeckel") + (license "CC-BY-SA / GPL 2+") + (title "Super Tux - Fortress") (loop-begin 0) (loop-at 46) ) diff --git a/data/music/retro/ice_music.music b/data/music/retro/ice_music.music index 9674125e0f8..dc1f6df95cf 100644 --- a/data/music/retro/ice_music.music +++ b/data/music/retro/ice_music.music @@ -1,5 +1,7 @@ (supertux-music (file "ice_music.ogg") + (author "ZhayTee") + (title "supertux ice level") (loop-begin 0) (loop-at 137) ) diff --git a/data/music/retro/worldmap_old.music b/data/music/retro/worldmap_old.music index 783038e679a..600fec8b46b 100644 --- a/data/music/retro/worldmap_old.music +++ b/data/music/retro/worldmap_old.music @@ -1,5 +1,7 @@ (supertux-music (file "worldmap_old.ogg") + (author "ZhayTee") + (title "supertux title") (loop-begin 0) (loop-at 40) ) diff --git a/data/music/tropical/saharan_penguin.music b/data/music/tropical/saharan_penguin.music index dd61680eb9f..3f90c93cb20 100644 --- a/data/music/tropical/saharan_penguin.music +++ b/data/music/tropical/saharan_penguin.music @@ -1,5 +1,7 @@ (supertux-music (file "saharan_penguin.ogg") + (author "Enol \"Meji\" Monte") + (license "CC-BY-SA") (loop-begin 0) (loop-at 96) ) diff --git a/data/music/tropical/tropicalbreeze.music b/data/music/tropical/tropicalbreeze.music index a6fa849ade8..3032c917f44 100644 --- a/data/music/tropical/tropicalbreeze.music +++ b/data/music/tropical/tropicalbreeze.music @@ -1,5 +1,8 @@ (supertux-music (file "tropicalbreeze.ogg") + (author "Flan") + (license "CC-BY-SA 4.0") + (title "Tropical Breeze") (loop-begin 0) (loop-at 73) ) diff --git a/src/audio/sound_file.cpp b/src/audio/sound_file.cpp index cf98711cca3..f077a68eada 100644 --- a/src/audio/sound_file.cpp +++ b/src/audio/sound_file.cpp @@ -62,10 +62,16 @@ std::unique_ptr load_music_file(const std::string& filename_original) auto music = root.get_mapping(); std::string raw_music_file; + std::string author; + std::string license; + std::string title; float loop_begin = 0; float loop_at = -1; music.get("file", raw_music_file); + music.get("author", author); + music.get("license", license); + music.get("title", title); music.get("loop-begin", loop_begin); music.get("loop-at", loop_at); @@ -83,14 +89,20 @@ std::unique_ptr load_music_file(const std::string& filename_original) throw SoundError(msg.str()); } auto format = SoundFile::get_file_format(file, raw_music_file); - if (format == SoundFile::FORMAT_WAV) - { - return std::make_unique(file); - } - else - { - return std::make_unique(file, loop_begin, loop_at); + + std::unique_ptr sound_file; + + if (format == SoundFile::FORMAT_WAV) { + sound_file = std::make_unique(file); + } else { + sound_file = std::make_unique(file, loop_begin, loop_at); } + + sound_file->m_author = author; + sound_file->m_license = license; + sound_file->m_title = title; + + return sound_file; } } @@ -156,6 +168,7 @@ SoundFile::get_file_format(PHYSFS_File* file, const std::string& filename) namespace { // List obtained with the help of sed: +// cd data/music // find | sort | sed 's:^\.:/music:; /\./ !d; s:\(.*/\)\([^/]*$\):{"\2", "\1\2"},:g' std::unordered_map fallback_paths = { {"airship_2.ogg", "/music/antarctic/airship_2.ogg"}, @@ -194,6 +207,8 @@ std::unordered_map fallback_paths = { {"beneath_the_rabbit_hole.ogg", "/music/forest/beneath_the_rabbit_hole.ogg"}, {"bright_thunders.music", "/music/forest/bright_thunders.music"}, {"bright_thunders.ogg", "/music/forest/bright_thunders.ogg"}, + {"call_of_the_winding_path.music", "/music/forest/call_of_the_winding_path.music"}, + {"call_of_the_winding_path.ogg", "/music/forest/call_of_the_winding_path.ogg"}, {"clavelian_march.music", "/music/forest/clavelian_march.music"}, {"clavelian_march.ogg", "/music/forest/clavelian_march.ogg"}, {"forest2.music", "/music/forest/forest2.music"}, @@ -202,8 +217,6 @@ std::unordered_map fallback_paths = { {"forest3.ogg", "/music/forest/forest3.ogg"}, {"forest-cave.music", "/music/forest/forest-cave.music"}, {"forest-cave.ogg", "/music/forest/forest-cave.ogg"}, - {"forest-map.music", "/music/forest/forest-map.music"}, - {"forestmap.ogg", "/music/forest/forestmap.ogg"}, {"forest.music", "/music/forest/forest.music"}, {"forest.ogg", "/music/forest/forest.ogg"}, {"forest-sprint.music", "/music/forest/forest-sprint.music"}, @@ -218,6 +231,8 @@ std::unordered_map fallback_paths = { {"ghostforest.ogg", "/music/forest/ghostforest.ogg"}, {"greatgigantic.music", "/music/forest/greatgigantic.music"}, {"greatgigantic.ogg", "/music/forest/greatgigantic.ogg"}, + {"march_of_the_malevolent.music", "/music/forest/march_of_the_malevolent.music"}, + {"march_of_the_malevolent.ogg", "/music/forest/march_of_the_malevolent.ogg"}, {"new_forest_map.music", "/music/forest/new_forest_map.music"}, {"new_forest_map.ogg", "/music/forest/new_forest_map.ogg"}, {"shallow-green.music", "/music/forest/shallow-green.music"}, @@ -242,6 +257,20 @@ std::unordered_map fallback_paths = { {"leveldone.ogg", "/music/misc/leveldone.ogg"}, {"theme.music", "/music/misc/theme.music"}, {"theme.ogg", "/music/misc/theme.ogg"}, + {"cave_old.music", "/music/retro/cave_old.music"}, + {"cave_old.ogg", "/music/retro/cave_old.ogg"}, + {"classic.music", "/music/retro/classic.music"}, + {"classic.ogg", "/music/retro/classic.ogg"}, + {"fortress_old.music", "/music/retro/fortress_old.music"}, + {"fortress_old.ogg", "/music/retro/fortress_old.ogg"}, + {"ice_music.music", "/music/retro/ice_music.music"}, + {"ice_music.ogg", "/music/retro/ice_music.ogg"}, + {"worldmap_old.music", "/music/retro/worldmap_old.music"}, + {"worldmap_old.ogg", "/music/retro/worldmap_old.ogg"}, + {"saharan_penguin.music", "/music/tropical/saharan_penguin.music"}, + {"saharan_penguin.ogg", "/music/tropical/saharan_penguin.ogg"}, + {"tropicalbreeze.music", "/music/tropical/tropicalbreeze.music"}, + {"tropicalbreeze.ogg", "/music/tropical/tropicalbreeze.ogg"}, }; const std::string& get_fallback_path(const std::string& file_path) diff --git a/src/audio/sound_file.hpp b/src/audio/sound_file.hpp index 1dffb6fb04d..ba4c145d45c 100644 --- a/src/audio/sound_file.hpp +++ b/src/audio/sound_file.hpp @@ -38,7 +38,10 @@ class SoundFile m_channels(), m_rate(), m_bits_per_sample(), - m_size() + m_size(), + m_author(), + m_license(), + m_title() {} virtual ~SoundFile() {} @@ -52,6 +55,9 @@ class SoundFile int m_bits_per_sample; /// size in bytes size_t m_size; + std::string m_author; + std::string m_license; + std::string m_title; private: SoundFile(const SoundFile&) = delete; diff --git a/src/editor/object_option.cpp b/src/editor/object_option.cpp index 28e360df0c3..d72dc50767c 100644 --- a/src/editor/object_option.cpp +++ b/src/editor/object_option.cpp @@ -406,12 +406,14 @@ FileObjectOption::FileObjectOption(const std::string& text, std::string* pointer std::vector filter, const std::string& basedir, bool path_relative_to_basedir, - unsigned int flags) : + unsigned int flags, + std::function generate_help_text_for_file) : ObjectOption(text, key, flags, pointer), m_default_value(std::move(default_value)), m_filter(std::move(filter)), m_basedir(basedir), - m_path_relative_to_basedir(path_relative_to_basedir) + m_path_relative_to_basedir(path_relative_to_basedir), + m_generate_help_text_for_file(generate_help_text_for_file) { } @@ -440,7 +442,7 @@ FileObjectOption::to_string() const void FileObjectOption::add_to_menu(Menu& menu) const { - menu.add_file(get_text(), m_value_pointer, m_filter, m_basedir, m_path_relative_to_basedir); + menu.add_file(get_text(), m_value_pointer, m_filter, m_basedir, m_path_relative_to_basedir, -1, m_generate_help_text_for_file); } ColorObjectOption::ColorObjectOption(const std::string& text, Color* pointer, const std::string& key, diff --git a/src/editor/object_option.hpp b/src/editor/object_option.hpp index b481f78350f..3c83c5ff153 100644 --- a/src/editor/object_option.hpp +++ b/src/editor/object_option.hpp @@ -286,7 +286,8 @@ class FileObjectOption final : public ObjectOption std::vector filter, const std::string& basedir, bool path_relative_to_basedir, - unsigned int flags); + unsigned int flags, + std::function generate_help_text_for_file = nullptr); virtual void save(Writer& write) const override; virtual std::string to_string() const override; @@ -297,6 +298,7 @@ class FileObjectOption final : public ObjectOption const std::vector m_filter; std::string m_basedir; bool m_path_relative_to_basedir; + std::function m_generate_help_text_for_file; private: FileObjectOption(const FileObjectOption&) = delete; diff --git a/src/editor/object_settings.cpp b/src/editor/object_settings.cpp index 24b7fa19a1d..067ff7629e4 100644 --- a/src/editor/object_settings.cpp +++ b/src/editor/object_settings.cpp @@ -19,6 +19,8 @@ #include #include +#include "audio/sound_file.hpp" +#include "util/file_system.hpp" #include "util/gettext.hpp" #include "video/color.hpp" @@ -218,9 +220,10 @@ ObjectSettings::add_file(const std::string& text, std::string* value_ptr, const std::vector& filter, const std::string& basedir, bool path_relative_to_basedir, - unsigned int flags) + unsigned int flags, + std::function generate_help_text_for_file) { - add_option(std::make_unique(text, value_ptr, default_value, key, filter, basedir, path_relative_to_basedir, flags)); + add_option(std::make_unique(text, value_ptr, default_value, key, filter, basedir, path_relative_to_basedir, flags, generate_help_text_for_file)); } void @@ -293,7 +296,35 @@ ObjectSettings::add_music(const std::string& text, std::string* value_ptr, std::optional default_value, unsigned int flags) { - add_file(text, value_ptr, key, std::move(default_value), {".music"}, {"/music"}, false, flags); + auto generate_help_text_for_file = [](std::string path) -> std::string + { + std::string filename = FileSystem::basename(path); + std::unique_ptr sound_file; + try { + sound_file = load_sound_file(path); + } catch (...) { + return ""; + } + + std::string& author = sound_file->m_author; + std::string& license = sound_file->m_license; + std::string& title = sound_file->m_title; + + bool hasMusicMetadata = !title.empty() || !author.empty() || !license.empty(); + if (!hasMusicMetadata) { + return ""; + } + + std::string title_or_filename = title.empty() ? filename : "\"" + title + "\""; // assumes path is just a filename + + std::string help_text = + title_or_filename + (author.empty() ? "" : "\n by " + author) + + (license.empty() ? "" : "\nLicense: " + license); + + return help_text; + }; + + add_file(text, value_ptr, key, std::move(default_value), {".music"}, {"/music"}, false, flags, generate_help_text_for_file); } void diff --git a/src/editor/object_settings.hpp b/src/editor/object_settings.hpp index 3742daa9a4b..86fc2865e15 100644 --- a/src/editor/object_settings.hpp +++ b/src/editor/object_settings.hpp @@ -143,7 +143,8 @@ class ObjectSettings final const std::vector& filter = {}, const std::string& basedir = {}, bool path_relative_to_basedir = true, - unsigned int flags = 0); + unsigned int flags = 0, + std::function generate_help_text_for_file = nullptr); void add_sexp(const std::string& text, const std::string& key, sexp::Value& value, unsigned int flags = 0); void add_string_array(const std::string& text, const std::string& key, std::vector& items); diff --git a/src/gui/item_file.cpp b/src/gui/item_file.cpp index c6c4a0ea26d..f7a752e0953 100644 --- a/src/gui/item_file.cpp +++ b/src/gui/item_file.cpp @@ -24,12 +24,14 @@ ItemFile::ItemFile(const std::string& text, std::string* filename, const std::vector& extensions, const std::string& basedir, bool path_relative_to_basedir, - int id) : + int id, + std::function generate_help_text_for_file) : MenuItem(text, id), m_filename(filename), m_extensions(extensions), m_basedir(basedir), - m_path_relative_to_basedir(path_relative_to_basedir) + m_path_relative_to_basedir(path_relative_to_basedir), + m_generate_help_text_for_file(generate_help_text_for_file) { } @@ -37,7 +39,7 @@ void ItemFile::process_action(const MenuAction& action) { if (action == MenuAction::HIT) { - MenuManager::instance().push_menu(std::make_unique(m_filename, m_extensions, m_basedir, m_path_relative_to_basedir)); + MenuManager::instance().push_menu(std::make_unique(m_filename, m_extensions, m_basedir, m_path_relative_to_basedir, nullptr, m_generate_help_text_for_file)); } } diff --git a/src/gui/item_file.hpp b/src/gui/item_file.hpp index eecfb6d4723..fed25048799 100644 --- a/src/gui/item_file.hpp +++ b/src/gui/item_file.hpp @@ -26,7 +26,8 @@ class ItemFile final : public MenuItem const std::vector& extensions, const std::string& basedir, bool path_relative_to_basedir, - int id = -1); + int id = -1, + std::function generate_help_text_for_file = nullptr); /** Processes the menu action. */ virtual void process_action(const MenuAction& action) override; @@ -36,6 +37,7 @@ class ItemFile final : public MenuItem std::vector m_extensions; std::string m_basedir; bool m_path_relative_to_basedir; + std::function m_generate_help_text_for_file; private: ItemFile(const ItemFile&) = delete; diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp index 347b9413b53..9954e62cdb2 100644 --- a/src/gui/menu.cpp +++ b/src/gui/menu.cpp @@ -16,6 +16,7 @@ #include "gui/menu.hpp" +#include "audio/sound_file.hpp" #include "control/input_manager.hpp" #include "gui/item_action.hpp" #include "gui/item_back.hpp" @@ -47,6 +48,7 @@ #include "supertux/gameconfig.hpp" #include "supertux/globals.hpp" #include "supertux/resources.hpp" +#include "util/file_system.hpp" #include "video/drawing_context.hpp" #include "video/renderer.hpp" #include "video/video_system.hpp" @@ -283,9 +285,10 @@ Menu::add_string_select(int id, const std::string& text, int default_item, const ItemFile& Menu::add_file(const std::string& text, std::string* input, const std::vector& extensions, - const std::string& basedir, bool path_relative_to_basedir, int id) + const std::string& basedir, bool path_relative_to_basedir, int id, + const std::function generate_help_text_for_file) { - auto item = std::make_unique(text, input, extensions, basedir, path_relative_to_basedir, id); + auto item = std::make_unique(text, input, extensions, basedir, path_relative_to_basedir, id, generate_help_text_for_file); auto item_ptr = item.get(); add_item(std::move(item)); return *item_ptr; diff --git a/src/gui/menu.hpp b/src/gui/menu.hpp index 0f55350b43e..afab0ebe8ff 100644 --- a/src/gui/menu.hpp +++ b/src/gui/menu.hpp @@ -97,7 +97,8 @@ class Menu ItemIntField& add_intfield(const std::string& text, int* input, int id = -1, bool positive = false); ItemFloatField& add_floatfield(const std::string& text, float* input, int id = -1, bool positive = false); ItemFile& add_file(const std::string& text, std::string* input, const std::vector& extensions, - const std::string& basedir, bool path_relative_to_basedir, int id = -1); + const std::string& basedir, bool path_relative_to_basedir, int id = -1, + const std::function generate_help_text_for_file = nullptr); ItemColor& add_color(const std::string& text, Color* color, int id = -1); ItemColorDisplay& add_color_display(Color* color, int id = -1); diff --git a/src/gui/menu_filesystem.cpp b/src/gui/menu_filesystem.cpp index 2fc4e864df5..7f537a4b1fb 100644 --- a/src/gui/menu_filesystem.cpp +++ b/src/gui/menu_filesystem.cpp @@ -19,6 +19,7 @@ #include #include "addon/addon_manager.hpp" +#include "gui/item_action.hpp" #include "gui/menu_item.hpp" #include "gui/menu_manager.hpp" #include "physfs/util.hpp" @@ -28,7 +29,9 @@ #include "util/string_util.hpp" FileSystemMenu::FileSystemMenu(std::string* filename, const std::vector& extensions, - const std::string& basedir, bool path_relative_to_basedir, std::function callback) : + const std::string& basedir, bool path_relative_to_basedir, + std::function callback, + std::function generate_help_text_for_file) : m_filename(filename), // when a basedir is given, 'filename' is relative to basedir, so // it's useless as a starting point @@ -38,7 +41,8 @@ FileSystemMenu::FileSystemMenu(std::string* filename, const std::vectorunmount_old_addons(); @@ -98,7 +102,13 @@ FileSystemMenu::refresh_items() for (const auto& item : m_files) { - add_entry(item_id, item); + ItemAction& entry = add_entry(item_id, item); + std::string help_text = m_generate_help_text_for_file ? m_generate_help_text_for_file(FileSystem::join(m_directory, item)) : ""; + + if (!help_text.empty()) { + entry.set_help(help_text); + } + item_id++; } diff --git a/src/gui/menu_filesystem.hpp b/src/gui/menu_filesystem.hpp index ef53e6131fb..1c5d91746cd 100644 --- a/src/gui/menu_filesystem.hpp +++ b/src/gui/menu_filesystem.hpp @@ -22,7 +22,7 @@ class FileSystemMenu final : public Menu { public: - FileSystemMenu(std::string* filename, const std::vector& extensions, const std::string& basedir, bool path_relative_to_basedir, const std::function callback = nullptr); + FileSystemMenu(std::string* filename, const std::vector& extensions, const std::string& basedir, bool path_relative_to_basedir, const std::function callback = nullptr, const std::function generate_help_text_for_file = nullptr); ~FileSystemMenu() override; void menu_action(MenuItem& item) override; @@ -40,6 +40,7 @@ class FileSystemMenu final : public Menu std::vector m_files; bool m_path_relative_to_basedir; std::function m_callback; + std::function m_generate_help_text_for_file; private: FileSystemMenu(const FileSystemMenu&) = delete;