From e30898b0a2218ecdc484c22be0c49982ba7542cf Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Thu, 11 Apr 2024 13:05:30 -0400 Subject: [PATCH] add shared gui project --- cmd/makefile | 2 +- core/makefile | 2 +- gui/gui.cpp | 8 ++ gui/gui.vcxproj | 186 ++++++++++++++++++++++++++++++++++++++++ gui/gui.vcxproj.filters | 33 +++++++ gui/makefile | 35 ++++++++ include/nsfplaygui.h | 9 ++ makefile | 4 +- makefile.common | 2 +- nsfplay.sln | 12 +++ nsfplay/makefile | 10 ++- nsfplay/nsfplay.vcxproj | 8 +- readme.md | 7 ++ winamp/makefile | 7 +- winamp/winamp.vcxproj | 4 +- 15 files changed, 312 insertions(+), 17 deletions(-) create mode 100644 gui/gui.cpp create mode 100644 gui/gui.vcxproj create mode 100644 gui/gui.vcxproj.filters create mode 100644 gui/makefile create mode 100644 include/nsfplaygui.h diff --git a/cmd/makefile b/cmd/makefile index 4799105..b9922c9 100644 --- a/cmd/makefile +++ b/cmd/makefile @@ -12,7 +12,7 @@ default: $(TARGET) SRCS = $(wildcard *.cpp) OBJS = $(addprefix $(CMD_INTDIR)/,$(SRCS:.cpp=.o)) DEPS = $(addprefix $(CMD_INTDIR)/,$(SRCS:.cpp=.d)) -CORE = ../$(OUTDIR)/$(LIB_NAME)$(LIB_SUFFIX) +CORE = ../$(OUTDIR)/$(CORE_NAME)$(LIB_SUFFIX) $(TARGET): $(OBJS) $(CORE) | $(dir $(TARGET)) $(CXX) -o $(TARGET) $(LDFLAGS) $(LDFLAGS_CMD) $(OBJS) $(CORE) diff --git a/core/makefile b/core/makefile index 0d61d12..a95d26a 100644 --- a/core/makefile +++ b/core/makefile @@ -1,6 +1,6 @@ include ../makefile.common -TARGETFILE ?= $(LIB_NAME)$(LIB_SUFFIX) +TARGETFILE ?= $(CORE_NAME)$(LIB_SUFFIX) TARGET ?= ../$(OUTDIR)/$(TARGETFILE) CORE_INTDIR ?= ../$(INTDIR)/core diff --git a/gui/gui.cpp b/gui/gui.cpp new file mode 100644 index 0000000..5680bca --- /dev/null +++ b/gui/gui.cpp @@ -0,0 +1,8 @@ +// stub + +#include + +int nsfplaygui::test() +{ + return 4; +} diff --git a/gui/gui.vcxproj b/gui/gui.vcxproj new file mode 100644 index 0000000..0cf51da --- /dev/null +++ b/gui/gui.vcxproj @@ -0,0 +1,186 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {62ffe7e8-a311-4603-a4c0-8d438230eba5} + gui + 10.0 + + + + StaticLibrary + true + v142 + Unicode + + + StaticLibrary + false + v142 + true + Unicode + + + StaticLibrary + true + v142 + Unicode + + + StaticLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)intermediate\$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)output\$(Platform)\$(Configuration)\ + nsfgui + + + false + $(SolutionDir)intermediate\$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)output\$(Platform)\$(Configuration)\ + nsfgui + + + true + $(SolutionDir)intermediate\$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)output\$(Platform)\$(Configuration)\ + nsfgui + + + false + $(SolutionDir)intermediate\$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)output\$(Platform)\$(Configuration)\ + nsfgui + + + + Level4 + true + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + NotUsing + pch.h + MultiThreadedDebug + ..\include\ + true + + + + + true + + + + + Level4 + true + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + NotUsing + pch.h + MultiThreaded + ..\include\ + true + + + + + true + true + true + + + + + Level4 + true + _DEBUG;_LIB;%(PreprocessorDefinitions) + true + NotUsing + pch.h + MultiThreadedDebug + ..\include\ + true + + + + + true + + + + + Level4 + true + true + true + NDEBUG;_LIB;%(PreprocessorDefinitions) + true + NotUsing + pch.h + MultiThreaded + ..\include\ + true + + + + + true + true + true + + + + + + + + + + + + \ No newline at end of file diff --git a/gui/gui.vcxproj.filters b/gui/gui.vcxproj.filters new file mode 100644 index 0000000..88cc0b6 --- /dev/null +++ b/gui/gui.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/gui/makefile b/gui/makefile new file mode 100644 index 0000000..63ee84d --- /dev/null +++ b/gui/makefile @@ -0,0 +1,35 @@ +include ../makefile.common + +TARGETFILE ?= $(GUI_NAME)$(LIB_SUFFIX) +TARGET ?= ../$(OUTDIR)/$(TARGETFILE) +GUI_INTDIR ?= ../$(INTDIR)/gui + +.PHONY: default clean + +default: $(TARGET) + +SRCS = $(wildcard *.cpp) +OBJS = $(addprefix $(GUI_INTDIR)/,$(SRCS:.cpp=.o)) +DEPS = $(addprefix $(GUI_INTDIR)/,$(SRCS:.cpp=.d)) + +$(TARGET): $(OBJS) | $(dir $(TARGET)) + rm -f $(TARGET) + $(AR) rcs $(TARGET) $(OBJS) + +$(GUI_INTDIR)/%.d: %.cpp | $(GUI_INTDIR)/ + $(CXX) -M -MM -MF $@ -MT $(GUI_INTDIR)/$(basename $<).o $(CXXFLAGS) -c $< + +$(GUI_INTDIR)/%.o: %.cpp $(GUI_INTDIR)/%.d | $(GUI_INTDIR)/ + $(CXX) -o $@ $(CXXFLAGS) -c $< + +$(GUI_INTDIR)/: + $(MKDIR) $@ + +$(dir $(TARGET)): + $(MKDIR) $@ + +clean: + rm -rf $(GUI_INTDIR) + rm -rf $(dir $(TARGET)) + +include $(DEPS) diff --git a/include/nsfplaygui.h b/include/nsfplaygui.h new file mode 100644 index 0000000..24708e2 --- /dev/null +++ b/include/nsfplaygui.h @@ -0,0 +1,9 @@ +// stub + +// this is the public interface to the gui library +namespace nsfplaygui +{ + +int test(); + +}; diff --git a/makefile b/makefile index 6bb70c8..de4f02d 100644 --- a/makefile +++ b/makefile @@ -17,10 +17,10 @@ cmd: core gui: core $(MAKE) -C gui -nsfplay: core +nsfplay: core gui $(MAKE) -C nsfplay -winamp: core +winamp: core gui $(MAKE) -C winamp install: cmd diff --git a/makefile.common b/makefile.common index db3f577..5358bc2 100644 --- a/makefile.common +++ b/makefile.common @@ -18,7 +18,7 @@ LIB_SUFFIX ?= .a EXE_SUFFIX ?= .exe DLL_SUFFIX ?= .dll -LIB_NAME ?= nsfcore +CORE_NAME ?= nsfcore CMD_NAME ?= nsfplac GUI_NAME ?= nsfgui NSFPLAY_NAME ?= nsfplay diff --git a/nsfplay.sln b/nsfplay.sln index 3c5539b..45f4fa1 100644 --- a/nsfplay.sln +++ b/nsfplay.sln @@ -13,13 +13,17 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winamp", "winamp\winamp.vcxproj", "{4564B30C-656E-4897-8036-42E4A3E88FBE}" ProjectSection(ProjectDependencies) = postProject {E492BA81-E2F5-439C-B42E-A3E26C82DDFB} = {E492BA81-E2F5-439C-B42E-A3E26C82DDFB} + {62FFE7E8-A311-4603-A4C0-8D438230EBA5} = {62FFE7E8-A311-4603-A4C0-8D438230EBA5} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nsfplay", "nsfplay\nsfplay.vcxproj", "{D3EC4B41-9124-4C7E-B2B8-01E85EEC750D}" ProjectSection(ProjectDependencies) = postProject {E492BA81-E2F5-439C-B42E-A3E26C82DDFB} = {E492BA81-E2F5-439C-B42E-A3E26C82DDFB} + {62FFE7E8-A311-4603-A4C0-8D438230EBA5} = {62FFE7E8-A311-4603-A4C0-8D438230EBA5} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gui", "gui\gui.vcxproj", "{62FFE7E8-A311-4603-A4C0-8D438230EBA5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -58,6 +62,14 @@ Global {D3EC4B41-9124-4C7E-B2B8-01E85EEC750D}.Release|x64.Build.0 = Release|x64 {D3EC4B41-9124-4C7E-B2B8-01E85EEC750D}.Release|x86.ActiveCfg = Release|Win32 {D3EC4B41-9124-4C7E-B2B8-01E85EEC750D}.Release|x86.Build.0 = Release|Win32 + {62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Debug|x64.ActiveCfg = Debug|x64 + {62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Debug|x64.Build.0 = Debug|x64 + {62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Debug|x86.ActiveCfg = Debug|Win32 + {62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Debug|x86.Build.0 = Debug|Win32 + {62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Release|x64.ActiveCfg = Release|x64 + {62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Release|x64.Build.0 = Release|x64 + {62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Release|x86.ActiveCfg = Release|Win32 + {62FFE7E8-A311-4603-A4C0-8D438230EBA5}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/nsfplay/makefile b/nsfplay/makefile index bb4d11a..d3be2a6 100644 --- a/nsfplay/makefile +++ b/nsfplay/makefile @@ -12,14 +12,15 @@ default: $(TARGET) SRCS = $(wildcard *.cpp) OBJS = $(addprefix $(NSFPLAY_INTDIR)/,$(SRCS:.cpp=.o)) DEPS = $(addprefix $(NSFPLAY_INTDIR)/,$(SRCS:.cpp=.d)) -CORE = ../$(OUTDIR)/$(LIB_NAME)$(LIB_SUFFIX) +CORE = ../$(OUTDIR)/$(CORE_NAME)$(LIB_SUFFIX) +GUI = ../$(OUTDIR)/$(GUI_NAME)$(LIB_SUFFIX) ifeq ($(OS),Windows_NT) OBJS += $(NSFPLAY_INTDIR)/nsfplay_rc.o endif -$(TARGET): $(OBJS) $(CORE) | $(dir $(TARGET)) - $(CXX) -o $(TARGET) $(LDFLAGS) $(LDFLAGS_NSFPLAY) $(OBJS) $(CORE) +$(TARGET): $(OBJS) $(CORE) $(GUI) | $(dir $(TARGET)) + $(CXX) -o $(TARGET) $(LDFLAGS) $(LDFLAGS_NSFPLAY) $(OBJS) $(CORE) $(GUI) $(STRIP_DEBUG) $(NSFPLAY_INTDIR)/%.d: %.cpp | $(NSFPLAY_INTDIR)/ @@ -40,6 +41,9 @@ $(dir $(TARGET)): $(CORE): $(MAKE) -C ../core +$(GUI): + $(MAKE) -C ../gui + install: $(TARGET) $(MKDIR) $(dir $(NSFPLAY_INSTALL)) cp $(TARGET) $(NSFPLAY_INSTALL) diff --git a/nsfplay/nsfplay.vcxproj b/nsfplay/nsfplay.vcxproj index e823294..5316ab3 100644 --- a/nsfplay/nsfplay.vcxproj +++ b/nsfplay/nsfplay.vcxproj @@ -108,7 +108,7 @@ Windows true - $(OutDir)nsfcore.lib;%(AdditionalDependencies) + $(OutDir)nsfcore.lib;$(OutDir)nsfgui.lib;%(AdditionalDependencies) @@ -128,7 +128,7 @@ true true true - $(OutDir)nsfcore.lib;%(AdditionalDependencies) + $(OutDir)nsfcore.lib;$(OutDir)nsfgui.lib;%(AdditionalDependencies) @@ -144,7 +144,7 @@ Windows true - $(OutDir)nsfcore.lib;%(AdditionalDependencies) + $(OutDir)nsfcore.lib;$(OutDir)nsfgui.lib;%(AdditionalDependencies) @@ -164,7 +164,7 @@ true true true - $(OutDir)nsfcore.lib;%(AdditionalDependencies) + $(OutDir)nsfcore.lib;$(OutDir)nsfgui.lib;%(AdditionalDependencies) diff --git a/readme.md b/readme.md index 0938004..af8a9bc 100644 --- a/readme.md +++ b/readme.md @@ -8,6 +8,13 @@ This is a work in progress total rewrite of NSFPlay. Goals include: * Winamp plugin. * Rewrite to change the emulation architecture, hopefully more efficient and easier to maintain. +Components: +* `core` - A platform-agnostic NSF player library suitable for integration into other programs. +* `gui` - A cross platform GUI library that works with the core, allowing plugins to share the same UI as the stand alone player. +* `cmd` - A stand-alone command line player. +* `nsfplay` - A stand-alone GUI player. +* `winamp` - A winamp plugin. + Make targets: * `make` - builds `cmd`, `gui`, and on windows: `winamp` . * `make clean` - deletes `intermediate` and `output` directories. diff --git a/winamp/makefile b/winamp/makefile index 9d44804..314fd3f 100644 --- a/winamp/makefile +++ b/winamp/makefile @@ -11,10 +11,11 @@ default: $(TARGET) SRCS = $(wildcard *.cpp) OBJS = $(addprefix $(WINAMP_INTDIR)/,$(SRCS:.cpp=.o)) DEPS = $(addprefix $(WINAMP_INTDIR)/,$(SRCS:.cpp=.d)) -CORE = ../$(OUTDIR)/$(LIB_NAME)$(LIB_SUFFIX) +CORE = ../$(OUTDIR)/$(CORE_NAME)$(LIB_SUFFIX) +GUI = ../$(OUTDIR)/$(GUI_NAME)$(LIB_SUFFIX) -$(TARGET): $(OBJS) $(CORE) | $(dir $(TARGET)) - $(CXX) -o $(TARGET) $(LDFLAGS) $(LDFLAGS_DLL) $(OBJS) $(CORE) +$(TARGET): $(OBJS) $(CORE) $(GUI) | $(dir $(TARGET)) + $(CXX) -o $(TARGET) $(LDFLAGS) $(LDFLAGS_DLL) $(OBJS) $(CORE) $(GUI) $(STRIP_DEBUG) $(WINAMP_INTDIR)/%.d: %.cpp | $(WINAMP_INTDIR)/ diff --git a/winamp/winamp.vcxproj b/winamp/winamp.vcxproj index 6e552d3..91d78c3 100644 --- a/winamp/winamp.vcxproj +++ b/winamp/winamp.vcxproj @@ -71,7 +71,7 @@ Windows true false - $(OutDir)nsfcore.lib;%(AdditionalDependencies) + $(OutDir)nsfcore.lib;$(OutDir)nsfgui.lib;%(AdditionalDependencies) $(OutDir)$(TargetFileName).pdb @@ -95,7 +95,7 @@ true true false - $(OutDir)nsfcore.lib;%(AdditionalDependencies) + $(OutDir)nsfcore.lib;$(OutDir)nsfgui.lib;%(AdditionalDependencies) $(OutDir)$(TargetFileName).pdb