summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-11-13 04:47:19 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-11-13 04:47:19 +0000
commit71ad6a13cbb1d7cbf414376d5a05492fc147d86f (patch)
tree04a9ac5efb9188bed98eaf7391509d60b6c16de9
parent40ee34e43e6c642d88c5d497d2d29db21b059c68 (diff)
handle disconnected-from-JACK state a little better (i.e. don't crash and be helpful
git-svn-id: svn://localhost/ardour2/trunk@1123 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/ardour_ui.cc1
-rw-r--r--gtk2_ardour/io_selector.cc5
-rw-r--r--gtk2_ardour/mixer_strip.cc14
-rw-r--r--gtk2_ardour/redirect_box.cc11
-rw-r--r--gtk2_ardour/route_ui.cc8
5 files changed, 19 insertions, 20 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 041300f517..278b9c30eb 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -1231,7 +1231,6 @@ ARDOUR_UI::engine_stopped ()
ActionManager::set_sensitive (ActionManager::jack_opposite_sensitive_actions, true);
}
-
void
ARDOUR_UI::engine_running ()
{
diff --git a/gtk2_ardour/io_selector.cc b/gtk2_ardour/io_selector.cc
index 866d1f7134..363f2aaaf5 100644
--- a/gtk2_ardour/io_selector.cc
+++ b/gtk2_ardour/io_selector.cc
@@ -294,8 +294,6 @@ IOSelector::rescan ()
current_page = notebook.get_current_page ();
- cerr << "clear notebook\n";
-
pages.clear ();
/* get relevant current JACK ports */
@@ -303,7 +301,6 @@ IOSelector::rescan ()
ports = session.engine().get_ports ("", JACK_DEFAULT_AUDIO_TYPE, for_input ? JackPortIsOutput : JackPortIsInput);
if (ports == 0) {
- cerr << "no ports\n";
return;
}
@@ -369,8 +366,6 @@ IOSelector::rescan ()
pages.push_back (TabElem (*client_box, *tab_label));
}
- cerr << "notebook should have " << portmap.size() << " pages\n";
-
notebook.set_current_page (current_page);
page_selection_connection = notebook.signal_show().connect (bind (mem_fun (notebook, &Notebook::set_current_page), current_page));
selector_box.show_all ();
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index dd60c51941..f79ac9bb93 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -500,7 +500,7 @@ MixerStrip::output_press (GdkEventButton *ev)
citems.push_back (SeparatorElem());
_session.foreach_connection (this, &MixerStrip::add_connection_to_output_menu);
-
+
output_menu.popup (1, ev->time);
break;
@@ -556,13 +556,13 @@ MixerStrip::input_press (GdkEventButton *ev)
switch (ev->button) {
case 1:
-
citems.push_back (MenuElem (_("Edit"), mem_fun(*this, &MixerStrip::edit_input_configuration)));
citems.push_back (SeparatorElem());
citems.push_back (MenuElem (_("Disconnect"), mem_fun (*(static_cast<RouteUI*>(this)), &RouteUI::disconnect_input)));
citems.push_back (SeparatorElem());
_session.foreach_connection (this, &MixerStrip::add_connection_to_input_menu);
+
input_menu.popup (1, ev->time);
break;
@@ -1177,21 +1177,11 @@ MixerStrip::mix_group() const
void
MixerStrip::engine_stopped ()
{
- input_button.set_sensitive (false);
- if (rec_enable_button) {
- rec_enable_button->set_sensitive (false);
- }
- output_button.set_sensitive (false);
}
void
MixerStrip::engine_running ()
{
- input_button.set_sensitive (true);
- if (rec_enable_button) {
- rec_enable_button->set_sensitive (true);
- }
- output_button.set_sensitive (true);
}
void
diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc
index b7eb117703..d0aa7500e4 100644
--- a/gtk2_ardour/redirect_box.cc
+++ b/gtk2_ardour/redirect_box.cc
@@ -1058,8 +1058,12 @@ RedirectBox::register_actions ()
/* new stuff */
ActionManager::register_action (popup_act_grp, X_("newplugin"), _("New Plugin ..."), sigc::ptr_fun (RedirectBox::rb_choose_plugin));
- ActionManager::register_action (popup_act_grp, X_("newinsert"), _("New Insert"), sigc::ptr_fun (RedirectBox::rb_choose_insert));
- ActionManager::register_action (popup_act_grp, X_("newsend"), _("New Send ..."), sigc::ptr_fun (RedirectBox::rb_choose_send));
+
+ act = ActionManager::register_action (popup_act_grp, X_("newinsert"), _("New Insert"), sigc::ptr_fun (RedirectBox::rb_choose_insert));
+ ActionManager::jack_sensitive_actions.push_back (act);
+ act = ActionManager::register_action (popup_act_grp, X_("newsend"), _("New Send ..."), sigc::ptr_fun (RedirectBox::rb_choose_send));
+ ActionManager::jack_sensitive_actions.push_back (act);
+
ActionManager::register_action (popup_act_grp, X_("clear"), _("Clear"), sigc::ptr_fun (RedirectBox::rb_clear));
/* standard editing stuff */
@@ -1086,6 +1090,8 @@ RedirectBox::register_actions ()
ActionManager::plugin_selection_sensitive_actions.push_back(act);
ActionManager::add_action_group (popup_act_grp);
+
+
}
void
@@ -1256,3 +1262,4 @@ RedirectBox::generate_redirect_title (boost::shared_ptr<PluginInsert> pi)
return string_compose(_("ardour: %1: %2 (by %3)"), _route->name(), pi->name(), maker);
}
+
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index 665f0f9288..ed42be2901 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -36,6 +36,8 @@
#include "gui_thread.h"
#include <ardour/route.h>
+#include <ardour/session.h>
+#include <ardour/audioengine.h>
#include <ardour/audio_track.h>
#include <ardour/audio_diskstream.h>
@@ -281,6 +283,12 @@ RouteUI::solo_release(GdkEventButton* ev)
bool
RouteUI::rec_enable_press(GdkEventButton* ev)
{
+ if (!_session.engine().connected()) {
+ MessageDialog msg (_("Not connected to JACK - cannot engage record"));
+ msg.run ();
+ return true;
+ }
+
if (!ignore_toggle && is_track() && rec_enable_button) {
if (ev->button == 2 && Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {