From 23fe5908a816423e878666169d64201227c52978 Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Fri, 30 Sep 2016 11:54:00 -0400 Subject: [PATCH 01/10] Remove un necessary files Not needed for the test branch --- AutoConvert.py | 812 ---------------------------------- AutoConvert_GUI.pyw | 345 --------------- Cold_storage/Auto Convert.bat | 591 ------------------------- Easy MP4.bat | 96 ---- Easy SWF.bat | 90 ---- Easy WMV.bat | 104 ----- Helpful-Material/MP4.cfg | 13 - Helpful-Material/SWF.cfg | 10 - Helpful-Material/WMV.cfg | 19 - inspiration/Convert.vbs | 173 -------- 10 files changed, 2253 deletions(-) delete mode 100644 AutoConvert.py delete mode 100644 AutoConvert_GUI.pyw delete mode 100644 Cold_storage/Auto Convert.bat delete mode 100644 Easy MP4.bat delete mode 100644 Easy SWF.bat delete mode 100644 Easy WMV.bat delete mode 100644 Helpful-Material/MP4.cfg delete mode 100644 Helpful-Material/SWF.cfg delete mode 100644 Helpful-Material/WMV.cfg delete mode 100644 inspiration/Convert.vbs diff --git a/AutoConvert.py b/AutoConvert.py deleted file mode 100644 index 28df944..0000000 --- a/AutoConvert.py +++ /dev/null @@ -1,812 +0,0 @@ -from os import path, chdir, listdir, makedirs, remove -from subprocess import call -from platform import system -from webbrowser import open_new_tab - - -# Variables naming convention: -# Variables for menus are prefixed with me_ -# Variables for the MP4 section are prefixed with m_ -# Variables for the WMV section are prefixed with w_ -# Variables for the SWF section are prefixed with s_ - -class init_system: - def __init__(self): - self.init_vars = {"path_to_file": path.abspath(__file__), - "nbr_path": path.normpath("C:/ProgramData/WebEx/WebEx/500/nbrplay.exe"), - "file_type": "mp4", - "showui": 0, - "need_ui_section": 1, - "width": 1920, - "height": 1080, - "m_ui_chat": 1, - "m_ui_qa": 1, - "m_ui_largeroutline": 1, - "m_framerate": 5, - "s_console_pcaudio": 0, - "s_framerate": 10, - "w_console_pcaudio": 0, - "w_ui_chat": 1, - "w_ui_video": 1, - "w_ui_largeroutline": 1, - "w_videocodec": "Windows Media Video 9", - "w_audiocodec": "Windows Media Audio 9.2 Lossless", - "w_videoformat": "default", - "w_audioformat": "default", - "w_videokeyframes": 4, - "w_maxstream": 1000} - self.init_vars["directory_name"] = path.dirname(self.init_vars["path_to_file"]) - self.init_vars["input_file_dir"] = path.dirname(self.init_vars["path_to_file"]) - self.init_vars["output_file_dir"] = path.dirname(self.init_vars["path_to_file"]) + "\\Converted" - self.check_os() - self.locate_nbr() - - def check_os(self): - if system() != "Windows": - clear_screen() - print("Please use Windows for file conversions.\nOther OSs are currently not supported :-(") - exit_program(False) - # Checks the operating system to see if it is compatible. If not, it displays an error and quits the program. - - - def locate_nbr(self): - if not self.check_file_existance(self.init_vars["nbr_path"]): - print("The system could not find the NBR player.\nWould you like to download it?") - me_locate_nbr = str(input("\nY or N: ")) - if me_locate_nbr.lower() == "y": - open_new_tab("www.webex.com/play-webex-recording.html") - exit() - elif me_locate_nbr.lower() == "n": - clear_screen() - print("Maybe we missed it...\nDo you have the NBR player installed already?") - me_nbr_already_installed = str(input("Y or N: ")) - if nbr_already_installed == "y": - self.custom_nbr_location() - self.locate_nbr() - else: - clear_screen() - print("This script requires the Network Broadcast Recording player to operate.") - print("Please have it installed for the next time you run this script.") - input("\nPress Enter/Return to continue...") - exit_program(False) - else: - return True - - # If the nbr.exe is not at the default location, asks user where it is. If not installed asks user if the user wishes to - # download the program. If the user does not want to then it stops the script and tells the user that it is required. - - - def check_file_existance(self, file_path): - result = path.exists(file_path) - return result - # Checks the given file path to see if the file exists and returns true or false. - - - def custom_nbr_location(self): - clear_screen() - print("Please enter the path to the nbrplay.exe here") - self.init_vars["nbr_path"] = input("\n(E.G. C:\\foo\\bar\\nbrplay.exe): ") - # Sets the nbr_path variable to the user provided path. The folder must exist to be accepted. - - - def check_folder(self): - error_num = 0 - if not path.exists(self.init_vars["input_file_dir"]): - error_num = error_num + 5 - elif not path.exists(self.init_vars["output_file_dir"]): - error_num = error_num + 4 - return error_num - # Check is the source directory exists and if it does not then displays an error and goes back to the main menu. - # Also checks if the output directory exists and if it does not it creates it. - # 0 = a, ok! - # 5 = input - # 4 = output - # 9 = input and output - - -# Sets up the initial variables and checks for system compatibility. Also houses generic core functions. - - -def clear_screen(): - if system() == "Windows": - call("cls", shell=True) - elif system() == "Darwin" or system() == "Linux": - call("clear", shell=True) - - -# Sets up a multi platform clear screen function for Windows, OS X and Linux - - -def main_menu(): - clear_screen() - print("Welcome to the Automatic ARF converter program. You have 5 options to chose from:") - print("\n1. Convert file(s) to MP4") - print("2. Convert file(s) to WMV") - print("3. Convert file(s) to SWF") - print("\n4. Advanced Options") - print("5. Exit program") - me_main_menu = int(input("\nEnter your selection here (1-5) then press Enter/Return: ")) - if me_main_menu == 1: - vars_system.init_vars["file_type"] = "mp4" - convert_file() - elif me_main_menu == 2: - vars_system.init_vars["file_type"] = "wmv" - convert_file() - elif me_main_menu == 3: - vars_system.init_vars["file_type"] = "swf" - convert_file() - elif me_main_menu == 4: - options_menu() - elif me_main_menu == 5: - exit_program(True) - else: - clear_screen() - print("Please enter a valid number from 1 to 5!") - input("\n Press Enter/Return to continue...") - main_menu() - - -# Creates the main menu for the user to navigate. - - -def convert_file(): - if vars_system.check_folder() == 5: - print("The ARF input dir is invalid, please check that it exists.") - input("\n Press Enter/Return to return to the main menu...") - main_menu() - if vars_system.check_folder() == 4: - print("The ARF output dir is invalid, please check that it exists.") - input("\n Press Enter/Return to return to the main menu...") - main_menu() - if vars_system.check_folder() == 9: - print("The ARF input and output dir is invalid, please check that they exist.") - input("\n Press Enter/Return to return to the main menu...") - main_menu() - cfg_counter = 0 - for file in listdir("."): - if path.isfile(file) and file[-3:].lower() == "cfg": - remove(file) - for file in listdir("."): - if path.isfile(file) and file[-3:].lower() == "arf": - create_configs(file) - cfg_counter += 1 - for file in listdir("."): - if path.isfile(file) and file[-3:].lower() == "cfg": - clear_screen() - print("%s Files left to convert. This may take a while..." % str(cfg_counter)) - execute_nbr_conversion(vars_system.init_vars["input_file_dir"] + "\\" + file) - cfg_counter -= 1 - remove(file) - convert_again() - - -# Deletes CFG files already present in the selected/default folder then creates new config files. After the cfg creation -# is complete, the NBR player is executed with the new cfg files for reference while the remaining files are counted -# down. - - -def create_configs(fname): - with open(fname[:-3] + "cfg", "a") as config_file: - config_file.write("[Console]") - config_file.write("\ninputfile=%s" % vars_system.init_vars["input_file_dir"] + "\\" + fname) - config_file.write("\nmedia=%s" % vars_system.init_vars["file_type"].upper()) - config_file.write("\nshowui=%s" % vars_system.init_vars["showui"]) - if vars_system.init_vars["file_type"].lower() == "swf": - config_file.write("\nPCAudio=%s" % vars_system.init_vars["s_console_pcaudio"]) - elif vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nPCAudio=%s" % vars_system.init_vars["w_console_pcaudio"]) - if vars_system.init_vars["need_ui_section"] == 1: - config_file.write("\n[UI]") - if vars_system.init_vars["file_type"].lower() == "mp4": - config_file.write("\nchat=%s" % vars_system.init_vars["m_ui_chat"]) - elif vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nchat=%s" % vars_system.init_vars["w_ui_chat"]) - if vars_system.init_vars["file_type"].lower() == "mp4": - config_file.write("\nqa=%s" % vars_system.init_vars["m_ui_qa"]) - elif vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nvideo=%s" % vars_system.init_vars["w_ui_video"]) - if vars_system.init_vars["file_type"].lower() == "mp4": - config_file.write("\nlargeroutline=%s" % vars_system.init_vars["m_ui_largeroutline"]) - elif vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nlargeroutline=%s" % vars_system.init_vars["w_ui_largeroutline"]) - config_file.write("\n[%s]" % vars_system.init_vars["file_type"].upper()) - config_file.write("\noutputfile=%s" % vars_system.init_vars["output_file_dir"] + "\\" + fname[:-3] + vars_system.init_vars["file_type"].lower()) - config_file.write("\nwidth=%s" % vars_system.init_vars["width"]) - config_file.write("\nheight=%s" % vars_system.init_vars["height"]) - if vars_system.init_vars["file_type"].lower() == "mp4": - config_file.write("\nframerate=%s" % vars_system.init_vars["m_framerate"]) - elif vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nvideocodec=%s" % vars_system.init_vars["w_videocodec"]) - elif vars_system.init_vars["file_type"].lower() == "swf": - config_file.write("\nframerate=%s" % vars_system.init_vars["s_framerate"]) - if vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\naudiocodec=%s" % vars_system.init_vars["w_audiocodec"]) - if vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nvideoformat=%s" % vars_system.init_vars["w_videoformat"]) - if vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\naudioformat=%s" % vars_system.init_vars["w_audioformat"]) - if vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nvideokeyframes=%s" % vars_system.init_vars["w_videokeyframes"]) - if vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nmaxstream=%s" % vars_system.init_vars["w_maxstream"]) - - -# Creates configuration files for the nbrplayer to use to convert the files. - - -def execute_nbr_conversion(cfg_name): - call(vars_system.init_vars["nbr_path"] + " -Convert" + ' "' + cfg_name + '"') - - -# Executes the nbr executable with the path to the generated cfg file. - - -def convert_again(): - clear_screen() - print("The conversion is finished.") - print("Would you like to run another bulk conversion?") - me_convert_again = input("\nType Y for yes and N for no then press Enter/Return to continue: ") - if me_convert_again.lower() == "y": - main_menu() - else: - exit_program(True) - - -# Asks the user if they would like to convert another batch of files. - - -def options_menu(): - clear_screen() - print("Here you can change options for the conversion. You have 6 options to chose from:") - print("\n1. MP4 Options") - print("2. WMV Options") - print("3. SWF Options") - print("4. Global Options (applies to all formats)") - print("\n5. Restore default settings") - print("\n6. Go back to the main menu") - me_options_menu = int(input("\nEnter your selection here (1-6)")) - if me_options_menu == 1: - mp4_options_menu() - elif me_options_menu == 2: - wmv_options_menu() - elif me_options_menu == 3: - swf_options_menu() - elif me_options_menu == 4: - global_options_menu() - elif me_options_menu == 5: - restore_default_settings() - elif me_options_menu == 6: - main_menu() - else: - clear_screen() - print("Please enter a valid number from 1 to 6!") - input("\nPress Enter/Return to continue...") - options_menu() - - -# Creates the options menu for the user to navigate. - - -def mp4_options_menu(): - clear_screen() - print("MP4 Files have 4 configurable options (at the moment)\n\n1. Toggle Chat Window\n2. Toggle Q&A Box") - print("3. Toggle Largeroutline\n4. Change frame rate\n\n5. Go back to the main options menu.") - me_mp4_options_menu = int(input("\nPlease enter 1-5 and press Enter/Return: ")) - if me_mp4_options_menu == 1: - mp4_toggle_chat() - elif me_mp4_options_menu == 2: - mp4_toggle_qa() - elif me_mp4_options_menu == 3: - mp4_toggle_largeroutline() - elif me_mp4_options_menu == 4: - mp4_change_framerate() - elif me_mp4_options_menu == 5: - options_menu() - else: - clear_screen() - print("Please enter a valid number from 1 to 5!") - input("\n Press Enter/Return to continue...") - mp4_options_menu() - - -# Lists settings available for the MP4 file format - - -def mp4_toggle_chat(): - clear_screen() - print("The Q&A box toggle is set to: %s" % vars_system.init_vars["m_ui_chat"]) - print("\nPress Y to toggle the setting. Leave it blank to do nothing.") - me_mp4_toggle_chat = input("Press Enter/Return when you are ready to continue: ") - if me_mp4_toggle_chat.lower() == "y": - if vars_system.init_vars["m_ui_chat"] == 1: - vars_system.init_vars["m_ui_chat"] = 0 - else: - vars_system.init_vars["m_ui_chat"] = 1 - clear_screen() - print("The Q&A box toggle is now set to: %s" % vars_system.init_vars["m_ui_chat"]) - input("Press Enter/Return to continue...") - mp4_options_menu() - - -# Toggles the chat box setting for MP4 files. - - -def mp4_toggle_qa(): - clear_screen() - print("The Q&A box toggle is set to: %s" % vars_system.init_vars["m_ui_qa"]) - print("\nPress Y to toggle the setting. Leave it blank to do nothing.") - me_mp4_toggle_qa = input("Press Enter/Return when you are ready to continue: ") - if me_mp4_toggle_qa.lower() == "y": - if vars_system.init_vars["m_ui_qa"] == 1: - vars_system.init_vars["m_ui_qa"] = 0 - else: - vars_system.init_vars["m_ui_qa"] = 1 - clear_screen() - print("The Q&A box toggle is now set to: %s" % vars_system.init_vars["m_ui_qa"]) - input("Press Enter/Return to continue...") - mp4_options_menu() - - -# Toggles the Q&A box setting for MP4 files. - - -def mp4_toggle_largeroutline(): - clear_screen() - print("The LargerOutline toggle is set to: %s" % vars_system.init_vars["m_ui_largeroutline"]) - print("\nPress Y to toggle the setting. Leave it blank to do nothing.") - me_mp4_toggle_largeroutline = input("Press Enter/Return when you are ready to continue: ") - if me_mp4_toggle_largeroutline.lower() == "y": - if vars_system.init_vars["m_ui_largeroutline"] == 1: - vars_system.init_vars["m_ui_largeroutline"] = 0 - else: - vars_system.init_vars["m_ui_largeroutline"] = 1 - clear_screen() - print("The LargerOutline toggle is now set to: %s" % vars_system.init_vars["m_ui_largeroutline"]) - input("Press Enter/Return to continue...") - mp4_options_menu() - - -# Toggles the LargerOutline setting for MP4 files. - - -def mp4_change_framerate(): - clear_screen() - print("The current frame rate is set to: %sFPS.\nLeave it blank to do nothing." % vars_system.init_vars["m_framerate"]) - print("Enter a number above 0 (the recommended range is 1 to 10) to change the setting.") - me_mp4_change_framerate = int(input("Press Enter/Return when you are ready to continue: ")) - if me_mp4_change_framerate > 0: - vars_system.init_vars["m_framerate"] = me_mp4_change_framerate - clear_screen() - print("The frame rate is now set to: %sFPS" % vars_system.init_vars["m_framerate"]) - input("Press Enter/Return to continue...") - mp4_options_menu() - - -# Changes the frame rate for MP4 files. - - -def wmv_options_menu(): - clear_screen() - print("WMV Files have 10 configurable options (at the moment)\n\n1. Toggle PCAudio setting\n2. Toggle Chat Box") - print("3. Toggle Webcam Video\n4. Toggle Largeroutline setting\n5. Change the video codex") - print("6. Change the audio codex\n7. Alter the Videoformat setting\n8. Alter the Audioformat setting") - print("9. Change the video key frames (frame rate)\n10. Change the maxstream (bit rate)") - print("\n\n11. Go back to the main options menu.") - me_wmv_options_menu = int(input("\nPlease enter 1-11 and press Enter/Return: ")) - if me_wmv_options_menu == 1: - wmv_toggle_pcaudio() - elif me_wmv_options_menu == 2: - wmv_toggle_chat_box() - elif me_wmv_options_menu == 3: - wmv_toggle_webcam_video() - elif me_wmv_options_menu == 4: - wmv_toggle_largeroutline() - elif me_wmv_options_menu == 5: - wmv_change_videocodec() - elif me_wmv_options_menu == 6: - wmv_change_audiocodec() - elif me_wmv_options_menu == 7: - wmv_alter_videoformat() - elif me_wmv_options_menu == 8: - wmv_alter_audioformat() - elif me_wmv_options_menu == 9: - wmv_change_keyframes() - elif me_wmv_options_menu == 10: - wmv_change_maxstream() - elif me_wmv_options_menu == 11: - options_menu() - else: - clear_screen() - print("Please enter a valid number from 1 to 11!") - input("\nPress Enter/Return to continue...") - wmv_options_menu() - - -# Lists settings available for the WMV file format - - -def wmv_toggle_pcaudio(): - clear_screen() - print("The PCAudio toggle is set to: %s\n Would you like to toggle this setting?" % vars_system.init_vars["w_console_pcaudio"]) - print("This is an experimental and untested setting!!!") - print("\nPress Y to toggle the setting. Leave it blank to do nothing.") - me_wmv_toggle_pcaudio = input("Press Enter/Return when you are ready to continue: ") - if me_wmv_toggle_pcaudio.lower() == "y": - if vars_system.init_vars["w_console_pcaudio"] == 1: - vars_system.init_vars["w_console_pcaudio"] = 0 - else: - vars_system.init_vars["w_console_pcaudio"] = 1 - clear_screen() - print("The PCAudio toggle is now set to: %s" % vars_system.init_vars["w_console_pcaudio"]) - input("Press Enter/Return to continue...") - wmv_options_menu() - - -# Enables or Disables the PCAudio setting for the WMV file - - -def wmv_toggle_chat_box(): - clear_screen() - print("The chat box toggle is set to: %s\n Would you like to toggle this setting?" % vars_system.init_vars["w_ui_chat"]) - print("\nPress Y to toggle the setting. Leave it blank to do nothing.") - me_wmv_toggle_chat_box = input("Press Enter/Return when you are ready to continue: ") - if me_wmv_toggle_chat_box.lower() == "y": - if vars_system.init_vars["w_ui_chat"] == 1: - vars_system.init_vars["w_ui_chat"] = 0 - else: - vars_system.init_vars["w_ui_chat"] = 1 - clear_screen() - print("The chat box toggle is now set to: %s" % vars_system.init_vars["w_ui_chat"]) - input("Press Enter/Return to continue...") - wmv_options_menu() - - -# Toggles the chat box setting for WMV files. - - -def wmv_toggle_webcam_video(): - clear_screen() - print("The web cam box toggle is set to: %s\n Would you like to toggle this setting?" % vars_system.init_vars["w_ui_video"]) - print("\nPress Y to toggle the setting. Leave it blank to do nothing.") - me_wmv_toggle_video_box = input("Press Enter/Return when you are ready to continue: ") - if me_wmv_toggle_video_box.lower() == "y": - if vars_system.init_vars["w_ui_video"] == 1: - vars_system.init_vars["w_ui_video"] = 0 - else: - vars_system.init_vars["w_ui_video"] = 1 - clear_screen() - print("The web cam toggle is now set to: %s" % vars_system.init_vars["w_ui_video"]) - input("Press Enter/Return to continue...") - wmv_options_menu() - - -# Toggles the web cam box setting for WMV files. - - -def wmv_toggle_largeroutline(): - clear_screen() - print("The LargerOutline toggle is set to: %s\n Would you like to toggle this setting?" % vars_system.init_vars["w_ui_largeroutline"]) - print("\nPress Y to toggle the setting. Leave it blank to do nothing.") - me_wmv_toggle_largeroutline = input("Press Enter/Return when you are ready to continue: ") - if me_wmv_toggle_largeroutline.lower() == "y": - if vars_system.init_vars["w_ui_largeroutline"] == 1: - vars_system.init_vars["w_ui_largeroutline"] = 0 - else: - vars_system.init_vars["w_ui_largeroutline"] = 1 - clear_screen() - print("The LargerOutline toggle is now set to: %s" % vars_system.init_vars["w_ui_largeroutline"]) - input("Press Enter/Return to continue...") - wmv_options_menu() - - -# Toggles the LargerOutline setting for WMV files. - - -def wmv_change_videocodec(): - clear_screen() - print("The WMV video codex is currently set to: %s" % vars_system.init_vars["w_videocodec"]) - print("There are 2 options for this setting:\n1. Windows Media Video 9\n2. Windows Media Video 9 Screen") - print("\nLeave the field blank to do nothing") - me_wmv_videocodec = int(input("\nPlease enter 1 or 2 then press Enter/Return: ")) - if me_wmv_videocodec == int: - if me_wmv_videocodec == 1: - vars_system.init_vars["w_videocodec"] = "Windows Media Video" - elif me_wmv_videocodec == 2: - vars_system.init_vars["w_videocodec"] = "Windows Media Video 9 Screen" - clear_screen() - print("The video codex is now set to: %s" % vars_system.init_vars["w_videocodec"]) - input("Press Enter/Return to continue...") - wmv_options_menu() - - -# Changes the Video Codex for WMV files. - - -def wmv_change_audiocodec(): - clear_screen() - print("The WMV audio codex is currently set to: %s" % vars_system.init_vars["w_audiocodec"]) - print("There are 3 options for this setting:\n1. Windows Media Audio 9.2 9\n2. Windows Media Audio 9.2 Lossless") - print("3. Windows Media Audio 10 Professional\nLeave the field blank to do nothing") - me_wmv_audiocodec = int(input("\nPlease enter 1-3 then press Enter/Return: ")) - if me_wmv_audiocodec == 1: - vars_system.init_vars["w_audiocodec"] = "Windows Media Video" - elif me_wmv_audiocodec == 2: - vars_system.init_vars["w_audiocodec"] = "Windows Media Video 9 Screen" - elif me_wmv_audiocodec == 3: - vars_system.init_vars["w_audiocodec"] = "Windows Media Audio 10 Professional" - clear_screen() - print("The audio codex is now set to: %s" % vars_system.init_vars["w_audiocodec"]) - input("Press Enter/Return to continue...") - wmv_options_menu() - - -# Changes the Audio Codex for WMV files. - - -def wmv_alter_videoformat(): - clear_screen() - print("I have no idea what this setting does so I do not recommend changing this.") - print("Leave the field blank to do nothing.\n The current setting is: %s" % vars_system.init_vars["w_videoformat"]) - me_wmv_videoformat = input("Enter some value here: ") - if len(me_wmv_videoformat) > 0: - vars_system.init_vars["w_videoformat"] = me_wmv_videoformat - clear_screen() - print("The VideoFormat setting is now set to: %s" % vars_system.init_vars["w_videoformat"]) - input("Press Enter/Return to continue...") - wmv_options_menu() - - -# Changes the VideoFormat for WMV files. - - -def wmv_alter_audioformat(): - clear_screen() - print("I have no idea what this setting does so I do not recommend changing this.") - print("Leave the field blank to do nothing.\n The current setting is: %s" % vars_system.init_vars["w_audioformat"]) - me_wmv_audioformat = input("Enter some value here: ") - if len(me_wmv_audioformat) > 0: - vars_system.init_vars["w_audioformat"] = me_wmv_audioformat - clear_screen() - print("The AudioFormat setting is now set to: %s" % vars_system.init_vars["w_audioformat"]) - input("Press Enter/Return to continue...") - wmv_options_menu() - - -# Changes the AudioFormat for WMV files. - - -def wmv_change_keyframes(): - clear_screen() - print("The current frame rate is set to: %sFPS.\nLeave it blank to do nothing." % vars_system.init_vars["w_videokeyframes"]) - print("Enter a number above 0 (the recommended range is 4 to 10) to change the setting.") - me_wmv_change_framerate = int(input("Press Enter/Return when you are ready to continue: ")) - if me_wmv_change_framerate > 0: - vars_system.init_vars["w_videokeyframes"] = me_wmv_change_framerate - clear_screen() - print("The frame rate is now set to: %sFPS" % vars_system.init_vars["w_videokeyframes"]) - input("Press Enter/Return to continue...") - wmv_options_menu() - - -# Changes the KeyFrames for WMV files. - - -def wmv_change_maxstream(): - clear_screen() - print("The current MaxStream is set to: %sBPS.\nLeave it blank to do nothing." % vars_system.init_vars["w_maxstream"]) - print("Enter a number above 0 (the recommended range is 500 to 1000) to change the setting.") - me_wmv_change_maxstream = int(input("Press Enter/Return when you are ready to continue: ")) - if me_wmv_change_maxstream > 0: - vars_system.init_vars["w_maxstream"] = me_wmv_change_maxstream - clear_screen() - print("MaxStream is now set to: %s" % vars_system.init_vars["w_maxstream"]) - input("Press Enter/Return to continue...") - wmv_options_menu() - - -# Changes the MaxStream for WMV files. - - -def swf_options_menu(): - clear_screen() - print("SWF Files have 2 configurable options (at the moment):\n\n1. Toggle PCAudio setting\n2. Change frame rate") - print("\n3. Go back to the main options menu.") - me_swf_options_menu = int(input("\nPlease enter 1-3 and press Enter/Return: ")) - if me_swf_options_menu == 1: - swf_toggle_pcaudio() - elif me_swf_options_menu == 2: - swf_change_framerate() - elif me_swf_options_menu == 3: - options_menu() - else: - clear_screen() - print("Please enter a valid number from 1 to 3!") - input("\n Press Enter/Return to continue...") - swf_options_menu() - - -# Lists settings available for the SWF file format - - -def swf_toggle_pcaudio(): - clear_screen() - print("The PCAudio toggle is set to: %s\n Would you like to toggle this setting?" % vars_system.init_vars["s_console_pcaudio"]) - print("\nPress Y to toggle the setting. Leave it blank to do nothing.") - me_swf_toggle_pcaudio = input("Press Enter/Return when you are ready to continue: ") - if me_swf_toggle_pcaudio.lower() == "y": - if vars_system.init_vars["s_console_pcaudio"] == 1: - vars_system.init_vars["s_console_pcaudio"] = 0 - else: - vars_system.init_vars["s_console_pcaudio"] = 1 - clear_screen() - print("The PCAudio toggle is now set to: %s" % vars_system.init_vars["s_console_pcaudio"]) - input("Press Enter/Return to continue...") - swf_options_menu() - - -# Enables or Disables the PCAudio setting for the SWF file - - -def swf_change_framerate(): - clear_screen() - print("The current frame rate is set to: %sFPS. Leave below blank to do nothing." % vars_system.init_vars["s_framerate"]) - print("Enter a number above 0 to change the frame rate (the recommended range is from 1 to 10).") - me_swf_change_framerate = int(input("Press Enter/Return when you are ready to continue: ")) - if me_swf_change_framerate > 0: - vars_system.init_vars["s_framerate"] = me_swf_change_framerate - clear_screen() - print("The frame rate is now set to: %sFPS" % vars_system.init_vars["s_framerate"]) - input("Press Enter/Return to continue...") - swf_options_menu() - - -# Changes the frame rate for SWF files. - - -def global_options_menu(): - clear_screen() - print("There are 5 global options (at the moment):4\n\n1. Set the ARF input folder\n2. Toggle ShowUI") - print("3. Set the converted output folder\n4. Set the resolution Width\n5. Set the resolution Height") - print("\n6. Go back to the main options menu.") - me_global_options_menu = int(input("\nPlease enter 1-6 and press Enter/Return: ")) - if me_global_options_menu == 1: - global_input_dir() - elif me_global_options_menu == 2: - global_toggle_showui() - elif me_global_options_menu == 3: - global_output_dir() - elif me_global_options_menu == 4: - global_set_res_width() - elif me_global_options_menu == 5: - global_set_res_height() - elif me_global_options_menu == 6: - options_menu() - else: - clear_screen() - print("Please enter a valid number from 1 to 6!") - input("\nPress Enter/Return to continue...") - global_options_menu() - - -# Lists settings available that are compatible with all of the file formats - - -def global_input_dir(): - clear_screen() - print("This sets the directory that contains all of the ARFs to be converted. By default this setting is the same") - print("as the directory that this script file is in.") - print("The current input dir is: %s" % vars_system.init_vars["input_file_dir"]) - print("\nEnter the full path to the directory that contains the ARF files to be converted or blank to do nothing.") - me_global_input_dir = input("Press Enter/Return when you are ready to continue: ") - if len(me_global_input_dir) > 0: - vars_system.init_vars["input_file_dir"] = me_global_input_dir - clear_screen() - print("The input directory is now set to: %s" % vars_system.init_vars["input_file_dir"]) - input("\nPress Enter/Return to continue...") - global_options_menu() - - -# Sets the directory that contains all of the ARF files to be converted. - - -def global_toggle_showui(): - clear_screen() - print("The ShowUI toggle is set to: %s\n Would you like to toggle this setting?" % vars_system.init_vars["showui"]) - print("This option is experimental, I would not recommend changing this until tested.") - print("\nPress Y to toggle the setting. Leave it blank to do nothing.") - me_global_toggle_showui = input("Press Enter/Return when you are ready to continue: ") - if me_global_toggle_showui.lower() == "y": - if vars_system.init_vars["showui"] == 1: - vars_system.init_vars["showui"] = 0 - else: - vars_system.init_vars["showui"] = 1 - clear_screen() - print("The ShowUI toggle is now set to: %s" % vars_system.init_vars["showui"]) - input("Press Enter/Return to continue...") - global_options_menu() - - -# Toggles the ShowUI setting for all file types. - - -def global_output_dir(): - clear_screen() - print("This sets the directory that will contain all of the converted ARFs. By default this setting is .\Converted") - print("The current output dir is: %s" % vars_system.init_vars["output_file_dir"]) - print("\nEnter the full path to the directory that will contain the converted ARF files or blank to do nothing.") - me_global_output_dir = input("Press Enter/Return when you are ready to continue: ") - if len(me_global_output_dir) > 0: - vars_system.init_vars["output_file_dir"] = me_global_output_dir - clear_screen() - print("The output directory is now set to: %s" % vars_system.init_vars["output_file_dir"]) - input("\nPress Enter/Return to continue...") - global_options_menu() - - -# Sets the directory that will contain all of the converted ARF files after conversion. - - -def global_set_res_width(): - clear_screen() - print("This sets the resolution width for the converted file.") - print("The resolution width is currently set to: %spx" % vars_system.init_vars["width"]) - print("\nEnter a number(recommended values are 1024 and above). Leave blank to change nothing.") - me_global_res_width = len(input("Press Enter/Return when you are ready to continue: ")) - if me_global_res_width > 0: - vars_system.init_vars["width"] = me_global_res_width - clear_screen() - print("The resolution width is now set to: %s" % vars_system.init_vars["width"]) - input("\nPress Enter/Return to continue...") - global_options_menu() - - -# Changes the output file's resolution width (the 1024 in 1024x768) - - -def global_set_res_height(): - clear_screen() - print("This sets the resolution height for the converted file.") - print("The resolution height is currently set to: %spx" % vars_system.init_vars["height"]) - print("\nEnter a number(recommended values are 768 and above). Leave blank to change nothing.") - me_global_res_height = len(input("Press Enter/Return when you are ready to continue: ")) - if me_global_res_height > 0: - vars_system.init_vars["height"] = me_global_res_height - clear_screen() - print("The resolution height is now set to: %s" % vars_system.init_vars["height"]) - input("\nPress Enter/Return to continue...") - global_options_menu() - - -# Changes the output file's resolution height (the 768 in 1024x768) - - -def restore_default_settings(): - vars_system.__init__() - options_menu() - - -# Restores all settings to default values - - -def exit_program(friendly): - clear_screen() - if friendly: - print("Thank you for using this script, I hope you enjoyed it!") - elif not friendly: - print("Thank you for considering this product! If you have any issues please email ehuffman@elliot-labs.com or") - print("file an issue on https://github.com/elliot-labs/ARF-Converter\n\nThanks!") - else: - print("You have triggered an exit that the programmer has not foreseen.") - print("Please report this to ehuffman@elliot-labs.com or https://github.com/elliot-labs/ARF-Converter") - exit() - - -# This is a simple program closer that thanks the user for using the program. - - -if __name__ == '__main__': - vars_system = init_system() - main_menu() - - -# Checks to see if it is the main program (not an import) and then starts madness! \ No newline at end of file diff --git a/AutoConvert_GUI.pyw b/AutoConvert_GUI.pyw deleted file mode 100644 index 4417e3c..0000000 --- a/AutoConvert_GUI.pyw +++ /dev/null @@ -1,345 +0,0 @@ -from os import path, chdir, listdir, makedirs, remove -from subprocess import call -from platform import system -from webbrowser import open_new_tab -from tkinter import * -from tkinter import messagebox, filedialog, ttk - - -# Variables naming convention: -# Variables for the various windows are xw_, where "x" is the first letter of the description of the window. -# Variables for the MP4 section are prefixed with m_ -# Variables for the WMV section are prefixed with w_ -# Variables for the SWF section are prefixed with s_ - -class render_window: - def __init__(self, height, width, window_title): - self.root_window = Tk() - w = width - h = height - ws = self.root_window.winfo_screenwidth() # width of the screen - hs = self.root_window.winfo_screenheight() # height of the screen - x = (ws/2) - (w/2) - y = (hs/2) - (h/2) - self.root_window.title(window_title) - self.root_window.minsize(width, height) - self.root_window.geometry('%dx%d+%d+%d' % (w, h, x, y)) - self.radio_button_var = StringVar() - - def new_button(self, button_text, button_command="", grid_row=0, grid_column=0, grid_sticky="NESW", grid_columnspan=1, grid_rowspan=1): - self.button = ttk.Button(self.root_window, text=button_text, command=button_command) - self.button.grid(row=grid_row, column=grid_column, sticky=grid_sticky, columnspan=grid_columnspan, rowspan=grid_rowspan) - self.responsive_grid(grid_row, grid_column) - - def new_label(self, label_text, text_alignment="center", grid_row=0, grid_column=0, grid_sticky="NESW", grid_columnspan=1, grid_rowspan=1): - self.label = ttk.Label(self.root_window, text=label_text, anchor=text_alignment) - self.label.grid(row=grid_row, column=grid_column, sticky=grid_sticky, columnspan=grid_columnspan, rowspan=grid_rowspan) - self.responsive_grid(grid_row, grid_column) - - def new_progress_bar(self, pg_length=250, pg_mode="determinate", grid_row=0, grid_column=0, grid_sticky="NESW", grid_columnspan=1, grid_rowspan=1): - self.progress_bar = ttk.Progressbar(self.root_window, length=pg_length, mode=pg_mode) - self.progress_bar.grid(row=grid_row, column=grid_column, sticky=grid_sticky, columnspan=grid_columnspan, rowspan=grid_rowspan) - self.responsive_grid(grid_row, grid_column) - - def new_radio_button(self, widget_text="Radio Button", radio_value="Radio Btn", radio_command="", grid_row=0, grid_column=0, grid_sticky="NESW", grid_columnspan=1, grid_rowspan=1): - self.radio_button = ttk.Radiobutton(self.root_window, text=widget_text, variable=self.radio_button_var, value=radio_value, command=radio_command) - self.radio_button.grid(row=grid_row, column=grid_column, sticky=grid_sticky, columnspan=grid_columnspan, rowspan=grid_rowspan) - self.responsive_grid(grid_row, grid_column) - - def new_text_box(self, grid_row=0, grid_column=0, grid_sticky="NESW", grid_columnspan=1, grid_rowspan=1): - self.text_box = ttk.Entry(self.root_window, textvariable=self.text_box_var) - self.text_box.grid(row=grid_row, column=grid_column, sticky=grid_sticky, columnspan=grid_columnspan, rowspan=grid_rowspan) - self.responsive_grid(grid_row, grid_column) - - def responsive_grid(self, row_responsive=0, column_responsive=0, row_weight_num=1, column_weight_num=1): - self.root_window.grid_columnconfigure(column_responsive, weight=column_weight_num) - self.root_window.grid_rowconfigure(row_responsive, weight=row_weight_num) - - -# Creates a framework to easily create new windows and populate them with widgets. - - -class init_system: - def __init__(self): - self.init_vars = {"path_to_file": path.abspath(__file__), - "nbr_path": path.normpath("C:/ProgramData/WebEx/WebEx/500/nbrplay.exe"), - "file_type": "mp4", - "showui": 0, - "need_ui_section": True, - "width": 1920, - "height": 1080, - "m_ui_chat": 1, - "m_ui_qa": 1, - "m_ui_largeroutline": 1, - "m_framerate": 5, - "s_console_pcaudio": 0, - "s_framerate": 10, - "w_console_pcaudio": 0, - "w_ui_chat": 1, - "w_ui_video": 1, - "w_ui_largeroutline": 1, - "w_videocodec": "Windows Media Video 9", - "w_audiocodec": "Windows Media Audio 9.2 Lossless", - "w_videoformat": "default", - "w_audioformat": "default", - "w_videokeyframes": 4, - "w_maxstream": 1000} - self.init_vars["directory_name"] = path.dirname(self.init_vars["path_to_file"]) - self.init_vars["input_file_dir"] = path.dirname(self.init_vars["path_to_file"]) - self.init_vars["output_file_dir"] = path.dirname(self.init_vars["path_to_file"]) + "\\Converted" - chdir(self.init_vars["directory_name"]) - self.check_os() - self.locate_nbr() - # Sets up the initial variables and checks for system compatibility - - - def check_os(self): - if system() != "Windows": - messagebox.showerror("Compatibility Error", "Please use Windows for file conversions.\nOther OSs are currently not supported :-(") - exit() - # Checks the operating system to see if it is compatible. If not, it displays an error and quits the program. - - - def locate_nbr(self): - if not self.check_file_existance(self.init_vars["nbr_path"]): - download_nbr = messagebox.askquestion("Download dependency?", "The system could not find the NBR player.\nWould you like to download it?") - if download_nbr == "yes": - open_new_tab("www.webex.com/play-webex-recording.html") - exit() - elif download_nbr == "no": - nbr_already_installed = messagebox.askquestion("Maybe we missed it...", "Do you have the NBR player installed already?") - if nbr_already_installed == "yes": - custom_nbr_location() - locate_nbr() - else: - messagebox.showerror("Cannot continue!", "This script requires the Network Broadcast Recording player to operate.\nPlease have it installed for the next time you run this script.") - exit() - else: - return True - # Checks if the NBR is present. If not it prompts the user to download it. If the user declines then it prompts if it is installed in a different location. - # If yes then it executes the custom_nbr_location function. If not, the program displays an error and quits after the error is acknowledged. - - - def check_file_existance(self, file_path): - result = path.exists(file_path) - return result - # Checks the given file path to see if the file exists and returns true or false. - - - def custom_nbr_location(self): - messagebox.showinfo("Find the player...", message="Please browse to the folder that houses the nbrplay.exe program.") - self.init_vars["nbr_path"] = filedialog.askdirectory(mustexist=True) - # Sets the nbr_path variable to the user provided path. The folder must exist to be accepted. - - - def check_folder(self): - error_num = 0 - if not path.exists(self.init_vars["input_file_dir"]): - error_num = error_num + 5 - elif not path.exists(self.init_vars["output_file_dir"]): - error_num = error_num + 4 - return error_num - # Check is the source directory exists and if it does not then displays an error and goes back to the main menu. - # Also checks if the output directory exists and if it does not it creates it. - # 5 = input - # 4 = output - # 9 = input and output - - -# Initializes the script with default values and changes to the directory where the script is located. - - -def progress_bar_window_system(): - global pg_window - global pg_progress - pg_window = render_window(50, 250, "Conversion Progress") - pg_window.new_progress_bar() - pg_progress = pg_window.progress_bar - pg_window.new_label("Converting Files", grid_row=1) - pg_window.root_window.after(1, func=convert_file) - main_window.root_window.withdraw() - pg_window.root_window.mainloop() - - -# Creates the progress bar window, complete with the progress bar and supporting text. Centered on the screen. - - -def convert_file(): - global pg_window - global pg_progress - global main_window - pg_window.root_window.update() - if vars_system.check_folder() == 5: - pg_window.root_window.destroy() - messagebox.showerror("Cannot continue!", "The ARF input dir is invalid, please check that it exists.") - main_window.root_window.deiconify() - return - elif vars_system.check_folder() == 4: - pg_window.root_window.destroy() - messagebox.showerror("Cannot continue!", "The ARF output dir is invalid, please check that it exists.") - main_window.root_window.deiconify() - return - elif vars_system.check_folder() == 9: - pg_window.root_window.destroy() - messagebox.showerror("Cannot continue!", "The ARF input and output dirs are invalid, please check that they exist.") - main_window.root_window.deiconify() - return - cfg_counter = 0 - for file in listdir("."): - if path.isfile(file) and file[-3:].lower() == "cfg": - remove(file) - for file in listdir("."): - if path.isfile(file) and file[-3:].lower() == "arf": - create_configs(file) - cfg_counter += 1 - pg_progress.config(maximum=cfg_counter) - for file in listdir("."): - if path.isfile(file) and file[-3:].lower() == "cfg": - execute_nbr_conversion(vars_system.init_vars["input_file_dir"] + "\\" + file) - cfg_counter -= 1 - pg_progress.config(value=cfg_counter) - pg_window.root_window.update() - remove(file) - pg_window.root_window.destroy() - main_window.root_window.deiconify() - messagebox.showinfo(title="Conversion complete!", message="File conversion(s) are complete!") - - -# The conversion process checks to make sure the dependencies are in place, if so then it creates the configs, enumerates the amount of files, sends that to the progress bar, -# executes the file conversion, updates the progress bar and repeats until there are no more config files. After there are no more config files, it removes the progress bar window, -# shows the main window and throws a completed message. - - -def create_configs(fname): - with open(fname[:-3] + "cfg", "a") as config_file: - config_file.write("[Console]") - config_file.write("\ninputfile=%s" % vars_system.init_vars["input_file_dir"] + "\\" + fname) - config_file.write("\nmedia=%s" % vars_system.init_vars["file_type"].upper()) - config_file.write("\nshowui=%s" % vars_system.init_vars["showui"]) - if vars_system.init_vars["file_type"].lower() == "swf": - config_file.write("\nPCAudio=%s" % vars_system.init_vars["s_console_pcaudio"]) - elif vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nPCAudio=%s" % vars_system.init_vars["w_console_pcaudio"]) - if vars_system.init_vars["need_ui_section"]: - config_file.write("\n[UI]") - if vars_system.init_vars["file_type"] == "mp4": - config_file.write("\nchat=%s" % vars_system.init_vars["m_ui_chat"]) - elif vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nchat=%s" % vars_system.init_vars["w_ui_chat"]) - if vars_system.init_vars["file_type"].lower() == "mp4": - config_file.write("\nqa=%s" % vars_system.init_vars["m_ui_qa"]) - elif vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nvideo=%s" % vars_system.init_vars["w_ui_video"]) - if vars_system.init_vars["file_type"].lower() == "mp4": - config_file.write("\nlargeroutline=%s" % vars_system.init_vars["m_ui_largeroutline"]) - elif vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nlargeroutline=%s" % vars_system.init_vars["w_ui_largeroutline"]) - config_file.write("\n[%s]" % vars_system.init_vars["file_type"].upper()) - config_file.write("\noutputfile=%s" % vars_system.init_vars["output_file_dir"] + "\\" + fname[:-3] + vars_system.init_vars["file_type"].lower()) - config_file.write("\nwidth=%s" % vars_system.init_vars["width"]) - config_file.write("\nheight=%s" % vars_system.init_vars["height"]) - if vars_system.init_vars["file_type"].lower() == "mp4": - config_file.write("\nframerate=%s" % vars_system.init_vars["m_framerate"]) - elif vars_system.init_vars["file_type"] == "wmv": - config_file.write("\nvideocodec=%s" % vars_system.init_vars["w_videocodec"]) - elif vars_system.init_vars["file_type"].lower() == "swf": - config_file.write("\nframerate=%s" % vars_system.init_vars["s_framerate"]) - if vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\naudiocodec=%s" % vars_system.init_vars["w_audiocodec"]) - if vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nvideoformat=%s" % vars_system.init_vars["w_videoformat"]) - if vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\naudioformat=%s" % vars_system.init_vars["w_audioformat"]) - if vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nvideokeyframes=%s" % vars_system.init_vars["w_videokeyframes"]) - if vars_system.init_vars["file_type"].lower() == "wmv": - config_file.write("\nmaxstream=%s" % vars_system.init_vars["w_maxstream"]) - - -# Creates configuration files for the nbrplayer to use to convert the files. - - -def execute_nbr_conversion(cfg_name): - call(vars_system.init_vars["nbr_path"] + " -Convert" + ' "' + cfg_name + '"') - - -# Executes the nbr executable with the path to the generated cfg file. - - -def main_window_create(): - global main_window - main_window = render_window(200, 250, "ARF Auto Converter") - - main_window.new_button("Convert to MP4", button_mp4, 1) - main_window.new_button("Convert to WMV", button_wmv, 2) - main_window.new_button("Convert to SWF", button_swf, 3) - main_window.new_button("Help", help_system, 2, 1) - main_window.new_button("Options", options_window_create, 1, 1) - main_window.new_button("Exit", exit, 3, 1) - main_window.new_label("Welcome to the ARF Auto Converter!", grid_columnspan=2) - - main_window.root_window.mainloop() - - -# Uses the render_window framework to create a window and populate it with widgets. - - -def options_window_create(): - global options_window - main_window.root_window.destroy() - - options_window = render_window(200, 500, "Converter Options") - - options_window.new_label("You can only currently restore the default settings. More to come soon!", grid_columnspan=2) - options_window.new_button("Restore Defaults", vars_system.__init__, 1, 1) - options_window.new_button("Back to Main Window", button_back_to_mw, 1) - - options_window.root_window.mainloop() - - -# Uses the render_window framework to create a window and populate it with widgets. - - -def help_system(): - messagebox.showinfo("Coming Soon!", "The help system will be present in a future version.") - - -# Displays an info box that says "coming soon" - - -def button_mp4(): - vars_system.init_vars["file_type"] = "mp4" - progress_bar_window_system() - - -# Starts file conversions for the SWF file type. - - -def button_wmv(): - vars_system.init_vars["file_type"] = "wmv" - progress_bar_window_system() - - -# Starts file conversions for the SWF file type. - - -def button_swf(): - vars_system.init_vars["file_type"] = "swf" - progress_bar_window_system() - - -# Starts file conversions for the SWF file type. - - -def button_back_to_mw(): - options_window.root_window.destroy() - main_window_create() - - -# Stops the options window and opens the main window. - - -vars_system = init_system() -main_window_create() - -# Starts the main window. diff --git a/Cold_storage/Auto Convert.bat b/Cold_storage/Auto Convert.bat deleted file mode 100644 index f304f80..0000000 --- a/Cold_storage/Auto Convert.bat +++ /dev/null @@ -1,591 +0,0 @@ -:start -@echo off -color 2e -cls -if not EXIST C:\programdata\webex\webex\500\nbrplay.exe goto nonbr -goto mainmenu - - -rem Checks if the required program is installed, turns off the output of commands and sets the color of the terminial. After it has completed the above tasks it routs the user to the main menu. - - -:init - - - - - -:mainmenu -cls -echo Easy mode: Enter the name of the folder on your desktop that contains your ARF files. -echo Advanced mode: Enter the full path to the folder containing the ARF files. -echo Options: Configure the conversion process from frame rate to codecs -echo. -set /p mmenu=Press A for Advanced, E for Easy and O for Options. Then press enter: -if %mmenu%==1 set fromm=easy -if %mmenu%==1 goto easy -if %mmenu%==2 set fromm=advanced -if %mmenu%==2 goto filetype -if %mmenu%==3 set fromm=options -if %mmenu%==3 goto options -cls -echo There has been an error -echo Error Location "mainmenu" -pause -goto mainmenu - - -rem This displays a simple menu for users to chose either advanced mode, Where you type -rem the full path, or Easy mode, Where you type ony the folder name of a folder on the desktop. -rem -rem This menu uses the choice command to make the user chose one of two choices. -rem After they chose it records which one the chose in %fromm% (from menu) so that they can be routed after they have chosen the file type. - - -:easy -set fromm=easy -cls -echo The converted files will appear in the same folder with the ARF files in it. -echo. -echo Please enter, below, the name of the folder on your desktop that contains ARF files you wish to convert. -echo. -set /p deskfolder=Enter the folder name here: -set source=%userprofile%\Desktop\%deskfolder%\ -set dest=%source% -goto filetype - - -rem The user inputs the name of a folder on the desktop -rem and it is combined with the system %userprofile% variable to -rem make %source%. %source% is then copied into %dest% to set the destination of the MP4 files. - - -:filetype -cls -echo You have three file types to convert to: WMV, SWF and MP4. -echo. -echo WMV is the Windows Media Video format and is compatible with most computers -echo. -echo MP4 is MPEG Layer 4. It is compatible with almost all computers and devices -echo. -echo SWF is a Shockwave Flash file. It is compatible with most web browsers with flash installed. It is ideal for embedding in web pages. -echo. -echo. -set /p filetypechoice="Enter you chosen file type here. W=WMV M=MP4 S=SWF. W, S or M?" -if %filetypechoice%==W set ftype=WMV -if %filetypechoice%==M set ftype=MP4 -if %filetypechoice%==S set ftype=SWF -if %filetypechoice%==w set ftype=WMV -if %filetypechoice%==m set ftype=MP4 -if %filetypechoice%==s set ftype=SWF -if %fromm%==easy goto where -if %fromm%==advanced goto source -cls -echo An error has occored. Please email me with the details. -echo Error Location "filetype" -echo elliot-labs@live.com -pause -goto end - - -rem The above gives you the choice to chose which formats that you can convert to. it does this by changing the %ftype% to the selected format then reading from which menu you - -came from (%fromm%, From Menu). After it has determined which one you came from it routs you to the approiate next step. - - - -:source -cls -echo Make sure that you type the full path to the folder that contains the ARF files. I have not tested network shares. Yet... -echo. -echo Please select the folder with the ARF files in it. -set /p source=E.G. C:\Users\Elliot\Desktop\ARFs: -goto dest - - -rem This sets the folder location for the ARF files. - - -:dest -cls -echo Make sure that you type the full path to the folder that contains the ARF files. I have not tested network shares. Yet... -echo. -echo Please select where the converted files should appear. -set /p dest=E.G. C:\Users\Elliot\Desktop\Converted: -goto where -cls -echo An error has occored. -echo Please email me with what happened. -echo Error location "dest" -echo elliot-labs@live.com -pause -goto end - - -rem This sets the output folder for the converted files. - - -:options -set omenu=4 -cls -echo There are no SWF options avalable :( -echo. -echo Press 1 for global settings. -echo Press 2 for MP4 settings. -echo Press 3 for WMV settings. -echo Press 4 to go back to the Main Menu -echo. -set /p omenu=Press [1-4] then press enter: -if %omenu%==1 goto mGlobal -if %omenu%==2 goto mMP4 -if %omenu%==3 goto mWMV -if %omenu%==4 goto mainmenu -cls -echo Something has went wrong. Please try again. -echo location: Options menu. -pause -goto options - - -:mWMV -set mWMV=4 -cls -echo Press 1 for the "PCAudio" setting -echo Press 2 for Video Codec settings -echo Press 3 for Audio Codec settings -echo. -echo Press 4 to go back to the main options menu -echo. -echo. -set /p mWMV=Press [1-4] then press enter: -if %mWMV%==1 goto mPCAudio -if %mWMV%==2 goto videocodec -if %mWMV%==3 goto audiocodec -if %mWMV%==4 goto options -cls -echo Something has went wrong. Please try again. -echo location: WMV options menu. -pause -goto mWMV - - -:mMP4 -set mMP4=4 -cls -echo These option effect only the MP4 file type. -echo. -echo for "Width" press 1 -echo for "Height" press 2 -echo for "Framerate" press 3 -echo. -echo Press 4 to go back to the main options menu -echo. -echo. -set /p mMP4=Press [1-4] then press enter: -if %mMP4%==1 goto MP4Width -if %mMP4%==2 goto MP4Height -if %mMP4%==3 goto MP4Framerate -if %mMP4%==4 goto options -cls -echo Something has went wrong. Please try again. -echo location: mMP4. -pause -goto mMP4 - - -:mGlobal -set mGlobal=6 -cls -echo These options effect all file types. -echo. -echo Press 1 for the "ShowUI" setting -echo Press 2 for the "chat" setting -echo Press 3 for the "video" setting -echo Press 4 for the "largeroutline" setting -echo Press 5 for the "QA" setting -echo. -echo Press 6 to return to the main options menu -echo. -echo. -set /p mGlobal= Press [1-6] then press enter: -if %mGlobal%==1 goto mShowUI -if %mGlobal%==2 goto mChat -if %mGlobal%==3 goto mVideo -if %mGlobal%==4 goto mLargeoutline -if %mGlobal%==5 goto mQA -if %mGlobal%==6 goto options -cls -echo Something has went wrong. Please try again. -echo location: mGlobal. -pause -goto mGlobal - - -:mShowUI -cls -echo Press 1 to enable the showUI setting -echo Press 2 to Disable the showUI setting -set /p mshowUI=Press the desired number [1-2] then press enter: -if %mshowUI%==1 set showUI=1 -if %mshowUI%==2 set showUI=0 -cls -if %mshowUI%==1 echo ShowUI is enabled -if %mshowUI%==2 echo ShowUI is disabled -pause -goto mGlobal - -:mQA -cls -echo Press 1 to show the QA box -echo Press 2 to hide the QA box -set /p mQA=Press the desired number [1-2] then press enter: -if %mQA%==1 set QA=1 -if %mQA%==2 set QA=0 -cls -if %mQA%==1 echo The QA box is enabled -if %mQA%==2 echo The QA box is disabled -pause -goto mGlobal - - -:mPCAudio -cls -echo Press 1 to enable the PCAudio setting -echo Press 2 to Disable the PCAudio setting -set /p mPCAudio=Press the desired number [1-2] then press enter: -if %mPCAudio%==1 set PCAudio=1 -if %mPCAudio%==2 set PCAudio=0 -cls -if %mPCAudio%==1 echo PCAudio is enabled -if %mPCAudio%==2 echo PCAudio is disabled -pause -goto mWMV - - -:MP4Width -cls -echo Please enter a witdth resolution (in pixles). -echo. -set /p MP4Width=Enter desired width for resolution here: -cls -echo You have set %MP4Width% as the desired width. -pause -goto mMP4 - - -:MP4Height -cls -echo Please enter a height resolution (in pixles). -echo. -set /p MP4Height=Enter the desired height for resolution here: -cls -echo You have set %MP4Height% as the desired height. -pause -goto mMP4 - - -:MP4Framerate -cls -echo Please enter a desired frame rate (in frames per second). -echo. -echo The optimal framerates are 3 for low quality, 5 for medium and -echo 8 for high. although you can use frame rates higher then the above -echo you might not get better results. -echo. -set /p MP4Framerate=Enter the desired frame rate here then press enter: -cls -echo You have set %MP4Framerate% as the desired frame rate. -if %MP4Framerate%==0 echo This is an incorrect frame rate. Please enter a valid frame rate. -pause -if %MP4Framerate%==0 goto MP4Framerate -goto mMP4 - - -:mChat -cls -echo Press 1 to display the Chat window -echo Press 2 to hide the chat window -set /p mChat=Press the desired number [1-2] then press enter: -if %mChat%==1 set Chat=1 -if %mChat%==2 set Chat=0 -cls -if %mChat%==1 echo You have enabled the chat window. -if %mChat%==2 echo You have disabled the chat window. -pause -goto mGlobal - - -:mVideo -cls -echo Press 1 to display the Video window -echo Press 2 to hide the Video window -set /p mVideo=Press the desired number [1-2] then press enter: -if %mVideo%==1 set Video=1 -if %mVideo%==2 set Video=0 -cls -if %mVideo%==1 echo You have enabled the video window. -if %mVideo%==2 echo You have disabled the video window. -pause -goto mGlobal - - -:mLargeoutline -cls -echo Press 1 to enable the Largeoutline setting -echo Press 2 to Disable the Largeoutline setting -set /p mLargeoutline=Press the desired number [1-2] then press enter: -if %mLargeoutline%==1 set Largeoutline=1 -if %mLargeoutline%==2 set Largeoutline=0 -cls -if %mLargeoutline%==1 echo You have enabled Largeoutline. -if %mLargeoutline%==2 echo You have disabled Largeoutline. -pause -goto mGlobal - - -:videocodec -cls -echo Press 1 for: Windows Media Video 9 -echo Press 2 for: Windows Media Video 9 Screen -echo. -set /p mvcodec=Press [1 or 2] then press enter: -if %mvcodec%==1 set vcodec=Windows Media Video 9 -if %mvcodec%==2 set vcodec=Windows Media Video 9 Screen -cls -echo You have set the Video codec to: -echo %vcodec% -pause -goto mWMV - - -:audiocodec -cls -echo Press 1 for: Windows Media Audio 9.2 -echo Press 2 for: Windows Media Audio 9.2 Lossless -echo Press 3 for: Windows Media Audio 10 Professional -echo. -set /p macodec=Press [1-3] then press enter: -if %macodec%==1 set acodec=Windows Media Audio 9.2 -if %macodec%==2 set acodec=Windows Media Audio 9.2 Lossless -if %macodec%==3 set acodec=Windows Media Audio 10 Professional -cls -echo You have set the Audio codec to: -echo %acodec% -pause -goto mWMV - - -:where -if %ftype% EQU MP4 goto premp4cfg -if %ftype% EQU WMV goto prewmvcfg -if %ftype% EQU SWF goto preswfcfg -cls -echo An error has occored. Please email me with what happened :( -echo Error location "where" -echo elliot-labs@live.com -pause -goto end - - -rem The above code routes the user to the diffrent config makers based on there input. - - -:premp4cfg -cls -setlocal -set cd=%source% -cd /d %cd% -for %%a in ("%cd%\*.arf") do call:MakeMP4CFG "%%~a" "%dest%" "%source%" -for %%a in ("%cd%\*.cfg") do set /a count +=1 -for %%a in ("%cd%\*.cfg") do call:countnconvert "%%~a" "%source%" "%count%" & set /a count -=1 -del *.cfg -goto end - - -rem lists the contents of %cd% and puts the list in %%a. -rem Then processes the list (%a) and runs the call command for each entry while passing -rem the preselected destination and source to the config file that is created. - -rem After that is done it then looks and makes a list of all the config files in the %cd% folder, again as %a. -rem Then it calls the :countnconvert section and converts them while displaying the remaining file count. - - -:MakeMP4CFG -setlocal -set "MP4=%~n1" -set "source=%~dp1" -set "filename=%~n1" - -( -ECHO([Console] -ECHO(inputfile="%source%\%filename%.arf" -ECHO(media=MP4 -ECHO(showui=0 -ECHO([UI] -ECHO(chat=1 -ECHO(video=0 -ECHO(qa=0 -ECHO(largeroutline=1 -ECHO([MP4] -ECHO(outputfile="%dest%\%filename%.mp4" -ECHO(width=1440 -ECHO(height=768 -ECHO(framerate=10 -)>"%MP4%.cfg" -exit /b - - -rem Above is the CFG file template used to create the ARF's CFG file. - - -:prewmvcfg -cls -setlocal -set cd=%source% -cd /d %cd% -for %%a in ("%cd%\*.arf") do call:MakeWMVCFG "%%~a" "%dest%" "%source%" -for %%a in ("%cd%\*.cfg") do set /a count +=1 -for %%a in ("%cd%\*.cfg") do call:countnconvert "%%~a" "%source%" "%count%" & set /a count -=1 -del *.cfg -goto end - - -rem lists the contents of %cd% and puts the list in %%a. -rem Then processes the list (%a) and runs the call command for each entry while passing -rem the preselected destination and source to the config file that is created. - -rem After that is done it then looks and makes a list of all the config files in the %cd% folder, again as %a. -rem Then it calls the :countnconvert section and converts them while displaying the remaining file count. - - -:MakeWMVCFG -setlocal -set "WMV=%~n1" -set "source=%~dp1" -set "filename=%~n1" - -( -ECHO([Console] -ECHO(inputfile="%source%\%filename%.arf" -ECHO(media=WMV -ECHO(showui=0 -ECHO(PCAudio=0 -ECHO([UI] -ECHO(chat=1 -ECHO(video=0 -ECHO(qa=0 -ECHO(largeroutline=1 -ECHO([WMV] -ECHO(outputfile="%dest%\%filename%.wmv" -ECHO(width=1440 -ECHO(height=768 -ECHO(videocodec=Windows Media Video 9 -ECHO(audiocodec=Windows Media Audio 9.2 Lossless -ECHO(videoformat=default -ECHO(audioformat=default -ECHO(videokeyframes=4 -ECHO(maxstream=1000 -)>"%WMV%.cfg" -exit /b - - -rem Above is the CFG file template used to create the ARF's CFG file. - - -:preswfcfg -cls -setlocal -set cd=%source% -cd /d %cd% -for %%a in ("%cd%\*.arf") do call:MakeSWFCFG "%%~a" "%dest%" "%source%" -for %%a in ("%cd%\*.cfg") do set /a count +=1 -for %%a in ("%cd%\*.cfg") do call:countnconvert "%%~a" "%source%" "%count%" & set /a count -=1 -del *.cfg -goto end - - -rem lists the contents of %cd% and puts the list in %%a. -rem Then processes the list (%a) and runs the call command for each entry while passing -rem the preselected destination and source to the config file that is created. - -rem After that is done it then looks and makes a list of all the config files in the %cd% folder, again as %a. -rem Then it calls the :countnconvert section and converts them while displaying the remaining file count. - - -:MakeSWFCFG -setlocal -set "SWF=%~n1" -set "source=%~dp1" -set "filename=%~n1" - -( -ECHO([Console] -ECHO(inputfile="%source%\%filename%.arf" -ECHO(media=SWF -ECHO(showui=0 -ECHO(PCAudio=0 -ECHO([SWF] -ECHO(outputfile="%dest%\%filename%.swf" -ECHO(width=1440 -ECHO(height=768 -)>"%SWF%.cfg" -exit /b - - -rem Above is the CFG file template used to create the ARF's CFG file. - - -:nonbr -cls -echo You do not have WebEx's Network Recording Player installed. -echo. -echo Pressing "Y" will open http://www.webex.com/play-webex-recording.html -echo Pressing "N" will jump the program to the end. -echo. -choice /m "NOTE: When you download the player, download the ARF version." -if %errorlevel% EQU 2 goto end -cls -echo I have opened the above link in you web browser. -echo. -echo NOTE: Download and install the ARF version!!! -start www.webex.com/play-webex-recording.html -pause -goto end - - -rem The above is displayed if you do not have the Networking Recording Player (nbrplayer) -rem installed. It displays a link to the download page to the NBR tool. - - -:countnconvert -setlocal -cls -echo %count% files remaining... This may take some time ;) -c:\programdata\webex\webex\500\nbrplay.exe -Convert "%~dp1\%~n1.cfg" -exit /b - - -rem This converts the file based upon the imputed CFG file that was created in one of the previous steps. -rem This also displays the current files that are left for conversion. - - -:help -echo Coming soon... -pause -goto end - - -rem Coming soon... :) - - -:end -cls -echo Thank you for using the Elliot Labs ARF converter. -echo Special thanks to HuffDaddy for coding help. -echo For feature requests please email Elliot at elliot-labs@live.com -echo. -pause | echo Press any key to exit... -exit /b - - -rem Exits the program on the user's input while giving the credits. diff --git a/Easy MP4.bat b/Easy MP4.bat deleted file mode 100644 index d575a38..0000000 --- a/Easy MP4.bat +++ /dev/null @@ -1,96 +0,0 @@ -:start -@echo off -color 2e -cls -cd /d %~dp0 -if not EXIST C:\programdata\webex\webex\500\nbrplay.exe goto nonbr -if not EXIST "%cd%\Converted\" mkdir Converted -del *.cfg -goto precfg - -rem Checks if the required program is installed, turns off the output of commands and sets the color of the terminial. After it has completed the above tasks it routs the user to the main menu - -:nonbr -cls -echo You do not have WebEx's Network Recording Player installed. -echo. -echo Pressing "Y" will open http://www.webex.com/play-webex-recording.html -echo Pressing "N" will jump the program to the end. -echo. -choice /m "NOTE: When you download the player, download the ARF version." -if %errorlevel% EQU 2 goto end -cls -echo I have opened the above link in you web browser. -echo. -echo NOTE: Download and install the ARF version!!! -start www.webex.com/play-webex-recording.html -pause -goto end - -rem The above is displayed if you do not have the Networking Recording Player (nbrplayer) -rem installed. It displays a link to the download page to the NBR tool. - -:precfg -cls -setlocal -for %%a in ("%cd%\*.arf") do call:MakeMP4CFG "%%~a" "%source%\Converted" "%cd%" -for %%a in ("%cd%\*.cfg") do set /a count +=1 -for %%a in ("%cd%\*.cfg") do call:countnconvert "%%~a" "%cd%" "%count%" & set /a count -=1 -del *.cfg -goto end - - -rem lists the contents of %cd% and puts the list in %%a. -rem Then processes the list (%a) and runs the call command for each entry while passing -rem the preselected destination and source to the config file that is created. - -rem After that is done it then looks and makes a list of all the config files in the %cd% folder, again as %a. -rem Then it calls the :countnconvert section and converts them while displaying the remaining file count. - - -:MakeMP4CFG -setlocal -set "MP4=%~n1" -set "source=%~dp1" -set "filename=%~n1" - -( -ECHO([Console] -ECHO(inputfile="%source%\%filename%.arf" -ECHO(media=MP4 -ECHO(showui=0 -ECHO([UI] -ECHO(chat=1 -ECHO(video=0 -ECHO(qa=0 -ECHO(largeroutline=1 -ECHO([MP4] -ECHO(outputfile="%source%\%filename%.mp4" -ECHO(width=1440 -ECHO(height=768 -ECHO(framerate=10 -)>"%MP4%.cfg" -exit /b - -rem Above is the CFG file template used to create the ARF's CFG file. - -:countnconvert -setlocal -cls -echo %count% files remaining... This may take some time ;) -c:\programdata\webex\webex\500\nbrplay.exe -Convert "%~dp1\%~n1.cfg" -exit /b - -rem This converts the file based upon the imputed CFG file that was created in one of the previous steps. -rem This also displays the current files that are left for conversion. - -:end -cls -echo Thank you for using the Elliot Labs ARF converter. -echo Special thanks to HuffDaddy for coding help. -echo For feature requests please email Elliot at elliot-labs@live.com -echo. -pause | echo Press any key to exit... -exit /b - -rem Exits the program on the user's input while giving the credits. diff --git a/Easy SWF.bat b/Easy SWF.bat deleted file mode 100644 index 647bc9c..0000000 --- a/Easy SWF.bat +++ /dev/null @@ -1,90 +0,0 @@ -:start -@echo off -color 2e -cls -cd /d %~dp0 -if not EXIST C:\programdata\webex\webex\500\nbrplay.exe goto nonbr -goto precfg - -rem Checks if the required program is installed, turns off the output of commands and sets the color of the terminial. After it has completed the above tasks it routs the user to the main menu - -:nonbr -cls -echo You do not have WebEx's Network Recording Player installed. -echo. -echo Pressing "Y" will open http://www.webex.com/play-webex-recording.html -echo Pressing "N" will jump the program to the end. -echo. -choice /m "NOTE: When you download the player, download the ARF version." -if %errorlevel% EQU 2 goto end -cls -echo I have opened the above link in you web browser. -echo. -echo NOTE: Download and install the ARF version!!! -start www.webex.com/play-webex-recording.html -pause -goto end - -rem The above is displayed if you do not have the Networking Recording Player (nbrplayer) -rem installed. It displays a link to the download page to the NBR tool. - -:precfg -cls -setlocal -for %%a in ("%cd%\*.arf") do call:MakeSWFCFG "%%~a" "%source%\Converted" "%source%" -for %%a in ("%cd%\*.cfg") do set /a count +=1 -for %%a in ("%cd%\*.cfg") do call:countnconvert "%%~a" "%source%" "%count%" & set /a count -=1 -del *.cfg -goto end - - -rem lists the contents of %cd% and puts the list in %%a. -rem Then processes the list (%a) and runs the call command for each entry while passing -rem the preselected destination and source to the config file that is created. - -rem After that is done it then looks and makes a list of all the config files in the %cd% folder, again as %a. -rem Then it calls the :countnconvert section and converts them while displaying the remaining file count. - - -:MakeSWFCFG -setlocal -set "SWF=%~n1" -set "source=%~dp1" -set "filename=%~n1" - -( -ECHO([Console] -ECHO(inputfile="%source%%filename%.arf" -ECHO(media=SWF -ECHO(showui=0 -ECHO(PCAudio=0 -ECHO([SWF] -ECHO(outputfile="%source%Converted\%filename%.swf" -ECHO(width=1440 -ECHO(height=768 -)>"%SWF%.cfg" -exit /b - - -rem Above is the CFG file template used to create the ARF's CFG file. - -:countnconvert -setlocal -cls -echo %count% files remaining... This may take some time ;) -c:\programdata\webex\webex\500\nbrplay.exe -Convert "%~dp1\%~n1.cfg" -exit /b - -rem This converts the file based upon the imputed CFG file that was created in one of the previous steps. -rem This also displays the current files that are left for conversion. - -:end -cls -echo Thank you for using the Elliot Labs ARF converter. -echo Special thanks to HuffDaddy for coding help. -echo For feature requests please email Elliot at elliot-labs@live.com -echo. -pause | echo Press any key to exit... -exit /b - -rem Exits the program on the user's input while giving the credits. diff --git a/Easy WMV.bat b/Easy WMV.bat deleted file mode 100644 index 6af664d..0000000 --- a/Easy WMV.bat +++ /dev/null @@ -1,104 +0,0 @@ -:start -@echo off -color 2e -cls -cd /d %~dp0 -if not EXIST C:\programdata\webex\webex\500\nbrplay.exe goto nonbr -if not EXIST "%cd%\Converted\" mkdir Converted -del *.cfg -goto precfg - -rem Checks if the required program is installed, turns off the output of commands and sets the color of the terminial. After it has completed the above tasks it routs the user to the main menu - -:nonbr -cls -echo You do not have WebEx's Network Recording Player installed. -echo. -echo Pressing "Y" will open http://www.webex.com/play-webex-recording.html -echo Pressing "N" will jump the program to the end. -echo. -choice /m "NOTE: When you download the player, download the ARF version." -if %errorlevel% EQU 2 goto end -cls -echo I have opened the above link in you web browser. -echo. -echo NOTE: Download and install the ARF version!!! -start www.webex.com/play-webex-recording.html -pause -goto end - -rem The above is displayed if you do not have the Networking Recording Player (nbrplayer) -rem installed. It displays a link to the download page to the NBR tool. - -:precfg -cls -setlocal -for %%a in ("%cd%\*.arf") do call:MakeWMVCFG "%%~a" "%source%\Converted" "%source%" -for %%a in ("%cd%\*.cfg") do set /a count +=1 -for %%a in ("%cd%\*.cfg") do call:countnconvert "%%~a" "%source%" "%count%" & set /a count -=1 -del *.cfg -goto end - - -rem lists the contents of %cd% and puts the list in %%a. -rem Then processes the list (%a) and runs the call command for each entry while passing -rem the preselected destination and source to the config file that is created. - -rem After that is done it then looks and makes a list of all the config files in the %cd% folder, again as %a. -rem Then it calls the :countnconvert section and converts them while displaying the remaining file count. - - -:MakeWMVCFG -setlocal -set "WMV=%~n1" -set "source=%~dp1" -set "filename=%~n1" - -( -ECHO([Console] -ECHO(inputfile="%source%%filename%.arf" -ECHO(media=WMV -ECHO(showui=0 -ECHO(PCAudio=0 -ECHO([UI] -ECHO(chat=1 -ECHO(video=0 -ECHO(qa=0 -ECHO(largeroutline=1 -ECHO([WMV] -ECHO(outputfile="%source%Converted\%filename%.wmv" -ECHO(width=1440 -ECHO(height=768 -ECHO(videocodec=Windows Media Video 9 -ECHO(audiocodec=Windows Media Audio 9.2 Lossless -ECHO(videoformat=default -ECHO(audioformat=default -ECHO(videokeyframes=4 -ECHO(maxstream=1000 -)>"%WMV%.cfg" -exit /b - - -rem Above is the CFG file template used to create the ARF's CFG file. - - -:countnconvert -setlocal -cls -echo %count% files remaining... This may take some time ;) -c:\programdata\webex\webex\500\nbrplay.exe -Convert "%~dp1\%~n1.cfg" -exit /b - -rem This converts the file based upon the imputed CFG file that was created in one of the previous steps. -rem This also displays the current files that are left for conversion. - -:end -cls -echo Thank you for using the Elliot Labs ARF converter. -echo Special thanks to HuffDaddy for coding help. -echo For feature requests please email Elliot at elliot-labs@live.com -echo. -pause | echo Press any key to exit... -exit /b - -rem Exits the program on the user's input while giving the credits. diff --git a/Helpful-Material/MP4.cfg b/Helpful-Material/MP4.cfg deleted file mode 100644 index dd63e79..0000000 --- a/Helpful-Material/MP4.cfg +++ /dev/null @@ -1,13 +0,0 @@ -[Console] -inputfile=C:\webex\1.arf -media=MP4 -showui=0 -[UI] -chat=1 -qa=0 -largeroutline=1 -[MP4] -outputfile=C:\webex\1.mp4 -width=1440 -height=768 -framerate=10 diff --git a/Helpful-Material/SWF.cfg b/Helpful-Material/SWF.cfg deleted file mode 100644 index f708951..0000000 --- a/Helpful-Material/SWF.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[Console] -inputfile=C:\webex\1.arf -media=SWF -showui=0 -PCAudio=0 -[SWF] -outputfile=C:\webex\1.swf -width=1440 -height=768 -framerate=1 diff --git a/Helpful-Material/WMV.cfg b/Helpful-Material/WMV.cfg deleted file mode 100644 index 0aa7b2a..0000000 --- a/Helpful-Material/WMV.cfg +++ /dev/null @@ -1,19 +0,0 @@ -[Console] -inputfile=C:\webex\2.arf -media=WMV -showui=0 -PCAudio=0 -[UI] -chat=1 -video=1 -largeroutline=1 -[WMV] -outputfile=C:\webex\2.wmv -width=1024 -height=768 -videocodec=Windows Media Video 9 -audiocodec=Windows Media Audio 9.2 Lossless -videoformat=default -audioformat=default -videokeyframes=4 -maxstream=1000 diff --git a/inspiration/Convert.vbs b/inspiration/Convert.vbs deleted file mode 100644 index 9682707..0000000 --- a/inspiration/Convert.vbs +++ /dev/null @@ -1,173 +0,0 @@ -Option Explicit - -Main - -Sub Main -Dim Path -Dim a: a = ListDir("c:\Webex\*.arf") -Dim FileName -Dim FileName1 -Dim FileName2 -Dim mp4 -Dim wmv -Dim objFSO -Dim objFile -Dim objTextFile -Dim WSHShell -Dim StrCMDLine -Dim d: d = ListDir("c:\Webex\*.cfg") -Set WSHShell = CreateObject("WScript.Shell") -For Each FileName In d -Set objFSO = CreateObject("Scripting.FileSystemObject") -objFSO.DeleteFile(Filename) -Next -For Each FileName In a -mp4 = 0 -wmv = 0 -'WScript.Echo FileName -'WScript.Echo Left(Filename,(Len(Filename)-4)) -Dim b: b = ListDir(Left(Filename,(Len(Filename)-4))+".mp4") -For Each FileName1 In b -'WScript.Echo FileName1 -mp4 = 1 -Next -Dim c: c = ListDir(Left(Filename,(Len(Filename)-4))+".wmv") -For Each FileName2 In c -'WScript.Echo FileName2 -wmv = 1 -Next -If mp4 = 0 then -Set objFSO = CreateObject("Scripting.FileSystemObject") -Set objTextFile = objFSO.CreateTextFile(Left(Filename,(Len(Filename)-4))+"-mp4.cfg") -objTextFile.WriteLine("") -objTextFile.WriteLine("[Console]") -objTextFile.WriteLine("inputfile="+Filename) -objTextFile.WriteLine("media=MP4") -objTextFile.WriteLine("showui=0") -objTextFile.WriteLine("[UI]") -objTextFile.WriteLine("chat=0") -objTextFile.WriteLine("qa=0") -objTextFile.WriteLine("largeroutline=1") -objTextFile.WriteLine("[MP4]") -objTextFile.WriteLine("outputfile="+Left(Filename,(Len(Filename)-4))+".mp4") -objTextFile.WriteLine("width=1024") -objTextFile.WriteLine("height=768") -objTextFile.WriteLine("framerate=8") -objTextFile.Close -End If -If wmv = 0 then -Set objFSO = CreateObject("Scripting.FileSystemObject") -Set objTextFile = objFSO.CreateTextFile(Left(Filename,(Len(Filename)-4))+"-wmv.cfg") -objTextFile.WriteLine("[Console]") -objTextFile.WriteLine("inputfile="+Filename) -objTextFile.WriteLine("media=WMV") -objTextFile.WriteLine("showui=0") -objTextFile.WriteLine("PCAudio=0") -objTextFile.WriteLine("[UI]") -objTextFile.WriteLine("largeroutline=0") -objTextFile.WriteLine("[WMV]") -objTextFile.WriteLine("outputfile="+Left(Filename,(Len(Filename)-4))+".wmv") -objTextFile.WriteLine("width=1024") -objTextFile.WriteLine("height=768") -objTextFile.WriteLine("videocodec=Windows Media Video 9") -objTextFile.WriteLine("audiocodec=Windows Media Audio 9.2 Lossless") -objTextFile.WriteLine("videoformat=default") -objTextFile.WriteLine("audioformat=default") -objTextFile.WriteLine("videokeyframes=4") -objTextFile.WriteLine("maxstream=1000") -objTextFile.Close -End If -Next -Dim e: e = ListDir("c:\Webex\*.cfg") -For Each FileName In e -Set objFSO = CreateObject("Scripting.FileSystemObject") -StrCMDLine = "cmd /c C: & CD %windir% & C:\ProgramData\WebEx\WebEx\500\nbrplay.exe -Convert " + """" + FileName + """" + " & exit" -'WScript.Echo StrCMDLine -wshShell.run StrCMDLine ,0,True -objFSO.DeleteFile(Filename) -Next - -End Sub - -Public Function ListDir (ByVal Path) -Dim fso: Set fso = CreateObject("Scripting.FileSystemObject") -If Path = "" then Path = "*.*" -Dim Parent, Filter -if fso.FolderExists(Path) then ' Path is a directory -Parent = Path -Filter = "*" -Else -Parent = fso.GetParentFolderName(Path) -If Parent = "" Then If Right(Path,1) = ":" Then Parent = Path: Else Parent = "." -Filter = fso.GetFileName(Path) -If Filter = "" Then Filter = "*" -End If -ReDim a(10) -Dim n: n = 0 -Dim Folder: Set Folder = fso.GetFolder(Parent) -Dim Files: Set Files = Folder.Files -Dim File -For Each File In Files -If CompareFileName(File.Name,Filter) Then -If n > UBound(a) Then ReDim Preserve a(n*2) -a(n) = File.Path -n = n + 1 -End If -Next -ReDim Preserve a(n-1) -ListDir = a -End Function - -Private Function CompareFileName (ByVal Name, ByVal Filter) ' (recursive) -CompareFileName = False -Dim np, fp: np = 1: fp = 1 -Do -If fp > Len(Filter) Then CompareFileName = np > len(name): Exit Function -If Mid(Filter,fp) = ".*" Then ' special case: ".*" at end of filter -If np > Len(Name) Then CompareFileName = True: Exit Function -End If -If Mid(Filter,fp) = "." Then ' special case: "." at end of filter -CompareFileName = np > Len(Name): Exit Function -End If -Dim fc: fc = Mid(Filter,fp,1): fp = fp + 1 -Select Case fc -Case "*" -CompareFileName = CompareFileName2(name,np,filter,fp) -Exit Function -Case "?" -If np <= Len(Name) And Mid(Name,np,1) <> "." Then np = np + 1 -Case Else -If np > Len(Name) Then Exit Function -Dim nc: nc = Mid(Name,np,1): np = np + 1 -If Strcomp(fc,nc,vbTextCompare)<>0 Then Exit Function -End Select -Loop -End Function - -Private Function CompareFileName2 (ByVal Name, ByVal np0, ByVal Filter, ByVal fp0) -Dim fp: fp = fp0 -Dim fc2 -Do ' skip over "*" and "?" characters in filter -If fp > Len(Filter) Then CompareFileName2 = True: Exit Function -fc2 = Mid(Filter,fp,1): fp = fp + 1 -If fc2 <> "*" And fc2 <> "?" Then Exit Do -Loop -If fc2 = "." Then -If Mid(Filter,fp) = "*" Then ' special case: ".*" at end of filter -CompareFileName2 = True: Exit Function -End If -If fp > Len(Filter) Then ' special case: "." at end of filter -CompareFileName2 = InStr(np0,Name,".") = 0: Exit Function -End If -End If -Dim np -For np = np0 To Len(Name) -Dim nc: nc = Mid(Name,np,1) -If StrComp(fc2,nc,vbTextCompare)=0 Then -If CompareFileName(Mid(Name,np+1),Mid(Filter,fp)) Then -CompareFileName2 = True: Exit Function -End If -End If -Next -CompareFileName2 = False -End Function From 9628c4456bb1f6b4c01fa0ca6774b79dce4aed29 Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Sat, 1 Oct 2016 18:56:47 -0400 Subject: [PATCH 02/10] Finalize radio framework Added top level window usage from suggesstion of @Bryan Oakley of stack overflow. Thank you for your help (pep 8 adherence is coming in a future version (most likely after the gui is finished.) --- test.py | 70 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 25 deletions(-) diff --git a/test.py b/test.py index bd50136..27a8f80 100644 --- a/test.py +++ b/test.py @@ -16,15 +16,33 @@ def __init__(self, height, width, window_title): self.root_window.title(window_title) self.root_window.minsize(width, height) self.root_window.geometry('%dx%d+%d+%d' % (w, h, x, y)) - self.master_dictionary = {"radio_ctrl": StringVar()} + self.master_dictionary = {"radio_ctrl": StringVar(), "top_level_window": False} + + def new_top_level(self, height, width, window_title): + self.top_level_window = Toplevel() + w = width + h = height + ws = self.top_level_window.winfo_screenwidth() # width of the screen + hs = self.top_level_window.winfo_screenheight() # height of the screen + x = (ws/2) - (w/2) + y = (hs/2) - (h/2) + self.top_level_window.title(window_title) + self.top_level_window.minsize(width, height) + self.top_level_window.geometry('%dx%d+%d+%d' % (w, h, x, y)) def new_button(self, button_text, button_command="", grid_row=0, grid_column=0, grid_sticky="NESW", grid_columnspan=1, grid_rowspan=1): - self.button = ttk.Button(self.root_window, text=button_text, command=button_command) + if self.master_dictionary["top_level_window"]: + self.button = ttk.Button(self.top_level_window, text=button_text, command=button_command) + elif not self.master_dictionary["top_level_window"]: + self.button = ttk.Button(self.root_window, text=button_text, command=button_command) self.button.grid(row=grid_row, column=grid_column, sticky=grid_sticky, columnspan=grid_columnspan, rowspan=grid_rowspan) self.responsive_grid(grid_row, grid_column) def new_label(self, label_text, text_alignment="center", grid_row=0, grid_column=0, grid_sticky="NESW", grid_columnspan=1, grid_rowspan=1): - self.label = ttk.Label(self.root_window, text=label_text, anchor=text_alignment) + if self.master_dictionary["top_level_window"]: + self.label = ttk.Label(self.top_level_window, text=label_text, anchor=text_alignment) + elif not self.master_dictionary["top_level_window"]: + self.label = ttk.Label(self.root_window, text=label_text, anchor=text_alignment) self.label.grid(row=grid_row, column=grid_column, sticky=grid_sticky, columnspan=grid_columnspan, rowspan=grid_rowspan) self.responsive_grid(grid_row, grid_column) @@ -34,11 +52,18 @@ def new_progress_bar(self, pg_length=250, pg_mode="determinate", grid_row=0, gri self.responsive_grid(grid_row, grid_column) def responsive_grid(self, row_responsive=0, column_responsive=0, row_weight_num=1, column_weight_num=1): - self.root_window.grid_columnconfigure(column_responsive, weight=column_weight_num) - self.root_window.grid_rowconfigure(row_responsive, weight=row_weight_num) + if self.master_dictionary["top_level_window"]: + self.top_level_window.grid_columnconfigure(column_responsive, weight=column_weight_num) + self.top_level_window.grid_rowconfigure(row_responsive, weight=row_weight_num) + elif not self.master_dictionary["top_level_window"]: + self.root_window.grid_columnconfigure(column_responsive, weight=column_weight_num) + self.root_window.grid_rowconfigure(row_responsive, weight=row_weight_num) def new_radio_button(self, widget_text="Radio Button", radio_value="Radio Btn", radio_command="", grid_row=0, grid_column=0, grid_sticky="NESW", grid_columnspan=1, grid_rowspan=1): - self.radio_button = ttk.Radiobutton(self.root_window, text=widget_text, variable=self.master_dictionary["radio_ctrl"], value=radio_value, command=radio_command) + if self.master_dictionary["top_level_window"]: + self.radio_button = ttk.Radiobutton(self.top_level_window, text=widget_text, variable=self.master_dictionary["radio_ctrl"], value=radio_value, command=radio_command) + elif not self.master_dictionary["top_level_window"]: + self.radio_button = ttk.Radiobutton(self.root_window, text=widget_text, variable=self.master_dictionary["radio_ctrl"], value=radio_value, command=radio_command) self.radio_button.grid(row=grid_row, column=grid_column, sticky=grid_sticky, columnspan=grid_columnspan, rowspan=grid_rowspan) self.responsive_grid(grid_row, grid_column) @@ -127,7 +152,7 @@ def toggle_var(self, var_name="some_var", custom_data=False, custom_data_enable= def save_radio_var(self): vars_system.init_vars[self.change_var_window_values["var_to_change"]] = self.master_dictionary["radio_ctrl"].get() messagebox.showinfo("debug", self.master_dictionary["radio_ctrl"].get()) - #self.root_window.destroy() + self.top_level_window.destroy() #main_window.root_window.deiconify() @@ -147,7 +172,7 @@ def create_change_var_window(self): self.new_radio_button(widget_text=radio_name, radio_value=value, grid_row=grid_placement) grid_placement +=1 grid_placement -=1 - self.new_button("Cancle", self.root_window.destroy, grid_row=grid_placement, grid_column=1) + self.new_button("Cancle", self.top_level_window.destroy, grid_row=grid_placement, grid_column=1) grid_placement -=1 self.new_button("Save", self.save_radio_var, grid_row=grid_placement, grid_column=1) # Radio Requires: @@ -158,7 +183,10 @@ def create_change_var_window(self): self.new_button("Cancel", self.root_window.destroy, grid_row=3, grid_column=1) # Free_form requires: # "var_to_change" and "is_number" - self.root_window.mainloop() + if self.master_dictionary["top_level_window"]: + self.top_level_window.mainloop() + elif not self.master_dictionary["top_level_window"]: + self.root_window.mainloop() # seperator @@ -275,22 +303,14 @@ def example_toggle(): toggle.create_change_var_window() def radio_example(): - radio = change_var_window(300, 350, "Radio Select") - radio.change_var_window_values.update({"free_form": False, "toggle": False, "radio": True, "var_to_change": "w_audiocodec", "line_one": "Current value of w_audiocodec:", "line_two": vars_system.init_vars["w_audiocodec"]}) - radio.change_var_window_values.update({"radio_list": [("Windows Media Audio 9.2", "Windows Media Audio 9.2"), ("Windows Media Audio 9.2 Lossless", "Windows Media Audio 9.2 Lossless"), ("Windows Media Audio 10 Professional", "Windows Media Audio 10 Professional")]}) - #main_window.root_window.withdraw() - radio.create_change_var_window() + main_window.new_top_level(200, 250, "Radio") + main_window.master_dictionary["top_level_window"] = True + main_window.change_var_window_values.update({"free_form": False, "toggle": False, "radio": True, "var_to_change": "w_audiocodec", "line_one": "Current value of w_audiocodec:", "line_two": vars_system.init_vars["w_audiocodec"]}) + main_window.change_var_window_values.update({"radio_list": [("Windows Media Audio 9.2", "Windows Media Audio 9.2"), ("Windows Media Audio 9.2 Lossless", "Windows Media Audio 9.2 Lossless"), ("Windows Media Audio 10 Professional", "Windows Media Audio 10 Professional")]}) + main_window.create_change_var_window() + def print_radio_value(): - global radio_test_window messagebox.showinfo("Debug", radio_test_window.master_dictionary["radio_ctrl"].get()) -def radio_test(): - global radio_test_window - radio_test_window = render_window(200, 250, "Test") - radio_test_window.new_button("Dialog", print_radio_value, grid_column=1) - radio_test_window.new_radio_button("Button 1", "btn1") - radio_test_window.new_radio_button("Button 2", "btn2", grid_row=1) - radio_test_window.new_radio_button("Button 3", "btn3", grid_row=2) - radio_test_window.root_window.mainloop() @@ -298,9 +318,9 @@ def radio_test(): vars_system = init_system() -main_window = render_window(200, 250, "Main Window") +main_window = change_var_window(200, 250, "Main Window") main_window.new_button("Freeform Edit", freeform_example, 1, grid_columnspan=2) -main_window.new_button("Toggle Var", radio_test) +main_window.new_button("Toggle Var", example_toggle) main_window.new_button("Radio Var", radio_example, grid_column=1) main_window.root_window.mainloop() From 71e03d5f6e9835a6a882f52c7050e56309e4d826 Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Sat, 1 Oct 2016 20:40:50 -0400 Subject: [PATCH 03/10] Add top level window support Added top level window support to the render_window framework --- test.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test.py b/test.py index 27a8f80..c2d71d6 100644 --- a/test.py +++ b/test.py @@ -47,7 +47,10 @@ def new_label(self, label_text, text_alignment="center", grid_row=0, grid_column self.responsive_grid(grid_row, grid_column) def new_progress_bar(self, pg_length=250, pg_mode="determinate", grid_row=0, grid_column=0, grid_sticky="NESW", grid_columnspan=1, grid_rowspan=1): - self.progress_bar = ttk.Progressbar(self.root_window, length=pg_length, mode=pg_mode) + if self.master_dictionary["top_level_window"]: + self.progress_bar = ttk.Progressbar(self.top_level_window, length=pg_length, mode=pg_mode) + elif not self.master_dictionary["top_level_window"]: + self.progress_bar = ttk.Progressbar(self.root_window, length=pg_length, mode=pg_mode) self.progress_bar.grid(row=grid_row, column=grid_column, sticky=grid_sticky, columnspan=grid_columnspan, rowspan=grid_rowspan) self.responsive_grid(grid_row, grid_column) @@ -68,7 +71,10 @@ def new_radio_button(self, widget_text="Radio Button", radio_value="Radio Btn", self.responsive_grid(grid_row, grid_column) def new_text_box(self, grid_row=0, grid_column=0, grid_sticky="NESW", grid_columnspan=1, grid_rowspan=1): - self.text_box = ttk.Entry(self.root_window) + if self.master_dictionary["top_level_window"]: + self.text_box = ttk.Entry(self.top_level_window) + elif not self.master_dictionary["top_level_window"]: + self.text_box = ttk.Entry(self.root_window) self.text_box.grid(row=grid_row, column=grid_column, sticky=grid_sticky, columnspan=grid_columnspan, rowspan=grid_rowspan) self.responsive_grid(grid_row, grid_column) #seperator @@ -88,7 +94,6 @@ class change_var_window(render_window): "Custom_Enable": "Disable me", "radio_list": [("Radio Button 1", "btn_1"), ("Radio Button 2", "btn_2"), ("Radio Button 3", "btn_3")], "is_number": True} - def save_freeform_value(self): if self.change_var_window_values["is_number"] and vars_system.int_able_check(self.text_box.get()): vars_system.init_vars[self.change_var_window_values["var_to_change"]] = self.text_box.get() @@ -309,10 +314,6 @@ def radio_example(): main_window.change_var_window_values.update({"radio_list": [("Windows Media Audio 9.2", "Windows Media Audio 9.2"), ("Windows Media Audio 9.2 Lossless", "Windows Media Audio 9.2 Lossless"), ("Windows Media Audio 10 Professional", "Windows Media Audio 10 Professional")]}) main_window.create_change_var_window() -def print_radio_value(): - messagebox.showinfo("Debug", radio_test_window.master_dictionary["radio_ctrl"].get()) - - #seperator From bd2f77587c92087abd0a2265300c98d17fe6a15a Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Sun, 2 Oct 2016 09:30:34 -0400 Subject: [PATCH 04/10] Pep8 and bug fix Added more pep8 complincy plus corrected a bug with the NBR checking system where methods were not correctly referenced --- test.py | 86 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/test.py b/test.py index c2d71d6..e7a9b74 100644 --- a/test.py +++ b/test.py @@ -83,17 +83,18 @@ def new_text_box(self, grid_row=0, grid_column=0, grid_sticky="NESW", grid_colum class change_var_window(render_window): change_var_window_values = {"example_data_below": "Check it out!", - "var_to_change": "show_ui", - "toggle": False, - "radio": False, - "free_form":False, - "line_one": "Current value of:", - "line_two": "some varible name here passwed with a dicrionary", - "Custom_Data_Bool": False, - "Custom_Disable": "Enable me", - "Custom_Enable": "Disable me", - "radio_list": [("Radio Button 1", "btn_1"), ("Radio Button 2", "btn_2"), ("Radio Button 3", "btn_3")], - "is_number": True} + "var_to_change": "show_ui", + "toggle": False, + "radio": False, + "free_form":False, + "line_one": "Current value of:", + "line_two": "some varible name here passwed with a dicrionary", + "Custom_Data_Bool": False, + "Custom_Disable": "Enable me", + "Custom_Enable": "Disable me", + "radio_list": [("Radio Button 1", "btn_1"), ("Radio Button 2", "btn_2"), ("Radio Button 3", "btn_3")], + "is_number": True + } def save_freeform_value(self): if self.change_var_window_values["is_number"] and vars_system.int_able_check(self.text_box.get()): vars_system.init_vars[self.change_var_window_values["var_to_change"]] = self.text_box.get() @@ -158,8 +159,8 @@ def save_radio_var(self): vars_system.init_vars[self.change_var_window_values["var_to_change"]] = self.master_dictionary["radio_ctrl"].get() messagebox.showinfo("debug", self.master_dictionary["radio_ctrl"].get()) self.top_level_window.destroy() - #main_window.root_window.deiconify() - + main_window.root_window.deiconify() + def create_change_var_window(self): self.new_label(self.change_var_window_values["line_one"], grid_columnspan=2) @@ -175,10 +176,10 @@ def create_change_var_window(self): #self.master_dictionary["radio_ctrl"].set(vars_system.init_vars[self.change_var_window_values["var_to_change"]]) for radio_name, value in self.change_var_window_values["radio_list"]: self.new_radio_button(widget_text=radio_name, radio_value=value, grid_row=grid_placement) - grid_placement +=1 - grid_placement -=1 + grid_placement += 1 + grid_placement -= 1 self.new_button("Cancle", self.top_level_window.destroy, grid_row=grid_placement, grid_column=1) - grid_placement -=1 + grid_placement -= 1 self.new_button("Save", self.save_radio_var, grid_row=grid_placement, grid_column=1) # Radio Requires: # "radio_list" "var_to_change" @@ -198,29 +199,30 @@ def create_change_var_window(self): class init_system: def __init__(self): - self.init_vars = {"path_to_file": path.abspath(__file__), - "nbr_path": path.normpath("C:/ProgramData/WebEx/WebEx/500/nbrplay.exe"), - "file_type": "mp4", - "showui": 0, - "need_ui_section": False, - "width": 1920, - "height": 1080, - "m_ui_chat": 1, - "m_ui_qa": 1, - "m_ui_largeroutline": 1, - "m_framerate": 5, - "s_console_pcaudio": 0, - "s_framerate": 10, - "w_console_pcaudio": 0, - "w_ui_chat": 1, - "w_ui_video": 1, - "w_ui_largeroutline": 1, - "w_videocodec": "Windows Media Video 9", - "w_audiocodec": "Windows Media Audio 9.2 Lossless", - "w_videoformat": "default", - "w_audioformat": "default", - "w_videokeyframes": 4, - "w_maxstream": 1000} + self.init_vars = { + "path_to_file": path.abspath(__file__), + "nbr_path": path.normpath("C:/ProgramData/WebEx/WebEx/500/nbrplay.exe"), + "file_type": "mp4", + "showui": 0, + "need_ui_section": False, + "width": 1920, + "height": 1080, + "m_ui_chat": 1, + "m_ui_qa": 1, + "m_ui_largeroutline": 1, + "m_framerate": 5, + "s_console_pcaudio": 0, + "s_framerate": 10, + "w_console_pcaudio": 0, + "w_ui_chat": 1, + "w_ui_video": 1, + "w_ui_largeroutline": 1, + "w_videocodec": "Windows Media Video 9", + "w_audiocodec": "Windows Media Audio 9.2 Lossless", + "w_videoformat": "default", + "w_audioformat": "default", + "w_videokeyframes": 4, + "w_maxstream": 1000} self.init_vars["directory_name"] = path.dirname(self.init_vars["path_to_file"]) self.init_vars["input_file_dir"] = path.dirname(self.init_vars["path_to_file"]) self.init_vars["output_file_dir"] = path.dirname(self.init_vars["path_to_file"]) + "\\Converted" @@ -246,8 +248,8 @@ def locate_nbr(self): elif download_nbr == "no": nbr_already_installed = messagebox.askquestion("Maybe we missed it...", "Do you have the NBR player installed already?") if nbr_already_installed == "yes": - custom_nbr_location() - locate_nbr() + self.custom_nbr_location() + self.locate_nbr() else: messagebox.showerror("Cannot continue!", "This script requires the Network Broadcast Recording player to operate.\nPlease have it installed for the next time you run this script.") exit() @@ -284,7 +286,7 @@ def check_folder(self): def int_able_check(self, string): - try: + try: int(string) return True except ValueError: From 7a6ed862ffc088400177280b2cf2ade9ff50b89d Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Sun, 2 Oct 2016 10:03:16 -0400 Subject: [PATCH 05/10] Fixed cancel button Fixed cancel button not showing the parent window again. --- test.py | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/test.py b/test.py index e7a9b74..1f6e9db 100644 --- a/test.py +++ b/test.py @@ -77,6 +77,13 @@ def new_text_box(self, grid_row=0, grid_column=0, grid_sticky="NESW", grid_colum self.text_box = ttk.Entry(self.root_window) self.text_box.grid(row=grid_row, column=grid_column, sticky=grid_sticky, columnspan=grid_columnspan, rowspan=grid_rowspan) self.responsive_grid(grid_row, grid_column) + + def close_window(self): + if self.master_dictionary["top_level_window"]: + self.top_level_window.destroy() + self.root_window.deiconify() + elif not self.master_dictionary["top_level_window"]: + self.root_window.destroy() #seperator @@ -99,15 +106,13 @@ def save_freeform_value(self): if self.change_var_window_values["is_number"] and vars_system.int_able_check(self.text_box.get()): vars_system.init_vars[self.change_var_window_values["var_to_change"]] = self.text_box.get() messagebox.showinfo("Success", "The custom value has been saved!") - main_window.root_window.deiconify() - self.root_window.destroy() + self.close_window() elif self.change_var_window_values["is_number"] and not vars_system.int_able_check(self.text_box.get()): messagebox.showerror("Error", "Entry has to be a number above zero.") elif not self.change_var_window_values["is_number"]: vars_system.init_vars[self.change_var_window_values["var_to_change"]] = self.text_box.get() messagebox.showinfo("Success", "The custom value has been saved!") - main_window.root_window.deiconify() - self.root_window.destroy() + self.close_window() def change_bool_data(self): if self.change_var_window_values["bool_value"]: @@ -123,14 +128,13 @@ def change_bool_data(self): else: messagebox.showerror("Error!", "An error has occured at change_data!") messagebox.showinfo("Success", "The toggle has been changed!") - main_window.root_window.deiconify() - self.root_window.destroy() + self.close_window() # seperator - def toggle_var(self, var_name="some_var", custom_data=False, custom_data_enable="placeholder", custom_data_disable="placeholder"): + def toggle_var(self, custom_data=False, custom_data_enable="placeholder", custom_data_disable="placeholder"): if custom_data: self.change_var_window_values["data_type"] = "custom" self.change_var_window_values["custom_data_enable"] = custom_data_enable @@ -158,16 +162,16 @@ def toggle_var(self, var_name="some_var", custom_data=False, custom_data_enable= def save_radio_var(self): vars_system.init_vars[self.change_var_window_values["var_to_change"]] = self.master_dictionary["radio_ctrl"].get() messagebox.showinfo("debug", self.master_dictionary["radio_ctrl"].get()) - self.top_level_window.destroy() - main_window.root_window.deiconify() + self.close_window() def create_change_var_window(self): + self.root_window.withdraw() self.new_label(self.change_var_window_values["line_one"], grid_columnspan=2) self.new_label(self.change_var_window_values["line_two"], grid_row=1, grid_columnspan=2) if self.change_var_window_values["toggle"]: - self.toggle_var(self.change_var_window_values["var_to_change"], self.change_var_window_values["Custom_Data_Bool"], self.change_var_window_values["Custom_Enable"], self.change_var_window_values["Custom_Disable"]) - self.new_button("Cancel", self.root_window.destroy, grid_row=2, grid_column=1) + self.toggle_var(self.change_var_window_values["Custom_Data_Bool"], self.change_var_window_values["Custom_Enable"], self.change_var_window_values["Custom_Disable"]) + self.new_button("Cancel", self.close_window, grid_row=2, grid_column=1) # Toggle requires: # "var_to_change", "Custom_Data_Bool", "Custom_Enable", "Custom_Disable" elif self.change_var_window_values["radio"]: @@ -178,7 +182,7 @@ def create_change_var_window(self): self.new_radio_button(widget_text=radio_name, radio_value=value, grid_row=grid_placement) grid_placement += 1 grid_placement -= 1 - self.new_button("Cancle", self.top_level_window.destroy, grid_row=grid_placement, grid_column=1) + self.new_button("Cancle", self.close_window, grid_row=grid_placement, grid_column=1) grid_placement -= 1 self.new_button("Save", self.save_radio_var, grid_row=grid_placement, grid_column=1) # Radio Requires: @@ -186,7 +190,7 @@ def create_change_var_window(self): elif self.change_var_window_values["free_form"]: self.new_text_box(grid_row=2, grid_columnspan=2) self.new_button("Save Value", self.save_freeform_value, 3) - self.new_button("Cancel", self.root_window.destroy, grid_row=3, grid_column=1) + self.new_button("Cancel", self.close_window, grid_row=3, grid_column=1) # Free_form requires: # "var_to_change" and "is_number" if self.master_dictionary["top_level_window"]: @@ -297,17 +301,16 @@ def int_able_check(self, string): def freeform_example(): - freeform = change_var_window(200, 250, "Change width") - freeform.change_var_window_values.update({"free_form": True, "toggle": False, "radio": False, "var_to_change": "width", "line_one": "Current value of width:", "line_two": vars_system.init_vars["width"], "is_number": True}) - main_window.root_window.withdraw() - freeform.create_change_var_window() - #remember to include Line_One and Line_Two!!! + main_window.new_top_level(200, 250, "Change width") + main_window.master_dictionary["top_level_window"] = True + main_window.change_var_window_values.update({"free_form": True, "toggle": False, "radio": False, "var_to_change": "width", "line_one": "Current value of width:", "line_two": vars_system.init_vars["width"], "is_number": True}) + main_window.create_change_var_window() def example_toggle(): - toggle = change_var_window(200, 250, "Toggle ShowUI") - toggle.change_var_window_values.update({"toggle": True, "var_to_change": "showui", "line_one": "Current value of ShowUI:", "line_two": vars_system.init_vars["showui"]}) - main_window.root_window.withdraw() - toggle.create_change_var_window() + main_window.new_top_level(200, 250, "Toggle ShowUI") + main_window.master_dictionary["top_level_window"] = True + main_window.change_var_window_values.update({"toggle": True, "var_to_change": "showui", "line_one": "Current value of ShowUI:", "line_two": vars_system.init_vars["showui"]}) + main_window.create_change_var_window() def radio_example(): main_window.new_top_level(200, 250, "Radio") From 5d4aa6da52c80696579a15431e3b913b40accfdb Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Sun, 2 Oct 2016 13:52:59 -0400 Subject: [PATCH 06/10] Lambda Example Implemented lambda test/example as a button. The purpose for this code is to demonstrate how to pass arguments via a button press without creating extra code/functions to do so. Also updated class name for pep8 compliency, moved another function out of Render_Window as Render_Window's scope does not handle window closing commands, that is for the program implementing Render_Window to handle. --- test.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/test.py b/test.py index 1f6e9db..ff7d36a 100644 --- a/test.py +++ b/test.py @@ -4,7 +4,7 @@ from tkinter import * from tkinter import messagebox, filedialog, ttk -class render_window: +class Render_Window: def __init__(self, height, width, window_title): self.root_window = Tk() w = width @@ -78,16 +78,11 @@ def new_text_box(self, grid_row=0, grid_column=0, grid_sticky="NESW", grid_colum self.text_box.grid(row=grid_row, column=grid_column, sticky=grid_sticky, columnspan=grid_columnspan, rowspan=grid_rowspan) self.responsive_grid(grid_row, grid_column) - def close_window(self): - if self.master_dictionary["top_level_window"]: - self.top_level_window.destroy() - self.root_window.deiconify() - elif not self.master_dictionary["top_level_window"]: - self.root_window.destroy() + #seperator -class change_var_window(render_window): +class change_var_window(Render_Window): change_var_window_values = {"example_data_below": "Check it out!", "var_to_change": "show_ui", @@ -102,6 +97,13 @@ class change_var_window(render_window): "radio_list": [("Radio Button 1", "btn_1"), ("Radio Button 2", "btn_2"), ("Radio Button 3", "btn_3")], "is_number": True } + def close_window(self): + if self.master_dictionary["top_level_window"]: + self.top_level_window.destroy() + self.root_window.deiconify() + elif not self.master_dictionary["top_level_window"]: + self.root_window.destroy() + def save_freeform_value(self): if self.change_var_window_values["is_number"] and vars_system.int_able_check(self.text_box.get()): vars_system.init_vars[self.change_var_window_values["var_to_change"]] = self.text_box.get() @@ -328,5 +330,6 @@ def radio_example(): main_window.new_button("Freeform Edit", freeform_example, 1, grid_columnspan=2) main_window.new_button("Toggle Var", example_toggle) main_window.new_button("Radio Var", radio_example, grid_column=1) +main_window.new_button("lambda test", lambda: messagebox.showerror("test","Example error"), 2, grid_columnspan=2) main_window.root_window.mainloop() From 0e5e1d40d01584a153ae474a42a187a2d825afd7 Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Mon, 3 Oct 2016 14:53:43 -0400 Subject: [PATCH 07/10] Add browse_for_data Added a browse for data system to allow varible manipulation by browsing for a directory or file, currently unfinished. Framework partially built. --- test.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test.py b/test.py index ff7d36a..d9727e5 100644 --- a/test.py +++ b/test.py @@ -86,6 +86,7 @@ class change_var_window(Render_Window): change_var_window_values = {"example_data_below": "Check it out!", "var_to_change": "show_ui", + "browse_data": False, "toggle": False, "radio": False, "free_form":False, @@ -97,6 +98,8 @@ class change_var_window(Render_Window): "radio_list": [("Radio Button 1", "btn_1"), ("Radio Button 2", "btn_2"), ("Radio Button 3", "btn_3")], "is_number": True } + def browse_for_data(self): + pass def close_window(self): if self.master_dictionary["top_level_window"]: self.top_level_window.destroy() @@ -195,6 +198,9 @@ def create_change_var_window(self): self.new_button("Cancel", self.close_window, grid_row=3, grid_column=1) # Free_form requires: # "var_to_change" and "is_number" + elif self.change_var_window_values["browse_data"]: + self.new_button("Browse", self.browse_for_data, grid_row=2) + self.new_button("Cancel", self.close_window, grid_row=2, grid_column=1) if self.master_dictionary["top_level_window"]: self.top_level_window.mainloop() elif not self.master_dictionary["top_level_window"]: @@ -202,7 +208,6 @@ def create_change_var_window(self): # seperator - class init_system: def __init__(self): self.init_vars = { @@ -301,6 +306,11 @@ def int_able_check(self, string): # Initializes the script with default values and changes to the directory where the script is located. +def browse_example(): + main_window.new_top_level(200, 250, "Browse for a dir") + main_window.master_dictionary["top_level_window"] = True + main_window.change_var_window_values.update({"browse_data": True, "free_form": False, "toggle": False, "radio": False, "var_to_change": "input_file_dir", "line_one": "Current value of input_file_dir:", "line_two": vars_system.init_vars["input_file_dir"]}) + main_window.create_change_var_window() def freeform_example(): main_window.new_top_level(200, 250, "Change width") @@ -330,6 +340,7 @@ def radio_example(): main_window.new_button("Freeform Edit", freeform_example, 1, grid_columnspan=2) main_window.new_button("Toggle Var", example_toggle) main_window.new_button("Radio Var", radio_example, grid_column=1) -main_window.new_button("lambda test", lambda: messagebox.showerror("test","Example error"), 2, grid_columnspan=2) +main_window.new_button("Browse Var", browse_example, grid_row=2) +main_window.new_button("lambda test", lambda: messagebox.showinfo("test","a message box..."), grid_row=2, grid_column=1) main_window.root_window.mainloop() From d6683d89dcb4b2d348778974b631376f6e9acb45 Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Mon, 3 Oct 2016 15:15:24 -0400 Subject: [PATCH 08/10] more browsing framework Added more systems to the change var via browsing system. --- test.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test.py b/test.py index d9727e5..9c00a78 100644 --- a/test.py +++ b/test.py @@ -89,7 +89,8 @@ class change_var_window(Render_Window): "browse_data": False, "toggle": False, "radio": False, - "free_form":False, + "free_form": False, + "browse_for_dir": True, "line_one": "Current value of:", "line_two": "some varible name here passwed with a dicrionary", "Custom_Data_Bool": False, @@ -99,7 +100,11 @@ class change_var_window(Render_Window): "is_number": True } def browse_for_data(self): - pass + if self.change_var_window_values["browse_for_dir"]: + vars_system.init_vars[self.change_var_window_values["var_to_change"]] = filedialog.askdirectory(mustexist=True) + elif not self.change_var_window_values["browse_for_dir"]: + vars_system.init_vars[self.change_var_window_values["var_to_change"]] = filedialog.askopenfile() + self.close_window() def close_window(self): if self.master_dictionary["top_level_window"]: self.top_level_window.destroy() @@ -309,7 +314,7 @@ def int_able_check(self, string): def browse_example(): main_window.new_top_level(200, 250, "Browse for a dir") main_window.master_dictionary["top_level_window"] = True - main_window.change_var_window_values.update({"browse_data": True, "free_form": False, "toggle": False, "radio": False, "var_to_change": "input_file_dir", "line_one": "Current value of input_file_dir:", "line_two": vars_system.init_vars["input_file_dir"]}) + main_window.change_var_window_values.update({"browse_data": True, "browse_for_dir": True, "free_form": False, "toggle": False, "radio": False, "var_to_change": "input_file_dir", "line_one": "Current value of input_file_dir:", "line_two": vars_system.init_vars["input_file_dir"]}) main_window.create_change_var_window() def freeform_example(): @@ -342,5 +347,6 @@ def radio_example(): main_window.new_button("Radio Var", radio_example, grid_column=1) main_window.new_button("Browse Var", browse_example, grid_row=2) main_window.new_button("lambda test", lambda: messagebox.showinfo("test","a message box..."), grid_row=2, grid_column=1) +main_window.new_button("Browse", browse_example, grid_row=3, grid_columnspan=2) main_window.root_window.mainloop() From d108b3277695834d025df6f8373fd77ed4883c7b Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Mon, 3 Oct 2016 15:43:10 -0400 Subject: [PATCH 09/10] Finalized Brwosing Finilised change var via browsing framework, added path correction to get the correct path saved in the var so it would be useable. --- test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test.py b/test.py index 9c00a78..49f283c 100644 --- a/test.py +++ b/test.py @@ -101,10 +101,11 @@ class change_var_window(Render_Window): } def browse_for_data(self): if self.change_var_window_values["browse_for_dir"]: - vars_system.init_vars[self.change_var_window_values["var_to_change"]] = filedialog.askdirectory(mustexist=True) + vars_system.init_vars[self.change_var_window_values["var_to_change"]] = path.normpath(filedialog.askdirectory(mustexist=True)) elif not self.change_var_window_values["browse_for_dir"]: - vars_system.init_vars[self.change_var_window_values["var_to_change"]] = filedialog.askopenfile() + vars_system.init_vars[self.change_var_window_values["var_to_change"]] = path.normpath(filedialog.askopenfile()) self.close_window() + def close_window(self): if self.master_dictionary["top_level_window"]: self.top_level_window.destroy() From 3fbb1effac46d74b2d1887d2bfd89768522ca45f Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Mon, 3 Oct 2016 18:51:13 -0400 Subject: [PATCH 10/10] Updated examples Added code to properly disable certain dynamic generation features. Should now be more robust. --- test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test.py b/test.py index 49f283c..7b90c01 100644 --- a/test.py +++ b/test.py @@ -315,25 +315,25 @@ def int_able_check(self, string): def browse_example(): main_window.new_top_level(200, 250, "Browse for a dir") main_window.master_dictionary["top_level_window"] = True - main_window.change_var_window_values.update({"browse_data": True, "browse_for_dir": True, "free_form": False, "toggle": False, "radio": False, "var_to_change": "input_file_dir", "line_one": "Current value of input_file_dir:", "line_two": vars_system.init_vars["input_file_dir"]}) + main_window.change_var_window_values.update({"browse_data": True, "free_form": False, "toggle": False, "radio": False, "browse_for_dir": True, "var_to_change": "input_file_dir", "line_one": "Current value of input_file_dir:", "line_two": vars_system.init_vars["input_file_dir"]}) main_window.create_change_var_window() def freeform_example(): main_window.new_top_level(200, 250, "Change width") main_window.master_dictionary["top_level_window"] = True - main_window.change_var_window_values.update({"free_form": True, "toggle": False, "radio": False, "var_to_change": "width", "line_one": "Current value of width:", "line_two": vars_system.init_vars["width"], "is_number": True}) + main_window.change_var_window_values.update({"browse_data": False, "free_form": True, "toggle": False, "radio": False, "var_to_change": "width", "line_one": "Current value of width:", "line_two": vars_system.init_vars["width"], "is_number": True}) main_window.create_change_var_window() def example_toggle(): main_window.new_top_level(200, 250, "Toggle ShowUI") main_window.master_dictionary["top_level_window"] = True - main_window.change_var_window_values.update({"toggle": True, "var_to_change": "showui", "line_one": "Current value of ShowUI:", "line_two": vars_system.init_vars["showui"]}) + main_window.change_var_window_values.update({"browse_data": False, "free_form": False, "toggle": True, "radio": False, "var_to_change": "showui", "line_one": "Current value of ShowUI:", "line_two": vars_system.init_vars["showui"]}) main_window.create_change_var_window() def radio_example(): main_window.new_top_level(200, 250, "Radio") main_window.master_dictionary["top_level_window"] = True - main_window.change_var_window_values.update({"free_form": False, "toggle": False, "radio": True, "var_to_change": "w_audiocodec", "line_one": "Current value of w_audiocodec:", "line_two": vars_system.init_vars["w_audiocodec"]}) + main_window.change_var_window_values.update({"browse_data": False, "free_form": False, "toggle": False, "radio": True, "var_to_change": "w_audiocodec", "line_one": "Current value of w_audiocodec:", "line_two": vars_system.init_vars["w_audiocodec"]}) main_window.change_var_window_values.update({"radio_list": [("Windows Media Audio 9.2", "Windows Media Audio 9.2"), ("Windows Media Audio 9.2 Lossless", "Windows Media Audio 9.2 Lossless"), ("Windows Media Audio 10 Professional", "Windows Media Audio 10 Professional")]}) main_window.create_change_var_window()