2020-10-25 23:14:46 +00:00
|
|
|
project(jellyfin-qt VERSION 0.1.0)
|
2020-10-25 18:58:02 +00:00
|
|
|
find_package(Qt5 5.6 COMPONENTS Multimedia Network Qml WebSockets REQUIRED)
|
2021-08-30 23:29:51 +00:00
|
|
|
|
|
|
|
if (FREEDESKTOP_INTEGRATION)
|
2021-09-02 13:34:32 +00:00
|
|
|
find_package(Qt5 5.6 COMPONENTS DBus REQUIRED)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (USE_MLITE)
|
|
|
|
find_package(mlite5 REQUIRED)
|
2021-08-30 23:29:51 +00:00
|
|
|
endif()
|
|
|
|
|
2020-10-25 18:58:02 +00:00
|
|
|
include(GNUInstallDirs)
|
2021-02-20 23:26:18 +00:00
|
|
|
include(GeneratedSources.cmake)
|
|
|
|
|
2021-03-24 19:04:03 +00:00
|
|
|
set(JellyfinQt_SOURCES
|
2022-12-28 20:20:04 +00:00
|
|
|
src/model/controllablesession.cpp
|
2021-03-28 02:00:00 +00:00
|
|
|
src/model/deviceprofile.cpp
|
2021-03-20 15:29:31 +00:00
|
|
|
src/model/item.cpp
|
core: Split PlaybackManager up into smaller parts
The PlaybackManager was a giant class that handled UI bindings, fetching
stream URLS, playback logic.
It now has been split up into:
- ViewModel::PlaybackManager, which handles UI interfacing and allowing
to swap out the Model::Playback implementation on the fly.
- Model::PlaybackManager, which is an interface for what a
PlaybackManager must do, handling queues/playlists, and controlling a
player.
- Model::LocalPlaybackManager, which is an Model::PlaybackManager
implementation for playing back Jellyfin media within the application.
- Model::PlaybackReporter, which reports the current playback state to
the Jellyfin server, for keeping track of played items.
- Model::Player, which handles playing back media from an URL and
the usual play/pause et cetera.
In a future commit, this would allow for introducing a
Model::RemoteJellyfinPlaybackManager, to control other Jellyfin
instances.
2022-01-05 20:24:52 +00:00
|
|
|
src/model/player.cpp
|
|
|
|
src/model/playbackmanager.cpp
|
|
|
|
src/model/playbackreporter.cpp
|
2021-05-21 13:46:30 +00:00
|
|
|
src/model/playlist.cpp
|
2022-12-28 20:20:04 +00:00
|
|
|
src/model/remotejellyfinplayback.cpp
|
2021-07-31 13:06:17 +00:00
|
|
|
src/model/shuffle.cpp
|
2021-08-17 22:04:27 +00:00
|
|
|
src/model/user.cpp
|
2021-07-31 13:06:17 +00:00
|
|
|
|
2021-03-20 15:29:31 +00:00
|
|
|
src/support/jsonconv.cpp
|
2021-03-05 14:34:10 +00:00
|
|
|
src/support/loader.cpp
|
2021-07-31 13:06:17 +00:00
|
|
|
src/support/parseexception.cpp
|
2021-03-24 19:04:03 +00:00
|
|
|
src/viewmodel/item.cpp
|
2021-03-26 20:27:35 +00:00
|
|
|
src/viewmodel/itemmodel.cpp
|
2021-03-24 19:04:03 +00:00
|
|
|
src/viewmodel/loader.cpp
|
2021-08-22 23:46:57 +00:00
|
|
|
src/viewmodel/mediastream.cpp
|
2021-03-29 12:27:37 +00:00
|
|
|
src/viewmodel/modelstatus.cpp
|
2021-03-24 19:04:03 +00:00
|
|
|
src/viewmodel/playbackmanager.cpp
|
2021-05-21 13:46:30 +00:00
|
|
|
src/viewmodel/playlist.cpp
|
2022-12-28 20:20:04 +00:00
|
|
|
src/viewmodel/remotedevice.cpp
|
2021-09-02 13:34:32 +00:00
|
|
|
src/viewmodel/settings.cpp
|
2021-08-11 21:35:33 +00:00
|
|
|
src/viewmodel/userdata.cpp
|
2021-08-17 22:04:27 +00:00
|
|
|
src/viewmodel/usermodel.cpp
|
|
|
|
src/viewmodel/user.cpp
|
2021-02-17 18:42:10 +00:00
|
|
|
src/apiclient.cpp
|
|
|
|
src/apimodel.cpp
|
|
|
|
src/credentialmanager.cpp
|
2021-03-24 19:04:03 +00:00
|
|
|
src/eventbus.cpp
|
2021-02-17 18:42:10 +00:00
|
|
|
src/jellyfin.cpp
|
|
|
|
src/jsonhelper.cpp
|
2021-09-02 13:34:32 +00:00
|
|
|
src/qobjectsettingswrapper.cpp
|
2021-02-17 18:42:10 +00:00
|
|
|
src/serverdiscoverymodel.cpp
|
|
|
|
src/websocket.cpp)
|
2020-10-25 18:58:02 +00:00
|
|
|
|
2021-03-24 19:04:03 +00:00
|
|
|
list(APPEND JellyfinQt_SOURCES ${openapi_SOURCES})
|
2021-02-20 23:26:18 +00:00
|
|
|
|
2021-03-24 19:04:03 +00:00
|
|
|
set(JellyfinQt_HEADERS
|
2022-12-28 20:20:04 +00:00
|
|
|
include/JellyfinQt/model/controllablesession.h
|
|
|
|
include/JellyfinQt/model/deviceprofile.h
|
|
|
|
include/JellyfinQt/model/item.h
|
|
|
|
include/JellyfinQt/model/player.h
|
|
|
|
include/JellyfinQt/model/playbackmanager.h
|
|
|
|
include/JellyfinQt/model/playbackreporter.h
|
|
|
|
include/JellyfinQt/model/playlist.h
|
|
|
|
include/JellyfinQt/model/remotejellyfinplayback.h
|
|
|
|
include/JellyfinQt/model/shuffle.h
|
|
|
|
include/JellyfinQt/model/user.h
|
|
|
|
include/JellyfinQt/support/jsonconv.h
|
|
|
|
include/JellyfinQt/support/jsonconvimpl.h
|
|
|
|
include/JellyfinQt/support/loader.h
|
|
|
|
include/JellyfinQt/support/parseexception.h
|
|
|
|
include/JellyfinQt/viewmodel/item.h
|
|
|
|
include/JellyfinQt/viewmodel/itemmodel.h
|
|
|
|
include/JellyfinQt/viewmodel/loader.h
|
|
|
|
include/JellyfinQt/viewmodel/mediastream.h
|
|
|
|
include/JellyfinQt/viewmodel/modelstatus.h
|
|
|
|
include/JellyfinQt/viewmodel/propertyhelper.h
|
|
|
|
include/JellyfinQt/viewmodel/playbackmanager.h
|
|
|
|
include/JellyfinQt/viewmodel/platformmediacontrol.h
|
|
|
|
include/JellyfinQt/viewmodel/playlist.h
|
|
|
|
include/JellyfinQt/viewmodel/remotedevice.h
|
|
|
|
include/JellyfinQt/viewmodel/settings.h
|
|
|
|
include/JellyfinQt/viewmodel/userdata.h
|
|
|
|
include/JellyfinQt/viewmodel/usermodel.h
|
|
|
|
include/JellyfinQt/viewmodel/user.h
|
|
|
|
include/JellyfinQt/viewmodel/utils.h
|
|
|
|
include/JellyfinQt/apiclient.h
|
|
|
|
include/JellyfinQt/apimodel.h
|
|
|
|
include/JellyfinQt/credentialmanager.h
|
|
|
|
include/JellyfinQt/eventbus.h
|
|
|
|
include/JellyfinQt/jellyfin.h
|
|
|
|
include/JellyfinQt/jsonhelper.h
|
|
|
|
include/JellyfinQt/qobjectsettingswrapper.h
|
|
|
|
include/JellyfinQt/serverdiscoverymodel.h
|
|
|
|
include/JellyfinQt/websocket.h)
|
2021-08-30 23:29:51 +00:00
|
|
|
|
|
|
|
if (FREEDESKTOP_INTEGRATION)
|
|
|
|
list(APPEND JellyfinQt_SOURCES
|
|
|
|
src/platform/freedesktop/mediaplayer2.cpp
|
|
|
|
src/platform/freedesktop/mediaplayer2player.cpp
|
|
|
|
src/viewmodel/platformmediacontrol_freedesktop.cpp)
|
|
|
|
list(APPEND JellyfinQt_HEADERS
|
|
|
|
include/JellyfinQt/platform/freedesktop/mediaplayer2.h
|
|
|
|
include/JellyfinQt/platform/freedesktop/mediaplayer2player.h)
|
|
|
|
else()
|
|
|
|
list(APPEND JellyfinQt_SOURCES
|
|
|
|
src/viewmodel/platformmediacontrol_stub.cpp)
|
|
|
|
endif()
|
2021-02-20 23:26:18 +00:00
|
|
|
|
2021-03-28 02:00:00 +00:00
|
|
|
list(APPEND JellyfinQt_HEADERS ${openapi_HEADERS})
|
2020-10-25 18:58:02 +00:00
|
|
|
|
|
|
|
add_definitions(-DSAILFIN_VERSION=\"${SAILFIN_VERSION}\")
|
2021-03-28 02:00:00 +00:00
|
|
|
|
2021-02-17 01:28:37 +00:00
|
|
|
if (PLATFORM_SAILFISHOS)
|
|
|
|
add_definitions(-DPLATFORM_SAILFISHOS=1)
|
|
|
|
endif()
|
2021-03-28 02:00:00 +00:00
|
|
|
|
2021-09-02 13:34:32 +00:00
|
|
|
|
|
|
|
|
2021-09-04 20:23:54 +00:00
|
|
|
add_library(JellyfinQt ${JellyfinQt_SOURCES} ${JellyfinQt_HEADERS} qmldir JellyfinQt.qmltypes)
|
2021-03-28 02:00:00 +00:00
|
|
|
|
2021-02-21 04:02:05 +00:00
|
|
|
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
|
2021-03-29 15:10:25 +00:00
|
|
|
if(BUILD_PRECOMPILED_HEADERS)
|
|
|
|
target_precompile_headers(JellyfinQt PRIVATE ${JellyfinQt_HEADERS})
|
|
|
|
endif()
|
2021-02-21 04:02:05 +00:00
|
|
|
endif()
|
2021-03-28 02:00:00 +00:00
|
|
|
|
2021-03-24 19:04:03 +00:00
|
|
|
target_include_directories(JellyfinQt PUBLIC "include")
|
|
|
|
target_link_libraries(JellyfinQt PUBLIC Qt5::Core Qt5::Multimedia Qt5::Network Qt5::Qml Qt5::WebSockets)
|
2021-08-30 23:29:51 +00:00
|
|
|
|
|
|
|
if (FREEDESKTOP_INTEGRATION)
|
|
|
|
target_link_libraries(JellyfinQt PUBLIC Qt5::DBus)
|
|
|
|
endif()
|
2021-09-02 13:34:32 +00:00
|
|
|
|
|
|
|
if (USE_MLITE)
|
|
|
|
add_definitions(-DUSE_MLITE)
|
|
|
|
target_link_libraries(JellyfinQt PUBLIC mlite5::mlite5)
|
|
|
|
endif()
|
|
|
|
|
2021-03-24 19:04:03 +00:00
|
|
|
set_target_properties(JellyfinQt PROPERTIES CXX_VISIBILITY_PRESET default)
|
|
|
|
install(TARGETS JellyfinQt
|
2020-10-25 18:58:02 +00:00
|
|
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
|
|
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
|
|
|
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
|
|
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
|
|
|
2021-09-04 20:23:54 +00:00
|
|
|
add_custom_target(qmltypes
|
|
|
|
COMMAND qmlplugindump -nonrelocatable nl.netsoj.chris.Jellyfin 1.0 > $$PWD/JellyfinQt.qmltypes)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
TARGET JellyfinQt
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND} -E copy
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/qmldir
|
|
|
|
$<TARGET_FILE_DIR:JellyfinQt>/qmldir
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
TARGET JellyfinQt
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND} -E copy
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/JellyfinQt.qmltypes
|
|
|
|
$<TARGET_FILE_DIR:JellyfinQt>/JellyfinQt.qmltypes
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
set(QML_IMPORT_PATH $<TARGET_FILE_DIR:JellyfinQt> CACHE PATH "")
|
|
|
|
install(FILES $<TARGET_FILE_DIR:JellyfinQt>/qmldir DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
|
|
|
2021-03-24 19:04:03 +00:00
|
|
|
export(TARGETS JellyfinQt FILE JellyfinQtConfig.cmake)
|