Compare commits

..

4 Commits

Author SHA1 Message Date
leper 514c12cb66 Add ark pixel font's latin feature branch font. 1 week ago
Ondřej Hruška 3713c859ad Make media buttons control use double click so it is less prone to accidental track skips 2 weeks ago
Ondřej Hruška 972eb280d0 Enable scroll wrap-around 2 weeks ago
Ondřej Hruška 2ab4e9d8a6 Changed volume to go in 5pct steps 2 weeks ago
  1. 34
      lua/licenses.lua
  2. 28
      lua/settings.lua
  3. 2
      src/codecs/wavpack.cpp
  4. 3
      src/tangara/audio/audio_fsm.cpp
  5. 2
      src/tangara/audio/bt_audio_output.cpp
  6. 5
      src/tangara/audio/stream_cues.cpp
  7. 2
      src/tangara/audio/stream_cues.hpp

@ -62,18 +62,19 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE
OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.]]) OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.]])
end end
local function bsd3(copyright, name) local function xiphbsd(copyright)
show_license(copyright .. [[ show_license(copyright .. [[
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of ]] .. name .. [[ nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - Neither the name of the Xiph.org Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.]]) USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.]])
end end
local function apache(copyright) local function apache(copyright)
@ -242,31 +243,26 @@ return function(self)
apache("Copyright 2022 Ronald Ross Miller") apache("Copyright 2022 Ronald Ross Miller")
end) end)
library("ogg", "BSD", function() library("ogg", "BSD", function()
bsd3("Copyright (c) 2002, Xiph.org Foundation", "Xiph.org Foundation") xiphbsd("Copyright (c) 2002, Xiph.org Foundation")
end) end)
library("Opus", "BSD", function() library("Opus", "BSD", function()
bsd3( xiphbsd(
"Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, Jean-Marc Valin, Timothy B. Terriberry, CSIRO, Gregory Maxwell, Mark Borgerding, Erik de Castro Lopo", "Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, Jean-Marc Valin, Timothy B. Terriberry, CSIRO, Gregory Maxwell, Mark Borgerding, Erik de Castro Lopo")
"Xiph.org Foundation")
end) end)
library("Opusfile", "BSD", function() library("Opusfile", "BSD", function()
bsd3("Copyright (c) 1994-2013 Xiph.Org Foundation and contributors", "Xiph.org Foundation") xiphbsd("Copyright (c) 1994-2013 Xiph.Org Foundation and contributors")
end) end)
library("result", "MIT", function() library("result", "MIT", function()
mit("Copyright (c) 2017-2021 Matthew Rodusek") mit("Copyright (c) 2017-2021 Matthew Rodusek")
end) end)
library("speexdsp", "BSD", function() library("speexdsp", "BSD", function()
bsd3( xiphbsd(
"Copyright 2002-2008 Xiph.org Foundation, Copyright 2002-2008 Jean-Marc Valin, Copyright 2005-2007 Analog Devices Inc., Copyright 2005-2008 Commonwealth Scientific and Industrial Research, Organisation (CSIRO), Copyright 1993, 2002, 2006 David Rowe, Copyright 2003 EpicGames, Copyright 1992-1994 Jutta Degener, Carsten Bormann", "Copyright 2002-2008 Xiph.org Foundation, Copyright 2002-2008 Jean-Marc Valin, Copyright 2005-2007 Analog Devices Inc., Copyright 2005-2008 Commonwealth Scientific and Industrial Research, Organisation (CSIRO), Copyright 1993, 2002, 2006 David Rowe, Copyright 2003 EpicGames, Copyright 1992-1994 Jutta Degener, Carsten Bormann")
"Xiph.org Foundation")
end) end)
library("tinyfsm", "MIT", function() library("tinyfsm", "MIT", function()
mit("Copyright (c) 2012-2022 Axel Burri") mit("Copyright (c) 2012-2022 Axel Burri")
end) end)
library("tremor", "BSD", function() library("tremor", "BSD", function()
bsd3("Copyright (c) 2002, Xiph.org Foundation", "Xiph.org Foundation") xiphbsd("Copyright (c) 2002, Xiph.org Foundation")
end)
library("WavPack", "BSD", function()
bsd3("Copyright (c) 1998 - 2006 Conifer Software, All rights reserved.", "Conifer Software")
end) end)
end end

