summaryrefslogtreecommitdiff
path: root/gtk2_ardour/new_session_dialog.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-01-11 20:33:47 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-01-11 20:33:47 +0000
commit5c3ba06c8dc8f695f3bacf929e0b598cad83b04c (patch)
treed00c8ba89648785989c2c79124dbaa13c64d7495 /gtk2_ardour/new_session_dialog.cc
parentcec81ceb3c143a110b0a53edc59d742b59467b17 (diff)
enable packaging for OSX native without jack; use which_page() everywhere in NSD; fix bad use of set_filename() in NSD; do not offer non-duplex devices in ardour's own audio setup dialog
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2896 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/new_session_dialog.cc')
-rw-r--r--gtk2_ardour/new_session_dialog.cc49
1 files changed, 29 insertions, 20 deletions
diff --git a/gtk2_ardour/new_session_dialog.cc b/gtk2_ardour/new_session_dialog.cc
index 7a3482e850..adc36df8b6 100644
--- a/gtk2_ardour/new_session_dialog.cc
+++ b/gtk2_ardour/new_session_dialog.cc
@@ -20,6 +20,8 @@
#include "i18n.h"
#include "new_session_dialog.h"
+#include <pbd/error.h>
+
#include <ardour/recent_sessions.h>
#include <ardour/session.h>
#include <ardour/profile.h>
@@ -36,6 +38,7 @@
#include <gtkmm2ext/window_title.h>
using namespace Gtkmm2ext;
+using namespace PBD;
#include "opts.h"
#include "utils.h"
@@ -557,40 +560,46 @@ NewSessionDialog::session_name() const
}
*/
- int page = m_notebook->get_current_page();
-
- if (page == 0 || page == 2) {
+ switch (which_page()) {
+ case NewPage:
+ case EnginePage:
/* new or audio setup pages */
return Glib::filename_from_utf8(m_name->get_text());
- } else {
- if (m_treeview->get_selection()->count_selected_rows() == 0) {
- return Glib::filename_from_utf8(str);
- }
- Gtk::TreeModel::iterator i = m_treeview->get_selection()->get_selected();
- return (*i)[recent_columns.visible_name];
+ default:
+ break;
+ }
+
+ if (m_treeview->get_selection()->count_selected_rows() == 0) {
+ return Glib::filename_from_utf8(str);
}
+ Gtk::TreeModel::iterator i = m_treeview->get_selection()->get_selected();
+ return (*i)[recent_columns.visible_name];
}
std::string
NewSessionDialog::session_folder() const
{
- if (m_notebook->get_current_page() == 0) {
+ switch (which_page()) {
+ case NewPage:
return Glib::filename_from_utf8(m_folder->get_filename());
- } else {
+
+ default:
+ break;
+ }
- if (m_treeview->get_selection()->count_selected_rows() == 0) {
- const string filename(Glib::filename_from_utf8(m_open_filechooser->get_filename()));
- return Glib::path_get_dirname(filename);
- }
- Gtk::TreeModel::iterator i = m_treeview->get_selection()->get_selected();
- return (*i)[recent_columns.fullpath];
+ if (m_treeview->get_selection()->count_selected_rows() == 0) {
+ const string filename(Glib::filename_from_utf8(m_open_filechooser->get_filename()));
+ return Glib::path_get_dirname(filename);
}
+
+ Gtk::TreeModel::iterator i = m_treeview->get_selection()->get_selected();
+ return (*i)[recent_columns.fullpath];
}
bool
NewSessionDialog::use_session_template() const
{
- if(m_template->get_filename().empty() && (m_notebook->get_current_page() == 0)) return false;
+ if(m_template->get_filename().empty() && (which_page() == NewPage)) return false;
return true;
}
@@ -679,7 +688,7 @@ NewSessionDialog::get_current_page()
}
NewSessionDialog::Pages
-NewSessionDialog::which_page ()
+NewSessionDialog::which_page () const
{
int num = m_notebook->get_current_page();
@@ -902,7 +911,7 @@ NewSessionDialog::monitor_bus_button_clicked ()
void
NewSessionDialog::reset_template()
{
- m_template->set_filename("");
+ m_template->unselect_all ();
}
void