add a way to see (most of) the waf config used to build ardour at run time (from...
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 4 Jan 2010 02:04:05 +0000 (02:04 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 4 Jan 2010 02:04:05 +0000 (02:04 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6439 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/about.cc
gtk2_ardour/about.h
gtk2_ardour/configinfo.cc [new file with mode: 0644]
gtk2_ardour/configinfo.h [new file with mode: 0644]
gtk2_ardour/rc_option_editor.cc
gtk2_ardour/wscript
libs/ardour/ardour/ardour.h
libs/ardour/wscript
libs/surfaces/generic_midi/generic_midi_control_protocol.cc
wscript

index 2519e767bd3864b61f3779513cf77fac11a3a6b8..d384daae32aedc11e32ffccdd6ba4f1b8732848f 100644 (file)
@@ -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 ()
index 33b5a9ed8952c6617ce98fad5f5ce90d051c025d..80e4618d226d2c13e0fd5cc6933994d57ba83c41 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <gtkmm/aboutdialog.h>
 
-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 (file)
index 0000000..2ec6b1f
--- /dev/null
@@ -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 (file)
index 0000000..ee8a452
--- /dev/null
@@ -0,0 +1,12 @@
+#include <gtkmm/textview.h>
+
+#include "ardour_dialog.h"
+
+class ConfigInfoDialog : public ArdourDialog
+{
+  public:
+       ConfigInfoDialog();
+
+  private:
+       Gtk::TextView text;
+};
index e35ec0026d7cd19fbbaeaf5e5c8f8b9d4d2af3f1..ec0728b7fccb9b6c9018bf2f1f10379db5870202 100644 (file)
@@ -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_("<i>%1</i>"), _("Double-click on a name to edit settings for an enabled protocol")));
 
                _box->pack_start (*label, false, false);
                label->show ();
index 6a3caef427bb75aea0a2a57d0bff9e98b207136f..181922b7736152082f18b6b33c39b016295e8572 100644 (file)
@@ -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',
index aaae8ba1c9d5b1baee9661fca159e14833868878..e98d85c4335ec502ebb1b796bd7e4b894c8cb3f3 100644 (file)
@@ -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<std::string,std::string>&);
 
index 2e2211b611955bb65ca274e5997bd8a6e0670184..dfa05ba752ad60f64f65f17cd8552341bbf52801 100644 (file)
@@ -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',
index 51c1b119eb0fa41aaddc37214cd0ec4c2be9e590..c9cc8c76cdd20f9b05901dc60af7a27c6e880043 100644 (file)
@@ -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 7644476cc727f8c48085d2a1762a737a9433fbdf..80596f3f5d059a99212ede4e93caa9f731822a1e 100644 (file)
--- 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':