herrie-2.1-signals.diff 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. diff -ru herrie-2.1-orig/herrie-2.1/src/gui_input.c herrie-2.1-signals/herrie-2.1/src/gui_input.c
  2. --- herrie-2.1-orig/herrie-2.1/src/gui_input.c 2008-07-15 10:59:07.000000000 -0500
  3. +++ herrie-2.1-signals/herrie-2.1/src/gui_input.c 2008-07-18 09:44:41.000000000 -0500
  4. @@ -521,6 +521,9 @@
  5. sigset_t sset;
  6. sigemptyset(&sset);
  7. + sigaddset(&sset, SIGRTMIN+1);
  8. + sigaddset(&sset, SIGRTMIN+2);
  9. + sigaddset(&sset, SIGRTMIN+3);
  10. sigaddset(&sset, SIGUSR1);
  11. sigaddset(&sset, SIGUSR2);
  12. sigaddset(&sset, SIGHUP);
  13. @@ -545,20 +548,29 @@
  14. if (shutting_down)
  15. return;
  16. - switch (signal) {
  17. - case SIGUSR1:
  18. - playq_cursong_pause();
  19. - break;
  20. - case SIGUSR2:
  21. - playq_cursong_next();
  22. - break;
  23. - case SIGHUP:
  24. - case SIGINT:
  25. - case SIGPIPE:
  26. - case SIGQUIT:
  27. - case SIGTERM:
  28. - gui_input_quit();
  29. - g_assert_not_reached();
  30. + if (signal == (SIGRTMIN+1)) { gui_playq_song_select(); }
  31. + else {
  32. + if (signal == (SIGRTMIN+2)) { playq_cursong_stop(); }
  33. + else {
  34. + if (signal == (SIGRTMIN+3)) { playq_cursong_prev(); }
  35. + else {
  36. + switch (signal) {
  37. + case SIGUSR1:
  38. + playq_cursong_pause();
  39. + break;
  40. + case SIGUSR2:
  41. + playq_cursong_next();
  42. + break;
  43. + case SIGHUP:
  44. + case SIGINT:
  45. + case SIGPIPE:
  46. + case SIGQUIT:
  47. + case SIGTERM:
  48. + gui_input_quit();
  49. + g_assert_not_reached();
  50. + }
  51. + }
  52. + }
  53. }
  54. }
  55. #endif /* G_OS_UNIX */
  56. @@ -570,6 +582,9 @@
  57. unsigned int i;
  58. #ifdef G_OS_UNIX
  59. + signal(SIGRTMIN+1, gui_input_sighandler);
  60. + signal(SIGRTMIN+2, gui_input_sighandler);
  61. + signal(SIGRTMIN+3, gui_input_sighandler);
  62. signal(SIGUSR1, gui_input_sighandler);
  63. signal(SIGUSR2, gui_input_sighandler);
  64. signal(SIGHUP, gui_input_sighandler);