Skip to content

Commit

Permalink
Merge pull request #9 from bigasdev/dev
Browse files Browse the repository at this point in the history
v1.1
  • Loading branch information
bigasdev authored May 27, 2024
2 parents 3063407 + b7ace49 commit 8762587
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ bld/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

*.zip

# Visual Studio 2017 auto generated files
Generated\ Files/

Expand Down
2 changes: 1 addition & 1 deletion config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ relative_name=null
relative_x=340
relative_y=160
[config]
lastWriteTime=-4721858902000000000
lastWriteTime=-4720830621000000000
[file]
fileName=config.ini
name=file
Expand Down
24 changes: 23 additions & 1 deletion src/Scenes/MainScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ std::vector<FileEntity*> m_selected_files;

static const char* m_selected_width = "800";
static const char* m_selected_quality = "5";
static const char* m_selected_fps = "20";

std::atomic<bool> is_convertion_running(false);

Expand Down Expand Up @@ -95,6 +96,13 @@ void MainScene::init()
//Convert command so we can attach it to another thread
void convert_command(const std::string& strCmdText) {
system(("CMD.exe " + strCmdText).c_str());

if(m_folder_path != ""){
//open the folder path
std::string command = "explorer " + m_folder_path;
system(command.c_str());
}

is_convertion_running = false;
}

Expand All @@ -105,7 +113,7 @@ void convert_file(std::string file){
std::string filenameWithoutExtension = filename.substr(0, filename.find_last_of("."));


std::string command = "-w " + std::string(m_selected_width) + " -q " + m_selected_quality + " -o \"" + m_folder_path + "\\" + filenameWithoutExtension + ".gif\""; // Default command
std::string command = "-w " + std::string(m_selected_width) + " -f " + m_selected_fps + " -q " + m_selected_quality + " -o \"" + m_folder_path + "\\" + filenameWithoutExtension + ".gif\""; // Default command

//std::string command = "-w 1024 -q 6 -o \"" + m_folder_path + "\\" + filenameWithoutExtension + ".gif\""; // Default command
std::cout << command << std::endl;
Expand Down Expand Up @@ -221,6 +229,7 @@ void video_settings(){
ImGui::Text("Video Settings");
const char* width[] = { "200", "400", "600", "800", "1024" };
const char* quality[] = { "1", "2", "3", "4", "5", "6" };
const char* fps[] = { "10", "15", "20", "25", "30", "35", "40", "45" };
ImGui::Text("Gif Width:");
if (ImGui::BeginCombo("##select_width", m_selected_width)) // The second parameter is the label previewed before opening the combo.
{
Expand All @@ -247,6 +256,19 @@ void video_settings(){
}
ImGui::EndCombo();
}
ImGui::Text("Gif FPS:");
if (ImGui::BeginCombo("##select_fps", m_selected_fps)) // The second parameter is the label previewed before opening the combo.
{
for (int n = 0; n < IM_ARRAYSIZE(fps); n++)
{
bool is_selected = (m_selected_fps == fps[n]); // You can store your selection however you want, outside or inside your objects
if (ImGui::Selectable(fps[n], is_selected))
m_selected_fps = fps[n];
if (is_selected)
ImGui::SetItemDefaultFocus(); // You may set the initial focus when opening the combo (scrolling + for keyboard navigation support)
}
ImGui::EndCombo();
}
ImGui::End();

}
Expand Down

0 comments on commit 8762587

Please sign in to comment.