Commit Graph

265 Commits

Author SHA1 Message Date
Přemysl Eric Janouch 3934d9b1f9
Bind M-Up to the "up" action
Taken from Windows Explorer, which abandoned the Backspace binding.
2020-10-23 03:33:26 +02:00
Přemysl Eric Janouch 2d3909fdd1
Cleanup
No functional change.
2020-10-23 02:57:34 +02:00
Přemysl Eric Janouch b6ce8a0913
Avoid jumping around in polling mode
While still avoiding busy loops.

It works well enough to enable this by default.

Closes #1
2020-10-23 02:42:18 +02:00
Přemysl Eric Janouch 9928eca274
Add a comment and update another one 2020-10-18 21:09:03 +02:00
Přemysl Eric Janouch 6c2ae2f6bb
Give up and implement elapsed time polling
Playback may sometimes stall but it won't produce any events.

This popular workaround likes to jump around, though.
It might be a good idea to use some kind of hybrid approach.

Therefore this is disabled by default so far.

Updates #1
2020-10-18 07:28:14 +02:00
Přemysl Eric Janouch b3579d1128
Explain the ticking mechanism
Took time to read.  Also fix an invalid comment.
2020-10-18 05:57:44 +02:00
Přemysl Eric Janouch 525e952753
Bump liberty and termo 2020-10-10 21:31:31 +02:00
Přemysl Eric Janouch 8707b38c48
Make direct SHOUTcast streams work again
Might be an issue specific to my bbc-on-ice, since we're not asking
for SHOUTcast by including "Icy-MetaData: 1" in request headers
but the proxy always outputs an "ICY 200 OK" header.
2020-10-10 14:48:22 +02:00
Přemysl Eric Janouch 7af041ac01
Remove unnecessary quotes from macro definitions
The behaviour is defined by the standard.
2020-09-20 13:18:07 +02:00
Přemysl Eric Janouch e21699ab47
Support iterating tabs with C-PgUp/Down and C-Left/Right 2020-09-07 18:15:39 +02:00
Přemysl Eric Janouch d124f43cf6
Support vi-like scrolling with C-y and C-e 2020-08-01 14:06:17 +02:00
Přemysl Eric Janouch 0e2a050c4f
Name change 2020-08-01 14:04:10 +02:00
Přemysl Eric Janouch 6c1546e919
Workaround cURL bug 2019-02-24 01:41:15 +01:00
Přemysl Eric Janouch cdb86652b9
Fix unmarking behaviour, cleanup 2018-10-29 15:04:22 +01:00
Přemysl Eric Janouch cbdec0552d
Allow moving multiple items in the Current tab 2018-10-29 14:45:25 +01:00
Přemysl Eric Janouch 2cd100af7a
Remove an outdated comment 2018-10-29 13:44:43 +01:00
Přemysl Eric Janouch 44ebc3591e
Make holding Shift+Up/Down behave better 2018-10-29 13:42:39 +01:00
Přemysl Eric Janouch 0691c533b4
Update selection on playlist changes 2018-10-29 13:22:56 +01:00
Přemysl Eric Janouch 6298235e22
Add actions for repeat/random/single/consume
Now the user can at least toggle them from the help tab,
or even bind them as necessary.
2018-10-29 09:58:43 +01:00
Přemysl Eric Janouch 841e2f79c0
Make help tab items actionable 2018-10-29 09:46:45 +01:00
Přemysl Eric Janouch 5ade0f082e
Show unbound actions in help 2018-10-29 09:19:34 +01:00
Přemysl Eric Janouch a6543a796d
Implement multiselect for deletion in Current tab 2018-10-21 05:11:20 +02:00
Přemysl Eric Janouch 1349e39941
Add keyboard shortcut d for deletion
As in vi(1).
2018-10-21 05:10:04 +02:00
Přemysl Eric Janouch f7e4d8d3d3
Add keyboard shortcuts g/G for goto top/bottom
As in less(1).
2018-10-21 04:20:06 +02:00
Přemysl Eric Janouch 8f362e787b
Add a search feature for Library tab 2018-10-21 04:17:05 +02:00
Přemysl Eric Janouch 609ddfab22
Cleanup 2018-10-20 22:22:26 +02:00
Přemysl Eric Janouch 804f051d66
Implement sequential multiselect for Library tab 2018-10-20 22:22:26 +02:00
Přemysl Eric Janouch 3c09a16a02
Fix input handling
When app_process_termo_event() returns false, it always means to beep,
not to quit the application.
2018-10-20 22:13:33 +02:00
Přemysl Eric Janouch 9c16ab4136
Mark an issue for later 2018-10-20 22:13:32 +02:00
Přemysl Eric Janouch f241a7016a
Move the line editor into its own file
Trying to make it reusable in other projects.
2018-10-20 22:13:32 +02:00
Přemysl Eric Janouch e957bba771
Use a common algorithm for scrollbars
Let's have reasonable behaviour with Unicode one as well.
2018-10-20 04:27:35 +02:00
Přemysl Eric Janouch 3fd88d593c
Improve fallback scrollbar behaviour 2018-10-20 02:51:09 +02:00
Přemysl Eric Janouch caba65b2bc
Bind the </> keys to previous/next
As in mpv.
2018-09-26 04:02:35 +02:00
Přemysl Eric Janouch 9b38c4c74f
Fix undefined behaviour 2018-07-21 23:36:13 +02:00
Přemysl Eric Janouch 7f8ad9430f
Relicense to 0BSD, update mail address
I've come to the conclusion that copyright mostly just stands in the way
of software development.  In my jurisdiction I cannot give up my own
copyright and 0BSD seems to be the closest thing to public domain.

