Skip to content

Commit

Permalink
Merge pull request #4 from kbuffington/x64
Browse files Browse the repository at this point in the history
X64
  • Loading branch information
kbuffington authored Feb 13, 2023
2 parents 7b46108 + 02f13d1 commit 1ee27d5
Show file tree
Hide file tree
Showing 19 changed files with 203 additions and 47 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mono_crash.*
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
src/x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
Expand Down Expand Up @@ -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
# Storing PDBs just in case
!pdbs/foo_musicbrainz.pdb
!pdbs/x64/foo_musicbrainz.pdb
2 changes: 1 addition & 1 deletion foobar2000-SDK
Binary file added pdbs/foo_musicbrainz.pdb
Binary file not shown.
Binary file added pdbs/x64/foo_musicbrainz.pdb
Binary file not shown.
11 changes: 6 additions & 5 deletions src/contextmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "query.h"
#include "request_thread.h"
#include "toc.h"
#include <foobar2000/SDK/coreDarkMode.h>

namespace mb
{
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions src/dialog_mbid.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <foobar2000/SDK/coreDarkMode.h>

namespace mb
{
class dialog_mbid : public CDialogImpl<dialog_mbid>
Expand All @@ -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);
Expand Down Expand Up @@ -56,5 +60,8 @@ namespace mb
CEdit m_mbid_edit;
str8 m_mbid_str;
str8 m_group_title_str;

private:
fb2k::CCoreDarkModeHooks m_hooks;
};
}
12 changes: 9 additions & 3 deletions src/dialog_tagger.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <sstream>
#include <foobar2000/SDK/coreDarkMode.h>

namespace mb
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -356,14 +360,16 @@ namespace mb
}

current_disc = 0;
disc_combo.SetCurSel(current_disc);
disc_combo.SetCurSel((int) current_disc);
UpdateDisc();

str8 url_str = PFC_string_formatter() << "<a href=\"" << prefs::get_server() << "/release/" << m_release_list[current_release].albumid << "\">MusicBrainz release page</a>";
uSetWindowText(url, url_str);
}

private:
fb2k::CCoreDarkModeHooks m_hooks;

bool listCanSelectItem(ctx_t, size_t) override
{
return false;
Expand Down
7 changes: 7 additions & 0 deletions src/dialog_tags.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <foobar2000/SDK/coreDarkMode.h>

namespace mb
{
class dialog_tags : public CDialogImpl<dialog_tags>
Expand All @@ -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);
Expand Down Expand Up @@ -71,5 +75,8 @@ namespace mb
str8 m_album_str;
str8 m_album_stripped_str;
bool lastCheckVal = true;

private:
fb2k::CCoreDarkModeHooks m_hooks;
};
}
4 changes: 2 additions & 2 deletions src/foo_musicbrainz.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__;
}
8 changes: 4 additions & 4 deletions src/foo_musicbrainz.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 33 additions & 7 deletions src/foo_musicbrainz.sln
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit 1ee27d5

Please sign in to comment.