zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

VuMeter.h (760B)


      1 /*
      2   ZynAddSubFX - a software synthesizer
      3 
      4   VuMeter.h - VU Meter
      5   Copyright (C) 2016 Mark McCurry
      6 
      7   This program is free software; you can redistribute it and/or
      8   modify it under the terms of the GNU General Public License
      9   as published by the Free Software Foundation; either version 2
     10   of the License, or (at your option) any later version.
     11 */
     12 #ifndef VU_METER_H
     13 #define VU_METER_H
     14 #include <FL/Fl_Box.H>
     15 
     16 class VuMeter: public Fl_Box
     17 {
     18     public:
     19 
     20         VuMeter(int x,int y, int w, int h, const char *label=0)
     21             :Fl_Box(x,y,w,h,label)
     22         {}
     23 
     24     protected:
     25         float limit(float x)
     26         {
     27             if(x<0.0)
     28                 x=0.0;
     29             else if(x>1.0)
     30                 x=1.0;
     31             return x;
     32         }
     33 };
     34 #endif