title: Draw sound wave with possibility to zoom in/out
body: <p>I'm writing a sound editor for my graduation. I'm using <a href="http://www.un4seen.com/bass.html" rel="nofollow noreferrer">BASS</a> to extract samples from MP3, WAV, OGG etc files and add DSP effects like echo, flanger etc. Simply speaching I made my framework that apply an effect from position1 to position2, cut/paste management.</p>
  
  <p>Now my problem is that I want to create a control similar with this one from <a href="http://recordrestoration.com/cool%20edit%20pro%20gui.gif" rel="nofollow noreferrer">Cool Edit Pro</a> that draw a wave form representation of the song and have the ability to zoom in/out select portions of the wave form etc. After a selection i can do something like:</p>
  
  <pre><code>TInterval EditZone = WaveForm-&gt;GetSelection();
  </code></pre>
  
  <p>where TInterval have this form:</p>
  
  <pre><code>struct TInterval
  {
      long Start;
      long End;
  }
  </code></pre>
  
  <p>I'm a beginner when it comes to sophisticated drawing so any hint on how to create a wave form representation of a song, using sample data returned by BASS, with ability to zoom in/out would be appreciated.</p>
  
  <p>I'm writing my project in C++ but I can understand C#, Delphi code so if you want you can post snippets in last two languages as well :) </p>
  
  <p>Thanx DrOptix</p>