The updated mail address, also used in my author/committer lines,
is shorter and looks nicer.  People rarely interact anyway.
2018-06-24 04:29:24 +02:00
Přemysl Eric Janouch 0f350f88b3
Cleanup 2017-06-27 04:35:02 +02:00
Přemysl Eric Janouch a1831a3ab8
Reorganize actions 2017-06-27 04:31:08 +02:00
Přemysl Eric Janouch 021bc214a3
Improve the Help tab
There are now up to three bindings per action by default, so grouping
is desirable.  We can even follow the more or less logical order given
by enumeration values.

It should be much easier to find what you need.
2017-06-27 04:31:08 +02:00
Přemysl Eric Janouch 23efe3bfdf
Cleanup 2017-06-27 04:31:08 +02:00
Přemysl Eric Janouch 4bb9b11fed
Customizable key bindings 2017-06-27 04:31:04 +02:00
Přemysl Eric Janouch 2375e0dd3e
Make Del/Bksp eat whole graphemes
Tested on some zalgo text.
2017-06-26 04:54:56 +02:00
Přemysl Eric Janouch 7d414c7647
Make left/right skip non-spacing characters 2017-06-26 04:19:42 +02:00
Přemysl Eric Janouch 33f5ba0b60
Allow running arbitrary MPD commands 2017-06-26 03:51:53 +02:00
Přemysl Eric Janouch 4261c81468
Teach the line editor to scroll + prompt 2017-06-26 03:50:29 +02:00
Přemysl Eric Janouch 6b2def7531
Clean up the line editor 2017-06-26 01:59:55 +02:00
Přemysl Eric Janouch 9fc690c4c9
Cache widths in the line editor 2017-06-26 01:48:38 +02:00
Přemysl Eric Janouch ba3302982e
Basic implementation of a line editor
Not yet used anywhere.
2017-06-26 00:01:24 +02:00
Přemysl Eric Janouch f71eee66bd
Rename item_list_{init,make}() 2017-06-23 00:20:08 +02:00
Přemysl Eric Janouch 3ff7867e30
Bump liberty 2017-06-23 00:20:08 +02:00
Přemysl Eric Janouch 99f35a509c
Handle weird playlists better 2017-06-22 21:25:52 +02:00
Přemysl Eric Janouch 88455f03bf
Cleanup 2017-06-13 17:06:31 +02:00
Přemysl Eric Janouch d0c0af0e38
Allow modifying playlist order 2017-06-05 22:19:39 +02:00
Přemysl Eric Janouch c5fcc1c8c1
More beeping 2017-06-05 22:19:12 +02:00
Přemysl Eric Janouch 7f66f801f4
Give up on freeing tab resources 2017-06-05 21:34:50 +02:00
Přemysl Eric Janouch 1dbece753e
Auto-resume playback on replace 2017-06-05 21:20:31 +02:00
Přemysl Eric Janouch 19605f9b7b
Use song IDs when available 2017-06-05 20:54:50 +02:00
Přemysl Eric Janouch cadc846fd4
Cleanup 2017-06-05 20:26:28 +02:00
Přemysl Eric Janouch 34bbff2f71
Remove a pointless TODO 2017-06-05 20:14:49 +02:00
Přemysl Eric Janouch abb5022793
Invalidate a TODO 2017-06-05 20:09:47 +02:00
Přemysl Eric Janouch e0e63cb177
Make code a bit more compact 2017-06-05 20:02:21 +02:00
Přemysl Eric Janouch 627cb0dee9
Add and bind backward/forward seeks 2017-06-05 19:57:00 +02:00
Přemysl Eric Janouch 77c78d8866
Fix a little glitch 2017-06-05 19:50:04 +02:00
Přemysl Eric Janouch 7b41ae1658
Simplify view code
Now we beep if selection movement is impossible.

