Skip to content

Commit 4d6f5e1

Browse files
committed
Desktop build errors / remove custom_log_level
1 parent b18bdae commit 4d6f5e1

File tree

8 files changed

+8
-65
lines changed

8 files changed

+8
-65
lines changed

src/AudioTools/AudioCodecs/AudioEncoded.h

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "AudioCodecsBase.h"
44
#include "AudioToolsConfig.h"
5-
#include "AudioLogger.h"
5+
#include "AudioTools/CoreAudio/AudioLogger.h"
66
#include "AudioTools/CoreAudio/AudioIO.h"
77
#include "AudioTools/CoreAudio/AudioOutput.h"
88
#include "AudioTools/CoreAudio/AudioStreams.h"
@@ -135,9 +135,6 @@ class EncodedAudioOutput : public ModifyingOutput {
135135

136136
/// Starts the processing - sets the status to active
137137
bool begin() override {
138-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
139-
custom_log_level.set();
140-
#endif
141138
TRACED();
142139
if (!active) {
143140
TRACED();
@@ -150,9 +147,6 @@ class EncodedAudioOutput : public ModifyingOutput {
150147
LOGW("no decoder or encoder defined");
151148
}
152149
}
153-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
154-
custom_log_level.reset();
155-
#endif
156150
return active;
157151
}
158152

@@ -165,16 +159,10 @@ class EncodedAudioOutput : public ModifyingOutput {
165159
/// Ends the processing
166160
void end() override {
167161
if (active) {
168-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
169-
custom_log_level.set();
170-
#endif
171162
TRACEI();
172163
decoder_ptr->end();
173164
encoder_ptr->end();
174165
active = false;
175-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
176-
custom_log_level.reset();
177-
#endif
178166
}
179167
}
180168

@@ -184,9 +172,6 @@ class EncodedAudioOutput : public ModifyingOutput {
184172
// LOGI("write: %d", 0);
185173
return 0;
186174
}
187-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
188-
custom_log_level.set();
189-
#endif
190175
LOGD("EncodedAudioOutput::write: %d", (int)len);
191176

192177
if (writer_ptr == nullptr || data == nullptr) {
@@ -200,9 +185,6 @@ class EncodedAudioOutput : public ModifyingOutput {
200185

201186
size_t result = writer_ptr->write(data, len);
202187
LOGD("EncodedAudioOutput::write: %d -> %d", (int)len, (int)result);
203-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
204-
custom_log_level.reset();
205-
#endif
206188
return result;
207189
}
208190

@@ -220,10 +202,6 @@ class EncodedAudioOutput : public ModifyingOutput {
220202
/// Provides the initialized encoder
221203
AudioEncoder &encoder() { return *encoder_ptr; }
222204

223-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
224-
/// Defines the class specific custom log level
225-
void setLogLevel(AudioLogger::LogLevel level) { custom_log_level.set(level); }
226-
#endif
227205
/// Is Available for Write check activated ?
228206
bool isCheckAvailableForWrite() { return check_available_for_write; }
229207

@@ -238,9 +216,6 @@ class EncodedAudioOutput : public ModifyingOutput {
238216
Print *ptr_out = nullptr;
239217
bool active = false;
240218
bool check_available_for_write = false;
241-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
242-
CustomLogLevel custom_log_level;
243-
#endif
244219
int frame_size = DEFAULT_BUFFER_SIZE;
245220
};
246221

@@ -372,11 +347,6 @@ class EncodedAudioStream : public ReformatBaseStream {
372347
float getByteFactor() { return byte_factor; }
373348
void setByteFactor(float factor) { byte_factor = factor; }
374349

375-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
376-
/// Defines the class specific custom log level
377-
void setLogLevel(AudioLogger::LogLevel level) { enc_out.setLogLevel(level); }
378-
#endif
379-
380350
/// defines the size of the decoded frame in bytes
381351
void setFrameSize(int size) { enc_out.setFrameSize(size); }
382352

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#pragma once
22
#define VFS_SD SD
33
#include "AudioTools/Disk/VFSFile.h"
4+
#include "AudioTools/Disk/VFS.h"
45

56
// We allow the access to the files via the global SD object
67

78
namespace audio_tools {
89

910
using File = VFSFile;
10-
using FS = VFS_SDClass;
11+
using FS = VFS;
1112

1213
}

src/AudioTools/AudioLibs/HLSStream.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ class HLSParser {
220220

221221
bool begin() {
222222
TRACEI();
223-
custom_log_level.set();
224223
segments_url_str = "";
225224
bandwidth = 0;
226225

@@ -245,29 +244,24 @@ class HLSParser {
245244
return false;
246245
}
247246

248-
custom_log_level.reset();
249247
return true;
250248
}
251249

252250
int available() {
253251
TRACED();
254252
int result = 0;
255-
custom_log_level.set();
256253
reloadSegments();
257254

258255
if (active) result = url_loader.available();
259-
custom_log_level.reset();
260256
return result;
261257
}
262258

263259
size_t readBytes(uint8_t *data, size_t len) {
264260
TRACED();
265261
size_t result = 0;
266-
custom_log_level.set();
267262
reloadSegments();
268263

269264
if (active) result = url_loader.readBytes(data, len);
270-
custom_log_level.reset();
271265
return result;
272266
}
273267

@@ -300,9 +294,6 @@ class HLSParser {
300294
/// Defines the number of urls that are preloaded in the URLLoaderHLS
301295
void setUrlCount(int count) { url_count = count; }
302296

303-
/// Defines the class specific custom log level
304-
void setLogLevel(AudioLogger::LogLevel level) { custom_log_level.set(level); }
305-
306297
/// Redefines the buffer size
307298
void setBufferSize(int size, int count) {
308299
url_loader.setBufferSize(size, count);
@@ -323,7 +314,6 @@ class HLSParser {
323314
protected:
324315
enum class URLType { Undefined, Index, Segment };
325316
URLType next_url_type = URLType::Undefined;
326-
CustomLogLevel custom_log_level;
327317
int bandwidth = 0;
328318
int url_count = 5;
329319
bool url_active = false;
@@ -701,9 +691,6 @@ class HLSStream : public AbstractURLStream {
701691
return parser.readBytes(data, len);
702692
}
703693

704-
/// Defines the class specific custom log level
705-
void setLogLevel(AudioLogger::LogLevel level) { parser.setLogLevel(level); }
706-
707694
/// Redefines the read buffer size
708695
void setBufferSize(int size, int count) { parser.setBufferSize(size, count); }
709696

src/AudioTools/CoreAudio/AudioBasic/Collections/Allocator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "AudioToolsConfig.h"
55
#include "AudioTools/CoreAudio/AudioLogger.h"
6+
#include "AudioTools/CoreAudio/AudioRuntime.h"
67

78
namespace audio_tools {
89

src/AudioTools/CoreAudio/AudioHttp/URLStream.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ class URLStream : public AbstractURLStream {
103103
total_read = 0;
104104
active = result == 200;
105105
LOGI("==> http status: %d", result);
106-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
107-
custom_log_level.reset();
108-
#endif
109106
return active;
110107
}
111108

@@ -129,9 +126,6 @@ class URLStream : public AbstractURLStream {
129126
total_read = 0;
130127
active = result == 200;
131128
LOGI("==> http status: %d", result);
132-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
133-
custom_log_level.reset();
134-
#endif
135129
return active;
136130
}
137131

@@ -260,10 +254,6 @@ class URLStream : public AbstractURLStream {
260254
return request.available() > 0;
261255
}
262256

263-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
264-
/// Defines the class specific custom log level
265-
void setLogLevel(AudioLogger::LogLevel level) { custom_log_level.set(level); }
266-
#endif
267257
const char* urlStr() { return url_str.c_str(); }
268258

269259
/// Define the Root PEM Certificate for SSL
@@ -275,9 +265,6 @@ class URLStream : public AbstractURLStream {
275265

276266
protected:
277267
HttpRequest request;
278-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
279-
CustomLogLevel custom_log_level;
280-
#endif
281268
Str url_str;
282269
Url url;
283270
long size;
@@ -305,9 +292,6 @@ class URLStream : public AbstractURLStream {
305292

306293
bool preProcess(const char* urlStr, const char* acceptMime) {
307294
TRACED();
308-
#if USE_AUDIO_LOGGING && !defined(USE_IDF_LOGGER)
309-
custom_log_level.set();
310-
#endif
311295
url_str = urlStr;
312296
url.setUrl(url_str.c_str());
313297
int result = -1;

src/AudioTools/Disk/VFS.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ namespace audio_tools {
1414
class VFS {
1515
public:
1616
/// mount the file systems
17-
virtual bool begin() = 0;
17+
virtual bool begin() {return true;}
1818
/// unmount the file system
19-
virtual void end() = 0;
19+
virtual void end() {}
2020
/// provide the mount point (root directory for the file system)
21-
virtual void setMountPoint(const char* mp) = 0;
21+
virtual void setMountPoint(const char* mp) { mount_point = mp; };
2222

2323
VFSFile open(const char* file, FileMode mode = VFS_FILE_READ) {
2424
VFSFile vfs_file;

src/AudioToolsConfig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# include "AudioTools/AudioLibs/Desktop/NoArduino.h"
1616
# include "AudioTools/AudioLibs/Desktop/Time.h"
1717
# include "AudioTools/AudioLibs/Desktop/Main.h"
18-
# include "AudioTools/AudioLibs/Desktop/File.h"
1918
# define USE_STREAM_READ_OVERRIDE
2019
# ifndef EXIT_ON_STOP
2120
# define EXIT_ON_STOP

tests-cmake/fft-effect/fft-effect.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "AudioTools.h"
22
#include "AudioTools/AudioLibs/MiniAudioStream.h"
33
#include "AudioTools/AudioLibs/FFTEffects.h"
4+
#include "AudioTools/AudioLibs/Desktop/File.h"
45

56
AudioInfo info(16000, 2, 16);
67
MiniAudioStream out; // final output of decoded stream

0 commit comments

Comments
 (0)