117 Commits

Author SHA1 Message Date
Craig Drummond
b6bd94c236 Update (c) year 2022-01-08 21:24:07 +00:00
Craig Drummond
b65b182629 Misc fixes - taken from https://github.com/fenuks/cantata 2021-12-27 17:05:24 +00:00
Craig Drummond
11bb7571c9 Update (c) year 2021-01-01 10:06:43 +00:00
Thomas Uhle
1d25d0dbfc Use QGuiApplication::applicationDisplayName() as application name
Using a consistent spelling of the application name (w.r.t. case-sensitivity)
whenever communicating with the desktop environment is common practice to
always have the same name displayed (as window title, in a window switcher
dialog, etc.). That is also what already has been done in Notify::show().
2020-06-06 18:55:36 +02:00
Thomas Uhle
9f5e3bfa33 Additionally call Inhibit() from org.freedesktop.login1.Manager
to also support desktop environments that do not provide
org.freedesktop.PowerManagement.Inhibit (newer GNOME releases for instance).
2020-06-06 18:30:05 +02:00
Thomas Uhle
4599a49484 Fix bus name of freedesktop.org's power management
While the interface name truely is 'org.freedesktop.PowerManagement.Inhibit',
its bus name is yet just 'org.freedesktop.PowerManagement'.
2020-06-06 18:00:16 +02:00
Thomas Uhle
0df2710b9e Fix enabling of play queue navigation actions 'next' and 'previous'
To enable or disable 'next' action, just rely on MPD's status value
'nextSongId'. Enable 'previous' action when there is more than one item in
the play queue or one item for which its duration is known and this is more
than 5 seconds. That is to also support the feature to go to the start of a
track if already played 5 seconds of it at least (which was introduced in
version 2.4.0). Corresponding implementation of Mpris and ThumbnailToolBar
updated accordingly.
2020-05-30 17:00:12 +02:00
Thomas Uhle
020ef1f956 Trigger MPRIS status update when connection to MPD lost
- Also propagate status update to MPRIS interface similar to what has been
  done in commit 5dd0942066.
  The probably simplest solution is to call Mpris::updateStatus() always
  when MainWindow::updateStatus() is called.
- Check for valid song ID in Mpris::CanPause() to return false if
  connection to MPD has been lost.
2020-05-15 15:45:23 +02:00
Thomas Uhle
9acee0d50c Synchronize update of current song details and status of MPRIS interface
- Trigger MPRIS status update if current song is updated a little too late.
- Skip MPRIS status update if current song has not yet been updated.
2020-05-15 13:00:27 +02:00
Thomas Uhle
4263744926 Avoid unknown song durations and duplicate updates of MPRIS' song details
- Move call to Mpris::updateCurrentSong() downwards to pick up the potential
  update of current song's duration from MPD's total time value (introduced
  by commit 1a38e468b7) and to avoid duplicate
  notifications (cf. commit bba9cfd880).
- Update MPRIS status value CanSeek when MPD's total time changes.
- Set MPDStatusValues::timeElapsed and MPDStatusValues::timeTotal to 0
  instead of -1 by default because the latter yields 65535 as these
  variables are 16 bit unsigned integer.
