Commit graph

21 commits

Author SHA1 Message Date
Alexander Lohnau
dc8f3e209e Reformat project with clang-format 2023-12-02 14:56:20 +01:00
Albert Vaca Cintora
5a27c93538 Windows MPRIS: Add a "default player" entry
This sends generic multimedia keyboard events, since the implementation
using GlobalSystemMediaTransportControlsSessionManager had some problems:
the SessionsChanged event doesn't work on recent Windows versions,
plus many players don't implement this API (eg: VLC, Windows Media).
2023-08-28 17:31:26 +00:00
Alexander Lohnau
ed1e24d231 kdeconnect_add_plugin: Autogenerate logging category
This is far less code and allows for an easier enforcing of standards, for
example the name of the log identifiers which were adjusted in a few cases.

Also clean up unused includes when noticed.
2023-08-07 19:47:41 +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
Albert Vaca Cintora
6e8abd75e8 Do not use optionals when they are not needed 2023-07-25 17:22:20 +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
Willyanto Willyanto
29f56dcc29 Perform initialization in initialization list
Fixes variable is assigned in constructor body. Consider performing
initialization in initialization list. (CWE-398)
2022-12-22 23:24:31 +07:00
Nicolas Fella
a918ffc0cb Add and make use of ECM's clang-format integration 2022-09-11 23:21:58 +00:00
Piyush Aggarwal
d71af0134e mpriscontrolplugin-win: add nullptr check for autoRepeatMode and isShuffleActive 2021-06-24 15:29:43 +05:30
Piyush Aggarwal
ee19722eea mpriscontrolplugin-win: add support for loopStatus and shuffle control 2021-06-22 10:43:34 +05:30
Piyush Aggarwal
a59ea0e9b8 mpriscontrolplugin-win: send -1 volume to show per-app volume control is not supported 2021-06-22 08:17:23 +05:30
Piyush Aggarwal
a6de73d437 add compilation check for WIN_SDK_VERSION 2021-06-15 18:06:03 +05:30
Piyush Aggarwal
d11f15a3e6 mpriscontrolplugin: resolve AUMID to display name of the media app when possible 2021-06-15 17:17:52 +05:30
Nicolas Fella
87db95b22f Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00
Jun Bo Bi
4c011458c2 Add real support for mpriscontrol on Windows 2020-05-31 15:50:56 -04: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
Yuri Chornoivan
01c4d0411b Fix minor EBN issues 2019-12-22 09:49:55 +02:00
Nicolas Fella
7bdfd3863a Remove trailing whitespace 2019-06-12 22:17:16 +02:00
Nicolas Fella
5c16bfda5d Use K_PLUGIN_CLASS_WITH_JSON 2019-06-12 22:16:54 +02:00
Jun Bo Bi
f4c7e12ea6 [mpriscontrol] add primitive windows support
Summary: Added primitive support for the mpriscontrol plugin on Windows by simulating VK_MEDIA key presses. I took a look into `ISystemMediaTransportControls`, but there doesn't seem to query it since it's per app. Leaving simulating key presses our only option for now. Completes T10000

Reviewers: kdeconnect, #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka

Tags: #kde_connect, #windows

Maniphest Tasks: T10000

Differential Revision: https://phabricator.kde.org/D17702
2018-12-21 19:24:06 +01:00