Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ESP32-audioI2S
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ESP32-audioI2S
Commits
b5354f19
Unverified
Commit
b5354f19
authored
Aug 12, 2021
by
Wolle
Committed by
GitHub
Aug 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new event audio_icydescription()
is transmitted in the audio header
parent
fdc8f3be
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
205 additions
and
157 deletions
+205
-157
src/Audio.cpp
src/Audio.cpp
+188
-154
src/Audio.h
src/Audio.h
+17
-3
No files found.
src/Audio.cpp
View file @
b5354f19
This diff is collapsed.
Click to expand it.
src/Audio.h
View file @
b5354f19
...
...
@@ -13,7 +13,6 @@
#pragma GCC optimize ("Ofast")
#include "Arduino.h"
//#include "libb64/cdecode.h"
#include "libb64/cencode.h"
#include "SPI.h"
#include "WiFi.h"
...
...
@@ -74,6 +73,7 @@ extern __attribute__((weak)) void audio_showstation(const char*);
extern
__attribute__
((
weak
))
void
audio_bitrate
(
const
char
*
);
extern
__attribute__
((
weak
))
void
audio_commercial
(
const
char
*
);
extern
__attribute__
((
weak
))
void
audio_icyurl
(
const
char
*
);
extern
__attribute__
((
weak
))
void
audio_icydescription
(
const
char
*
);
extern
__attribute__
((
weak
))
void
audio_lasthost
(
const
char
*
);
extern
__attribute__
((
weak
))
void
audio_eof_speech
(
const
char
*
);
extern
__attribute__
((
weak
))
void
audio_eof_stream
(
const
char
*
);
// The webstream comes to an end
...
...
@@ -234,7 +234,10 @@ private:
bool
endsWith
(
const
char
*
base
,
const
char
*
str
)
{
int
blen
=
strlen
(
base
);
int
slen
=
strlen
(
str
);
return
(
blen
>=
slen
)
&&
(
0
==
strcmp
(
base
+
blen
-
slen
,
str
));
while
(
isspace
(
*
(
base
+
blen
-
1
)))
blen
--
;
// rtrim
char
*
pos
=
strstr
(
base
+
blen
-
slen
,
str
);
if
(
pos
==
NULL
)
return
false
;
else
return
true
;
}
int
indexOf
(
const
char
*
base
,
const
char
*
str
,
int
startIndex
)
{
int
result
;
...
...
@@ -247,6 +250,15 @@ private:
}
return
result
;
}
int
lastIndexOf
(
const
char
*
base
,
const
char
*
str
){
int
pos
=
-
1
,
lastIndex
=
-
1
;
while
(
true
){
pos
=
indexOf
(
base
,
str
,
pos
+
1
);
if
(
pos
>=
0
)
lastIndex
=
pos
;
else
break
;
}
return
lastIndex
;
}
int
specialIndexOf
(
uint8_t
*
base
,
const
char
*
str
,
int
baselen
,
bool
exact
=
false
){
int
result
;
// seek for str in buffer or in header up to baselen, not nullterninated
if
(
strlen
(
str
)
>
baselen
)
return
-
1
;
// if exact == true seekstr in buffer must have "\0" at the end
...
...
@@ -294,7 +306,9 @@ private:
return
expectedLen
;
}
void
trim
(
char
*
s
){
while
(
isspace
(
*
s
))
s
++
;
// ltrim
uint8_t
l
=
0
;
while
(
isspace
(
*
(
s
+
l
)))
l
++
;
for
(
uint16_t
i
=
0
;
i
<
strlen
(
s
)
-
l
;
i
++
)
*
(
s
+
i
)
=
*
(
s
+
i
+
l
);
// ltrim
char
*
back
=
s
+
strlen
(
s
);
while
(
isspace
(
*--
back
));
*
(
back
+
1
)
=
'\0'
;
// rtrim
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment