Skip to content

Commit 5e1fed7

Browse files
committed
Add quickConvert settings in the menu
Why: How: Just added the option it is not working currenctly Tags:ffmpeg, ffmpeg_coder
1 parent 273a5e9 commit 5e1fed7

File tree

1 file changed

+43
-56
lines changed

1 file changed

+43
-56
lines changed

include/ffmpeg-coder/frontend_funcs.hpp

+43-56
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,118 @@
11
#if !defined(FRONTEND_FUNC_HPP)
22
#define FRONTEND_FUNC_HPP
33

4+
#include "ffmpeg_coder.hpp"
45
#include "rang.hpp"
5-
#include <iostream>
6-
#include <vector>
6+
#include "s_lock.hpp"
77
#include "utils.hpp"
8-
#include "ffmpeg_coder.hpp"
98
#include <fstream>
10-
#include "s_lock.hpp"
9+
#include <iostream>
10+
#include <vector>
1111

12-
//Functions
13-
void title()
14-
{
12+
// Functions
13+
void title() {
1514
decorateMe("FFMPEG Coder");
1615
}
1716

18-
void about()
19-
{
17+
void about() {
2018
clear_screen();
2119
std::string about_ffmpeg_coder;
2220
std::ifstream read_about("res/about.bin");
2321

24-
while (getline(read_about, about_ffmpeg_coder))
25-
{
22+
while (getline(read_about, about_ffmpeg_coder)) {
2623
std::cout << about_ffmpeg_coder;
2724
}
2825
}
2926

30-
void settings()
31-
{
27+
void settings() {
3228
int choice;
3329
clear_screen();
3430
std::vector<std::string> available_settings;
3531
available_settings.push_back("Startup-Lock");
32+
available_settings.push_back("Quick Convert Settings");
3633
available_settings.push_back("Go Back");
3734

38-
std::cout<<rang::fg::blue<<rang::style::bold<<"NB: "<<rang::style::reset<<"This feature only works in windows now !\n\n"<<rang::fg::reset<<std::endl;
39-
for (int i = 0; i < available_settings.size(); i++)
40-
{
35+
std::cout << rang::fg::blue << rang::style::bold
36+
<< "NB: " << rang::style::reset
37+
<< "This feature only works in windows now !\n\n"
38+
<< rang::fg::reset << std::endl;
39+
for (int i = 0; i < available_settings.size(); i++) {
4140
std::cout << (i + 1) << ". " << available_settings[i] << std::endl;
4241
}
4342

4443
std::cout << "\n\nGive your choice: ";
4544
std::cin >> choice;
4645

47-
switch (choice)
48-
{
49-
case 1:
50-
{
46+
switch (choice) {
47+
case 1: {
5148
S_Lock slock;
5249
slock.showOptions();
5350
break;
5451
}
5552

56-
case 2:
57-
{
58-
break;
53+
case 2: {
5954
}
6055

61-
default:
62-
std::cout << "Invalid choice !!";
56+
case 3: {
6357
break;
6458
}
59+
60+
default: std::cout << "Invalid choice !!"; break;
61+
}
6562
}
6663

67-
//Home page of the tool
68-
void homepage()
69-
{
64+
// Home page of the tool
65+
void homepage() {
7066
using namespace std;
7167

72-
ffmpeg ffmpeg; //Creating ffmpeg object
68+
ffmpeg ffmpeg; // Creating ffmpeg object
7369
int choice;
7470

75-
/* The char goBack variable is used for navigating to the main screen using the while loop */
71+
/* The char goBack variable is used for navigating to the main screen using
72+
* the while loop */
7673
char goBack;
77-
do
78-
{
74+
do {
7975
clear_screen();
8076
title();
81-
cout <<rang::style::dim << "Choose your option: "<< rang::style::reset << endl;
77+
cout << rang::style::dim << "Choose your option: " << rang::style::reset
78+
<< endl;
8279

83-
//Adding the options to the homepage menu (Main menu)
80+
// Adding the options to the homepage menu (Main menu)
8481
vector<string> options;
8582
options.push_back("Make Codes");
8683
options.push_back("Quick Convert (mp4)");
8784
options.push_back("About");
8885
options.push_back("Settings");
8986
options.push_back("Exit");
9087

91-
//showing the options
92-
for (int i = 0; i < options.size(); i++)
93-
{
88+
// showing the options
89+
for (int i = 0; i < options.size(); i++) {
9490
cout << (i + 1) << ". " << options[i] << endl;
9591
}
9692

97-
//taking choice input
98-
cout <<rang::bg::green<<rang::fg::black<<"\nYour choice: "<<rang::fg::reset<<rang::bg::reset;
93+
// taking choice input
94+
cout << rang::bg::green << rang::fg::black
95+
<< "\nYour choice: " << rang::fg::reset << rang::bg::reset;
9996
cin >> choice;
10097

101-
//Entering into selected option funcs
102-
if (choice == 1)
103-
{
98+
// Entering into selected option funcs
99+
if (choice == 1) {
104100
clear_screen();
105101
ffmpeg.load_encodes();
106102
ffmpeg.show_encodes();
107103
ffmpeg.select_encodes();
108104
ffmpeg.selected_action();
109-
}
110-
else if (choice == 2){
105+
} else if (choice == 2) {
111106
ffmpeg.quickConvert();
112-
}
113-
else if (choice == 3)
114-
{
107+
} else if (choice == 3) {
115108
about();
116-
}
117-
else if (choice == 4)
118-
{
109+
} else if (choice == 4) {
119110
settings();
120-
}
121-
else if (choice == 5)
122-
{
111+
} else if (choice == 5) {
123112
clear_screen();
124113
std::cout << "Exiting the program..............." << std::endl;
125114
exit(0);
126-
}
127-
else
128-
{
115+
} else {
129116
cout << "Invalid choice | Exiting...........";
130117
exit(0);
131118
}

0 commit comments

Comments
 (0)