Merge branch 'master' of https://github.com/nmains/ardour
[ardour.git] / gtk2_ardour / startup.h
index 79c59544c56016e750b8951f3d2584633378a760..7ddb3830a430c9bdf02d8feb42d416bddf8897bd 100644 (file)
@@ -1,3 +1,22 @@
+/*
+    Copyright (C) 2010 Paul Davis
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
 #ifndef __gtk2_ardour_startup_h__
 #define __gtk2_ardour_startup_h__
 
@@ -26,19 +45,16 @@ class EngineControl;
 
 class ArdourStartup : public Gtk::Assistant {
   public:
-       ArdourStartup ();
+        ArdourStartup (bool require_new, const std::string& session_name, const std::string& session_path, const std::string& template_name);
        ~ArdourStartup ();
 
-       void set_new_only (bool);
-        void set_load_template( std::string load_template );
+        bool ready_without_display () const;
 
-       Glib::ustring session_name (bool& should_be_new);
-       Glib::ustring session_folder ();
+       std::string session_name (bool& should_be_new);
+       std::string session_folder ();
 
        bool use_session_template();
-       Glib::ustring session_template_name();
-
-       EngineControl* engine_control() { return engine_dialog; }
+       std::string session_template_name();
 
        // advanced session options
 
@@ -56,7 +72,7 @@ class ArdourStartup : public Gtk::Assistant {
        bool connect_outs_to_master() const;
        bool connect_outs_to_physical() const;
 
-       gint response () const { 
+       gint response () const {
                return  _response;
        }
 
@@ -64,12 +80,17 @@ class ArdourStartup : public Gtk::Assistant {
        gint _response;
        bool config_modified;
        bool new_user;
+        bool need_session_info;
        bool new_only;
+        std::string _provided_session_name;
+        std::string _provided_session_path;
+
+       std::string been_here_before_path () const;
 
        void on_apply ();
        void on_cancel ();
        bool on_delete_event (GdkEventAny*);
-       void on_prepare (Gtk::Widget*);
+        void on_prepare (Gtk::Widget*);
 
        static ArdourStartup *the_startup;
 
@@ -92,10 +113,8 @@ class ArdourStartup : public Gtk::Assistant {
 
        void setup_initial_choice_page ();
        Gtk::VBox ic_vbox;
-       Gtk::RadioButton ic_new_session_button;
-       Gtk::RadioButton ic_existing_session_button;
-       bool initial_button_press(GdkEventButton *);
-       void initial_button_activated();
+       Gtk::Button ic_new_session_button;
+        void new_session_button_clicked ();
 
        /* monitoring choices */
 
@@ -113,11 +132,6 @@ class ArdourStartup : public Gtk::Assistant {
        Gtk::RadioButton no_monitor_section_button;
        void setup_monitor_section_choice_page ();
 
-       /* session page (could be new or existing) */
-
-       void setup_session_page ();
-       Gtk::VBox session_vbox;
-       Gtk::HBox session_hbox;
 
        /* recent sessions */
 
@@ -132,24 +146,25 @@ class ArdourStartup : public Gtk::Assistant {
        struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
            RecentSessionModelColumns() {
                    add (visible_name);
+                   add (tip);
                    add (fullpath);
            }
-           Gtk::TreeModelColumn<Glib::ustring> visible_name;
-           Gtk::TreeModelColumn<Glib::ustring> fullpath;
+           Gtk::TreeModelColumn<std::string> visible_name;
+           Gtk::TreeModelColumn<std::string> tip;
+           Gtk::TreeModelColumn<std::string> fullpath;
        };
 
        RecentSessionModelColumns    recent_session_columns;
        Gtk::TreeView                recent_session_display;
        Glib::RefPtr<Gtk::TreeStore> recent_session_model;
        Gtk::ScrolledWindow          recent_scroller;
+       Gtk::FileChooserButton       existing_session_chooser;
        int redisplay_recent_sessions ();
        void recent_session_row_selected ();
        void recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
 
-       /* audio setup page */
-
-       void setup_audio_page ();
-       EngineControl* engine_dialog;
+       void existing_session_selected ();
+        void session_selected ();
 
        /* new sessions */
 
@@ -157,7 +172,6 @@ class ArdourStartup : public Gtk::Assistant {
        Gtk::Entry new_name_entry;
        Gtk::FileChooserButton new_folder_chooser;
        Gtk::FileChooserButton session_template_chooser;
-        void new_name_mapped ();
 
        struct SessionTemplateColumns : public Gtk::TreeModel::ColumnRecord {
                SessionTemplateColumns () {
@@ -174,6 +188,7 @@ class ArdourStartup : public Gtk::Assistant {
        Gtk::ComboBox template_chooser;
 
        Gtk::VBox session_new_vbox;
+       Gtk::VBox session_existing_vbox;
        Gtk::CheckButton more_new_session_options_button;
        Gtk::RadioButtonGroup session_template_group;
        Gtk::RadioButton use_session_as_template_button;
@@ -257,13 +272,21 @@ class ArdourStartup : public Gtk::Assistant {
        gint default_folder_page_index;
        gint monitoring_page_index;
        gint monitor_section_page_index;
-       gint session_page_index;
+       gint new_session_page_index;
        gint initial_choice_index;
        gint final_page_index;
        gint session_options_page_index;
 
        void move_along_now ();
 
+       bool _existing_session_chooser_used; ///< set to true when the existing session chooser has been used
+        void setup_prerelease_page ();
+
+       Gtk::Label info_scroller_label;
+        std::string::size_type info_scroller_count;
+        bool info_scroller_update();
+       sigc::connection info_scroller_connection;
+        void updates_button_clicked ();
 };
 
 #endif /* __gtk2_ardour_startup_h__ */