import { CLOSE_WINAMP , OPEN_WINAMP , STOP , TOGGLE_VISUALIZER_STYLE , CLOSE_REQUESTED , MINIMIZE_WINAMP , SET_FOCUS , UNSET_FOCUS , LOAD_SERIALIZED_STATE , LOAD_DEFAULT_SKIN , SET_MILKDROP_DESKTOP , SET_MILKDROP_FULLSCREEN , TOGGLE_PRESET_OVERLAY , STEP_MARQUEE , SET_BAND_FOCUS , } from "../actionTypes" ; import { WINDOWS } from "../constants" ; import { Thunk , Action , Slider } from "../types" ; import { SerializedStateV1 } from "../serializedStates/v1Types" ; import * as Selectors from "../selectors" ; import { ensureWindowsAreOnScreen , setFocusedWindow } from "./windows" ; export { toggleDoubleSizeMode , toggleEqualizerShadeMode , togglePlaylistShadeMode , closeWindow , setWindowSize , toggleWindow , updateWindowPositions , toggleMainWindowShadeMode , centerWindowsInContainer , centerWindowsInView , resetWindowSizes , browserWindowSizeChanged , ensureWindowsAreOnScreen , stackWindows , toggleLlamaMode , setFocusedWindow , } from "./windows" ; export { play , pause , stop , nextN , next , previous , seekToTime , seekForward , seekBackward , setVolume , playTrack , playTrackNow , adjustVolume , scrollVolume , setBalance , toggleRepeat , toggleShuffle , toggleTimeMode , } from "./media" ; export { setEqBand , setEqToMax , setEqToMid , setEqToMin , setPreamp , toggleEq , toggleEqAuto , } from "./equalizer" ; export { addTracksFromReferences , loadFilesFromReferences , setSkinFromUrl , openEqfFileDialog , openMediaFileDialog , openSkinFileDialog , fetchMediaDuration , loadMedia , loadMediaFiles , loadMediaFile , fetchMediaTags , setEqFromFileReference , downloadPreset , setEqFromObject , downloadHtmlPlaylist , addDirAtIndex , addFilesAtIndex , addFilesFromUrl , addFilesFromList , saveFilesToList , droppedFiles , } from "./files" ; export { cropPlaylist , removeSelectedTracks , removeAllTracks , reverseList , randomizeList , sortListByTitle , setPlaylistScrollPosition , scrollNTracks , scrollPlaylistByDelta , scrollUpFourTracks , scrollDownFourTracks , dragSelected , selectAll , selectZero , invertSelection , } from "./playlist" ; export { initializePresets , requestPresetAtIndex , selectRandomPreset , selectNextPreset , selectPreviousPreset , appendPresetFileList , handlePresetDrop , loadPresets , toggleRandomizePresets , togglePresetCycling , scheduleMilkdropMessage , } from "./milkdrop" ; export function close ( ) { return ( dispatch ) => { let defaultPrevented = false ; const cancel = ( ) => { defaultPrevented = true ; } ; dispatch ( { type : CLOSE_REQUESTED , cancel } ) ; if ( ! defaultPrevented ) { dispatch ( { type : STOP } ) ; dispatch ( { type : CLOSE_WINAMP } ) ; } } ; } export function open ( ) { return { type : OPEN_WINAMP } ; } export function toggleVisualizerStyle ( ) { return { type : TOGGLE_VISUALIZER_STYLE } ; } export function minimize ( ) { return { type : MINIMIZE_WINAMP } ; } export function setFocus ( input ) { return { type : SET_FOCUS , input } ; } export function unsetFocus ( ) { return { type : UNSET_FOCUS } ; } export function focusBand ( band ) { return { type : SET_BAND_FOCUS , input : "eq" , bandFocused : band } ; } export function loadSerializedState ( serializedState ) { return ( dispatch ) => { dispatch ( { type : LOAD_SERIALIZED_STATE , serializedState } ) ; dispatch ( ensureWindowsAreOnScreen ( ) ) ; } ; } export function loadDefaultSkin ( ) { return { type : LOAD_DEFAULT_SKIN } ; } export function toggleMilkdropDesktop ( ) { return ( dispatch , getState ) => { if ( Selectors . getMilkdropDesktopEnabled ( getState ( ) ) ) { dispatch ( { type : SET_MILKDROP_DESKTOP , enabled : false } ) ; } else { dispatch ( { type : SET_MILKDROP_DESKTOP , enabled : true } ) ; } } ; } export function setMilkdropFullscreen ( enabled ) { return { type : SET_MILKDROP_FULLSCREEN , enabled } ; } export function toggleMilkdropFullscreen ( ) { return ( dispatch , getState ) => { dispatch ( setMilkdropFullscreen ( ! Selectors . getMilkdropFullscreenEnabled ( getState ( ) ) ) ) ; } ; } export function togglePresetOverlay ( ) { return ( dispatch , getState ) => { if ( Selectors . getPresetOverlayOpen ( getState ( ) ) ) { dispatch ( setFocusedWindow ( WINDOWS . MILKDROP ) ) ; } dispatch ( { type : TOGGLE_PRESET_OVERLAY } ) ; } ; } export function stepMarquee ( ) { return { type : STEP_MARQUEE } ; }