A somewhat gotcha: when unmarshaling into &m.d with json.Unmarshal
or yaml.Unmarshal, maps were "merged" with the existing maps, which
is how we ended up with send units with color parameters, among
other things. This fix always unmarshals into fresh var data
modelData and only then sets m.d = data if the unmarshaling was
succesful.
In addition to the oscilloscope and loudness/peak detections, this
commit refactors all the channels between components (i.e.
ModelMessages and PlayerMessages) etc. into a new class Broker. This
was done because now we have one more goroutine running: a Detector,
where the loudness / true peak detection is done in another thread.
The different threads/components are only aware of the Broker and
communicate through it. Currently, it's just a collection of
channels, so it's many-to-one communication, but in the future,
we could change Broker to have many-to-one-to-many communication.
Related to #61
Also includes a refactoring of the List: all methods that accepted
or returned a [from, to] range now return a Range, which is
non-inclusive i.e. [start,end).
Also the assignUnitIds was slightly refactored & a new function
called assignUnitIdsForPatch was added, to assign all unit IDs for
an patch at once.
Closes#157, #163.
Notetracking was used in two completely different meanings: the
pitch/bpm notetracking in the delay unit and the cursor follow in
when playing. The word for the second meaning was changed to Follow,
to avoid confusion.
The Model was getting unmaintanable mess. This is an attempt to refactor/rewrite the Model so that data of certain type is exposed in standardized way, offering certain standard manipulations for that data type, and on the GUI side, certain standard widgets to tied to that data.
This rewrite closes#72, #106 and #120.
The modelData is moving towards clear meaning: it's the part of the
GUI state that is undone and also recovered from disk. This changes
the recovery data so that the undo and redo stacks are not undone,
but that is unlikely a good idea anyway, as it grows the recovery
data into unreasonable sizes.
This has also the nice benefit of undoing the cursor position, which
closes#64.
The yaml marshaling and umarshaling seems to allocate a lot of memory. When saving the recovery file, the memory use jumped up by hundreds of megabytes. Switch to using json marshaling for the recovery file, as it does waste memory so badly. Binary marshaling was also an option, but its nice in emergency situations that the user can glance the recovery file and perhaps, with some effort, recover stuff from it. Json is good enough for manual recovery during emergency situations.
The options are stereo, left and right. Similar to oscillator sample settings, if you tamper with these, it starts to show "custom". Used some of the generic features of go1.18, so had to update go.mod to require go1.18.
The RPC and sync library mechanisms were removed for now; they never really worked and contained several obvious bugs. Need to consider if syncs are useful at all during the compose time, or just used during intro.