diff options
-rw-r--r-- | composer/common.h | 3 | ||||
-rw-r--r-- | composer/composer.c | 3 | ||||
-rw-r--r-- | composer/pattern.c | 2 | ||||
-rw-r--r-- | composer/window.tk | 9 |
4 files changed, 9 insertions, 8 deletions
diff --git a/composer/common.h b/composer/common.h index bdfb99b..516836f 100644 --- a/composer/common.h +++ b/composer/common.h @@ -55,9 +55,6 @@ #define TRACK_SELECTOR "#TRACK" #define SONG_SELECTOR "#SONG" -extern t_symbol s_list; -extern t_symbol s_empty; - struct _track; struct _pattern; diff --git a/composer/composer.c b/composer/composer.c index b267137..dd5ccab 100644 --- a/composer/composer.c +++ b/composer/composer.c @@ -34,9 +34,6 @@ ArrayListDeclare(songs, t_song*, int); -t_symbol s_list = {"list", 0, 0}; -t_symbol s_empty = {"empty", 0, 0}; - void composer_setup(void) { debugprint("loading composer library for pd"); sys_vgui("source {window.tk}\n"); diff --git a/composer/pattern.c b/composer/pattern.c index ed5bce4..95afed2 100644 --- a/composer/pattern.c +++ b/composer/pattern.c @@ -90,7 +90,7 @@ static void pattern_new_empty_row(t_pattern* x) { t_atom* rowdata = (t_atom*)getbytes(sizeof(t_atom) * x->x_track->x_ncolumns); int j; for(j = 0; j < x->x_track->x_ncolumns; j++) - SETSYMBOL(&(rowdata[j]), &s_empty); + SETSYMBOL(&(rowdata[j]), gensym("empty")); ArrayListAdd(x->x_rows, t_atom*, rowdata); } diff --git a/composer/window.tk b/composer/window.tk index 7f7da7d..ac52a2b 100644 --- a/composer/window.tk +++ b/composer/window.tk @@ -46,6 +46,7 @@ namespace eval pd::composer { array set patterns {} variable quirks_fix_int_floats 0 + variable symbolmap {empty {}} # set to 1 until startup, for getting soon a pattern list # affects the behavior of dispatcher::patterns branch variable startup @@ -372,6 +373,11 @@ namespace eval pd::composer { proc validateCommand {id row col curVal newVal} { debugPrint [info level 0] variable currentpattern + variable symbolmap + + debugPrint "BEFORE: newVal = '$newVal'" + set newVal [dict get [dict merge [list $newVal $newVal] [lreverse $symbolmap]] $newVal] + debugPrint "AFTER: newVal = '$newVal'" sendGui [concat $id EDIT setcell $currentpattern($id) $row $col $newVal] @@ -510,7 +516,8 @@ namespace eval pd::composer { proc setCellValueUI {id pat r c v} { upvar 0 [getDataVar $id $pat] data - set data($r,$c) [string map {empty {}} $v] + variable symbolmap + set data($r,$c) [dict get [dict merge [list $v $v] $symbolmap] $v] } proc dispatch {id args} { |