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 <functional>
#include <stdint.h>
#include <functional>
#include "esp_err.h"
#include "result.hpp"

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

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

@ -182,35 +182,38 @@ void DacAudioPlayback::Pause() {
void DacAudioPlayback::ProcessEvents() {
while (1) {
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) {
ESP_LOGI(kTag, "error listening for event:%x", err);
continue;
}
ESP_LOGI(kTag, "received event, cmd %i", event.cmd);
if (event.source_type == AUDIO_ELEMENT_TYPE_ELEMENT
&& event.source == (void *) mp3_decoder_
&& event.cmd == AEL_MSG_CMD_REPORT_MUSIC_INFO) {
if (event.source_type == AUDIO_ELEMENT_TYPE_ELEMENT &&
event.source == (void*)mp3_decoder_ &&
event.cmd == AEL_MSG_CMD_REPORT_MUSIC_INFO) {
audio_element_info_t music_info = {0};
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);
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
&& event.source == (void *) fatfs_stream_reader_
&& event.cmd == AEL_MSG_CMD_REPORT_STATUS) {
if (event.source_type == AUDIO_ELEMENT_TYPE_ELEMENT &&
event.source == (void*)fatfs_stream_reader_ &&
event.cmd == AEL_MSG_CMD_REPORT_STATUS) {
audio_element_status_t status = status_from_the_void(event.data);
if (status == AEL_STATUS_STATE_FINISHED) {
// TODO: enqueue next track?
}
}
if (event.source_type == AUDIO_ELEMENT_TYPE_ELEMENT
&& event.source == (void *) i2s_stream_writer_
&& event.cmd == AEL_MSG_CMD_REPORT_STATUS) {
if (event.source_type == AUDIO_ELEMENT_TYPE_ELEMENT &&
event.source == (void*)i2s_stream_writer_ &&
event.cmd == AEL_MSG_CMD_REPORT_STATUS) {
audio_element_status_t status = status_from_the_void(event.data);
if (status == AEL_STATUS_STATE_FINISHED) {
// TODO.

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

Loading…
Cancel
Save