It still looks a bit more obfuscated than it needs to be.
2017-06-05 19:39:06 +02:00
Přemysl Eric Janouch e62c41f4a1
Use the ARRAY abstraction 2017-06-05 18:59:23 +02:00
Přemysl Eric Janouch b050113eed
Show playlist length time
Now we look distinctly Sonata-like.
2017-06-05 18:51:18 +02:00
Přemysl Eric Janouch 0541b7e179
Uncapitalize cURL errors 2017-06-05 13:05:33 +02:00
Přemysl Eric Janouch 99f2117d4c
Implement L/M/H bindings 2017-06-05 01:24:10 +02:00
Přemysl Eric Janouch 8c260c3fc3
Only display enabled options 2017-06-05 01:09:55 +02:00
Přemysl Eric Janouch a343156930
Show the current path in Library
The UI code is totally ad-hoc and ugly.
2017-06-05 00:56:34 +02:00
Přemysl Eric Janouch 2223680504
Add interface for database updates 2017-06-05 00:18:53 +02:00
Přemysl Eric Janouch 92f350ef04
Stop eating errors
Instead show them up in the status bar with a timeout.
2017-06-04 23:58:04 +02:00
Přemysl Eric Janouch c4965726f4
Add a basic statusbar
Unfortunately so far the user can't toggle the options.
2017-06-04 23:08:36 +02:00
Přemysl Eric Janouch e808d06651
Cleanup 2017-06-04 04:32:30 +02:00
Přemysl Eric Janouch 8c3b0670ce
Remember the position when browsing Library 2017-06-04 04:32:30 +02:00
Přemysl Eric Janouch e8a0864ead
Add an attribute for directories
Completely overrides row colors though.
2017-06-04 04:32:29 +02:00
Přemysl Eric Janouch 57b4a9688d
Only change path when we get its contents 2017-06-04 04:32:25 +02:00
Přemysl Eric Janouch 653ff1373f
Don't default to negative selection 2017-06-04 03:04:35 +02:00
Přemysl Eric Janouch 86b87bee74
Cleanup 2017-06-04 03:04:35 +02:00
Přemysl Eric Janouch 5721074b48
Make backspace go up a level 2017-06-03 23:33:08 +02:00
Přemysl Eric Janouch a1436318b6
Improve SIGWINCH handling 2017-06-03 23:03:38 +02:00
Přemysl Eric Janouch a1548bed00
Fix and update LICENSE 2017-02-03 23:09:25 +01:00
Přemysl Eric Janouch f9c85e3ef2
Don't show "playing" when we don't know 2017-01-29 18:21:27 +01:00
Přemysl Eric Janouch 4cc079b6b6
Fix segfault on insufficient privileges 2017-01-29 18:18:58 +01:00
Přemysl Eric Janouch 87a738161a
Factor out app_fitting_items() 2017-01-29 17:56:59 +01:00
Přemysl Eric Janouch d95eb500f7
ATTRIBUTE_HEADER -> ATTRIBUTE_NORMAL 2017-01-29 17:55:50 +01:00
Přemysl Eric Janouch 993fe3f2d6
g_ctx -> g
Because it's just plain noise.  But I still enjoy the indicator.
2017-01-29 15:26:55 +01:00
Přemysl Eric Janouch 36e726eca0
Resolve the APP_ATTR situation 2017-01-29 15:17:35 +01:00
Přemysl Eric Janouch 5939c7135a
Handle disconnects better
Reset all state and update the UI.
2017-01-29 15:03:00 +01:00
Přemysl Eric Janouch ae67595c3e
Rewrite mpd_update_playback_state()
- no longer make destructive changes to the state
 - use "duration" and support millisecond precision
 - clean up
