diff --git a/CMakeLists.txt b/CMakeLists.txt index c374eb6..e0b89e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,12 +63,13 @@ execute_process( ) add_subdirectory(discord-rpc) INCLUDE_DIRECTORIES(discord-rpc/include) +target_link_libraries(KittehPlayer discord-rpc) endif(DISCORD) add_executable(KittehPlayer ${SOURCES} ${qml_QRC}) # Use the Qml/Quick modules from Qt 5. -target_link_libraries(KittehPlayer ${MPV_LIBRARIES} ${X11_LIBRARIES} ${Xext_LIBRARIES} Qt5::X11Extras discord-rpc) +target_link_libraries(KittehPlayer ${MPV_LIBRARIES} ${X11_LIBRARIES} ${Xext_LIBRARIES} Qt5::X11Extras) qt5_use_modules(KittehPlayer Qml Quick Core Gui Widgets X11Extras) diff --git a/src/MpvPlayerBackend.cpp b/src/MpvPlayerBackend.cpp index 9525c38..cc13ced 100644 --- a/src/MpvPlayerBackend.cpp +++ b/src/MpvPlayerBackend.cpp @@ -279,6 +279,11 @@ void MpvPlayerBackend::loadFile(const QVariant& filename) command(QVariantList() << "loadfile" << filename); } +void MpvPlayerBackend::appendFile(const QVariant& filename) +{ + command(QVariantList() << "loadfile" << filename << "append-play"); +} + void MpvPlayerBackend::setVolume(const QVariant& volume) { command(QVariantList() << "set" diff --git a/src/MpvPlayerBackend.h b/src/MpvPlayerBackend.h index 96accd1..1acc9fd 100644 --- a/src/MpvPlayerBackend.h +++ b/src/MpvPlayerBackend.h @@ -57,6 +57,7 @@ public slots: void setVolume(const QVariant& volume); void addVolume(const QVariant& volume); void loadFile(const QVariant& filename); + void appendFile(const QVariant& filename); void seek(const QVariant& seekTime); void seekAbsolute(const QVariant& seekTime); void command(const QVariant& params); diff --git a/src/qml/main.qml b/src/qml/main.qml index 5be1228..84b91e4 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -115,7 +115,7 @@ ApplicationWindow { } } else { - player.loadFile(argument) + player.appendFile(argument) } } }