Commit graph

44 commits

Author SHA1 Message Date
Paul Lietar
0da9020ad3 Store DeviceState directly into SpircTask 2017-01-20 14:44:13 +00:00
Paul Lietar
bcedfefaa9 Move spirc to tokio 2017-01-20 13:28:13 +00:00
Paul Lietar
bcbd7afb1a Change mercury to use tokio 2017-01-20 01:59:47 +00:00
Paul Lietar
d27063d5da Create event loop in main 2017-01-20 01:59:46 +00:00
Jörg Krause
c1e570f48d Say goodbye when terminating
When librespot is terminated while a session is active it will now send
a goodbye message, so that the Spotify client unregisters the device
from its list.

Closes: #114
2016-09-20 21:00:01 +02:00
Jörg Krause
0716643ae3 Fix out of bounds panic
Selecting a librespot device with the Spotify desktop client causes a
crash if the playlist is empty.

Take into account the case where an empty list of tracks is received. In
this case notify the desktop client, so it will accept the device and
turn the status bar green.

Closes: #71
2016-08-23 23:49:19 +02:00
Paul Lietar
edb8a6a766 Cleanup authentication logic 2016-04-24 12:15:53 +01:00
Marcus Thiesen
b0ea636179 Replace some more println with log 2016-04-23 13:35:00 +02:00
Paul Lietar
230c891df0 Print librespot version on startup. 2016-03-17 03:31:57 +00:00
Paul Lietar
0770f6ce61 Move authentication to a different directory, and make discover use hyper. 2016-03-17 03:28:28 +00:00
Paul Lietar
c3c258dfaf Bump protobuf-macros version and use the simpler string literal syntax 2016-02-22 05:48:58 +00:00
Paul Lietar
c700315b30 Fix a deadlock between SpircManager and Player.
The player was invoking its observers with the state locked, and the
SpircManager’s registered observer would try to lock it again.

Instead, the observers are invoked with a cloned state, and the SpircManager
avoids locking the state again.
2016-02-22 05:41:37 +00:00
Paul Lietar
95d1dfd774 Make recipient of SpircManager methods non-mut.
SpircManager has interior mutability using a Mutex. There’s no need to
make it’s methods take a mut reference.
2016-02-19 00:03:08 +00:00
Simon Persson
3ccb2e2a10 Clean up before merging. 2016-02-19 00:02:41 +01:00
Simon Persson
c98ff9bd54 Make SpricManager cloneable to simplify for clients. 2016-02-17 20:53:25 +01:00
Simon Persson
906241b92e Export the current queue. 2016-02-17 20:53:25 +01:00
Simon Persson
8e0325c297 Add function for sending load comand. 2016-02-17 20:53:25 +01:00
Simon Persson
5e3404137f Add support for replacing tracks. Make a builder out of send_cmd. 2016-02-17 20:53:21 +01:00
Simon Persson
08cb429a0c Add functions for sending commands to other clients. 2016-02-17 20:45:01 +01:00
Simon Persson
677173d01b Export devices. 2016-02-17 20:45:01 +01:00
Simon Persson
5a19d38270 Refactor notify/notify_with_player_state. 2016-02-17 20:45:01 +01:00
Simon Persson
958d0c74d4 Maintain list of connected devices. 2016-02-17 20:44:54 +01:00
Paul Lietar
93640465dc Import librespot_protocol as protocol. 2016-01-27 10:40:00 +00:00
Paul Lietar
7a1db5f5a9 Encapsulate the session data and configuration. 2016-01-26 22:34:57 +00:00
Paul Lietar
8fed885595 Reorganize the spirc/player interaction.
Updates are now sent through a callback mechanism rather than a channel.
2016-01-20 15:52:50 +00:00
Paul Lietar
463ce97661 Remove the SpircDelegate abstraction 2016-01-20 14:11:49 +00:00
Paul Lietar
303121032d Store the volume as a u16 2016-01-20 13:55:36 +00:00
Paul Lietar
c5ed04f70d Merge remote-tracking branch 'realtwister/queue' 2016-01-20 13:51:35 +00:00
Paul Lietar
ac0d597e75 Ignore files which don’t have an id.
Fixes #42
2016-01-20 10:37:57 +00:00
Erik
6f962089fd added queue functionality and created load_tracks 2016-01-16 02:15:24 +01:00
Erik
4310162b88 Fixed the multiple volume vars and the calculation is a bit simplified. 2016-01-15 01:12:08 +01:00
Erik
17a5bb122a Added Volume in a fishy manner by modulating stream, could maybe be optimized. 2016-01-14 13:12:01 +01:00
Erik
3c8d709ff1 Added: Next and Previous track
Bug resolved: opening a list with "dissallowed tracks" is now possible
2016-01-14 04:27:34 +01:00
Paul Lietar
90eeed3f80 rustfmt 2016-01-02 16:20:35 +01:00
Paul Lietar
bead9daf78 Add zeroconf based authentication. 2016-01-02 00:27:08 +01:00
Paul Lietar
4806f3e85a mercury: Register subscription for all channel aliases
When subscribing to a channel, we may actually end up subscribed to other
alias channels. We must track these as well in order to redirect received
messages properly.
2016-01-02 00:02:22 +01:00
Jaime Rodriguez
e321379501 Use canonical username when subscribing to spirc.
Uses canonical username that APWelcome message
contains once authenticated instead of username 
provided by user. SpircManager now accesses it via
its Session field. 

Fixes #15
2015-12-30 20:11:46 +01:00
Paul Lietar
5db141066a Use eventual’s futures in metadata instead of rolling our own.
For now the object cache has been removed. It may be added back later.
2015-12-28 16:53:54 +01:00
Paul Lietar
0ebe8b9e82 Fox subscription URL for spirc.
For some reason the old URL doesn’t work in new clients.
Can’t remember where it came from.
2015-12-28 01:41:29 +01:00
Paul Lietar
267ccbe65e Fix build on latest rust. 2015-09-01 13:20:37 +02:00
Paul Lietar
1d76658fdf Support playing multiple tracks in a row 2015-07-09 23:09:40 +01:00
Paul Lietar
94503e351b Remove busy waiting in SpircManager. 2015-07-09 22:04:19 +01:00
Paul Lietar
1264394838 Add a SpircDelegate abstraction. 2015-07-09 21:08:14 +01:00
Tor Arne Vestbø
22e367214e Move SPIRC into librespot so it can be re-used by other applications 2015-07-08 23:01:15 +02:00