mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Limit 50 items per page in sndboard. Maybe solves oom (#2263)
This commit is contained in:
parent
a21e9ca1af
commit
b3a0ad018c
@ -35,6 +35,8 @@ using namespace portapack;
|
|||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
|
||||||
|
#define FILE_PER_PAGE 50
|
||||||
|
|
||||||
bool SoundBoardView::is_active() const {
|
bool SoundBoardView::is_active() const {
|
||||||
return (bool)replay_thread;
|
return (bool)replay_thread;
|
||||||
}
|
}
|
||||||
@ -178,9 +180,9 @@ void SoundBoardView::refresh_list() {
|
|||||||
if ((reader->channels() == 1) && ((reader->bits_per_sample() == 8) || (reader->bits_per_sample() == 16))) {
|
if ((reader->channels() == 1) && ((reader->bits_per_sample() == 8) || (reader->bits_per_sample() == 16))) {
|
||||||
// sounds[c].ms_duration = reader->ms_duration();
|
// sounds[c].ms_duration = reader->ms_duration();
|
||||||
// sounds[c].path = u"WAV/" + entry.path().native();
|
// sounds[c].path = u"WAV/" + entry.path().native();
|
||||||
if (count >= (page - 1) * 100 && count < page * 100) {
|
if (count >= (page - 1) * FILE_PER_PAGE && count < page * FILE_PER_PAGE) {
|
||||||
file_list.push_back(entry.path());
|
file_list.push_back(entry.path());
|
||||||
if (file_list.size() == 100) {
|
if (file_list.size() == FILE_PER_PAGE) {
|
||||||
page++;
|
page++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -225,7 +227,7 @@ void SoundBoardView::refresh_list() {
|
|||||||
menu_view.set_highlighted(0); // Refresh
|
menu_view.set_highlighted(0); // Refresh
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_list.size() < 100) {
|
if (file_list.size() < FILE_PER_PAGE) {
|
||||||
page = 1;
|
page = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user