Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
drawingControlsElem.appendChild(clearbuttonElem);
let clearbutton = new Nexus.TextButton('#clear-button',{
'size': [150,50],
'state': false,
'text': 'Clear all'
});
clearbutton.textElement.style.fontSize = '16px';
clearbutton.on('change', (event) => { if (clearbutton.state) {canvas.clear().renderAll()}});
let sendbuttonElem: HTMLElement = document.createElement("div");
sendbuttonElem.id = 'send-button';
drawingControlsElem.appendChild(sendbuttonElem);
let sendbutton = new Nexus.TextButton('#send-button',{
'size': [150,50],
'state': false,
'text': 'Send'
});
sendbutton.on('change', (e) => {if (sendbutton.state) {send_callback();}});
sendbutton.textElement.style.fontSize = '16px';
// var canvasElem2: HTMLCanvasElement = document.createElement("canvas");
// canvasElem2.id = 'c2';
// canvasElem2.height = 220;
// canvasElem2.width = time_step * maximum_sixteenth_notes;
// document.body.appendChild(canvasElem2);
// canvas2 = new fabric.Canvas('c2', { selection: false });
// Initialize_edition_mode();
m.shapes().arm.attr("stroke", "#EEE");
bpmSliderRecord.on('change', function(value){
m.stop();
if (record_button.state) {
m.start(value, 10000);
}
});
let startRecord = document.createElement('div')
startRecord.id = 'startRecord';
startRecord.style.position = 'absolute';
startRecord.style.top = '0px';
metronome_container.appendChild(startRecord);
let record_button = new Nexus.TextButton('#startRecord',{
'size': [150,50],
'state': false,
'text': 'Start recording',
'alternateText': 'Stop recording'
});
record_button.textElement.style.fontSize = '17px';
record_button.on('change', (e) => { if (record_button.state) {
startRecording();
m.start(bpmSliderRecord.value, 10000);
}
else {
m.stop();
var _AudioFormat = "audio/wav";
stopRecording( function(AudioBLOB) {
// callback for exportWAV
// Default mode : free drawing mode
Initialize_free_mode();
let drawingControlsElem: HTMLDivElement = document.createElement('div');
drawingControlsElem.id = 'drawing-controls';
drawingControlsElem.style.display = 'grid';
drawingControlsElem.style.gridTemplateColumns = 'repeat(5, 2fr)';
drawingControlsElem.style.width = '50%';
document.body.appendChild(drawingControlsElem);
let selectCompoModebuttonElem: HTMLElement = document.createElement("div");
selectCompoModebuttonElem.id = 'select-compo-mode-button';
drawingControlsElem.appendChild(selectCompoModebuttonElem);
let selectCompoModebutton = new Nexus.TextButton('#select-compo-mode-button',{
'size': [200,50],
'state': false,
'text': 'Composition mode : Edit',
'alternateText' : 'Composition mode : Modify'
});
selectCompoModebutton.textElement.style.fontSize = '16px';
selectCompoModebutton.on('change', (event) => { if (selectCompoModebutton.state) {Initialize_modif_mode(composition_mode);}
else {if (selectDrawingModebutton.state) {Initialize_linear_mode();}
else {Initialize_free_mode();}}
});
let selectDrawingModebuttonElem: HTMLElement = document.createElement("div");
selectDrawingModebuttonElem.id = 'select-mode-button';
drawingControlsElem.appendChild(selectDrawingModebuttonElem);
'text': 'Drawing mode : Linear',
'alternateText' : 'Drawing mode : Free'
});
selectDrawingModebutton.textElement.style.fontSize = '16px';
selectDrawingModebutton.on('change', (event) => { if (selectDrawingModebutton.state) {canvas.clear().renderAll();
Initialize_linear_mode();}
else {canvas.clear().renderAll();
Initialize_free_mode();}
});
let clearbuttonElem: HTMLElement = document.createElement("div");
clearbuttonElem.id = 'clear-button';
drawingControlsElem.appendChild(clearbuttonElem);
let clearbutton = new Nexus.TextButton('#clear-button',{
'size': [150,50],
'state': false,
'text': 'Clear all'
});
clearbutton.textElement.style.fontSize = '16px';
clearbutton.on('change', (event) => { if (clearbutton.state) {canvas.clear().renderAll()}});
let sendbuttonElem: HTMLElement = document.createElement("div");
sendbuttonElem.id = 'send-button';
drawingControlsElem.appendChild(sendbuttonElem);
let sendbutton = new Nexus.TextButton('#send-button',{
'size': [150,50],
'state': false,
'text': 'Send'
let soprano_locked = document.createElement('div');
soprano_locked.id = 'soprano_locked';
voiceBar.appendChild(soprano_locked);
var soprano_button = new Nexus.TextButton('#soprano_locked',{
'size': [60, 40],
'state': false,
'text': 'Lock',
'alternateText': 'Unlock'
});
set_font_size(soprano_button, '12px');
let alto_locked = document.createElement('div')
alto_locked.id = 'alto_locked';
voiceBar.appendChild(alto_locked);
var alto_button = new Nexus.TextButton('#alto_locked',{
'size': [60, 40],
'state': false,
'text': 'Lock',
'alternateText': 'Unlock'
});
set_font_size(alto_button, '12px');
let tenor_locked = document.createElement('div')
tenor_locked.id = 'tenor_locked';
voiceBar.appendChild(tenor_locked);
var tenor_button = new Nexus.TextButton('#tenor_locked',{
'size': [60, 40],
'state': false,
'text': 'Lock',
'alternateText': 'Unlock'
});
'state': false,
'text': 'Composition mode : Edit',
'alternateText' : 'Composition mode : Modify'
});
selectCompoModebutton.textElement.style.fontSize = '16px';
selectCompoModebutton.on('change', (event) => { if (selectCompoModebutton.state) {Initialize_modif_mode(composition_mode);}
else {if (selectDrawingModebutton.state) {Initialize_linear_mode();}
else {Initialize_free_mode();}}
});
let selectDrawingModebuttonElem: HTMLElement = document.createElement("div");
selectDrawingModebuttonElem.id = 'select-mode-button';
drawingControlsElem.appendChild(selectDrawingModebuttonElem);
let selectDrawingModebutton = new Nexus.TextButton('#select-mode-button',{
'size': [200,50],
'state': false,
'text': 'Drawing mode : Linear',
'alternateText' : 'Drawing mode : Free'
});
selectDrawingModebutton.textElement.style.fontSize = '16px';
selectDrawingModebutton.on('change', (event) => { if (selectDrawingModebutton.state) {canvas.clear().renderAll();
Initialize_linear_mode();}
else {canvas.clear().renderAll();
Initialize_free_mode();}
});
let clearbuttonElem: HTMLElement = document.createElement("div");
clearbuttonElem.id = 'clear-button';
drawingControlsElem.appendChild(clearbuttonElem);
let alto_locked = document.createElement('div')
alto_locked.id = 'alto_locked';
voiceBar.appendChild(alto_locked);
var alto_button = new Nexus.TextButton('#alto_locked',{
'size': [60, 40],
'state': false,
'text': 'Lock',
'alternateText': 'Unlock'
});
set_font_size(alto_button, '12px');
let tenor_locked = document.createElement('div')
tenor_locked.id = 'tenor_locked';
voiceBar.appendChild(tenor_locked);
var tenor_button = new Nexus.TextButton('#tenor_locked',{
'size': [60, 40],
'state': false,
'text': 'Lock',
'alternateText': 'Unlock'
});
set_font_size(tenor_button, '12px');
let bass_locked = document.createElement('div')
bass_locked.id = 'bass_locked';
voiceBar.appendChild(bass_locked);
var bass_button = new Nexus.TextButton('#bass_locked',{
'size': [60, 40],
'state': false,
'text': 'Lock',
'alternateText': 'Unlock'
})
let tenor_locked = document.createElement('div')
tenor_locked.id = 'tenor_locked';
voiceBar.appendChild(tenor_locked);
var tenor_button = new Nexus.TextButton('#tenor_locked',{
'size': [60, 40],
'state': false,
'text': 'Lock',
'alternateText': 'Unlock'
});
set_font_size(tenor_button, '12px');
let bass_locked = document.createElement('div')
bass_locked.id = 'bass_locked';
voiceBar.appendChild(bass_locked);
var bass_button = new Nexus.TextButton('#bass_locked',{
'size': [60, 40],
'state': false,
'text': 'Lock',
'alternateText': 'Unlock'
})
set_font_size(bass_button, '12px');
function get_locked_voices() {
UrlTimerangeChange = 'timerange-change' +
`?sopranoLocked=${soprano_button.state}` +
`&altoLocked=${alto_button.state}` +
`&tenorLocked=${tenor_button.state}` +
`&bassLocked=${bass_button.state}`;
};
get_locked_voices();
export function make_voices_lockets() {
let voiceBar: HTMLDivElement = document.createElement('div')
voiceBar.id = 'voice-controls';
document.body.appendChild(voiceBar);
let no_voice_locked = document.createElement('div')
no_voice_locked.id = 'no_voice_locked';
voiceBar.appendChild(no_voice_locked);
var no_voice_button = new Nexus.TextButton('#no_voice_locked',{
'size': [60, 40],
'state': false,
'text': 'Unlock all'
});
set_font_size(no_voice_button, '12px');
let soprano_locked = document.createElement('div');
soprano_locked.id = 'soprano_locked';
voiceBar.appendChild(soprano_locked);
var soprano_button = new Nexus.TextButton('#soprano_locked',{
'size': [60, 40],
'state': false,
'text': 'Lock',
'alternateText': 'Unlock'
});
set_font_size(soprano_button, '12px');
document.body.appendChild(voiceBar);
let no_voice_locked = document.createElement('div')
no_voice_locked.id = 'no_voice_locked';
voiceBar.appendChild(no_voice_locked);
var no_voice_button = new Nexus.TextButton('#no_voice_locked',{
'size': [60, 40],
'state': false,
'text': 'Unlock all'
});
set_font_size(no_voice_button, '12px');
let soprano_locked = document.createElement('div');
soprano_locked.id = 'soprano_locked';
voiceBar.appendChild(soprano_locked);
var soprano_button = new Nexus.TextButton('#soprano_locked',{
'size': [60, 40],
'state': false,
'text': 'Lock',
'alternateText': 'Unlock'
});
set_font_size(soprano_button, '12px');
let alto_locked = document.createElement('div')
alto_locked.id = 'alto_locked';
voiceBar.appendChild(alto_locked);
var alto_button = new Nexus.TextButton('#alto_locked',{
'size': [60, 40],
'state': false,
'text': 'Lock',
'alternateText': 'Unlock'
});