Skip to content

Commit

Permalink
set dummy jack agnostic, and code cosmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
Houston4444 committed Sep 16, 2024
1 parent 7845d88 commit 91456ce
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 62 deletions.
10 changes: 0 additions & 10 deletions src/chichi_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,3 @@ def split_params(input_str: str, split_equal=False,

if w_str:
yield (w_str, w_start, i, is_value)


if __name__ == '__main__':
for stro in [':kofz:zefko:', ':sdpfo:fkodf:fkeo', 'fokf:eprof:', ':zeokf:okef:"fkeoms:kfof":',
':eporkg:ggkgor:erj\:erog:erp',
':AUDIO:OUTPUT', ':normz:fkoe"fokef"',
':ICON_NAME=application-pdf:PRETTY_NAME=rantanplan']:
print('___', stro, '___')
for strou in split_params(stro, split_equal=True):
print(strou)
22 changes: 17 additions & 5 deletions src/fast_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import time
from typing import Callable


class Pali:
def __init__(self, name: str) -> None:
self.name = name
Expand All @@ -19,7 +18,7 @@ def __exit__(self, *args, **kwargs):
print('sortie')


long_list = [i for i in range(1000000)]
long_list = [i for i in range(100000)]

def direct_search():
i = 999999
Expand All @@ -38,6 +37,19 @@ def measure(callable: Callable):
after = time.time()
print('tadam', after - before)


measure(direct_search)
measure(setted_search)
AMSTA = 'foulou'
AMSTAB = 'foulou'

def kiki_eq():
for l in long_list:
if AMSTA == AMSTAB:
...

def kiki_is():
for l in long_list:
if AMSTA is AMSTAB:
...


measure(kiki_eq)
measure(kiki_is)
13 changes: 8 additions & 5 deletions src/main_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ def __init__(self):
self.main_menu.addAction(self.ui.actionShowMenuBar)
self.main_menu.addAction(self.ui.actionQuit)

self.menu_button = self.ui.toolBar.widgetForAction(self.ui.actionMainMenu)
self.menu_button = self.ui.toolBar.widgetForAction(
self.ui.actionMainMenu)

if TYPE_CHECKING:
assert isinstance(self.menu_button, QToolButton)

self.menu_button.setPopupMode(QToolButton.InstantPopup)
self.menu_button.setMenu(self.main_menu)

Expand Down Expand Up @@ -197,8 +200,7 @@ def _select_group_in_patchbay(self, group_name: str):
return

self.patchbay_manager.select_group(group_name)



def refresh_patchbay(self):
if self.patchbay_manager is None:
return
Expand Down Expand Up @@ -324,6 +326,7 @@ def closeEvent(self, event):

def keyPressEvent(self, event: QKeyEvent):
super().keyPressEvent(event)

if event.text().isdigit() and event.modifiers() & Qt.AltModifier:

if (event.text().isdigit()
and event.modifiers() & Qt.KeyboardModifier.AltModifier):
self.patchbay_manager.change_view(int(event.text()))
1 change: 0 additions & 1 deletion src/patchichi.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def main_loop():
load_scene_ok = False
if scene_to_load:
load_scene_ok = main_win.load_scene_at_startup(scene_to_load)
print('scene to load:', scene_to_load, 'OK' if load_scene_ok else 'Failed')

last_patch = Path(settings.fileName()).parent / 'last.patchichi.json'

Expand Down
42 changes: 2 additions & 40 deletions src/patchichi_pb_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
JACK_METADATA_PORT_GROUP,
JACK_METADATA_PRETTY_NAME,
JACK_METADATA_SIGNAL_TYPE)
from patchbay.tools_widgets import JackAgnostic
from patchbay.patchcanvas.init_values import PortMode, PortType
from chichi_syntax import split_params

Expand Down Expand Up @@ -579,7 +580,7 @@ def finish_init(self, main: 'Main'):

self.set_canvas_menu(CanvasMenu(self))
self.set_filter_frame(main.main_win.ui.filterFrame)
# main.main_win.patchbay_tools.set_jack_agnostic()
main.main_win.patchbay_tools.set_jack_agnostic(JackAgnostic.DUMMY)
self.set_tools_widget(main.main_win.patchbay_tools)
self.set_options_dialog(
CanvasOptionsDialog(self.main_win, self, self._settings))
Expand Down Expand Up @@ -697,45 +698,6 @@ def load_file(self, path: Path) -> bool:
# no views in the file, write an empty view
self.views[self.view_number] = {}

# if isinstance(views, dict):
# for view_str, v_dict in views.items():
# if not isinstance(v_dict, dict):
# continue

# if not (isinstance(view_str, str)
# and view_str.upper().startswith('VIEW_')):
# continue

# view_str = view_str.upper().replace('VIEW_', '', 1)
# if not view_str.isdigit():
# continue

# view_number = int(view_str)
# self.views[view_number] = {}

# for ptv_str, ptv_dict in v_dict.items():
# if not isinstance(ptv_dict, dict):
# continue

# if not (isinstance(ptv_str, str)):
# continue

# ptv = PortTypesViewFlag.from_config_str(ptv_str)
# if not ptv:
# continue

# self.views[view_number][ptv] = {}

# for group_name, gpos_dict in ptv_dict.items():
# if not isinstance(gpos_dict, dict):
# continue

# if not isinstance(group_name, str):
# continue

# self.views[view_number][ptv][group_name] = \
# GroupPos.from_new_dict(ptv, group_name, gpos_dict)

elif isinstance(group_positions, list):
self.views[self.view_number] = {}

Expand Down

0 comments on commit 91456ce

Please sign in to comment.