From fca851f7bb04a4acf798d273000ddc7172e7ce7e Mon Sep 17 00:00:00 2001 From: Oleksiy Yakovenko Date: Thu, 1 Feb 2024 19:21:28 +0100 Subject: [PATCH] undo: linux & windows build fixes --- configure.ac | 1 + osx/deadbeef.xcodeproj/project.pbxproj | 32 ++++++++++---------------- plugins/gtkui/Makefile.am | 4 ++-- plugins/gtkui/gtkui.c | 2 +- plugins/gtkui/undo.c | 4 ++-- plugins/gtkui/undo.h | 2 +- premake5.lua | 5 ++++ shared/Makefile.am | 3 ++- shared/undo/Makefile.am | 8 +++++++ {src => shared}/undo/undobuffer.c | 0 {src => shared}/undo/undobuffer.h | 0 {src => shared}/undo/undomanager.c | 0 {src => shared}/undo/undomanager.h | 0 src/Makefile.am | 8 +++---- src/playlist.c | 2 -- src/undo/undo_playlist.c | 1 - src/undo/undo_playlist.h | 2 +- 17 files changed, 38 insertions(+), 36 deletions(-) create mode 100644 shared/undo/Makefile.am rename {src => shared}/undo/undobuffer.c (100%) rename {src => shared}/undo/undobuffer.h (100%) rename {src => shared}/undo/undomanager.c (100%) rename {src => shared}/undo/undomanager.h (100%) diff --git a/configure.ac b/configure.ac index 8a60e1aa16..669bc8c822 100644 --- a/configure.ac +++ b/configure.ac @@ -940,6 +940,7 @@ shared/Makefile shared/analyzer/Makefile shared/scope/Makefile shared/scriptable/Makefile +shared/undo/Makefile external/Makefile external/ddb_dsp_libretro/Makefile external/ddb_output_pw/Makefile diff --git a/osx/deadbeef.xcodeproj/project.pbxproj b/osx/deadbeef.xcodeproj/project.pbxproj index e3c81fd965..d9ad6485bc 100644 --- a/osx/deadbeef.xcodeproj/project.pbxproj +++ b/osx/deadbeef.xcodeproj/project.pbxproj @@ -1656,8 +1656,6 @@ 2D95F6BE29392CE9002D8499 /* libvorbislib.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D7C37F41B2C40580029DE0A /* libvorbislib.dylib */; }; 2D95F6C129392F18002D8499 /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = 2D95F6BF29392F17002D8499 /* base64.c */; }; 2D95F6C229392F18002D8499 /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D95F6C029392F17002D8499 /* base64.h */; }; - 2D95F6DD293B58E1002D8499 /* undo_playlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D95F6DB293B58E1002D8499 /* undo_playlist.h */; }; - 2D95F70C293B95AC002D8499 /* undomanager.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D95F70A293B95AC002D8499 /* undomanager.h */; }; 2D95F721293BA3B8002D8499 /* NSUndoManager+DdbUndoBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D95F71F293BA3B8002D8499 /* NSUndoManager+DdbUndoBuffer.h */; }; 2D95F725293BA3DA002D8499 /* DdbUndoBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D95F723293BA3DA002D8499 /* DdbUndoBuffer.h */; }; 2D95F726293BA3DA002D8499 /* DdbUndoBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D95F724293BA3DA002D8499 /* DdbUndoBuffer.m */; }; @@ -6241,8 +6239,6 @@ 2D95F6B929392884002D8499 /* artwork_ogg.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = artwork_ogg.c; sourceTree = ""; }; 2D95F6BF29392F17002D8499 /* base64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = base64.c; sourceTree = ""; }; 2D95F6C029392F17002D8499 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base64.h; sourceTree = ""; }; - 2D95F6DB293B58E1002D8499 /* undo_playlist.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = undo_playlist.h; sourceTree = ""; }; - 2D95F70A293B95AC002D8499 /* undomanager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = undomanager.h; sourceTree = ""; }; 2D95F71F293BA3B8002D8499 /* NSUndoManager+DdbUndoBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSUndoManager+DdbUndoBuffer.h"; sourceTree = ""; }; 2D95F720293BA3B8002D8499 /* NSUndoManager+DdbUndoBuffer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSUndoManager+DdbUndoBuffer.m"; sourceTree = ""; }; 2D95F723293BA3DA002D8499 /* DdbUndoBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DdbUndoBuffer.h; sourceTree = ""; }; @@ -9587,6 +9583,17 @@ path = codebook; sourceTree = ""; }; + 2D2C51632B6C085400EAC44E /* undo */ = { + isa = PBXGroup; + children = ( + 2D7387D529BE5DA1003E3126 /* undobuffer.c */, + 2D7387D829BE5DA1003E3126 /* undobuffer.h */, + 2D7387D429BE5DA1003E3126 /* undomanager.c */, + 2D7387D729BE5DA1003E3126 /* undomanager.h */, + ); + path = undo; + sourceTree = ""; + }; 2D30D13625E2A6B40023A299 /* DesignMode */ = { isa = PBXGroup; children = ( @@ -10458,10 +10465,6 @@ children = ( 2D7387D629BE5DA1003E3126 /* undo_playlist.c */, 2D7387D929BE5DA1003E3126 /* undo_playlist.h */, - 2D7387D529BE5DA1003E3126 /* undobuffer.c */, - 2D7387D829BE5DA1003E3126 /* undobuffer.h */, - 2D7387D429BE5DA1003E3126 /* undomanager.c */, - 2D7387D729BE5DA1003E3126 /* undomanager.h */, ); path = undo; sourceTree = ""; @@ -10968,6 +10971,7 @@ 2D92D1ED29B92DF900218F1D /* shared */ = { isa = PBXGroup; children = ( + 2D2C51632B6C085400EAC44E /* undo */, 2DB520E52AA8FA4C00B6250A /* scriptable */, 2D92D21929B92DF900218F1D /* analyzer */, 2D92D1F629B92DF900218F1D /* scope */, @@ -12092,15 +12096,6 @@ path = Playlist; sourceTree = ""; }; - 2DDD75EF25E14FC200FA6FE5 /* Recovered References */ = { - isa = PBXGroup; - children = ( - 2D95F6DB293B58E1002D8499 /* undo_playlist.h */, - 2D95F70A293B95AC002D8499 /* undomanager.h */, - ); - name = "Recovered References"; - sourceTree = ""; - }; 2DDD764125E1506100FA6FE5 /* metadata */ = { isa = PBXGroup; children = ( @@ -12393,7 +12388,6 @@ 4D1B3E7C18379829003E6066 /* Frameworks */, 4D1B3E7B18379829003E6066 /* Products */, 2D48DC5C2269B732002CACFD /* DeaDBeeF GTK3.plist */, - 2DDD75EF25E14FC200FA6FE5 /* Recovered References */, 2DC6578D274428F300583E14 /* DeaDBeeF GTK2.plist */, ); sourceTree = ""; @@ -14700,13 +14694,11 @@ 2DC657C62748502F00583E14 /* SegmentedTabView.h in Headers */, 2DF55C432270FF7E002C44DC /* ScriptablePropertySheetDataSource.h in Headers */, 2DC6580D274A994100583E14 /* TableViewWithReturnAction.h in Headers */, - 2D95F6DD293B58E1002D8499 /* undo_playlist.h in Headers */, 2D30D20C25E2A8930023A299 /* WidgetTopLevelView.h in Headers */, 2D78C55927568B4A00F96F9D /* medialibscanner.h in Headers */, 2D72047619DF2971000989C6 /* PlaylistViewController.h in Headers */, 2D8030CD24B261A400539F9F /* MediaLibraryItem.h in Headers */, 2DCF73B41A952F8900495740 /* PreferencesWindowController.h in Headers */, - 2D95F70C293B95AC002D8499 /* undomanager.h in Headers */, 2D046F7D25E2B55200F68459 /* MainWindow.h in Headers */, 2D98B67F272B272300E655AE /* ScopeShaderTypes.h in Headers */, 2D747E4024B6580A00BBB987 /* MainWindowSidebarViewController.h in Headers */, diff --git a/plugins/gtkui/Makefile.am b/plugins/gtkui/Makefile.am index 80037fb6db..8883fbd99a 100644 --- a/plugins/gtkui/Makefile.am +++ b/plugins/gtkui/Makefile.am @@ -101,7 +101,7 @@ GTKUI_SOURCES_GTK2 = $(GTKUI_SOURCES) ddb_gui_GTK2_la_SOURCES = $(GTKUI_SOURCES_GTK2) ddb_gui_GTK2_la_LDFLAGS = -module -avoid-version -ddb_gui_GTK2_la_LIBADD = $(LDADD) $(GTK2_DEPS_LIBS) $(SM_LIBADD) ../libparser/libparser.la ../../shared/libtrkpropertiesutil.la ../../shared/libeqpreset.la ../../shared/libdeletefromdisk.la ../../shared/libtftintutil.la ../../shared/analyzer/libanalyzer.la ../../shared/scope/libscope.la ../../shared/scriptable/libscriptable.la $(JANSSON_LIBS) $(DISPATCH_LIBS) +ddb_gui_GTK2_la_LIBADD = $(LDADD) $(GTK2_DEPS_LIBS) $(SM_LIBADD) ../libparser/libparser.la ../../shared/libtrkpropertiesutil.la ../../shared/libeqpreset.la ../../shared/libdeletefromdisk.la ../../shared/libtftintutil.la ../../shared/analyzer/libanalyzer.la ../../shared/scope/libscope.la ../../shared/scriptable/libscriptable.la ../../shared/undo/libundo.la $(JANSSON_LIBS) $(DISPATCH_LIBS) ddb_gui_GTK2_la_CFLAGS = -std=c99 -Werror -DGLIB_DISABLE_DEPRECATION_WARNINGS -DGDK_DISABLE_DEPRECATION_WARNINGS -DGTK_DISABLE_DEPRECATION_WARNINGS $(GTK2_DEPS_CFLAGS) $(SM_CFLAGS) $(JANSSON_CFLAGS) $(DISPATCH_CFLAGS) $(MEDIALIB_CFLAGS) -I@top_srcdir@/include -I@top_srcdir@/shared -DDDB_WARN_DEPRECATED=1 @@ -113,7 +113,7 @@ GTKUI_SOURCES_GTK3 = deadbeefapp.c deadbeefapp.h $(GTKUI_SOURCES) ddb_gui_GTK3_la_LDFLAGS = -module -avoid-version ddb_gui_GTK3_la_SOURCES = $(GTKUI_SOURCES_GTK3) -ddb_gui_GTK3_la_LIBADD = $(LDADD) $(GTK3_DEPS_LIBS) $(SM_LIBADD) ../libparser/libparser.la ../../shared/libtrkpropertiesutil.la ../../shared/libeqpreset.la ../../shared/libdeletefromdisk.la ../../shared/libtftintutil.la ../../shared/analyzer/libanalyzer.la ../../shared/scope/libscope.la ../../shared/scriptable/libscriptable.la $(JANSSON_LIBS) $(DISPATCH_LIBS) +ddb_gui_GTK3_la_LIBADD = $(LDADD) $(GTK3_DEPS_LIBS) $(SM_LIBADD) ../libparser/libparser.la ../../shared/libtrkpropertiesutil.la ../../shared/libeqpreset.la ../../shared/libdeletefromdisk.la ../../shared/libtftintutil.la ../../shared/analyzer/libanalyzer.la ../../shared/scope/libscope.la ../../shared/scriptable/libscriptable.la ../../shared/undo/libundo.la $(JANSSON_LIBS) $(DISPATCH_LIBS) ddb_gui_GTK3_la_CFLAGS = -std=c99 -Werror -DGLIB_DISABLE_DEPRECATION_WARNINGS -DGDK_DISABLE_DEPRECATION_WARNINGS -DGTK_DISABLE_DEPRECATION_WARNINGS $(GTK3_DEPS_CFLAGS) $(SM_CFLAGS) $(JANSSON_CFLAGS) $(DISPATCH_CFLAGS) $(MEDIALIB_CFLAGS) -I@top_srcdir@/include -I@top_srcdir@/shared -DDDB_WARN_DEPRECATED=1 ddb_gui_GTK3_la_OBJCFLAGS = $(GTK3_DEPS_CFLAGS) $(SM_CFLAGS) $(JANSSON_CFLAGS) diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 808b3c472b..e9b9cfb6e2 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -69,7 +69,7 @@ #include "covermanager/albumartwidget.h" #include "selpropertieswidget.h" #include "undo.h" -#include "undomanager.h" +#include "undo/undomanager.h" #define USE_GTK_APPLICATION 1 diff --git a/plugins/gtkui/undo.c b/plugins/gtkui/undo.c index d9535724d4..435ce87317 100644 --- a/plugins/gtkui/undo.c +++ b/plugins/gtkui/undo.c @@ -25,8 +25,8 @@ #include #include #include "undo.h" -#include "undobuffer.h" -#include "undomanager.h" +#include "undo/undobuffer.h" +#include "undo/undomanager.h" extern DB_functions_t *deadbeef; diff --git a/plugins/gtkui/undo.h b/plugins/gtkui/undo.h index c322d584dd..6741ab373d 100644 --- a/plugins/gtkui/undo.h +++ b/plugins/gtkui/undo.h @@ -24,7 +24,7 @@ #ifndef undo_h #define undo_h -#include "undobuffer.h" +#include "undo/undobuffer.h" void gtkui_undo_deinit (void); diff --git a/premake5.lua b/premake5.lua index 8a07ba9d1e..24a1b8fc6a 100644 --- a/premake5.lua +++ b/premake5.lua @@ -199,6 +199,9 @@ project "deadbeef" "external/wcwidth/wcwidth.c", "shared/ctmap.c", } + includedirs { + "shared" + } defines { "PORTABLE=1", "STATICLINK=1", @@ -832,6 +835,7 @@ project "ddb_gui_GTK2" "shared/analyzer/analyzer.c", "shared/scope/scope.c", "shared/scriptable/*.c", + "shared/undo/*.c", "plugins/libparser/parser.c", "src/utf8.c" } @@ -865,6 +869,7 @@ project "ddb_gui_GTK3" "shared/analyzer/analyzer.c", "shared/scope/scope.c", "shared/scriptable/*.c", + "shared/undo/*.c", "plugins/libparser/parser.c", "src/utf8.c" } diff --git a/shared/Makefile.am b/shared/Makefile.am index eb89e3f63c..9592e01d29 100644 --- a/shared/Makefile.am +++ b/shared/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = analyzer scope scriptable +SUBDIRS = analyzer scope scriptable undo noinst_LTLIBRARIES = libmp4tagutil.la libtrkpropertiesutil.la libeqpreset.la libctmap.la libdeletefromdisk.la libtftintutil.la @@ -19,3 +19,4 @@ libdeletefromdisk_la_CFLAGS = -fPIC -std=c99 -I@top_srcdir@/include libtftintutil_la_SOURCES = tftintutil.h tftintutil.c libtftintutil_la_CFLAGS = -fPIC -std=c99 -I@top_srcdir@/include + diff --git a/shared/undo/Makefile.am b/shared/undo/Makefile.am new file mode 100644 index 0000000000..5c28d07961 --- /dev/null +++ b/shared/undo/Makefile.am @@ -0,0 +1,8 @@ +noinst_LTLIBRARIES = libundo.la + +libundo_la_SOURCES = \ + undobuffer.c undobuffer.h\ + undomanager.c undomanager.h + +libundo_la_CFLAGS = -fPIC -std=c99 -I@top_srcdir@/include $(DISPATCH_CFLAGS) + diff --git a/src/undo/undobuffer.c b/shared/undo/undobuffer.c similarity index 100% rename from src/undo/undobuffer.c rename to shared/undo/undobuffer.c diff --git a/src/undo/undobuffer.h b/shared/undo/undobuffer.h similarity index 100% rename from src/undo/undobuffer.h rename to shared/undo/undobuffer.h diff --git a/src/undo/undomanager.c b/shared/undo/undomanager.c similarity index 100% rename from src/undo/undomanager.c rename to shared/undo/undomanager.c diff --git a/src/undo/undomanager.h b/shared/undo/undomanager.h similarity index 100% rename from src/undo/undomanager.h rename to shared/undo/undomanager.h diff --git a/src/Makefile.am b/src/Makefile.am index afe765926f..5c08cc353e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -36,12 +36,10 @@ deadbeef_SOURCES =\ vfs.c vfs.h vfs_stdio.c\ volume.c volume.h\ viz.c viz.h\ - undo/undo_playlist.c undo/undo_playlist.h\ - undo/undobuffer.c undo/undobuffer.h\ - undo/undomanager.c undo/undomanager.h + undo/undo_playlist.c undo/undo_playlist.h -deadbeef_LDADD = $(LDADD) $(ICONV_LIB) $(DL_LIBS) -lm -lpthread $(DISPATCH_LIBS) $(LTLIBINTL) ../shared/libctmap.la ../plugins/libparser/libparser.la +deadbeef_LDADD = $(LDADD) $(ICONV_LIB) $(DL_LIBS) -lm -lpthread $(DISPATCH_LIBS) $(LTLIBINTL) ../shared/libctmap.la ../shared/undo/libundo.la ../plugins/libparser/libparser.la -deadbeef_CFLAGS = $(DEPS_CFLAGS) $(DISPATCH_CFLAGS) -std=c99 -DLOCALEDIR=\"@localedir@\" -I@top_srcdir@/include -I@top_srcdir@ +deadbeef_CFLAGS = $(DEPS_CFLAGS) $(DISPATCH_CFLAGS) -std=c99 -DLOCALEDIR=\"@localedir@\" -I@top_srcdir@/include -I@top_srcdir@/shared -I@top_srcdir@ EXTRA_DIST = sj_to_unicode.h diff --git a/src/playlist.c b/src/playlist.c index aec5bee76f..e3a4a61a5b 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -86,8 +86,6 @@ #endif // file format revision history -// 1.1->1.2 changelog: -// added flags field // 1.0->1.1 changelog: // added sample-accurate seek positions for sub-tracks // 1.1->1.2 changelog: diff --git a/src/undo/undo_playlist.c b/src/undo/undo_playlist.c index 2090b6c22a..97c0e54fe7 100644 --- a/src/undo/undo_playlist.c +++ b/src/undo/undo_playlist.c @@ -23,7 +23,6 @@ #include #include -#include "undobuffer.h" #include "undo_playlist.h" #define UNDO_SELECTION_LIST_UNSELECTED 1 diff --git a/src/undo/undo_playlist.h b/src/undo/undo_playlist.h index 9c6c9c27e4..72153992c4 100644 --- a/src/undo/undo_playlist.h +++ b/src/undo/undo_playlist.h @@ -24,7 +24,7 @@ #ifndef undo_playlist_h #define undo_playlist_h -#include "undobuffer.h" +#include "undo/undobuffer.h" #include "../playlist.h" void