SYNTHINGS is a digital synthesizer development platform that I've been building.

Tune editor (part 3)

jason | 16 January, 2011 23:35

I got a little distracted today with car stuff, so I didn't do as much work as I wanted. However, I did create a generic interface for selecting a variable amount of objects.

There's a number of UI elements which do roughly the same work - selecting a file from the file system, selecting a sample, and I added selecting a pattern. When I'd just finished the pattern code, I decided that these three need to be merged into one.

Since the pattern selection code was the only one that scrolled properly, I decided to use that as a basis. I extended it to allow me to select how many lines you want to have, and you pass in function pointers for drawing the line, and another one for selection changes (so any meta-data could be updated).

This is what the pattern selector looks like:

Tune editor part 2

And scrolled down:

Tune editor part 3

And the sample selector now looks like this:

Tune editor part 3

I'll add in the sample's length in the selection bar, and also a scrollbar. I ran out of time today to do the file selection, but I'll do that tomorrow.

Although I'd removed the sample selection code, the amount of code added for the generic selection was larger (the sample selection code didn't need to worry about scrolling).

Program Memory  [Origin = 0x200, Length = 0x2aa00]

section                    address   length (PC units)   length (bytes) (dec)
-------                    -------   -----------------   --------------------
.text                        0x200              0x1376          0x1d31  (7473)
.const                      0x1576              0x26fa          0x3a77  (14967)
.text                       0x3c70              0xc822         0x12c33  (76851)
.dinit                     0x10492               0x252           0x37b  (891)
.text                      0x106e4               0xe10          0x1518  (5400)
.isr                       0x114f4                 0x2             0x3  (3)

                     Total program memory used (bytes):        0x19c71  (105585) 40%

Data Memory  [Origin = 0x800, Length = 0x7800]

section                    address      alignment gaps    total length  (dec)
-------                    -------      --------------    -------------------
.nbss                        0x800                   0           0x9ea  (2538)
.ndata                      0x11ea                   0             0x2  (2)
_03774ee04d2cd01c           0x11ec                   0           0x200  (512)
_037770704d2cd01c           0x13ec                   0           0x200  (512)
.nbss                       0x15ec                   0           0x314  (788)
.ndata                      0x1900                   0            0x86  (134)
.nbss                       0x1986                   0            0xc2  (194)
.ndata                      0x1a48                   0            0x20  (32)
.nbss                       0x1a68                   0            0x18  (24)
.ndata                      0x1a80                   0            0x24  (36)
.nbss                       0x1aa4                   0            0x2a  (42)
.ndata                      0x1ace                   0             0x8  (8)
.nbss                       0x1ad6                   0            0x1a  (26)
.ndata                      0x1af0                   0             0x2  (2)
.nbss                       0x1af2                   0             0x4  (4)
.ndata                      0x1af6                   0             0x4  (4)
.nbss                       0x1afa                   0             0x2  (2)
.ndata                      0x1afc                   0             0x2  (2)
.data                       0x1afe                   0           0x106  (262)
.dconst                     0x1c04                   0             0x8  (8)
.data                       0x1c0c                   0             0xa  (10)
.bss                        0x1c16                   0             0x4  (4)
.data                       0x1c1a                   0             0x2  (2)
.heap                       0x1c1c                   0          0x2000  (8192)

                        Total data memory used (bytes):         0x341c  (13340) 43%

Dynamic Memory Usage

region                     address                      maximum length  (dec)
------                     -------                      ---------------------
heap                        0x1c1c                              0x2000  (8192)
stack                       0x3c1c                              0x43e4  (17380)

                        Maximum dynamic memory (bytes):         0x63e4  (25572)

Note that before I did the refactoring, the code size was over 106,000 bytes, so I have saved some.

Powered by LifeType - Design by BalearWeb and Jason Tribbeck
Copyright © 2010 | | Jason Tribbeck
All trademarks are the property of their respective owners