[SCM] calf/master: + GUI: add VU meter control to GUIs (PF_CTL_METER), add horizontal margin to fader control, document PF_CTL_xxxx values
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:37:59 UTC 2013
The following commit has been merged in the master branch:
commit 3ffe274d49bbc16d20b116b13139eb7571d89c83
Author: Krzysztof Foltman <wdev at foltman.com>
Date: Thu Oct 30 22:37:16 2008 +0000
+ GUI: add VU meter control to GUIs (PF_CTL_METER), add horizontal margin to fader control, document PF_CTL_xxxx values
diff --git a/src/calf/giface.h b/src/calf/giface.h
index d3c3bad..c5b7a15 100644
--- a/src/calf/giface.h
+++ b/src/calf/giface.h
@@ -68,12 +68,13 @@ enum parameter_flags
PF_CTLMASK = 0x0F00,
PF_CTL_DEFAULT = 0x0000,
- PF_CTL_KNOB = 0x0100,
- PF_CTL_FADER = 0x0200,
- PF_CTL_TOGGLE = 0x0300,
- PF_CTL_COMBO = 0x0400,
- PF_CTL_RADIO = 0x0500,
- PF_CTL_BUTTON = 0x0600,
+ PF_CTL_KNOB = 0x0100, ///< knob
+ PF_CTL_FADER = 0x0200, ///< fader (slider)
+ PF_CTL_TOGGLE = 0x0300, ///< toggle button
+ PF_CTL_COMBO = 0x0400, ///< combo box
+ PF_CTL_RADIO = 0x0500, ///< radio button
+ PF_CTL_BUTTON = 0x0600, ///< push button
+ PF_CTL_METER = 0x0700, ///< volume meter
PF_CTLOPTIONS = 0x00F000,
PF_CTLO_HORIZ = 0x001000, ///< horizontal version of the control
diff --git a/src/calf/gui.h b/src/calf/gui.h
index 80c03e5..e605267 100644
--- a/src/calf/gui.h
+++ b/src/calf/gui.h
@@ -130,6 +130,7 @@ struct scrolled_container: public control_container
virtual GtkWidget *create(plugin_gui *_gui, const char *element, xml_attribute_map &attributes);
};
+/// Display-only control: static text
struct label_param_control: public param_control
{
virtual GtkWidget *create(plugin_gui *_gui, int _param_no);
@@ -137,6 +138,7 @@ struct label_param_control: public param_control
virtual void set() {}
};
+/// Display-only control: value text
struct value_param_control: public param_control
{
virtual GtkWidget *create(plugin_gui *_gui, int _param_no);
@@ -144,6 +146,16 @@ struct value_param_control: public param_control
virtual void set();
};
+/// Display-only control: volume meter
+struct vumeter_param_control: public param_control
+{
+ CalfVUMeter *meter;
+
+ virtual GtkWidget *create(plugin_gui *_gui, int _param_no);
+ virtual void get() {}
+ virtual void set();
+};
+
struct hscale_param_control: public param_control
{
GtkHScale *scale;
diff --git a/src/gui.cpp b/src/gui.cpp
index e7c42f2..1439330 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -232,6 +232,23 @@ void value_param_control::set()
gtk_label_set_text (GTK_LABEL (widget), props.to_string(gui->plugin->get_param_value(param_no)).c_str());
}
+// value
+
+GtkWidget *vumeter_param_control::create(plugin_gui *_gui, int _param_no)
+{
+ gui = _gui, param_no = _param_no;
+ // parameter_properties &props = get_props();
+ widget = calf_vumeter_new ();
+ return widget;
+}
+
+void vumeter_param_control::set()
+{
+ _GUARD_CHANGE_
+ parameter_properties &props = get_props();
+ calf_vumeter_set_value (CALF_VUMETER (widget), props.to_01(gui->plugin->get_param_value(param_no)));
+}
+
// check box
GtkWidget *toggle_param_control::create(plugin_gui *_gui, int _param_no)
@@ -521,6 +538,13 @@ GtkWidget *plugin_gui::create(plugin_ctl_iface *_plugin)
widget = params[i]->create(this, i);
gtk_table_attach (GTK_TABLE (container), widget, 0, 3, trow, trow + 1, GTK_EXPAND, GTK_SHRINK, 0, 0);
}
+ else if ((props.flags & PF_CTLMASK) == PF_CTL_METER)
+ {
+ params[i] = new vumeter_param_control();
+ widget = params[i]->create(this, i);
+ // gtk_widget_set_size_request(widget, -1, 14);
+ gtk_table_attach (GTK_TABLE (container), widget, 1, 3, trow, trow + 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), GTK_SHRINK, 10, 0);
+ }
else if ((props.flags & PF_CTLMASK) != PF_CTL_FADER)
{
params[i] = new knob_param_control();
@@ -528,7 +552,7 @@ GtkWidget *plugin_gui::create(plugin_ctl_iface *_plugin)
params[i]->attribs["type"] = "3";
widget = params[i]->create(this, i);
gtk_table_attach (GTK_TABLE (container), widget, 1, 2, trow, trow + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_table_attach (GTK_TABLE (container), params[i]->create_label(), 2, 3, trow, trow + 1, (GtkAttachOptions)(GTK_SHRINK | GTK_FILL), GTK_SHRINK, 0, 0);
+ gtk_table_attach (GTK_TABLE (container), params[i]->create_label(), 2, 3, trow, trow + 1, (GtkAttachOptions)(GTK_SHRINK | GTK_FILL), GTK_SHRINK, 10, 0);
}
else
{
@@ -705,6 +729,8 @@ param_control *plugin_gui::create_control_from_xml(const char *element, const ch
return new label_param_control;
if (!strcmp(element, "value"))
return new value_param_control;
+ if (!strcmp(element, "vumeter"))
+ return new vumeter_param_control;
if (!strcmp(element, "line-graph"))
return new line_graph_param_control;
if (!strcmp(element, "keyboard"))
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list