Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

bcmeter.h

Go to the documentation of this file.
00001 #ifndef BCMETER_H
00002 #define BCMETER_H
00003 
00004 #include "bcmeter.inc"
00005 #include "bcsubwindow.h"
00006 #include "units.h"
00007 
00008 #define METER_TYPES 2
00009 
00010 #define METER_DB 0
00011 #define METER_INT 1
00012 #define METER_VERT 0
00013 #define METER_HORIZ 1
00014 
00015 // Distance from subwindow border to top and bottom tick mark
00016 #define METER_MARGIN 0
00017 
00018 class BC_Meter : public BC_SubWindow
00019 {
00020 public:
00021         BC_Meter(int x, 
00022                 int y, 
00023                 int orientation, 
00024                 int pixels, 
00025                 int min, /* = -40, */
00026                 int max,
00027                 int mode, /* = METER_DB, */
00028                 int use_titles, /* = 0, */
00029 // Number of updates before over dissappears
00030                 long over_delay, /* = 150, */
00031 // Number of updates before peak updates
00032                 long peak_delay /* = 15 */);
00033         virtual ~BC_Meter();
00034 
00035         int initialize();
00036         void set_images(VFrame **data);
00037         int set_delays(int over_delay, int peak_delay);
00038         int region_pixel(int region);
00039         int region_pixels(int region);
00040         virtual int button_press_event();
00041 
00042         static int get_title_w();
00043         static int get_meter_w();
00044         int update(float new_value, int over);
00045         int reposition_window(int x, int y, int pixels);
00046         int reset();
00047         int reset_over();
00048         int change_format(int mode, int min, int max);
00049 
00050 private:
00051         void draw_titles();
00052         void draw_face();
00053         int level_to_pixel(float level);
00054         void get_divisions();
00055 
00056         BC_Pixmap *images[TOTAL_METER_IMAGES];
00057         int orientation;
00058 // Number of pixels in the longest dimension
00059         int pixels;
00060         int low_division;
00061         int medium_division;
00062         int high_division;
00063         int use_titles;
00064 // Tick mark positions
00065         ArrayList<int> tick_pixels;
00066 // Title positions
00067         ArrayList<int> title_pixels;
00068         ArrayList<char*> db_titles;
00069         float level, peak;
00070         int mode;
00071         DB db;
00072         int peak_timer;
00073 
00074 
00075 
00076 
00077 
00078 
00079         int peak_pixel, level_pixel, peak_pixel1, peak_pixel2;
00080         int over_count, over_timer;
00081         int min;
00082         int max;
00083         long over_delay;       // Number of updates the over warning lasts.
00084         long peak_delay;       // Number of updates the peak lasts.
00085 };
00086 
00087 #endif

Generated on Sun Jan 8 13:26:32 2006 for Guicast-svn by  doxygen 1.4.4