Commit graph

5 commits

Author SHA1 Message Date
Brice
d40c0f50db Cache volume across restarts (#220)
* create Volume struct for use with Cache

* add "volume" file to Cache

* load cached volume on start, intial overrides cached overrides default

* amend volume_to_mixer function to cache the volume on every change

* pass cache to Spirc and SpircTask so volume_to_mixer has access

* rustfmt changes

* revert volume_to_mixer function and Spirc/SpircTask cache variable

* Volume implements Copy, pass by value instead of reference

* clamp volume to 100 if cached value exceeds limit

* convert Volume to u16 internally, use float and round to convert hex->dec

* convert initial_volume and ConnectConfig.volume to u16 as well

* add cache_volume function to SpircTask

* remove conversion to/from percentage on cached volume

* consolidate device.set_volume, mixer.set_volume, and caching

* streamline intial volume logic
2018-05-17 03:15:17 +02:00
awiouy
4c2b641cad core API: move spotify_id to lib.rs 2018-02-13 07:57:28 +01:00
awiouy
c9ba73c9ef rustfmt: core 2018-02-11 12:37:08 +01:00
awiouy
d7fa1464ff core API: move mkdir_existing to cache.rs 2018-02-10 17:58:15 +01:00
awiouy
4c23803c84 core API: cache.rs 2018-02-09 21:29:29 +01:00
Renamed from core/src/cache/mod.rs (Browse further)