mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 04:27:12 +03:00
build + volume
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "esp_log.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "driver/ledc.h"
|
||||
#include "platform_config.h"
|
||||
#include "led.h"
|
||||
#include "globdefs.h"
|
||||
#include "accessors.h"
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
|
||||
#include "platform_config.h"
|
||||
#include "squeezelite.h"
|
||||
#include "bt_app_sink.h"
|
||||
#include "raop_sink.h"
|
||||
#include <math.h>
|
||||
|
||||
#include "bt_app_sink.h"
|
||||
|
||||
#define LOCK_O mutex_lock(outputbuf->mutex)
|
||||
#define UNLOCK_O mutex_unlock(outputbuf->mutex)
|
||||
#define LOCK_D mutex_lock(decode.mutex);
|
||||
@@ -146,7 +145,7 @@ static bool bt_sink_cmd_handler(bt_sink_cmd_t cmd, va_list args)
|
||||
LOG_INFO("Setting BT sample rate %u", output.next_sample_rate);
|
||||
break;
|
||||
case BT_SINK_VOLUME: {
|
||||
u16_t volume = (u16_t) va_arg(args, u32_t);
|
||||
u32_t volume = va_arg(args, u32_t);
|
||||
volume = 65536 * powf(volume / 128.0f, 3);
|
||||
set_volume(volume, volume);
|
||||
break;
|
||||
@@ -283,7 +282,7 @@ static bool raop_sink_cmd_handler(raop_event_t event, va_list args)
|
||||
float volume = va_arg(args, double);
|
||||
LOG_INFO("Volume[0..1] %0.4f", volume);
|
||||
volume = 65536 * powf(volume, 3);
|
||||
set_volume((u16_t) volume, (u16_t) volume);
|
||||
set_volume(volume, volume);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user