packages feed

hXmixer 0.2.0.0 → 0.2.5.0

raw patch · 2 files changed

+7/−10 lines, 2 files

Files

hXmixer.cabal view
@@ -1,5 +1,5 @@ name:                hXmixer
-version:             0.2.0.0
+version:             0.2.5.0
 synopsis:            A Gtk mixer application for FreeBSD
 description:         A Gtk mixer application for FreeBSD
 homepage:            http://colinrmitchell.endoftheinternet.org/
src/MixerQuery.hs view
@@ -36,12 +36,9 @@ 
 -- | Sets the volume of a channel.
 setVol :: String -> String -> Int -> Int -> IO ()
-setVol mixer channel left right 
-   | mixer == "Default"
-      = (runInteractiveCommand 
-         (unwords ["mixer", channel, (show left) ++ ":" ++ (show right)]))
-            >>= \_ -> return ()
-   | otherwise
-      = (runInteractiveCommand 
-         (unwords ["mixer", "-f", mixer, channel, (show left) ++ ":" ++ (show right)]))
-            >>= \_ -> return ()
+setVol "Default" channel left right =
+   setVolCmd ["mixer", channel, (show left) ++ ":" ++ (show right)]
+setVol mixer channel left right =
+   setVolCmd ["mixer", "-f", mixer, channel, (show left) ++ ":" ++ (show right)]
+   
+setVolCmd cmd = (runInteractiveCommand $ unwords cmd) >>= \_ -> return ()