Open mpogue2 opened 1 year ago
Commit 5dfa9ba0be4e844818287d595386dab89da01a36: I think I've figured out a better model for editing and playback, after prototyping some UX alternatives. It's different from the "Sequence Designer vs Dance Arranger" model that I have in there now. Instead, it's a lot more like the "Lyrics Editor vs Lyrics Viewer" model that we have for cuesheets. That is, initially we can VIEW a sequence. Clicking on EDIT/UNLOCK allows us to edit that sequence, and also MOVE/COPY TO , which then takes us back to VIEW mode.
If this works out, I'll get rid of the Sequence Designer/Dance Arranger distinction, and there will be only a single SD window that looks like the current Dance Arranger. Bouncing back and forth between them will now be done within the Dance Arranger, just by entering and exiting EDIT mode. The Menu options will still be there, to allow viewing/hiding various of the UX widgets.
It's slightly different from Lyrics in this way:
That does suggest that we should extend the Lyrics model to include a NEW button as well. It does feel pretty natural to me when making New Sequences to click on NEW in the Current Sequence pane (which is loaded with one of the frames), so it's probably useful to make New Cuesheets (perhaps with a context menu with a couple of options: Single column, and Double Column).
Example of editing a new C1 sequence:
Current initial view, showing NEW and UNLOCK buttons:
Current editing view after UNLOCK was clicked, showing SAVE... button:
and SAVE options:
Commit c17733d588c1d31c04cfd817808da1ae8d836591 turns off some debug input, in case anybody is using this code in the field. Debug input causes writes to debug.log, which sometimes slows things down a bit, so the default is "commented out" for all qDebug() statements.
TODO: Allow typing in an AUTHOR into preferences, so that #AUTHOR=
Here's a screenshot of 2019 CSDS:
I do like the |< and >| buttons to go to the beginning or end of a frame. Could also use SHIFT-F11 and SHIFT-F12 for those functions. Probably need a right-click context menu to make these discoverable, or something in the main SD menu (or both).
BUG: Single letter key shortcuts, like "L" are broken right now. Cmd-L works I think, but L does not. (FIXED: 21234e2d84b3a92914f6587a3ccd607a2db6f47a)
FEATURE: keyboard shortcut to swap HEADS and SIDES everywhere in the sequence (useful for those sequences where HEAD/SIDE are used in other than the first line. CSDS seems to discourage using such sequences, but I can see where something like this might come in handy.
TODO: Need a way to create a new frame (e.g. "local.ssd.easy" etc). Not sure if we need this right now, though, since just creating a file in the sd directory will create that new frame (once we've implemented scanning the sd directory for frames -- this is not there YET).
FEATURE: We need a "Revert Edits" for sequences. FEATURE: When a sequence has been modified, there should be a somewhere in the frame description line. Perhaps: F6 local.plus [1/2], and that * should go away only when the Save is done (not when Move or Copy are done).
Commit: df410c52debc5670c6f59b4d60f6fa54515b15bf
Now working:
NOTE: If you copy or move or save a C1 sequence to a Plus frame, it will do it, but the resulting sequence will NOT be loadable into the new frame. Also, many CEDER sequences are not loadable into any SD frame (this requires the translation code that is designed, but isn't written yet).
What is safe to do right now is creating an SD frame, save/copy/moving it to another SD frame (of the same or higher level).
NOTE: While care is taken to atomically modify files, there are no backups for any of the sequence files. Caveat user.
Commit: 71c24519f19a5e66810da99aa0ab0465fa576ec8
SHIFT-F11 goes to sequence 1 in the current frame. SHIFT-F12 goes to the last sequence in the current frame.
FEATURE: It really feels to me like LEFT/RIGHT ARROWs should work the same as F11/F12. But, does that conflict with them being used for volume right now?
commit: 094bc6f59132228caf2d8d713b3d1cbad0fbd174
As the user presses F11/F12 to move around within a frame, we keep track of that internally for displaying the frame (either in the sidebar, or in the Current Sequence pane). This commit persists that value at quit() time, so the next time the user comes in, the frameCurSeq values are remembered. If the persist file doesn't exist, it is created, with an initial value of 1 for all files.
The Current Sequence values for each frame are remembered in /sd/.current.csv, which is an invisible file (at least to Mac users). It's done this way, because the frameCurSeq values go with the musicDir, and are not separate for each laptop the user may have. File services like Dropbox, Box.net, and iCloud will sync the music directory, and in the process, will retain the frameCurSeq values across all synchronized devices.
Commit: 71119993e6aa2224b659d01963e4c05332833c50
If we do a Load Sequence from File, Paste Sequence (context menu), F11/12 to move between sequences within a frame, or F1-F10 to switch frames, we should select and highlight the first item in the tableWidgetCurrentSequence, and display the ending position. Then, UP/DOWN ARROWS will work as expected within that sequence.
This was a tough one. It turns out that in order for the first row to be selected and highlighted (and not crash), AND for the up/down keys to work, there needs to be:
BUT, we actually don't know when the load is complete, because SD executes in a separate thread asynchronously AND there's nothing in the SD output that tells us that it's done.
So, for 1 above, I always check to make sure the item(r,c) pointer is valid before trying to do anything with it, AND I wait 100ms after the last line is received by us from SD, before I try to set the selection, AND I only set the selection once. For 2 above, I now explicitly set the current item (which I wasn't doing before). For 3 above, I was doing that before already.
In my testing, it seems stable now. No crashes, and the 100ms delay for the selection is not noticeable. And, no UP/DOWN keys are seemingly lost, because the tableWidget was in a weird state where an item was selected but was not the current item (who knew??).
Commit: c47464862508810f4867273e5781ae1d82e47b6e
If on the SD page, Left/Right Arrows will go to Previous/Next sequence in the current frame, as you might have expected (it's natural to navigate this way, because the arrow keys are toward the bottom of the keyboard and placed in an easy-to-get-to pattern, while F11/12 are near the top and are often hard to distinguish from other keys up there).
NOTE: If you have the default keyboard hot keys setup, Left/Right are default assigned to moving around within a song. In that case, there are two alternatives:
Commit: 2d215d484dc65b93fb83454107b8bb200487e273
We're going out of Edit Mode, so highlight the first item again. This is basically the Replace code.
Notes on #REC=
Therefore, I think the best plan for GLUIDs in SquareDesk for use in the REC field is:
Examples of GLUID for a sequence:
"7493600012" => userID: 74936, sequenceID: 12
Example of .squaredesk/metadata.txt file:
key,value
userID,74936
Commit: 3c7cfbbeca92075264b3b5b6666ee5a82d5521f1
A sequence now looks like this:
@
#REC=1658300004#
#AUTHOR=16583#
HEADS Square Thru 2
Swing Thru
BOYS Run
Ferris Wheel
CENTERS Square Thru 3
where 16583 is my userID (randomly assigned the first time the app was run), and 00004 is the sequenceID.
NOTES:
QUESTION:
Should it actually do the REC=3 save at all right after NEW?
Maybe it should wait until the user does SAVE SEQUENCE, and then save it with REC=3. This would use up fewer sequence numbers, for the typical case of NEW + EDIT + SAVE.
PROS for saving as REC=3 then REC=4:
CONS:
UPDATE: For now, I'm not going to do this, because changing this would mean that we have to distinguish NEW sequences (unsaved) from LOADED sequences (saved), and I'm not ready to implement that yet (I don't think it's straightforward). So for now, this is a FUTURE thing.
Notes on cut/pasting (for the purposes of translation between SD, CSDS Online, and Taminations):
Therefore, IMPORTING TO SQUAREDESK:
And, EXPORTING FROM SQUAREDESK:
If we do the above, here are the use cases (P0 = priority 0, P1 = priority 1, etc.):
Given those priorities, the order of implementation should probably be:
Commit: 7758dd8db0d1560115c6c4ae9a5b06ac90175784
If there isn't already a .squaredesk/metadata.csv file, the authorID is set to the same as userID (it's a number). Right now, if you want it to be a real string, you'll have to edit this by hand right now, e.g. "authorID,Mike Pogue". Then, that string will be used for the #AUTHOR=
Notes regarding COMMENTS:
CSDS Online does not support ENTERING any comments at all.
CSDS (app) apparently allows creating whole-line, prefix, and suffix comments, e.g. "(left handed)", "Boys Run (Left)" or "(Each Side) Crossfire" using parens
SD supports ENTERING sequence comments, but it's pretty weird to do so: -- "insert a comment" -- "hello there" -- square thru 4 -- AND THEN, what is actually created in the sequence is "{hello there} square thru 4" (curly braces).
The resulting line with curly braces is NOT round-trippable, and it cannot be entered that way into sdtty.
SD does NOT support whole-line or suffix comments at all
So, there are conflicts between delimiters for inline comments.
For whole-line comments:
Also, remember that our Current Sequence pane is currently refreshed every time SD sends us stuff. And so the ONLY stuff that makes it in the Current Sequence pane is what SD understands.
I think this argues that at least for now:
Therefore, no work to be done on comments right now. To do so would require a major rearchitecture of how SD itself deals with comments, and that's not work for Phase 1 (Minimum Lovable Product).
STILL OPEN: What to do about a trailing AL or RLG?
I think I'll go with the "simplest approach" for now, and see how it feels.
Implications:
My current TODO list for this EPIC (getting close to something I think I can actually use for P0: WRITING C1 SEQUENCES, and P0.1: PLAYING BACK C1 SEQUENCES):
HIGH PRIORITY
IMPORTING
ONDISK FORMAT CHANGE
SIMPLIFY
SELECT FRAMES
FAKE DATA
DISMISSING A SEQUENCE
TODO LATER:
After a lot of thought, I think I'm going to move to more of a Taminations-like model for writing sequences, in the following sense:
Taminations colors:
As per color picker on a screen capture of Taminations:
I'm also going to get rid of the folder hierarchy, and just put all of the frame files into the <musicDir>/sd folder, just to keep it simpler. This will require renaming of files if they are downloaded from ceder.net, but I think that's a pretty simple task, and it's done only once. I'll use a standard extension so that SquareDesk can know the file type: ".seq.txt". This will allow any standard text editor to recognize the file as plain text, yet SquareDesk can still recognize it as a "Sequence File".
Commit: 46d57d9822907e1d0eb0c873f88e7205cafac734
Removed the folder hierarchy, which seemed too complex. Now all sequence files are just regular files with the extension ".seq.txt" in the /sd folder.
Commit: 223a25471f2eb14b9aafea3c5580f4ef61b62ded
The SD Level is now persistent. The default if you've never selected a level is "Plus". But, when you select a level, that selection will persist to the next time you open SquareDesk.
But, BE CAREFUL: Callers with a mixture of levels should set the SD level to the highest level they expect to use (otherwise, at SD startup time, a C1 sequence in the default Current Sequence window might not load properly if Plus is the default level).
BUG: When initially in Sequence Designer, should not have NEW and UNLOCK buttons.
Commit: 61221fa4a60fb40adbb0569c4c268a9618d173ad
First step in coloring. Colors are like Taminations
The call lists are the internal ones used to initialize the Dance Programs.
TODO: It probably SHOULD be the EXTERNAL ones in the Reference folder.
TODO: Need to remove the WHO at the front of a call, before scanning for call level. This is true especially for the first call in a sequence, but it really should be done for all calls. TODO: Need to initialize the big long call strings just once (right now, it's for every call, which was easy to code, but dumb. TODO: Is there room for a string for level, e.g. "A1", etc.? If not, maybe colors is OK. TODO: Right now, zebra striping is still turned ON. Maybe need a preference to turn ON/OFF?
BUG: If hit F11/F12 before current sequence is saved, it is gone.
Commit: bef4c0c7f8b4c035901152a7847e821e00d391fd
Initial C1 coloring. Looks like this:
Commit: 677871001ce674a533b7ba955f67a7af531f13dc
A couple of tweaks to the Current Sequence window:
to better match Taminations.
Now it looks like this:
TODO: Need ways to navigate WITHOUT the function keys, like:
TODO: Current pane arrangement (which one is Current) should be persistent.
Current look and feel:
OK, I've been thinking about how to make this paradigm better. The current UX is hard-to-understand, I think. Here are my thoughts on what would work:
OK, so here is what I think that implies:
Key assignments would be something like this:
Bugs:
TODO (short term):
Features:
TODO [FIXED]: Font Size for Names bigger (FIXED by f7325df269ff2c2cdddb3297b2c8986d7b21c90d) BUG [FIXED]: entry in Current Sequence list defaults to too tall, clicking on Dance Arranger fixes it (FIXED by: 21b782a27f79e43a654c1667697278a5db526f5f)
TODO: Font Size for Current Sequence calls bigger BUG: Going to Sequence Designer, title is "Current Sequence" -- where does this go? Pressing F1 changes it to hoedown1.easy.ms, as expected. So, it should probably default to that.
Commit: 7318ff7c0190b0f3f4fdfdd75894cdcea7ebf431
"sd/sequenceUsed.csv" now contains a CSV list of when sequences were called. If G was hit, the sequence is marked "GOOD". If B was hit, the sequence is marked "BAD". Both B and G will take us to the next sequence. The datetime is in ISO8601 UTC. Note: This is similar to what CSDS does with U ("Used") and CTRL-P ("Problem"), however in our case we're just storing a GOOD/BAD value in a CSV file, whereas CSDS records this stuff in a database, with a lot more detail about what problems the sequence had. This file is intentionally visible (does not start with ".", so that the user can go back and manually take a look at the BAD sequences (without a specific SquareDesk UX to do so).
The current sequence number for each frame is now retained in "sd/.current.csv", and it's updated whenever the current sequence changes due to keypress. The current sequence numbers are intentionally here, because they are associated with the database, and not a specific laptop (as Preferences are).
The SD tab now defaults to Dance Arranger, since it does most all of what Sequence Designer does. User can still switch back to the simpler interface (Sequence Designer), if desired.
Sequence files are all of the format: "
TODO: scan sd dir to find files of that format, and provide a mechanism for selecting one of them to work on (e.g. "hoedown1")
Keyboard navigation is as per the diagram I drew above:
".squareDesk/metadata.csv" contains a numeric userID, and numeric nextSequenceId, and a human-readable authorID. The default is to start with a random userID, nextSequenceID == 1, and authorID == userID. A human can hand edit the file to replace the authorID with a human-readable one.
Feature:
Question:
Feature [FIXED]: If the resolve is Left Allemande, that should be recorded as a ( comment ) in the sequence. AND, on input, it should stick comments into the Current Sequence pane. Maybe not? The resolve line does show the "left allemande" or "at home".
OK, I decided to put the resolve into the sequence in the file, but NOT show it in the Current Sequence window. The commit that does this: e9fa34d22760a45dd49cf1a8af8d00a60b758639 .
BUG?: When I save a sequence that I just wrote, it highlights the first call. Perhaps it should highlight the last call?
Feature?: Key to swap HEADS and SIDES in a sequence
BUG [FIXED]: REC's are incrementing by 2, they should increment by 1 (Is that because the NEW creates it, and the SAVE increments it?). Yeah, that looks like it.
This bug was fixed by commit: c42004f56f60b13004f4d33f4024fcbff053b1b1 . Now, NEW will NOT write to the file, but SAVE (really REPLACE under the covers) will. REC's are incrementing as expected now.
Feature?: Should G and B be locked out for some period of time, so that they are not accidentally triggered?
BUG [FIXED]: Resolve line, when it's big (e.g. circulate 1-1/2 BTL resolve) makes the whole pane very wide....
Actual long-winded wording: "promenade (1/8 promenade, or couples 1/2 circulate, bend the line, you're home)"
This was fixed by commit: 7bd204a7cbd659afbff905b36afe1b6b64ec9749 .
BUG [FIXED]: "Quarter In" --> "1/4 in" should be colored like an A-1 call Fixed by: 1d1f49f268de4b27759cd27dff7cb2acf2c577b3 .
Bug [FIXED]: CMD-SHIFT-DownArrow while focus is in the Title field is not moving the selected song down in the playlist. It does move the song down, when the focus is in the songTable.
EDIT: This bug was actually already reported earlier (twice!). I just fixed it in commit 44e371114a0179ab703e446b65cb2d50db661a2d .
Bug [FIXED]: when first coming into SD, the resolve line isn't set to anything. Hit LEFT then RIGHT ARROW, and it appears.
This one seems to be fixed.
Bug: NEW (NULL) sequence isn't viewable at all, needs to be manually edited in text editor. So, do NEW, and then quit the program. This last sequence isn't viewable.
This commit (c42004f56f60b13004f4d33f4024fcbff053b1b1) adds an edit sequence indicator, which is triggered either on NEW or UNLOCK. However, NEW will create a sequence, but now will NOT write it to the file. That will be done at SAVE time. If the app is quit between NEW and SAVE, nothing is written to the file. AND, null sequences are written as "just as you are", which makes them both viewable and editable. It also fixes the "null sequence" bug described above.
Bug: Blank lines at the end of a sequence file are treated as a valid sequence (and they're not). These should not be created unless there's a bug, but if there is a bug, the UX can be very confusing.
Feature: If a sequence is being edited, and user does QUIT, offer to save the sequence before quitting.
Bug: New "*" shows up when last sequence is new, but previous sequence is not, and I hit LEFT_ARROW.
Bug: New doesn't give me a blank sequence (it used to).
I need a sequence playback thing of SOME kind, since I'm calling C1 for the first time in August. I've evaluated CSDS, CSDS Online, Callerama, Taminations, and SD. I won't repeat all of that analysis here, but my conclusion is that the best approach is probably hybrid: "Design: use CSDS Online or Taminations or SquareDesk's internal SD; Playback (while calling a C1 dance): use SquareDesk's SD".
I do like the "resolver" in CSDS Online (https://www.ceder.net/ws/) a LOT. But, the UI is very weak for designing (especially if you make a typo mistake), and it's really unusable for playback (during a dance). CSDS seems really good for playback, but it's Windows X86 only (and it's $200).
I think it's possible to make a minimally usable Design/Playback tab, using SD. This ticket describes some thoughts about what I think I need for August C1 calling:
Design in CSDS Online, Convert CSDS sequences to SD, use SD sequences or converted CSDS sequences: PROS: Nice resolution in CSDS Online Can still design in SquareDesk/SD SquareDesk has better music support CONS: have to write code:
UPDATE
Here's what's implemented from the above list, as of 2023/03/12: