Skip to content

Commit

Permalink
probably last fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyAdd committed Jan 6, 2025
1 parent 124ec4d commit 32b41db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/flvc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class FLVCEncoder {
public:
FLVCEncoder(uint16_t width, uint16_t height, uint16_t fps, const std::string& outputFilePath)
FLVCEncoder(uint16_t width, uint16_t height, uint16_t fps, const std::filesystem::path& outputFilePath)
: width(width), height(height), fps(fps), frameSize(width * height * 3), frameCount(0), outputFilePath(outputFilePath) {
outputFile.open(outputFilePath, std::ios::binary);
if (!outputFile.is_open()) {
Expand Down Expand Up @@ -60,7 +60,7 @@ class FLVCEncoder {
uint16_t fps;
size_t frameSize;
size_t frameCount;
std::string outputFilePath;
std::filesystem::path outputFilePath;
std::ofstream outputFile;

void writeHeader() {
Expand All @@ -80,7 +80,7 @@ class FLVCEncoder {

class FLVCDecoder {
public:
FLVCDecoder(const std::string& inputFilePath) : inputFilePath(inputFilePath) {
FLVCDecoder(const std::filesystem::path& inputFilePath) : inputFilePath(inputFilePath) {
inputFile.open(inputFilePath, std::ios::binary);
if (!inputFile.is_open()) {
return;
Expand Down Expand Up @@ -150,7 +150,7 @@ class FLVCDecoder {
uint16_t fps;
size_t frameSize;
size_t frameCount;
std::string inputFilePath;
std::filesystem::path inputFilePath;
std::ifstream inputFile;

void readHeader() {
Expand Down
3 changes: 2 additions & 1 deletion src/gui_mobile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "labels.hpp"
#include "replayEngine.hpp"
#include "utils.hpp"
#include "recorder.hpp"

using namespace geode::prelude;

Expand Down Expand Up @@ -334,7 +335,7 @@ bool HacksLayer::setup() {

auto justATestButton = ButtonSprite::create("Just a test", 80, true, "bigFont.fnt", "GJ_button_01.png", 30.f, 0.7f);
auto justATestButtonClick = CCMenuItemExt::createSpriteExtra(justATestButton, [this, &engine, info_label](CCMenuItemSpriteExtra* sender) {
utilsH::getFolder();
Recorder::get().start("");
});
justATestButtonClick->setPosition({270, 25});
engineTab->addChild(justATestButtonClick);
Expand Down
4 changes: 1 addition & 3 deletions src/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ void Recorder::restoreWinSize() {
}

void Recorder::start(std::string command) {
#ifdef GEODE_IS_WINDOWS
need_remove_black = false;
need_visible_lc = false;

Expand Down Expand Up @@ -124,7 +123,7 @@ void Recorder::start(std::string command) {

std::thread([&, command] {
// auto process = subprocess::Popen(command);
FLVCEncoder encoder(width, height, fps, "output.flvc");
FLVCEncoder encoder(width, height, fps, folderPath / "output.flvc");
while (is_recording || frame_has_data) {
lock.lock();
if (frame_has_data) {
Expand All @@ -141,7 +140,6 @@ void Recorder::start(std::string command) {
// return;
// }
}).detach();
#endif
}

void Recorder::stop() {
Expand Down

0 comments on commit 32b41db

Please sign in to comment.