Thursday, August 06, 2020

Power Thursday, Copy and Paste

A full 'power day' of work today, I must have copied and pasted 10,000 items. I started by updating the ICON types in Prometheus. These are numbers at the moment 0 to 24, but the program would be easier to manage and update if these were defines. Here is the list I started with:

#define ICONTYPE_INACTIVE 0
#define ICONTYPE_NORMAL3x1 1
#define ICONTYPE_NORMAL12x1 2
#define ICONTYPE_ENGINE 3
#define ICONTYPE_CYCLE 4
#define ICONTYPE_TOGGLEOFF 5
#define ICONTYPE_TOGGLEON 6
#define ICONTYPE_ARROWUP 7
#define ICONTYPE_ARROWRIGHT 8
#define ICONTYPE_ARROWDOWN 9
#define ICONTYPE_ARROWLEFT 10
#define ICONTYPE_NOUNITS 11
#define ICONTYPE_UNITSSECS 12
#define ICONTYPE_UNITSMILLISECS 13
#define ICONTYPE_UNITSMEASURES 14
#define ICONTYPE_UNITSBEATS 15
#define ICONTYPE_UNITSTICKS 16
#define ICONTYPE_MUTEREDON 17
#define ICONTYPE_MUTEREDOFF 18
#define ICONTYPE_MUTEPHRASE 19
#define ICONTYPE_MUTEGREENON 20
#define ICONTYPE_MUTEGREENOFF 21
#define ICONTYPE_REDDOTOFF 22
#define ICONTYPE_REDDOTON 23
#define ICONTYPE_MUTEGUIDE 24

These items had to replace each occurrence of the numbers, about 200 or so in the code, at least one per icon, but often more because some were programmatically swapped (ICONTYPE_TOGGLEOFF may become ICONTYPE_TOGGLEON when an icon is 'lit'). The code before would use things like type=5+(value) but now I have to check the value and assign ICONTYPE_TOGGLEOFF or ICONTYPE_TOGGLEON by word; this makes it easier to change the actual numbers around, delete unused icons etc. Doing all of this took an hour or so, it has to be rather meticulous because one mistake would cause an error somewhere. Then I did the same for LABEL types, ICON contents (text, numbers etc.) LABEL contents, and TEXT BOX contents.

Then I updated the main program skin, making that more efficient and recoding the locations of the icons there, then a new skin for the labels (which is largely graphics), new track names, and finally retyping all of the menu codes, a list of 650 numbers which over the years had become messy, so I re-ordered them in neat groups. All of this took until 3pm, and after all of this cleaning, the program ironically worked exactly as it did before, yet hopefully easier to edit in future.

These changes are down to my current programming of Argus. It shows the power of two projects; one can push another on.

Then I worked on the forthcoming Chinese translation of 21st Century Surrealism, finding, copying and pasting each of the paragraphs. This took 3 hours, and also involved updating the main index.

An exhausting day, but then a welcome walk in the very sultry park. The air feels viscous, too warm, like a salt bath.