diff options
author | ben <benjaminfranzke@googlemail.com> | 2010-07-15 11:07:51 +0200 |
---|---|---|
committer | ben <benjaminfranzke@googlemail.com> | 2010-07-15 11:07:51 +0200 |
commit | b9357271148229d36c42b59508c89940bbbcd708 (patch) | |
tree | c5adf259c2472978936a2cf5745b60bc7a245611 /src | |
parent | e084dd44550567aaf5e67a3128a16a4cd59ea744 (diff) | |
download | pa-sink-ctl-b9357271148229d36c42b59508c89940bbbcd708.tar.gz pa-sink-ctl-b9357271148229d36c42b59508c89940bbbcd708.tar.bz2 pa-sink-ctl-b9357271148229d36c42b59508c89940bbbcd708.zip |
replace own VOLUME_MAX def with PA_VOLUME_NORM def
Diffstat (limited to 'src')
-rw-r--r-- | src/interface.c | 4 | ||||
-rw-r--r-- | src/interface.h | 1 | ||||
-rw-r--r-- | src/pa-sink-ctl.c | 1 | ||||
-rw-r--r-- | src/pa-sink-ctl.h | 7 | ||||
-rw-r--r-- | src/sink_input.h | 3 |
5 files changed, 6 insertions, 10 deletions
diff --git a/src/interface.c b/src/interface.c index 4ac1a0f..771127b 100644 --- a/src/interface.c +++ b/src/interface.c @@ -9,7 +9,6 @@ #include "sink.h" #include "pa-sink-ctl.h" -#define VOLUME_MAX UINT16_MAX #define VOLUME_BAR_LEN 50 #define WIDTH 80 #define HEIGHT 10 @@ -188,9 +187,8 @@ void get_input(void) }; } else break; - int input_vol = tmp.tmp_vol + 2 * volume_mult * (VOLUME_MAX / 100); - tmp.tmp_vol = CLAMP(input_vol, 0, VOLUME_MAX); /* force input_vol in [0, VOL_MAX] */ + tmp.tmp_vol = CLAMP(input_vol, VOLUME_MIN, VOLUME_MAX); /* force input_vol in [0, VOL_NORM] */ for (int i = 0; i < tmp.volume.channels; ++i) tmp.volume.values[i] = tmp.tmp_vol; diff --git a/src/interface.h b/src/interface.h index c6208fb..0290d1f 100644 --- a/src/interface.h +++ b/src/interface.h @@ -3,7 +3,6 @@ #include <pulse/pulseaudio.h> -#define VOLUME_MAX UINT16_MAX #define VOLUME_BAR_LEN 50 #define WIDTH 80 #define HEIGHT 10 diff --git a/src/pa-sink-ctl.c b/src/pa-sink-ctl.c index 98b57ad..aa7870a 100644 --- a/src/pa-sink-ctl.c +++ b/src/pa-sink-ctl.c @@ -15,7 +15,6 @@ #include "interface.h" #include "pa-sink-ctl.h" -#define VOLUME_MAX UINT16_MAX #define VOLUME_BAR_LEN 50 #define WIDTH 80 #define HEIGHT 10 diff --git a/src/pa-sink-ctl.h b/src/pa-sink-ctl.h index 36201cb..eb130d4 100644 --- a/src/pa-sink-ctl.h +++ b/src/pa-sink-ctl.h @@ -2,16 +2,19 @@ #define PA_SINK_CTL_H #include <stdio.h> +#include <stdlib.h> +#include <stdint.h> #include <pulse/pulseaudio.h> #include <ncurses.h> #include <string.h> -#include <stdlib.h> #include "sink_input.h" #include "sink.h" #include "interface.h" -#define VOLUME_MAX UINT16_MAX +#define VOLUME_MIN ((intmax_t) PA_VOLUME_MUTED) +#define VOLUME_MAX ((intmax_t) PA_VOLUME_NORM) + #define VOLUME_BAR_LEN 50 #define WIDTH 80 #define HEIGHT 10 diff --git a/src/sink_input.h b/src/sink_input.h index 4da8981..ec636d0 100644 --- a/src/sink_input.h +++ b/src/sink_input.h @@ -6,9 +6,6 @@ #include <glib.h> #include <pulse/pulseaudio.h> -// TODO: change this with the given define from pulselib -#define VOLUME_MAX UINT16_MAX - typedef struct _sink_input_info { uint32_t index; uint32_t sink; |