import System import Network.XMMS.Playback import Network.XMMS.Client import Network.XMMS.Medialib import Data.Map (Map) import Data.Map as Map import Prelude hiding (init) main = do connection <- init "tutorial3" xmmsPath <- catch (getEnv "XMMS_PATH") (\e -> return "") connectRes <- connect connection xmmsPath if connectRes == 0 then do errorMsg <- getLastError connection putStrLn $ "Connection failed: " ++ errorMsg else do print "1" result <- currentID connection print "2" resultWait result print "3" returnValue <- resultGetValue result print "4" case returnValue of XMMSError msg -> putStrLn $ "playback start returned error: " ++ msg XMMSInt id -> do putStrLn $ "playing track with ID:" ++ show id result <- medialibGetInfo connection id print "5" resultWait result print "6" returnValue <- resultGetValue result print "7" case returnValue of XMMSDict dict -> mapM_ (\(key, value) -> print (key ++ " : " ++ show value)) (assocs $ propdictToDict dict) _ -> error "not a dictionary" return () _ -> return ()