Skip to content

Commit 83f25b9

Browse files
committed
deadbeef: allow building without support for legacy artwork plugin
1 parent 3a9bad7 commit 83f25b9

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
set(DEADBEEF_ARTWORK_LEGACY ON)
12
set(DEADBEEF_INCLUDE_DIRS ${EXTLIB_INSTALL_DIR}/include)

cpp/extlibs/deadbeef/system/FindDeadbeef.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
set(DEADBEEF_ARTWORK_LEGACY OFF)
2+
13
find_path(
24
DEADBEEF_INCLUDE_DIRS
35
NAMES deadbeef/deadbeef.h

cpp/server/deadbeef/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include_directories(
77
set(
88
PLUGIN_SOURCES
99
add_items_scope.cpp add_items_scope.hpp
10-
artwork_fetcher_v1.cpp artwork_fetcher_v2.cpp artwork_fetcher.hpp
10+
artwork_fetcher_v2.cpp artwork_fetcher.hpp
1111
common.cpp common.hpp
1212
player.hpp
1313
player_control.cpp
@@ -19,6 +19,16 @@ set(
1919
utils.cpp utils.hpp
2020
)
2121

22+
if(DEADBEEF_ARTWORK_LEGACY)
23+
add_definitions(-DDEADBEEF_ARTWORK_LEGACY)
24+
25+
set(
26+
PLUGIN_SOURCES
27+
${PLUGIN_SOURCES}
28+
artwork_fetcher_v1.cpp
29+
)
30+
endif()
31+
2232
add_library(
2333
deadbeef_plugin MODULE
2434
${PLUGIN_SOURCES}

cpp/server/deadbeef/artwork_fetcher.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ class ArtworkFetcher
1313

1414
virtual boost::unique_future<ArtworkResult> fetchArtwork(PlaylistPtr playlist, PlaylistItemPtr item) = 0;
1515

16+
#ifdef DEADBEEF_ARTWORK_LEGACY
1617
static std::unique_ptr<ArtworkFetcher> createV1();
18+
#endif
19+
1720
static std::unique_ptr<ArtworkFetcher> createV2();
1821
};
1922

cpp/server/deadbeef/player_misc.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ void PlayerImpl::connect()
8282

8383
artworkFetcher_ = ArtworkFetcher::createV2();
8484

85+
#ifdef DEADBEEF_ARTWORK_LEGACY
8586
if (!artworkFetcher_)
8687
{
8788
artworkFetcher_ = ArtworkFetcher::createV1();
8889
}
90+
#endif
8991
}
9092

9193
void PlayerImpl::disconnect()

0 commit comments

Comments
 (0)