2020-05-15 12:44:55 +02:00
Thomas Uhle
6c89271ac5 MPRIS interface: fix LoopStatus getter and setter
Also take into account whether MPD's single state is set or should
be updated.
2020-05-07 12:00:16 +02:00
Thomas Uhle
f0a1ae8b1c MPRIS interface: fix CanPlay/CanPause status update
Re-enable status update of CanPlay/CanPause and let Mpris::CanPlay()
only return true if the play queue is non-empty and so just let
Mpris::CanPause() return true unless MPD's state equals 'stopped'.
2020-05-05 22:36:56 +02:00
Thomas Uhle
530d907240 MPRIS interface: fix if condition for CanSeek status update
Update status of CanSeek after switching to another item in the play
queue but not if MPD's state is changing.
2020-05-05 22:36:11 +02:00
Craig Drummond
b8645d1358 Fix most, but not all, deprecation warnings. 2020-02-16 09:51:37 +00:00
Craig Drummond
d7b3965b9b Update (c) year 2020-01-01 11:51:13 +00:00
Craig Drummond
cb9efe205f Update (c) year 2019-09-15 15:56:58 +01:00
Kai Uwe Broulik
139e0b8713 Set low urgency hint for notifications and send along desktop entry
Allows the notification server to better identify where the notification comes from and that
it is a non-important notification that shouldn't e.g. clutter up the notification backlog.
Moreover, according to freedesktop Notifications spec the "appName" is a user-visible
name, so use applicationDisplayName for it.
2019-04-17 12:36:22 +02:00
Craig Drummond
087d5a1223 Fix greyscale images in notifications.
Issue #1447
2019-02-06 18:30:37 +00:00
Craig Drummond
ed947e2052 Encode ampersands
Closes #1439
2019-01-24 21:32:40 +00:00
Craig Drummond
9d9089c67f MPRIS seeks command specifies an offset from current position.
Closes #1417
2018-12-09 20:38:21 +00:00
Craig Drummond
eff0e66d39 Use AUTOMOC 2018-03-07 19:04:14 +00:00
Craig Drummond
96af98b5cb Use qlonglong for Position
Issue #1227
2018-03-01 23:42:28 +00:00
padertux
4f26eb686e Refactor code to use C++11 nullptr 2018-01-08 23:01:25 +01:00
padertux
dc8cbed1eb Refactor code to use C++11 overriding 2018-01-08 22:51:48 +01:00
Craig Drummond
2139d3dbb8 Update (c) year 2018-01-01 10:11:39 +00:00
Craig Drummond
33e1800f39 Fix MPRIS length field.
Issue #1119
2017-11-10 23:38:52 +00:00
Craig Drummond
003cc3889a MPRIS: Fix updating of can go next/previous 2017-09-08 18:59:11 +01:00
Craig Drummond
554d41783e Set correct mpris:trackid
Issue #1082
2017-09-08 18:51:54 +01:00
Craig Drummond
fe8a736947 To support older GNOME settings daemon installations, if fail to use the
new MediaKeys DBUS interface the use the previous.
2017-09-02 18:01:12 +01:00
Craig Drummond
ae47e34bc6 To support alder GNOME settings daemon installations, revert to the
previous MediaKeys DBUS interface.
Issue #1060
2017-08-15 12:07:57 +01:00
Craig Drummond
c2032575e5 Fix CanSeek
Issue #1034
2017-06-22 21:07:51 +01:00
Craig Drummond
665b2acbcc Don't always return true for CanSeek, CanGoNext, CanGoPrevious. There
was a reason for this, but I can't remember...
Issue #1034
2017-06-21 22:48:02 +01:00
Craig Drummond
b2f17f3066 Use newly correct MediaKeys dbus service name -
org.gnome.SettingsDaemon.MediaKeys
Issue #1010
2017-04-26 18:08:52 +01:00
Craig Drummond
ed83208630 Make all of Cantata's internal actions accessible via DBUS. These can
then be used to bind to global shortcuts.

Issues #1007 #1009
2017-04-22 11:56:46 +01:00
Craig Drummond
3348c7b545 No longer used 2017-04-22 11:16:35 +01:00
Craig Drummond
05dd63f984 Show more radio stream data in MPRIS
Issue #1005
2017-04-20 18:07:46 +01:00
Craig Drummond
b63c6fbe26 Use Qt5's translation framework - ts files, not po files. 2017-04-08 10:35:31 +01:00
Craig Drummond
0a73215867 Update (c) year 2017-04-02 18:45:30 +01:00
Craig Drummond
a517bf4f17 Remove KDE4 and Ubuntu Touch support 2017-04-01 22:55:27 +01:00
Craig Drummond
eaca1f34f3 When listing albums where composer is used for artist grouping, place album artist name after album name if different from composer.
Issue #896
2016-10-16 22:33:41 +01:00
Craig Drummond
63a5208b6d CanPause, Play, etc, never change - so no need to add to notification 2016-07-03 22:48:25 +01:00
Craig Drummond
0e5c172671 Always return true for MPRIS CanPlay, CanPause, etc. 2016-07-02 16:09:44 +01:00
Craig Drummond
705648420a Update (c) year 2016-01-08 18:55:13 +00:00
Craig Drummond
9533f12881 Update (c) year 2015-08-13 21:12:34 +01:00
Craig Drummond
9215b4bdf5 Add option to disable MPRIS interface.
#707
2015-07-25 18:07:15 +01:00
Craig Drummond
a048f62137 Use mpd.cantata as DBus service name. 2015-04-25 15:23:28 +01:00
craig.p.drummond
93b70ec240 Rename mpd source folder to mpd-interface to help build errors when libmpdclient(?) is also installed.
BUG: 650
2015-03-16 19:18:52 +00:00
craig.p.drummond
fe45cefb5b Add 'setCollection' to Cantata's DBUS interface.
BUG: 634
2015-02-25 18:24:22 +00:00
craig.p.drummond
190670a986 For Linux non-KDE builds, use login1 interface to detect system resuming. 2015-02-04 21:59:29 +00:00
craig.p.drummond
e9505ae2c0 Connect MPRIS stopAfterCurrent signal to correct action. 2014-10-01 11:03:32 +00:00