~ubuntu-branches/ubuntu/wily/morse/wily-proposed

« back to all changes in this revision

Viewing changes to morse.d/beepALSA.c

  • Committer: Package Import Robot
  • Author(s): Nanakos Chrysostomos
  • Date: 2015-06-10 11:26:20 UTC
  • mfrom: (7.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20150610112620-q00v2tou9427gf42
Tags: 2.5-1
* New upstream release.
* Bump S-V to 3.9.6.
* Clean Lintian messages.
* Fix AlarmSet declaration and definition match (Closes: Bug#749420).
* Update watch file (Closes: Bug#784861).
* Fix build (omit morseALSA and morseLinux) for non-Linux arches
  - drop 02makefile.patch, build and install via debian/rules
* Fix -X crash (Closes: #716099, #716111, #716218, #716298)
* Adjust Maintainer/Uploaders fields

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
 
61
61
int Beep (int time, int volume, int pitch)
62
62
{
63
 
  static int      last_pitch = -1, last_n = -1, last_volume = -1;
64
 
  int             i, n, first_len, down_len, cycle;
65
 
  double          dt;
66
 
 
 
63
    int n;
67
64
  /*
68
65
   * Finagle the number of samples
69
66
   */
81
78
  if (volume <= 0) {
82
79
    snd_pcm_writei(handle, silence, channels*n);
83
80
  } else {
 
81
    static int      last_pitch = -1, last_n = -1, last_volume = -1;
 
82
    int             first_len, down_len, cycle;
84
83
    /*
85
84
     * clip to Nyquist
86
85
     * (Of course this means that if you ask for too high a frequency you
119
118
      last_pitch = pitch;
120
119
      last_n = n;
121
120
      last_volume = volume;
 
121
      double          dt;
 
122
      int i;
122
123
 
123
124
      dt = 2. * M_PI / cycle;   /* sine scale factor */
124
125