#include "ardour/dB.h"
#include "ardour/rc_configuration.h"
+#include "gtk2_ardour/stripable_colorpicker.h"
#include "gtkmm2ext/utils.h"
Gtk::HSeparator _sep;
};
+class LuaColorPicker : public LuaDialogWidget
+{
+public:
+ LuaColorPicker (std::string const& key)
+ : LuaDialogWidget (key, "", 0, 1)
+ {}
+
+ Gtk::Widget* widget ()
+ {
+ return &_cs;
+ }
+ void assign (luabridge::LuaRef* rv) const {
+ uint32_t rgba = ARDOUR_UI_UTILS::gdk_color_to_rgba(_cs.get_color());
+ (*rv)[_key] = rgba;
+ }
+protected:
+ Gtk::ColorButton _cs;
+};
+/*
+local a = {
+ {type = "color", key = "col", title = ""}
+}
+
+local rv = LuaDialog.Dialog("", a):run()
+
+print(rv['col'])
+*/
+
class LuaDialogCheckbox : public LuaDialogWidget
{
public:
path = i.value ()["path"].cast<std::string> ();
}
w = new LuaFileChooser (key, title, Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER, path);
+ } else if (type == "color") {
+ w = new LuaColorPicker (key);
}
if (w) {
#include "pbd/compose.h"
#include "pbd/i18n.h"
+#include "public_editor.h"
#include "stripable_colorpicker.h"
#include "ui_config.h"
#include "utils.h"
void
StripableColorDialog::finish_color_edit (int response)
{
+ ARDOUR::RouteList rl = PublicEditor::instance().get_selection().tracks.routelist();
+
if (response == RESPONSE_OK) {
ColorChanged (gdk_color_to_rgba (get_colorsel()->get_current_color())); /* EMIT SIGNAL */
}
if (_stripable && response == RESPONSE_OK) {
+ for (ARDOUR::RouteList::iterator i = rl.begin(); i != rl.end(); ++i) {
+ (*i)->presentation_info().set_color (gdk_color_to_rgba (get_colorsel()->get_current_color()));
+ }
_stripable->presentation_info().set_color (gdk_color_to_rgba (get_colorsel()->get_current_color()));
} else if (_stripable) {
_stripable->presentation_info().set_color (_initial_color);