mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Fixed issues with cross-platform memory-cue naming and coloring
This commit is contained in:
1 parent
19a604f730
commit
1f2ca18e8a
5 files changed
+26
-8
No files matched your search
@@ -367,12 +367,13 @@ class OneLibraryExporter:
|
||||
if is_memory:
|
||||
# rekordbox keeps 10 (earliest first; the rest are dropped, per
|
||||
# the lossiness rule). A memory cue's colour is PCP2 byte 28 from
|
||||
# its own 8-colour palette; the hot-cue code + RGB stay zero.
|
||||
# its own 8-colour palette — what Konduktor SHOWS (stored, else
|
||||
# the type's), as for a hot cue; the hot-cue code + RGB stay zero.
|
||||
if memory >= MAX_MEMORY_CUES:
|
||||
continue
|
||||
memory += 1
|
||||
code, rgb = 0, (0, 0, 0)
|
||||
color_id = memory_palette.anlz_byte(memory_palette.nearest_code(cue.color))
|
||||
color_id = memory_palette.anlz_byte(memory_palette.nearest_code(effective_color(cue)))
|
||||
else:
|
||||
# What Konduktor SHOWS — stored colour, else the type's (blue cue,
|
||||
# green loop) — as a rekordbox palette CODE, which is what
|
||||
|
||||
@@ -213,14 +213,15 @@ class RekordboxExporter:
|
||||
for cue in sorted(item.cues.cues, key=lambda c: c.start):
|
||||
if cue.role == "memory" or cue.slot is None:
|
||||
# rekordbox keeps 10 (earliest first; the rest are
|
||||
# dropped, per the lossiness rule). Colour: the memory
|
||||
# palette's nearest swatch, else rekordbox's "unset".
|
||||
# dropped, per the lossiness rule). Colour: what
|
||||
# Konduktor SHOWS — stored, else the type's — as the
|
||||
# nearest of the memory palette's 8, as for a hot cue.
|
||||
if memory >= store.MAX_MEMORY_CUES:
|
||||
continue
|
||||
store.add_memory_cue(
|
||||
track_id, start_sec=cue.start, cue_type=cue.type,
|
||||
length_sec=cue.length, name=cue.name,
|
||||
color_code=memory_palette.nearest_code(cue.color),
|
||||
color_code=memory_palette.nearest_code(effective_color(cue)),
|
||||
)
|
||||
memory += 1
|
||||
continue
|
||||
|
||||
@@ -175,6 +175,10 @@ def to_track(e) -> Track:
|
||||
)
|
||||
|
||||
|
||||
#: Traktor's NAME for a cue nobody named.
|
||||
UNNAMED = "n.n."
|
||||
|
||||
|
||||
def is_memory_cue(c) -> bool:
|
||||
"""A cue on no pad that is not a grid marker — Traktor's memory cue.
|
||||
|
||||
@@ -248,7 +252,10 @@ def to_track_cues(entry, offset_ms: float = 0.0) -> TrackCues:
|
||||
slot = c.hotcue if c.hotcue is not None and c.hotcue >= 0 else None
|
||||
cues.append(
|
||||
CuePoint(
|
||||
name=c.name,
|
||||
# "n.n." is the name Traktor gives every cue the user did not
|
||||
# name — a placeholder, not a name, so it crosses as none
|
||||
# (it once landed in rekordbox as a comment reading "n.n.").
|
||||
name=None if c.name in (None, "", UNNAMED) else c.name,
|
||||
# An unknown TYPE is projected as a plain cue rather than dropped:
|
||||
# preserving a cue we cannot name beats hiding it from the user.
|
||||
type=NATIVE_TO_CUE_TYPE.get(c.type, "cue"),
|
||||
|
||||
Reference in new issue
Block a user