Changeset e01a3af


Ignore:
Timestamp:
Sep 8, 2010, 8:24:09 PM (14 years ago)
Author:
Mats Ahlgren <mats@…>
Branches:
master, debian, mac, no-cups
Children:
bbede33
Parents:
3ee56cf
git-author:
Mats Ahlgren <mats@…> (09/08/10 20:24:09)
git-committer:
Mats Ahlgren <mats@…> (09/08/10 20:24:09)
Message:

the alsa volume number is soundcard-dependent, and may not be linear;
nevertheless, volume adjust now steps in smaller (yet still noticeable)
ramps of roughly +/-3dB as replicated on current hardware; this may
vary between hardware (check with 'volume-get'); if it does, one can
just grab the dB and ramp the dB linearly by going amixer set PCM XdB
where X is an *absolute* setting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • remctl/lib/gutenbach/volume-helper.py

    r3ee56cf re01a3af  
    3131                tempV = int(v + (newV-v)*frac)
    3232                command = ['amixer', 'set', 'PCM', str(tempV)]
     33                print tempV
     34                sys.stdout.flush()
    3335                call(command, stdout=PIPE)
    3436                time.sleep(0.3)
     
    3638v = getVolume()
    3739map = {
    38         '+': int(math.ceil( v*1.2 + .001 )),
    39         '-': int(math.floor( v/1.2 + .001 ))
     40        '+': int(math.ceil( v*1.13 + .001 )),
     41        '-': int(math.floor( v/1.13 + .001 ))
    4042}
    4143
    4244newVolume = map[arg]
    43 print 'Smoothly modifying over 3 seconds...'
     45print 'Smoothly modifying over 3 seconds... (from %i)' % v
    4446sys.stdout.flush()
    4547setVolume(newVolume)
Note: See TracChangeset for help on using the changeset viewer.