#define SCOPEWINDOW_H
+#include "boxblur.inc"
#include "guicast.h"
#include "loadbalance.h"
#include "mwindow.h"
+#include "overlayframe.inc"
#include "pluginclient.h"
#include "recordmonitor.inc"
#include "scopewindow.inc"
#include "theme.inc"
+enum {
+ SCOPE_HISTOGRAM, SCOPE_HISTOGRAM_RGB,
+ SCOPE_WAVEFORM, SCOPE_WAVEFORM_RGB, SCOPE_WAVEFORM_PLY,
+ SCOPE_VECTORSCOPE, SCOPE_VECTORWHEEL,
+ SCOPE_SMOOTH, SCOPE_REFRESH, SCOPE_RELEASE,
+};
// Number of divisions in histogram.
// 65536 + min and max range to speed up the tabulation
#define HISTOGRAM_MAX 110
#define FLOAT_MAX 1.1
-#define MIN_SCOPE_W 320
-#define MIN_SCOPE_H 320
-
+#define MIN_SCOPE_W xS(320)
+#define MIN_SCOPE_H yS(320)
#define WAVEFORM_DIVISIONS 12
{
public:
ScopeUnit(ScopeGUI *gui, ScopeEngine *server);
- void draw_point(unsigned char **rows,
- int x,
- int y,
- int r,
- int g,
- int b);
void process_package(LoadPackage *package);
int bins[HIST_SECTIONS][TOTAL_BINS];
ScopeGUI *gui;
class ScopePanel : public BC_SubWindow
{
public:
- ScopePanel(ScopeGUI *gui,
- int x,
- int y,
- int w,
- int h);
+ ScopePanel(ScopeGUI *gui, int x, int y, int w, int h);
void create_objects();
virtual void update_point(int x, int y);
virtual void draw_point();
class ScopeWaveform : public ScopePanel
{
public:
- ScopeWaveform(ScopeGUI *gui,
- int x,
- int y,
- int w,
- int h);
+ ScopeWaveform(ScopeGUI *gui, int x, int y, int w, int h);
virtual void update_point(int x, int y);
virtual void draw_point();
virtual void clear_point();
class ScopeVectorscope : public ScopePanel
{
public:
- ScopeVectorscope(ScopeGUI *gui,
- int x,
- int y,
- int w,
- int h);
+ ScopeVectorscope(ScopeGUI *gui, int x, int y, int w, int h);
virtual void update_point(int x, int y);
virtual void draw_point();
virtual void clear_point();
+ void draw_point(float th, float r, int color);
+ void draw_radient(float th, float r1, float r2, int color);
+
int drag_radius;
float drag_angle;
};
class ScopeHistogram : public ScopePanel
{
public:
- ScopeHistogram(ScopeGUI *gui,
- int x,
- int y,
- int w,
- int h);
+ ScopeHistogram(ScopeGUI *gui, int x, int y, int w, int h);
void clear_point();
void update_point(int x, int y);
void draw_point();
int drag_x;
};
-class ScopeToggle : public BC_Toggle
+
+class ScopeScopesOn : public BC_MenuItem
{
public:
- ScopeToggle(ScopeGUI *gui,
- int x,
- int y,
- int *value);
- static VFrame** get_image_set(ScopeGUI *gui, int *value);
+ ScopeScopesOn(ScopeMenu *scope_menu, const char *text, int id);
int handle_event();
+
+ ScopeMenu *scope_menu;
+ int id;
+};
+
+class ScopeMenu : public BC_PopupMenu
+{
+public:
+ ScopeMenu(ScopeGUI *gui, int x, int y);
+ void create_objects();
+ void update_toggles();
+
ScopeGUI *gui;
- int *value;
+ ScopeScopesOn *hist_on;
+ ScopeScopesOn *hist_rgb_on;
+ ScopeScopesOn *wave_on;
+ ScopeScopesOn *wave_rgb_on;
+ ScopeScopesOn *wave_ply_on;
+ ScopeScopesOn *vect_on;
+ ScopeScopesOn *vect_wheel;
+};
+
+class ScopeSettingOn : public BC_MenuItem
+{
+public:
+ ScopeSettingOn(ScopeSettings *settings, const char *text, int id);
+ int handle_event();
+
+ ScopeSettings *settings;
+ int id;
+};
+
+class ScopeGratPaths : public ArrayList<const char *>
+{
+public:
+ ScopeGratPaths() { set_array_delete(); }
+ ~ScopeGratPaths() { remove_all_objects(); }
+};
+
+class ScopeGratItem : public BC_MenuItem
+{
+public:
+ ScopeGratItem(ScopeSettings *settings, const char *text, int idx);
+ int handle_event();
+
+ ScopeSettings *settings;
+ int idx;
+};
+
+class ScopeSettings : public BC_PopupMenu
+{
+public:
+ ScopeSettings(ScopeGUI *gui, int x, int y);
+ void create_objects();
+ void update_toggles();
+
+ ScopeGUI *gui;
+ ScopeSettingOn *smooth_on;
+ ScopeSettingOn *refresh_on;
+ ScopeSettingOn *release_on;
+};
+
+
+class ScopeGainReset : public BC_Button
+{
+public:
+ ScopeGainReset(ScopeGain *gain, int x, int y);
+ static int calculate_w(BC_Theme *theme);
+ int handle_event();
+
+ ScopeGain *gain;
+};
+
+class ScopeGainSlider : public BC_ISlider
+{
+public:
+ ScopeGainSlider(ScopeGain *gain, int x, int y, int w);
+
+ int handle_event();
+ ScopeGain *gain;
+};
+
+class ScopeGain
+{
+public:
+ ScopeGain(ScopeGUI *gui, int x, int y, int w, int *value);
+ ~ScopeGain();
+ static int calculate_h();
+ void create_objects();
+ void reposition_window(int x, int y);
+ int handle_event();
+
+ ScopeGUI *gui;
+ int x, y, w, *value;
+ int reset_w;
+ ScopeGainReset *reset;
+ ScopeGainSlider *slider;
+
+ int get_x() { return x; }
+ int get_y() { return y; }
+ int get_w() { return w; }
+ int get_h() { return calculate_h(); }
+};
+
+class ScopeWaveSlider : public ScopeGain
+{
+public:
+ ScopeWaveSlider(ScopeGUI *gui, int x, int y, int w);
+};
+
+class ScopeVectSlider : public ScopeGain
+{
+public:
+ ScopeVectSlider(ScopeGUI *gui, int x, int y, int w);
};
class ScopeGUI : public PluginClientWindow
{
public:
- ScopeGUI(Theme *theme,
- int x,
- int y,
- int w,
- int h,
- int cpus);
- ScopeGUI(PluginClient *plugin,
- int w,
- int h);
+ ScopeGUI(Theme *theme, int x, int y, int w, int h, int cpus);
+ ScopeGUI(PluginClient *plugin, int w, int h);
virtual ~ScopeGUI();
void reset();
void create_panels();
virtual int resize_event(int w, int h);
virtual int translation_event();
+ virtual void update_scope() {}
// Called for user storage when toggles change
virtual void toggle_event();
// update toggles
void update_toggles();
void calculate_sizes(int w, int h);
- void allocate_bitmaps();
+ void allocate_vframes();
void draw_overlays(int overlays, int borders, int flush);
+ void update_graticule(int idx);
+ void draw_colorwheel(VFrame *dst, int bg_color);
+ void draw_scope();
void process(VFrame *output_frame);
void draw(int flash, int flush);
void clear_points(int flash);
-
Theme *theme;
VFrame *output_frame;
+ VFrame *data_frame, *temp_frame;
ScopeEngine *engine;
- BC_Bitmap *waveform_bitmap;
- BC_Bitmap *vector_bitmap;
+ BoxBlur *box_blur;
+ VFrame *waveform_vframe;
+ VFrame *vector_vframe;
+ VFrame *wheel_vframe;
ScopeHistogram *histogram;
ScopeWaveform *waveform;
ScopeVectorscope *vectorscope;
- ScopeToggle *hist_parade_on;
- ScopeToggle *hist_on;
- ScopeToggle *waveform_parade_on;
- ScopeToggle *waveform_on;
- ScopeToggle *vector_on;
- BC_Title *value_text;
+ ScopeMenu *scope_menu;
+ ScopeWaveSlider *wave_slider;
+ ScopeVectSlider *vect_slider;
+ ScopeSettings *settings;
+ VFrame *grat_image;
+ OverlayFrame *overlay;
int x, y, w, h;
int vector_x, vector_y, vector_w, vector_h;
+ int vector_cx, vector_cy, radius;
int wave_x, wave_y, wave_w, wave_h;
int hist_x, hist_y, hist_w, hist_h;
+ int text_color, dark_color;
+
+ ScopeGratPaths grat_paths;
+ int grat_idx, use_graticule;
int cpus;
int use_hist, use_wave, use_vector;
int use_hist_parade, use_wave_parade;
int bins[HIST_SECTIONS][TOTAL_BINS];
- int frame_w;
+ int frame_w, use_smooth;
+ int use_refresh, use_release;
+ int use_wave_gain, use_vect_gain;
};
-
-
-
#endif
-
-
-