diff --git a/devel/get_shortcuts_and_classes.py b/devel/get_shortcuts_and_classes.py index 4b29e98..143630e 100755 --- a/devel/get_shortcuts_and_classes.py +++ b/devel/get_shortcuts_and_classes.py @@ -3,6 +3,20 @@ import ast import re import json +import argparse +import subprocess +import sys +import threading + +# Argument parser for command line options +parser = argparse.ArgumentParser(description="Analyze Python project for classes and keyboard shortcuts.") +parser.add_argument("-v", "--verbose", action="store_true", help="Display all messages") +args = parser.parse_args() + +def verbose_print(message): + """Prints messages only if verbose mode is enabled.""" + if args.verbose: + print(message) def find_keypress_functions_with_kbkeys(project_path): result = {} @@ -121,16 +135,16 @@ def find_class_inheritance(classes): cls["inherits_from"] = None def display_classes(classes): - print("\nClasses Found in Files:") + verbose_print("\nClasses Found in Files:") for entry in classes: - print(f"File: {os.path.basename(entry['file'])}, Class: {entry['class_name']}, " + verbose_print(f"File: {os.path.basename(entry['file'])}, Class: {entry['class_name']}, " f"Start Line: {entry['start_line']}, End Line: {entry['end_line']}, " f"Uses: {entry['uses']}, Inherits from: {entry['inherits_from']}") def display_results(results): - print("\n\nFound keypress functions with kbkey references:") + verbose_print("\n\nFound keypress functions with kbkey references:") for class_name, kbkeys in results.items(): - print(f"Class: {class_name}, kbkey References: {kbkeys}") + verbose_print(f"Class: {class_name}, kbkey References: {kbkeys}") def map_functional_relationships(results, classes): """Map functional relationships of classes with keypress shortcuts.""" @@ -180,24 +194,25 @@ def functional_structural_integration(results, classes): return integration_map def display_functional_relationships(map_data): - print("\nFunctional Relationships:") - for entry in map_data: - print(f"Class: {entry['class_name']}, Inherits From: {entry['inherits_from']}, " - f"Uses: {entry['uses']}, Keypress Shortcuts: {entry['kbkeys']}") + if args.verbose: + verbose_print("\nFunctional Relationships:") + for entry in map_data: + verbose_print(f"Class: {entry['class_name']}, Inherits From: {entry['inherits_from']}, " + f"Uses: {entry['uses']}, Keypress Shortcuts: {entry['kbkeys']}") def display_dependencies(map_data): - print("\nDependencies Analysis:") - for entry in map_data: - print(f"Class: {entry['class_name']}, Depends On: {entry['dependencies']}, " - f"Own Keypress Shortcuts: {entry['kbkeys']}") + if args.verbose: + verbose_print("\nDependencies Analysis:") + for entry in map_data: + verbose_print(f"Class: {entry['class_name']}, Depends On: {entry['dependencies']}, " + f"Own Keypress Shortcuts: {entry['kbkeys']}") def display_integration(integration_map): - print("\nFunctional-Structural Integration:") - for cls, data in integration_map.items(): - print(f"Class: {cls}, Keypress Shortcuts: {data['kbkeys']}, " - f"Related Classes: {data['related_classes']}") - - + if args.verbose: + verbose_print("\nFunctional-Structural Integration:") + for cls, data in integration_map.items(): + verbose_print(f"Class: {cls}, Keypress Shortcuts: {data['kbkeys']}, " + f"Related Classes: {data['related_classes']}") def extend_results_with_related_keys(results, classes): """Extend results by appending keys from used and inherited classes.""" @@ -225,16 +240,16 @@ def extend_results_with_related_keys(results, classes): return extended_results def display_extended_results(extended_results): - print("\nExtended Results with Related Keys:") - for class_name, keys in extended_results.items(): - print(f"Class: {class_name}, Keypress Shortcuts: {keys}") + if args.verbose: + verbose_print("\nExtended Results with Related Keys:") + for class_name, keys in extended_results.items(): + verbose_print(f"Class: {class_name}, Keypress Shortcuts: {keys}") def extract_global_functions_keys(file_path): """Extract keys from `_global_functions` in the specified Python file.""" global_functions_keys = [] inside_global_functions = False inside_local_functions = False - global_functions_keys = [] local_functions_keys = [] file_name = os.path.join(file_path, 'radio.py') @@ -325,17 +340,49 @@ def precompute_context_map(results): context_map[key].append(class_name) return context_map +def ask_and_execute(): + print("Do you want to execute './pyradio/keyboard.py'? (y/n, ENTER = 'y'): ", end='', flush=True) + + # Variable to store user's answer + user_answer = None + input_event = threading.Event() + + def get_user_input(): + nonlocal user_answer + user_answer = input().strip().lower() + input_event.set() # Signal that input was received + + # Start a thread to get the user input + input_thread = threading.Thread(target=get_user_input) + input_thread.daemon = True + input_thread.start() + + # Wait for input or timeout + if input_event.wait(timeout=5): # Wait up to 5 seconds for input + if user_answer == '' or user_answer == 'y': # Treat ENTER or 'y' as confirmation + try: + # Execute the script + subprocess.run(["python", "./pyradio/keyboard.py"], check=True) + except subprocess.CalledProcessError as e: + print(f"Error executing script: {e}") + except FileNotFoundError: + print("File './pyradio/keyboard.py' not found.") + else: + print("You entered 'n'. Exiting...") + else: + print("\nTimeout occurred. Exiting...") + if __name__ == "__main__": from sys import exit # Updated project path starting_dir = os.getcwd() - print(f'{starting_dir = }') + verbose_print(f'{starting_dir = }') project_path = os.path.join(starting_dir, 'pyradio') - print(f'{project_path = }') + verbose_print(f'{project_path = }') out_file = os.path.join(project_path, 'keyboard', 'classes.json') new_out_file = os.path.join(project_path, 'keyboard', 'keys.json') - print(f'{out_file = }') - print(f'{new_out_file = }') + verbose_print(f'{out_file = }') + verbose_print(f'{new_out_file = }') # Find and display keypress functions with kbkeys results = find_keypress_functions_with_kbkeys(project_path) @@ -346,9 +393,9 @@ def precompute_context_map(results): find_class_usages(classes) find_class_inheritance(classes) global_functions_keys, local_functions_keys = extract_global_functions_keys(project_path) - results['PyRadio'] += local_functions_keys + results['PyRadio'].extend(local_functions_keys) ''' - print(results) + verbose_print(results) for a_class in results: results[a_class] += global_functions_keys ''' @@ -378,13 +425,13 @@ def precompute_context_map(results): # Extract h_extra keys from keyboard.py h_extra_keys = extract_section_keys(project_path, 'h_extra') - print("\nExtracted h_extra keys:") + verbose_print("\nExtracted h_extra keys:") for key in sorted(h_extra_keys): - print(f" - {key}") + verbose_print(f" - {key}") # Remove h_extra keys from results remove_section_keys_from_results(results, h_extra_keys) - print("\nUpdated results after removing h_extra keys:") + verbose_print("\nUpdated results after removing h_extra keys:") display_results(results) # these three keys are added by code, they are not detected @@ -396,12 +443,8 @@ def precompute_context_map(results): # info_rename is a uniq key in the info window results['PyRadio'].pop(results['PyRadio'].index('info_rename')) results['InfoWindow'] = ['info_rename'] - - results['GlobalFunctions'] = global_functions_keys + ['t'] - results['ExtraKeys'] = list(h_extra_keys) - print("\n\nFinal results after removing h_extra keys:") - display_results(results) + ''' # remove global function keys for gl_key in global_functions_keys: for a_key in results: @@ -411,25 +454,34 @@ def precompute_context_map(results): break except ValueError: pass - + # results[a_key].extend(global_functions_keys) + ''' + for a_key in results: + results[a_key].extend(global_functions_keys) + results['ExtraKeys'] = list(h_extra_keys) + + verbose_print("\n\nFinal results after removing h_extra keys:") + display_results(results) + with open(out_file, 'w', encoding='utf-8') as f: json.dump(results, f) - precompute_map = precompute_context_map(results) with open(new_out_file, 'w', encoding='utf-8') as f: json.dump(precompute_map, f) - # print('\n\n{}'.format(global_functions_keys)) - - # print('\n\n{}'.format(h_extra_keys)) + + # verbose_print('\n\n{}'.format(global_functions_keys)) + # verbose_print('\n\n{}'.format(h_extra_keys)) print(''' - Files created: - classes.json - keys.json + - classes.json + - keys.json Execute - python keyboard.py + - python keyboard.py to check for missing shortcuts ''') + + ask_and_execute() + sys.exit() diff --git a/pyradio/config.py b/pyradio/config.py index e8597c0..2e5e7e3 100644 --- a/pyradio/config.py +++ b/pyradio/config.py @@ -1270,7 +1270,7 @@ def find_history_by_station_title(self, a_title): class PyRadioConfig(PyRadioStations): ''' PyRadio Config Class ''' - DO_NOT_PLAY_OPTS = None + EXTERNAL_PLAYER_OPTS = None ''' I will get this when a player is selected It will be used when command line parameters are evaluated diff --git a/pyradio/config_window.py b/pyradio/config_window.py index 107d0d8..b514474 100644 --- a/pyradio/config_window.py +++ b/pyradio/config_window.py @@ -110,7 +110,7 @@ class PyRadioConfigWindow(): _help_text.append(None) _help_text.append(['This options will open the configuration window for the RadioBrowser Online Stations Directory.',]) _help_text.append(None) - _help_text.append(['This options will open the configuration window for the Shortcuts Definitions.', '|', 'Currently not available.']) + _help_text.append(['This options will open the configuration window for the Shortcuts Definitions.', '|', 'Please keep in mind that if you customize the keyboard shortcuts, the documentation may no longer align with your personalized settings. While the in-program runtime help will always reflect your current key configurations, the static documentation will continue to display the default shortcuts.', '|', 'To ensure you have the best experience, refer to the runtime help for the most accurate information regarding your customized key bindings!']) _help_text.append(['This options will open the configuration window for the Alternative Shortcuts Definitions.', '|', 'Currently not available.']) _config_options = None @@ -3514,7 +3514,7 @@ def _update_focus(self): else: self._b_ok.focused = False self._b_cancel.focused = True - self._widget.show() + self._needs_update = True def _focus_next(self): if not self._editing: @@ -3694,7 +3694,10 @@ def _go_to_line(self, a_line): self._needs_update = True def _select_line(self, a_line): - self._win.chgat(a_line, 2, self.maxX-4, curses.color_pair(6)) + if self._focus == 0: + self._win.chgat(a_line, 2, self.maxX-4, curses.color_pair(6)) + # else: + # self._unselect_line(a_line) def _unselect_line(self, a_line): self._win.chgat(a_line, 2, self._max_length-1, curses.color_pair(5)) @@ -3790,23 +3793,7 @@ def _get_after_header(self, next=True): self._selection = self._start + 1 - def _calculate_conflicts(self, the_headers, the_item, index, the_exceptions=None): - self.existing_conflict = None - for a_header in the_headers: - for group_item in conflicts[a_header]: - if group_item != the_item[0]: - logger.error(f'conflict item: {group_item}') - - chk = [x for x in self._list if x[0] == group_item][0] - existing_value = chk[3] - logger.error(f'{existing_value = }') - # TODO: exceptions...? - if existing_value == the_item[3]: - self.existing_conflict = ((index, chk[-3])) - logger.error('CONFLICT!!!') - break - - def detect_conflict(self, modified_item): + def _detect_conflict(self, modified_item): """ Detect a conflict for a modified shortcut in the context of precomputed data. @@ -3815,20 +3802,26 @@ def detect_conflict(self, modified_item): Format example: ['reload', 114, 114, 117, 'r', 'r', 'u', 2, 1, 'Reload'] Returns: - tuple or None: + tuple or None (in self.existing_conflict): - (modified_item[-3], idx): Tuple containing the key of the modified item and the index of the conflicting item in `self._list`, if a conflict exists. - None: If no conflict exists. """ + # reset self.existing_conflict ; None means no conflict + self.existing_conflict = None + # Extract key and the new shortcut code from the modified item key = modified_item[0] # Identifier for the shortcut (e.g., "reload", "mute") new_shortcut_code = modified_item[3] # The new shortcut code provided by the user + logger.error('\n\n-*-*-*-*-*-*-*-*-') logger.error(f'{key = }') + logger.error(f'{new_shortcut_code = }') # Step 1: Retrieve contexts for the current key if key not in self._keys_to_classes: - return None # No relevant context; no conflict is possible + logger.error('\n-*-*-*-*-*-*-*-*- None 1\n\n') + return # Collect all relevant keys for this key's contexts context_classes = self._keys_to_classes[key] # List of class names where this key is used @@ -3839,61 +3832,33 @@ def detect_conflict(self, modified_item): if context_class in self._keys_to_classes[key_in_context]: context_keys.add(key_in_context) - if key not in self._classes['ExtraKeys']: - context_keys = context_keys.union(set(self._classes['GlobalFunctions'])) logger.error(f'{context_keys = }') + tmp = [x for x in self._list if x[0] in context_keys] + + logger.error('\n\ntmp\n{}'.format(tmp)) + # Step 2: Detect conflict within the resolved context keys for key_in_context in context_keys: # Iterate through all relevant keys in the context + logger.error(f'checking "{key_in_context}"') # Skip checking against the key being modified if key_in_context == key: continue + idx, chk = [(i, x) for i, x in enumerate(self._list) if x[0] == key_in_context][0] + logger.error('\n\nitem with key - {0}: {1}\n\n'.format(idx, chk)) # Check if the new shortcut code matches the existing shortcut code for any other key - if kbkey[key_in_context] == new_shortcut_code: - # Conflict detected: Find the conflicting item's index in `self._list` - for idx, item in enumerate(self._list): - if item[0] == key_in_context: - return modified_item[-3], idx # Return the first conflicting key and index + if chk[3] == new_shortcut_code: + self.existing_conflict = (modified_item[-3], idx) # Return the first conflicting key and index + return - # No conflict found - return None + logger.error('\n-*-*-*-*-*-*-*-*- None 2\n\n') + # No conflict found + # self.existing_conflict = None def _validate_key(self): - the_item = self._list[self._selection] - # the_header = self._list[the_item[-2]] - # first_in_group = the_header[-2] + 1 - # logger.error(f'{the_item = }') - # logger.error(f'{the_header = }') - # logger.error(f'{first_in_group = }') - # the_list = [(the_item[-3], the_item[0], the_item[3])] - # logger.error(f'{the_list = }') - # active_headers = [] - # logger.error('\n\nthe_item[0] = {}\n\n'.format(the_item[0])) - # logger.error('\n\nself._global_functions = {}\n\n'.format(self._global_functions)) - # if the_item[0] in self._global_functions: - # the_global_key = None - # for n in self._global_functions: - # if the_item[3] == kbkey[n]: - # the_global_key = n - # break - # if the_global_key is not None: - # logger.error('global function conflict!!!') - # else: - # for n in self._headers: - # logger.error(f'header: {n}') - # active_headers.append(self._list[n][0]) - # if the_header[0] == 'h_rb_s': - # logger.error('In h_rb_s') - # active_headers = ('h_rb_s', ) - # elif the_header[0] == 'h_this': - # active_headers = ('h_this', 'h_movement', 'h_volune') - # include_keys = ('q', ) - # logger.error(f'{active_headers = }') - # self._calculate_conflicts(active_headers, the_item, the_item[-3]) - # logger.error(f'{self.existing_conflict = }') - self.existing_conflict = self.detect_conflict(the_item) + self._detect_conflict(self._list[self._selection]) if self.existing_conflict: return -3 return 1 @@ -3976,11 +3941,11 @@ def keypress(self, char): elif self._editing: if is_invalid_key(char): self.message = 'M_INVALID_KEY_ERROR' - logger.error('Key is INVALID') + logger.error('1 Key is INVALID') return 2 if not is_valid_char(char, self._win): self.message = 'M_INVALID_TYPE_KEY_ERROR' - logger.error('Key is INVALID') + logger.error('2 Key is INVALID') return 2 if char in (curses.KEY_EXIT, 27): self._stop_editing() diff --git a/pyradio/keyboard.py b/pyradio/keyboard.py index d2d7231..fd3a470 100644 --- a/pyradio/keyboard.py +++ b/pyradio/keyboard.py @@ -436,7 +436,6 @@ def is_valid_char(char, win): Returns: bool: True if c is valid, False otherwise. """ - # if char <= 127: if (65 <= char <= 90) or (97 <= char <= 122) or (1 <= char <= 47): ''' 1 byte ''' @@ -454,6 +453,21 @@ def is_valid_char(char, win): win.getch() win.getch() win.getch() + elif char in ( + ord('='), ord('.'), ord('+'), + ord('`'), ord('-'), + curses.KEY_F1, + curses.KEY_F2, + curses.KEY_F3, + curses.KEY_F4, + curses.KEY_F5, + curses.KEY_F6, + curses.KEY_F7, + curses.KEY_F8, + curses.KEY_F9, + curses.KEY_F10, + ): + return True return False def is_invalid_key(key): @@ -481,6 +495,20 @@ def is_invalid_key(key): curses.KEY_BACKSPACE, # Add more keys as necessary ] + if key in ( + curses.KEY_F1, + curses.KEY_F2, + curses.KEY_F3, + curses.KEY_F4, + curses.KEY_F5, + curses.KEY_F6, + curses.KEY_F7, + curses.KEY_F8, + curses.KEY_F9, + curses.KEY_F10, + ): + logger.error('Key is F-[1-10]') + return False # Check if the key is in the list of special keys or is greater than 255 return key in special_keys or key > 255 diff --git a/pyradio/keyboard/classes.json b/pyradio/keyboard/classes.json index ca05b90..abdd89c 100644 --- a/pyradio/keyboard/classes.json +++ b/pyradio/keyboard/classes.json @@ -1 +1 @@ -{"SimpleCursesString": ["pause", "l"], "SimpleCursesDate": ["?", "stab", "t", "h", "q", "tab", "l"], "SimpleCursesTime": ["?", "stab", "t", "h", "pause", "q", "tab", "l"], "SimpleCursesCounter": ["?", "q", "h", "l"], "SimpleCursesWidgetColumns": ["?", "g", "G", "h", "k", "j", "pause", "q", "l"], "SimpleCursesMenu": ["?", "screen_middle", "goto_playing", "g", "G", "add", "h", "k", "j", "edit", "pause", "del", "q", "l"], "SimpleCursesCheckBox": ["pause"], "SimpleCursesPushButton": ["pause"], "SimpleCursesLineEdit": ["?", "stab", "paste", "tab"], "SimpleCursesBoolean": ["?", "h", "pause", "q", "l"], "SelectPlayer": ["h", "k", "j", "pause", "s", "q", "l"], "PyRadio": ["open_playlist", "search_next", "st_up", "no_show", "open_regs", "add_to_reg", "screen_top", "j", "Y", "append", "https", "q", "gr_prev", "gr", "F7", "screen_middle", "screen_bottom", "rb_vote", "n", "search", "G", "open_enc", "random", "F8", "h", "st_dn", "info", "rec", "Reload", "y", "s", "revert_saved", "F9", "F10", "open_extra", "paste", "open_config", "fav", "l", "t", "k", "revert_def", "pause", "gr_next", "rb_info", "rb_sort", "del", "reload", "?", "goto_playing", "ext_player", "jump", "g", "search_prev", "add", "open_online", "rb_server", "edit", "extra_p_pamars", "hist_prev", "hist_next", "p_prev", "p_next", "rb_p_first", "rb_p_next", "rb_p_prev"], "PyRadioThemeSelector": ["g", "G", "add", "h", "k", "watch_theme", "j", "edit", "pause", "s", "q", "reload", "l"], "RadioBrowserConfigWindow": ["?", "stab", "k", "revert_def", "j", "pause", "s", "q", "tab", "l"], "RadioBrowserSearchWindow": ["rb_h_add", "rb_h_0", "rb_h_prev", "j", "rb_h_def", "q", "tab", "l", "G", "h", "s", "stab", "rb_h_next", "k", "pause", "?", "g", "rb_h_save", "rb_h_del"], "RadioBrowserSort": ["g", "G", "h", "k", "j", "pause", "q", "l"], "RadioBrowserServersSelect": ["q"], "RadioBrowserServers": ["?", "g", "G", "h", "k", "j", "pause", "q", "l"], "RadioBrowserTermNavigator": ["?", "next", "g", "G", "prev", "h", "pause", "del", "q", "l"], "PyRadioMessagesSystem": ["k", "j", "g", "G"], "PyRadioSimpleScheduleWindow": ["?", "stab", "h", "k", "info", "j", "pause", "q", "tab", "l"], "PyRadioConfigWindow": ["pause", "h", "l"], "ExtraParametersEditor": ["?", "stab", "s", "q", "tab"], "ExtraParameters": ["?", "h", "pause", "s", "q", "l"], "PyRadioSelectPlayer": ["h", "k", "revert_saved", "j", "pause", "s", "q", "tab", "l"], "PyRadioSelectEncodings": ["g", "G", "q", "h", "k", "j", "revert_def", "pause", "s", "revert_saved", "l"], "PyRadioSelectPlaylist": ["screen_middle", "g", "G", "q", "h", "k", "j", "pause", "revert_saved", "l"], "PyRadioSelectStation": ["revert_saved"], "PyRadioKeyboardConfig": ["?", "g", "G", "stab", "h", "k", "j", "pause", "q", "tab", "l"], "PyRadioEditor": ["stab", "q", "s", "revert_saved", "tab"], "PyRadioRecordingDir": ["?", "stab", "pause", "s", "q", "tab", "l"], "PyRadioResourceOpener": ["?", "stab", "revert_def", "s", "q", "tab"], "PyRadioRenameFile": ["stab", "pause", "s", "q", "tab", "l"], "PyRadioBuffering": ["no_buffer", "h", "k", "revert_saved", "j", "s", "q"], "PyRadioConnectionType": ["h", "k", "j", "pause", "s", "q", "l"], "PyRadioServerWindow": ["h", "k", "revert_def", "j", "pause", "s", "revert_saved", "l"], "InfoWindow": ["info_rename"], "GlobalFunctions": ["transp", "repaint", "t"], "ExtraKeys": ["clear_all_reg", "html_help", "open_remote_control", "unnamed", "clear_reg", "new_playlist", "buffer", "hist_top", "change_player", "open_buffer", "last_playlist", "rename_playlist", "open_dirs"]} \ No newline at end of file +{"SimpleCursesString": ["pause", "l", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "SimpleCursesDate": ["t", "q", "tab", "l", "?", "stab", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "SimpleCursesTime": ["t", "q", "tab", "l", "pause", "?", "stab", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "SimpleCursesCounter": ["q", "l", "?", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "SimpleCursesWidgetColumns": ["g", "q", "j", "l", "k", "pause", "G", "?", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "SimpleCursesMenu": ["edit", "g", "goto_playing", "q", "add", "j", "l", "k", "pause", "G", "?", "del", "screen_middle", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "SimpleCursesCheckBox": ["pause", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "SimpleCursesPushButton": ["pause", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "SimpleCursesLineEdit": ["tab", "paste", "?", "stab", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "SimpleCursesBoolean": ["q", "l", "pause", "?", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "SelectPlayer": ["q", "j", "l", "k", "s", "pause", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadio": ["F8", "https", "repaint", "g", "rb_vote", "open_enc", "extra_p_pamars", "G", "F9", "F7", "open_online", "jump", "gr_prev", "search", "random", "revert_def", "edit", "open_extra", "add_to_reg", "t", "q", "add", "rec", "search_next", "open_config", "s", "pause", "rb_sort", "transp", "search_prev", "ext_player", "append", "screen_top", "Y", "info", "goto_playing", "gr", "st_dn", "no_show", "paste", "n", "revert_saved", "gr_next", "F10", "st_up", "Reload", "fav", "rb_info", "reload", "j", "y", "k", "rb_server", "l", "?", "screen_bottom", "screen_middle", "del", "open_playlist", "open_regs", "h", "hist_prev", "hist_next", "p_prev", "p_next", "rb_p_first", "rb_p_next", "rb_p_prev", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioThemeSelector": ["edit", "g", "add", "reload", "j", "l", "k", "q", "s", "pause", "G", "watch_theme", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "RadioBrowserConfigWindow": ["revert_def", "q", "tab", "j", "l", "k", "s", "pause", "?", "stab", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "RadioBrowserSearchWindow": ["g", "tab", "G", "rb_h_add", "stab", "rb_h_next", "q", "s", "pause", "rb_h_def", "rb_h_save", "rb_h_0", "j", "l", "k", "?", "rb_h_prev", "h", "rb_h_del", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "RadioBrowserSort": ["g", "q", "j", "l", "k", "pause", "G", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "RadioBrowserServersSelect": ["q", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "RadioBrowserServers": ["g", "q", "j", "l", "k", "pause", "G", "?", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "RadioBrowserTermNavigator": ["g", "next", "q", "l", "prev", "pause", "G", "?", "del", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioMessagesSystem": ["G", "j", "k", "g", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioSimpleScheduleWindow": ["info", "q", "tab", "j", "l", "k", "pause", "?", "stab", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioConfigWindow": ["pause", "l", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "ExtraParametersEditor": ["q", "tab", "s", "?", "stab", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "ExtraParameters": ["q", "l", "s", "pause", "?", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioSelectPlayer": ["tab", "q", "j", "l", "k", "s", "pause", "revert_saved", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioSelectEncodings": ["revert_def", "g", "q", "j", "l", "k", "s", "G", "pause", "revert_saved", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioSelectPlaylist": ["g", "q", "j", "l", "k", "pause", "G", "screen_middle", "revert_saved", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioSelectStation": ["revert_saved", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioKeyboardConfig": ["g", "q", "tab", "j", "l", "k", "G", "pause", "?", "stab", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioEditor": ["q", "tab", "s", "stab", "revert_saved", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioRecordingDir": ["q", "tab", "l", "s", "pause", "?", "stab", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioResourceOpener": ["revert_def", "q", "tab", "s", "?", "stab", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioRenameFile": ["q", "tab", "l", "s", "pause", "stab", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioBuffering": ["no_buffer", "q", "j", "k", "s", "revert_saved", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioConnectionType": ["q", "j", "l", "k", "s", "pause", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "PyRadioServerWindow": ["revert_def", "j", "l", "k", "s", "pause", "revert_saved", "h", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "InfoWindow": ["info_rename", "tag", "t_tag", "transp", "v_up1", "v_up2", "v_up3", "v_dn1", "v_dn2", "mute", "s_vol", "t_calc_col", "repaint"], "ExtraKeys": ["last_playlist", "open_buffer", "clear_all_reg", "clear_reg", "buffer", "open_dirs", "open_remote_control", "new_playlist", "hist_top", "unnamed", "html_help", "rename_playlist", "change_player"]} \ No newline at end of file diff --git a/pyradio/keyboard/keys.json b/pyradio/keyboard/keys.json index 777804c..351f172 100644 --- a/pyradio/keyboard/keys.json +++ b/pyradio/keyboard/keys.json @@ -1 +1 @@ -{"pause": ["SimpleCursesString", "SimpleCursesTime", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig", "PyRadioRecordingDir", "PyRadioRenameFile", "PyRadioConnectionType", "PyRadioServerWindow"], "l": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig", "PyRadioRecordingDir", "PyRadioRenameFile", "PyRadioConnectionType", "PyRadioServerWindow"], "?": ["SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesLineEdit", "SimpleCursesBoolean", "PyRadio", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioSimpleScheduleWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioKeyboardConfig", "PyRadioRecordingDir", "PyRadioResourceOpener"], "stab": ["SimpleCursesDate", "SimpleCursesTime", "SimpleCursesLineEdit", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "PyRadioSimpleScheduleWindow", "ExtraParametersEditor", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile"], "t": ["SimpleCursesDate", "SimpleCursesTime", "PyRadio", "GlobalFunctions"], "h": ["SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow"], "q": ["SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioSimpleScheduleWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType"], "tab": ["SimpleCursesDate", "SimpleCursesTime", "SimpleCursesLineEdit", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "PyRadioSimpleScheduleWindow", "ExtraParametersEditor", "PyRadioSelectPlayer", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile"], "g": ["SimpleCursesWidgetColumns", "SimpleCursesMenu", "PyRadio", "PyRadioThemeSelector", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig"], "G": ["SimpleCursesWidgetColumns", "SimpleCursesMenu", "PyRadio", "PyRadioThemeSelector", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig"], "k": ["SimpleCursesWidgetColumns", "SimpleCursesMenu", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow"], "j": ["SimpleCursesWidgetColumns", "SimpleCursesMenu", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow"], "screen_middle": ["SimpleCursesMenu", "PyRadio", "PyRadioSelectPlaylist"], "goto_playing": ["SimpleCursesMenu", "PyRadio"], "add": ["SimpleCursesMenu", "PyRadio", "PyRadioThemeSelector"], "edit": ["SimpleCursesMenu", "PyRadio", "PyRadioThemeSelector"], "del": ["SimpleCursesMenu", "PyRadio", "RadioBrowserTermNavigator"], "paste": ["SimpleCursesLineEdit", "PyRadio"], "s": ["SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow"], "open_playlist": ["PyRadio"], "search_next": ["PyRadio"], "st_up": ["PyRadio"], "no_show": ["PyRadio"], "open_regs": ["PyRadio"], "add_to_reg": ["PyRadio"], "screen_top": ["PyRadio"], "Y": ["PyRadio"], "append": ["PyRadio"], "https": ["PyRadio"], "gr_prev": ["PyRadio"], "gr": ["PyRadio"], "F7": ["PyRadio"], "screen_bottom": ["PyRadio"], "rb_vote": ["PyRadio"], "n": ["PyRadio"], "search": ["PyRadio"], "open_enc": ["PyRadio"], "random": ["PyRadio"], "F8": ["PyRadio"], "st_dn": ["PyRadio"], "info": ["PyRadio", "PyRadioSimpleScheduleWindow"], "rec": ["PyRadio"], "Reload": ["PyRadio"], "y": ["PyRadio"], "revert_saved": ["PyRadio", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioEditor", "PyRadioBuffering", "PyRadioServerWindow"], "F9": ["PyRadio"], "F10": ["PyRadio"], "open_extra": ["PyRadio"], "open_config": ["PyRadio"], "fav": ["PyRadio"], "revert_def": ["PyRadio", "RadioBrowserConfigWindow", "PyRadioSelectEncodings", "PyRadioResourceOpener", "PyRadioServerWindow"], "gr_next": ["PyRadio"], "rb_info": ["PyRadio"], "rb_sort": ["PyRadio"], "reload": ["PyRadio", "PyRadioThemeSelector"], "ext_player": ["PyRadio"], "jump": ["PyRadio"], "search_prev": ["PyRadio"], "open_online": ["PyRadio"], "rb_server": ["PyRadio"], "extra_p_pamars": ["PyRadio"], "hist_prev": ["PyRadio"], "hist_next": ["PyRadio"], "p_prev": ["PyRadio"], "p_next": ["PyRadio"], "rb_p_first": ["PyRadio"], "rb_p_next": ["PyRadio"], "rb_p_prev": ["PyRadio"], "watch_theme": ["PyRadioThemeSelector"], "rb_h_add": ["RadioBrowserSearchWindow"], "rb_h_0": ["RadioBrowserSearchWindow"], "rb_h_prev": ["RadioBrowserSearchWindow"], "rb_h_def": ["RadioBrowserSearchWindow"], "rb_h_next": ["RadioBrowserSearchWindow"], "rb_h_save": ["RadioBrowserSearchWindow"], "rb_h_del": ["RadioBrowserSearchWindow"], "next": ["RadioBrowserTermNavigator"], "prev": ["RadioBrowserTermNavigator"], "no_buffer": ["PyRadioBuffering"], "info_rename": ["InfoWindow"], "transp": ["GlobalFunctions"], "repaint": ["GlobalFunctions"], "clear_all_reg": ["ExtraKeys"], "html_help": ["ExtraKeys"], "open_remote_control": ["ExtraKeys"], "unnamed": ["ExtraKeys"], "clear_reg": ["ExtraKeys"], "new_playlist": ["ExtraKeys"], "buffer": ["ExtraKeys"], "hist_top": ["ExtraKeys"], "change_player": ["ExtraKeys"], "open_buffer": ["ExtraKeys"], "last_playlist": ["ExtraKeys"], "rename_playlist": ["ExtraKeys"], "open_dirs": ["ExtraKeys"]} \ No newline at end of file +{"pause": ["SimpleCursesString", "SimpleCursesTime", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig", "PyRadioRecordingDir", "PyRadioRenameFile", "PyRadioConnectionType", "PyRadioServerWindow"], "l": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig", "PyRadioRecordingDir", "PyRadioRenameFile", "PyRadioConnectionType", "PyRadioServerWindow"], "tag": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesLineEdit", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow", "InfoWindow"], "t_tag": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesLineEdit", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow", "InfoWindow"], "transp": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesLineEdit", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow", "InfoWindow"], "v_up1": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesLineEdit", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow", "InfoWindow"], "v_up2": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesLineEdit", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow", "InfoWindow"], "v_up3": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesLineEdit", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow", "InfoWindow"], "v_dn1": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesLineEdit", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow", "InfoWindow"], "v_dn2": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesLineEdit", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow", "InfoWindow"], "mute": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesLineEdit", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow", "InfoWindow"], "s_vol": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesLineEdit", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow", "InfoWindow"], "t_calc_col": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesLineEdit", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow", "InfoWindow"], "repaint": ["SimpleCursesString", "SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesCheckBox", "SimpleCursesPushButton", "SimpleCursesLineEdit", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow", "InfoWindow"], "t": ["SimpleCursesDate", "SimpleCursesTime", "PyRadio"], "q": ["SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServersSelect", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioSimpleScheduleWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType"], "tab": ["SimpleCursesDate", "SimpleCursesTime", "SimpleCursesLineEdit", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "PyRadioSimpleScheduleWindow", "ExtraParametersEditor", "PyRadioSelectPlayer", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile"], "?": ["SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesLineEdit", "SimpleCursesBoolean", "PyRadio", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioSimpleScheduleWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioKeyboardConfig", "PyRadioRecordingDir", "PyRadioResourceOpener"], "stab": ["SimpleCursesDate", "SimpleCursesTime", "SimpleCursesLineEdit", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "PyRadioSimpleScheduleWindow", "ExtraParametersEditor", "PyRadioKeyboardConfig", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile"], "h": ["SimpleCursesDate", "SimpleCursesTime", "SimpleCursesCounter", "SimpleCursesWidgetColumns", "SimpleCursesMenu", "SimpleCursesBoolean", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioSimpleScheduleWindow", "PyRadioConfigWindow", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow"], "g": ["SimpleCursesWidgetColumns", "SimpleCursesMenu", "PyRadio", "PyRadioThemeSelector", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig"], "j": ["SimpleCursesWidgetColumns", "SimpleCursesMenu", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow"], "k": ["SimpleCursesWidgetColumns", "SimpleCursesMenu", "SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "PyRadioMessagesSystem", "PyRadioSimpleScheduleWindow", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow"], "G": ["SimpleCursesWidgetColumns", "SimpleCursesMenu", "PyRadio", "PyRadioThemeSelector", "RadioBrowserSearchWindow", "RadioBrowserSort", "RadioBrowserServers", "RadioBrowserTermNavigator", "PyRadioMessagesSystem", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioKeyboardConfig"], "edit": ["SimpleCursesMenu", "PyRadio", "PyRadioThemeSelector"], "goto_playing": ["SimpleCursesMenu", "PyRadio"], "add": ["SimpleCursesMenu", "PyRadio", "PyRadioThemeSelector"], "del": ["SimpleCursesMenu", "PyRadio", "RadioBrowserTermNavigator"], "screen_middle": ["SimpleCursesMenu", "PyRadio", "PyRadioSelectPlaylist"], "paste": ["SimpleCursesLineEdit", "PyRadio"], "s": ["SelectPlayer", "PyRadio", "PyRadioThemeSelector", "RadioBrowserConfigWindow", "RadioBrowserSearchWindow", "ExtraParametersEditor", "ExtraParameters", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioEditor", "PyRadioRecordingDir", "PyRadioResourceOpener", "PyRadioRenameFile", "PyRadioBuffering", "PyRadioConnectionType", "PyRadioServerWindow"], "F8": ["PyRadio"], "https": ["PyRadio"], "rb_vote": ["PyRadio"], "open_enc": ["PyRadio"], "extra_p_pamars": ["PyRadio"], "F9": ["PyRadio"], "F7": ["PyRadio"], "open_online": ["PyRadio"], "jump": ["PyRadio"], "gr_prev": ["PyRadio"], "search": ["PyRadio"], "random": ["PyRadio"], "revert_def": ["PyRadio", "RadioBrowserConfigWindow", "PyRadioSelectEncodings", "PyRadioResourceOpener", "PyRadioServerWindow"], "open_extra": ["PyRadio"], "add_to_reg": ["PyRadio"], "rec": ["PyRadio"], "search_next": ["PyRadio"], "open_config": ["PyRadio"], "rb_sort": ["PyRadio"], "search_prev": ["PyRadio"], "ext_player": ["PyRadio"], "append": ["PyRadio"], "screen_top": ["PyRadio"], "Y": ["PyRadio"], "info": ["PyRadio", "PyRadioSimpleScheduleWindow"], "gr": ["PyRadio"], "st_dn": ["PyRadio"], "no_show": ["PyRadio"], "n": ["PyRadio"], "revert_saved": ["PyRadio", "PyRadioSelectPlayer", "PyRadioSelectEncodings", "PyRadioSelectPlaylist", "PyRadioSelectStation", "PyRadioEditor", "PyRadioBuffering", "PyRadioServerWindow"], "gr_next": ["PyRadio"], "F10": ["PyRadio"], "st_up": ["PyRadio"], "Reload": ["PyRadio"], "fav": ["PyRadio"], "rb_info": ["PyRadio"], "reload": ["PyRadio", "PyRadioThemeSelector"], "y": ["PyRadio"], "rb_server": ["PyRadio"], "screen_bottom": ["PyRadio"], "open_playlist": ["PyRadio"], "open_regs": ["PyRadio"], "hist_prev": ["PyRadio"], "hist_next": ["PyRadio"], "p_prev": ["PyRadio"], "p_next": ["PyRadio"], "rb_p_first": ["PyRadio"], "rb_p_next": ["PyRadio"], "rb_p_prev": ["PyRadio"], "watch_theme": ["PyRadioThemeSelector"], "rb_h_add": ["RadioBrowserSearchWindow"], "rb_h_next": ["RadioBrowserSearchWindow"], "rb_h_def": ["RadioBrowserSearchWindow"], "rb_h_save": ["RadioBrowserSearchWindow"], "rb_h_0": ["RadioBrowserSearchWindow"], "rb_h_prev": ["RadioBrowserSearchWindow"], "rb_h_del": ["RadioBrowserSearchWindow"], "next": ["RadioBrowserTermNavigator"], "prev": ["RadioBrowserTermNavigator"], "no_buffer": ["PyRadioBuffering"], "info_rename": ["InfoWindow"], "last_playlist": ["ExtraKeys"], "open_buffer": ["ExtraKeys"], "clear_all_reg": ["ExtraKeys"], "clear_reg": ["ExtraKeys"], "buffer": ["ExtraKeys"], "open_dirs": ["ExtraKeys"], "open_remote_control": ["ExtraKeys"], "new_playlist": ["ExtraKeys"], "hist_top": ["ExtraKeys"], "unnamed": ["ExtraKeys"], "html_help": ["ExtraKeys"], "rename_playlist": ["ExtraKeys"], "change_player": ["ExtraKeys"]} \ No newline at end of file diff --git a/pyradio/main.py b/pyradio/main.py index f6659bb..84cd368 100644 --- a/pyradio/main.py +++ b/pyradio/main.py @@ -957,14 +957,14 @@ def shell(): ''' curses is off ''' if pyradio.setup_return_status: - if pyradio_config.DO_NOT_PLAY_OPTS is not None: - # print(pyradio_config.DO_NOT_PLAY_OPTS) + if pyradio_config.EXTERNAL_PLAYER_OPTS is not None: + # print(pyradio_config.EXTERNAL_PLAYER_OPTS) pyradio_config.remove_session_lock_file() import subprocess print('\n[bold red]Launching external player[/bold red]') - print('Station: "[cyan]{}[/cyan]"'.format(pyradio_config.DO_NOT_PLAY_OPTS[0])) - print('Command: "[yellow]{}[/yellow]"'.format(' '.join(pyradio_config.DO_NOT_PLAY_OPTS[1:]))) - process = subprocess.Popen(pyradio_config.DO_NOT_PLAY_OPTS[1:], stdout=None, stderr=None) + print('Station: "[cyan]{}[/cyan]"'.format(pyradio_config.EXTERNAL_PLAYER_OPTS[0])) + print('Command: "[yellow]{}[/yellow]"'.format(' '.join(pyradio_config.EXTERNAL_PLAYER_OPTS[1:]))) + process = subprocess.Popen(pyradio_config.EXTERNAL_PLAYER_OPTS[1:], stdout=None, stderr=None) process.wait() return diff --git a/pyradio/player.py b/pyradio/player.py index c2aff2f..5efb47b 100644 --- a/pyradio/player.py +++ b/pyradio/player.py @@ -326,7 +326,7 @@ class Player(): currently_recording = False - DO_NOT_PLAY = False + USE_EXTERNAL_PLAYER = False def __init__(self, config, @@ -2020,7 +2020,7 @@ def play(self, except: pass - if self.DO_NOT_PLAY: + if self.USE_EXTERNAL_PLAYER: ''' do not start the player, just return opts ''' return opts @@ -2507,7 +2507,7 @@ def _buildStartOpts(self, streamName, streamUrl, playList=False): ''' Test for newer MPV versions as it supports different IPC flags. ''' p = subprocess.Popen([self.PLAYER_CMD, '--no-video', '--input-ipc-server=' + self.mpvsocket], stdout=subprocess.PIPE, stdin=subprocess.PIPE, shell=False) - if self.DO_NOT_PLAY: + if self.USE_EXTERNAL_PLAYER: self.recording = self.NO_RECORDING out = p.communicate() if 'not found' not in str(out[0]): @@ -2519,7 +2519,7 @@ def _buildStartOpts(self, streamName, streamUrl, playList=False): logger.debug('--input-ipc-server is not supported.') newerMpv = False logger.error('\n\nself._cnf.user_agent_string = {}\n\n'.format(self._cnf.user_agent_string)) - if self.DO_NOT_PLAY: + if self.USE_EXTERNAL_PLAYER: opts = [self.PLAYER_CMD, '--no-video'] else: opts = [self.PLAYER_CMD, '--no-video', '--quiet'] @@ -2570,24 +2570,24 @@ def _buildStartOpts(self, streamName, streamUrl, playList=False): if playList: if newerMpv: - if not self.DO_NOT_PLAY: + if not self.USE_EXTERNAL_PLAYER: opts.append('--input-ipc-server=' + self.mpvsocket) opts.append('--playlist=' + self._url_to_use(streamUrl)) else: - if not self.DO_NOT_PLAY: + if not self.USE_EXTERNAL_PLAYER: opts.append('--input-unix-socket=' + self.mpvsocket) opts.append('--playlist=' + self._url_to_use(streamUrl)) else: if newerMpv: - if not self.DO_NOT_PLAY: + if not self.USE_EXTERNAL_PLAYER: opts.append('--input-ipc-server=' + self.mpvsocket) opts.append(self._url_to_use(streamUrl)) else: - if not self.DO_NOT_PLAY: + if not self.USE_EXTERNAL_PLAYER: opts.append('--input-unix-socket=' + self.mpvsocket) opts.append(self._url_to_use(streamUrl)) - # if self.DO_NOT_PLAY: + # if self.USE_EXTERNAL_PLAYER: # # opts.append('--msg-color=yes') # opts.append('--msg-color=no') # opts.append('--msg-level=all=trace,lavf=no,ao/pipewire=no') @@ -3002,7 +3002,7 @@ def save_volume(self): def _buildStartOpts(self, streamName, streamUrl, playList=False): ''' Builds the options to pass to mplayer subprocess.''' - if self.DO_NOT_PLAY: + if self.USE_EXTERNAL_PLAYER: self.recording = self.NO_RECORDING opts = [self.PLAYER_CMD, '-vo', 'null', '-msglevel', 'all=6'] if self._cnf.buffering_data: @@ -3353,7 +3353,7 @@ def _buildStartOpts(self, streamName, streamUrl, playList=False): #opts = [self.PLAYER_CMD, "-Irc", "--quiet", streamUrl] monitor_opts = None self._vlc_url = self._url_to_use(streamUrl) - if self.DO_NOT_PLAY: + if self.USE_EXTERNAL_PLAYER: self.recording = self.NO_RECORDING if self.WIN: ''' Get a random port (44000-44999) @@ -3379,7 +3379,7 @@ def _buildStartOpts(self, streamName, streamUrl, playList=False): if ok_to_go_on: break - if self.DO_NOT_PLAY: + if self.USE_EXTERNAL_PLAYER: opts = [self.PLAYER_CMD, '--no-video', '--no-one-instance', '-Irc', self._url_to_use(streamUrl)] else: @@ -3401,7 +3401,7 @@ def _buildStartOpts(self, streamName, streamUrl, playList=False): else: opts = [self.PLAYER_CMD, '--no-video', '--no-one-instance', '--no-volume-save', '-Irc', '-vv'] - if self.DO_NOT_PLAY: + if self.USE_EXTERNAL_PLAYER: opts.pop(opts.index('-vv')) else: if self.WIN: @@ -3457,7 +3457,7 @@ def _buildStartOpts(self, streamName, streamUrl, playList=False): with self.buffering_lock: self.buffering_change_function() - if self.DO_NOT_PLAY: + if self.USE_EXTERNAL_PLAYER: opts.append(streamUrl) return opts, monitor_opts diff --git a/pyradio/radio.py b/pyradio/radio.py index b6ad98b..9fa8b0a 100644 --- a/pyradio/radio.py +++ b/pyradio/radio.py @@ -6202,7 +6202,10 @@ def keypress(self, char): Please insert a different shortcut! -'''.format(conflict_second_item[-4], conflict_first_header_title, conflict_first_title, sec) +'''.format( + 'Space' if conflict_second_item[-4] == ' ' else conflict_second_item[-4], + conflict_first_header_title, + conflict_first_title, sec) self._messaging_win.set_a_message( 'UNIVERSAL', ( @@ -8748,9 +8751,9 @@ def keypress(self, char): if self.ws.operation_mode == self.ws.NORMAL_MODE: if char == kbkey['ext_player']: - self.player.DO_NOT_PLAY = True + self.player.USE_EXTERNAL_PLAYER = True stream_url = self.stations[self.selection][1] - self._cnf.DO_NOT_PLAY_OPTS = self.player.play(name='', + self._cnf.EXTERNAL_PLAYER_OPTS = self.player.play(name='', streamUrl=stream_url, stop_player=None, detect_if_player_exited=None, @@ -8758,8 +8761,8 @@ def keypress(self, char): encoding='utf-8' ) if logger.isEnabledFor(logging.INFO): - logger.info('Launching external player: {}'.format(' '.join(self._cnf.DO_NOT_PLAY_OPTS))) - self._cnf.DO_NOT_PLAY_OPTS = [self.stations[self.selection][0]] + self._cnf.DO_NOT_PLAY_OPTS + logger.info('Launching external player: {}'.format(' '.join(self._cnf.EXTERNAL_PLAYER_OPTS))) + self._cnf.EXTERNAL_PLAYER_OPTS = [self.stations[self.selection][0]] + self._cnf.EXTERNAL_PLAYER_OPTS self.log.asked_to_stop = True self.ctrl_c_handler(0,0) self._cnf._online_browser = None