Commit graph

27 commits

Author SHA1 Message Date
Krut Patel
f2e506e059 mpris-remote: Support for fetching album art
Implementation of sending album art from phone to PC.

Complementary MR for the android side: https://invent.kde.org/network/kdeconnect-android/-/merge_requests/353

Fixes: https://bugs.kde.org/show_bug.cgi?id=422136
2024-07-31 16:39:28 +00:00
Alexander Lohnau
69d6c17214 plugins: Use QLatin1String::arg for faster and simpler string concatination
Using an infix with .arg() is simpler than having two string literals
2023-08-28 17:20:46 +00:00
Alexander Lohnau
c5e7fdb5e4 plugins: Prefer using statements with baseclass over empty constructor
Those plugins re really simple and don't need any initialization logic.
With the using statement, we do not need to add a constructor and pass the parent/args to the baseclass
2023-08-07 19:28:37 +02:00
Alexander Lohnau
1631ada5b3 Simplify KDEConnectPlugin::recievePacket
- We do not need the return type. If a plugin declares it can handle the
  packet it should do so. We don't have any fallback logic in place and
  the packet types are namespaced with the plugin IDs anyway.

- Provide a default implementation with a warning, not all plugins need
  to overwrite this
2023-08-03 20:49:44 +02:00
Alexander Lohnau
2e67f95017 Add explicit moc includes to cpp files
The rationale is explained in https://planet.kde.org/friedrich-kossebau-2023-06-28-include-also-moc-files-of-headers/

In case of KDEConnect, it impressively speeds up compilation. Before it
took 390 seconds on a clean build and with this change it took 330 seconds.
This is due to the mocs_compilation having to include the header files
and thus all their headers. Due to the lots of small plugins we have,
this means that the same headers must be compiled plenty of times.
When we include the moc files directly in the C++ file, they are already
available.
2023-07-30 07:27:45 +00:00
Alexander Lohnau
0b99c3a637 Remove unneeded destructors from plugins
We already have a destructor from the baseclass and don't need to clean
up any resources in the affected plugins
2023-07-22 16:01:21 +02:00
Albert Vaca Cintora
2e0550651e Remove mpris "nowPlaying" field
We've had separate title & artist for a while, and all clients should be
using those by now.

Also fixes the position change not being emitted when the song changes,
and fixes the values being written after emitting that they changed.
2023-06-08 21:58:58 +00:00
Nicolas Fella
a918ffc0cb Add and make use of ECM's clang-format integration 2022-09-11 23:21:58 +00:00
Nicolas Fella
87db95b22f Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00
Antonio Larrosa
1d36164230 Use ecm_qt_declare_logging_category to declare the logging categories
This automatizes the generation of logging categories so a
kdeconnect-kde.categories is generated and installed to
/usr/share/qlogging-categories5/ so kdebugsettings can use it.

Also, sets the default logging level to Warning. So now the logs
of users won't be filled with debug messages but they can
modify the configuration easily with kdebugsettings.
2020-05-26 18:55:47 +02:00
Matthijs Tijink
f7b7cdbfd5 Adds an MPRIS server for controlling other device's MPRIS services
By creating a DBus connection per player, we are able to support
multiple remote players.

The album art is not yet supported.
2020-03-15 22:38:03 +00:00
Nicolas Fella
749dcfa148 [app/mpris] Support non-seekable players 2019-07-17 21:19:53 +00:00
Nicolas Fella
5c16bfda5d Use K_PLUGIN_CLASS_WITH_JSON 2019-06-12 22:16:54 +02:00
Nicolas Fella
e601755644 Force usage of QStringLiteral and port remaining offenders 2019-06-10 14:40:28 +00:00
Nicolas Fella
0ff45fdf49 Use QMap::firstKey() 2019-05-05 16:03:02 +02:00
Nicolas Fella
3b8fedea1a Replace http GNU urls with https 2019-03-23 17:29:26 +01:00
Nicolas Fella
47e39ef55a [plugins/mprisremote] Don't link against KI18n 2019-03-11 19:09:00 +01:00
Nicolas Fella
72610654fc Fix crash in mprisremote when data for an unknown player arrives 2019-02-01 22:31:26 +00:00
Nicolas Fella
88d0e72667 Request status when connecting
Summary:
Send requestNowPlaying packet when a player is discovered
Depends on D12546

Test Plan: Restart daemon, open app. Status is now displayed correctly, previously it was not until the first update

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12550
2018-04-28 00:23:52 +02:00
Nicolas Fella
1b622de1f1 Support multiple players in MprisRemote
Summary: Current code only supports one player

Test Plan: Run two media sessions. Dbus inspection works fine, UI has some issues with values not updated, but out of scope for this diff

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: apol, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12546
2018-04-28 00:22:58 +02:00
Albert Vaca
f47f517827 Rename NetworkPackage -> NetworkPacket
Summary: KDE Connect, now with correct naming!

Test Plan: It still builds.

Reviewers: #kde_connect, apol, nicolasfella

Reviewed By: #kde_connect, apol, nicolasfella

Subscribers: nicolasfella

Differential Revision: https://phabricator.kde.org/D11036
2018-03-05 20:03:23 +01:00
Aleix Pol
3734d6ce4d Reduce API exposed through dbus
Summary:
Don't use QDBusConnection::ExportAllContents
No need to make connect and receivedPackage public slots (they're are the
parent's already)

Fixes T4975

Test Plan: Rough manual test

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Maniphest Tasks: T4975

Differential Revision: https://phabricator.kde.org/D3871
2017-01-10 18:15:01 +01:00
Albert Vaca
60331ccbf1 Clazy says all this QStringLiteral and QLatin1String were missing/wrong 2016-11-26 16:21:29 +01:00
Aleix Pol
f9406e8afc Introduce QVariantMap as an argument of NetworkPackage
Makes it possible to specify the different properties sent at once,
rather than one by one as we used to do.

Also port whenever possible to the initializer-list syntax.

REVIEW: 128269
2016-06-21 20:07:12 +02:00
Aleix Pol
588c956191 We don't receive requests in the mprisremote plugin 2016-06-06 01:21:37 +02:00
Aleix Pol
e7578cc129 Refactor capabilities together with Albert
He is committing a similar patch to kdeconnect-android
2016-05-31 17:16:01 +02:00
Aleix Pol
5c79e8a7a6 Implement an MPRIS client plugin
Makes it possible to control remote MPRIS instances.

REVIEW: 124100
2015-06-18 04:01:01 +02:00