Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make the high-level interface for proplist.

-- Fix some typo in the definition of `PropTag`.

-- Use `Data.Dependent.Map`.

-- Add comments for Haddock.
  • Loading branch information...
commit 8c90a0b367f1cc2f8adec42d96e734f7fba06875 1 parent 520ea61
@favonia authored
Showing with 18 additions and 3 deletions.
  1. +15 −2 Sound/Pulse/Properties.hs
  2. +3 −1 pulse.cabal
View
17 Sound/Pulse/Properties.hs
@@ -12,18 +12,31 @@ This module provides the high-level property list interface.
-}
module Sound.Pulse.Properties where
+import Data.Dependent.Map
+
+-- |Access mode. Used in 'DeviceAccessMode'.
data AccessMode = Mmap | MmapRewrite | Serial
+-- |Bus type. Used in 'DeviceBus'.
data Bus = Isa | Pci | Usb | Firewire | Bluetooth
+-- |Class of a device. Used in 'DeviceClass'.
data Class = Sound | Modem | Monitor | Filter
+-- |Form factor. Used in 'DeviceFormFactor'.
data FormFactor = Internal | Speaker | Handset | Tv | Webcam | Microphone | Headset | Headphone | HandsFree | Car | Hifi | Computer | Portable
+-- |Button clicked in an event. Used in 'EventMouseButton'.
data MouseButton = MouseLeft | MouseMiddle | MouseRight
+-- |Role of this media. Used in 'MediaRole' and 'DeviceIntendedRoles'.
data Role = Video | Music | Game | Event | Phone | Animation | Production | A11y | Test
+-- |A map serving the high-level interface of @pa_proplist@
+-- (<http://freedesktop.org/software/pulseaudio/doxygen/proplist_8h.html>).
+type PropList = DMap PropTag
+
+-- |The tag type used to build the map.
data PropTag a where
MediaName :: PropTag String
MediaTitle :: PropTag String
@@ -83,7 +96,7 @@ data PropTag a where
DeviceVendorName :: PropTag String
DeviceProductId :: PropTag Int -- FIXME : Device ID
DeviceProductName :: PropTag String
- DeviceClass :: PropTag String
+ DeviceClass :: PropTag Class
DeviceFormFactor :: PropTag String
DeviceBus :: PropTag Bus
DeviceIconName :: PropTag String
@@ -92,7 +105,7 @@ data PropTag a where
DeviceBufferingBufferSize :: PropTag Int
DeviceBufferingFragmentSize :: PropTag Int
DeviceProfileName :: PropTag String
- DeviceIntendedRoles :: PropTag [String]
+ DeviceIntendedRoles :: PropTag [Role]
DeviceProfileDescription :: PropTag String
ModuleAuthor :: PropTag String
View
4 pulse.cabal
@@ -36,7 +36,8 @@ Library
mtl >= 2 && < 3,
syb >= 0.2,
ConfigFile >= 1,
- template-haskell >= 2 && < 3
+ template-haskell >= 2 && < 3,
+ dependent-map >= 0.1 && < 0.2
Build-tools:
c2hs, hsc2hs
@@ -50,5 +51,6 @@ Test-Suite test-pulse
Build-depends:
base >= 3 && < 5,
mtl >= 2 && < 3,
+ dependent-map >= 0.1 && < 0.2,
QuickCheck,
pulse
Please sign in to comment.
Something went wrong with that request. Please try again.