Commit c94655ca authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

Merge branch 'port-pianoroll'

parents 88c2fa48 fc90dee3
......@@ -572,8 +572,14 @@ static void scope_displace(t_gobj *z, t_glist *glist, int dx, int dy)
if (glist_isvisible(glist))
{
t_canvas *cv = scope_getcanvas(x, glist);
//sys_vgui(".x%x.c move %s %d %d\n", cv, x->x_tag, dx, dy);
//canvas_fixlinesfor(cv, t);
//sys_vgui(".x%x.c move %s %d %d\n", cv, x->x_tag, dx, dy)
gui_vmess("gui_text_displace", "xxii",
cv,
x,
dx,
dy
);
canvas_fixlinesfor(cv, t);
}
}
......
......@@ -450,6 +450,12 @@ static void grid_displace(t_gobj *z, t_glist *glist, int dx, int dy)
x->y_current += dy;
if (xold != text_xpix(&x->x_obj, glist) || yold != text_ypix(&x->x_obj, glist))
{
gui_vmess("gui_text_displace", "xxii",
glist_getcanvas(glist),
x,
dx,
dy
);
//grid_draw_move(x, x->x_glist);
canvas_fixlinesfor(glist, (t_text *)z);
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -2630,9 +2630,11 @@ function elem_get_coords(elem) {
}
}
// used for tidy up
// used for tidy up and GUI external displacefn callbacks
function gui_text_displace(name, tag, dx, dy) {
elem_displace(get_gobj(name, tag), dx, dy);
gui(name).get_gobj(tag, function(e) {
elem_displace(e, dx, dy);
});
}
function textentry_displace(t, dx, dy) {
......@@ -4231,7 +4233,6 @@ function gui_grid_new(cid, tag, x, y, is_toplevel) {
});
}
function gui_grid_point(cid, tag, x, y) {
gui(cid).get_gobj(tag)
.q(".point", {
......@@ -4241,6 +4242,47 @@ function gui_grid_point(cid, tag, x, y) {
});
}
// unauthorized/pianoroll
function pianoroll_get_id(tag, type, i, j) {
// Because i and j are just integers we want to prevent ambiguity.
// For example, "1" and "23" concatenate the same as "12" and "3". So
// we separate the two with an underscore.
return tag + "_" + type + "_" + i + "_" + j;
}
function gui_pianoroll_draw_rect(cid, tag, x1, y1, x2, y2, i, j, type) {
gui(cid).get_gobj(tag)
.append(function(frag) {
var r = create_item(cid, "rect", {
x: x1,
y: y1,
width: x2 - x1,
height: y2 - y1,
id: pianoroll_get_id(tag, type, i, j),
fill: type === "pitch" ? "#771623" : "#562663",
stroke: "#998121",
"stroke-width": "1"
});
frag.appendChild(r);
return frag;
});
}
// consider doing a single call with an array of data here...
function gui_pianoroll_update_rect(cid, tag, type, i, j, fill) {
gui(cid)
.get_elem(pianoroll_get_id(tag, type, i, j), {
fill: fill
});
}
// just clear out everything inside the container
function gui_pianoroll_erase_innards(cid, tag) {
gui(cid).get_gobj(tag, function(e) {
e.innerHTML = "";
});
}
// mknob from moonlib
function gui_mknob_new(cid, tag, x, y, is_toplevel, show_in, show_out,
is_footils_knob) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment