clang-format

custom
jacqueline 3 years ago
parent cc45d1ead0
commit 58ed7b1e10
  1. 2
      main/dac.hpp
  2. 4
      main/gay-ipod-fw.cpp
  3. 2
      main/gpio-expander.hpp
  4. 27
      main/playback.cpp
  5. 2
      main/playback.hpp

@ -2,8 +2,8 @@
#include "gpio-expander.hpp" #include "gpio-expander.hpp"
#include <functional>
#include <stdint.h> #include <stdint.h>
#include <functional>
#include "esp_err.h" #include "esp_err.h"
#include "result.hpp" #include "result.hpp"

@ -4,10 +4,10 @@
#include "playback.hpp" #include "playback.hpp"
#include "storage.hpp" #include "storage.hpp"
#include <cstdint>
#include <dirent.h> #include <dirent.h>
#include <memory>
#include <stdio.h> #include <stdio.h>
#include <cstdint>
#include <memory>
#include "audio_common.h" #include "audio_common.h"
#include "audio_element.h" #include "audio_element.h"

@ -1,9 +1,9 @@
#pragma once #pragma once
#include <stdint.h>
#include <atomic> #include <atomic>
#include <functional> #include <functional>
#include <mutex> #include <mutex>
#include <stdint.h>
#include <tuple> #include <tuple>
#include <utility> #include <utility>

@ -182,35 +182,38 @@ void DacAudioPlayback::Pause() {
void DacAudioPlayback::ProcessEvents() { void DacAudioPlayback::ProcessEvents() {
while (1) { while (1) {
audio_event_iface_msg_t event; audio_event_iface_msg_t event;
esp_err_t err = audio_event_iface_listen(event_interface_, &event, portMAX_DELAY); esp_err_t err =
audio_event_iface_listen(event_interface_, &event, portMAX_DELAY);
if (err != ESP_OK) { if (err != ESP_OK) {
ESP_LOGI(kTag, "error listening for event:%x", err); ESP_LOGI(kTag, "error listening for event:%x", err);
continue; continue;
} }
ESP_LOGI(kTag, "received event, cmd %i", event.cmd); ESP_LOGI(kTag, "received event, cmd %i", event.cmd);
if (event.source_type == AUDIO_ELEMENT_TYPE_ELEMENT if (event.source_type == AUDIO_ELEMENT_TYPE_ELEMENT &&
&& event.source == (void *) mp3_decoder_ event.source == (void*)mp3_decoder_ &&
&& event.cmd == AEL_MSG_CMD_REPORT_MUSIC_INFO) { event.cmd == AEL_MSG_CMD_REPORT_MUSIC_INFO) {
audio_element_info_t music_info = {0}; audio_element_info_t music_info = {0};
audio_element_getinfo(mp3_decoder_, &music_info); audio_element_getinfo(mp3_decoder_, &music_info);
ESP_LOGI(kTag, "sample_rate=%d, bits=%d, ch=%d", music_info.sample_rates, music_info.bits, music_info.channels); ESP_LOGI(kTag, "sample_rate=%d, bits=%d, ch=%d", music_info.sample_rates,
music_info.bits, music_info.channels);
audio_element_setinfo(i2s_stream_writer_, &music_info); audio_element_setinfo(i2s_stream_writer_, &music_info);
i2s_stream_set_clk(i2s_stream_writer_, music_info.sample_rates, music_info.bits, music_info.channels); i2s_stream_set_clk(i2s_stream_writer_, music_info.sample_rates,
music_info.bits, music_info.channels);
} }
if (event.source_type == AUDIO_ELEMENT_TYPE_ELEMENT if (event.source_type == AUDIO_ELEMENT_TYPE_ELEMENT &&
&& event.source == (void *) fatfs_stream_reader_ event.source == (void*)fatfs_stream_reader_ &&
&& event.cmd == AEL_MSG_CMD_REPORT_STATUS) { event.cmd == AEL_MSG_CMD_REPORT_STATUS) {
audio_element_status_t status = status_from_the_void(event.data); audio_element_status_t status = status_from_the_void(event.data);
if (status == AEL_STATUS_STATE_FINISHED) { if (status == AEL_STATUS_STATE_FINISHED) {
// TODO: enqueue next track? // TODO: enqueue next track?
} }
} }
if (event.source_type == AUDIO_ELEMENT_TYPE_ELEMENT if (event.source_type == AUDIO_ELEMENT_TYPE_ELEMENT &&
&& event.source == (void *) i2s_stream_writer_ event.source == (void*)i2s_stream_writer_ &&
&& event.cmd == AEL_MSG_CMD_REPORT_STATUS) { event.cmd == AEL_MSG_CMD_REPORT_STATUS) {
audio_element_status_t status = status_from_the_void(event.data); audio_element_status_t status = status_from_the_void(event.data);
if (status == AEL_STATUS_STATE_FINISHED) { if (status == AEL_STATUS_STATE_FINISHED) {
// TODO. // TODO.

@ -13,9 +13,9 @@
#include "audio_pipeline.h" #include "audio_pipeline.h"
#include "esp_err.h" #include "esp_err.h"
#include "fatfs_stream.h" #include "fatfs_stream.h"
#include "result.hpp"
#include "i2s_stream.h" #include "i2s_stream.h"
#include "mp3_decoder.h" #include "mp3_decoder.h"
#include "result.hpp"
namespace gay_ipod { namespace gay_ipod {

Loading…
Cancel
Save