Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
'Backup'
Browse files Browse the repository at this point in the history
  • Loading branch information
lebrunthibault committed Apr 23, 2023
1 parent 6ebe5ef commit 3fd38cf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
8 changes: 1 addition & 7 deletions application/control_surface/group/ActionGroupTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,5 @@ def action_log_midi(self):

def action_test(self):
# type: () -> None
device = Song.selected_device()
params = device.parameters
from protocol0.shared.logging.Logger import Logger
Logger.dev(params)

for param in params:
from protocol0.shared.logging.Logger import Logger
Logger.dev(param.name)
Logger.dev(Song.selected_clip())
2 changes: 1 addition & 1 deletion domain/lom/clip/Clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def update(self, observable):
if isinstance(observable, ClipLoop):
self.notify_observers()

name = cast(str, ForwardTo("appearance", "name"))
name = cast(str, ForwardTo("clip_name", "name"))
color = cast(int, ForwardTo("appearance", "color"))
length = cast(float, ForwardTo("loop", "length"))
bar_length = cast(float, ForwardTo("loop", "bar_length"))
Expand Down
14 changes: 0 additions & 14 deletions domain/lom/clip/ClipAppearance.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ def __init__(self, live_clip, clip_name, color):
self._clip_name = clip_name
self._color = color

@property
def name(self):
# type: () -> str
if self._live_clip:
return self._live_clip.name
else:
return ""

@name.setter
def name(self, name):
# type: (str) -> None
if self._live_clip and name:
self._live_clip.name = str(name).strip() # noqa

@property
def color(self):
# type: () -> int
Expand Down
15 changes: 15 additions & 0 deletions domain/lom/clip/ClipName.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import Optional

from protocol0.domain.shared.scheduler.Scheduler import Scheduler
from protocol0.domain.shared.utils.string import smart_string
from protocol0.domain.shared.utils.utils import get_length_legend
from protocol0.shared.Song import Song
from protocol0.shared.logging.Logger import Logger
Expand All @@ -27,6 +28,20 @@ def __init__(self, live_clip):
self._name_listener.subject = self._live_clip
self._base_name = None # type: Optional[str]

@property
def name(self):
# type: () -> str
if self._live_clip:
return smart_string(self._live_clip.name)
else:
return ""

@name.setter
def name(self, name):
# type: (str) -> None
if self._live_clip and name:
self._live_clip.name = str(name).strip() # noqa

@property
def base_name(self):
# type: () -> str
Expand Down

0 comments on commit 3fd38cf

Please sign in to comment.