mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 05:13:03 +01:00
possibly fix sound notification bug
This commit is contained in:
parent
be264528d2
commit
f7d46f1100
13
src/notify.c
13
src/notify.c
@ -209,6 +209,7 @@ void graceful_clear()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if(actives[i].id_indicator)
|
||||||
*actives[i].id_indicator = -1; /* reset indicator value */
|
*actives[i].id_indicator = -1; /* reset indicator value */
|
||||||
|
|
||||||
if ( actives[i].looping ) {
|
if ( actives[i].looping ) {
|
||||||
@ -251,6 +252,9 @@ void* do_playing(void* _p)
|
|||||||
&& !actives[i].box
|
&& !actives[i].box
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
|
if(actives[i].id_indicator)
|
||||||
|
*actives[i].id_indicator = -1; /* reset indicator value */
|
||||||
|
|
||||||
if (!is_playing(actives[i].source)) {
|
if (!is_playing(actives[i].source)) {
|
||||||
/* Close */
|
/* Close */
|
||||||
alSourceStop(actives[i].source);
|
alSourceStop(actives[i].source);
|
||||||
@ -265,6 +269,7 @@ void* do_playing(void* _p)
|
|||||||
GError* ignore;
|
GError* ignore;
|
||||||
notify_notification_close(actives[i].box, &ignore);
|
notify_notification_close(actives[i].box, &ignore);
|
||||||
actives[i].box = NULL;
|
actives[i].box = NULL;
|
||||||
|
if(actives[i].id_indicator)
|
||||||
*actives[i].id_indicator = -1; /* reset indicator value */
|
*actives[i].id_indicator = -1; /* reset indicator value */
|
||||||
|
|
||||||
if (!actives[i].looping && !is_playing(actives[i].source)) {
|
if (!actives[i].looping && !is_playing(actives[i].source)) {
|
||||||
@ -322,7 +327,9 @@ void* do_playing(void* _p)
|
|||||||
GError* ignore;
|
GError* ignore;
|
||||||
notify_notification_close(actives[i].box, &ignore);
|
notify_notification_close(actives[i].box, &ignore);
|
||||||
actives[i].box = NULL;
|
actives[i].box = NULL;
|
||||||
|
if(actives[i].id_indicator)
|
||||||
*actives[i].id_indicator = -1; /* reset indicator value */
|
*actives[i].id_indicator = -1; /* reset indicator value */
|
||||||
|
|
||||||
memset(&actives[i], 0, sizeof(struct _ActiveNotifications));
|
memset(&actives[i], 0, sizeof(struct _ActiveNotifications));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -344,7 +351,9 @@ void graceful_clear()
|
|||||||
actives[i].box = NULL;
|
actives[i].box = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (actives[i].id_indicator)
|
||||||
*actives[i].id_indicator = -1; /* reset indicator value */
|
*actives[i].id_indicator = -1; /* reset indicator value */
|
||||||
|
|
||||||
memset(&actives[i], 0, sizeof(struct _ActiveNotifications));
|
memset(&actives[i], 0, sizeof(struct _ActiveNotifications));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,6 +386,7 @@ int init_notify(int login_cooldown, int notification_timeout)
|
|||||||
pthread_mutex_destroy(Control.poll_mutex);
|
pthread_mutex_destroy(Control.poll_mutex);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Control.poll_active = 1;
|
Control.poll_active = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -388,7 +398,7 @@ int init_notify(int login_cooldown, int notification_timeout)
|
|||||||
|
|
||||||
|
|
||||||
#ifdef BOX_NOTIFY
|
#ifdef BOX_NOTIFY
|
||||||
notify_init("toxic");
|
notify_init("Toxic");
|
||||||
#endif
|
#endif
|
||||||
Control.notif_timeout = notification_timeout;
|
Control.notif_timeout = notification_timeout;
|
||||||
return 1;
|
return 1;
|
||||||
@ -478,6 +488,7 @@ void stop_sound(int id)
|
|||||||
notify_notification_close(actives[id].box, &ignore);
|
notify_notification_close(actives[id].box, &ignore);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (actives[id].id_indicator)
|
||||||
*actives[id].id_indicator = -1;
|
*actives[id].id_indicator = -1;
|
||||||
// alSourcei(actives[id].source, AL_LOOPING, false);
|
// alSourcei(actives[id].source, AL_LOOPING, false);
|
||||||
alSourceStop(actives[id].source);
|
alSourceStop(actives[id].source);
|
||||||
|
Loading…
Reference in New Issue
Block a user