~ubuntu-branches/debian/squeeze/alsa-utils/squeeze

« back to all changes in this revision

Viewing changes to alsamixer/mixer_display.c

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Elimar Riesebieter, Jordi Mallach
  • Date: 2010-06-03 16:27:52 UTC
  • mfrom: (1.4.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100603162752-uspsz4bqdqf6dkcx
Tags: 1.0.23-2
[ Elimar Riesebieter ]
* Let dh_installinit install the LSB defaults. Thanks Sven Joachim for the
  hint. (closes: #584311)

[ Jordi Mallach ]
* Add a trailing newline to debian/NEWS to placate lintian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
390
390
        display_string_in_field(y, x, s, width, ALIGN_CENTER);
391
391
}
392
392
 
 
393
static long clamp(long value, long min, long max)
 
394
{
 
395
        if (value < min)
 
396
                return min;
 
397
        if (value > max)
 
398
                return max;
 
399
        return value;
 
400
}
 
401
 
393
402
static void display_control(unsigned int control_index)
394
403
{
395
404
        struct control *control;
462
471
                        err = snd_mixer_selem_get_capture_volume_range(control->elem, &min, &max);
463
472
                if (err < 0)
464
473
                        return;
 
474
                if (min >= max)
 
475
                        max = min + 1;
 
476
                volumes[0] = clamp(volumes[0], min, max);
 
477
                volumes[1] = clamp(volumes[1], min, max);
465
478
 
466
479
                if (control->flags & IS_ACTIVE)
467
480
                        wattrset(mixer_widget.window, 0);