CompressorWindow::CompressorWindow(CompressorEffect *plugin)
: PluginClientWindow(plugin,
- 650,
- 480,
- 650,
- 480,
+ xS(650),
+ yS(480),
+ xS(650),
+ yS(480),
0)
{
this->plugin = plugin;
void CompressorWindow::create_objects()
{
- int x = 35, y = 10;
- int control_margin = 130;
+ int xs10 = xS(10), xs20 = xS(20), xs50 = xS(50), xs110 = xS(110);
+ int ys20 = yS(20), ys30 = yS(30), ys40 = yS(40), ys60 = yS(60), ys70 = yS(70);
+ int x = xS(35), y = yS(10);
+ int control_margin = xS(130);
add_subwindow(canvas = new CompressorCanvas(plugin,
x,
y,
- get_w() - x - control_margin - 10,
- get_h() - y - 70));
+ get_w() - x - control_margin - xs10,
+ get_h() - y - ys70));
canvas->set_cursor(CROSS_CURSOR, 0, 0);
x = get_w() - control_margin;
add_subwindow(new BC_Title(x, y, _("Reaction secs:")));
- y += 20;
+ y += ys20;
add_subwindow(reaction = new CompressorReaction(plugin, x, y));
- y += 30;
+ y += ys30;
add_subwindow(new BC_Title(x, y, _("Decay secs:")));
- y += 20;
+ y += ys20;
add_subwindow(decay = new CompressorDecay(plugin, x, y));
- y += 30;
+ y += ys30;
add_subwindow(new BC_Title(x, y, _("Trigger Type:")));
- y += 20;
+ y += ys20;
add_subwindow(input = new CompressorInput(plugin, x, y));
input->create_objects();
- y += 30;
+ y += ys30;
add_subwindow(new BC_Title(x, y, _("Trigger:")));
- y += 20;
+ y += ys20;
add_subwindow(trigger = new CompressorTrigger(plugin, x, y));
if(plugin->config.input != CompressorConfig::TRIGGER) trigger->disable();
- y += 30;
+ y += ys30;
add_subwindow(smooth = new CompressorSmooth(plugin, x, y));
- y += 60;
+ y += ys60;
add_subwindow(clear = new CompressorClear(plugin, x, y));
- x = 10;
- y = get_h() - 40;
+ x = xs10;
+ y = get_h() - ys40;
add_subwindow(new BC_Title(x, y, _("Point:")));
- x += 50;
+ x += xs50;
add_subwindow(x_text = new CompressorX(plugin, x, y));
- x += 110;
+ x += xs110;
add_subwindow(new BC_Title(x, y, _("x")));
- x += 20;
+ x += xs20;
add_subwindow(y_text = new CompressorY(plugin, x, y));
draw_scales();
#define DIVISIONS 8
for(int i = 0; i <= DIVISIONS; i++)
{
- int y = canvas->get_y() + 10 + canvas->get_h() / DIVISIONS * i;
- int x = canvas->get_x() - 30;
+ int y = canvas->get_y() + yS(10) + canvas->get_h() / DIVISIONS * i;
+ int x = canvas->get_x() - xS(30);
char string[BCTEXTLEN];
sprintf(string, "%.0f", (float)i / DIVISIONS * plugin->config.min_db);
y = y1 + (y2 - y1) * j / 10;
if(j == 0)
{
- draw_line(canvas->get_x() - 10, y, canvas->get_x(), y);
+ draw_line(canvas->get_x() - xS(10), y, canvas->get_x(), y);
}
else
if(i < DIVISIONS)
{
- draw_line(canvas->get_x() - 5, y, canvas->get_x(), y);
+ draw_line(canvas->get_x() - xS(5), y, canvas->get_x(), y);
}
}
}
for(int i = 0; i <= DIVISIONS; i++)
{
- int y = canvas->get_h() + 30;
- int x = canvas->get_x() + (canvas->get_w() - 10) / DIVISIONS * i;
+ int y = canvas->get_h() + yS(30);
+ int x = canvas->get_x() + (canvas->get_w() - xS(10)) / DIVISIONS * i;
char string[BCTEXTLEN];
sprintf(string, "%.0f", (1.0 - (float)i / DIVISIONS) * plugin->config.min_db);
x = x1 + (x2 - x1) * j / 10;
if(j == 0)
{
- draw_line(x, canvas->get_y() + canvas->get_h(), x, canvas->get_y() + canvas->get_h() + 10);
+ draw_line(x, canvas->get_y() + canvas->get_h(), x, canvas->get_y() + canvas->get_h() + yS(10));
}
else
if(i < DIVISIONS)
{
- draw_line(x, canvas->get_y() + canvas->get_h(), x, canvas->get_y() + canvas->get_h() + 5);
+ draw_line(x, canvas->get_y() + canvas->get_h(), x, canvas->get_y() + canvas->get_h() + yS(5));
}
}
}
}
}
-#define POINT_W 10
+#define POINT_W xS(10)
void CompressorWindow::update_canvas()
{
canvas->clear_box(0, 0, canvas->get_w(), canvas->get_h());
CompressorReaction::CompressorReaction(CompressorEffect *plugin, int x, int y)
- : BC_TextBox(x, y, 100, 1, (float)plugin->config.reaction_len)
+ : BC_TextBox(x, y, xS(100), 1, (float)plugin->config.reaction_len)
{
this->plugin = plugin;
}
}
CompressorDecay::CompressorDecay(CompressorEffect *plugin, int x, int y)
- : BC_TextBox(x, y, 100, 1, (float)plugin->config.decay_len)
+ : BC_TextBox(x, y, xS(100), 1, (float)plugin->config.decay_len)
{
this->plugin = plugin;
}
CompressorX::CompressorX(CompressorEffect *plugin, int x, int y)
- : BC_TextBox(x, y, 100, 1, "")
+ : BC_TextBox(x, y, xS(100), 1, "")
{
this->plugin = plugin;
}
CompressorY::CompressorY(CompressorEffect *plugin, int x, int y)
- : BC_TextBox(x, y, 100, 1, "")
+ : BC_TextBox(x, y, xS(100), 1, "")
{
this->plugin = plugin;
}
CompressorTrigger::CompressorTrigger(CompressorEffect *plugin, int x, int y)
- : BC_TextBox(x, y, (int64_t)100, (int64_t)1, (int64_t)plugin->config.trigger)
+ : BC_TextBox(x, y, xS(100), 1, (int64_t)plugin->config.trigger)
{
this->plugin = plugin;
}
CompressorInput::CompressorInput(CompressorEffect *plugin, int x, int y)
: BC_PopupMenu(x,
y,
- 100,
+ xS(100),
CompressorInput::value_to_text(plugin->config.input),
1)
{