packages feed

XMMS-0.1: example/tut1.hs

import System
import Network.XMMS.Playback
import Network.XMMS.Client
import Prelude hiding (init)

main = do
    connection <- init "tutorial1"
    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 
        result <- start connection
        resultWait result
        returnValue <- resultGetValue result
        case returnValue of
            XMMSError msg -> putStrLn $ "playback start returned error: " ++ msg
            _ -> return ()