[Pommed-commits] r370 - in trunk: . pommed
jblache at alioth.debian.org
jblache at alioth.debian.org
Fri Nov 9 12:59:40 UTC 2007
Author: jblache
Date: 2007-11-09 12:59:40 +0000 (Fri, 09 Nov 2007)
New Revision: 370
Modified:
trunk/ChangeLog
trunk/pommed/audio.c
trunk/pommed/beep.c
trunk/pommed/beep.h
Log:
Beep on volume change, now that we have the beep code in pommed.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-10-18 19:00:04 UTC (rev 369)
+++ trunk/ChangeLog 2007-11-09 12:59:40 UTC (rev 370)
@@ -2,8 +2,9 @@
--------------------
version 1.11:
+ - pommed: beep on volume change, now that we have the audio code
+ in pommed itself.
-
version 1.10:
- pommed: add a beeper feature as a substitute to the missing PC
Speaker. The feature is disabled by default, as not all machines
Modified: trunk/pommed/audio.c
===================================================================
--- trunk/pommed/audio.c 2007-10-18 19:00:04 UTC (rev 369)
+++ trunk/pommed/audio.c 2007-11-09 12:59:40 UTC (rev 370)
@@ -29,6 +29,7 @@
#include "pommed.h"
#include "conffile.h"
#include "audio.h"
+#include "beep.h"
#include "dbus.h"
@@ -92,6 +93,8 @@
if (snd_mixer_selem_is_playback_mono(vol_elem) == 0)
snd_mixer_selem_set_playback_volume(vol_elem, 1, newvol);
+ beep_audio();
+
mbpdbus_send_audio_volume(newvol, vol);
audio_info.level = newvol;
Modified: trunk/pommed/beep.c
===================================================================
--- trunk/pommed/beep.c 2007-10-18 19:00:04 UTC (rev 369)
+++ trunk/pommed/beep.c 2007-11-09 12:59:40 UTC (rev 370)
@@ -74,7 +74,7 @@
void
beep_beep(void)
{
- if (beep_cfg.enabled == 0)
+ if (!beep_cfg.enabled)
return;
if (audio_info.muted)
@@ -83,7 +83,16 @@
beep_thread_command(AUDIO_CLICK);
}
+void
+beep_audio(void)
+{
+ if (audio_info.muted)
+ return;
+ beep_thread_command(AUDIO_CLICK);
+}
+
+
int
beep_open_device(void)
{
@@ -165,7 +174,7 @@
void
beep_close_device(void)
{
- if (beep_cfg.enabled == 0)
+ if (!beep_cfg.enabled)
return;
ioctl(beep_info.fd, UI_DEV_DESTROY, NULL);
@@ -181,9 +190,6 @@
{
int ret;
- if (beep_cfg.enabled == 0)
- return 0;
-
ret = beep_thread_init();
if (ret < 0)
{
@@ -241,8 +247,7 @@
/*
- * Beep thread - taken from gpomme/audio.c
- * If there's a bug somewhere below, it's also in gpomme, so please fix it there too.
+ * Beep thread
*/
struct dspdata _dsp;
@@ -452,6 +457,9 @@
static void
beep_thread_command(int command)
{
+ if (!beep_thread_running)
+ return;
+
if (!_dsp.sample)
return;
Modified: trunk/pommed/beep.h
===================================================================
--- trunk/pommed/beep.h 2007-10-18 19:00:04 UTC (rev 369)
+++ trunk/pommed/beep.h 2007-11-09 12:59:40 UTC (rev 370)
@@ -19,6 +19,9 @@
void
beep_beep(void);
+void
+beep_audio(void);
+
int
beep_open_device(void);
More information about the Pommed-commits
mailing list