diff --git a/.gitignore b/.gitignore index 60e8c16..d802046 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,7 @@ mono_crash.* [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ -x64/ +src/x64/ x86/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ @@ -361,5 +361,6 @@ MigrationBackup/ # End of https://www.gitignore.io/api/visualstudio -# Storing PDB just in case -!src/Release/foo_musicbrainz/foo_musicbrainz.pdb \ No newline at end of file +# Storing PDBs just in case +!pdbs/foo_musicbrainz.pdb +!pdbs/x64/foo_musicbrainz.pdb \ No newline at end of file diff --git a/foobar2000-SDK b/foobar2000-SDK index 99763a2..230bc54 160000 --- a/foobar2000-SDK +++ b/foobar2000-SDK @@ -1 +1 @@ -Subproject commit 99763a2db23daae1d980cd336ad68dde17349cf4 +Subproject commit 230bc543f64067a6f9ab3d5517c6417ec0b1c35f diff --git a/pdbs/foo_musicbrainz.pdb b/pdbs/foo_musicbrainz.pdb new file mode 100644 index 0000000..a600b5a Binary files /dev/null and b/pdbs/foo_musicbrainz.pdb differ diff --git a/pdbs/x64/foo_musicbrainz.pdb b/pdbs/x64/foo_musicbrainz.pdb new file mode 100644 index 0000000..7567c3e Binary files /dev/null and b/pdbs/x64/foo_musicbrainz.pdb differ diff --git a/src/contextmenu.cpp b/src/contextmenu.cpp index 14da8ac..2bf2d0c 100644 --- a/src/contextmenu.cpp +++ b/src/contextmenu.cpp @@ -4,6 +4,7 @@ #include "query.h" #include "request_thread.h" #include "toc.h" +#include namespace mb { @@ -73,12 +74,12 @@ namespace mb return true; } - size_t get_num_items() override + unsigned get_num_items() override { - return context_names.size(); + return (unsigned) context_names.size(); } - void context_command(size_t index, metadb_handle_list_cref handles, const GUID& caller) override + void context_command(unsigned index, metadb_handle_list_cref handles, const GUID& caller) override { HWND wnd = core_api::get_main_window(); const size_t count = handles.get_count(); @@ -270,7 +271,7 @@ namespace mb } } - void get_item_name(size_t index, pfc::string_base& out) override + void get_item_name(unsigned index, pfc::string_base& out) override { out = context_names[index].first; } @@ -313,7 +314,7 @@ namespace mb pfc::string8 stripAlbumEditionStrings(pfc::string8 albumTitle) { - for (pfc::stringp descriptor : album_descriptors) { + for (pfc::string8 descriptor : album_descriptors) { pfc::string8 albumLower = stringToLower(albumTitle); pfc::string8 searchLower = stringToLower(descriptor); t_size start = albumLower.find_last(searchLower); diff --git a/src/dialog_mbid.h b/src/dialog_mbid.h index 2a666fa..7246ce6 100644 --- a/src/dialog_mbid.h +++ b/src/dialog_mbid.h @@ -1,5 +1,7 @@ #pragma once +#include + namespace mb { class dialog_mbid : public CDialogImpl @@ -19,6 +21,8 @@ namespace mb BOOL OnInitDialog(CWindow, LPARAM) { + m_hooks.AddDialogWithControls(*this); + m_ok = GetDlgItem(IDOK); m_mbid_edit = GetDlgItem(IDC_EDIT_MBID); CEdit m_mbid_title = GetDlgItem(IDC_STATIC); @@ -56,5 +60,8 @@ namespace mb CEdit m_mbid_edit; str8 m_mbid_str; str8 m_group_title_str; + + private: + fb2k::CCoreDarkModeHooks m_hooks; }; } diff --git a/src/dialog_tagger.h b/src/dialog_tagger.h index 4cb91b1..cbe37a2 100644 --- a/src/dialog_tagger.h +++ b/src/dialog_tagger.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace mb { @@ -101,6 +102,9 @@ namespace mb }; track_list.CreateInDialog(*this, IDC_LIST_TRACK); + // Do this AFTER creating all CListControls, so dark mode hook talks to new CListControl rather than shortlived placeholders + m_hooks.AddDialogWithControls(*this); + type_combo = GetDlgItem(IDC_COMBO_TYPE); status_combo = GetDlgItem(IDC_COMBO_STATUS); @@ -314,8 +318,8 @@ namespace mb uSetWindowText(catalog_edit, m_release_list[current_release].catalog); uSetWindowText(barcode_edit, m_release_list[current_release].barcode); - type_combo.SetCurSel(get_type_index(m_release_list[current_release].primary_type)); - status_combo.SetCurSel(get_status_index(m_release_list[current_release].status)); + type_combo.SetCurSel((int) get_type_index(m_release_list[current_release].primary_type)); + status_combo.SetCurSel((int) get_status_index(m_release_list[current_release].status)); auto DPI = track_list.GetDPI(); track_list.ResizeColumn(2, m_release_list[current_release].tracks[0].totaldiscs > 1 ? MulDiv(120, DPI.cx, 96) : 0); @@ -356,7 +360,7 @@ namespace mb } current_disc = 0; - disc_combo.SetCurSel(current_disc); + disc_combo.SetCurSel((int) current_disc); UpdateDisc(); str8 url_str = PFC_string_formatter() << "MusicBrainz release page"; @@ -364,6 +368,8 @@ namespace mb } private: + fb2k::CCoreDarkModeHooks m_hooks; + bool listCanSelectItem(ctx_t, size_t) override { return false; diff --git a/src/dialog_tags.h b/src/dialog_tags.h index e6acd97..e6c6ada 100644 --- a/src/dialog_tags.h +++ b/src/dialog_tags.h @@ -1,5 +1,7 @@ #pragma once +#include + namespace mb { class dialog_tags : public CDialogImpl @@ -18,6 +20,8 @@ namespace mb BOOL OnInitDialog(CWindow, LPARAM) { + m_hooks.AddDialogWithControls(*this); + m_ok = GetDlgItem(IDOK); m_artist_edit = GetDlgItem(IDC_EDIT_ARTIST); m_album_edit = GetDlgItem(IDC_EDIT_ALBUM); @@ -71,5 +75,8 @@ namespace mb str8 m_album_str; str8 m_album_stripped_str; bool lastCheckVal = true; + + private: + fb2k::CCoreDarkModeHooks m_hooks; }; } diff --git a/src/foo_musicbrainz.h b/src/foo_musicbrainz.h index ffd41f1..efc1bb2 100644 --- a/src/foo_musicbrainz.h +++ b/src/foo_musicbrainz.h @@ -4,6 +4,6 @@ namespace mb { static constexpr const char* component_title = "MusicBrainz Tagger"; static constexpr const char* component_dll_name = "foo_musicbrainz.dll"; - static constexpr const char* component_version = "0.4.7"; - static constexpr const char* component_info = "Copyright (C) 2009-2012 Dremora\nCopyright (C) 2015-2020 marc2003\nCopyright (C) 2020-2021 Mordred\n\nBuild: " __TIME__ ", " __DATE__; + static constexpr const char* component_version = "0.5.0 beta 1"; + static constexpr const char* component_info = "Copyright (C) 2009-2012 Dremora\nCopyright (C) 2015-2020 marc2003\nCopyright (C) 2020-2023 Mordred\n\nBuild: " __TIME__ ", " __DATE__; } diff --git a/src/foo_musicbrainz.rc b/src/foo_musicbrainz.rc index a187e32..bc81886 100644 --- a/src/foo_musicbrainz.rc +++ b/src/foo_musicbrainz.rc @@ -62,12 +62,12 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,36,290,10 CONTROL "Convert Unicode punctuation characters to ASCII",IDC_CHECK_ASCII_PUNCTUATION, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,51,200,10 - GROUPBOX "",IDC_GROUPBOX_MBIDS,3,67,260,58 CONTROL "Write MusicBrainz IDs (Artist MBID, Release Group MBID)",IDC_CHECK_WRITE_IDS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,66,205,10 - CONTROL "Write Album ID",IDC_CHECK_WRITE_ALBUMID,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,15,81,200,10 - CONTROL "Write Disc IDs",IDC_CHECK_WRITE_DISCIDS,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,15,96,200,10 - CONTROL "Write Track IDs",IDC_CHECK_WRITE_TRACKIDS,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,15,111,200,10 + //GROUPBOX "",IDC_GROUPBOX_MBIDS,3,73,260,47 + CONTROL "Write Album ID",IDC_CHECK_WRITE_ALBUMID,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,18,81,200,10 + CONTROL "Write Disc IDs",IDC_CHECK_WRITE_DISCIDS,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,18,96,200,10 + CONTROL "Write Track IDs",IDC_CHECK_WRITE_TRACKIDS,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,18,111,200,10 CONTROL "Write Album Type, use field:",IDC_CHECK_WRITE_ALBUMTYPE, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,132,120,10 EDITTEXT IDC_EDIT_ALBUMTYPE,130,130,133,14,ES_UPPERCASE | ES_AUTOHSCROLL | WS_DISABLED diff --git a/src/foo_musicbrainz.sln b/src/foo_musicbrainz.sln index 08d590f..03b7385 100644 --- a/src/foo_musicbrainz.sln +++ b/src/foo_musicbrainz.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29209.62 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33213.308 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "foobar2000_SDK", "..\foobar2000-SDK\foobar2000\SDK\foobar2000_SDK.vcxproj", "{E8091321-D79D-4575-86EF-064EA1A4A20D}" EndProject @@ -11,40 +11,66 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "foobar2000_sdk_helpers", ". EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pfc", "..\foobar2000-SDK\pfc\pfc.vcxproj", "{EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "foo_musicbrainz", "foo_musicbrainz.vcxproj", "{AFB5049B-6CAB-477A-A659-936BDFC977DF}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "foo_musicbrainz", "foo_musicbrainz.vcxproj", "{95C8AB42-DB6C-4B30-81EB-35BC2E5CDCD6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libPPUI", "..\foobar2000-SDK\libPPUI\libPPUI.vcxproj", "{7729EB82-4069-4414-964B-AD399091A03F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E8091321-D79D-4575-86EF-064EA1A4A20D}.Debug|Win32.ActiveCfg = Debug|Win32 {E8091321-D79D-4575-86EF-064EA1A4A20D}.Debug|Win32.Build.0 = Debug|Win32 + {E8091321-D79D-4575-86EF-064EA1A4A20D}.Debug|x64.ActiveCfg = Debug|x64 + {E8091321-D79D-4575-86EF-064EA1A4A20D}.Debug|x64.Build.0 = Debug|x64 {E8091321-D79D-4575-86EF-064EA1A4A20D}.Release|Win32.ActiveCfg = Release|Win32 {E8091321-D79D-4575-86EF-064EA1A4A20D}.Release|Win32.Build.0 = Release|Win32 + {E8091321-D79D-4575-86EF-064EA1A4A20D}.Release|x64.ActiveCfg = Release|x64 + {E8091321-D79D-4575-86EF-064EA1A4A20D}.Release|x64.Build.0 = Release|x64 {71AD2674-065B-48F5-B8B0-E1F9D3892081}.Debug|Win32.ActiveCfg = Debug|Win32 {71AD2674-065B-48F5-B8B0-E1F9D3892081}.Debug|Win32.Build.0 = Debug|Win32 + {71AD2674-065B-48F5-B8B0-E1F9D3892081}.Debug|x64.ActiveCfg = Debug|x64 + {71AD2674-065B-48F5-B8B0-E1F9D3892081}.Debug|x64.Build.0 = Debug|x64 {71AD2674-065B-48F5-B8B0-E1F9D3892081}.Release|Win32.ActiveCfg = Release|Win32 {71AD2674-065B-48F5-B8B0-E1F9D3892081}.Release|Win32.Build.0 = Release|Win32 + {71AD2674-065B-48F5-B8B0-E1F9D3892081}.Release|x64.ActiveCfg = Release|x64 + {71AD2674-065B-48F5-B8B0-E1F9D3892081}.Release|x64.Build.0 = Release|x64 {EE47764E-A202-4F85-A767-ABDAB4AFF35F}.Debug|Win32.ActiveCfg = Debug|Win32 {EE47764E-A202-4F85-A767-ABDAB4AFF35F}.Debug|Win32.Build.0 = Debug|Win32 + {EE47764E-A202-4F85-A767-ABDAB4AFF35F}.Debug|x64.ActiveCfg = Debug|x64 + {EE47764E-A202-4F85-A767-ABDAB4AFF35F}.Debug|x64.Build.0 = Debug|x64 {EE47764E-A202-4F85-A767-ABDAB4AFF35F}.Release|Win32.ActiveCfg = Release|Win32 {EE47764E-A202-4F85-A767-ABDAB4AFF35F}.Release|Win32.Build.0 = Release|Win32 + {EE47764E-A202-4F85-A767-ABDAB4AFF35F}.Release|x64.ActiveCfg = Release|x64 + {EE47764E-A202-4F85-A767-ABDAB4AFF35F}.Release|x64.Build.0 = Release|x64 {EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}.Debug|Win32.ActiveCfg = Debug FB2K|Win32 {EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}.Debug|Win32.Build.0 = Debug FB2K|Win32 + {EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}.Debug|x64.ActiveCfg = Debug FB2K|x64 + {EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}.Debug|x64.Build.0 = Debug FB2K|x64 {EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}.Release|Win32.ActiveCfg = Release FB2K|Win32 {EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}.Release|Win32.Build.0 = Release FB2K|Win32 - {AFB5049B-6CAB-477A-A659-936BDFC977DF}.Debug|Win32.ActiveCfg = Debug|Win32 - {AFB5049B-6CAB-477A-A659-936BDFC977DF}.Debug|Win32.Build.0 = Debug|Win32 - {AFB5049B-6CAB-477A-A659-936BDFC977DF}.Release|Win32.ActiveCfg = Release|Win32 - {AFB5049B-6CAB-477A-A659-936BDFC977DF}.Release|Win32.Build.0 = Release|Win32 + {EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}.Release|x64.ActiveCfg = Release FB2K|x64 + {EBFFFB4E-261D-44D3-B89C-957B31A0BF9C}.Release|x64.Build.0 = Release FB2K|x64 + {95C8AB42-DB6C-4B30-81EB-35BC2E5CDCD6}.Debug|Win32.ActiveCfg = Debug|Win32 + {95C8AB42-DB6C-4B30-81EB-35BC2E5CDCD6}.Debug|Win32.Build.0 = Debug|Win32 + {95C8AB42-DB6C-4B30-81EB-35BC2E5CDCD6}.Debug|x64.ActiveCfg = Debug|x64 + {95C8AB42-DB6C-4B30-81EB-35BC2E5CDCD6}.Debug|x64.Build.0 = Debug|x64 + {95C8AB42-DB6C-4B30-81EB-35BC2E5CDCD6}.Release|Win32.ActiveCfg = Release|Win32 + {95C8AB42-DB6C-4B30-81EB-35BC2E5CDCD6}.Release|Win32.Build.0 = Release|Win32 + {95C8AB42-DB6C-4B30-81EB-35BC2E5CDCD6}.Release|x64.ActiveCfg = Release|x64 + {95C8AB42-DB6C-4B30-81EB-35BC2E5CDCD6}.Release|x64.Build.0 = Release|x64 {7729EB82-4069-4414-964B-AD399091A03F}.Debug|Win32.ActiveCfg = Debug|Win32 {7729EB82-4069-4414-964B-AD399091A03F}.Debug|Win32.Build.0 = Debug|Win32 + {7729EB82-4069-4414-964B-AD399091A03F}.Debug|x64.ActiveCfg = Debug|x64 + {7729EB82-4069-4414-964B-AD399091A03F}.Debug|x64.Build.0 = Debug|x64 {7729EB82-4069-4414-964B-AD399091A03F}.Release|Win32.ActiveCfg = Release|Win32 {7729EB82-4069-4414-964B-AD399091A03F}.Release|Win32.Build.0 = Release|Win32 + {7729EB82-4069-4414-964B-AD399091A03F}.Release|x64.ActiveCfg = Release|x64 + {7729EB82-4069-4414-964B-AD399091A03F}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/foo_musicbrainz.vcxproj b/src/foo_musicbrainz.vcxproj index e816f84..3e94c7b 100644 --- a/src/foo_musicbrainz.vcxproj +++ b/src/foo_musicbrainz.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + 15.0 @@ -21,16 +29,29 @@ DynamicLibrary true - v142 + v143 + Unicode + + + DynamicLibrary + true + v143 Unicode DynamicLibrary false - v142 + v143 true Unicode + + DynamicLibrary + false + v143 + false + Unicode + @@ -39,15 +60,27 @@ + + + + + + true $(VC_IncludePath);$(WindowsSDK_IncludePath);$(IncludePath) - $(SolutionDir)$(Configuration)\$(ProjectName)\ - $(SolutionDir)$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + true + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(IncludePath) + $(SolutionDir)$(Configuration)\ + $(Configuration)\ false @@ -55,28 +88,57 @@ $(SolutionDir)$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Configuration)\$(ProjectName)\ + + false + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(IncludePath) + false + - Use + Create Level3 Disabled WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) stdcpp17 - ..\foobar2000-SDK;..\foobar2000-SDK\wtl;%(AdditionalIncludeDirectories) - /Zc:__cplusplus %(AdditionalOptions) + ..\foobar2000-SDK;..\foobar2000-SDK\foobar2000;..\foobar2000-SDK\wtl;%(AdditionalIncludeDirectories) Caret true - MultiThreadedDebug + MultiThreadedDebugDLL Windows true - $(SolutionDir)..\foobar2000-SDK\foobar2000\shared\shared.lib;%(AdditionalDependencies) + $(SolutionDir)..\foobar2000-SDK\foobar2000\shared\shared-$(Platform).lib;%(AdditionalDependencies) set component_path=$(SolutionDir)..\component copy /Y "$(TargetPath)" "%component_path%\" -copy /Y "$(TargetDir)$(TargetName).pdb" "%component_path%\" +copy /Y "$(TargetDir)$(TargetName).pdb" "%component_path%\" +copy /Y "$(TargetPath)" "D:\Source\foobar2000_portable\user-components\$(ProjectName)\" +copy /Y "$(TargetDir)$(TargetName).pdb" "D:\Source\foobar2000_portable\user-components\$(ProjectName)\" + Copying to component folder and portable install + + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + stdcpp17 + ..\foobar2000-SDK;..\foobar2000-SDK\foobar2000;..\foobar2000-SDK\wtl;%(AdditionalIncludeDirectories) + /Zc:__cplusplus %(AdditionalOptions) + Caret + true + MultiThreadedDebugDLL + + + Windows + DebugFull + $(SolutionDir)..\foobar2000-SDK\foobar2000\shared\shared-$(Platform).lib;%(AdditionalDependencies) + + + copy /Y "$(TargetPath)" "D:\Source\foobar2000-2.0x64_portable\profile\user-components-x64\$(ProjectName)\" @@ -88,23 +150,56 @@ copy /Y "$(TargetDir)$(TargetName).pdb" "%component_path%\" true WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) stdcpp17 - ..\foobar2000-SDK;..\foobar2000-SDK\wtl;%(AdditionalIncludeDirectories) + ..\foobar2000-SDK;..\foobar2000-SDK\foobar2000;..\foobar2000-SDK\wtl;%(AdditionalIncludeDirectories) /Zc:__cplusplus %(AdditionalOptions) Caret true - MultiThreaded + MultiThreadedDLL Windows true true true - $(SolutionDir)..\foobar2000-SDK\foobar2000\shared\shared.lib;%(AdditionalDependencies) + $(SolutionDir)..\foobar2000-SDK\foobar2000\shared\shared-$(Platform).lib;%(AdditionalDependencies) set component_path=$(SolutionDir)..\component copy /Y "$(TargetPath)" "%component_path%\" -copy /Y "$(TargetDir)$(TargetName).pdb" "%component_path%\" +copy /Y "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)..\pdbs\" +copy /Y "$(TargetPath)" "D:\Source\foobar2000_portable\user-components\$(ProjectName)\" + Copying to component directory and portable install + + + + + Use + Level3 + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + stdcpp17 + ..\foobar2000-SDK;..\foobar2000-SDK\foobar2000;..\foobar2000-SDK\wtl;%(AdditionalIncludeDirectories) + /Zc:__cplusplus %(AdditionalOptions) + Caret + true + MultiThreadedDLL + + + Windows + true + true + true + $(SolutionDir)..\foobar2000-SDK\foobar2000\shared\shared-$(Platform).lib;%(AdditionalDependencies) + UseLinkTimeCodeGeneration + + + set component_path=$(SolutionDir)..\component +copy /Y "$(TargetPath)" "%component_path%\x64\" +copy /Y "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)..\pdbs\x64\" +copy /Y "$(TargetPath)" "D:\Source\foobar2000-2.0x64_portable\profile\user-components-x64\$(ProjectName)\" + Copying to 2.0 x64 components folder @@ -128,6 +223,7 @@ copy /Y "$(TargetDir)$(TargetName).pdb" "%component_path%\" Use + Use @@ -140,7 +236,9 @@ copy /Y "$(TargetDir)$(TargetName).pdb" "%component_path%\" Create + Create Create + Create diff --git a/src/helpers.cpp b/src/helpers.cpp index 2c62843..2bdf144 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -136,9 +136,9 @@ namespace mb bool is_uuid(pfc::stringp mbid) { - if (!mbid.length()) return false; + if (!pfc::stringp_length(mbid)) return false; regex rx("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"); - return regex_search(mbid.get_ptr(), rx); + return regex_search(mbid, rx); } size_t get_status_index(pfc::stringp str) @@ -188,7 +188,7 @@ namespace mb str8 slasher(pfc::stringp one, pfc::stringp two) { - if (one.length() || two.length()) + if (pfc::stringp_length(one) || pfc::stringp_length(two)) { return PFC_string_formatter() << one << "/" << two; } diff --git a/src/preferences.cpp b/src/preferences.cpp index 21cc8a1..7088e55 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -1,5 +1,7 @@ #include "stdafx.h" +#include + namespace prefs { namespace guids @@ -101,6 +103,7 @@ namespace mb BOOL OnInitDialog(CWindow, LPARAM) { using namespace prefs; + m_hooks.AddDialogWithControls(*this); m_check_map[IDC_CHECK_SERVER] = { &check::server, defaults::check_server }; m_check_map[IDC_CHECK_ORIG_DATE] = { &check::use_orig_date, defaults::check_use_orig_date }; @@ -163,7 +166,7 @@ namespace mb { t_uint32 state = preferences_state::resettable; if (has_changed()) state |= preferences_state::changed; - return state; + return state | preferences_state::dark_mode_supported; } void apply() override @@ -220,6 +223,8 @@ namespace mb } private: + fb2k::CCoreDarkModeHooks m_hooks; + struct check_cfg { cfg_bool* setting; diff --git a/src/query.cpp b/src/query.cpp index 352708a..376a439 100644 --- a/src/query.cpp +++ b/src/query.cpp @@ -12,7 +12,7 @@ namespace mb query::query(pfc::stringp entity, pfc::stringp id) { url << prefs::get_server() << "/ws/2/" << entity; - if (id.length()) url << "/" << id; + if (pfc::stringp_length(id)) url << "/" << id; url << "?fmt=json"; } diff --git a/src/query_cache.cpp b/src/query_cache.cpp index c3496fa..bcb4ede 100644 --- a/src/query_cache.cpp +++ b/src/query_cache.cpp @@ -36,7 +36,7 @@ namespace mb { } int query_cache::hashCode(str8 text) { - int hash = 0, strlen = text.length(), i; + int hash = 0, strlen = (int) text.length(), i; char character; if (strlen == 0) return hash; diff --git a/src/toc.cpp b/src/toc.cpp index 5742fb6..cfbab6b 100644 --- a/src/toc.cpp +++ b/src/toc.cpp @@ -38,7 +38,7 @@ namespace mb sprintf_s(tmp, "%02X", 1); SHA1Input(&context, (uint8_t*)tmp, 2); - sprintf_s(tmp, "%02X", num_tracks); + sprintf_s(tmp, "%02X", (unsigned) num_tracks); SHA1Input(&context, (uint8_t*)tmp, 2); for (const auto track : tracks) diff --git a/src/toc.h b/src/toc.h index 9193782..75aff30 100644 --- a/src/toc.h +++ b/src/toc.h @@ -17,7 +17,7 @@ namespace mb std::vector tracks; str8 discid; str8 toc_url; - uint32_t num_tracks = 0; + size_t num_tracks = 0; uint32_t pregap = 150; }; } diff --git a/todo.md b/todo.md new file mode 100644 index 0000000..2047721 --- /dev/null +++ b/todo.md @@ -0,0 +1,5 @@ +### Unprioritized TODO list + + * Add link to open relevant musicbrainz page (or at least group) + * Disable writing everything but MBIDs + * Right-click menu to navigate to MB pages \ No newline at end of file