summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors/MPD.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Plugins/Monitors/MPD.hs')
-rw-r--r--src/Plugins/Monitors/MPD.hs13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/Plugins/Monitors/MPD.hs b/src/Plugins/Monitors/MPD.hs
index daf0ed4..60c3e48 100644
--- a/src/Plugins/Monitors/MPD.hs
+++ b/src/Plugins/Monitors/MPD.hs
@@ -30,9 +30,6 @@ data MOpts = MOpts
{ mPlaying :: String
, mStopped :: String
, mPaused :: String
- , mHost :: String
- , mPort :: Integer
- , mPassword :: String
}
defaultOpts :: MOpts
@@ -40,9 +37,6 @@ defaultOpts = MOpts
{ mPlaying = ">>"
, mStopped = "><"
, mPaused = "||"
- , mHost = "127.0.0.1"
- , mPort = 6600
- , mPassword = ""
}
options :: [OptDescr (MOpts -> MOpts)]
@@ -50,15 +44,12 @@ options =
[ Option "P" ["playing"] (ReqArg (\x o -> o { mPlaying = x }) "") ""
, Option "S" ["stopped"] (ReqArg (\x o -> o { mStopped = x }) "") ""
, Option "Z" ["paused"] (ReqArg (\x o -> o { mPaused = x }) "") ""
- , Option "h" ["host"] (ReqArg (\x o -> o { mHost = x }) "") ""
- , Option "p" ["port"] (ReqArg (\x o -> o { mPort = read x }) "") ""
- , Option "x" ["password"] (ReqArg (\x o -> o { mPassword = x }) "") ""
]
runMPD :: [String] -> Monitor String
runMPD args = do
opts <- io $ mopts args
- let mpd = M.withMPDEx (mHost opts) (mPort opts) (mPassword opts)
+ let mpd = M.withMPD
status <- io $ mpd M.status
song <- io $ mpd M.currentSong
s <- parseMPD status song opts
@@ -100,7 +91,7 @@ parseSong (Right Nothing) = return $ repeat ""
parseSong (Right (Just s)) =
let join [] = ""
join (x:xs) = foldl (\a o -> a ++ ", " ++ o) x xs
- str sel = maybe "" join (M.sgGet sel s)
+ str sel = maybe "" join (M.sgGetTag sel s)
sels = [ M.Name, M.Artist, M.Composer, M.Performer
, M.Album, M.Title, M.Track, M.Genre ]
fields = M.sgFilePath s : map str sels