mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 21:14:31 -04:00
feat(tracker): add ability to copy, cut and paste units
This commit is contained in:
parent
338529012a
commit
5a2e87982e
@ -67,6 +67,15 @@ type Tracker struct {
|
||||
}
|
||||
|
||||
func (t *Tracker) UnmarshalContent(bytes []byte) error {
|
||||
var unit sointu.Unit
|
||||
if errJSON := json.Unmarshal(bytes, &unit); errJSON == nil {
|
||||
t.PasteUnit(unit)
|
||||
return nil
|
||||
}
|
||||
if errYaml := yaml.Unmarshal(bytes, &unit); errYaml == nil {
|
||||
t.PasteUnit(unit)
|
||||
return nil
|
||||
}
|
||||
var instr sointu.Instrument
|
||||
if errJSON := json.Unmarshal(bytes, &instr); errJSON == nil {
|
||||
if t.SetInstrument(instr) {
|
||||
|
Reference in New Issue
Block a user