Platform specific portions:
- Monitor sleep
- Detect Monitor woken up by user mouse movement
- input idle time or set input idleness timer
- process sleep
- filesystem access for logfile and creating config dir.
   also, finding suitable home directory to store conf dir.
- time epoch
- termination signal handling
- ftp upload (phone home)

Other TODO items:
- high-pass filter white noise in freq response measurement.
- user's volume settings will affect calibration.  Can we solve this by using ration of delta to mean in recording?
- use strings instead of indices to identify audio devices to allow for device
   removal or addition.  Also, hide OSS devices because their names change.
- fix memory leaks
- Only works with Portaudio 1.9, which is only in the bleeding edge distros
- create ~/.sonarPM directory to store all associated files
- close portaudio stream on termination?
   AudioDev::check_error( Pa_CloseStream( strm ) ); // close ping stream

mingw32 notes:
- must compile portaudio.a first:
  - requires pthread: yum install mingw32-pthreads, then:
     cd /usr/i686-pc-mingw32/sys-root/mingw/lib/
     sudo ln -s libpthreadGC2.a libpthread.a
  - wget http://portaudio.com/archives/pa_stable_v19_20071207.tar.gz
  - cd portaudio; mingw32-env; cp ../Makefile.portaudio-mingw32 Makefile; make
- must install wxWidgets for win32 first:
    cd /usr/local/src
    sudo wget http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.10.zip
    sudo unzip wxMSW-2.8.10.zip
    sudo chown -R steve:steve wxMSW-2.8.10
    mkdir mingw32-static
    cd mingw32-static
    mingw32-env
    ../configure --build=i586-mingw32msvc --host=i586-mingw32msvc --disable-shared --prefix=/usr/local/wx-2.8.10-mingw32
    make
    sudo make install
- to build sonar: run "mingw32-env; make"

brightness notes:
- in linux can control backlight via HAL as follows:
dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/dell_lcd_panel org.freedesktop.Hal.Device.LaptopPanel.SetBrightness int32:7 
 - replace 7 with value in [0-7], find HAL device name with 'lshal' command
