new version derivation system, improvements to splash screen display
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 26 Oct 2006 14:13:10 +0000 (14:13 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 26 Oct 2006 14:13:10 +0000 (14:13 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1022 d708f5d6-7413-0410-9779-e7cbd77b26cf

SConstruct
gtk2_ardour/SConscript
gtk2_ardour/about.cc
gtk2_ardour/ardour_ui.cc
gtk2_ardour/main.cc
libs/pbd/pbd/rcu.h

index b7031ff80ecb887821b80d2263a8d7f17c28cc69..40b52d8db2b10bd70c486a36dd55c7449e5923c6 100644 (file)
@@ -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})
index 02ba7dd9c115c144e8aa6c0d587bdd720d3820d3..40e7855a1b5381f50716b1c650b0492b058ad937 100644 (file)
@@ -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'],
index fcae1784a384920911dd3f3f33c479e0e43ac98a..16512b595106ca07dc00a9c35157ba09f1767e1f 100644 (file)
@@ -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)));
        
index 7548f94c5b7ee6c9e3ba66099500d858490eae61..18cb808eeb5cf6fa2256da473614e365664e68af 100644 (file)
@@ -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
index 049ef29ead0dae3f2bd4e3d938a7f5f45afb84a2..6182182d38bb2b0113f88b1b97617bfcbe083983 100644 (file)
@@ -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
index e81db8ba8717108d9cb8dcf110bb2fee219c4a74..a8f3cdd5bc72e5e5b23026ddcc7a6a9013b7736e 100644 (file)
@@ -17,7 +17,7 @@ class RCUManager
  
        virtual ~RCUManager() { delete m_rcu_value; }
  
-        boost::shared_ptr<T> reader () const { return *((boost::shared_ptr<T> *) g_atomic_pointer_get (&m_rcu_value)); }
+        boost::shared_ptr<T> reader () const { return *((boost::shared_ptr<T> *) g_atomic_pointer_get (the_pointer())); }
  
        virtual boost::shared_ptr<T> write_copy () = 0;
        virtual bool update (boost::shared_ptr<T> new_value) = 0;