Commit Graph

56 Commits

Author SHA1 Message Date
Henrik Friedrichsen
71d42d489e Remove extern crate statements
https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html
2021-05-07 22:51:32 +02:00
Henrik Friedrichsen
98e572169b Implement track preloading
Will preload the next track close to the end of the currently playing
track. Should make playback of queued tracks a little smoother.
2021-04-11 15:54:32 +02:00
Henrik Friedrichsen
decf7c2aef Improve synchronization of playback times
Take librespot timestamps instead of approximating them in ncspot.
2021-04-11 15:17:10 +02:00
Henrik Friedrichsen
cea5228245 (Re)store currently playing track + shuffle state
Solves #448
2021-04-09 19:10:34 +02:00
Henrik Friedrichsen
0f573f8247 Refactor: Make Spotify cloneable 2021-04-03 22:35:08 +02:00
Henrik Friedrichsen
db894d7ce8 Add config values to override shuffle/repeat state 2021-02-25 21:07:12 +01:00
Henrik Friedrichsen
92d1978340 Save track queue when closing and restore at start 2021-02-22 22:14:34 +01:00
Henrik Friedrichsen
a880ffd1f6 Persist volume and shuffle/repeat state 2021-02-22 22:14:34 +01:00
André Andersson
92335594bc Restart queue if pressing play when stopped (#399)
* Restart queue if pressing play when stopped

* Remove FinishedTrack from match

* Formatting
2021-01-19 21:47:41 +01:00
Henrik Friedrichsen
63e65c32c9 update dependencies
rand 0.8.0 now accepts ranges
2021-01-03 23:24:45 +01:00
Henrik Friedrichsen
3874dc42f8 cargo clippy 2021-01-02 21:30:52 +01:00
Henrik Friedrichsen
013beb245b refactor: pass globally mutable config reference
Before, copies of the configuration were passed over. This change also
causes configuration reloads to affect the entire application and is
easier to maintain but introduces some RwLock overhead.
2020-10-18 13:09:45 +02:00
Moshe Sherman
fc79889665 play next (#278)
* add play next feature

* fix play_next insertion order

* fix play_next call for playable

* document play_next shortcut + reformat

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2020-10-04 16:58:55 +02:00
Moshe Sherman
7bf0cac6c0 handle last element removal in queue 2020-10-01 20:48:27 +02:00
Moshe Sherman
4e7ec60b0e disable repeat track if manualy skip song 2020-10-01 20:48:27 +02:00
Moshe Sherman
9872a10bfa adhere to repeat/shuffle settings on previous track 2020-10-01 20:48:27 +02:00
Moshe Sherman
181f5e4918 dont stop track 2020-10-01 20:48:27 +02:00
Henrik Friedrichsen
3893a6f5a0 add feature flag for song notifications
enables users/distributions to ship without dbus dependency
2020-09-07 23:50:45 +02:00
Henrik Friedrichsen
69f11cdcf7 gracefully handle error when showing notification
fixes #265
2020-09-07 23:38:37 +02:00
Henrik Friedrichsen
d2b9dffb54 fix: do not delete from empty queue
fixes #253
2020-08-21 00:13:54 +02:00
Henrik Friedrichsen
e5bc12b1ba use cfg of spotify object
TODO:
- apply this to other single config values that are passed directly, e.g. in the
  statusbar
- use a more appropriate object to hold `cfg`
2020-08-18 23:06:41 +02:00
Ronak Buch
097f59eb83 Add notifications 2020-08-18 23:06:38 +02:00
Henrik Friedrichsen
1b1d392ab8 podcast support (#203)
* implement search for shows/podcasts

* create Playable supertype for queue to contain tracks and episodes

* wip: implement playback of episodes

* load spotify id from uri instead of raw id to fix podcast playback

* show duration for podcast episodes

* implement generic status bar for playables (tracks and episodes)

omit saved indicator for now as the library does not yet support podcasts

* instead of only the last 50 fetch all episodes of a show

* refactor: extract Playable code to separate file

* implement playback/queuing of shows + sharing url

* implement podcast library

* migrate mpris code to Playable supertype
2020-07-14 10:38:22 +02:00
Henrik Friedrichsen
b6772225e0 rely on librespot status instead of guessing when a track is playing 2020-06-15 21:08:58 +02:00
Henrik Friedrichsen
4e7af1c920 add command/binding to jump to currently playing track
fixes #181
2020-04-18 21:57:41 +02:00
Henrik Friedrichsen
c6b85f7d9b only stop playback if the last item was deleted AND playing
fixes #159
2020-03-22 09:06:08 +01:00
Henrik Friedrichsen
dccb36d8e7 update to rust edition 2018 + bump version 2020-03-15 11:06:24 +01:00
dann-merlin
56a178dcfd Added configuration option for initial shuffle, repeat, volume 2020-03-03 18:05:03 +01:00
Henrik Friedrichsen
d2915316da various non-functional code cleanups 2020-02-21 23:33:08 +01:00
Tobias Langendorf
363e71242a Shuffle: Start with random track if not selecting track directly
Starting a playlist, album or artist with shuffle enabled always
starts on the first track in it and then plays the rest of the
queue shuffled.
This changes it so unless a track is picked directly, playback
will start on a random track of the selection.
2020-02-21 18:42:31 +01:00
Henrik Friedrichsen
54230bd85b show commands in help screen in the same syntax they are parsed 2020-02-05 22:48:35 +01:00
Rasmus Larsen
1e0d9ea952 Handle default command behavior 2019-05-21 16:01:56 +02:00
Henrik Friedrichsen
534ccc904f respect currently playing track when shifting queue entries 2019-04-07 14:14:56 +02:00
KoffeinFlummi
d223aae9c7 Add album and artist searching 2019-04-02 08:31:17 +02:00
Henrik Friedrichsen
fdb1d01d9a fix crash when adding list to randomized empty queue
with an empty queue the index calculation results in a negative value for
unsigned type usize.
2019-03-30 23:23:16 +01:00
Henrik Friedrichsen
4f8342da83 refactorial spring cleaning (cargo fmt + clippy) 2019-03-26 20:51:39 +01:00
KoffeinFlummi
9cf1e9945e Only regenerate random order if shuffle is enabled 2019-03-25 20:07:38 +01:00
KoffeinFlummi
45062bd89e Add shuffle and repeat 2019-03-25 18:32:51 +01:00
Henrik Friedrichsen
0807f6464f bugfix: don't panic when an invalid index is to be played
this can be triggered by commands or when hitting return in an empty queue
view. we shouldn't crash in that case..
2019-03-24 13:23:45 +01:00
Henrik Friedrichsen
9842b89457 remove obsolete events and callbacks 2019-03-17 22:14:59 +01:00
KoffeinFlummi
5a85619105 Add rebindable keys, refactor lists 2019-03-17 04:29:29 +01:00
KoffeinFlummi
9db8d0fcb3 Implement MPRIS D-Bus spec 2019-03-11 21:24:25 +01:00
Henrik Friedrichsen
392e3efb87 turn off autorefresh and redraw only on demand
this should significantly reduce CPU usage but is a little bit more complicated.
while we're at it, remove the different screen redraw events and use a combined
event for all screens.

TODO:
the spotify player still needs to update the statusbar at least every second.
2019-03-09 01:55:55 +01:00
Henrik Friedrichsen
75fd57108e add 'clear playlist' keybinding 2019-03-08 00:23:03 +01:00
Henrik Friedrichsen
b075c96134 update current_track when tracks before the current one are removed
also:
don't use events to update the queue UI
this makes the Add/Remove queue events useless, but we'll keep them for now

hopefully fixes #22
2019-03-07 17:33:45 +01:00
Henrik Friedrichsen
0b14fc5da7 transform simple queue to a preserving, more complex kind
this is a pretty big but necessary change and might not be stable yet.

some key points:
- the queue is now responsible for playback controls and track management, as
this was scattered between the queue and spotify objects.
- because the queue is now retained, it should be easier to save it as a
spotify playlist

closes #12
2019-03-06 23:59:33 +01:00
Henrik Friedrichsen
91e89c2970 introduce track data class 2019-03-06 00:15:28 +01:00
Henrik Friedrichsen
9507add6a4 more refined queue events + playlist delete binding
- move from listview to linearlayout + scrollview
- doesn't redraw the whole view on queue changes anymore
- uses new cursive functions for linearlayout (needs cursive git)

closes #3
2019-03-04 00:56:34 +01:00
Henrik Friedrichsen
a562f0b7a7 implement custom track button view (closes #2) 2019-03-03 00:16:17 +01:00
Henrik Friedrichsen
70d68f8854 cargo fmt 2019-02-27 23:12:43 +01:00