From 59dea70a2b29a2957553ba079a4d57417cc5cf42 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 10 Sep 2024 17:13:24 +0200 Subject: [PATCH] mpdclient, gidle: move to client/ --- meson.build | 16 ++-------------- src/ChatPage.cxx | 2 +- src/DelayedSeek.cxx | 2 +- src/EditPlaylistPage.cxx | 4 +--- src/FileBrowserPage.cxx | 2 +- src/FileListPage.cxx | 2 +- src/Instance.hxx | 2 +- src/LibraryPage.cxx | 2 +- src/LyricsPage.cxx | 2 +- src/Main.cxx | 1 - src/OutputsPage.cxx | 2 +- src/QueuePage.cxx | 2 +- src/SearchPage.cxx | 2 +- src/SongPage.cxx | 2 +- src/TagListPage.cxx | 2 +- src/callbacks.cxx | 2 +- src/{ => client}/aconnect.cxx | 0 src/{ => client}/aconnect.hxx | 0 src/{ => client}/gidle.cxx | 0 src/{ => client}/gidle.hxx | 0 src/client/meson.build | 33 +++++++++++++++++++++++++++++++++ src/{ => client}/mpdclient.cxx | 0 src/{ => client}/mpdclient.hxx | 0 src/db_completion.cxx | 2 +- src/player_command.cxx | 2 +- src/save_playlist.cxx | 2 +- src/screen.cxx | 2 +- src/screen_client.cxx | 2 +- 28 files changed, 54 insertions(+), 36 deletions(-) rename src/{ => client}/aconnect.cxx (100%) rename src/{ => client}/aconnect.hxx (100%) rename src/{ => client}/gidle.cxx (100%) rename src/{ => client}/gidle.hxx (100%) create mode 100644 src/client/meson.build rename src/{ => client}/mpdclient.cxx (100%) rename src/{ => client}/mpdclient.hxx (100%) diff --git a/meson.build b/meson.build index 7f83815a..ac052802 100644 --- a/meson.build +++ b/meson.build @@ -208,8 +208,6 @@ if not mini m_dep = cc.find_library('m', required: false) endif -libmpdclient_dep = dependency('libmpdclient', version: '>= 2.16') - if not mini pcre_dep = dependency('libpcre2-8', required: get_option('regex')) @@ -263,15 +261,6 @@ if not mini endif endif -if async_connect - sources += [ - 'src/net/SocketError.cxx', - 'src/net/AsyncResolveConnect.cxx', - 'src/event/net/ConnectSocket.cxx', - 'src/aconnect.cxx', - ] -endif - if lirc_dep.found() sources += [ 'src/lirc.cxx', @@ -380,6 +369,7 @@ subdir('src/io') subdir('src/system') subdir('src/net') subdir('src/event') +subdir('src/client') subdir('src/ui') subdir('src/dialogs') subdir('src/page') @@ -387,8 +377,6 @@ subdir('src/page') ncmpc = executable('ncmpc', 'src/Main.cxx', 'src/Instance.cxx', - 'src/gidle.cxx', - 'src/mpdclient.cxx', 'src/callbacks.cxx', 'src/Queue.cxx', 'src/filelist.cxx', @@ -438,7 +426,7 @@ ncmpc = executable('ncmpc', m_dep, curses_dep, lirc_dep, - libmpdclient_dep, + client_dep, fmt_dep, ui_dep, dialogs_dep, diff --git a/src/ChatPage.cxx b/src/ChatPage.cxx index fb142b89..01ae0924 100644 --- a/src/ChatPage.cxx +++ b/src/ChatPage.cxx @@ -5,13 +5,13 @@ #include "PageMeta.hxx" #include "screen.hxx" #include "screen_status.hxx" -#include "mpdclient.hxx" #include "i18n.h" #include "charset.hxx" #include "Command.hxx" #include "Options.hxx" #include "page/TextPage.hxx" #include "dialogs/TextInputDialog.hxx" +#include "client/mpdclient.hxx" #include "util/StringAPI.hxx" #include diff --git a/src/DelayedSeek.cxx b/src/DelayedSeek.cxx index ee4f9e84..4d1b6f80 100644 --- a/src/DelayedSeek.cxx +++ b/src/DelayedSeek.cxx @@ -2,7 +2,7 @@ // Copyright The Music Player Daemon Project #include "DelayedSeek.hxx" -#include "mpdclient.hxx" +#include "client/mpdclient.hxx" void DelayedSeek::Commit() noexcept diff --git a/src/EditPlaylistPage.cxx b/src/EditPlaylistPage.cxx index ec47c920..206fb9af 100644 --- a/src/EditPlaylistPage.cxx +++ b/src/EditPlaylistPage.cxx @@ -10,11 +10,9 @@ #include "i18n.h" #include "Command.hxx" #include "Options.hxx" -#include "mpdclient.hxx" #include "screen.hxx" #include "lib/fmt/ToSpan.hxx" - -#include +#include "client/mpdclient.hxx" #include diff --git a/src/FileBrowserPage.cxx b/src/FileBrowserPage.cxx index 2e95c4e0..3a20b7dc 100644 --- a/src/FileBrowserPage.cxx +++ b/src/FileBrowserPage.cxx @@ -10,7 +10,6 @@ #include "config.h" // IWYU pragma: keep #include "i18n.h" #include "charset.hxx" -#include "mpdclient.hxx" #include "filelist.hxx" #include "screen_client.hxx" #include "Command.hxx" @@ -18,6 +17,7 @@ #include "dialogs/YesNoDialog.hxx" #include "ui/Bell.hxx" #include "lib/fmt/ToSpan.hxx" +#include "client/mpdclient.hxx" #include "util/UriUtil.hxx" #include diff --git a/src/FileListPage.cxx b/src/FileListPage.cxx index 9548d859..f4dfb694 100644 --- a/src/FileListPage.cxx +++ b/src/FileListPage.cxx @@ -12,12 +12,12 @@ #include "Options.hxx" #include "charset.hxx" #include "strfsong.hxx" -#include "mpdclient.hxx" #include "filelist.hxx" #include "Styles.hxx" #include "SongRowPaint.hxx" #include "time_format.hxx" #include "ui/paint.hxx" +#include "client/mpdclient.hxx" #include "util/UriUtil.hxx" #include diff --git a/src/Instance.hxx b/src/Instance.hxx index ae597a0d..909502d3 100644 --- a/src/Instance.hxx +++ b/src/Instance.hxx @@ -6,9 +6,9 @@ #include "config.h" #include "AsyncUserInput.hxx" #include "UserInputHandler.hxx" -#include "mpdclient.hxx" #include "DelayedSeek.hxx" #include "screen.hxx" +#include "client/mpdclient.hxx" #include "event/Loop.hxx" #include "event/CoarseTimerEvent.hxx" #include "event/FineTimerEvent.hxx" diff --git a/src/LibraryPage.cxx b/src/LibraryPage.cxx index ddda03d6..3e59426d 100644 --- a/src/LibraryPage.cxx +++ b/src/LibraryPage.cxx @@ -8,12 +8,12 @@ #include "Command.hxx" #include "i18n.h" #include "charset.hxx" -#include "mpdclient.hxx" #include "filelist.hxx" #include "Options.hxx" #include "screen.hxx" #include "page/ProxyPage.hxx" #include "lib/fmt/ToSpan.hxx" +#include "client/mpdclient.hxx" #include #include diff --git a/src/LyricsPage.cxx b/src/LyricsPage.cxx index 39b2acf4..21236b43 100644 --- a/src/LyricsPage.cxx +++ b/src/LyricsPage.cxx @@ -9,12 +9,12 @@ #include "i18n.h" #include "Command.hxx" #include "Options.hxx" -#include "mpdclient.hxx" #include "screen.hxx" #include "plugin.hxx" #include "ncu.hxx" #include "page/TextPage.hxx" #include "lib/fmt/ToSpan.hxx" +#include "client/mpdclient.hxx" #include "util/StringAPI.hxx" #include diff --git a/src/Main.cxx b/src/Main.cxx index 55501333..f3feb5a8 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -4,7 +4,6 @@ #include "config.h" #include "Instance.hxx" #include "ncmpc.hxx" -#include "mpdclient.hxx" #include "callbacks.hxx" #include "charset.hxx" #include "Options.hxx" diff --git a/src/OutputsPage.cxx b/src/OutputsPage.cxx index da53073b..1f42bd42 100644 --- a/src/OutputsPage.cxx +++ b/src/OutputsPage.cxx @@ -8,11 +8,11 @@ #include "screen_status.hxx" #include "Command.hxx" #include "i18n.h" -#include "mpdclient.hxx" #include "page/ListPage.hxx" #include "dialogs/TextInputDialog.hxx" #include "ui/ListRenderer.hxx" #include "ui/paint.hxx" +#include "client/mpdclient.hxx" #include "util/FNVHash.hxx" #include "util/StringAPI.hxx" diff --git a/src/QueuePage.cxx b/src/QueuePage.cxx index ccd23492..54c9dbd0 100644 --- a/src/QueuePage.cxx +++ b/src/QueuePage.cxx @@ -10,7 +10,6 @@ #include "charset.hxx" #include "Command.hxx" #include "Options.hxx" -#include "mpdclient.hxx" #include "strfsong.hxx" #include "Completion.hxx" #include "Styles.hxx" @@ -23,6 +22,7 @@ #include "dialogs/TextInputDialog.hxx" #include "ui/ListRenderer.hxx" #include "ui/ListText.hxx" +#include "client/mpdclient.hxx" #include "event/CoarseTimerEvent.hxx" #include "util/SPrintf.hxx" diff --git a/src/SearchPage.cxx b/src/SearchPage.cxx index 5ece4233..6503be6e 100644 --- a/src/SearchPage.cxx +++ b/src/SearchPage.cxx @@ -10,12 +10,12 @@ #include "Bindings.hxx" #include "GlobalBindings.hxx" #include "charset.hxx" -#include "mpdclient.hxx" #include "FileListPage.hxx" #include "filelist.hxx" #include "dialogs/TextInputDialog.hxx" #include "ui/TextListRenderer.hxx" #include "lib/fmt/ToSpan.hxx" +#include "client/mpdclient.hxx" #include "util/StringAPI.hxx" #include diff --git a/src/SongPage.cxx b/src/SongPage.cxx index 9930ebc6..e47323b0 100644 --- a/src/SongPage.cxx +++ b/src/SongPage.cxx @@ -8,11 +8,11 @@ #include "screen.hxx" #include "charset.hxx" #include "time_format.hxx" -#include "mpdclient.hxx" #include "page/ListPage.hxx" #include "ui/ListText.hxx" #include "ui/TextListRenderer.hxx" #include "lib/fmt/ToSpan.hxx" +#include "client/mpdclient.hxx" #include "util/LocaleString.hxx" #include "util/StringAPI.hxx" #include "util/StringStrip.hxx" diff --git a/src/TagListPage.cxx b/src/TagListPage.cxx index 24b6a031..9fb3cab8 100644 --- a/src/TagListPage.cxx +++ b/src/TagListPage.cxx @@ -7,8 +7,8 @@ #include "Command.hxx" #include "i18n.h" #include "charset.hxx" -#include "mpdclient.hxx" #include "page/FindSupport.hxx" +#include "client/mpdclient.hxx" #include "util/StringUTF8.hxx" #include diff --git a/src/callbacks.cxx b/src/callbacks.cxx index 46345ee1..6a16823b 100644 --- a/src/callbacks.cxx +++ b/src/callbacks.cxx @@ -4,9 +4,9 @@ #include "callbacks.hxx" #include "screen.hxx" #include "screen_status.hxx" -#include "mpdclient.hxx" #include "ncmpc.hxx" #include "ui/Bell.hxx" +#include "client/mpdclient.hxx" #include diff --git a/src/aconnect.cxx b/src/client/aconnect.cxx similarity index 100% rename from src/aconnect.cxx rename to src/client/aconnect.cxx diff --git a/src/aconnect.hxx b/src/client/aconnect.hxx similarity index 100% rename from src/aconnect.hxx rename to src/client/aconnect.hxx diff --git a/src/gidle.cxx b/src/client/gidle.cxx similarity index 100% rename from src/gidle.cxx rename to src/client/gidle.cxx diff --git a/src/gidle.hxx b/src/client/gidle.hxx similarity index 100% rename from src/gidle.hxx rename to src/client/gidle.hxx diff --git a/src/client/meson.build b/src/client/meson.build new file mode 100644 index 00000000..165faea7 --- /dev/null +++ b/src/client/meson.build @@ -0,0 +1,33 @@ +libmpdclient_dep = dependency('libmpdclient', version: '>= 2.16') + +client_sources = [ + 'gidle.cxx', + 'mpdclient.cxx', +] + +if async_connect + client_sources += [ + '../net/SocketError.cxx', + '../net/AsyncResolveConnect.cxx', + '../event/net/ConnectSocket.cxx', + 'aconnect.cxx', + ] +endif + +client = static_library( + 'client', + client_sources, + include_directories: inc, + dependencies: [ + libmpdclient_dep, + event_dep, + ], +) + +client_dep = declare_dependency( + link_with: client, + dependencies: [ + libmpdclient_dep, + event_dep, + ], +) diff --git a/src/mpdclient.cxx b/src/client/mpdclient.cxx similarity index 100% rename from src/mpdclient.cxx rename to src/client/mpdclient.cxx diff --git a/src/mpdclient.hxx b/src/client/mpdclient.hxx similarity index 100% rename from src/mpdclient.hxx rename to src/client/mpdclient.hxx diff --git a/src/db_completion.cxx b/src/db_completion.cxx index 20689a5e..e9347cfd 100644 --- a/src/db_completion.cxx +++ b/src/db_completion.cxx @@ -4,7 +4,7 @@ #include "db_completion.hxx" #include "Completion.hxx" #include "charset.hxx" -#include "mpdclient.hxx" +#include "client/mpdclient.hxx" #include "util/ScopeExit.hxx" #include diff --git a/src/player_command.cxx b/src/player_command.cxx index 10c013ab..a167dbfa 100644 --- a/src/player_command.cxx +++ b/src/player_command.cxx @@ -4,11 +4,11 @@ #include "player_command.hxx" #include "DelayedSeek.hxx" #include "Command.hxx" -#include "mpdclient.hxx" #include "Options.hxx" #include "i18n.h" #include "screen_client.hxx" #include "screen_status.hxx" +#include "client/mpdclient.hxx" bool handle_player_command(struct mpdclient &c, DelayedSeek &seek, Command cmd) diff --git a/src/save_playlist.cxx b/src/save_playlist.cxx index c126a0a5..e5e8b65c 100644 --- a/src/save_playlist.cxx +++ b/src/save_playlist.cxx @@ -7,12 +7,12 @@ #include "config.h" // IWYU pragma: keep #include "i18n.h" #include "charset.hxx" -#include "mpdclient.hxx" #include "Completion.hxx" #include "screen.hxx" #include "screen_utils.hxx" #include "dialogs/TextInputDialog.hxx" #include "dialogs/YesNoDialog.hxx" +#include "client/mpdclient.hxx" #include "co/InvokeTask.hxx" #include diff --git a/src/screen.cxx b/src/screen.cxx index bbdb062b..77d29082 100644 --- a/src/screen.cxx +++ b/src/screen.cxx @@ -8,7 +8,6 @@ #include "Command.hxx" #include "config.h" #include "i18n.h" -#include "mpdclient.hxx" #include "Options.hxx" #include "DelayedSeek.hxx" #include "player_command.hxx" @@ -21,6 +20,7 @@ #include "dialogs/TextInputDialog.hxx" #include "ui/Options.hxx" #include "co/Task.hxx" +#include "client/mpdclient.hxx" #include "util/ScopeExit.hxx" #include "util/StringAPI.hxx" diff --git a/src/screen_client.cxx b/src/screen_client.cxx index 35745a0c..1027f2dd 100644 --- a/src/screen_client.cxx +++ b/src/screen_client.cxx @@ -3,7 +3,7 @@ #include "screen_client.hxx" #include "screen_status.hxx" -#include "mpdclient.hxx" +#include "client/mpdclient.hxx" #include "i18n.h" #include "charset.hxx"