2016-10-14 22:42:45 +13:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Actions and Action Creators
|
|
|
|
|
**/
|
|
|
|
|
|
2016-10-18 21:57:29 +13:00
|
|
|
export function setConfig( config ){
|
2016-10-14 22:42:45 +13:00
|
|
|
return {
|
2016-10-18 21:57:29 +13:00
|
|
|
type: 'MOPIDY_SET_CONFIG',
|
|
|
|
|
config: config
|
2016-10-14 22:42:45 +13:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-18 21:57:29 +13:00
|
|
|
export function connect(){
|
2016-10-14 22:42:45 +13:00
|
|
|
return {
|
2016-10-18 21:57:29 +13:00
|
|
|
type: 'MOPIDY_CONNECT'
|
2016-10-16 12:37:37 +13:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-18 21:57:29 +13:00
|
|
|
export function disconnect(){
|
2016-10-18 08:56:53 +13:00
|
|
|
return {
|
2016-10-18 21:57:29 +13:00
|
|
|
type: 'MOPIDY_DISCONNECT'
|
2016-10-18 08:56:53 +13:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-16 12:37:37 +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 }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-16 12:37:37 +13:00
|
|
|
export function removeTracks( tlids ){
|
|
|
|
|
return {
|
|
|
|
|
type: 'MOPIDY_REMOVE_TRACKS',
|
|
|
|
|
call: 'tracklist.remove',
|
|
|
|
|
value: { tlid: tlids }
|
2016-10-14 22:42:45 +13:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function instruct( call, value ){
|
|
|
|
|
return {
|
2016-10-16 12:37:37 +13:00
|
|
|
type: 'MOPIDY_INSTRUCT',
|
2016-10-14 22:42:45 +13:00
|
|
|
call: call,
|
|
|
|
|
value: value
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|