diff --git a/help/max8.tc.preset.maxhelp b/help/max8.tc.preset.maxhelp index c5a4cd9..981c29e 100644 --- a/help/max8.tc.preset.maxhelp +++ b/help/max8.tc.preset.maxhelp @@ -73,6 +73,28 @@ "rect": [ 0.0, 26.0, 899.0, 620.0 ], "showontab": 1, "boxes": [ + { + "box": { + "id": "obj-7", + "maxclass": "newobj", + "numinlets": 1, + "numoutlets": 1, + "outlettype": [ "" ], + "patching_rect": [ 242.5, 538.0, 93.0, 22.0 ], + "text": "prepend setlock" + } + }, + { + "box": { + "id": "obj-2", + "maxclass": "newobj", + "numinlets": 1, + "numoutlets": 1, + "outlettype": [ "" ], + "patching_rect": [ 10.0, 538.0, 116.0, 22.0 ], + "text": "prepend recall_filled" + } + }, { "box": { "id": "obj-12", @@ -508,43 +530,43 @@ "box": { "border": 0, "embedstate": [ - [ "poll_edited", 0 ], - [ "autowriteagain", 0 ], - [ "send_name", "none" ], - [ "slot_round", 0 ], - [ "display_interp", 1 ], - [ "margin", 4 ], - [ "menu_mode", 0 ], - [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], - [ "fontsize", 14 ], - [ "color_3", 0.527, 0.459, 0.756, 1 ], - [ "unique_names", 0 ], [ "fontname", "Arial" ], [ "pattrstorage", "tcpreset_help" ], - [ "bubblesize", 14 ], + [ "color_6", 0.316, 0.616, 0.377, 1 ], + [ "min_rows", 10 ], + [ "bgcolor", 0.2, 0.2, 0.2, 1 ], + [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], + [ "ignoreslotzero", 1 ], + [ "color_mode", 0 ], + [ "send_name", "none" ], + [ "spacing", 4 ], + [ "ui_rename", 0 ], + [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_3", 0.527, 0.459, 0.756, 1 ], + [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], + [ "menu_mode", 0 ], + [ "unique_names", 0 ], + [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], + [ "text_bg_color", 1, 1, 1, 0.5 ], [ "nbslot_edit", 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], - [ "use_uid", 0 ], - [ "scrollable", 0 ], - [ "min_rows", 10 ], - [ "ui_rename", 0 ], - [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], - [ "layout", 0 ], - [ "color_5", 0.283, 0.606, 0.559, 1 ], - [ "spacing", 4 ], - [ "bgcolor", 0.2, 0.2, 0.2, 1 ], - [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], - [ "color_1", 0.743, 0.41, 0.501, 1 ], - [ "color_mode", 0 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], - [ "text_bg_color", 1, 1, 1, 0.5 ], + [ "autowriteagain", 0 ], + [ "display_interp", 1 ], [ "select_mode", 0 ], - [ "color_6", 0.316, 0.616, 0.377, 1 ], - [ "ignoreslotzero", 1 ], - [ "color_2", 0.679, 0.405, 0.669, 1 ], - [ "recall_passthrough", 1 ] + [ "use_uid", 0 ], + [ "bubblesize", 14 ], + [ "recall_passthrough", 1 ], + [ "poll_edited", 0 ], + [ "margin", 4 ], + [ "color_5", 0.283, 0.606, 0.559, 1 ], + [ "scrollable", 0 ], + [ "fontsize", 14 ], + [ "layout", 0 ], + [ "slot_round", 0 ] ], "filename": "tc.preset.js", "id": "obj-10", @@ -612,6 +634,12 @@ "source": [ "obj-14", 0 ] } }, + { + "patchline": { + "destination": [ "obj-2", 0 ], + "source": [ "obj-17", 0 ] + } + }, { "patchline": { "destination": [ "obj-10", 0 ], @@ -624,6 +652,13 @@ "source": [ "obj-19", 0 ] } }, + { + "patchline": { + "destination": [ "obj-10", 0 ], + "midpoints": [ 19.5, 561.0, 6.0, 561.0, 6.0, 375.0, 19.5, 375.0 ], + "source": [ "obj-2", 0 ] + } + }, { "patchline": { "destination": [ "obj-10", 0 ], @@ -654,6 +689,13 @@ "source": [ "obj-26", 0 ] } }, + { + "patchline": { + "destination": [ "obj-10", 0 ], + "midpoints": [ 138.5, 569.1953125, 6.0, 569.1953125, 6.0, 375.0, 19.5, 375.0 ], + "source": [ "obj-27", 0 ] + } + }, { "patchline": { "destination": [ "obj-10", 0 ], @@ -726,11 +768,24 @@ "source": [ "obj-50", 0 ] } }, + { + "patchline": { + "destination": [ "obj-7", 0 ], + "source": [ "obj-56", 0 ] + } + }, { "patchline": { "destination": [ "obj-10", 0 ], "source": [ "obj-6", 0 ] } + }, + { + "patchline": { + "destination": [ "obj-10", 0 ], + "midpoints": [ 252.0, 570.0, 6.0, 570.0, 6.0, 375.0, 19.5, 375.0 ], + "source": [ "obj-7", 0 ] + } } ] }, @@ -758,6 +813,18 @@ "rect": [ 0.0, 26.0, 899.0, 620.0 ], "showontab": 1, "boxes": [ + { + "box": { + "id": "obj-3", + "items": [ "Preset", "number", "|", "name", ",", "Preset", "number", ",", "Preset", "name" ], + "maxclass": "umenu", + "numinlets": 1, + "numoutlets": 3, + "outlettype": [ "int", "", "" ], + "parameter_enable": 0, + "patching_rect": [ 235.0, 549.0, 155.0, 22.0 ] + } + }, { "box": { "id": "obj-11", @@ -1054,7 +1121,7 @@ "maxclass": "comment", "numinlets": 1, "numoutlets": 0, - "patching_rect": [ 441.0, 527.0, 261.0, 87.0 ], + "patching_rect": [ 404.0, 527.0, 261.0, 87.0 ], "text": "Make the preset menu to be populated by the preset number and/or their name.\nIn modes 0 and 2, use the leftmost outlet of umenu prepended by the recall_filled message to recall the correct preset. In mode 1, you can use the umenu's middle outlet directly." } }, @@ -1135,43 +1202,43 @@ "box": { "border": 0, "embedstate": [ - [ "poll_edited", 1 ], - [ "autowriteagain", 0 ], - [ "send_name", "none" ], - [ "slot_round", 0 ], - [ "display_interp", 1 ], - [ "margin", 4 ], - [ "menu_mode", 0 ], - [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], - [ "fontsize", 14 ], - [ "color_3", 0.527, 0.459, 0.756, 1 ], - [ "unique_names", 0 ], [ "fontname", "Arial" ], [ "pattrstorage", "tcpreset_help" ], - [ "bubblesize", 14 ], + [ "color_6", 0.316, 0.616, 0.377, 1 ], + [ "min_rows", 10 ], + [ "bgcolor", 0.2, 0.2, 0.2, 1 ], + [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], + [ "ignoreslotzero", 1 ], + [ "color_mode", 0 ], + [ "send_name", "none" ], + [ "spacing", 4 ], + [ "ui_rename", 1 ], + [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_3", 0.527, 0.459, 0.756, 1 ], + [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], + [ "menu_mode", 0 ], + [ "unique_names", 0 ], + [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], + [ "text_bg_color", 1, 1, 1, 0.5 ], [ "nbslot_edit", 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], - [ "use_uid", 0 ], - [ "scrollable", 0 ], - [ "min_rows", 10 ], - [ "ui_rename", 1 ], - [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], - [ "layout", 0 ], - [ "color_5", 0.283, 0.606, 0.559, 1 ], - [ "spacing", 4 ], - [ "bgcolor", 0.2, 0.2, 0.2, 1 ], - [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], - [ "color_1", 0.743, 0.41, 0.501, 1 ], - [ "color_mode", 0 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], - [ "text_bg_color", 1, 1, 1, 0.5 ], + [ "autowriteagain", 0 ], + [ "display_interp", 1 ], [ "select_mode", 1 ], - [ "color_6", 0.316, 0.616, 0.377, 1 ], - [ "ignoreslotzero", 1 ], - [ "color_2", 0.679, 0.405, 0.669, 1 ], - [ "recall_passthrough", 0 ] + [ "use_uid", 0 ], + [ "bubblesize", 14 ], + [ "recall_passthrough", 0 ], + [ "poll_edited", 1 ], + [ "margin", 4 ], + [ "color_5", 0.283, 0.606, 0.559, 1 ], + [ "scrollable", 0 ], + [ "fontsize", 14 ], + [ "layout", 0 ], + [ "slot_round", 0 ] ], "filename": "tc.preset.js", "id": "obj-10", @@ -1320,7 +1387,7 @@ "numoutlets": 1, "outlettype": [ "" ], "parameter_enable": 0, - "patching_rect": [ 197.0, 563.0, 242.0, 22.0 ], + "patching_rect": [ 235.0, 577.0, 117.0, 22.0 ], "text_width": 87.0 } }, @@ -1450,6 +1517,12 @@ "source": [ "obj-27", 0 ] } }, + { + "patchline": { + "destination": [ "obj-15", 0 ], + "source": [ "obj-3", 0 ] + } + }, { "patchline": { "destination": [ "obj-34", 0 ], @@ -1587,43 +1660,43 @@ "box": { "border": 0, "embedstate": [ - [ "poll_edited", 0 ], - [ "autowriteagain", 0 ], - [ "send_name", "none" ], - [ "slot_round", 0 ], - [ "display_interp", 1 ], - [ "margin", 4 ], - [ "menu_mode", 0 ], - [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], - [ "fontsize", 14 ], - [ "color_3", 0.527, 0.459, 0.756, 1 ], - [ "unique_names", 0 ], [ "fontname", "Arial" ], [ "pattrstorage", "mypat" ], - [ "bubblesize", 14 ], + [ "color_6", 0.316, 0.616, 0.377, 1 ], + [ "min_rows", 10 ], + [ "bgcolor", 0.2, 0.2, 0.2, 1 ], + [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], + [ "ignoreslotzero", 1 ], + [ "color_mode", 0 ], + [ "send_name", "none" ], + [ "spacing", 4 ], + [ "ui_rename", 1 ], + [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_3", 0.527, 0.459, 0.756, 1 ], + [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], + [ "menu_mode", 0 ], + [ "unique_names", 0 ], + [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], + [ "text_bg_color", 1, 1, 1, 0.5 ], [ "nbslot_edit", 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], - [ "use_uid", 0 ], - [ "scrollable", 1 ], - [ "min_rows", 10 ], - [ "ui_rename", 1 ], - [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], - [ "layout", 1 ], - [ "color_5", 0.283, 0.606, 0.559, 1 ], - [ "spacing", 4 ], - [ "bgcolor", 0.2, 0.2, 0.2, 1 ], - [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], - [ "color_1", 0.743, 0.41, 0.501, 1 ], - [ "color_mode", 0 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], - [ "text_bg_color", 1, 1, 1, 0.5 ], + [ "autowriteagain", 0 ], + [ "display_interp", 1 ], [ "select_mode", 0 ], - [ "color_6", 0.316, 0.616, 0.377, 1 ], - [ "ignoreslotzero", 1 ], - [ "color_2", 0.679, 0.405, 0.669, 1 ], - [ "recall_passthrough", 1 ] + [ "use_uid", 0 ], + [ "bubblesize", 14 ], + [ "recall_passthrough", 1 ], + [ "poll_edited", 0 ], + [ "margin", 4 ], + [ "color_5", 0.283, 0.606, 0.559, 1 ], + [ "scrollable", 1 ], + [ "fontsize", 14 ], + [ "layout", 1 ], + [ "slot_round", 0 ] ], "filename": "tc.preset.js", "id": "obj-10", @@ -1729,43 +1802,43 @@ { "box": { "embedstate": [ - [ "poll_edited", 0 ], - [ "autowriteagain", 0 ], - [ "send_name", "none" ], - [ "slot_round", 0 ], - [ "display_interp", 1 ], - [ "margin", 4 ], - [ "menu_mode", 0 ], - [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], - [ "fontsize", 14 ], - [ "color_3", 0.527, 0.459, 0.756, 1 ], - [ "unique_names", 0 ], [ "fontname", "Arial" ], [ "pattrstorage", "mypat" ], - [ "bubblesize", 14 ], + [ "color_6", 0.316, 0.616, 0.377, 1 ], + [ "min_rows", 10 ], + [ "bgcolor", 0.2, 0.2, 0.2, 1 ], + [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], + [ "ignoreslotzero", 1 ], + [ "color_mode", 0 ], + [ "send_name", "none" ], + [ "spacing", 4 ], + [ "ui_rename", 0 ], + [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_3", 0.527, 0.459, 0.756, 1 ], + [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], + [ "menu_mode", 0 ], + [ "unique_names", 0 ], + [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], + [ "text_bg_color", 1, 1, 1, 0.5 ], [ "nbslot_edit", 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], - [ "use_uid", 0 ], - [ "scrollable", 0 ], - [ "min_rows", 10 ], - [ "ui_rename", 0 ], - [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], - [ "layout", 0 ], - [ "color_5", 0.283, 0.606, 0.559, 1 ], - [ "spacing", 4 ], - [ "bgcolor", 0.2, 0.2, 0.2, 1 ], - [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], - [ "color_1", 0.743, 0.41, 0.501, 1 ], - [ "color_mode", 0 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], - [ "text_bg_color", 1, 1, 1, 0.5 ], + [ "autowriteagain", 0 ], + [ "display_interp", 1 ], [ "select_mode", 0 ], - [ "color_6", 0.316, 0.616, 0.377, 1 ], - [ "ignoreslotzero", 1 ], - [ "color_2", 0.679, 0.405, 0.669, 1 ], - [ "recall_passthrough", 1 ] + [ "use_uid", 0 ], + [ "bubblesize", 14 ], + [ "recall_passthrough", 1 ], + [ "poll_edited", 0 ], + [ "margin", 4 ], + [ "color_5", 0.283, 0.606, 0.559, 1 ], + [ "scrollable", 0 ], + [ "fontsize", 14 ], + [ "layout", 0 ], + [ "slot_round", 0 ] ], "filename": "tc.preset.js", "id": "obj-2", @@ -2287,43 +2360,43 @@ "box": { "border": 0, "embedstate": [ - [ "poll_edited", 0 ], - [ "autowriteagain", 0 ], - [ "send_name", "none" ], - [ "slot_round", 0 ], - [ "display_interp", 1 ], - [ "margin", 4 ], - [ "menu_mode", 0 ], - [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], - [ "fontsize", 14 ], - [ "color_3", 0.527, 0.459, 0.756, 1 ], - [ "unique_names", 0 ], [ "fontname", "Arial" ], [ "pattrstorage", "mypat" ], - [ "bubblesize", 14 ], + [ "color_6", 0.316, 0.616, 0.377, 1 ], + [ "min_rows", 10 ], + [ "bgcolor", 0.2, 0.2, 0.2, 1 ], + [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], + [ "ignoreslotzero", 1 ], + [ "color_mode", 0 ], + [ "send_name", "none" ], + [ "spacing", 4 ], + [ "ui_rename", 1 ], + [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_3", 0.527, 0.459, 0.756, 1 ], + [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], + [ "menu_mode", 0 ], + [ "unique_names", 0 ], + [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], + [ "text_bg_color", 1, 1, 1, 0.5 ], [ "nbslot_edit", 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], - [ "use_uid", 0 ], - [ "scrollable", 0 ], - [ "min_rows", 10 ], - [ "ui_rename", 1 ], - [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], - [ "layout", 0 ], - [ "color_5", 0.283, 0.606, 0.559, 1 ], - [ "spacing", 4 ], - [ "bgcolor", 0.2, 0.2, 0.2, 1 ], - [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], - [ "color_1", 0.743, 0.41, 0.501, 1 ], - [ "color_mode", 0 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], - [ "text_bg_color", 1, 1, 1, 0.5 ], + [ "autowriteagain", 0 ], + [ "display_interp", 1 ], [ "select_mode", 0 ], - [ "color_6", 0.316, 0.616, 0.377, 1 ], - [ "ignoreslotzero", 1 ], - [ "color_2", 0.679, 0.405, 0.669, 1 ], - [ "recall_passthrough", 0 ] + [ "use_uid", 0 ], + [ "bubblesize", 14 ], + [ "recall_passthrough", 0 ], + [ "poll_edited", 0 ], + [ "margin", 4 ], + [ "color_5", 0.283, 0.606, 0.559, 1 ], + [ "scrollable", 0 ], + [ "fontsize", 14 ], + [ "layout", 0 ], + [ "slot_round", 0 ] ], "filename": "tc.preset.js", "id": "obj-10", @@ -2444,6 +2517,34 @@ "rect": [ 0.0, 26.0, 899.0, 620.0 ], "showontab": 1, "boxes": [ + { + "box": { + "fontface": 0, + "fontname": "Arial", + "fontsize": 12.0, + "id": "obj-2", + "keymode": 1, + "lines": 1, + "maxclass": "textedit", + "numinlets": 1, + "numoutlets": 4, + "outlettype": [ "", "int", "", "" ], + "parameter_enable": 0, + "patching_rect": [ 10.0, 499.0, 116.0, 26.0 ] + } + }, + { + "box": { + "bubble": 1, + "bubbleside": 0, + "id": "obj-6", + "maxclass": "comment", + "numinlets": 1, + "numoutlets": 0, + "patching_rect": [ 137.0, 492.0, 236.0, 39.0 ], + "text": "Scroll the list with your mouse or trackpad!" + } + }, { "box": { "hidden": 1, @@ -2532,59 +2633,47 @@ "text_width": 78.0 } }, - { - "box": { - "bubble": 1, - "bubbleside": 0, - "id": "obj-6", - "maxclass": "comment", - "numinlets": 1, - "numoutlets": 0, - "patching_rect": [ 20.5, 484.0, 236.0, 39.0 ], - "text": "Scroll the list with your mouse or trackpad!" - } - }, { "box": { "border": 0, "embedstate": [ - [ "poll_edited", 0 ], - [ "autowriteagain", 0 ], - [ "send_name", "none" ], - [ "slot_round", 0 ], - [ "display_interp", 1 ], - [ "margin", 4 ], - [ "menu_mode", 0 ], - [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], - [ "fontsize", 14 ], - [ "color_3", 0.527, 0.459, 0.756, 1 ], - [ "unique_names", 0 ], [ "fontname", "Arial" ], [ "pattrstorage", "tcpreset_help" ], - [ "bubblesize", 14 ], + [ "color_6", 0.316, 0.616, 0.377, 1 ], + [ "min_rows", 10 ], + [ "bgcolor", 0.2, 0.2, 0.2, 1 ], + [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], + [ "ignoreslotzero", 1 ], + [ "color_mode", 0 ], + [ "send_name", "none" ], + [ "spacing", 4 ], + [ "ui_rename", 0 ], + [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_3", 0.527, 0.459, 0.756, 1 ], + [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], + [ "menu_mode", 0 ], + [ "unique_names", 0 ], + [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], + [ "text_bg_color", 1, 1, 1, 0.5 ], [ "nbslot_edit", 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], - [ "use_uid", 0 ], - [ "scrollable", 1 ], - [ "min_rows", 10 ], - [ "ui_rename", 0 ], - [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], - [ "layout", 1 ], - [ "color_5", 0.283, 0.606, 0.559, 1 ], - [ "spacing", 4 ], - [ "bgcolor", 0.2, 0.2, 0.2, 1 ], - [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], - [ "color_1", 0.743, 0.41, 0.501, 1 ], - [ "color_mode", 0 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], - [ "text_bg_color", 1, 1, 1, 0.5 ], + [ "autowriteagain", 0 ], + [ "display_interp", 1 ], [ "select_mode", 0 ], - [ "color_6", 0.316, 0.616, 0.377, 1 ], - [ "ignoreslotzero", 1 ], - [ "color_2", 0.679, 0.405, 0.669, 1 ], - [ "recall_passthrough", 1 ] + [ "use_uid", 0 ], + [ "bubblesize", 14 ], + [ "recall_passthrough", 1 ], + [ "poll_edited", 0 ], + [ "margin", 4 ], + [ "color_5", 0.283, 0.606, 0.559, 1 ], + [ "scrollable", 1 ], + [ "fontsize", 14 ], + [ "layout", 1 ], + [ "slot_round", 0 ] ], "filename": "tc.preset.js", "id": "obj-10", @@ -2769,6 +2858,12 @@ "source": [ "obj-1", 0 ] } }, + { + "patchline": { + "destination": [ "obj-2", 0 ], + "source": [ "obj-10", 2 ] + } + }, { "patchline": { "destination": [ "obj-10", 0 ], @@ -2805,6 +2900,13 @@ "source": [ "obj-16", 0 ] } }, + { + "patchline": { + "destination": [ "obj-10", 0 ], + "midpoints": [ 19.5, 528.0, 6.0, 528.0, 6.0, 375.0, 19.5, 375.0 ], + "source": [ "obj-2", 0 ] + } + }, { "patchline": { "destination": [ "obj-129", 0 ], @@ -2859,7 +2961,7 @@ "modernui": 1 }, "classnamespace": "box", - "rect": [ 0.0, 26.0, 899.0, 620.0 ], + "rect": [ 100.0, 126.0, 899.0, 620.0 ], "showontab": 1, "boxes": [ { @@ -4186,43 +4288,43 @@ "box": { "border": 0, "embedstate": [ - [ "poll_edited", 0 ], - [ "autowriteagain", 0 ], - [ "send_name", "none" ], - [ "slot_round", 0 ], - [ "display_interp", 1 ], - [ "margin", 4 ], - [ "menu_mode", 0 ], - [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], - [ "fontsize", 14 ], - [ "color_3", 0.527, 0.459, 0.756, 1 ], - [ "unique_names", 0 ], [ "fontname", "Arial" ], [ "pattrstorage", "colors" ], - [ "bubblesize", 14 ], + [ "color_6", 0.316, 0.616, 0.377, 1 ], + [ "min_rows", 10 ], + [ "bgcolor", 0.2, 0.2, 0.2, 1 ], + [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], + [ "ignoreslotzero", 1 ], + [ "color_mode", 1 ], + [ "send_name", "none" ], + [ "spacing", 4 ], + [ "ui_rename", 0 ], + [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_3", 0.527, 0.459, 0.756, 1 ], + [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], + [ "menu_mode", 0 ], + [ "unique_names", 0 ], + [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], + [ "text_bg_color", 1, 1, 1, 0.5 ], [ "nbslot_edit", 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], - [ "use_uid", 1 ], - [ "scrollable", 0 ], - [ "min_rows", 10 ], - [ "ui_rename", 0 ], - [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], - [ "layout", 0 ], - [ "color_5", 0.283, 0.606, 0.559, 1 ], - [ "spacing", 4 ], - [ "bgcolor", 0.2, 0.2, 0.2, 1 ], - [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], - [ "color_1", 0.743, 0.41, 0.501, 1 ], - [ "color_mode", 1 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], - [ "text_bg_color", 1, 1, 1, 0.5 ], + [ "autowriteagain", 0 ], + [ "display_interp", 1 ], [ "select_mode", 0 ], - [ "color_6", 0.316, 0.616, 0.377, 1 ], - [ "ignoreslotzero", 1 ], - [ "color_2", 0.679, 0.405, 0.669, 1 ], - [ "recall_passthrough", 1 ] + [ "use_uid", 1 ], + [ "bubblesize", 14 ], + [ "recall_passthrough", 1 ], + [ "poll_edited", 0 ], + [ "margin", 4 ], + [ "color_5", 0.283, 0.606, 0.559, 1 ], + [ "scrollable", 0 ], + [ "fontsize", 14 ], + [ "layout", 0 ], + [ "slot_round", 0 ] ], "filename": "tc.preset.js", "id": "obj-10", @@ -4509,11 +4611,25 @@ "modernui": 1 }, "classnamespace": "box", - "rect": [ 100.0, 126.0, 899.0, 620.0 ], + "rect": [ 0.0, 26.0, 899.0, 620.0 ], "default_fontsize": 13.0, "gridsize": [ 5.0, 5.0 ], "showontab": 1, "boxes": [ + { + "box": { + "bgcolor": [ 0.7019607843137254, 0.7019607843137254, 0.7019607843137254, 0.0 ], + "fontface": 1, + "fontsize": 14.0, + "id": "obj-13", + "linecount": 6, + "maxclass": "comment", + "numinlets": 1, + "numoutlets": 0, + "patching_rect": [ 10.0, 159.0, 457.0, 100.0 ], + "text": "Get tc.preset working in 2 steps:\n1. Create a [tc.preset] (substitute for [jsui @filename tc.preset.js])\n2. Connect it to your [pattrstorage] like shown below\n\n...and that's it! The @pattrstorage attribute of [tc.preset] will be automatically populated." + } + }, { "box": { "id": "obj-4", @@ -4677,43 +4793,43 @@ "box": { "border": 0, "embedstate": [ - [ "poll_edited", 0 ], - [ "autowriteagain", 0 ], - [ "send_name", "none" ], - [ "slot_round", 0 ], - [ "display_interp", 1 ], - [ "margin", 4 ], - [ "menu_mode", 0 ], - [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], - [ "fontsize", 14 ], - [ "color_3", 0.527, 0.459, 0.756, 1 ], - [ "unique_names", 0 ], [ "fontname", "Arial" ], [ "pattrstorage", "tcpreset_help" ], - [ "bubblesize", 14 ], + [ "color_6", 0.316, 0.616, 0.377, 1 ], + [ "min_rows", 10 ], + [ "bgcolor", 0.2, 0.2, 0.2, 1 ], + [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], + [ "ignoreslotzero", 1 ], + [ "color_mode", 0 ], + [ "send_name", "none" ], + [ "spacing", 4 ], + [ "ui_rename", 0 ], + [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_3", 0.527, 0.459, 0.756, 1 ], + [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], + [ "menu_mode", 0 ], + [ "unique_names", 0 ], + [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], + [ "text_bg_color", 1, 1, 1, 0.5 ], [ "nbslot_edit", 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], - [ "use_uid", 0 ], - [ "scrollable", 0 ], - [ "min_rows", 10 ], - [ "ui_rename", 0 ], - [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], - [ "layout", 0 ], - [ "color_5", 0.283, 0.606, 0.559, 1 ], - [ "spacing", 4 ], - [ "bgcolor", 0.2, 0.2, 0.2, 1 ], - [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], - [ "color_1", 0.743, 0.41, 0.501, 1 ], - [ "color_mode", 0 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], - [ "text_bg_color", 1, 1, 1, 0.5 ], + [ "autowriteagain", 0 ], + [ "display_interp", 1 ], [ "select_mode", 0 ], - [ "color_6", 0.316, 0.616, 0.377, 1 ], - [ "ignoreslotzero", 1 ], - [ "color_2", 0.679, 0.405, 0.669, 1 ], - [ "recall_passthrough", 1 ] + [ "use_uid", 0 ], + [ "bubblesize", 14 ], + [ "recall_passthrough", 1 ], + [ "poll_edited", 0 ], + [ "margin", 4 ], + [ "color_5", 0.283, 0.606, 0.559, 1 ], + [ "scrollable", 0 ], + [ "fontsize", 14 ], + [ "layout", 0 ], + [ "slot_round", 0 ] ], "filename": "tc.preset.js", "id": "obj-10", @@ -4743,18 +4859,6 @@ "varname": "tcpreset_help" } }, - { - "box": { - "fontsize": 14.0, - "id": "obj-13", - "linecount": 5, - "maxclass": "comment", - "numinlets": 1, - "numoutlets": 0, - "patching_rect": [ 10.0, 136.0, 427.0, 85.0 ], - "text": "Get tc.preset working in 3 steps:\n1. Create a [tc.preset] (shortcut for [jsui @filename tc.preset.js])\n2. Connect its inlet to your [pattrstorage] outlet like shown below\n3. Send to tc.preset the name of your pattrstorage prepended by \"pattrstorage\", or set its name in the @pattrstorage attribute " - } - }, { "box": { "border": 0, diff --git a/help/max9.tc.preset.maxhelp b/help/max9.tc.preset.maxhelp index 6949e90..da31fdc 100644 --- a/help/max9.tc.preset.maxhelp +++ b/help/max9.tc.preset.maxhelp @@ -32,6 +32,17 @@ "rect": [ 0.0, 26.0, 900.0, 620.0 ], "showontab": 1, "boxes": [ + { + "box": { + "id": "obj-9", + "linecount": 3, + "maxclass": "comment", + "numinlets": 1, + "numoutlets": 0, + "patching_rect": [ 519.0, 236.0, 350.0, 47.0 ], + "text": "V8UI version in Max 9.0.0 to 9.0.5: ui_rename and automatic pattrstorage linking won't work, since jsmaxobj patchcords property vor v8ui has been added in Max 9.0.6." + } + }, { "box": { "id": "obj-12", @@ -39,7 +50,7 @@ "maxclass": "comment", "numinlets": 1, "numoutlets": 0, - "patching_rect": [ 519.0, 158.0, 350.0, 87.0 ], + "patching_rect": [ 519.0, 136.0, 350.0, 87.0 ], "text": "Reason for the [substitute read readfile] workaround:\n[pattrstorage] sometimes outputs 'read' messages, which are properly handled by [jsui] or [v8ui] starting from Max 9.1.0.\nBut between Max 9.0.0 and 9.0.9, [v8ui] doesn't accept read messages since it is a method of the object to change the loaded javascript file." } }, @@ -379,43 +390,43 @@ { "box": { "embedstate": [ - [ "poll_edited", 0 ], - [ "autowriteagain", 0 ], - [ "send_name", "none" ], - [ "slot_round", 0 ], - [ "display_interp", 1 ], - [ "margin", 4 ], - [ "menu_mode", 0 ], - [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], - [ "fontsize", 14 ], - [ "color_3", 0.527, 0.459, 0.756, 1 ], - [ "unique_names", 0 ], [ "fontname", "Arial" ], [ "pattrstorage", "mypat" ], - [ "bubblesize", 14 ], + [ "color_6", 0.316, 0.616, 0.377, 1 ], + [ "min_rows", 10 ], + [ "bgcolor", 0.2, 0.2, 0.2, 1 ], + [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], + [ "ignoreslotzero", 1 ], + [ "color_mode", 0 ], + [ "send_name", "none" ], + [ "spacing", 4 ], + [ "ui_rename", 0 ], + [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_3", 0.527, 0.459, 0.756, 1 ], + [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], + [ "menu_mode", 0 ], + [ "unique_names", 0 ], + [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], + [ "text_bg_color", 1, 1, 1, 0.5 ], [ "nbslot_edit", 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], - [ "use_uid", 0 ], - [ "scrollable", 0 ], - [ "min_rows", 10 ], - [ "ui_rename", 0 ], - [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], - [ "layout", 0 ], - [ "color_5", 0.283, 0.606, 0.559, 1 ], - [ "spacing", 4 ], - [ "bgcolor", 0.2, 0.2, 0.2, 1 ], - [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], - [ "color_1", 0.743, 0.41, 0.501, 1 ], - [ "color_mode", 0 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], - [ "text_bg_color", 1, 1, 1, 0.5 ], + [ "autowriteagain", 0 ], + [ "display_interp", 1 ], [ "select_mode", 0 ], - [ "color_6", 0.316, 0.616, 0.377, 1 ], - [ "ignoreslotzero", 1 ], - [ "color_2", 0.679, 0.405, 0.669, 1 ], - [ "recall_passthrough", 1 ] + [ "use_uid", 0 ], + [ "bubblesize", 14 ], + [ "recall_passthrough", 1 ], + [ "poll_edited", 0 ], + [ "margin", 4 ], + [ "color_5", 0.283, 0.606, 0.559, 1 ], + [ "scrollable", 0 ], + [ "fontsize", 14 ], + [ "layout", 0 ], + [ "slot_round", 0 ] ], "filename": "tc.preset", "id": "obj-1", @@ -947,8 +958,7 @@ "numoutlets": 4, "outlettype": [ "", "int", "", "" ], "parameter_enable": 0, - "patching_rect": [ 129.0, 506.0, 102.0, 24.0 ], - "text": "up" + "patching_rect": [ 129.0, 506.0, 102.0, 24.0 ] } }, { @@ -1701,8 +1711,7 @@ "numoutlets": 4, "outlettype": [ "", "int", "", "" ], "parameter_enable": 0, - "patching_rect": [ 129.0, 505.0, 102.0, 24.0 ], - "text": "up" + "patching_rect": [ 129.0, 505.0, 102.0, 24.0 ] } }, { @@ -2157,43 +2166,43 @@ { "box": { "embedstate": [ - [ "poll_edited", 0 ], - [ "autowriteagain", 0 ], - [ "send_name", "none" ], - [ "slot_round", 0 ], - [ "display_interp", 1 ], - [ "margin", 4 ], - [ "menu_mode", 0 ], - [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], - [ "fontsize", 14 ], - [ "color_3", 0.527, 0.459, 0.756, 1 ], - [ "unique_names", 0 ], [ "fontname", "Arial" ], [ "pattrstorage", "mypat" ], - [ "bubblesize", 14 ], + [ "color_6", 0.316, 0.616, 0.377, 1 ], + [ "min_rows", 10 ], + [ "bgcolor", 0.2, 0.2, 0.2, 1 ], + [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], + [ "ignoreslotzero", 1 ], + [ "color_mode", 0 ], + [ "send_name", "none" ], + [ "spacing", 4 ], + [ "ui_rename", 0 ], + [ "edited_color", 1, 0.49, 0.263, 1 ], + [ "color_3", 0.527, 0.459, 0.756, 1 ], + [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], + [ "menu_mode", 0 ], + [ "unique_names", 0 ], + [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], + [ "text_bg_color", 1, 1, 1, 0.5 ], [ "nbslot_edit", 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], - [ "use_uid", 0 ], - [ "scrollable", 0 ], - [ "min_rows", 10 ], - [ "ui_rename", 0 ], - [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], - [ "layout", 0 ], - [ "color_5", 0.283, 0.606, 0.559, 1 ], - [ "spacing", 4 ], - [ "bgcolor", 0.2, 0.2, 0.2, 1 ], - [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], - [ "color_1", 0.743, 0.41, 0.501, 1 ], - [ "color_mode", 0 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], - [ "text_bg_color", 1, 1, 1, 0.5 ], + [ "autowriteagain", 0 ], + [ "display_interp", 1 ], [ "select_mode", 0 ], - [ "color_6", 0.316, 0.616, 0.377, 1 ], - [ "ignoreslotzero", 1 ], - [ "color_2", 0.679, 0.405, 0.669, 1 ], - [ "recall_passthrough", 1 ] + [ "use_uid", 0 ], + [ "bubblesize", 14 ], + [ "recall_passthrough", 1 ], + [ "poll_edited", 0 ], + [ "margin", 4 ], + [ "color_5", 0.283, 0.606, 0.559, 1 ], + [ "scrollable", 0 ], + [ "fontsize", 14 ], + [ "layout", 0 ], + [ "slot_round", 0 ] ], "filename": "tc.preset", "id": "obj-1", @@ -3218,7 +3227,7 @@ "modernui": 1 }, "classnamespace": "box", - "rect": [ 368.0, 166.0, 900.0, 620.0 ], + "rect": [ 0.0, 26.0, 900.0, 620.0 ], "showontab": 1, "boxes": [ { @@ -3234,8 +3243,7 @@ "numoutlets": 4, "outlettype": [ "", "int", "", "" ], "parameter_enable": 0, - "patching_rect": [ 10.0, 499.0, 116.0, 26.0 ], - "text": "up" + "patching_rect": [ 10.0, 499.0, 116.0, 26.0 ] } }, { @@ -3672,8 +3680,7 @@ "numoutlets": 4, "outlettype": [ "", "int", "", "" ], "parameter_enable": 0, - "patching_rect": [ 128.5, 499.0, 102.0, 24.0 ], - "text": "Preset 1" + "patching_rect": [ 128.5, 499.0, 102.0, 24.0 ] } }, { @@ -5267,7 +5274,7 @@ "modernui": 1 }, "classnamespace": "box", - "rect": [ 0.0, 26.0, 900.0, 620.0 ], + "rect": [ 368.0, 166.0, 900.0, 620.0 ], "default_fontsize": 13.0, "gridsize": [ 5.0, 5.0 ], "showontab": 1, @@ -5280,7 +5287,7 @@ "numoutlets": 3, "outlettype": [ "", "", "" ], "patching_rect": [ 596.0, 159.0, 40.0, 23.0 ], - "restore": [ -0.714285714285714, -0.714285714285714, -0.6, -0.542857142857143, -0.457142857142857, -0.342857142857143, -0.171428571428571, -0.028571428571429, 0.028571428571428, 0.142857142857143, 0.228571428571429, 0.371428571428571, 0.485714285714286, 0.571428571428571, 0.714285714285714, 0.8 ], + "restore": [ -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0 ], "saved_object_attributes": { "parameter_enable": 0, "parameter_mappable": 0 @@ -5409,8 +5416,7 @@ "numoutlets": 4, "outlettype": [ "", "int", "", "" ], "parameter_enable": 0, - "patching_rect": [ 254.0, 441.0, 98.0, 23.0 ], - "text": "up" + "patching_rect": [ 254.0, 441.0, 98.0, 23.0 ] } }, { @@ -5507,12 +5513,12 @@ "fontface": 1, "fontsize": 14.0, "id": "obj-13", - "linecount": 5, + "linecount": 6, "maxclass": "comment", "numinlets": 1, "numoutlets": 0, - "patching_rect": [ 10.0, 159.0, 457.0, 85.0 ], - "text": "Get tc.preset working in 3 steps:\n1. Create a [tc.preset] (substitute for [v8ui @filename tc.preset.js])\n2. Connect it to your [pattrstorage] like shown below\n3. Send to tc.preset the name of your pattrstorage prepended by \"pattrstorage\", or set its name in the @pattrstorage attribute " + "patching_rect": [ 10.0, 159.0, 457.0, 100.0 ], + "text": "Get tc.preset working in 2 steps:\n1. Create a [tc.preset] (substitute for [v8ui @filename tc.preset.js])\n2. Connect it to your [pattrstorage] like shown below\n\n...and that's it! The @pattrstorage attribute of [tc.preset] will be automatically populated." } }, { diff --git a/javascript/tc.preset.js b/javascript/tc.preset.js index 5d9cb9b..3038c0e 100644 --- a/javascript/tc.preset.js +++ b/javascript/tc.preset.js @@ -88,7 +88,8 @@ var poll_edited = 0; // If >0, check if current preset is edited every X var nbslot_edit = true; // If nbslot_edit and scrollable are enabled, the last two visible slots are replaced by buttons to add or remove lines of slot. // (WORK) -var pattrstorage_name, pattrstorage_obj = null; +var pattrstorage_name = null; +var pattrstorage_obj = null; var columns, rows = 0; var slots = []; // Stores on screen box, name, lock and interpolation state for all slots @@ -143,8 +144,10 @@ var textedit_obj = null; var textedit_initstate = {}; var is_typing_name = false; -var poll_edited_task = new Task(do_poll_edited, this); var init_tsk; +var psto_auto_link_task = new Task(psto_auto_link, this); +psto_auto_link_task.interval = 200; +var poll_edited_task = new Task(do_poll_edited, this); var has_loaded = false; @@ -195,12 +198,44 @@ function slot(left, top, right, bottom, name, lock, interp, color_index, color_c function loadbang() { // post("loadbang\n"); has_loaded = true; - find_pattrstorage(pattrstorage_name); + find_pattrstorage(pattrstorage_name); + if (!pattrstorage_name) { + psto_auto_link_task.repeat(); + } calc_rows_columns(); find_textedit(); } +init_tsk = new Task(delayed_init); +init_tsk.schedule(200); + +function delayed_init() { + if (!has_loaded) { + loadbang(); + } + if (arguments.callee.task.valid) { + arguments.callee.task.freepeer(); + } +} +delayed_init.local = 1; + +function psto_auto_link() { + if (!pattrstorage_name) { + var cords = this.box.patchcords; + for (var c = 0; c < cords.inputs.length; c++) { + if (cords.inputs[c].dstinlet == 0 && cords.inputs[c].srcobject.maxclass == "pattrstorage") { + find_pattrstorage(cords.inputs[c].srcobject.getboxattr('varname')); + calc_rows_columns(); + arguments.callee.task.freepeer(); + break; + } + } + } else { + arguments.callee.task.cancel(); + } +} + function calc_rows_columns() { half_margin = margin / 2; half_spacing = spacing / 2; @@ -419,12 +454,12 @@ paint_base.local = 1; function paint() { + // post("redraw\n"); // Handling Presentation mode enable/disable var cur_size = mgraphics.size; if (cur_size[0] != ui_width || cur_size[1] != ui_height) { onresize(cur_size[0], cur_size[1]); } else { - // post("redraw\n"); mgraphics.select_font_face(font_name); mgraphics.set_font_size(font_size); mgraphics.translate(0, y_offset); @@ -1322,6 +1357,8 @@ function resync() { function find_pattrstorage(name) { active_slot = 0; + previous_active_slot = 0; + selected_slot = 0; pattrstorage_obj = this.patcher.getnamed(name); if (pattrstorage_obj == null) { var parent_patcher = this.patcher.parentpatcher; @@ -1335,13 +1372,11 @@ function find_pattrstorage(name) { // this.patcher.hiddenconnect(pattrstorage_obj, 0, this.box, 0); // post('lets find presets_metata pattr for', name, '\n'); if (use_uid || color_mode > 1) connect_to_metadata_pattr(); + if (psto_auto_link_task.running) psto_auto_link_task.cancel(); to_pattrstorage("getslotlist"); to_pattrstorage("getlockedslots"); } else { pattrstorage_name = null; - active_slot = 0; - previous_active_slot = 0; - selected_slot = 0; slots_clear(); if (name != undefined) { error("Pattrstorage", name, "doesn't exist.\n"); @@ -1794,6 +1829,9 @@ function notifydeleted(){ if (poll_edited_task.valid) { poll_edited_task.freepeer(); } + if (psto_auto_link_task.valid) { + psto_auto_link_task.freepeer(); + } } // ATTRIBUTES DECLARATION @@ -1801,47 +1839,30 @@ function notifydeleted(){ declareattribute("pattrstorage", "getpattrstorage","setpattrstorage", 1, {type: "symbol", label: "Pattrstorage"}); function getpattrstorage() { if (pattrstorage_name == null) { - return + return "" } else { return pattrstorage_name; } } +getpattrstorage.local = 1; + function setpattrstorage(v){ // This method is called for the first time when the patch is loading, before the loadbang (not all objects are instanciated yet) // With v being the value stored whithin the patcher - if (v == null || v == 0 || v.lastIndexOf('#') === 0) { + if (v == null || v == 0 || v == "" | v.lastIndexOf('#') === 0) { pattrstorage_name = null; pattrstorage_obj = null; } else { pattrstorage_name = arrayfromargs(arguments)[0]; } - // post('set_pattrstorage', pattrstorage_name, '\n'); - - // If the loadbang already occured once, we need to retrigger here - if (has_loaded) { - loadbang(); - } else { - // Otherwise, we have no way to know how we're here in the code - // (was it just an attribute change? or maybe the object got copy-pasted with already set attribute, or it is being instantiated at patch load with saved attributes) - // So we have to delay the loadbang to make sure it will work in any case - // and won't be triggered before this or other objects are being instantiated completely. - init_tsk = new Task(delayed_init); - init_tsk.schedule(200); - } } - -function delayed_init() { - loadbang(); - if (arguments.callee.task.valid) { - arguments.callee.task.freepeer(); - } -} -delayed_init.local = 1; +setpattrstorage.local = 1; declareattribute("bubblesize", "getslotsize", "setslotsize", 1, {type: "long", default: 14, label: "Slot Size", category: "Appearance"}); function getslotsize() { return slot_size; } +getslotsize.local = 1; function setslotsize(v){ if (arguments.length) { slot_size = Math.max(2, v); @@ -1850,11 +1871,14 @@ function setslotsize(v){ } calc_rows_columns(); } +setslotsize.local = 1; declareattribute("slot_round", "getslotround", "setslotround", 1, {type: "long", default: 0, label: "Slot Round", category: "Appearance"}); function getslotround() { return slot_round; } +getslotround.local = 1; + function setslotround(v){ if (arguments.length) { slot_round = Math.max(0, Math.min(slot_size, v)); @@ -1864,11 +1888,14 @@ function setslotround(v){ slot_round_ratio = slot_round / slot_size; calc_rows_columns(); } +setslotround.local = 1; declareattribute("margin", "getmargin", "setmargin", 1, {type: "long", default: 4, label: "Margin", category: "Appearance"}); function getmargin() { return margin; } +getmargin.local = 1; + function setmargin(v){ if (arguments.length) { margin = Math.max(0, v); @@ -1877,11 +1904,14 @@ function setmargin(v){ } calc_rows_columns(); } +setmargin.local = 1; declareattribute("spacing", "getspacing", "setspacing", 1, {type: "long", default: 4, label: "Spacing", category: "Appearance"}); function getspacing() { return spacing; } +getspacing.local = 1; + function setspacing(v){ if (arguments.length) { spacing = Math.max(1, v); @@ -1891,10 +1921,14 @@ function setspacing(v){ calc_rows_columns(); } +setspacing.local = 1; + declareattribute("bgcolor", "getbgcolor", "setbgcolor", 1, {style: "rgba", label: "Background Color", category: "Appearance"}); function getbgcolor() { return background_color; } +getbgcolor.local = 1; + function setbgcolor(){ if (arguments.length == 4) { background_color = [arguments[0], arguments[1], arguments[2], arguments[3]]; @@ -1905,11 +1939,14 @@ function setbgcolor(){ } paint_base(); } +setbgcolor.local = 1; declareattribute("empty_slot_color", "getemptycolor", "setemptycolor", 1, {style: "rgba", label: "Empty Slot Color", category: "Appearance"}); function getemptycolor() { return empty_slot_color; } +getemptycolor.local = 1; + function setemptycolor(){ if (arguments.length == 4) { empty_slot_color = [arguments[0], arguments[1], arguments[2], arguments[3]]; @@ -1920,11 +1957,14 @@ function setemptycolor(){ } paint_base(); } +setemptycolor.local = 1; declareattribute("active_slot_color", "getactiveslotcolor", "setactiveslotcolor", 1, {style: "rgba", label: "Active Slot Color", category: "Appearance"}); function getactiveslotcolor() { return active_slot_color; } +getactiveslotcolor.local = 1; + function setactiveslotcolor(){ if (arguments.length == 4) { active_slot_color = [arguments[0], arguments[1], arguments[2], arguments[3]]; @@ -1935,11 +1975,14 @@ function setactiveslotcolor(){ } mgraphics.redraw(); } +setactiveslotcolor.local = 1; declareattribute("stored_slot_color", "getstoredslotcolor", "setstoredslotcolor", 1, {style: "rgba", label: "Stored Slot Color", category: "Appearance"}); function getstoredslotcolor() { return stored_slot_color; } +getstoredslotcolor.local = 1; + function setstoredslotcolor(){ if (arguments.length == 4) { stored_slot_color = [arguments[0], arguments[1], arguments[2], arguments[3]]; @@ -1950,11 +1993,14 @@ function setstoredslotcolor(){ } paint_base(); } +setstoredslotcolor.local = 1; declareattribute("interp_slot_color", "getinterpslotcolor", "setinterpslotcolor", 1, {style: "rgba", label: "Interpolating slot color", category: "Appearance"}); function getinterpslotcolor() { return interp_slot_color; } +getinterpslotcolor.local = 1; + function setinterpslotcolor(){ if (arguments.length == 4) { interp_slot_color = [arguments[0], arguments[1], arguments[2], arguments[3]]; @@ -1965,11 +2011,14 @@ function setinterpslotcolor(){ } mgraphics.redraw(); } +setinterpslotcolor.local = 1; declareattribute("text_bg_color", "gettextbgcolor", "settextbgcolor", 1, {style: "rgba", label: "Text Background Color", category: "Appearance"}); function gettextbgcolor() { return text_bg_color; } +gettextbgcolor.local = 1; + function settextbgcolor(){ if (arguments.length == 4) { text_bg_color = [arguments[0], arguments[1], arguments[2], arguments[3]]; @@ -1980,11 +2029,13 @@ function settextbgcolor(){ } mgraphics.redraw(); } +settextbgcolor.local = 1; declareattribute("text_color", "gettextcolor", "settextcolor", 1, {style: "rgba", label: "Text Color", category: "Appearance"}); function gettextcolor() { return text_color; } +gettextcolor.local = 1; function settextcolor(){ if (arguments.length == 4) { text_color = [arguments[0], arguments[1], arguments[2], arguments[3]]; @@ -1995,11 +2046,14 @@ function settextcolor(){ } mgraphics.redraw(); } +settextcolor.local = 1; declareattribute("fontsize", "getfontsize", "setfontsize", 1, {type: "float", label: "Font Size", category: "Appearance"}); function getfontsize() { return font_size; } +getfontsize.local = 1; + function setfontsize(v){ if (arguments.length) { font_size = Math.max(2, v); @@ -2012,11 +2066,14 @@ function setfontsize(v){ mgraphics.redraw(); } } +setfontsize.local = 1; declareattribute("fontname", "getfontname", "setfontname", 1, {type: "symbol", label: "Font Name", category: "Appearance"}); function getfontname() { return font_name; } +getfontname.local = 1; + function setfontname(v){ if (arguments.length) { var fontlist = mgraphics.getfontlist(); @@ -2034,22 +2091,28 @@ function setfontname(v){ mgraphics.redraw(); } } +setfontname.local = 1; declareattribute("menu_mode", "getmenu_mode", "setmenu_mode", 1, {style: "enumindex", enumvals: ["Preset number + name", "Preset number", "Preset name"], label: "Menu Mode"}); function getmenu_mode() { return menu_mode; } +getmenu_mode.local = 1; + function setmenu_mode(v){ if (arguments.length == 1) { menu_mode = Math.min(Math.max(0, parseInt(v)), 2); update_umenu(); } } +setmenu_mode.local = 1; declareattribute("autowriteagain", "getautowriteagain", "setautowriteagain", 1, {style: "onoff", label: "Auto writeagain"}); function getautowriteagain() { return auto_writeagain; } +getautowriteagain.local = 1; + function setautowriteagain(v){ if (v == 0) { auto_writeagain = 0; @@ -2057,11 +2120,14 @@ function setautowriteagain(v){ auto_writeagain = 1; } } +setautowriteagain.local = 1; declareattribute("ignoreslotzero", "getignoreslotzero", "setignoreslotzero", 1, {style: "onoff", label: "Ignore Slot 0", category: "Appearance"}); function getignoreslotzero() { return ignore_slot_zero; } +getignoreslotzero.local = 1; + function setignoreslotzero(v){ if (v == 0) { ignore_slot_zero = 0; @@ -2069,11 +2135,14 @@ function setignoreslotzero(v){ ignore_slot_zero = 1; } } +setignoreslotzero.local = 1; declareattribute("display_interp", "getdisplayinterp", "setdisplayinterp", 1, {style: "onoff", label: "Display Interpolations", category: "Appearance"}); function getdisplayinterp() { return display_interp; } +getdisplayinterp.local = 1; + function setdisplayinterp(v){ if (v == 0) { display_interp = 0; @@ -2081,11 +2150,14 @@ function setdisplayinterp(v){ display_interp = 1; } } +setdisplayinterp.local = 1; declareattribute("layout", "getlayout", "setlayout", 1, {style: "enumindex", enumvals: ["Grid", "List"], label: "Layout", category: "Appearance"}); function getlayout() { return layout; } +getlayout.local = 1; + function setlayout(v){ if (v == 0) { layout = 0; @@ -2095,11 +2167,14 @@ function setlayout(v){ y_offset = 0; calc_rows_columns(); } +setlayout.local = 1; declareattribute("scrollable", "getscrollable", "setscrollable", 1, {style: "onoff", label: "Scrollable"}); function getscrollable() { return scrollable; } +getscrollable.local = 1; + function setscrollable(v){ if (v == 0) { scrollable = 0; @@ -2109,11 +2184,13 @@ function setscrollable(v){ y_offset = 0; calc_rows_columns(); } +setscrollable.local = 1; declareattribute("min_rows", "getmin_rows", "setmin_rows", 1, {type: "long", min: 1, label: "Minimum Rows"}); function getmin_rows() { return min_rows; } +getmin_rows.local = 1; function setmin_rows(v){ if (v > 0) { min_rows = v; @@ -2122,11 +2199,14 @@ function setmin_rows(v){ calc_rows_columns(); } } +setmin_rows.local = 1; declareattribute("select_mode", "getselect_mode", "setselect_mode", 1, {style: "onoff", label: "Select Mode"}); function getselect_mode() { return select_mode; } +getselect_mode.local = 1; + function setselect_mode(v){ if (v == 1) { select_mode = 1; @@ -2135,11 +2215,14 @@ function setselect_mode(v){ } mgraphics.redraw(); } +setselect_mode.local = 1; declareattribute("color_mode", "getcolor_mode", "setcolor_mode", 1, {type: "long", min: 0, max: 3, style: "enumindex", enumvals: ["Classic", "Cycle", "Select", "Custom"], label: "Color Mode", category: "Appearance"}); function getcolor_mode() { return color_mode; } +getcolor_mode.local = 1; + function setcolor_mode(v){ v = Math.floor(v); v = Math.max(0, Math.min(3, v)); @@ -2162,11 +2245,14 @@ function setcolor_mode(v){ paint_base(); } } +setcolor_mode.local = 1; declareattribute("color_1", "getcolor1", "setcolor1", 1, {style: "rgba", label: "Color 1", category: "Appearance"}); function getcolor1() { return color_1; } +getcolor1.local = 1; + function setcolor1(){ if (arguments.length == 4) { color_wheel(1, arguments[0], arguments[1], arguments[2], arguments[3]); @@ -2176,11 +2262,14 @@ function setcolor1(){ error('color_1: wrong number of arguments\n'); } } +setcolor1.local = 1; declareattribute("color_2", "getcolor2", "setcolor2", 1, {style: "rgba", label: "Color 2", category: "Appearance"}); function getcolor2() { return color_2; } +getcolor2.local = 1; + function setcolor2(){ if (arguments.length == 4) { color_wheel(2, arguments[0], arguments[1], arguments[2], arguments[3]); @@ -2190,11 +2279,14 @@ function setcolor2(){ error('color_2: wrong number of arguments\n'); } } +setcolor2.local = 1; declareattribute("color_3", "getcolor3", "setcolor3", 1, {style: "rgba", label: "Color 3", category: "Appearance"}); function getcolor3() { return color_3; } +getcolor3.local = 1; + function setcolor3(){ if (arguments.length == 4) { color_wheel(3, arguments[0], arguments[1], arguments[2], arguments[3]); @@ -2204,11 +2296,14 @@ function setcolor3(){ error('color_3: wrong number of arguments\n'); } } +setcolor3.local = 1; declareattribute("color_4", "getcolor4", "setcolor4", 1, {style: "rgba", label: "Color 4", category: "Appearance"}); function getcolor4() { return color_4; } +getcolor4.local = 1; + function setcolor4(){ if (arguments.length == 4) { color_wheel(4, arguments[0], arguments[1], arguments[2], arguments[3]); @@ -2218,11 +2313,14 @@ function setcolor4(){ error('color_4: wrong number of arguments\n'); } } +setcolor4.local = 1; declareattribute("color_5", "getcolor5", "setcolor5", 1, {style: "rgba", label: "Color 5", category: "Appearance"}); function getcolor5() { return color_5; } +getcolor5.local = 1; + function setcolor5(){ if (arguments.length == 4) { color_wheel(5, arguments[0], arguments[1], arguments[2], arguments[3]); @@ -2232,11 +2330,14 @@ function setcolor5(){ error('color_5: wrong number of arguments\n'); } } +setcolor5.local = 1; declareattribute("color_6", "getcolor6", "setcolor6", 1, {style: "rgba", label: "Color 6", category: "Appearance"}); function getcolor6() { return color_6; } +getcolor6.local = 1; + function setcolor6(){ if (arguments.length == 4) { color_wheel(6, arguments[0], arguments[1], arguments[2], arguments[3]); @@ -2246,11 +2347,14 @@ function setcolor6(){ error('color_6: wrong number of arguments\n'); } } +setcolor6.local = 1; declareattribute("send_name", "getsendname", "setsendname", 1, {type: "symbol", label: "Send Dictionary To"}); function getsendname() { return send_name; } +getsendname.local = 1; + function setsendname(){ if (arguments.length > 0) { send_name = arguments[0]; @@ -2258,19 +2362,25 @@ function setsendname(){ send_name = "none"; } } +setsendname.local = 1; declareattribute("unique_names", "getunique_names", "setunique_names", 1, {style: "onoff", label: "Force Unique Names"}); function getunique_names() { return unique_names; } +getunique_names.local = 1; + function setunique_names(v){ unique_names = v > 0; } +setunique_names.local = 1; declareattribute("use_uid", "getuse_uid", "setuse_uid", 1, {style: "onoff", label: "Use UID"}); function getuse_uid() { return use_uid; } +getuse_uid.local = 1; + function setuse_uid(v){ var new_val = v == 1 ? 1 : 0; if (new_val != use_uid && new_val == 1) { @@ -2280,30 +2390,39 @@ function setuse_uid(v){ } use_uid = new_val; } +setuse_uid.local = 1; declareattribute("recall_passthrough", "getrecall_passthrough", "setrecall_passthrough", 1, {style: "onoff", label: "Recall Passthrough"}); function getrecall_passthrough() { return recall_passthrough; } +getrecall_passthrough.local = 1; + function setrecall_passthrough(v){ recall_passthrough = v > 0; } +setrecall_passthrough.local = 1; declareattribute("ui_rename", "getui_rename", "setui_rename", 1, {style: "onoff", label: "Rename In UI"}); function getui_rename() { return ui_rename; } +getui_rename.local = 1; + function setui_rename(v){ ui_rename = v > 0; if (ui_rename) { find_textedit(); } } +setui_rename.local = 1; declareattribute("poll_edited", "getpoll_edited", "setpoll_edited", 1, {type: "float", min: 0, label: "Poll Edited State"}); function getpoll_edited() { return poll_edited; } +getpoll_edited.local = 1; + function setpoll_edited(v){ poll_edited = v == 0 ? 0 : Math.max(0.1, Math.abs(v)); if (poll_edited > 0) { @@ -2312,6 +2431,7 @@ function setpoll_edited(v){ cancel_edited_poll_task(); } } +setpoll_edited.local = 1; function run_edited_poll_task() { if (poll_edited_task.valid && !poll_edited_task.running && poll_edited > 0 && active_slot > 0) { @@ -2337,6 +2457,8 @@ declareattribute("edited_color", "getedited_color", "setedited_color", 1, {style function getedited_color() { return edited_color; } +getedited_color.local = 1; + function setedited_color(){ if (arguments.length == 4) { edited_color = [arguments[0], arguments[1], arguments[2], arguments[3]]; @@ -2346,6 +2468,7 @@ function setedited_color(){ error('edited_color: wrong number of arguments\n'); } } +setedited_color.local = 1; function edited(v) { active_slot_edited = v; @@ -2359,11 +2482,14 @@ declareattribute("nbslot_edit", "getnbslot_edit", "setnbslot_edit", 1, {style: " function getnbslot_edit() { return nbslot_edit; } +getnbslot_edit.local = 1; + function setnbslot_edit(v){ nbslot_edit = v > 0; y_offset = 0; calc_rows_columns(); } +setnbslot_edit.local = 1; // UTILITY function post_keys(obj) {