From 8f53fc64599a8b7b4cc21af5dfa90bdbf8eb28f2 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 26 Oct 2006 14:13:10 +0000 Subject: new version derivation system, improvements to splash screen display git-svn-id: svn://localhost/ardour2/trunk@1022 d708f5d6-7413-0410-9779-e7cbd77b26cf --- SConstruct | 95 ++++++++++++++++++++++++++++++++++-------------- gtk2_ardour/SConscript | 2 +- gtk2_ardour/about.cc | 2 +- gtk2_ardour/ardour_ui.cc | 5 +-- gtk2_ardour/main.cc | 13 ++++--- libs/pbd/pbd/rcu.h | 2 +- 6 files changed, 78 insertions(+), 41 deletions(-) diff --git a/SConstruct b/SConstruct index b7031ff80e..40b52d8db2 100644 --- a/SConstruct +++ b/SConstruct @@ -9,6 +9,7 @@ import errno import time import platform import string +import commands from sets import Set import SCons.Node.FS @@ -236,35 +237,73 @@ def i18n (buildenv, sources, installenv): # note: requires that DOMAIN, MAJOR, MINOR, MICRO are set in the construction environment # note: assumes one source files, the header that declares the version variables # +#def version_builder (target, source, env): +# text = "int " + env['DOMAIN'] + "_major_version = " + str (env['MAJOR']) + ";\n" +# text += "int " + env['DOMAIN'] + "_minor_version = " + str (env['MINOR']) + ";\n" +# text += "int " + env['DOMAIN'] + "_micro_version = " + str (env['MICRO']) + ";\n" +# +# try: +# o = file (target[0].get_path(), 'w') +# o.write (text) +# o.close () +# except IOError: +# print "Could not open", target[0].get_path(), " for writing\n" +# sys.exit (-1) +# +# text = "#ifndef __" + env['DOMAIN'] + "_version_h__\n" +# text += "#define __" + env['DOMAIN'] + "_version_h__\n" +# text += "extern int " + env['DOMAIN'] + "_major_version;\n" +# text += "extern int " + env['DOMAIN'] + "_minor_version;\n" +# text += "extern int " + env['DOMAIN'] + "_micro_version;\n" +# text += "#endif /* __" + env['DOMAIN'] + "_version_h__ */\n" +# +# try: +# o = file (target[1].get_path(), 'w') +# o.write (text) +# o.close (); +# except IOError: +# print "Could not open", target[1].get_path(), " for writing\n" +# sys.exit (-1) +# +# return None + def version_builder (target, source, env): - text = "int " + env['DOMAIN'] + "_major_version = " + str (env['MAJOR']) + ";\n" - text += "int " + env['DOMAIN'] + "_minor_version = " + str (env['MINOR']) + ";\n" - text += "int " + env['DOMAIN'] + "_micro_version = " + str (env['MICRO']) + ";\n" - - try: - o = file (target[0].get_path(), 'w') - o.write (text) - o.close () - except IOError: - print "Could not open", target[0].get_path(), " for writing\n" - sys.exit (-1) - - text = "#ifndef __" + env['DOMAIN'] + "_version_h__\n" - text += "#define __" + env['DOMAIN'] + "_version_h__\n" - text += "extern int " + env['DOMAIN'] + "_major_version;\n" - text += "extern int " + env['DOMAIN'] + "_minor_version;\n" - text += "extern int " + env['DOMAIN'] + "_micro_version;\n" - text += "#endif /* __" + env['DOMAIN'] + "_version_h__ */\n" - - try: - o = file (target[1].get_path(), 'w') - o.write (text) - o.close (); - except IOError: - print "Could not open", target[1].get_path(), " for writing\n" - sys.exit (-1) - - return None + cmd = "svn info " + cmd += source[0].get_path() + cmd += " | awk '/^Revision:/ { print $2}'" + + rev = commands.getoutput (cmd) + + text = "const char* " + env['DOMAIN'] + "_revision = \"" + rev + "\";\n" + text += "int " + env['DOMAIN'] + "_major_version = " + str (env['MAJOR']) + ";\n" + text += "int " + env['DOMAIN'] + "_minor_version = " + str (env['MINOR']) + ";\n" + text += "int " + env['DOMAIN'] + "_micro_version = " + str (env['MICRO']) + ";\n" + + try: + o = file (target[0].get_path(), 'w') + o.write (text) + o.close () + except IOError: + print "Could not open", target[0].get_path(), " for writing\n" + sys.exit (-1) + + text = "#ifndef __" + env['DOMAIN'] + "_version_h__\n" + text += "#define __" + env['DOMAIN'] + "_version_h__\n" + text += "extern const char* " + env['DOMAIN'] + "_revision;\n" + text += "extern int " + env['DOMAIN'] + "_major_version;\n" + text += "extern int " + env['DOMAIN'] + "_minor_version;\n" + text += "extern int " + env['DOMAIN'] + "_micro_version;\n" + text += "#endif /* __" + env['DOMAIN'] + "_version_h__ */\n" + + try: + o = file (target[1].get_path(), 'w') + o.write (text) + o.close (); + except IOError: + print "Could not open", target[1].get_path(), " for writing\n" + sys.exit (-1) + + return None version_bld = Builder (action = version_builder) env.Append (BUILDERS = {'VersionBuild' : version_bld}) diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript index 02ba7dd9c1..40e7855a1b 100644 --- a/gtk2_ardour/SConscript +++ b/gtk2_ardour/SConscript @@ -306,7 +306,7 @@ env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2/pix env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2/icons'), icon_files)) env.AlwaysBuild ('version.cc') -env.Alias ('version', gtkardour.VersionBuild(['version.cc','version.h'], ['..'])) +env.Alias ('version', gtkardour.VersionBuild(['version.cc','version.h'], 'SConscript')) #dist env.Alias ('tarball', env.Distribute (env['DISTTREE'], diff --git a/gtk2_ardour/about.cc b/gtk2_ardour/about.cc index fcae1784a3..16512b5951 100644 --- a/gtk2_ardour/about.cc +++ b/gtk2_ardour/about.cc @@ -190,7 +190,7 @@ About::About () set_name (X_("ardour")); set_website (X_("http://ardour.org/")); set_website_label (X_("visit http://www.ardour.org/")); - set_version ((string_compose(_("%1\n(built from revision %s"), + set_version ((string_compose(_("%1\n(built from revision %2)"), VERSIONSTRING, gtk_ardour_revision))); diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 7548f94c5b..18cb808eeb 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1873,10 +1873,6 @@ ARDOUR_UI::show () shown_flag = true; } - - if (about) { - about->present (); - } } void @@ -1886,6 +1882,7 @@ ARDOUR_UI::show_splash () about = new About(); } about->present(); + flush_pending (); } void diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index 049ef29ead..6182182d38 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -259,7 +259,6 @@ show_ui_callback (void *arg) ARDOUR_UI * ui = (ARDOUR_UI *) arg; ui->hide_splash(); - ui->show (); return FALSE; } @@ -286,7 +285,7 @@ Please consider the possibilities, and perhaps (re)start JACK.")); win.set_position (Gtk::WIN_POS_CENTER); if (!no_splash) { - ui->hide_splash (); + ui->hide_splash (); } /* we just don't care about the result, but we want to block */ @@ -329,10 +328,12 @@ To create it from the command line, start ardour as \"ardour --new %1"), path) < ui->load_session (path, name); } else { - /* TODO: This bit of code doesn't work properly yet - Glib::signal_idle().connect (bind (mem_fun (*ui, &ARDOUR_UI::cmdline_new_session), path)); - ui->set_will_create_new_session_automatically (true); */ + /* TODO: This bit of code doesn't work properly yet + Glib::signal_idle().connect (bind (mem_fun (*ui, &ARDOUR_UI::cmdline_new_session), path)); + ui->set_will_create_new_session_automatically (true); + */ + /* Show the NSD */ ui->hide_splash (); if (!Config->get_no_new_session_dialog()) { @@ -383,7 +384,7 @@ int main (int argc, char *argv[]) cout << _("Ardour/GTK ") << VERSIONSTRING << _("\n (built using ") - << ARDOUR::get_ardour_revision () + << gtk_ardour_revision #ifdef __GNUC__ << _(" and GCC version ") << __VERSION__ #endif diff --git a/libs/pbd/pbd/rcu.h b/libs/pbd/pbd/rcu.h index e81db8ba87..a8f3cdd5bc 100644 --- a/libs/pbd/pbd/rcu.h +++ b/libs/pbd/pbd/rcu.h @@ -17,7 +17,7 @@ class RCUManager virtual ~RCUManager() { delete m_rcu_value; } - boost::shared_ptr reader () const { return *((boost::shared_ptr *) g_atomic_pointer_get (&m_rcu_value)); } + boost::shared_ptr reader () const { return *((boost::shared_ptr *) g_atomic_pointer_get (the_pointer())); } virtual boost::shared_ptr write_copy () = 0; virtual bool update (boost::shared_ptr new_value) = 0; -- cgit v1.2.3