Changeset 22082 in project


Ignore:
Timestamp:
12/19/10 23:47:31 (10 years ago)
Author:
Moritz Heidkamp
Message:

pulseaudio: add volume->percent

Location:
release/4/pulseaudio/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/pulseaudio/trunk/pulseaudio-lolevel.scm

    r22071 r22082  
    1818 sink-input-info-mute
    1919
    20  volume->linear volume->string
     20 volume->linear volume->string volume->percent
    2121 cvolume-channels cvolume-values)
    2222
  • release/4/pulseaudio/trunk/types.scm

    r22069 r22082  
    153153(define-foreign-type volume unsigned-int32)
    154154
     155(define-foreign-variable volume-norm volume "PA_VOLUME_NORM")
    155156(define volume->linear (foreign-lambda double pa_sw_volume_to_linear volume))
    156157
     
    160161     s (number-of-bytes s) v)
    161162    (string-trim-both s)))
     163
     164(define (volume->percent v)
     165  (/ (* v 100) volume-norm))
    162166
    163167(define-foreign-record-type (cvolume "struct pa_cvolume")
Note: See TracChangeset for help on using the changeset viewer.