todo.txt 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. TODO: A way to see the path of the currently selected item in any grouplike
  2. element. Each item in the path should be a button that, when pressed,
  3. makes the MAIN grouplike view navigate there.
  4. (Done!)
  5. TODO: A "shuffle queue" button!
  6. TODO: A "clear queue" button.
  7. (Done! Press S or C, or choose the option from the menubar.)
  8. TODO: A way to jump to an item with a particular name. Probably press "/".
  9. It'd be nice if the closest match got highlighted while you were typing.
  10. (Done!)
  11. TODO: "Queue to play next"... maybe also a cursor in the queue list, which
  12. would tell after what track to place newly-queued items?
  13. (Done!)
  14. TODO: Scroll to the selected track once it starts playing when selected from
  15. the queue.
  16. TODO: process.on('SIGWINCH', () => ...) -- detect terminal resize!!
  17. (Done!)
  18. TODO: Pressing enter in the queue seems to not be doing the right thing?
  19. It should NOT move the selected item anywhere in the queue; it should
  20. just select and play that track.
  21. (Done!)
  22. TODO: iTunes downloader - test this.
  23. TODO: Warn if no mkfifo (means controls won't work).
  24. TODO: file:// support for crawl-local.
  25. (Done!)
  26. TODO: Pass YouTube playlist or http://.../playlist.json-like URLs to use them
  27. as playlists (crawl automatically).
  28. (Done!)
  29. TODO: There's some weird glitch where, if downloaderArg is missing (=== ""),
  30. it'll play.. something by Jake Chudnow?? -- Okay, looks like it's using
  31. ~/.mtui/downloads/<locallink, etc>/ as the directory for where it would
  32. put the download file (because it's .../localink/ + encode(dlArg) and
  33. dlArg is empty). The way the cache works is that it checks if there is
  34. already a file in that directory, and there IS: a directory for another
  35. track download! But the cache doesn't know this; it just thinks that
  36. directory is the MP3 file (or whatever). So it returns it. MPV works fine
  37. if you pass it a directory that contains music files, so in my case,
  38. 72_food (by Jake Chudnow) plays. (That's the first thing returned by
  39. readdir, I suppose.)
  40. (Done!)
  41. TODO: Mouse support, obviously.
  42. TODO: Ctrl-O'ing a playlist sets the left-pane's selected index to the second
  43. item, for some reason. (Regardless of what you had selected before..)
  44. TODO: "Open in new tab" in the Open prompt.
  45. TODO: Inspect the inevitable memory issues that are absolutely 100% sure to
  46. become a problem with opening playlists on the fly.
  47. TODO: Cancelling the "enter a playlist source" dialog shouldn't also stop the
  48. current song.
  49. (Done!)
  50. TODO: Move TabberElement to tui-lib, at some point.
  51. TODO: Make PathElements selectable (again).
  52. (Done!)
  53. TODO: Make the tabber UI show handy information, like what tab you've got
  54. selected, how many tabs there are, the usual (same way a browser tabber
  55. works).
  56. (Done!)
  57. TODO: A "bookmarked playlists" list in the UI, so you can quickly load up
  58. playlists you often use. (Let anything go here, like YT playlist URLs,
  59. file paths, etc.)
  60. TODO: Get rid of "WARNING: unable to extract uploader nickname", which comes
  61. from youtube-dl.
  62. (Done!)
  63. TODO: Fix crashes related to the window resizing while a download is occurring
  64. (i.e. the braille "download spinner" is showing). Very weird!
  65. TODO: Investigate performance issues with very very long ListScrollForms.
  66. (Done!)
  67. TODO: At some point, putting mtui downloads in ~/.mtui - but preferrably with
  68. a more humanish structure - would be quite nice..!
  69. (Done! Yeeeeeeees!!!!!!!!)
  70. TODO: Press "M" to show a context menu. (Done!)
  71. TODO: Figure out a keybinding for Mark (in edit mode) - probably Ctrl-M.
  72. (I prefer Ctrl to be used for functions that will open a dialog of some
  73. sort, though..)
  74. TODO: Only show scrollbars if the form is actually scrollable. (This would make
  75. context menus look better.)
  76. TODO: "Play" (now), in the context menu, should act like a queue-up-next, not a
  77. queue-at-end. (Done!)
  78. TODO: Make the queue code more sane.
  79. (Done!)
  80. TODO: Figure out when the "queue" context menu options should immediately play
  81. the track. Currently, they don't ever initiate playing (besides the
  82. "Play now" option).
  83. (Done! Sorta. There are now just "play" and "queue" buttons. These use
  84. the options chosen ("where" and "order"). Previously, combinations of
  85. those made up menu options, e.g. "queue at end". Now they're separate
  86. controls and the play/queue button you pick decides whether they play
  87. right away or not.)
  88. TODO: A "remove from queue" option for tracks and groups, which removes them
  89. and their children from the queue.
  90. (Done!)
  91. TODO: After the end of a shuffled queue, the next song from the group of the
  92. last track is played (and so on, until the group is empty). This seems
  93. definitely wrong.
  94. (Done! At the end of a shuffle queue, it just stops now.)
  95. TODO: Show a preview of where "Jump to" will go while typing.
  96. (Done!)
  97. TODO: Cancelling "Jump to" should return the selected index to whatever it was
  98. before.
  99. (Done!)
  100. TODO: Entering more than one key "at once" into a text input element will only
  101. move the cursor right by one character, not by the length of the inputted
  102. text. (This is an issue when pasting or spamming the keyboard.) Should be
  103. fixed in tui-lib.
  104. (Done!)
  105. TODO: Pressing space while an "Up (to <group>)" button is selected both
  106. activates the button and pauses music (because the app detects that the
  107. space key is pressed). This is definitely wrong (it should do one or the
  108. other - I'm not too sure which, yet, but probably the latter). (Done!)
  109. TODO: If a track's file is a symlink, the "From:" label should show where it
  110. links to.
  111. TODO: The "Up (to <group>)" and "(This group has no items)" elements are not
  112. quite buttons nor grouplike items. They should be more consistent with
  113. actual grouplike items (i.e. same behavior and appearance), and should
  114. be less buggy.
  115. (Done!)
  116. TODO: "Distribute" options in play/queue menu -- "don't distribute", "spread
  117. (across queue?) evenly", "spread randomly".
  118. (Done!)
  119. TODO: Investigate how to make "distribute" options work better when the
  120. currently-playing song is contained in the group to be distributed.
  121. TODO: The "distribute" options shouldn't show up when you've only got a track
  122. selected! But imagine you already had a "distribute" option selected when
  123. you open up the menu on a track. Is there a way to not mutate the index
  124. of the whereControl in that case (until the user changes the option)?
  125. Like the DS home screen.
  126. TODO: If you remove tracks from the queue that are above the currently selected
  127. track of the queue, the selection index won't change -- so the actual
  128. selected track will become something different. No good!
  129. (Done!)
  130. TODO: Arbitrary queue! I.e, you specify the downloadURL, then it queues that
  131. item.
  132. TODO: A "distribute children" option (with better wording)! Like manually
  133. queueing each child group to be distributed evenly one by one, but
  134. automatic.
  135. More on that thought...I don't think I want to have "clumps" of like,
  136. one of a song from EVERY album right at the start and the end, when we
  137. do that. (Well maybe not the end, but definitely at the start.) If we
  138. pretend there's "fake" items at the start of the group before we
  139. distribute it, I think we'll get better results - that fake item will be
  140. placed at the start, letting the rest of the group get distributed in
  141. better order. (Of course, the fake item is just an offset in the math.
  142. It isn't an actual item that will get added to the queue.)
  143. TODO: Remove ALL children before queueing, THEN queue them - including any math
  144. for distribution. Might give interesting results...or maybe it wouldn't
  145. be any different. Worth investigating!
  146. TODO: A "play later" option for songs in the queue, identical to distributing
  147. randomly the single track; if the track is already playing, it should
  148. skip to the next song before shuffling.
  149. (Done!)
  150. TODO: Loop one song!
  151. (Done!)
  152. TODO: Volume controls!
  153. (Done!)
  154. TODO: Metadata, in memory.
  155. (Done!)
  156. TODO: Load metadata from storage.
  157. (Done!)
  158. TODO: Restore metadata, if it's recognized as similar to an old path.
  159. (Basically: How do we deal with moving files around? We'll also want some
  160. sort of a manager to get rid of unused metadata, if wanted..... on the
  161. one hand, it'll be saving precious kilobytes, but on the other, people
  162. might not want to keep a record of moved or deleted tracks at all, so it
  163. could actually be useful.)
  164. TODO: Don't store duplicate metadata entries (prereq for tags, custom metadata,
  165. etc) for the same track. Do it symlink-style -- map downloader arg to
  166. actual key used for metadata (downloaded file path).
  167. (Done!)
  168. TODO: Metadata process status bar.
  169. (Done!)
  170. TODO: Add Vim arrow keys. Please forgive me.
  171. (Done!)
  172. TODO: Use some other key for toggling loop (besides L), so we can make full use
  173. of HJKL arrow keys.
  174. TODO: In the queue, remove the track number, if possible! Search if all tracks
  175. (or a majority?? maybe later if it becomes a problem...) follow the same
  176. track number format (i.e. start with a number), and if so, remove from
  177. the displayed name. Otherwise, the number is probably just part of the
  178. track's actual name and shouldn't be removed.
  179. (Done!)
  180. TODO: An indicator for the number of tracks in the queue!
  181. (Done!)
  182. TODO: "Reveal" option in queue listing context menu.
  183. (Done!)
  184. TODO: A menubar!
  185. (Done!)
  186. TODO: Make pressing the de-focus menubar key restore the selection even if you
  187. selected the menubar by clicking on it.
  188. TODO: Make the queue length element react to being very squished.
  189. TODO: Don't close the menubar menus when an option is chosen!
  190. Instead, reload that menu to reflect the changes. Handy so that you can
  191. easily press a specific action (e.g. "play later") several times in
  192. succession.
  193. TODO: Color theme picker!! Make sure to save the choice in ~/.mtui, of course!
  194. TODO: An "interweaved" option in the "order" picker - works like putting every
  195. sub-group into a new queue, each time distributing evenly, then using
  196. that as the group to queue according to the "where" picker.
  197. TODO: A "reverse" option in the order picker! Also a "reverse order of groups"
  198. or something, cuz why not yo.
  199. (Done!)
  200. TODO: The context menu crashes when the input spans across the screen! Need to
  201. figure out some kind of "fix layout according to max dimensions" code in
  202. general - it'd be useful here.
  203. TODO: Work out frame rate shenanigans. :) This is a huge task, though (to get
  204. it exactly right) - to begin, just make it so telnet and ordinary clients
  205. get different framerates.
  206. (Done!)
  207. TODO: Remember the scroll position of each group. This should probably be done
  208. per-listing, but make sure the data disappears when the listing is
  209. destroyed (e.g. tab closed)! Have maps on the listings instead of the
  210. grouplikes themselves.
  211. (Done!)
  212. TODO: Apparently shift-up/down selecting doesn't keep the selected item within
  213. the scroll view. Fix that.
  214. (Done!)
  215. TODO: When you queue a song which is already before the current song / insert
  216. index in the queue, it ends up being placed one index closer to the end
  217. than intended. Fix this!
  218. (Done!)
  219. TODO: A "clear after this track" option. Maybe also a corresponding "clear
  220. up to this track" option?
  221. (Done!)
  222. TODO: Maybe also a "pause after this track" option. Worth considering!
  223. TODO: Pay closer attention to the ordering of queue items' context menu...
  224. I like how it is right now for accessibility to specific menu items
  225. (play sooner/later immediately under the start position, remove from
  226. queue one "above" the start pos = at the bottom) -- but it might make
  227. more logical sense to group 'play sooner', 'play next', and 'remove
  228. from queue' all into one section.
  229. TODO: Figure out duplicates in the selection system! Right now, it's possible
  230. to have both a group and its children selected at the same time, which
  231. actually treats them as separate items in the selection grouplike.
  232. This /might/ be good for performing an action on a group as well as its
  233. children, but that seems like a rare case (only relevant to labelling as
  234. far as I can imagine), and it doesn't seem super intuitive UI-wise right
  235. now.
  236. Maybe we could make it so if you have a grouplike selected, then browse
  237. within it to see its children (or subchildren, etc), those child items
  238. would be highlighted, but only dimly? The idea is that no highlight = not
  239. selected; dim highlight = a parent is selected and so actions like
  240. queuing will apply to this item; full highlight = this item itself is
  241. selected, so actions that only apply to individual items, like labelling,
  242. will apply. It's not entirely obvious what this means, but I think it
  243. more or less makes sense.
  244. BTW: we'll need a new function, removeDuplicates, for said actions. One
  245. of those "actions" is actually called just by opening the context menu --
  246. the tally numbers showing the total tracks selected and the sum duration
  247. of all of those tracks. Make sure to call removeDuplicates after
  248. flattenGrouplike. (I considered putting that new behavior of rD into fG,
  249. but it doesn't seem worth it - better to keep them separate and let us
  250. explicitly decide when we do or don't want to consider duplicates.)
  251. (Done! But sort of in the reverse direction: you can't select groups
  252. themselves anymore; whether they display as selected is based upon if
  253. all their child tracks are selected. Accordingly, groups can also show
  254. as "partial" selections, if only some of the tracks are selected.
  255. Might be worth revisiting, but I think what I've got implemented is
  256. easier to wrap your head around than this stuff, however cool the ideas
  257. here probably are.)
  258. TODO: Default to 'after selected track' in context menu, and make pressing Q
  259. (the shorthand for queuing the selection) act as though that's the
  260. selected option, instead of queuing at the end of the queue (which is
  261. really only useful when you're building a queue at the start, assuming
  262. you don't start by shuffling your entire queue anyway).
  263. (Done!)
  264. TODO: When grouplike listings are fixLayout'd (e.g. the window is resized),
  265. make sure the selected input is still visible!
  266. (Done!)
  267. TODO: If you press any key which should select a particular element of the UI
  268. (e.g. the menubar) while a context menu is open, currently the context
  269. menu will close and then restore selection to the element which was
  270. selected when the menu was opened. This seems to happen after the target
  271. element is selected; the effect is that any key which is meant to focus
  272. specific UI parts instead closes the context menu while one is open.
  273. We already have a key for doing just that (the cancel key, i.e. esc or
  274. period), so fix this!
  275. (Done!)
  276. TODO: g/G should work for navigation in context menus! And probably all
  277. ListScrollForms, tbh, but I'm kinda weary of introducing new behavior
  278. like that to tui-lib.
  279. (Done!)
  280. TODO: PageUp/PageDown support is complicated to implement (I've tried) and
  281. should come eventually, but for now just make Home/End work as aliases
  282. for g/G. ~~This means making it possible for the keybinding system to let
  283. a single input function return true for multiple different keys!~~
  284. Actually, we already had that part implemented. :P
  285. (Done!)
  286. TODO: Work out the BIGGER framerate shenanigans. Specifically: down with the
  287. render interval! Or, more literally, get rid of it altogether. Only
  288. render when we know the on-screen text is going to have changed.
  289. (Done - Huzzah! We use 0% CPU when not actively updating the screen now.)
  290. TODO: Be more sneaky about how we decide what text to update on the screen,
  291. in a way which saves us performance. Instead of going through the whole
  292. ansi.interpret process, predict which regions of the screen are going to
  293. have updated, and only process those spaces. We can guess reasonably by
  294. looking at which elements caused the screen to update (keep track of this
  295. in the Root, through the shouldRenderTo function).
  296. TODO: Create a basic Element class, which DisplayElement extends. We have a lot
  297. of code related to scheduling displaying stuff on the screen, and it'd be
  298. nice to keep it more separate from all the basic element logic.
  299. (Done!)
  300. TODO: toString functions for elements! Handy for debugging.
  301. TODO: Revealing a track shouldn't forcibly position it at the bottom of the
  302. screen (in grouplike listings that span more than a screen). Don't scroll
  303. if the item is already visible, and if it's above the current scroll
  304. area, make it appear at the top of the listing view instead of the
  305. bottom.
  306. (Done!)
  307. TODO: Text file support. Yes. Heck yes. Heck hecking yes.
  308. Read text files contained in your music library folders. If there is a
  309. file which has the same basename as a track (or group), show a mark on
  310. the item in grouplike listings, and let it be viewed through an action
  311. on the context menu. Maybe, just MAYBE, implement editing support too.
  312. (Done!!! Still some WIP stuff in the text editor library, but this is
  313. definitely functional as of now.)
  314. TODO: Make 'after selected song' the default in the context menu, too. I miight
  315. go back on this decision, but I think it's just more convenient in
  316. general, and if you prefer 'after current song', that option isn't hard
  317. to discover and select.
  318. (Done!)
  319. TODO: Investigate why reveal() has distinct support for grouplikes as well as
  320. tracks - you can't append actual groups to the queue (only their
  321. flattened children) after all. But if you could -- I think reveal should
  322. work the same for groups as it does for tracks, i.e. opening the parent
  323. and then selecting the item.
  324. TODO: Make the menubar work like context menus for keyboard selection, e.g.
  325. pressing P should select 'Playback' (not bubble to the app element and
  326. rewind to the previous track).
  327. (Done!)
  328. TODO: Implement a UI in the playback info pane that shows when multiple players
  329. exist at once. Make sure it's mouse-interactive, too!
  330. (Done! Will probably be tweaked / expanded in the future.)
  331. TODO: Add a menu for controlling the multiple-players code through the menubar.
  332. (Done! Oh gosh this was such a hack.)
  333. TODO: Investigate menubar UX - now that it uses KeyboardSelector, it's very
  334. comparable in interaction to ContextMenus. To match context menus,
  335. should we make its selection index reset to zero (i.e. the 'mtui' option)
  336. whenever it's selected (via the keyboard)?
  337. (Done! Decided yes.)
  338. TODO: When a telnet client disconnects, the music stops. This shouldn't happen!
  339. TODO: Creating a new music player should base its details (volume, looping
  340. status) on the player which was selected when it was created.
  341. TODO: Show the number of new entries in the "process (new entries)" label.
  342. Probably don't show that menu option if there aren't any new entries.
  343. (Also change it to "new tracks" instead of "new entries"?)
  344. TODO: A "play (in new player)" option in the play menu. It'd be nice to have
  345. this in the queue's context menu, too.
  346. TODO: "Shuffle queue", "shuffle these tracks" options in the queue's
  347. context menu?
  348. TODO: It looks like you can't move the currently playing track by re-queuing
  349. it? Investigate this.
  350. TODO: Fix mtui crashing when you interact with it before the main listing has
  351. loaded its contents.
  352. TODO: Specific config permissions to view and edit text files.
  353. TODO: I lied when I said I finished text editor stuff. Still to-do:
  354. Don't show text files which are adjacent (same filename, but .txt) to
  355. a playable. Instead, show a mark on the listing item. Have a context menu
  356. option for focusing the text editor.
  357. TODO: Have a context menu option for creating a text file for notes on a
  358. playable, when there is no existing adjacent file.
  359. (Done!)
  360. TODO: Delete notes files which are totally empty (or just a single line break).
  361. TODO: Only count *consistently* formatted text, across all tracks in a group,
  362. as track numbering. See '19 3 In The Morning (Pianokind)' for example -
  363. it is the only track in the group which is formatted '## # <text>'.
  364. It does follow the formatting '## <text>' as all other tracks do, so only
  365. the first digits, and following whitespace, should be removed.
  366. (Done!)
  367. TODO: Related to the above - always keep at least one word. See CANSLP's new
  368. release "untitled folder", with tracks named "01 1", "02 2", etc.
  369. (Done!)
  370. TODO: Update to work with IPC server mpv (and socat).
  371. (Done!)
  372. TODO: Look into testing ^that on Windows. Remove mkfifo, since it's probably
  373. no longer necessary!
  374. TODO: Expand selection context menu by pressing the heading button! It should
  375. show a list of the tracks contained within the selection. Selecting any
  376. item should reveal that item in the main listing pane.
  377. TODO: Opening the selection contxt menu should show an option to either add or
  378. remove the cursor-focused item from the selection - this would make
  379. selection accessible when a keyboard or the shift key is inaccessible.
  380. (Done!)
  381. TODO: Integrate the rest of the stuff that handles argv into parseOptions.
  382. (Done!)
  383. TODO: Figure out looping not always working consistently. I've tried to deal
  384. with this before, but it's been broken since switching to socat. Maybe we
  385. aren't receiving time data as consistently, or aren't re-applying loop
  386. when we're supposed to?
  387. (Update: I'm pretty sure this is from socat messages getting dropped -
  388. probably by fault of mpv, not socat or mtui.)
  389. TODO: Show how many tracks remain in a queue player's queue, ala "+1" floated
  390. to the right, behind the playback position/duration indicator.
  391. (Done!)
  392. TODO: "Lock scroll to cursor" option in queue listing. Will make the listing
  393. automatically scroll so that the selected element is at the same visual
  394. Y-position - even when the cursor is moved *not* by the user, e.g. the
  395. enxt track playing while the current track is selected. This will allow
  396. the user to reveal a certain number of tracks ahead/behind the current
  397. track according to their liking. (Keep in mind ends of the listing, where
  398. the scroll can't be adjusted to match because that would mean scrolling
  399. past the ends... maybe put a dim background behind the element currently
  400. occupying the locked position, scrolling such that the selected element
  401. is at that position whenever doing so doesn't go out of bounds?)
  402. (Done! This was less work than expected. Dim background not implemented
  403. because (1) it's more work and (2) I don't want to overcomplicate the
  404. user interface.)
  405. TODO: Revisit labels and notes features! They're commented out for now :P
  406. TODO: Pressing "Reveal" should focus the main listing. This is prrrrobably a
  407. case of context menu selection-restoring being a pain.
  408. (Done!)
  409. TODO: When a track besides the currently playing one is selected in the queue
  410. listing, display the time either *until the track starts* or *since the
  411. track ended* appropriately, ala "+03:45" or "-1:32:17", in the queue
  412. time label (which is positioned at the bottom of the queue listing).
  413. (Done!)
  414. TODO: In that regard, also change the queue length label (just above the time
  415. label) to indicate which track is selected --- RELATIVE to the current
  416. track, ala "40 (+5) / 1032" or "5 (-1) / 10".
  417. (Done!)
  418. TODO: Deselecting a grouplike listing (e.g. by clicking elsewhere) should hide
  419. its "jump to" element.
  420. (Done!)
  421. TODO: A "before selected item" option for in the queue menu!
  422. (Done!)
  423. TODO: The sorting for library3/C418 seems to be weird???? Could be pointing to
  424. some bug!
  425. (Done! Using a better package for sorting now.)
  426. TODO: Selecting a group from the path listing at the bottom of listings should
  427. make it so the child of that group matching with the path is selected.
  428. For example: selecting X in W/X/Y/Z would open the directory X and
  429. select item Y; selecting Z would open the directory Z and select the
  430. track (or group) which the path element is active on in the first place.
  431. (Done!)
  432. TODO: UI to change the directory from which mtui reads music by default!
  433. TODO: file/folder browse-select UI 0_0
  434. TODO: Change any "song" terminology to "track" in the UI.
  435. (Done!)