5 Commits

3 changed files with 19 additions and 16 deletions

View File

@@ -135,7 +135,6 @@ var option_hold = 0;
var control_hold = 0;
var cmd_hold = 0;
var modifier = null; // null lock rename delete store drag_swap
var is_updating_names = 0;
var is_interpolating = 0;
var is_moving = 0;
var is_dragging = 0; // Drag flag
@@ -229,6 +228,13 @@ function slot(left, top, right, bottom) {
slot.local = 1;
function loadbang() {
// If running in a M4L device, for some reason loadbang needs to be delayed in order to properly get presets stored in Live set
// So we bypass the initial loadbang, and we rely on init_tsk instead
if (max.isplugin) return;
do_loadbang();
}
function do_loadbang() {
// post("loadbang\n");
has_loaded = true;
this.box.setboxattr('border', 0);
@@ -245,7 +251,7 @@ init_tsk.schedule(200);
function delayed_init() {
if (!has_loaded) {
loadbang();
do_loadbang();
}
if (arguments.callee.task.valid) {
arguments.callee.task.freepeer();
@@ -496,14 +502,13 @@ paint_base.local = 1;
function paint()
{
// post("redraw\n");
// Handling Presentation mode enable/disable
// Handling Presentation mode enable/disable in jsui
var cur_size = mgraphics.size;
if (cur_size[0] != ui_width || cur_size[1] != ui_height) {
onresize(cur_size[0], cur_size[1]);
return
}
// post("redraw\n");
mgraphics.select_font_face(font_name);
mgraphics.set_font_size(font_size);
mgraphics.translate(0, y_offset);
@@ -1026,7 +1031,6 @@ function slotlist() {
for (var i = 0; i < filled_slots.length; i++) {
slots[filled_slots[i]].filled = true;
}
is_updating_names = 1;
to_pattrstorage("getslotnamelist");
get_all_presets_metadata();
update_filled_slots_dict();
@@ -1037,12 +1041,9 @@ function slotname() {
var args = arrayfromargs(arguments);
var slot = args[0];
var name = args[1];
if (slot == 'done') {
is_updating_names = 0;
return;
}
if (slot > 0 && name != "(undefined)") {
if (is_updating_names == 1 && slots[slot].filled === false && name !== "<(unnamed)>") {
if (slot === 'done') return;
if (slot > 0 && name !== "(undefined)") {
if (slots[slot].filled === false && name !== "<(unnamed)>") {
// Removing parenthesis automatically added by pattrstorage if the preset has a name but isn't filled
name = name.slice(1, -1);
}
@@ -1485,7 +1486,6 @@ function resync() {
to_pattrstorage("getslotlist");
to_pattrstorage("getlockedslots");
calc_rows_columns();
}
function find_pattrstorage(name) {
@@ -1501,7 +1501,6 @@ function find_pattrstorage(name) {
if (pattrstorage_obj != null) {
pattrstorage_name = name;
filled_slots_dict.name = pattrstorage_name + '_presets_dict';
slots_clear();
// 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();
@@ -2111,6 +2110,7 @@ onresize.local = 1;
// in which case we resize it to a more convenient size to start with.
if (ui_width == 64 && ui_height == 64) {
box.setboxattr("patching_rect", box.rect[0], box.rect[1], 130, 58);
box.setboxattr("presentation_rect", box.rect[0], box.rect[1], 130, 58);
}
// Allows for dynamic resizing even in presentation mode (addressing the limitation of onresize() in jsui)
if (is_jsui) {
@@ -2152,6 +2152,9 @@ function setpattrstorage(v){
} else {
pattrstorage_name = arrayfromargs(arguments)[0];
}
if (has_loaded) {
do_loadbang();
}
}
setpattrstorage.local = 1;

View File

@@ -1,7 +1,7 @@
{
"name" : "tc.preset",
"displayname" : "",
"version" : "1.5.1",
"version" : "1.5.2",
"author" : "Théophile Clet",
"authors" : [ ],
"description" : "A jsui replacement for the preset object",

View File

@@ -1,7 +1,7 @@
{
"name" : "tc.preset",
"displayname" : "",
"version" : "1.5.1",
"version" : "1.5.2",
"author" : "Théophile Clet",
"authors" : [ ],
"description" : "A v8ui replacement for the preset object",