Skip to content

Commit 1c6160f

Browse files
Run clang-format on all source files (#1465)
1 parent 40145ab commit 1c6160f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+511
-511
lines changed

src/GUI/ccextractorGUI.c

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void drop_callback(GLFWwindow *window, int count, const char **paths)
105105
}
106106

107107
/*Rectangle to hold file names*/
108-
//void draw_file_rectangle_widget(struct nk_context *ctx, struct nk_font *font)
108+
// void draw_file_rectangle_widget(struct nk_context *ctx, struct nk_font *font)
109109
//{
110110
// struct nk_command_buffer *canvas;
111111
// struct nk_input *input = &ctx->input;
@@ -132,10 +132,10 @@ void drop_callback(GLFWwindow *window, int count, const char **paths)
132132
// }
133133
// }
134134
//
135-
//}
135+
// }
136136

137137
/*Rectangle to hold extraction info*/
138-
//void draw_info_rectangle_widget(struct nk_context *ctx, struct nk_font *font)
138+
// void draw_info_rectangle_widget(struct nk_context *ctx, struct nk_font *font)
139139
//{
140140
// struct nk_command_buffer *canvas;
141141
// struct nk_input *input = &ctx->input;
@@ -157,18 +157,18 @@ void drop_callback(GLFWwindow *window, int count, const char **paths)
157157
// nk_draw_text(canvas, space, "Output Path: Default", 20, &font->handle, nk_rgb(88, 81, 96), nk_rgb(0, 0, 0));
158158
// space.y = space.y + 20;
159159
// nk_draw_text(canvas, space, "Hardsubs Extraction: Yes", 24, &font->handle, nk_rgb(88, 81, 96), nk_rgb(0, 0, 0));
160-
//}
160+
// }
161161

162162
int main(void)
163163
{
164164

165-
//Platform
165+
// Platform
166166
static GLFWwindow *win;
167167
struct nk_context *ctx;
168168
int screenWidth, screenHeight;
169-
//int winWidth, winHeight;
169+
// int winWidth, winHeight;
170170

171-
//GLFW
171+
// GLFW
172172
glfwSetErrorCallback(error_callback);
173173
if (!glfwInit())
174174
{
@@ -188,7 +188,7 @@ int main(void)
188188
exit(1);
189189
}
190190

191-
//GUI
191+
// GUI
192192

193193
struct file_browser browser;
194194
static const struct file_browser reset_browser;
@@ -203,7 +203,7 @@ int main(void)
203203
nk_glfw3_font_stash_end();
204204
nk_style_set_font(ctx, &droid->handle);
205205

206-
//CHECKBOX VALUES
206+
// CHECKBOX VALUES
207207
static int show_terminal_check = nk_false;
208208
static int show_preview_check = nk_false;
209209
static int show_activity_check = nk_false;
@@ -273,21 +273,21 @@ int main(void)
273273
fclose(saveFile);
274274
break;
275275
}
276-
//Input
276+
// Input
277277
glfwPollEvents();
278278
nk_glfw3_new_frame();
279279

280-
//Popups
280+
// Popups
281281
static int show_progress_details = nk_false;
282282
static int show_about_ccx = nk_false;
283283
static int show_getting_started = nk_false;
284284

285-
//GUI
285+
// GUI
286286
if (nk_begin(ctx, "CCExtractor", nk_rect(0, 0, WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow),
287287
NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BACKGROUND))
288288
{
289289

290-
//MENUBAR
290+
// MENUBAR
291291
nk_menubar_begin(ctx);
292292
nk_layout_row_begin(ctx, NK_STATIC, 30, 3);
293293
nk_layout_row_push(ctx, 80);
@@ -332,23 +332,23 @@ int main(void)
332332
nk_menu_end(ctx);
333333
}
334334

335-
//Network Settings
335+
// Network Settings
336336
if (network_settings.show_network_settings)
337337
draw_network_popup(ctx, &network_settings);
338338

339-
//About CCExtractor Popup
339+
// About CCExtractor Popup
340340
if (show_about_ccx)
341341
draw_about_ccx_popup(ctx, &show_about_ccx, &droid_big->handle, &droid_head->handle);
342342

343-
//Getting Started
343+
// Getting Started
344344
if (show_getting_started)
345345
draw_getting_started_popup(ctx, &show_getting_started);
346346

347-
//Color Popup
347+
// Color Popup
348348
if (output.color_popup)
349349
draw_color_popup(ctx, &output);
350350

351-
//File Browser as Popup
351+
// File Browser as Popup
352352
if (main_settings.scaleWindowForFileBrowser)
353353
{
354354
int width = 0, height = 0;
@@ -358,11 +358,11 @@ int main(void)
358358
file_browser_run(&browser, ctx, &main_settings, &output, &debug, &hd_homerun);
359359
}
360360