2017-01-28 01:53:57 +01:00
Přemysl Eric Janouch efc14a94f0
Trivial source code fixes 2017-01-27 23:53:09 +01:00
Přemysl Eric Janouch acd6e32983
Fix memory leaks in uses of the MPD_SIMPLE macro 2017-01-24 16:25:42 +01:00
Přemysl Eric Janouch 912b424515
Use binary search for key bindings 2017-01-24 16:23:20 +01:00
Přemysl Eric Janouch 9697898b42
Update copyright years 2017-01-24 00:18:03 +01:00
Přemysl Eric Janouch 30498ff856
Fix visual regression 2017-01-24 00:12:46 +01:00
Přemysl Eric Janouch f76b060dc2
Mark some memory leaks to be fixed 2017-01-23 23:32:59 +01:00
Přemysl Eric Janouch a1e9d660bd
Bump liberty 2017-01-23 23:32:30 +01:00
Přemysl Eric Janouch fc5981a361
Cleanup 2017-01-17 19:29:39 +01:00
Přemysl Eric Janouch 4aea3239b9
Improve double click detection 2016-11-20 23:15:28 +01:00
Přemysl Eric Janouch 1fa2ddbdfd
Fix launch w/o configuration 2016-11-20 23:14:47 +01:00
Přemysl Eric Janouch b9a27cf187
Use case insensitive ordering 2016-10-23 18:51:07 +02:00
Přemysl Eric Janouch 214c6e848b
Show song length in the playlist 2016-10-23 01:01:07 +02:00
Přemysl Eric Janouch 1a1347839c
Handle double clicks on items 2016-10-13 14:03:17 +02:00
Přemysl Eric Janouch 62ac29993e
Nicer playlist 2016-10-13 02:03:32 +02:00
Přemysl Eric Janouch a8deb3c218
Factor out mpd_parse_kv() 2016-10-13 01:50:00 +02:00
Přemysl Eric Janouch 62a08ad4d3
Clean up mpd_process_info(), bump liberty
"command_list_ok_begin" allows us to partition the response easily.
2016-10-13 01:50:00 +02:00
Přemysl Eric Janouch 5bf0410587
Simplify mpd_process_info()
At a cost but still a win as I see it.
2016-10-13 01:49:56 +02:00
Přemysl Eric Janouch fd1d918832
Clean up library_tab_on_data() 2016-10-13 00:48:02 +02:00
Přemysl Eric Janouch 0c65af91d9
First round of Library tab cleanups 2016-10-12 23:45:48 +02:00
Přemysl Eric Janouch e92a23d679
Rename "user actions" to "actions" 2016-10-12 16:06:23 +02:00
Přemysl Eric Janouch ea6b12ba7d
Hack together a Library tab
This needs serious clean up.  Even though it's not the first iteration.
2016-10-12 15:23:38 +02:00
Přemysl Eric Janouch d364f28039
Fix view after playlist update 2016-10-12 15:10:38 +02:00
Přemysl Eric Janouch 7b79dc3e57
Try to optimize playlists
I'm not entirely sure about this.
2016-10-12 15:10:32 +02:00
Přemysl Eric Janouch 4542bdd239
Move the MPD client interface to liberty
It seems like there aren't going to be any big changes any time soon.
2016-10-11 10:58:38 +02:00
Přemysl Eric Janouch b3d9ac2514
Allow switching tabs with just numbers 2016-10-11 10:58:38 +02:00
Přemysl Eric Janouch c0e07ec5d1
Add some actions, implement playlist control 2016-10-11 10:58:14 +02:00
Přemysl Eric Janouch 0b9e21c7fe
Fix regression in appearance 2016-10-10 16:30:15 +02:00
Přemysl Eric Janouch d9f992b23d
Add a dumb Current tab 2016-10-10 16:25:16 +02:00
Přemysl Eric Janouch 01ab646b11
Clean up initialization a bit 2016-10-10 11:13:52 +02:00
Přemysl Eric Janouch e513102318
Rewrite Streams code to be more asynchronous
Also made cURL troubleshooting easier by adding a debug callback.
2016-10-10 10:40:12 +02:00
Přemysl Eric Janouch 29bc035ecf
Ensure UTF-8 when parsing playlists 2016-10-10 10:16:28 +02:00
Přemysl Eric Janouch 44e19d68f0
Bump liberty 2016-10-10 07:48:18 +02:00
Přemysl Eric Janouch 7944a91707
Factor out an abstraction for cURL multi interface 2016-10-10 07:45:17 +02:00
Přemysl Eric Janouch 1f565b4d32
Make the Streams tab actually work
Clean up work is required now.
2016-10-09 09:48:47 +02:00
Přemysl Eric Janouch 4480d3c0cf
Further simplify terminal output
Most mess has been eliminated now, I believe.

