Merge branch 'main' of git.sr.ht:~jacqueline/tangara-fw

custom
jacqueline 1 year ago
commit aaa949f718
  1. 5
      README.md
  2. 1
      src/lua/include/lua_thread.hpp
  3. 20
      src/ui/encoder_input.cpp
  4. 1
      src/ui/include/ui_fsm.hpp
  5. 6
      src/ui/ui_fsm.cpp

@ -1,7 +1,8 @@
# Tangara # Tangara
Tangara is an open-hardware portable music player. It runs on an ESP32, fits in Tangara is a portable music player. It outputs high-quality sound through a 3.5-mm headphone jack, lasts a full day on a charge, and includes a processor that’s powerful enough to support any audio format you can throw at it. It’s also 100% open hardware running open-source software, which makes it easy to customize, repair, and upgrade. Tangara plays what you want to hear, however you want to hear it.
your pocket, and has a battery that lasts all day.
We're currently trying to scrape together a crowdfunding campaign! Please check us out on [Crowd Supply](https://www.crowdsupply.com/cool-tech-zone/tangara)!
## Source Repositories ## Source Repositories

@ -30,6 +30,7 @@ class LuaThread {
auto RunScript(const std::string& path) -> bool; auto RunScript(const std::string& path) -> bool;
auto bridge() -> Bridge& { return *bridge_; } auto bridge() -> Bridge& { return *bridge_; }
auto state() -> lua_State* { return state_; }
private: private:
LuaThread(std::unique_ptr<Allocator>&, std::unique_ptr<Bridge>&, lua_State*); LuaThread(std::unique_ptr<Allocator>&, std::unique_ptr<Bridge>&, lua_State*);

@ -264,6 +264,26 @@ auto EncoderInput::Read(lv_indev_data_t* data) -> void {
break; break;
} }
// Only trigger the directional long-press gestures if they trigger at the
// same time as a trigger on the overall touchwheel. This means the
// gestures only trigger if it's your only interaction with the wheel this
// press; scrolling and then resting on a direction should not trigger
// them.
trigger = TriggerKey(Keys::kTouchWheel, KeyStyle::kLongPress, now_ms);
if (trigger == Trigger::kLongPress) {
trigger =
TriggerKey(Keys::kDirectionalLeft, KeyStyle::kLongPress, now_ms);
switch (trigger) {
case Trigger::kNone:
break;
case Trigger::kClick:
break;
case Trigger::kLongPress:
events::Ui().Dispatch(internal::BackPressed{});
break;
}
}
break; break;
} }
} }

@ -129,6 +129,7 @@ class Lua : public UiState {
void react(const audio::PlaybackStarted&) override; void react(const audio::PlaybackStarted&) override;
void react(const audio::PlaybackUpdate&) override; void react(const audio::PlaybackUpdate&) override;
void react(const audio::PlaybackFinished&) override; void react(const audio::PlaybackFinished&) override;
void react(const internal::BackPressed&) override;
using UiState::react; using UiState::react;

@ -242,7 +242,7 @@ auto Lua::PushLuaScreen(lua_State* s) -> int {
return 0; return 0;
} }
auto Lua::PopLuaScreen(lua_State* s) -> int { auto Lua::PopLuaScreen(lua_State *s) -> int {
PopScreen(); PopScreen();
luavgl_set_root(s, sCurrentScreen->content()); luavgl_set_root(s, sCurrentScreen->content());
lv_group_set_default(sCurrentScreen->group()); lv_group_set_default(sCurrentScreen->group());
@ -303,6 +303,10 @@ void Lua::react(const audio::PlaybackFinished&) {
playback_playing_->Update(false); playback_playing_->Update(false);
} }
void Lua::react(const internal::BackPressed& ev) {
PopLuaScreen(sLua->state());
}
void Browse::entry() {} void Browse::entry() {}
void Browse::react(const internal::ShowSettingsPage& ev) { void Browse::react(const internal::ShowSettingsPage& ev) {

Loading…
Cancel
Save