@ -406,38 +406,24 @@ settings.ThemeSettings = SettingsScreen:new {
selected_idx = idx selected_idx = idx
end end
local theme_container = self.content:Object { local theme_chooser = self.content:Dropdown {
w = lvgl.PCT(100),
h = lvgl.SIZE_CONTENT,
flex = {
flex_direction = "column",
justify_content = "flex-start",
align_items = "space-evenly",
align_content = "flex-start",
},
pad_row = 4,
}
theme_container:add_style(styles.list_item)
local theme_chooser = theme_container:Dropdown {
options = options, options = options,
symbol = img.chevron, symbol = img.chevron,
} }
local theme_chooser_desc = widgets.Description(theme_chooser, "Theme") local theme_chooser_desc = widgets.Description(theme_chooser, "Theme")
local theme_reload = function() theme_chooser:set({ selected = selected_idx })
theme_chooser:onevent(lvgl.EVENT.VALUE_CHANGED, function()
local option = theme_chooser:get('selected_str') local option = theme_chooser:get('selected_str')
local selectedTheme = themeOptions[option] local selectedTheme = themeOptions[option]
if (selectedTheme) then if (selectedTheme) then
theme.load_theme(tostring(selectedTheme)) theme.load_theme(tostring(selectedTheme))
backstack.reset(main_menu:new()) backstack.reset(main_menu:new())
end end
end end)
theme_chooser:set({ selected = selected_idx })
theme_chooser:onevent(lvgl.EVENT.VALUE_CHANGED, theme_reload)
theme_chooser:focus()
local theme_reload_btn = theme_container:Button {} theme_chooser:focus()
theme_reload_btn:Label { text = "Reload" }
theme_reload_btn:onClicked(theme_reload)
end end
} }

@ -45,7 +45,7 @@ WavPackDecoder::WavPackDecoder() : input_(), buf_() {
buf_ = static_cast<int32_t*>( buf_ = static_cast<int32_t*>(
heap_caps_malloc( heap_caps_malloc(
kBufSize * sizeof(int32_t), kBufSize * sizeof(int32_t),
MALLOC_CAP_INTERNAL | MALLOC_CAP_32BIT MALLOC_CAP_INTERNAL | MALLOC_CAP_CACHE_ALIGNED
)); ));
} }

@ -148,7 +148,9 @@ void AudioState::react(const QueueUpdate& ev) {
void AudioState::react(const SetTrack& ev) { void AudioState::react(const SetTrack& ev) {
if (std::holds_alternative<std::monostate>(ev.new_track)) { if (std::holds_alternative<std::monostate>(ev.new_track)) {
ESP_LOGI(kTag, "playback finished, awaiting drain");
sDecoder->open({}); sDecoder->open({});
sStreamCues.clear();
return; return;
} }
@ -210,7 +212,6 @@ void AudioState::react(const TtsPlaybackChanged& ev) {
} }
void AudioState::react(const internal::DecodingFinished& ev) { void AudioState::react(const internal::DecodingFinished& ev) {
ESP_LOGD(kTag, "end of file decoded; awaiting playback of buffered audio");
// If we just finished playing whatever's at the front of the queue, then we // If we just finished playing whatever's at the front of the queue, then we
// need to advanve and start playing the next one ASAP in order to continue // need to advanve and start playing the next one ASAP in order to continue
// gaplessly. // gaplessly.

@ -32,7 +32,7 @@
namespace audio { namespace audio {
static constexpr uint16_t kVolumeRange = 60; static constexpr uint16_t kVolumeRange = 60;
static constexpr uint16_t kVolumeStep = 2; // CUSTOM - added static constexpr uint16_t kVolumeStep = 5; // CUSTOM - added
using ConnectionState = drivers::Bluetooth::ConnectionState; using ConnectionState = drivers::Bluetooth::ConnectionState;

@ -43,6 +43,11 @@ auto StreamCues::addCue(std::shared_ptr<TrackInfo> track, uint32_t sample)
} }
} }
auto StreamCues::clear() -> void {
upcoming_.clear();
current_ = {};
}
auto StreamCues::current() -> std::pair<std::shared_ptr<TrackInfo>, uint32_t> { auto StreamCues::current() -> std::pair<std::shared_ptr<TrackInfo>, uint32_t> {
if (!current_) { if (!current_) {
return {}; return {};

@ -34,6 +34,8 @@ class StreamCues {
auto addCue(std::shared_ptr<TrackInfo>, uint32_t start_at) -> void; auto addCue(std::shared_ptr<TrackInfo>, uint32_t start_at) -> void;
auto clear() -> void;
private: private:
uint32_t now_; uint32_t now_;

Loading…
Cancel
Save