Compare commits
14
Commits
custom
...
custom-try-329
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea13d692a6 | ||
|
|
312bd22b3e | ||
|
|
2bf904135e | ||
|
|
0e18330233 | ||
|
|
1e340b2cea | ||
|
|
4a50ed775e | ||
|
|
0e7f0732c5 | ||
|
|
0c7a8909c7 | ||
|
|
20ccf51d2b | ||
|
|
3804b2e2e8 | ||
|
|
b87e991a1c | ||
|
|
4890c7915c | ||
|
|
b8f13c804b | ||
|
|
c4c6c9df7b |
@@ -199,6 +199,12 @@ precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "1996-2018 Free Software Foundation, Inc."
|
||||
SPDX-License-Identifier = "LGPL-2.1-or-later"
|
||||
|
||||
[[annotations]]
|
||||
path = "tools/fonts/ark/**"
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "2021 TakWolf"
|
||||
SPDX-License-Identifier = "OFL-1.1-RFN"
|
||||
|
||||
[[annotations]]
|
||||
path = "tools/fonts/fusion/**"
|
||||
precedence = "aggregate"
|
||||
|
||||
@@ -60,6 +60,72 @@ return screen:new {
|
||||
}
|
||||
end
|
||||
|
||||
local enqueue_fs_iterator = function(it)
|
||||
local cnt = 0
|
||||
while true do
|
||||
it:next()
|
||||
local item = it:value()
|
||||
if item == nil then
|
||||
break
|
||||
end
|
||||
|
||||
if not item:is_directory() and not playlist_iterator:is_playlist(item) and playback.is_playable(item:filepath()) then
|
||||
queue.add(item:filepath())
|
||||
end
|
||||
|
||||
-- safety
|
||||
cnt = cnt + 1
|
||||
if cnt > 1000 then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- copied from browser.lua
|
||||
local buttons = header:Object({
|
||||
flex = {
|
||||
flex_direction = "row",
|
||||
flex_wrap = "wrap",
|
||||
justify_content = "space-between",
|
||||
align_items = "center",
|
||||
align_content = "center"
|
||||
},
|
||||
w = lvgl.PCT(100),
|
||||
h = lvgl.SIZE_CONTENT,
|
||||
pad_column = 4
|
||||
})
|
||||
local original_iterator = self.iterator:clone()
|
||||
local enqueue = widgets.IconBtn(buttons, img.enqueue, "Enqueue")
|
||||
enqueue:onClicked(function()
|
||||
-- queue.add(original_iterator)
|
||||
enqueue_fs_iterator(original_iterator)
|
||||
playback.playing:set(true)
|
||||
end)
|
||||
local shuffle_play = widgets.IconBtn(buttons, img.shuffleplay, "Shuffle")
|
||||
shuffle_play:onClicked(function()
|
||||
queue.clear()
|
||||
queue.random:set(true)
|
||||
--queue.add(original_iterator)
|
||||
enqueue_fs_iterator(original_iterator)
|
||||
playback.playing:set(true)
|
||||
backstack.push(playing:new())
|
||||
end)
|
||||
-- enqueue:add_flag(lvgl.FLAG.HIDDEN)
|
||||
local play = widgets.IconBtn(buttons, img.play_small, "Play")
|
||||
play:onClicked(function()
|
||||
queue.clear()
|
||||
queue.random:set(false)
|
||||
--queue.add(original_iterator)
|
||||
enqueue_fs_iterator(original_iterator)
|
||||
playback.playing:set(true)
|
||||
backstack.push(playing:new())
|
||||
end)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
local get_icon_func = function(item)
|
||||
if item:is_directory() then
|
||||
return img.file_directory
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+22
-15
@@ -62,19 +62,18 @@ 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.]])
|
||||
end
|
||||
|
||||
local function xiphbsd(copyright)
|
||||
local function bsd3(copyright, name)
|
||||
show_license(copyright .. [[
|
||||
|
||||
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 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 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.
|
||||
* 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.
|
||||
* 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.
|
||||
|
||||
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. 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
|
||||
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.]])
|
||||
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.
|
||||
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;
|
||||
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
|
||||
|
||||
local function apache(copyright)
|
||||
@@ -179,6 +178,9 @@ return function(self)
|
||||
button:onClicked(show_fn)
|
||||
end
|
||||
|
||||
library("Ark Pixel font", "OFL", function()
|
||||
ofl("Copyright (C) 2021 TakWolf")
|
||||
end)
|
||||
library("catch2", "BSL", function()
|
||||
bsl("2022 Two Blue Cubes Ltd.")
|
||||
end)
|
||||
@@ -240,26 +242,31 @@ return function(self)
|
||||
apache("Copyright 2022 Ronald Ross Miller")
|
||||
end)
|
||||
library("ogg", "BSD", function()
|
||||
xiphbsd("Copyright (c) 2002, Xiph.org Foundation")
|
||||
bsd3("Copyright (c) 2002, Xiph.org Foundation", "Xiph.org Foundation")
|
||||
end)
|
||||
library("Opus", "BSD", function()
|
||||
xiphbsd(
|
||||
"Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, Jean-Marc Valin, Timothy B. Terriberry, CSIRO, Gregory Maxwell, Mark Borgerding, Erik de Castro Lopo")
|
||||
bsd3(
|
||||
"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)
|
||||
library("Opusfile", "BSD", function()
|
||||
xiphbsd("Copyright (c) 1994-2013 Xiph.Org Foundation and contributors")
|
||||
bsd3("Copyright (c) 1994-2013 Xiph.Org Foundation and contributors", "Xiph.org Foundation")
|
||||
end)
|
||||
library("result", "MIT", function()
|
||||
mit("Copyright (c) 2017-2021 Matthew Rodusek")
|
||||
end)
|
||||
library("speexdsp", "BSD", function()
|
||||
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")
|
||||
bsd3(
|
||||
"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)
|
||||
library("tinyfsm", "MIT", function()
|
||||
mit("Copyright (c) 2012-2022 Axel Burri")
|
||||
end)
|
||||
library("tremor", "BSD", function()
|
||||
xiphbsd("Copyright (c) 2002, Xiph.org Foundation")
|
||||
bsd3("Copyright (c) 2002, Xiph.org Foundation", "Xiph.org Foundation")
|
||||
end)
|
||||
library("WavPack", "BSD", function()
|
||||
bsd3("Copyright (c) 1998 - 2006 Conifer Software, All rights reserved.", "Conifer Software")
|
||||
end)
|
||||
end
|
||||
|
||||
+21
-7
@@ -406,24 +406,38 @@ settings.ThemeSettings = SettingsScreen:new {
|
||||
selected_idx = idx
|
||||
end
|
||||
|
||||
local theme_chooser = self.content:Dropdown {
|
||||
local theme_container = self.content:Object {
|
||||
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,
|
||||
symbol = img.chevron,
|
||||
}
|
||||
|
||||
local theme_chooser_desc = widgets.Description(theme_chooser, "Theme")
|
||||
theme_chooser:set({ selected = selected_idx })
|
||||
|
||||
theme_chooser:onevent(lvgl.EVENT.VALUE_CHANGED, function()
|
||||
local theme_reload = function()
|
||||
local option = theme_chooser:get('selected_str')
|
||||
local selectedTheme = themeOptions[option]
|
||||
if (selectedTheme) then
|
||||
theme.load_theme(tostring(selectedTheme))
|
||||
backstack.reset(main_menu:new())
|
||||
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_reload_btn:Label { text = "Reload" }
|
||||
theme_reload_btn:onClicked(theme_reload)
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ WavPackDecoder::WavPackDecoder() : input_(), buf_() {
|
||||
buf_ = static_cast<int32_t*>(
|
||||
heap_caps_malloc(
|
||||
kBufSize * sizeof(int32_t),
|
||||
MALLOC_CAP_INTERNAL | MALLOC_CAP_CACHE_ALIGNED
|
||||
MALLOC_CAP_INTERNAL | MALLOC_CAP_32BIT
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -148,9 +148,7 @@ void AudioState::react(const QueueUpdate& ev) {
|
||||
|
||||
void AudioState::react(const SetTrack& ev) {
|
||||
if (std::holds_alternative<std::monostate>(ev.new_track)) {
|
||||
ESP_LOGI(kTag, "playback finished, awaiting drain");
|
||||
sDecoder->open({});
|
||||
sStreamCues.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -212,6 +210,7 @@ void AudioState::react(const TtsPlaybackChanged& 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
|
||||
// need to advanve and start playing the next one ASAP in order to continue
|
||||
// gaplessly.
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
namespace audio {
|
||||
|
||||
static constexpr uint16_t kVolumeRange = 60;
|
||||
static constexpr uint16_t kVolumeStep = 2; // CUSTOM - added
|
||||
|
||||
using ConnectionState = drivers::Bluetooth::ConnectionState;
|
||||
|
||||
@@ -101,7 +102,11 @@ auto BluetoothAudioOutput::AdjustVolumeUp() -> bool {
|
||||
if (volume_ == 100) {
|
||||
return false;
|
||||
}
|
||||
volume_++;
|
||||
if (volume_ > 100 - kVolumeStep) {
|
||||
volume_ = 100;
|
||||
} else {
|
||||
volume_ += kVolumeStep;
|
||||
}
|
||||
SetVolume(volume_);
|
||||
return true;
|
||||
}
|
||||
@@ -110,7 +115,11 @@ auto BluetoothAudioOutput::AdjustVolumeDown() -> bool {
|
||||
if (volume_ == 0) {
|
||||
return false;
|
||||
}
|
||||
volume_--;
|
||||
if (volume_ < kVolumeStep) {
|
||||
volume_ = 0;
|
||||
} else {
|
||||
volume_ -= kVolumeStep;
|
||||
}
|
||||
SetVolume(volume_);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ static constexpr uint16_t kMinVolume = 0b0;
|
||||
static constexpr uint16_t kMaxVolumeBeforeClipping = 0x185;
|
||||
static constexpr uint16_t kLineLevelVolume = 0x13d;
|
||||
static constexpr uint16_t kDefaultVolume = 0x100;
|
||||
static constexpr uint16_t kVolumeStep = 5; // CUSTOM - added
|
||||
|
||||
I2SAudioOutput::I2SAudioOutput(drivers::IGpios& expander,
|
||||
drivers::OutputBuffers& buffers)
|
||||
@@ -140,21 +141,29 @@ auto I2SAudioOutput::SetVolumeDb(int_fast16_t val) -> bool {
|
||||
}
|
||||
|
||||
auto I2SAudioOutput::AdjustVolumeUp() -> bool {
|
||||
if (GetVolume() >= max_volume_) {
|
||||
uint16_t vol = GetVolume();
|
||||
if (vol >= max_volume_) {
|
||||
return false;
|
||||
}
|
||||
SetVolume(GetVolume() + 1);
|
||||
|
||||
if (vol > max_volume_ - kVolumeStep) {
|
||||
SetVolume(max_volume_);
|
||||
} else {
|
||||
SetVolume(vol + kVolumeStep);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
auto I2SAudioOutput::AdjustVolumeDown() -> bool {
|
||||
if (GetVolume() == kMinVolume) {
|
||||
uint16_t vol = GetVolume();
|
||||
if (vol == kMinVolume) {
|
||||
return false;
|
||||
}
|
||||
if (GetVolume() <= kMinVolume + 1) {
|
||||
if (vol <= kMinVolume + kVolumeStep) {
|
||||
SetVolume(0);
|
||||
} else {
|
||||
SetVolume(GetVolume() - 1);
|
||||
SetVolume(vol - kVolumeStep);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -43,11 +43,6 @@ 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> {
|
||||
if (!current_) {
|
||||
return {};
|
||||
|
||||
@@ -34,8 +34,6 @@ class StreamCues {
|
||||
|
||||
auto addCue(std::shared_ptr<TrackInfo>, uint32_t start_at) -> void;
|
||||
|
||||
auto clear() -> void;
|
||||
|
||||
private:
|
||||
uint32_t now_;
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ namespace input {
|
||||
|
||||
MediaButtons::MediaButtons(drivers::IGpios& gpios, audio::TrackQueue& queue)
|
||||
: gpios_(gpios),
|
||||
up_("upper", actions::nextTrack(queue), {}, {}, actions::volumeUp()),
|
||||
down_("lower", actions::prevTrack(queue), {}, {}, actions::volumeDown()),
|
||||
up_("upper", {}, actions::nextTrack(queue), {}, actions::volumeUp()),
|
||||
down_("lower", {}, actions::prevTrack(queue), {}, actions::volumeDown()),
|
||||
locked_(),
|
||||
both_buttons_pressed_(false) {}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "esp_log.h"
|
||||
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
|
||||
#include "drivers/spi.hpp"
|
||||
#include "ff.h"
|
||||
@@ -91,4 +92,64 @@ auto FileIterator::iterate(bool show_hidden) -> bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
FileIteratorSorted::FileIteratorSorted(std::string filepath, bool showHidden)
|
||||
: offset_(-1) {
|
||||
|
||||
FileIterator iter(filepath, showHidden);
|
||||
|
||||
while (true) {
|
||||
iter.next();
|
||||
std::optional<FileEntry> res = iter.value();
|
||||
if (res) {
|
||||
files_.push_back(*res);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::sort(files_.begin(), files_.end(),
|
||||
[](const auto& lhs, const auto& rhs) {
|
||||
if (lhs.isDirectory > rhs.isDirectory) {
|
||||
return true;
|
||||
} else if (lhs.isDirectory < rhs.isDirectory) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return lhs.name < rhs.name;
|
||||
});
|
||||
|
||||
// reindex the files
|
||||
for(size_t i = 0; i != files_.size(); i++) {
|
||||
files_[i].index = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
FileIteratorSorted::~FileIteratorSorted() {
|
||||
}
|
||||
|
||||
auto FileIteratorSorted::value() const -> const std::optional<FileEntry> {
|
||||
if (offset_ < 0 || offset_ >= files_.size()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return std::optional(files_[offset_]);
|
||||
}
|
||||
|
||||
auto FileIteratorSorted::next() -> void {
|
||||
if (offset_ < (int) files_.size()) {
|
||||
offset_++;
|
||||
}
|
||||
}
|
||||
|
||||
auto FileIteratorSorted::prev() -> void {
|
||||
if (offset_ <= 0) {
|
||||
offset_ = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
offset_--;
|
||||
}
|
||||
|
||||
|
||||
} // namespace lua
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "ff.h"
|
||||
|
||||
@@ -43,4 +44,18 @@ class FileIterator {
|
||||
auto iterate(bool reverse = false) -> bool;
|
||||
};
|
||||
|
||||
class FileIteratorSorted {
|
||||
public:
|
||||
FileIteratorSorted(std::string filepath, bool showHidden);
|
||||
~FileIteratorSorted();
|
||||
|
||||
auto value() const -> const std::optional<FileEntry>;
|
||||
auto next() -> void;
|
||||
auto prev() -> void;
|
||||
|
||||
private:
|
||||
std::vector<FileEntry> files_;
|
||||
int offset_;
|
||||
};
|
||||
|
||||
} // namespace lua
|
||||
|
||||
@@ -38,22 +38,22 @@ auto check_file_entry(lua_State* L, int stack_pos) -> lua::FileEntry* {
|
||||
return entry;
|
||||
}
|
||||
|
||||
auto check_file_iterator(lua_State* L, int stack_pos) -> lua::FileIterator* {
|
||||
lua::FileIterator* it = *reinterpret_cast<lua::FileIterator**>(
|
||||
auto check_file_iterator(lua_State* L, int stack_pos) -> lua::FileIteratorSorted* {
|
||||
lua::FileIteratorSorted* it = *reinterpret_cast<lua::FileIteratorSorted**>(
|
||||
luaL_checkudata(L, stack_pos, kFileIteratorMetatable));
|
||||
return it;
|
||||
}
|
||||
|
||||
static auto push_iterator(lua_State* state, const lua::FileIterator& it)
|
||||
static auto push_iterator(lua_State* state, const lua::FileIteratorSorted& it)
|
||||
-> void {
|
||||
lua::FileIterator** data = reinterpret_cast<lua::FileIterator**>(
|
||||
lua::FileIteratorSorted** data = reinterpret_cast<lua::FileIteratorSorted**>(
|
||||
lua_newuserdata(state, sizeof(uintptr_t)));
|
||||
*data = new lua::FileIterator(it);
|
||||
*data = new lua::FileIteratorSorted(it);
|
||||
luaL_setmetatable(state, kFileIteratorMetatable);
|
||||
}
|
||||
|
||||
static auto fs_iterate_prev(lua_State* state) -> int {
|
||||
lua::FileIterator* it = check_file_iterator(state, 1);
|
||||
lua::FileIteratorSorted* it = check_file_iterator(state, 1);
|
||||
it->prev();
|
||||
std::optional<lua::FileEntry> res = it->value();
|
||||
|
||||
@@ -67,7 +67,7 @@ static auto fs_iterate_prev(lua_State* state) -> int {
|
||||
}
|
||||
|
||||
static auto fs_iterate(lua_State* state) -> int {
|
||||
lua::FileIterator* it = check_file_iterator(state, 1);
|
||||
lua::FileIteratorSorted* it = check_file_iterator(state, 1);
|
||||
it->next();
|
||||
std::optional<lua::FileEntry> res = it->value();
|
||||
|
||||
@@ -81,13 +81,13 @@ static auto fs_iterate(lua_State* state) -> int {
|
||||
}
|
||||
|
||||
static auto fs_iterator_clone(lua_State* state) -> int {
|
||||
lua::FileIterator* it = check_file_iterator(state, 1);
|
||||
lua::FileIteratorSorted* it = check_file_iterator(state, 1);
|
||||
push_iterator(state, *it);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static auto fs_iterator_value(lua_State* state) -> int {
|
||||
lua::FileIterator* it = check_file_iterator(state, 1);
|
||||
lua::FileIteratorSorted* it = check_file_iterator(state, 1);
|
||||
std::optional<lua::FileEntry> res = it->value();
|
||||
|
||||
if (res) {
|
||||
@@ -100,7 +100,7 @@ static auto fs_iterator_value(lua_State* state) -> int {
|
||||
}
|
||||
|
||||
static auto fs_iterator_gc(lua_State* state) -> int {
|
||||
lua::FileIterator* it = check_file_iterator(state, 1);
|
||||
lua::FileIteratorSorted* it = check_file_iterator(state, 1);
|
||||
delete it;
|
||||
return 0;
|
||||
}
|
||||
@@ -155,7 +155,7 @@ static auto fs_new_iterator(lua_State* state) -> int {
|
||||
// Takes a filepath as a string and returns a new FileIterator
|
||||
// on that directory
|
||||
std::string filepath = luaL_checkstring(state, -1);
|
||||
lua::FileIterator iter(filepath, false);
|
||||
lua::FileIteratorSorted iter(filepath, false);
|
||||
push_iterator(state, iter);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace lua {
|
||||
|
||||
auto check_file_iterator(lua_State*, int stack_pos) -> lua::FileIterator*;
|
||||
auto check_file_iterator(lua_State*, int stack_pos) -> lua::FileIteratorSorted*;
|
||||
|
||||
auto RegisterFileSystemModule(lua_State*) -> void;
|
||||
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
Copyright (c) 2021, TakWolf (https://takwolf.com),
|
||||
with Reserved Font Name 'Ark Pixel'.
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://openfontlicense.org
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
@@ -0,0 +1,94 @@
|
||||
Copyright (c) 2021, TakWolf (https://takwolf.com),
|
||||
with Reserved Font Name 'Ark Pixel'.
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://openfontlicense.org
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
@@ -15,6 +15,10 @@ fusion_12() {
|
||||
-r 0x180-0x24F \
|
||||
-r 0x370-0x3FF \
|
||||
-r 0x400-0x4FF \
|
||||
--font ark/ark-pixel-12px-proportional/ark-pixel-12px-proportional-latin.ttf \
|
||||
-r 0x100-0x17F \
|
||||
-r 0x180-0x24F \
|
||||
-r 0x370-0x3FF \
|
||||
--font fusion/fusion-pixel-12px-proportional/fusion-pixel-12px-proportional-ja.ttf \
|
||||
-r 0x3000-0x303f,0x3040-0x309F,0x30A0-0x30FF \
|
||||
-r 0xFF00-0xFFEF,0x4E00-0x9FAF \
|
||||
@@ -34,6 +38,10 @@ fusion_10() {
|
||||
-r 0x180-0x24F \
|
||||
-r 0x370-0x3FF \
|
||||
-r 0x400-0x4FF \
|
||||
--font ark/ark-pixel-10px-proportional/ark-pixel-10px-proportional-latin.ttf \
|
||||
-r 0x100-0x17F \
|
||||
-r 0x180-0x24F \
|
||||
-r 0x370-0x3FF \
|
||||
--font fusion/fusion-pixel-10px-proportional/fusion-pixel-10px-proportional-ja.ttf \
|
||||
-r 0x3000-0x303f,0x3040-0x309F,0x30A0-0x30FF \
|
||||
-r 0xFF00-0xFFEF,0x4E00-0x9FAF \
|
||||
|
||||
Reference in New Issue
Block a user