Assists music production by grouping standalone programs into sessions. Community version of "Non Session Manager".
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.5KB

  1. /*******************************************************************************/
  2. /* Copyright (C) 2013 Mark McCurry */
  3. /* Copyright (C) 2013 Jonathan Moore Liles */
  4. /* */
  5. /* This program is free software; you can redistribute it and/or modify it */
  6. /* under the terms of the GNU General Public License as published by the */
  7. /* Free Software Foundation; either version 2 of the License, or (at your */
  8. /* option) any later version. */
  9. /* */
  10. /* This program is distributed in the hope that it will be useful, but WITHOUT */
  11. /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
  12. /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
  13. /* more details. */
  14. /* */
  15. /* You should have received a copy of the GNU General Public License along */
  16. /* with This program; see the file COPYING. If not,write to the Free Software */
  17. /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  18. /*******************************************************************************/
  19. #include <FL/Fl_Box.H>
  20. class SpectrumView : public Fl_Box
  21. {
  22. static unsigned int _sample_rate;
  23. static float _fmin;
  24. static float _fmax;
  25. unsigned int _nframes;
  26. float * _data;
  27. float * _bands;
  28. float _dbmin;
  29. float _dbmax;
  30. bool _auto_level;
  31. void draw_curve ( void );
  32. void draw_semilog ( void );
  33. void analyze_data ( unsigned int plan_size );
  34. void clear_bands ( void );
  35. static void clear_plans ( void );
  36. public:
  37. static void sample_rate ( unsigned int sample_rate );
  38. /* set dB range. If min == max, then auto leveling will be enabled */
  39. void db_range ( float min, float max )
  40. {
  41. _dbmin = min;
  42. _dbmax = max;
  43. _auto_level = min == max;
  44. }
  45. /** /data/ must point to allocated memory. It will be freed when new data is set or when the control is destroyed */
  46. void data ( float *data, unsigned int data_frames );
  47. SpectrumView ( int X, int Y, int W, int H, const char *L=0 );
  48. virtual ~SpectrumView ( );
  49. virtual void resize ( int X, int Y, int W, int H );
  50. virtual void draw ( void );
  51. };