Also fixing a bug in row_buffer_space().
2016-10-07 22:15:46 +02:00
Přemysl Eric Janouch 44f114fc3b
Omitted part of the beeping commit 2016-10-07 21:41:32 +02:00
Přemysl Eric Janouch 6edf3d945e
Improve row_buffer_ellipsis()
Fixing a minor appearance regression from one of the last commits.
2016-10-07 00:51:49 +02:00
Přemysl Eric Janouch 4a1646c7e9
Beep on unhandled events
We have app_quit(), let's use the return booleans for something better.
2016-10-07 00:36:43 +02:00
Přemysl Eric Janouch f9744711b5
Simplify row_buffer_ellipsis() invocation 2016-10-07 00:19:22 +02:00
Přemysl Eric Janouch 74e6dd22ff
Factor out stupid column alignment loops 2016-10-06 07:21:36 +02:00
Přemysl Eric Janouch 54936c4bcb
Further optimize terminal output
By calling addstr() once instead of several addch() calls.

As a side effect, it's becoming easier to ditch ncurses altogether.
2016-10-06 07:03:51 +02:00
Přemysl Eric Janouch ca38c1d91a
Add CMakeLists.txt, link with cURL
My global .gitignore seems to be more trouble than it's worth.
2016-10-06 03:29:32 +02:00
Přemysl Eric Janouch c6e337e5c5
Add some actions for songs 2016-10-06 03:29:32 +02:00
Přemysl Eric Janouch 53ac2cf2c0
Clean up tab code, prepare for custom handlers 2016-10-06 03:29:32 +02:00
Přemysl Eric Janouch 2c7e8e3311
Add a non-functional Streams tab
Bump liberty.
2016-10-06 03:29:32 +02:00
Přemysl Eric Janouch dff58b1c16
Fill the Info tab with actual information 2016-10-05 02:54:43 +02:00
Přemysl Eric Janouch d723f9523f
Fix regression in Home/End handling 2016-10-05 02:53:09 +02:00
Přemysl Eric Janouch 16a19282cb
Some further shuffling and renaming 2016-10-05 01:55:06 +02:00
Přemysl Eric Janouch a59f0b237e
Rearrange code
I need to update tabs from MPD message handlers.
2016-10-05 01:13:48 +02:00
Přemysl Eric Janouch 319d0faffa
Don't advance the timer when not playing
Stupid regression.
2016-10-05 00:13:15 +02:00
Přemysl Eric Janouch 515d11114b
Postpone redraws
This solves a performance problem in debug mode.

But overall the has been simplified, with some renames taking place.
2016-10-04 23:44:43 +02:00
Přemysl Eric Janouch 07e3aafd84
Simplify some terminal output 2016-10-04 22:40:58 +02:00
Přemysl Eric Janouch fec9f83cbc
Optimize row_buffer
It was one of two obvious hotspots.
2016-10-04 21:32:13 +02:00
Přemysl Eric Janouch 859c9d2737
Enhance time tracking
Now with eliminated timer drift.
2016-10-04 18:33:14 +02:00
Přemysl Eric Janouch 87f5eddea0
Bump termo, use termo_strpkey_utf8() 2016-10-04 13:27:48 +02:00
Přemysl Eric Janouch 4a5be612c5
Stubplement an Info tab, make Help special 2016-10-04 07:13:24 +02:00
Přemysl Eric Janouch 8dff378617
Fix crash when not in debug mode 2016-10-04 06:47:30 +02:00
Přemysl Eric Janouch ac2c7d5108
Make the help tab useful 2016-10-04 06:43:24 +02:00
Přemysl Eric Janouch 2b77d65d4b
Add alternative bindings for home/end 2016-10-04 06:17:50 +02:00
Přemysl Eric Janouch 93e76a2221
Fix display of >=60 minute songs 2016-10-04 06:17:27 +02:00
Přemysl Eric Janouch 1e39ae52c5
Make the debug tab prettier
And the MPD code a little bit more generic.
2016-10-03 19:43:51 +02:00