1
0

version.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  1. /*
  2. * version.cpp
  3. * -----------
  4. * Purpose: OpenMPT version handling.
  5. * Notes : (currently none)
  6. * Authors: OpenMPT Devs
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #include "stdafx.h"
  10. #include "version.h"
  11. #include "mptString.h"
  12. #include "mptStringFormat.h"
  13. #include "mptStringParse.h"
  14. #include "versionNumber.h"
  15. #include "svn_version.h"
  16. OPENMPT_NAMESPACE_BEGIN
  17. #define MPT_MAKE_VERSION_NUMERIC_HELPER(prefix,v0,v1,v2,v3) Version( prefix ## v0 , prefix ## v1 , prefix ## v2 , prefix ## v3 )
  18. #define MPT_MAKE_VERSION_NUMERIC(v0,v1,v2,v3) MPT_MAKE_VERSION_NUMERIC_HELPER(0x, v0, v1, v2, v3)
  19. #define MPT_VERSION_CURRENT MPT_MAKE_VERSION_NUMERIC(VER_MAJORMAJOR,VER_MAJOR,VER_MINOR,VER_MINORMINOR)
  20. static_assert((MPT_VERSION_CURRENT.GetRawVersion() & 0xffffu) != 0x0000u, "Version numbers ending in .00.00 shall never exist again, as they make interpreting the version number ambiguous for file formats which can only store the two major parts of the version number (e.g. IT and S3M).");
  21. Version Version::Current() noexcept
  22. {
  23. return MPT_VERSION_CURRENT;
  24. }
  25. mpt::ustring Version::GetOpenMPTVersionString() const
  26. {
  27. return U_("OpenMPT ") + ToUString();
  28. }
  29. Version Version::Parse(const mpt::ustring &s)
  30. {
  31. uint32 result = 0;
  32. std::vector<mpt::ustring> numbers = mpt::String::Split<mpt::ustring>(s, U_("."));
  33. for (std::size_t i = 0; i < numbers.size() && i < 4; ++i)
  34. {
  35. result |= (mpt::String::Parse::Hex<unsigned int>(numbers[i]) & 0xff) << ((3 - i) * 8);
  36. }
  37. return Version(result);
  38. }
  39. mpt::ustring Version::ToUString() const
  40. {
  41. uint32 v = m_Version;
  42. if(v == 0)
  43. {
  44. // Unknown version
  45. return U_("Unknown");
  46. } else if((v & 0xFFFF) == 0)
  47. {
  48. // Only parts of the version number are known (e.g. when reading the version from the IT or S3M file header)
  49. return MPT_UFORMAT("{}.{}")(mpt::ufmt::HEX((v >> 24) & 0xFF), mpt::ufmt::HEX0<2>((v >> 16) & 0xFF));
  50. } else
  51. {
  52. // Full version info available
  53. return MPT_UFORMAT("{}.{}.{}.{}")(mpt::ufmt::HEX((v >> 24) & 0xFF), mpt::ufmt::HEX0<2>((v >> 16) & 0xFF), mpt::ufmt::HEX0<2>((v >> 8) & 0xFF), mpt::ufmt::HEX0<2>((v) & 0xFF));
  54. }
  55. }
  56. Version Version::WithoutTestNumber() const noexcept
  57. {
  58. return Version(m_Version & 0xFFFFFF00u);
  59. }
  60. Version Version::WithoutPatchOrTestNumbers() const noexcept
  61. {
  62. return Version(m_Version & 0xFFFF0000u);
  63. }
  64. bool Version::IsTestVersion() const noexcept
  65. {
  66. return (
  67. // Legacy
  68. (*this > MPT_V("1.17.02.54") && *this < MPT_V("1.18.02.00") && *this != MPT_V("1.18.00.00"))
  69. ||
  70. // Test builds have non-zero VER_MINORMINOR
  71. (*this > MPT_V("1.18.02.00") && ((m_Version & 0xFFFFFF00u) != m_Version))
  72. );
  73. }
  74. namespace Source {
  75. static mpt::ustring GetUrl()
  76. {
  77. #ifdef OPENMPT_VERSION_URL
  78. return mpt::ToUnicode(mpt::Charset::ASCII, OPENMPT_VERSION_URL);
  79. #else
  80. return mpt::ustring();
  81. #endif
  82. }
  83. static int GetRevision()
  84. {
  85. #if defined(OPENMPT_VERSION_REVISION)
  86. return OPENMPT_VERSION_REVISION;
  87. #elif defined(OPENMPT_VERSION_SVNVERSION)
  88. std::string svnversion = OPENMPT_VERSION_SVNVERSION;
  89. if(svnversion.length() == 0)
  90. {
  91. return 0;
  92. }
  93. if(svnversion.find(":") != std::string::npos)
  94. {
  95. svnversion = svnversion.substr(svnversion.find(":") + 1);
  96. }
  97. if(svnversion.find("-") != std::string::npos)
  98. {
  99. svnversion = svnversion.substr(svnversion.find("-") + 1);
  100. }
  101. if(svnversion.find("M") != std::string::npos)
  102. {
  103. svnversion = svnversion.substr(0, svnversion.find("M"));
  104. }
  105. if(svnversion.find("S") != std::string::npos)
  106. {
  107. svnversion = svnversion.substr(0, svnversion.find("S"));
  108. }
  109. if(svnversion.find("P") != std::string::npos)
  110. {
  111. svnversion = svnversion.substr(0, svnversion.find("P"));
  112. }
  113. return ConvertStrTo<int>(svnversion);
  114. #else
  115. MPT_WARNING_STATEMENT("SVN revision unknown. Please check your build system.");
  116. return 0;
  117. #endif
  118. }
  119. static bool IsDirty()
  120. {
  121. #if defined(OPENMPT_VERSION_DIRTY)
  122. return OPENMPT_VERSION_DIRTY != 0;
  123. #elif defined(OPENMPT_VERSION_SVNVERSION)
  124. std::string svnversion = OPENMPT_VERSION_SVNVERSION;
  125. if(svnversion.length() == 0)
  126. {
  127. return false;
  128. }
  129. if(svnversion.find("M") != std::string::npos)
  130. {
  131. return true;
  132. }
  133. return false;
  134. #else
  135. return false;
  136. #endif
  137. }
  138. static bool HasMixedRevisions()
  139. {
  140. #if defined(OPENMPT_VERSION_MIXEDREVISIONS)
  141. return OPENMPT_VERSION_MIXEDREVISIONS != 0;
  142. #elif defined(OPENMPT_VERSION_SVNVERSION)
  143. std::string svnversion = OPENMPT_VERSION_SVNVERSION;
  144. if(svnversion.length() == 0)
  145. {
  146. return false;
  147. }
  148. if(svnversion.find(":") != std::string::npos)
  149. {
  150. return true;
  151. }
  152. if(svnversion.find("-") != std::string::npos)
  153. {
  154. return true;
  155. }
  156. if(svnversion.find("S") != std::string::npos)
  157. {
  158. return true;
  159. }
  160. if(svnversion.find("P") != std::string::npos)
  161. {
  162. return true;
  163. }
  164. return false;
  165. #else
  166. return false;
  167. #endif
  168. }
  169. static bool IsPackage()
  170. {
  171. #if defined(OPENMPT_VERSION_IS_PACKAGE)
  172. return OPENMPT_VERSION_IS_PACKAGE != 0;
  173. #else
  174. return false;
  175. #endif
  176. }
  177. static mpt::ustring GetSourceDate()
  178. {
  179. #if defined(OPENMPT_VERSION_DATE)
  180. return mpt::ToUnicode(mpt::Charset::ASCII, OPENMPT_VERSION_DATE);
  181. #else
  182. return mpt::ustring();
  183. #endif
  184. }
  185. } // namespace Source
  186. SourceInfo::SourceInfo()
  187. : m_Url(Source::GetUrl())
  188. , m_Revision(Source::GetRevision())
  189. , m_IsDirty(Source::IsDirty())
  190. , m_HasMixedRevisions(Source::HasMixedRevisions())
  191. , m_IsPackage(Source::IsPackage())
  192. , m_Date(Source::GetSourceDate())
  193. {
  194. }
  195. mpt::ustring SourceInfo::GetUrlWithRevision() const
  196. {
  197. if(m_Url.empty() || (m_Revision == 0))
  198. {
  199. return mpt::ustring();
  200. }
  201. return m_Url + UL_("@") + mpt::ufmt::val(m_Revision);
  202. }
  203. mpt::ustring SourceInfo::GetStateString() const
  204. {
  205. mpt::ustring retval;
  206. if(m_IsDirty)
  207. {
  208. retval += UL_("+dirty");
  209. }
  210. if(m_HasMixedRevisions)
  211. {
  212. retval += UL_("+mixed");
  213. }
  214. if(retval.empty())
  215. {
  216. retval += UL_("clean");
  217. }
  218. if(m_IsPackage)
  219. {
  220. retval += UL_("-pkg");
  221. }
  222. return retval;
  223. }
  224. SourceInfo SourceInfo::Current()
  225. {
  226. return SourceInfo();
  227. }
  228. VersionWithRevision VersionWithRevision::Current()
  229. {
  230. return {Version::Current(), static_cast<uint64>(SourceInfo::Current().Revision())};
  231. }
  232. VersionWithRevision VersionWithRevision::Parse(const mpt::ustring &s)
  233. {
  234. Version version = Version::Parse(mpt::ustring());
  235. uint64 revision = 0;
  236. const auto tokens = mpt::String::Split<mpt::ustring>(s, U_("-"));
  237. if(tokens.size() >= 1)
  238. {
  239. version = Version::Parse(tokens[0]);
  240. }
  241. if(tokens.size() >= 2)
  242. {
  243. revision = ConvertStrTo<uint64>(tokens[1].substr(1));
  244. }
  245. return {version, revision};
  246. }
  247. mpt::ustring VersionWithRevision::ToUString() const
  248. {
  249. if(!HasRevision())
  250. {
  251. return mpt::ufmt::val(version);
  252. }
  253. if(!version.IsTestVersion())
  254. {
  255. return mpt::ufmt::val(version);
  256. }
  257. return MPT_UFORMAT("{}-r{}")(version, revision);
  258. }
  259. namespace Build {
  260. bool IsReleasedBuild()
  261. {
  262. return !(Version::Current().IsTestVersion() || IsDebugBuild() || Source::IsDirty() || Source::HasMixedRevisions());
  263. }
  264. bool IsDebugBuild()
  265. {
  266. #if defined(MPT_BUILD_DEBUG) || defined(DEBUG) || defined(_DEBUG)
  267. return true;
  268. #else
  269. return false;
  270. #endif
  271. }
  272. mpt::ustring GetBuildDateString()
  273. {
  274. mpt::ustring result;
  275. #ifdef MODPLUG_TRACKER
  276. #if defined(OPENMPT_BUILD_DATE)
  277. result = mpt::ToUnicode(mpt::Charset::ASCII, OPENMPT_BUILD_DATE );
  278. #else
  279. result = mpt::ToUnicode(mpt::Charset::ASCII, __DATE__ " " __TIME__ );
  280. #endif
  281. #else // !MODPLUG_TRACKER
  282. result = SourceInfo::Current().Date();
  283. #endif // MODPLUG_TRACKER
  284. return result;
  285. }
  286. static mpt::ustring GetBuildFlagsString()
  287. {
  288. mpt::ustring retval;
  289. #ifdef MODPLUG_TRACKER
  290. #if defined(MPT_BUILD_RETRO)
  291. retval += UL_(" RETRO");
  292. #endif // MPT_BUILD_RETRO
  293. if(Version::Current().IsTestVersion())
  294. {
  295. retval += UL_(" TEST");
  296. }
  297. #endif // MODPLUG_TRACKER
  298. if(IsDebugBuild())
  299. {
  300. retval += UL_(" DEBUG");
  301. }
  302. return retval;
  303. }
  304. mpt::ustring GetBuildFeaturesString()
  305. {
  306. mpt::ustring retval;
  307. #ifdef LIBOPENMPT_BUILD
  308. retval = UL_("")
  309. #if defined(MPT_WITH_ZLIB)
  310. UL_(" +ZLIB")
  311. #endif
  312. #if defined(MPT_WITH_MINIZ)
  313. UL_(" +MINIZ")
  314. #endif
  315. #if !defined(MPT_WITH_ZLIB) && !defined(MPT_WITH_MINIZ)
  316. UL_(" -INFLATE")
  317. #endif
  318. #if defined(MPT_WITH_MPG123)
  319. UL_(" +MPG123")
  320. #endif
  321. #if defined(MPT_WITH_MINIMP3)
  322. UL_(" +MINIMP3")
  323. #endif
  324. #if defined(MPT_WITH_MEDIAFOUNDATION)
  325. UL_(" +MF")
  326. #endif
  327. #if !defined(MPT_WITH_MPG123) && !defined(MPT_WITH_MINIMP3) && !defined(MPT_WITH_MEDIAFOUNDATION)
  328. UL_(" -MP3")
  329. #endif
  330. #if defined(MPT_WITH_OGG) && defined(MPT_WITH_VORBIS) && defined(MPT_WITH_VORBISFILE)
  331. UL_(" +VORBIS")
  332. #endif
  333. #if defined(MPT_WITH_STBVORBIS)
  334. UL_(" +STBVORBIS")
  335. #endif
  336. #if !(defined(MPT_WITH_OGG) && defined(MPT_WITH_VORBIS) && defined(MPT_WITH_VORBISFILE)) && !defined(MPT_WITH_STBVORBIS)
  337. UL_(" -VORBIS")
  338. #endif
  339. #if !defined(NO_PLUGINS)
  340. UL_(" +PLUGINS")
  341. #else
  342. UL_(" -PLUGINS")
  343. #endif
  344. #if defined(MPT_WITH_DMO)
  345. UL_(" +DMO")
  346. #endif
  347. ;
  348. #endif
  349. #ifdef MODPLUG_TRACKER
  350. retval += UL_("")
  351. #if defined(UNICODE)
  352. UL_(" UNICODE")
  353. #else
  354. UL_(" ANSI")
  355. #endif
  356. #ifndef MPT_WITH_VST
  357. UL_(" NO_VST")
  358. #endif
  359. #ifndef MPT_WITH_DMO
  360. UL_(" NO_DMO")
  361. #endif
  362. #ifdef NO_PLUGINS
  363. UL_(" NO_PLUGINS")
  364. #endif
  365. ;
  366. #endif
  367. return retval;
  368. }
  369. mpt::ustring GetBuildCompilerString()
  370. {
  371. mpt::ustring retval;
  372. #if MPT_COMPILER_GENERIC
  373. retval += U_("Generic C++11 Compiler");
  374. #elif MPT_COMPILER_MSVC
  375. #if defined(_MSC_FULL_VER) && defined(_MSC_BUILD) && (_MSC_BUILD > 0)
  376. retval += MPT_UFORMAT("Microsoft Compiler {}.{}.{}.{}")
  377. ( _MSC_FULL_VER / 10000000
  378. , mpt::ufmt::dec0<2>((_MSC_FULL_VER / 100000) % 100)
  379. , mpt::ufmt::dec0<5>(_MSC_FULL_VER % 100000)
  380. , mpt::ufmt::dec0<2>(_MSC_BUILD)
  381. );
  382. #elif defined(_MSC_FULL_VER)
  383. retval += MPT_UFORMAT("Microsoft Compiler {}.{}.{}")
  384. ( _MSC_FULL_VER / 10000000
  385. , mpt::ufmt::dec0<2>((_MSC_FULL_VER / 100000) % 100)
  386. , mpt::ufmt::dec0<5>(_MSC_FULL_VER % 100000)
  387. );
  388. #else
  389. retval += MPT_UFORMAT("Microsoft Compiler {}.{}")(MPT_COMPILER_MSVC_VERSION / 100, MPT_COMPILER_MSVC_VERSION % 100);
  390. #endif
  391. #elif MPT_COMPILER_GCC
  392. retval += MPT_UFORMAT("GNU Compiler Collection {}.{}.{}")(MPT_COMPILER_GCC_VERSION / 10000, (MPT_COMPILER_GCC_VERSION / 100) % 100, MPT_COMPILER_GCC_VERSION % 100);
  393. #elif MPT_COMPILER_CLANG
  394. retval += MPT_UFORMAT("Clang {}.{}.{}")(MPT_COMPILER_CLANG_VERSION / 10000, (MPT_COMPILER_CLANG_VERSION / 100) % 100, MPT_COMPILER_CLANG_VERSION % 100);
  395. #else
  396. retval += U_("unknown");
  397. #endif
  398. return retval;
  399. }
  400. static mpt::ustring GetRevisionString()
  401. {
  402. mpt::ustring result;
  403. if(Source::GetRevision() == 0)
  404. {
  405. return result;
  406. }
  407. result = U_("-r") + mpt::ufmt::val(Source::GetRevision());
  408. if(Source::HasMixedRevisions())
  409. {
  410. result += UL_("!");
  411. }
  412. if(Source::IsDirty())
  413. {
  414. result += UL_("+");
  415. }
  416. if(Source::IsPackage())
  417. {
  418. result += UL_("p");
  419. }
  420. return result;
  421. }
  422. mpt::ustring GetVersionString(FlagSet<Build::Strings> strings)
  423. {
  424. std::vector<mpt::ustring> result;
  425. if(strings[StringVersion])
  426. {
  427. result.push_back(mpt::ufmt::val(Version::Current()));
  428. }
  429. if(strings[StringRevision])
  430. {
  431. if(!IsReleasedBuild())
  432. {
  433. result.push_back(GetRevisionString());
  434. }
  435. }
  436. if(strings[StringSourceInfo])
  437. {
  438. const SourceInfo sourceInfo = SourceInfo::Current();
  439. if(!sourceInfo.GetUrlWithRevision().empty())
  440. {
  441. result.push_back(MPT_UFORMAT(" {}")(sourceInfo.GetUrlWithRevision()));
  442. }
  443. if(!sourceInfo.Date().empty())
  444. {
  445. result.push_back(MPT_UFORMAT(" ({})")(sourceInfo.Date()));
  446. }
  447. if(!sourceInfo.GetStateString().empty())
  448. {
  449. result.push_back(MPT_UFORMAT(" {}")(sourceInfo.GetStateString()));
  450. }
  451. }
  452. if(strings[StringBuildFlags])
  453. {
  454. if(!IsReleasedBuild())
  455. {
  456. result.push_back(GetBuildFlagsString());
  457. }
  458. }
  459. if(strings[StringBuildFeatures])
  460. {
  461. result.push_back(GetBuildFeaturesString());
  462. }
  463. return mpt::trim(mpt::String::Combine<mpt::ustring>(result, U_("")));
  464. }
  465. mpt::ustring GetVersionStringPure()
  466. {
  467. FlagSet<Build::Strings> strings;
  468. strings |= Build::StringVersion;
  469. strings |= Build::StringRevision;
  470. return GetVersionString(strings);
  471. }
  472. mpt::ustring GetVersionStringSimple()
  473. {
  474. FlagSet<Build::Strings> strings;
  475. strings |= Build::StringVersion;
  476. strings |= Build::StringRevision;
  477. strings |= Build::StringBuildFlags;
  478. return GetVersionString(strings);
  479. }
  480. mpt::ustring GetVersionStringExtended()
  481. {
  482. FlagSet<Build::Strings> strings;
  483. strings |= Build::StringVersion;
  484. strings |= Build::StringRevision;
  485. #ifndef MODPLUG_TRACKER
  486. strings |= Build::StringSourceInfo;
  487. #endif
  488. strings |= Build::StringBuildFlags;
  489. #ifdef MODPLUG_TRACKER
  490. strings |= Build::StringBuildFeatures;
  491. #endif
  492. return GetVersionString(strings);
  493. }
  494. mpt::ustring GetURL(Build::Url key)
  495. {
  496. mpt::ustring result;
  497. switch(key)
  498. {
  499. case Url::Website:
  500. #ifdef LIBOPENMPT_BUILD
  501. result = U_("https://lib.openmpt.org/");
  502. #else
  503. result = U_("https://openmpt.org/");
  504. #endif
  505. break;
  506. case Url::Download:
  507. #ifdef MODPLUG_TRACKER
  508. result = IsReleasedBuild() ? U_("https://openmpt.org/download") : U_("https://builds.openmpt.org/builds/");
  509. #else
  510. result = U_("https://lib.openmpt.org/libopenmpt/download/");
  511. #endif
  512. break;
  513. case Url::Forum:
  514. result = U_("https://forum.openmpt.org/");
  515. break;
  516. case Url::Bugtracker:
  517. result = U_("https://bugs.openmpt.org/");
  518. break;
  519. case Url::Updates:
  520. result = U_("https://openmpt.org/download");
  521. break;
  522. case Url::TopPicks:
  523. result = U_("https://openmpt.org/top_picks");
  524. break;
  525. }
  526. return result;
  527. }
  528. mpt::ustring GetFullCreditsString()
  529. {
  530. return mpt::ToUnicode(mpt::Charset::UTF8,
  531. #ifdef MODPLUG_TRACKER
  532. "OpenMPT / Open ModPlug Tracker\n"
  533. #else
  534. "libopenmpt (based on OpenMPT / Open ModPlug Tracker)\n"
  535. #endif
  536. "\n"
  537. "Copyright \xC2\xA9 2004-2022 OpenMPT Project Developers and Contributors\n"
  538. "Copyright \xC2\xA9 1997-2003 Olivier Lapicque\n"
  539. "\n"
  540. "Developers:\n"
  541. "Johannes Schultz (2008-2022)\n"
  542. "J\xC3\xB6rn Heusipp (2012-2022)\n"
  543. "Ahti Lepp\xC3\xA4nen (2005-2011)\n"
  544. "Robin Fernandes (2004-2007)\n"
  545. "Sergiy Pylypenko (2007)\n"
  546. "Eric Chavanon (2004-2005)\n"
  547. "Trevor Nunes (2004)\n"
  548. "Olivier Lapicque (1997-2003)\n"
  549. "\n"
  550. "Additional contributors:\n"
  551. "coda (https://coda.s3m.us/)\n"
  552. "Jo\xC3\xA3o Baptista de Paula e Silva (https://joaobapt.com/)\n"
  553. "kode54 (https://kode54.net/)\n"
  554. "Revenant (https://revenant1.net/)\n"
  555. "xaimus (http://xaimus.com/)\n"
  556. "\n"
  557. "Thanks to:\n"
  558. "\n"
  559. "Konstanty for the XMMS-ModPlug resampling implementation\n"
  560. "http://modplug-xmms.sourceforge.net/\n"
  561. "\n"
  562. #ifdef MODPLUG_TRACKER
  563. "Stephan M. Bernsee for pitch shifting source code\n"
  564. "http://www.dspdimension.com/\n"
  565. "\n"
  566. "Aleksey Vaneev of Voxengo for r8brain sample rate converter\n"
  567. "https://github.com/avaneev/r8brain-free-src\n"
  568. "\n"
  569. "Olli Parviainen for SoundTouch Library (time stretching)\n"
  570. "https://www.surina.net/soundtouch/\n"
  571. "\n"
  572. #endif
  573. #ifdef MPT_WITH_VST
  574. "Hermann Seib for his example VST Host implementation\n"
  575. "http://www.hermannseib.com/english/vsthost.htm\n"
  576. "\n"
  577. "Benjamin \"BeRo\" Rosseaux for his independent VST header\n"
  578. "https://blog.rosseaux.net/\n"
  579. "\n"
  580. #endif
  581. "Storlek for all the IT compatibility hints and testcases\n"
  582. "as well as the IMF, MDL, OKT and ULT loaders\n"
  583. "http://schismtracker.org/\n"
  584. "\n"
  585. "Sergei \"x0r\" Kolzun for various hints on Scream Tracker 2 compatibility\n"
  586. "https://github.com/viiri/st2play\n"
  587. "\n"
  588. "Laurent Cl\xc3\xA9vy for unofficial MO3 documentation and decompression code\n"
  589. "https://github.com/lclevy/unmo3\n"
  590. "\n"
  591. "Ben \"GreaseMonkey\" Russell for IT sample compression code\n"
  592. "https://github.com/iamgreaser/it2everything/\n"
  593. "\n"
  594. "Antti S. Lankila for Amiga resampler implementation\n"
  595. "https://bel.fi/alankila/modguide/interpolate.txt\n"
  596. "\n"
  597. "Shayde / Reality Productions for Opal OPL3 emulator\n"
  598. "https://www.3eality.com/\n"
  599. "\n"
  600. "Ryuhei Mori for TinyFFT\n"
  601. "https://github.com/ryuhei-mori/tinyfft\n"
  602. "\n"
  603. #ifdef MPT_WITH_ZLIB
  604. "Jean-loup Gailly and Mark Adler for zlib\n"
  605. "https://zlib.net/\n"
  606. "\n"
  607. #endif
  608. #ifdef MPT_WITH_MINIZ
  609. "Rich Geldreich et al. for miniz\n"
  610. "https://github.com/richgel999/miniz\n"
  611. "\n"
  612. #endif
  613. #ifdef MPT_WITH_LHASA
  614. "Simon Howard for lhasa\n"
  615. "https://fragglet.github.io/lhasa/\n"
  616. "\n"
  617. #endif
  618. #ifdef MPT_WITH_UNRAR
  619. "Alexander L. Roshal for UnRAR\n"
  620. "https://rarlab.com/\n"
  621. "\n"
  622. #endif
  623. #ifdef MPT_WITH_ANCIENT
  624. "Teemu Suutari for ancient\n"
  625. "https://github.com/temisu/ancient\n"
  626. "\n"
  627. #endif
  628. #ifdef MPT_WITH_PORTAUDIO
  629. "PortAudio contributors\n"
  630. "http://www.portaudio.com/\n"
  631. "\n"
  632. #endif
  633. #ifdef MPT_WITH_RTAUDIO
  634. "Gary P. Scavone, McGill University for RtAudio\n"
  635. "https://www.music.mcgill.ca/~gary/rtaudio/\n"
  636. "\n"
  637. #endif
  638. #ifdef MPT_WITH_FLAC
  639. "Josh Coalson / Xiph.Org Foundation for libFLAC\n"
  640. "https://xiph.org/flac/\n"
  641. "\n"
  642. #endif
  643. #if defined(MPT_WITH_MPG123)
  644. "The mpg123 project for libmpg123\n"
  645. "https://mpg123.de/\n"
  646. "\n"
  647. #endif
  648. #ifdef MPT_WITH_MINIMP3
  649. "Lion (github.com/lieff) for minimp3\n"
  650. "https://github.com/lieff/minimp3/\n"
  651. "\n"
  652. #endif
  653. #ifdef MPT_WITH_STBVORBIS
  654. "Sean Barrett for stb_vorbis\n"
  655. "https://github.com/nothings/stb/\n"
  656. "\n"
  657. #endif
  658. #ifdef MPT_WITH_OGG
  659. "Xiph.Org Foundation for libogg\n"
  660. "https://xiph.org/ogg/\n"
  661. "\n"
  662. #endif
  663. #if defined(MPT_WITH_VORBIS) || defined(MPT_WITH_LIBVORBISFILE)
  664. "Xiph.Org Foundation for libvorbis\n"
  665. "https://xiph.org/vorbis/\n"
  666. "\n"
  667. #endif
  668. #if defined(MPT_WITH_OPUS)
  669. "Xiph.Org, Skype Limited, Octasic, Jean-Marc Valin, Timothy B. Terriberry,\n"
  670. "CSIRO, Gregory Maxwell, Mark Borgerding, Erik de Castro Lopo,\n"
  671. "Xiph.Org Foundation, Microsoft Corporation, Broadcom Corporation for libopus\n"
  672. "https://opus-codec.org/\n"
  673. "\n"
  674. #endif
  675. #if defined(MPT_WITH_OPUSFILE)
  676. "Xiph.Org Foundation and contributors for libopusfile\n"
  677. "https://opus-codec.org/\n"
  678. "\n"
  679. #endif
  680. #if defined(MPT_WITH_OPUSENC)
  681. "Xiph.Org Foundation, Jean-Marc Valin and contributors for libopusenc\n"
  682. "https://git.xiph.org/?p=libopusenc.git;a=summary\n"
  683. "\n"
  684. #endif
  685. #if defined(MPT_WITH_LAME)
  686. "The LAME project for LAME\n"
  687. "https://lame.sourceforge.io/\n"
  688. "\n"
  689. #endif
  690. #if defined(MPT_WITH_NLOHMANNJSON)
  691. "Niels Lohmann et al. for nlohmann-json\n"
  692. "https://github.com/nlohmann/json\n"
  693. "\n"
  694. #endif
  695. #ifdef MODPLUG_TRACKER
  696. "Lennart Poettering and David Henningsson for RealtimeKit\n"
  697. "http://git.0pointer.net/rtkit.git/\n"
  698. "\n"
  699. "Gary P. Scavone for RtMidi\n"
  700. "https://www.music.mcgill.ca/~gary/rtmidi/\n"
  701. "\n"
  702. "Alexander Uckun for decimal input field\n"
  703. "https://www.codeproject.com/Articles/21257/_\n"
  704. "\n"
  705. "\xc3\x9alfur Kolka for application icon, splash and about screen\n"
  706. "https://www.behance.net/ulfurkolka\n"
  707. "\n"
  708. "Nobuyuki for file icon\n"
  709. "https://twitter.com/nobuyukinyuu\n"
  710. "\n"
  711. #endif
  712. "Daniel Collin (emoon/TBL) for providing test infrastructure\n"
  713. "https://twitter.com/daniel_collin\n"
  714. "\n"
  715. "The people at ModPlug forums for crucial contribution\n"
  716. "in the form of ideas, testing and support;\n"
  717. "thanks particularly to:\n"
  718. "33, 8bitbubsy, Anboi, BooT-SectoR-ViruZ, Bvanoudtshoorn\n"
  719. "christofori, cubaxd, Diamond, Ganja, Georg, Goor00,\n"
  720. "Harbinger, jmkz, KrazyKatz, LPChip, Nofold, Rakib, Sam Zen\n"
  721. "Skaven, Skilletaudio, Snu, Squirrel Havoc, Teimoso, Waxhead\n"
  722. "\n"
  723. #ifdef MPT_WITH_VST
  724. "VST PlugIn Technology by Steinberg Media Technologies GmbH\n"
  725. "\n"
  726. #endif
  727. #ifdef MPT_WITH_ASIO
  728. "ASIO Technology by Steinberg Media Technologies GmbH\n"
  729. "\n"
  730. #endif
  731. );
  732. }
  733. mpt::ustring GetLicenseString()
  734. {
  735. return MPT_UTF8(
  736. "Copyright (c) 2004-2022, OpenMPT Project Developers and Contributors" "\n"
  737. "Copyright (c) 1997-2003, Olivier Lapicque" "\n"
  738. "All rights reserved." "\n"
  739. "" "\n"
  740. "Redistribution and use in source and binary forms, with or without" "\n"
  741. "modification, are permitted provided that the following conditions are met:" "\n"
  742. " * Redistributions of source code must retain the above copyright" "\n"
  743. " notice, this list of conditions and the following disclaimer." "\n"
  744. " * Redistributions in binary form must reproduce the above copyright" "\n"
  745. " notice, this list of conditions and the following disclaimer in the" "\n"
  746. " documentation and/or other materials provided with the distribution." "\n"
  747. " * Neither the name of the OpenMPT project nor the" "\n"
  748. " names of its contributors may be used to endorse or promote products" "\n"
  749. " derived from this software without specific prior written permission." "\n"
  750. "" "\n"
  751. "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"" "\n"
  752. "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE" "\n"
  753. "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE" "\n"
  754. "DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE" "\n"
  755. "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL" "\n"
  756. "DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR" "\n"
  757. "SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER" "\n"
  758. "CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY," "\n"
  759. "OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE" "\n"
  760. "OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." "\n"
  761. );
  762. }
  763. } // namespace Build
  764. OPENMPT_NAMESPACE_END