From 6ddcd8f0b9a8c27cdc4b96966c6746a1a8c2dc15 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 4 Jan 2010 02:04:05 +0000 Subject: [PATCH] add a way to see (most of) the waf config used to build ardour at run time (from the about dialog). buttons still need reordering there git-svn-id: svn://localhost/ardour2/branches/3.0@6439 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/about.cc | 19 +++++++++-- gtk2_ardour/about.h | 6 +++- gtk2_ardour/configinfo.cc | 16 ++++++++++ gtk2_ardour/configinfo.h | 12 +++++++ gtk2_ardour/rc_option_editor.cc | 3 +- gtk2_ardour/wscript | 1 + libs/ardour/ardour/ardour.h | 1 + libs/ardour/wscript | 1 + .../generic_midi_control_protocol.cc | 2 +- wscript | 32 +++++++++++++++++++ 10 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 gtk2_ardour/configinfo.cc create mode 100644 gtk2_ardour/configinfo.h diff --git a/gtk2_ardour/about.cc b/gtk2_ardour/about.cc index 2519e767bd..d384daae32 100644 --- a/gtk2_ardour/about.cc +++ b/gtk2_ardour/about.cc @@ -36,6 +36,7 @@ #include "version.h" #include "about.h" +#include "configinfo.h" #include "rgb_macros.h" #include "ardour_ui.h" @@ -185,8 +186,9 @@ static const char* translators[] = { About::About () + : config_info (0) #ifdef WITH_PAYMENT_OPTIONS - : paypal_pixmap (paypal_xpm) + , paypal_pixmap (paypal_xpm) #endif { // set_type_hint(Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN); @@ -218,11 +220,14 @@ About::About () "under certain conditions; see the file COPYING for details.\n")); set_name (X_("ardour")); set_website (X_("http://ardour.org/")); - set_website_label (_("visit http://www.ardour.org/")); + set_website_label (_("visit http://ardour.org/")); set_version ((string_compose(_("%1\n(built from revision %2)"), VERSIONSTRING, svn_revision))); + Gtk::Button* config_button = manage (new Button (_("Config"))); + get_action_area()->pack_start (*config_button, false, false); + config_button->signal_clicked().connect (mem_fun (*this, &About::show_config_info)); #ifdef WITH_PAYMENT_OPTIONS paypal_button.add (paypal_pixmap); @@ -239,6 +244,16 @@ About::~About () { } +void +About::show_config_info () +{ + if (!config_info) { + config_info = new ConfigInfoDialog; + } + + config_info->present (); +} + #ifdef WITH_PAYMENT_OPTIONS void About::goto_paypal () diff --git a/gtk2_ardour/about.h b/gtk2_ardour/about.h index 33b5a9ed89..80e4618d22 100644 --- a/gtk2_ardour/about.h +++ b/gtk2_ardour/about.h @@ -22,7 +22,7 @@ #include -class ARDOUR_UI; +class ConfigInfoDialog; class About : public Gtk::AboutDialog { @@ -30,6 +30,10 @@ class About : public Gtk::AboutDialog About (); ~About (); + private: + ConfigInfoDialog* config_info; + void show_config_info (); + #ifdef WITH_PAYMENT_OPTIONS Gtk::Image paypal_pixmap; Gtk::Button paypal_button; diff --git a/gtk2_ardour/configinfo.cc b/gtk2_ardour/configinfo.cc new file mode 100644 index 0000000000..2ec6b1f39e --- /dev/null +++ b/gtk2_ardour/configinfo.cc @@ -0,0 +1,16 @@ +#include "ardour/ardour.h" + +#include "configinfo.h" +#include "i18n.h" + +ConfigInfoDialog::ConfigInfoDialog () + : ArdourDialog (_("Build Configuration")) +{ + set_border_width (12); + text.get_buffer()->set_text (Glib::ustring (ARDOUR::ardour_config_info)); + text.set_wrap_mode (Gtk::WRAP_WORD); + text.show (); + text.set_size_request (300, 800); + + get_vbox()->pack_start (text, true, true); +} diff --git a/gtk2_ardour/configinfo.h b/gtk2_ardour/configinfo.h new file mode 100644 index 0000000000..ee8a452867 --- /dev/null +++ b/gtk2_ardour/configinfo.h @@ -0,0 +1,12 @@ +#include + +#include "ardour_dialog.h" + +class ConfigInfoDialog : public ArdourDialog +{ + public: + ConfigInfoDialog(); + + private: + Gtk::TextView text; +}; diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index e35ec0026d..ec0728b7fc 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -778,7 +778,8 @@ public: _box->pack_start (_view, false, false); - Label* label = manage (new Label (_("Double-click on a name to edit settings for an enabled protocol"))); + Label* label = manage (new Label); + label->set_markup (string_compose (X_("%1"), _("Double-click on a name to edit settings for an enabled protocol"))); _box->pack_start (*label, false, false); label->show (); diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 6a3caef427..181922b773 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -60,6 +60,7 @@ gtk2_ardour_sources = [ 'canvas-simplerect.c', 'canvas-sysex.cc', 'canvas-waveview.c', + 'configinfo.cc', 'control_point.cc', 'control_point_dialog.cc', 'crossfade_edit.cc', diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index aaae8ba1c9..e98d85c433 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -54,6 +54,7 @@ namespace ARDOUR { bool no_auto_connect (); std::string get_ardour_revision (); + extern const char* const ardour_config_info; void find_bindings_files (std::map&); diff --git a/libs/ardour/wscript b/libs/ardour/wscript index 2e2211b611..dfa05ba752 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -64,6 +64,7 @@ libardour_sources = [ 'chan_count.cc', 'chan_mapping.cc', 'configuration.cc', + 'config_text.cc', 'control_protocol_manager.cc', 'control_protocol_search_path.cc', 'crossfade.cc', diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc index 51c1b119eb..c9cc8c76cd 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc @@ -308,7 +308,7 @@ GenericMidiControlProtocol::start_learning (Controllable* c) MIDIControllable* mc = 0; for (MIDIControllables::iterator i = controllables.begin(); i != controllables.end(); ++i) { - if ((*i)->get_controllable()->id() == c->id()) { + if ((*i)->get_controllable() && ((*i)->get_controllable()->id() == c->id())) { mc = *i; break; } diff --git a/wscript b/wscript index 7644476cc7..80596f3f5d 100644 --- a/wscript +++ b/wscript @@ -528,6 +528,38 @@ def configure(conf): autowaf.display_msg(conf, 'C Compiler flags', conf.env['CCFLAGS']) autowaf.display_msg(conf, 'C++ Compiler flags', conf.env['CXXFLAGS']) + # and dump the same stuff to a file for use in the build + + config_text = open ('libs/ardour/config_text.cc',"w") + config_text.write ('#include "ardour/ardour.h"\n\nnamespace ARDOUR {\nconst char* const ardour_config_info = "\\n\\\n') + config_text.write ("Install prefix "); config_text.write (str (conf.env['PREFIX'])); config_text.write ("\\n\\\n") + config_text.write ("Debuggable build "); config_text.write (str (str(conf.env['DEBUG']))); config_text.write ("\\n\\\n") + config_text.write ("Strict compiler flags "); config_text.write (str (str(conf.env['STRICT']))); config_text.write ("\\n\\\n") + config_text.write ("Build documentation "); config_text.write (str (str(conf.env['BUILD_DOCS']))); config_text.write ("\\n\\\n") + config_text.write ('Build Target '); config_text.write (str (conf.env['build_target'])); config_text.write ("\\n\\\n") + config_text.write ('Architecture flags '); config_text.write (str (opts.arch)); config_text.write ("\\n\\\n") + config_text.write ('Aubio '); config_text.write (str (bool(conf.env['HAVE_AUBIO']))); config_text.write ("\\n\\\n") + config_text.write ('AudioUnits '); config_text.write (str (opts.audiounits)); config_text.write ("\\n\\\n") + config_text.write ('CoreAudio '); config_text.write (str (bool(conf.env['HAVE_COREAUDIO']))); config_text.write ("\\n\\\n") + config_text.write ('FPU Optimization '); config_text.write (str (opts.fpu_optimization)); config_text.write ("\\n\\\n") + config_text.write ('Freedesktop Files '); config_text.write (str (opts.freedesktop)); config_text.write ("\\n\\\n") + config_text.write ('Freesound '); config_text.write (str (opts.freesound)); config_text.write ("\\n\\\n") + config_text.write ('GtkOSX '); config_text.write (str (opts.gtkosx)); config_text.write ("\\n\\\n") + config_text.write ('LV2 Support '); config_text.write (str (bool(conf.env['HAVE_SLV2']))); config_text.write ("\\n\\\n") + config_text.write ('Rubberband '); config_text.write (str (bool(conf.env['HAVE_RUBBERBAND']))); config_text.write ("\\n\\\n") + config_text.write ('Samplerate '); config_text.write (str (bool(conf.env['HAVE_SAMPLERATE']))); config_text.write ("\\n\\\n") + config_text.write ('Soundtouch '); config_text.write (str (bool(conf.env['HAVE_SOUNDTOUCH']))); config_text.write ("\\n\\\n") + config_text.write ('Translation '); config_text.write (str (opts.nls)); config_text.write ("\\n\\\n") + config_text.write ('Tranzport '); config_text.write (str (opts.tranzport)); config_text.write ("\\n\\\n") + config_text.write ('Universal Binary '); config_text.write (str (opts.universal)); config_text.write ("\\n\\\n") + config_text.write ('VST Support '); config_text.write (str (opts.vst)); config_text.write ("\\n\\\n") + config_text.write ('Wiimote Support '); config_text.write (str (opts.wiimote)); config_text.write ("\\n\\\n") + config_text.write ('Windows Key '); config_text.write (str (opts.windows_key)); config_text.write ("\\n\\\n") + config_text.write ('C Compiler flags '); config_text.write (str (conf.env['CCFLAGS'])); config_text.write ("\\n\\\n") + config_text.write ('C++ Compiler flags '); config_text.write (str (conf.env['CXXFLAGS'])); config_text.write ("\\n\\\n") + config_text.write ('";}\n') + config_text.close () + def build(bld): autowaf.set_recursive() if sys.platform == 'darwin':