See desc for more.

- Add WAV playback back with 10 MiB as max limit.

- Some more Screenshot Menu checks.
This commit is contained in:
StackZ
2020-12-03 07:19:02 +01:00
parent 78d0dad604
commit 64977911e6
22 changed files with 457 additions and 168 deletions
+6 -11
View File
@@ -67,16 +67,10 @@ public:
void drawThread();
void captureThread();
void handler(std::vector<u8>& out);
void handler(std::string &result);
bool done() const { return this->finished; };
bool cancelled() const { return this->cancel; };
bool Mode() const { return this->mode; };
void Info(bool v) { this->displayInfo = v; };
int selectedStore = 0, sPos = 0;
std::vector<StoreList> stores = { };
bool FromList = false;
uint8_t timeout = 30;
void List(bool v) { this->displayList = v; };
private:
void buffToImage();
void finish();
@@ -90,9 +84,10 @@ private:
std::atomic<bool> finished = false;
bool capturing = false;
bool cancel = false;
bool mode = true; // True -> Camera, False -> URL.
bool displayInfo = false;
bool displayList = false;
int selectedStore = 0, sPos = 0;
std::vector<StoreList> stores = { };
std::vector<u8> out;
};
/*
+1 -1
View File
@@ -55,7 +55,7 @@ private:
std::vector<std::string> dwnldList, dwnldSizes;
bool initialized = false, fetchDown = false, showMarks = false, showSettings = false,
ascending = false, updateFilter = false, screenshotFetch = false;
ascending = false, updateFilter = false, screenshotFetch = false, canDisplay = false;
int storeMode = 0, marks = 0, markIndex = 0, sPage = 0, lMode = 0, sSelection = 0,
lastMode = 0, smallDelay = 0, sPos = 0, screenshotIndex = 0, sSize = 0, zoom = 0;
+2 -2
View File
@@ -71,8 +71,8 @@ namespace StoreUtils {
void DrawCredits();
/* Screenshot menu. */
void DrawScreenshotMenu(const C2D_Image &img, const int sIndex, const bool sFetch, const int screenshotSize, const std::string &name, const int zoom);
void ScreenshotMenu(C2D_Image &img, int &sIndex, bool &sFetch, int &storeMode, const int screenshotSize, int &zoom);
void DrawScreenshotMenu(const C2D_Image &img, const int sIndex, const bool sFetch, const int screenshotSize, const std::string &name, const int zoom, const bool canDisplay);
void ScreenshotMenu(C2D_Image &img, int &sIndex, bool &sFetch, int &storeMode, const int screenshotSize, int &zoom, bool &canDisplay);
/* Settings. */
void DrawSettings(int page, int selection, int sPos);
+47
View File
@@ -0,0 +1,47 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_SOUND_HPP
#define _UNIVERSAL_UPDATER_SOUND_HPP
#include <3ds.h>
#include <string>
class Sound {
public:
Sound(const std::string &path, const int channel = 1, const bool toloop = true);
~Sound();
void play();
void stop();
private:
u32 dataSize;
bool good = true;
ndspWaveBuf waveBuf;
u8 *data = nullptr;
int chnl;
};
#endif