diff --git a/README.org b/README.org index 8b06e46..b710dfd 100644 --- a/README.org +++ b/README.org @@ -47,20 +47,27 @@ SampleHive let's you manage your audio samples in a nice and simple way, just ad :END: On Arch based distributions, -#+begin_example -sudo pacman -S wxgtk3 wxsvg sqlite taglib yaml-cpp libsndfile spdlog -#+end_example +#+begin_src +sudo pacman -S wxgtk3 sqlite taglib yaml-cpp libsndfile spdlog +#+end_src On Debian, Ubuntu and distributions based the on two, -#+begin_example +#+begin_src sudo apt install libwxbase3.0-dev libwxgtk-media3.0-gtk3-dev libwxgtk3.0-gtk3-dev wx3.0-headers libsqlite3-dev libyaml-cpp-dev libtagc0-dev libtag1-dev libtagc0 libexif-dev libpango1.0-dev libsndfile1-dev libspdlog-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev -#+end_example +#+end_src You might also need to install =git=, =cmake=, =meson= and =g++= as well, if you don't already have them installed in order to build SampleHive. *NOTE:* On Debian and Debian based distributions you also have to install =libwxgtk-media3.0-dev= +*Experimental Windows Build*: +If you want to try out =SampleHive= on =Windows=, you can use the [[https://www.msys2.org/][MSYS2]] environment and [[https://odsn.net/projects/mingw/][MinGW]] compiler for =Windows=. After setting up =MSYS2= and =MinGW= install the following dependencies using the package manager =pacman=. + +#+begin_src +pacman -S mingw-w64-x86_64-wxmsw3.1 mingw-w64-x86_64-sqlite mingw-w64-x86_64-taglib mingw-w64-x86_64-yaml-cpp mingw-w64-x86_64-libsndfile mingw-w64-x86_64-spdlog mingw-w64-x86_64-meson mingw-w64-x86_64-cmake git +#+end_src + ** How to build SampleHive? :PROPERTIES: :CUSTOM_ID: how-to-build-samplehive diff --git a/assets/icons/icon-hive_32x32.ico b/assets/icons/icon-hive_32x32.ico new file mode 100644 index 0000000..98186f9 Binary files /dev/null and b/assets/icons/icon-hive_32x32.ico differ diff --git a/meson.build b/meson.build index e420959..06e5a5a 100755 --- a/meson.build +++ b/meson.build @@ -120,6 +120,10 @@ wx_opts.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON', 'wxUSE_LIBSDL': 'OFF', 'wxUSE_MEDIACTRL': 'ON'}) +if host_sys == 'windows' + wx_opts.set_override_option('b_lto', 'false') +endif + taglib_opts = cmake.subproject_options() taglib_opts.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON', 'CMAKE_INSTALL_PREFIX': prefix, @@ -200,6 +204,14 @@ if not wx.found() wx_core = wx_subproject.dependency('wxcore') wx_base = wx_subproject.dependency('wxbase') wx = [wx_media, wx_core, wx_base] + + if host_sys == 'windows' + win = import('windows') + wx_inc = wx_subproject.include_directories('wxbase') + rc_file = win.compile_resources('src/GUI/Resources.rc', include_directories: wx_inc) + + src += rc_file + endif else wxconfig = find_program(['wx-config', 'wx-config-gtk3', 'wx-config-3.1']) wx_modules = ['media', 'std'] diff --git a/src/GUI/Dialogs/Settings.cpp b/src/GUI/Dialogs/Settings.cpp index bb3ea99..fbd9e3a 100644 --- a/src/GUI/Dialogs/Settings.cpp +++ b/src/GUI/Dialogs/Settings.cpp @@ -27,6 +27,7 @@ #include #include #include +#include cSettings::cSettings(wxWindow *window) : wxDialog(window, wxID_ANY, "cSettings", wxDefaultPosition, @@ -364,7 +365,7 @@ void cSettings::OnChangeFontSize(wxSpinEvent& event) int font_size = m_pFontSize->GetValue(); if (m_pFontType->GetStringSelection() == "System default") - m_Font = wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT); + m_Font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); m_Font.SetPointSize(font_size); @@ -381,7 +382,7 @@ void cSettings::LoadDefaultConfig() { SampleHive::cSerializer serializer; - wxFont sys_font = wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT); + wxFont sys_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); wxString system_font = sys_font.GetFaceName(); int system_font_size = sys_font.GetPointSize(); @@ -450,7 +451,7 @@ void cSettings::SetCustomFont() { SampleHive::cSerializer serializer; - wxFont sys_font = wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT); + wxFont sys_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); std::string system_font = sys_font.GetFaceName().ToStdString(); int system_font_size = sys_font.GetPointSize(); diff --git a/src/GUI/Resources.rc b/src/GUI/Resources.rc new file mode 100644 index 0000000..bc627c7 --- /dev/null +++ b/src/GUI/Resources.rc @@ -0,0 +1,6 @@ +#define wxUSE_RC_MANIFEST 1 +#define wxUSE_DPI_AWARE_MANIFEST 2 + +#include + +ApplicationIcon ICON "../../assets/icons/icon-hive_32x32.ico" \ No newline at end of file diff --git a/src/Utility/Serialize.cpp b/src/Utility/Serialize.cpp index 0852d2f..251ab39 100644 --- a/src/Utility/Serialize.cpp +++ b/src/Utility/Serialize.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -37,7 +38,7 @@ namespace SampleHive { { std::ifstream ifstrm(static_cast(CONFIG_FILEPATH)); - wxFont font = wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT); + wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); std::string system_font_face = font.GetFaceName().ToStdString(); int system_font_size = font.GetPointSize();