=> 3d723de1022d2fdeccb9bae6f934e6936445ef21
[1mdiff --git a/src/audio/player.c b/src/audio/player.c[m [1mindex e0003168..77c23104 100644[m [1m--- a/src/audio/player.c[m [1m+++ b/src/audio/player.c[m [36m@@ -29,6 +29,7 @@[m [mSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */[m #include[m #include [m #include [m [32m+[m[32m#include [m [m #if defined (LAGRANGE_ENABLE_MPG123)[m # include [m [36m@@ -443,6 +444,7 @@[m [mstruct Impl_Player {[m float volume;[m int flags;[m iInputBuf * data;[m [32m+[m[32m uint32_t lastInteraction;[m iDecoder * decoder;[m };[m [m [36m@@ -695,12 +697,14 @@[m [miBool start_Player(iPlayer *d) {[m d->decoder = new_Decoder(d->data, &content);[m d->decoder->gain = d->volume;[m SDL_PauseAudioDevice(d->device, SDL_FALSE);[m [32m+[m[32m setNotIdle_Player(d);[m return iTrue;[m }[m [m void setPaused_Player(iPlayer *d, iBool isPaused) {[m if (isStarted_Player(d)) {[m SDL_PauseAudioDevice(d->device, isPaused ? SDL_TRUE : SDL_FALSE);[m [32m+[m[32m setNotIdle_Player(d);[m }[m }[m [m [36m@@ -720,10 +724,16 @@[m [mvoid setVolume_Player(iPlayer *d, float volume) {[m if (d->decoder) {[m d->decoder->gain = d->volume;[m }[m [32m+[m[32m setNotIdle_Player(d);[m }[m [m void setFlags_Player(iPlayer *d, int flags, iBool set) {[m iChangeFlags(d->flags, flags, set);[m [32m+[m[32m setNotIdle_Player(d);[m [32m+[m[32m}[m [32m+[m [32m+[m[32mvoid setNotIdle_Player(iPlayer *d) {[m [32m+[m[32m d->lastInteraction = SDL_GetTicks();[m }[m [m int flags_Player(const iPlayer *d) {[m [36m@@ -760,6 +770,10 @@[m [mfloat streamProgress_Player(const iPlayer *d) {[m return 0;[m }[m [m [32m+[m[32muint32_t idleTimeMs_Player(const iPlayer *d) {[m [32m+[m[32m return SDL_GetTicks() - d->lastInteraction;[m [32m+[m[32m}[m [32m+[m iString *metadataLabel_Player(const iPlayer *d) {[m iString *meta = new_String();[m if (d->decoder) {[m [1mdiff --git a/src/audio/player.h b/src/audio/player.h[m [1mindex 58947ef4..82d95fd2 100644[m [1m--- a/src/audio/player.h[m [1m+++ b/src/audio/player.h[m [36m@@ -54,6 +54,7 @@[m [mvoid stop_Player (iPlayer *);[m void setPaused_Player (iPlayer *, iBool isPaused);[m void setVolume_Player (iPlayer *, float volume);[m void setFlags_Player (iPlayer *, int flags, iBool set);[m [32m+[m[32mvoid setNotIdle_Player (iPlayer *);[m [m int flags_Player (const iPlayer *);[m const iString *tag_Player (const iPlayer *, enum iPlayerTag tag);[m [36m@@ -64,4 +65,5 @@[m [mfloat time_Player (const iPlayer *);[m float duration_Player (const iPlayer *);[m float streamProgress_Player (const iPlayer *); /* normalized 0...1 */[m [m [32m+[m[32muint32_t idleTimeMs_Player (const iPlayer *);[m iString * metadataLabel_Player (const iPlayer *);[m [1mdiff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c[m [1mindex 1a7bf4a4..85c17a5b 100644[m [1m--- a/src/ui/documentwidget.c[m [1m+++ b/src/ui/documentwidget.c[m [36m@@ -460,7 +460,12 @@[m [mstatic void animatePlayingAudio_DocumentWidget_(void *widget) {[m if (document_App() != d) return;[m iConstForEach(PtrArray, i, &d->visiblePlayers) {[m const iGmRun *run = i.ptr;[m [31m- iPlayer *plr = audioPlayer_Media(media_GmDocument(d->doc), run->audioId);[m [32m+[m[32m iPlayer * plr = audioPlayer_Media(media_GmDocument(d->doc), run->audioId);[m [32m+[m[32m if (idleTimeMs_Player(plr) > 3000 && ~flags_Player(plr) & volumeGrabbed_PlayerFlag &&[m [32m+[m[32m flags_Player(plr) & adjustingVolume_PlayerFlag) {[m [32m+[m[32m setFlags_Player(plr, adjustingVolume_PlayerFlag, iFalse);[m [32m+[m[32m refresh_Widget(d);[m [32m+[m[32m }[m if (isStarted_Player(plr) && !isPaused_Player(plr)) {[m refresh_Widget(d);[m addTicker_App(animatePlayingAudio_DocumentWidget_, d);[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).