Compare commits
11
Commits
v1.5.0
..
ad7c925f6b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad7c925f6b | ||
|
|
9c762b8cb5 | ||
|
|
40890b3d93 | ||
|
|
eb0cd8ecad | ||
|
|
b495823333 | ||
|
|
f537e3a583 | ||
|
|
7721cd7322 | ||
|
|
6ee2ad8e9a | ||
|
|
15fece4b80 | ||
|
|
0d03fb4979 | ||
|
|
eb89d37a7c |
+29
-21
@@ -56,7 +56,7 @@ var stored_slot_color = max.getcolor("theme_accentcolor"); //[0.502, 0.502, 0.50
|
||||
var interp_slot_color = [1.0, 1.0, 1.0, 0.8];
|
||||
var border_color = [1.0, 1.0, 1.0, 0.85];
|
||||
var text_color = max.getcolor("theme_textcolor"); //[0.129, 0.129, 0.129, 1];
|
||||
var text_bg_color = set_text_bg_color();
|
||||
var text_bg_color; set_text_bg_color();
|
||||
var edited_color = [1, 0.49, 0.263, 1];
|
||||
|
||||
var color_1 = [0.743, 0.41, 0.501, 1]; // Color set for the filled slots. I don't like how this is declared. More info in color_wheel() declaration
|
||||
@@ -95,6 +95,7 @@ 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 is_jsui = this.box.maxclass === "jsui";
|
||||
var pattrstorage_name = null;
|
||||
var pattrstorage_obj = null;
|
||||
|
||||
@@ -134,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
|
||||
@@ -228,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);
|
||||
@@ -244,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();
|
||||
@@ -305,7 +312,7 @@ function calc_rows_columns(src) {
|
||||
}
|
||||
|
||||
// Preventing useless redraws when resizing
|
||||
if (src === "resize" && previous_rows === rows && previous_columns === columns) return false;
|
||||
if (src === "resize" && layout === 0 && previous_rows === rows && previous_columns === columns) return false;
|
||||
|
||||
true_slots_count_display = columns * rows - minus_slots_carry;
|
||||
slots_count_display = scrollable && nbslot_edit ? true_slots_count_display - 2 : true_slots_count_display;
|
||||
@@ -495,12 +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]);
|
||||
} else {
|
||||
return
|
||||
}
|
||||
// post("redraw\n");
|
||||
mgraphics.select_font_face(font_name);
|
||||
mgraphics.set_font_size(font_size);
|
||||
mgraphics.translate(0, y_offset);
|
||||
@@ -557,7 +565,6 @@ function paint()
|
||||
|
||||
// Interpolated slots
|
||||
if (is_dragging !== 1 && display_interp && is_interpolating) {
|
||||
|
||||
for (var i = 1; i <= slots_count_display; i++) {
|
||||
var slot = slots[i];
|
||||
var interp = slot.interp;
|
||||
@@ -740,7 +747,7 @@ function paint()
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
paint.local = 0;
|
||||
|
||||
@@ -1024,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();
|
||||
@@ -1035,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);
|
||||
}
|
||||
@@ -1483,7 +1486,6 @@ function resync() {
|
||||
to_pattrstorage("getslotlist");
|
||||
to_pattrstorage("getlockedslots");
|
||||
calc_rows_columns();
|
||||
|
||||
}
|
||||
|
||||
function find_pattrstorage(name) {
|
||||
@@ -1932,11 +1934,11 @@ ondblclick.local = 1;
|
||||
function ondrag(x,y,but,cmd,shift,capslock,option,ctrl)
|
||||
{
|
||||
if (pattrstorage_name != null) {
|
||||
y -= y_offset;
|
||||
if (is_dragging === 0 && !but) {
|
||||
// Triggering onclick() interactions when click releases if no drag happened
|
||||
onclick(x, y, 0, cmd, shift, capslock, option, ctrl);
|
||||
}
|
||||
y -= y_offset;
|
||||
if (drag_mode > 0 && !cmd && !shift && !ctrl) {
|
||||
switch (is_dragging) {
|
||||
case 0: // Not dragging yet
|
||||
@@ -2074,7 +2076,7 @@ function ondrag(x,y,but,cmd,shift,capslock,option,ctrl)
|
||||
if (!but) {
|
||||
// When the click releases, we force onidle() to compute currently hovered slot
|
||||
last_x += 1;
|
||||
onidle(x, y, but, cmd, shift, capslock, option, ctrl);
|
||||
onidle(x, y + y_offset, but, cmd, shift, capslock, option, ctrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2109,12 +2111,15 @@ 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())
|
||||
// Allows for dynamic resizing even in presentation mode (addressing the limitation of onresize() in jsui)
|
||||
if (is_jsui) {
|
||||
var pres_rect = new MaxobjListener(this.box,"presentation_rect",get_prect);
|
||||
}
|
||||
function get_prect(prect) {
|
||||
// post(this.patcher.wind.assoc.getattr("globalpatchername") == max.frontpatcher.wind.assoc.getattr("globalpatchername") ? 1 : 0, "\n")
|
||||
onresize(prect.value[2], prect.value[3])
|
||||
onresize(prect.value[2], prect.value[3], "from_maxobjlistener");
|
||||
}
|
||||
get_prect.local = 1;
|
||||
|
||||
@@ -2148,6 +2153,9 @@ function setpattrstorage(v){
|
||||
} else {
|
||||
pattrstorage_name = arrayfromargs(arguments)[0];
|
||||
}
|
||||
if (has_loaded) {
|
||||
do_loadbang();
|
||||
}
|
||||
}
|
||||
setpattrstorage.local = 1;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name" : "tc.preset",
|
||||
"displayname" : "",
|
||||
"version" : "1.5.0",
|
||||
"version" : "1.5.4",
|
||||
"author" : "Théophile Clet",
|
||||
"authors" : [ ],
|
||||
"description" : "A jsui replacement for the preset object",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name" : "tc.preset",
|
||||
"displayname" : "",
|
||||
"version" : "1.5.0",
|
||||
"version" : "1.5.4",
|
||||
"author" : "Théophile Clet",
|
||||
"authors" : [ ],
|
||||
"description" : "A v8ui replacement for the preset object",
|
||||
|
||||
Reference in New Issue
Block a user