Files
Iris/src/js/services/mopidy/actions.js

57 lines
872 B
JavaScript
Raw Normal View History

/**
* Actions and Action Creators
**/
export function setConfig( config ){
return {
type: 'MOPIDY_SET_CONFIG',
config: config
}
}
export function connect(){
return {
type: 'MOPIDY_CONNECT'
}
}
export function disconnect(){
2016-10-18 08:56:53 +13:00
return {
type: 'MOPIDY_DISCONNECT'
2016-10-18 08:56:53 +13:00
}
}
export function changeTrack( tlid ){
return {
type: 'MOPIDY_CHANGE_TRACK',
call: 'playback.play',
value: { tlid: tlid }
}
}
2016-10-19 14:09:34 +13:00
export function playTracks( uris ){
return {
type: 'MOPIDY_PLAY_TRACKS',
call: 'tracklist.add',
value: { at_position: 0, uris: uris }
}
}
export function removeTracks( tlids ){
return {
type: 'MOPIDY_REMOVE_TRACKS',
call: 'tracklist.remove',
value: { tlid: tlids }
}
}
export function instruct( call, value ){
return {
type: 'MOPIDY_INSTRUCT',
call: call,
value: value
}
}