more jukebox work
This commit is contained in:
@@ -298,11 +298,16 @@ type JukeboxProvider interface {
|
||||
JukeboxStop() error
|
||||
JukeboxSeek(idx, seconds int) error
|
||||
JukeboxClear() error
|
||||
JukeboxSet(trackID string) error
|
||||
JukeboxAdd(trackID string) error
|
||||
JukeboxRemove(idx int) error
|
||||
JukeboxSetVolume(vol int) error
|
||||
JukeboxGetStatus() (*JukeboxStatus, error)
|
||||
|
||||
// Performs a Clear followed by an Add to set the queue
|
||||
// to contain a single track
|
||||
JukeboxSet(trackID string) error
|
||||
|
||||
// Sets the volume of the jukebox player (0-100)
|
||||
JukeboxSetVolume(vol int) error
|
||||
}
|
||||
|
||||
type JukeboxStatus struct {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package subsonic
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
||||
@@ -24,8 +25,9 @@ func (s *subsonicMediaProvider) JukeboxClear() error {
|
||||
}
|
||||
|
||||
func (s *subsonicMediaProvider) JukeboxSetVolume(vol int) error {
|
||||
v := float64(vol) / 100
|
||||
_, err := s.client.JukeboxControl("setGain",
|
||||
map[string]string{"gain": strconv.Itoa(vol)})
|
||||
map[string]string{"gain": fmt.Sprintf("%0.2f", v)})
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user