smoosic
Version:
<sub>[Github site](https://github.com/Smoosic/smoosic) | [source documentation](https://smoosic.github.io/Smoosic/release/docs/modules.html) | [change notes](https://aarondavidnewman.github.io/Smoosic/changes.html) | [application](https://smoosic.github.i
62 lines (59 loc) • 1.42 kB
text/typescript
import { SmoDynamicText } from '../../smo/data/noteModifiers';
import { SuiMenuBase, SuiMenuParams, MenuDefinition } from './menu';
declare var $: any;
/**
* @category SuiMenu
*/
export class SuiDynamicsMenu extends SuiMenuBase {
constructor(params: SuiMenuParams) {
super(params);
}
static defaults: MenuDefinition = {
label: 'Dynamics',
menuItems: [{
icon: 'pianissimo',
text: 'Pianissimo',
value: 'pp'
}, {
icon: 'piano',
text: 'Piano',
value: 'p'
}, {
icon: 'mezzopiano',
text: 'Mezzo-piano',
value: 'mp'
}, {
icon: 'mezzoforte',
text: 'Mezzo-forte',
value: 'mf'
}, {
icon: 'forte',
text: 'Forte',
value: 'f'
}, {
icon: 'fortissimo',
text: 'Fortissimo',
value: 'ff'
}, {
icon: 'sfz',
text: 'sfortzando',
value: 'sfz'
}, {
icon: '',
text: 'Cancel',
value: 'cancel'
}]
};
getDefinition() {
return SuiDynamicsMenu.defaults;
}
async selection(ev: any) {
const text: string = $(ev.currentTarget).attr('data-value');
const props = SmoDynamicText.defaults;
props.text = text;
const dynamic = new SmoDynamicText(props);
await this.view.addDynamic(this.tracker.selections[0], dynamic);
this.complete();
}
keydown() { }
}