renamed stopAfterCurrent -> pauseAfterCurrent
This commit is contained in:
+20
-20
@@ -7,26 +7,26 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
PingPath = "/ping"
|
||||
PlayPath = "/transport/play"
|
||||
PlayAlbumPath = "/transport/play-album" // ?id=<album ID>&t=<firstTrack>&s=<shuffle>
|
||||
PlayPlaylistPath = "/transport/play-playlist" // ?id=<playlist ID>&t=<firstTrack>&s=<shuffle>
|
||||
PlayTrackPath = "/transport/play-track" // ?id=<track ID>
|
||||
SearchAlbumPath = "/transport/search-album" // ?s=<searchQuery>
|
||||
SearchPlaylistPath = "/transport/search-playlist" // ?s=<searchQuery>
|
||||
SearchTrackPath = "/transport/search-track" // ?s=<searchQuery>
|
||||
PlayPausePath = "/transport/playpause"
|
||||
PausePath = "/transport/pause"
|
||||
StopPath = "/transport/stop"
|
||||
StopAfterCurrentPath = "/transport/stop-after-current"
|
||||
PreviousPath = "/transport/previous"
|
||||
NextPath = "/transport/next"
|
||||
TimePosPath = "/transport/timepos" // ?s=<seconds>
|
||||
SeekByPath = "/transport/seek-by" // ?s=<+/- seconds>
|
||||
VolumePath = "/volume" // ?v=<vol>
|
||||
VolumeAdjustPath = "/volume/adjust" // ?pct=<+/- percentage>
|
||||
ShowPath = "/window/show"
|
||||
QuitPath = "/window/quit"
|
||||
PingPath = "/ping"
|
||||
PlayPath = "/transport/play"
|
||||
PlayAlbumPath = "/transport/play-album" // ?id=<album ID>&t=<firstTrack>&s=<shuffle>
|
||||
PlayPlaylistPath = "/transport/play-playlist" // ?id=<playlist ID>&t=<firstTrack>&s=<shuffle>
|
||||
PlayTrackPath = "/transport/play-track" // ?id=<track ID>
|
||||
SearchAlbumPath = "/transport/search-album" // ?s=<searchQuery>
|
||||
SearchPlaylistPath = "/transport/search-playlist" // ?s=<searchQuery>
|
||||
SearchTrackPath = "/transport/search-track" // ?s=<searchQuery>
|
||||
PlayPausePath = "/transport/playpause"
|
||||
PausePath = "/transport/pause"
|
||||
StopPath = "/transport/stop"
|
||||
PauseAfterCurrentPath = "/transport/pause-after-current"
|
||||
PreviousPath = "/transport/previous"
|
||||
NextPath = "/transport/next"
|
||||
TimePosPath = "/transport/timepos" // ?s=<seconds>
|
||||
SeekByPath = "/transport/seek-by" // ?s=<+/- seconds>
|
||||
VolumePath = "/volume" // ?v=<vol>
|
||||
VolumeAdjustPath = "/volume/adjust" // ?pct=<+/- percentage>
|
||||
ShowPath = "/window/show"
|
||||
QuitPath = "/window/quit"
|
||||
)
|
||||
|
||||
type Response struct {
|
||||
|
||||
@@ -83,8 +83,8 @@ func (c *Client) Stop() error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *Client) StopAfterCurrent() error {
|
||||
_, err := c.sendRequest(StopAfterCurrentPath)
|
||||
func (c *Client) PauseAfterCurrent() error {
|
||||
_, err := c.sendRequest(PauseAfterCurrentPath)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ type PlaybackHandler interface {
|
||||
Continue()
|
||||
SeekBackOrPrevious()
|
||||
SeekNext()
|
||||
SetStopAfterCurrent(bool)
|
||||
SetPauseAfterCurrent(bool)
|
||||
SeekSeconds(float64)
|
||||
SeekBySeconds(float64)
|
||||
Volume() int
|
||||
@@ -83,8 +83,8 @@ func (s *serverImpl) createHandler() http.Handler {
|
||||
m.HandleFunc(PausePath, s.makeSimpleEndpointHandler(s.pbHandler.Pause))
|
||||
m.HandleFunc(PlayPausePath, s.makeSimpleEndpointHandler(s.pbHandler.PlayPause))
|
||||
m.HandleFunc(StopPath, s.makeSimpleEndpointHandler(s.pbHandler.Stop))
|
||||
m.HandleFunc(StopAfterCurrentPath, s.makeSimpleEndpointHandler(func() {
|
||||
s.pbHandler.SetStopAfterCurrent(true)
|
||||
m.HandleFunc(PauseAfterCurrentPath, s.makeSimpleEndpointHandler(func() {
|
||||
s.pbHandler.SetPauseAfterCurrent(true)
|
||||
}))
|
||||
m.HandleFunc(PreviousPath, s.makeSimpleEndpointHandler(s.pbHandler.SeekBackOrPrevious))
|
||||
m.HandleFunc(NextPath, s.makeSimpleEndpointHandler(s.pbHandler.SeekNext))
|
||||
|
||||
Reference in New Issue
Block a user