361-
//Thread popop when file can't be read
361+
// Thread popop when file can't be read
362362
if (main_settings.threadPopup)
363363
draw_thread_popup(ctx, &main_settings.threadPopup);
364364

365-
//Thread popup for hd_homerun thread
365+
// Thread popup for hd_homerun thread
366366
if (hd_homerun.threadPopup)
367367
draw_thread_popup(ctx, &hd_homerun.threadPopup);
368368

@@ -463,25 +463,25 @@ int main(void)
463463
nk_style_pop_vec2(ctx);
464464
}
465465

466-
//ADVANCED MODE FLAG
466+
// ADVANCED MODE FLAG
467467
static const float ratio_adv_mode[] = {0.75f, 0.22f, .03f};
468468
nk_layout_row(ctx, NK_DYNAMIC, 20, 3, ratio_adv_mode);
469469
nk_spacing(ctx, 1);
470470
nk_checkbox_label(ctx, "Advanced Mode", &advanced_mode_check);
471471

472-
//RADIO BUTTON 1
472+
// RADIO BUTTON 1
473473
static const float ratio_button[] = {.10f, .90f};
474474
static const float check_extension_ratio[] = {.10f, .53f, .12f, .15f, .10f};
475-
//static int op = FILES;
475+
// static int op = FILES;
476476
nk_layout_row(ctx, NK_DYNAMIC, 20, 2, ratio_button);
477477
nk_spacing(ctx, 1);
478478
if (nk_option_label(ctx, "Extract from files below:", main_settings.port_or_files == FILES))
479479
{
480-
//op = FILES;
480+
// op = FILES;
481481
main_settings.port_or_files = FILES;
482482
}
483483

484-
//CHECKBOX FOR FILE TYPES
484+
// CHECKBOX FOR FILE TYPES
485485
static int add_remove_button = nk_false;
486486
nk_layout_row(ctx, NK_DYNAMIC, 20, 5, check_extension_ratio);
487487
nk_spacing(ctx, 1);
@@ -525,7 +525,7 @@ int main(void)
525525
}
526526
}
527527

528-
//RECTANGLE-FILES
528+
// RECTANGLE-FILES
529529
static const float ratio_rect_files[] = {0.10f, 0.80f};
530530
nk_layout_row(ctx, NK_DYNAMIC, 180, 2, ratio_rect_files);
531531
nk_spacing(ctx, 1);
@@ -559,31 +559,31 @@ int main(void)
559559
nk_group_end(ctx);
560560
}
561561

562-
//RadioButton 2 along with combobox
562+
// RadioButton 2 along with combobox
563563
static const float ratio_port[] = {0.10f, 0.20f, 0.20f, 0.20f, 0.20f, 0.10f};
564564
nk_layout_row(ctx, NK_DYNAMIC, 20, 6, ratio_port);
565565
nk_spacing(ctx, 1);
566566
if (nk_option_label(ctx, "Extract from", main_settings.port_or_files == PORT))
567567
{
568-
//op = PORT;
568+
// op = PORT;
569569
main_settings.port_or_files = PORT;
570570
}
571571
main_settings.port_select = nk_combo(ctx, main_settings.port_type, 2, main_settings.port_select, 20, nk_vec2(85, 100));
572572
nk_label(ctx, " stream, on port:", NK_TEXT_LEFT);
573573

574-
//RADDIO BUTTON 2, TEXTEDIT FOR ENTERING PORT NUMBER
574+
// RADDIO BUTTON 2, TEXTEDIT FOR ENTERING PORT NUMBER
575575

576576
static int len;
577577
static char buffer[10];
578578
nk_edit_string(ctx, NK_EDIT_SIMPLE, main_settings.port_num, &main_settings.port_num_len, 8, nk_filter_decimal);
579579
nk_layout_space_begin(ctx, NK_STATIC, 10, 1);
580580
nk_layout_space_end(ctx);
581581

582-
//Extraction Information
582+
// Extraction Information
583583
nk_layout_row_dynamic(ctx, 10, 1);
584584
nk_text(ctx, "Extraction Info:", 16, NK_TEXT_CENTERED);
585585

586-
//RECTANGLE-INFO
586+
// RECTANGLE-INFO
587587
static const float ratio_rect_info[] = {0.10f, 0.80f, 0.10f};
588588
nk_layout_row(ctx, NK_DYNAMIC, 75, 2, ratio_rect_info);
589589
nk_spacing(ctx, 1);
@@ -608,14 +608,14 @@ int main(void)
608608

609609
nk_layout_space_begin(ctx, NK_STATIC, 10, 1);
610610
nk_layout_space_end(ctx);
611-
//PROGRESSBAR
611+
// PROGRESSBAR
612612
static const float ratio_progress[] = {0.10f, 0.03f, 0.57f, 0.03f, 0.17f, 0.10f};
613613
nk_layout_row(ctx, NK_DYNAMIC, 20, 6, ratio_progress);
614614
nk_spacing(ctx, 1);
615615
nk_spacing(ctx, 1);
616616
nk_progress(ctx, &main_settings.progress_cursor, 101, nk_false);
617617

618-
//Extract Button
618+
// Extract Button
619619
nk_spacing(ctx, 1);
620620
if (nk_button_label(ctx, "Extract"))
621621
{
@@ -626,7 +626,7 @@ int main(void)
626626
nk_layout_space_begin(ctx, NK_STATIC, 10, 1);
627627
nk_layout_space_end(ctx);
628628

629-
//PROGRESS_DETAILS_BUTTON
629+
// PROGRESS_DETAILS_BUTTON
630630
if (!show_activity_check)
631631
{
632632
nk_layout_row_dynamic(ctx, 20, 3);
@@ -638,11 +638,11 @@ int main(void)
638638
nk_spacing(ctx, 1);
639639
}
640640

641-
//PROGRESS_DETAILS_POPUP
641+
// PROGRESS_DETAILS_POPUP
642642
if (show_progress_details)
643643
draw_progress_details_popup(ctx, &show_progress_details, &main_settings);
644644

645-
//build command string
645+
// build command string
646646
command_builder(&command, &main_settings, &network_settings, &input, &advanced_input, &output, &decoders, &credits, &debug, &burned_subs);
647647
}
648648
nk_end(ctx);
@@ -735,9 +735,9 @@ int main(void)
735735
glViewport(0, 0, screenWidth, screenHeight);
736736
glClear(GL_COLOR_BUFFER_BIT);
737737
/* IMPORTANT: `nk_glfw_render` modifies some global OpenGL state
738-
* with blending, scissor, face culling and depth test and defaults everything
739-
* back into a default state. Make sure to either save and restore or
740-
* reset your own state after drawing rendering the UI. */
738+
* with blending, scissor, face culling and depth test and defaults everything
739+
* back into a default state. Make sure to either save and restore or
740+
* reset your own state after drawing rendering the UI. */
741741
nk_glfw3_render(NK_ANTI_ALIASING_ON);
742742
glfwSwapBuffers(win);
743743
}
@@ -757,7 +757,7 @@ int main(void)
757757
glDeleteTextures(1, (const GLuint *)&media.icons.movie_file.handle.id);
758758

759759
file_browser_free(&browser);
760-
//free(main_settings.filenames);
760+
// free(main_settings.filenames);
761761

762762
nk_glfw3_shutdown();
763763
glfwTerminate();
@@ -786,7 +786,7 @@ char *truncate_path_string(char *filePath)
786786
char *file_path = strdup(filePath);
787787
int i, j, z, slash_length, fileNameTruncated_index, copycount, prefix_length;
788788
char file_name[PATH_LENGTH], *ptr_slash, fileNameTruncated[NAME_LENGTH];
789-
//strcpy(filePath[i], paths[i]);
789+
// strcpy(filePath[i], paths[i]);
790790
if (strlen(filePath) >= PATH_LENGTH - 1)
791791
{
792792
#ifdef _WIN32
@@ -847,10 +847,10 @@ char *truncate_path_string(char *filePath)
847847

848848
void remove_path_entry(struct main_tab *main_settings, int indexToRemove)
849849
{
850-
//printf("Beginning processing. Array is currently: ");
851-
//for (int i = 0; i < arraySize; ++i)
850+
// printf("Beginning processing. Array is currently: ");
851+
// for (int i = 0; i < arraySize; ++i)
852852
// printf("%d ", (*array)[i]);
853-
//printf("\n");
853+
// printf("\n");
854854

855855
char **temp = (char **)calloc(main_settings->filename_count, sizeof(char *)); // allocate an array with a size 1 less than the current one
856856

src/GUI/command_builder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <stdio.h>
44
#include <string.h>
55
#include <stdlib.h>
6-
#endif //!NK_IMPLEMENTATION
6+
#endif //! NK_IMPLEMENTATION
77

88
#include "ccextractorGUI.h"
99
#include "tabs.h"
@@ -398,7 +398,7 @@ void command_builder(struct built_string *command,
398398
strcat(buffer, " -detect_italics");
399399
}
400400

401-
//Output
401+
// Output
402402
{
403403
strcat(buffer, " -out=");
404404
strcat(buffer, output->type[output->type_select]);

src/GUI/popups.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void draw_network_popup(struct nk_context *ctx, struct network_popup *network_se
8383
nk_label(ctx, network_attr[5], NK_TEXT_LEFT);
8484
nk_edit_string(ctx, NK_EDIT_SIMPLE, text_buffer[5], &text_len[5], 50, nk_filter_default);*/
8585

86-
//OK Button
86+
// OK Button
8787
nk_layout_row(ctx, NK_DYNAMIC, 27, 3, save_ok_ratio);
8888
nk_spacing(ctx, 1);
8989
if (nk_button_label(ctx, "Save"))

0 commit comments

Comments
 (0)