summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-06-07 13:18:48 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-06-07 13:18:48 -0400
commit31d234b48c36bddb4d5228a3abee9c4419403879 (patch)
treefdc4f5aebd2823a6a8ac64927e08d9919cd07b94 /gtk2_ardour
parentce8731b32d5e91f56396cb5f6ca0798bc7fed48a (diff)
parent327ec5f58e58224e01004ddfd0252a840a0e84f0 (diff)
Merge branch 'master' into cairocanvas
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/about.cc5
-rw-r--r--gtk2_ardour/po/de.po4
-rw-r--r--gtk2_ardour/processor_box.cc33
-rw-r--r--gtk2_ardour/rc_option_editor.cc7
-rw-r--r--gtk2_ardour/system_exec.cc42
-rw-r--r--gtk2_ardour/video_timeline.cc57
-rw-r--r--gtk2_ardour/window_manager.cc9
7 files changed, 100 insertions, 57 deletions
diff --git a/gtk2_ardour/about.cc b/gtk2_ardour/about.cc
index db721b6441..280f72a8dc 100644
--- a/gtk2_ardour/about.cc
+++ b/gtk2_ardour/about.cc
@@ -591,6 +591,11 @@ About::About ()
get_action_area()->add (*config_button);
get_action_area()->reorder_child (*config_button, 0);
config_button->signal_clicked().connect (mem_fun (*this, &About::show_config_info));
+
+ Gtk::Button *btn = static_cast<Gtk::Button*>(get_widget_for_response(Gtk::RESPONSE_CANCEL));
+ if (btn) {
+ btn->signal_clicked().connect(sigc::mem_fun(static_cast<Gtk::Window*>(this), &Gtk::Window::hide));
+ }
}
About::~About ()
diff --git a/gtk2_ardour/po/de.po b/gtk2_ardour/po/de.po
index 6706ab9102..3875319835 100644
--- a/gtk2_ardour/po/de.po
+++ b/gtk2_ardour/po/de.po
@@ -269,7 +269,7 @@ msgid ""
"\tBenjamin Scherrer <realhangman@web.de>\n"
"\tEdgar Aichinger <edogawa@aon.at>\n"
"\tRichard Oax <richard@pagliacciempire.de>\n"
-"\Robin Gloster <robin@loc-com.de>\n"
+"\tRobin Gloster <robin@loc-com.de>\n"
msgstr ""
"Deutsch:\n"
"\tKarsten Petersen <kapet@kapet.de>\n"
@@ -278,7 +278,7 @@ msgstr ""
"\tBenjamin Scherrer <realhangman@web.de>\n"
"\tEdgar Aichinger <edogawa@aon.at>\n"
"\tRichard Oax <richard@pagliacciempire.de>\n"
-"\Robin Gloster <robin@loc-com.de>\n"
+"\tRobin Gloster <robin@loc-com.de>\n"
#: about.cc:189
msgid ""
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index 2f8513fd2a..bae29ae98a 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -113,7 +113,7 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processo
_button.set_active (_processor->active());
_button.show ();
-
+
_processor->ActiveChanged.connect (active_connection, invalidator (*this), boost::bind (&ProcessorEntry::processor_active_changed, this), gui_context());
_processor->PropertyChanged.connect (name_connection, invalidator (*this), boost::bind (&ProcessorEntry::processor_property_changed, this, _1), gui_context());
@@ -247,7 +247,20 @@ ProcessorEntry::processor_property_changed (const PropertyChange& what_changed)
void
ProcessorEntry::setup_tooltip ()
{
- ARDOUR_UI::instance()->set_tip (_button, name (Wide));
+ if (_processor) {
+ boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (_processor);
+ if (pi) {
+ if (pi->plugin()->has_editor()) {
+ ARDOUR_UI::instance()->set_tip (_button,
+ string_compose (_("<b>%1</b>\nDouble-click to show GUI.\nAlt+double-click to show generic GUI."), name (Wide)));
+ } else {
+ ARDOUR_UI::instance()->set_tip (_button,
+ string_compose (_("<b>%1</b>\nDouble-click to show generic GUI."), name (Wide)));
+ }
+ return;
+ }
+ }
+ ARDOUR_UI::instance()->set_tip (_button, string_compose ("<b>%1</b>", name (Wide)));
}
string
@@ -918,6 +931,7 @@ ProcessorBox::show_processor_menu (int arg)
const bool sensitive = !processor_display.selection().empty();
ActionManager::set_sensitive (ActionManager::plugin_selection_sensitive_actions, sensitive);
edit_action->set_sensitive (one_processor_can_be_edited ());
+ edit_generic_action->set_sensitive (one_processor_can_be_edited ());
boost::shared_ptr<PluginInsert> pi;
if (single_selection) {
@@ -925,7 +939,7 @@ ProcessorBox::show_processor_menu (int arg)
}
/* allow editing with an Ardour-generated UI for plugin inserts with editors */
- edit_generic_action->set_sensitive (pi && pi->plugin()->has_editor ());
+ edit_action->set_sensitive (pi && pi->plugin()->has_editor ());
/* disallow rename for multiple selections, for plugin inserts and for the fader */
rename_action->set_sensitive (single_selection && !pi && !boost::dynamic_pointer_cast<Amp> (single_selection->processor ()));
@@ -1050,13 +1064,14 @@ ProcessorBox::processor_button_press_event (GdkEventButton *ev, ProcessorEntry*
if (processor && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS))) {
if (_session->engine().connected()) {
-
/* XXX giving an error message here is hard, because we may be in the midst of a button press */
- if (Config->get_use_plugin_own_gui ()) {
- edit_processor (processor);
- } else {
+ if (!one_processor_can_be_edited ()) return true;
+
+ if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
generic_edit_processor (processor);
+ } else {
+ edit_processor (processor);
}
}
@@ -2235,7 +2250,7 @@ ProcessorBox::register_actions ()
sigc::ptr_fun (ProcessorBox::rb_edit));
edit_generic_action = ActionManager::register_action (
- popup_act_grp, X_("edit-generic"), _("Edit with basic controls..."),
+ popup_act_grp, X_("edit-generic"), _("Edit with generic controls..."),
sigc::ptr_fun (ProcessorBox::rb_edit_generic));
ActionManager::add_action_group (popup_act_grp);
@@ -2437,7 +2452,7 @@ ProcessorBox::edit_processor (boost::shared_ptr<Processor> processor)
ProcessorWindowProxy* proxy = find_window_proxy (processor);
if (proxy) {
- proxy->set_custom_ui_mode (Config->get_use_plugin_own_gui ());
+ proxy->set_custom_ui_mode (true);
proxy->toggle ();
}
}
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index 216a122e91..da0e55c7a2 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -1855,13 +1855,6 @@ RCOptionEditor::RCOptionEditor ()
/* font scaling does nothing with GDK/Quartz */
add_option (S_("Preferences|GUI"), new FontScalingOptions (_rc_config));
#endif
- add_option (S_("Preferences|GUI"),
- new BoolOption (
- "use-own-plugin-gui",
- string_compose (_("Use plugins' own interfaces instead of %1's"), PROGRAM_NAME),
- sigc::mem_fun (*_rc_config, &RCConfiguration::get_use_plugin_own_gui),
- sigc::mem_fun (*_rc_config, &RCConfiguration::set_use_plugin_own_gui)
- ));
add_option (S_("GUI"),
new BoolOption (
diff --git a/gtk2_ardour/system_exec.cc b/gtk2_ardour/system_exec.cc
index 566c87dfbb..c63d1d183b 100644
--- a/gtk2_ardour/system_exec.cc
+++ b/gtk2_ardour/system_exec.cc
@@ -414,19 +414,33 @@ void
SystemExec::terminate ()
{
::pthread_mutex_lock(&write_lock);
+
+ /* close stdin in an attempt to get the child to exit cleanly.
+ */
+
close_stdin();
+
if (pid) {
::usleep(50000);
sched_yield();
wait(WNOHANG);
}
+ /* if pid is non-zero, the child task is still executing (i.e. it did
+ * not exit in response to stdin being closed). try to kill it.
+ */
+
if (pid) {
::kill(pid, SIGTERM);
::usleep(50000);
sched_yield();
wait(WNOHANG);
}
+
+ /* if pid is non-zero, the child task is STILL executing after being
+ * sent SIGTERM. Act tough ... send SIGKILL
+ */
+
if (pid) {
::fprintf(stderr, "Process is still running! trying SIGKILL\n");
::kill(pid, SIGKILL);
@@ -442,12 +456,23 @@ int
SystemExec::wait (int options)
{
int status=0;
+ int ret;
+
if (pid==0) return -1;
- if (pid==::waitpid(pid, &status, options)) {
- pid=0;
- }
- if (errno == ECHILD) {
- pid=0;
+
+ ret = waitpid (pid, &status, options);
+
+ if (ret == pid) {
+ if (WEXITSTATUS(status) || WIFSIGNALED(status)) {
+ pid=0;
+ }
+ } else {
+ if (ret != 0) {
+ if (errno == ECHILD) {
+ /* no currently running children, reset pid */
+ pid=0;
+ }
+ } /* else the process is still running */
}
return status;
}
@@ -611,7 +636,7 @@ SystemExec::output_interposer()
ssize_t r;
unsigned long l = 1;
- ioctl(rfd, FIONBIO, &l); // set non-blocking I/O
+ ioctl(rfd, FIONBIO, &l); // set non-blocking I/O
for (;fcntl(rfd, F_GETFL)!=-1;) {
r = read(rfd, buf, sizeof(buf));
@@ -643,7 +668,8 @@ int
SystemExec::write_to_stdin(std::string d, size_t len)
{
const char *data;
- size_t r,c;
+ ssize_t r;
+ size_t c;
::pthread_mutex_lock(&write_lock);
data=d.c_str();
@@ -658,7 +684,7 @@ SystemExec::write_to_stdin(std::string d, size_t len)
sleep(1);
continue;
}
- if (r != (len-c)) {
+ if ((size_t) r != (len-c)) {
::pthread_mutex_unlock(&write_lock);
return c;
}
diff --git a/gtk2_ardour/video_timeline.cc b/gtk2_ardour/video_timeline.cc
index b68f57076e..3e7ef8f0a9 100644
--- a/gtk2_ardour/video_timeline.cc
+++ b/gtk2_ardour/video_timeline.cc
@@ -148,44 +148,41 @@ VideoTimeLine::set_session (ARDOUR::Session *s)
return;
}
- if (node) {
- ARDOUR_UI::instance()->start_video_server((Gtk::Window*)0, false);
+ ARDOUR_UI::instance()->start_video_server((Gtk::Window*)0, false);
- set_id(*node);
+ set_id(*node);
- const XMLProperty* proph = node->property (X_("Height"));
- if (proph) {
- editor->set_video_timeline_height(atoi(proph->value().c_str()));
- }
+ const XMLProperty* proph = node->property (X_("Height"));
+ if (proph) {
+ editor->set_video_timeline_height(atoi(proph->value().c_str()));
+ }
#if 0 /* TODO THINK: set FPS first time only ?! */
- const XMLProperty* propasfps = node->property (X_("AutoFPS"));
- if (propasfps) {
- auto_set_session_fps = atoi(propasfps->value().c_str())?true:false;
- }
+ const XMLProperty* propasfps = node->property (X_("AutoFPS"));
+ if (propasfps) {
+ auto_set_session_fps = atoi(propasfps->value().c_str())?true:false;
+ }
#endif
- const XMLProperty* propoffset = node->property (X_("VideoOffset"));
- if (propoffset) {
- video_offset = atoll(propoffset->value().c_str());
- video_offset_p = video_offset;
- }
-
- const XMLProperty* proplock = node->property (X_("VideoOffsetLock"));
- if (proplock) {
- video_offset_lock = atoi(proplock->value().c_str())?true:false;
- }
+ const XMLProperty* propoffset = node->property (X_("VideoOffset"));
+ if (propoffset) {
+ video_offset = atoll(propoffset->value().c_str());
+ video_offset_p = video_offset;
+ }
- const XMLProperty* localfile = node->property (X_("LocalFile"));
- if (localfile) {
- local_file = atoi(localfile->value().c_str())?true:false;
- }
+ const XMLProperty* proplock = node->property (X_("VideoOffsetLock"));
+ if (proplock) {
+ video_offset_lock = atoi(proplock->value().c_str())?true:false;
+ }
- const XMLProperty* propf = node->property (X_("Filename"));
- video_file_info(propf->value(), local_file);
+ const XMLProperty* localfile = node->property (X_("LocalFile"));
+ if (localfile) {
+ local_file = atoi(localfile->value().c_str())?true:false;
}
- node = _session->extra_xml (X_("Videomonitor"));
- if (node) {
+ const XMLProperty* propf = node->property (X_("Filename"));
+ video_file_info(propf->value(), local_file);
+
+ if ((node = _session->extra_xml (X_("Videomonitor")))) {
const XMLProperty* prop = node->property (X_("active"));
if (prop && prop->value() == "yes" && found_xjadeo() && !video_filename.empty() && local_file) {
open_video_monitor();
@@ -504,7 +501,7 @@ VideoTimeLine::video_file_info (std::string filename, bool local)
}
_session->config.set_video_pullup(0); /* TODO only set if set_timecode_format() was successful ?!*/
}
- if (video_file_fps != _session->timecode_frames_per_second()) {
+ if (floor(video_file_fps*100) != floor(_session->timecode_frames_per_second()*100)) {
warning << _("Video file's framerate is not equal to Ardour session timecode's framerate: ")
<< video_file_fps << _(" vs ") << _session->timecode_frames_per_second() << endmsg;
}
diff --git a/gtk2_ardour/window_manager.cc b/gtk2_ardour/window_manager.cc
index 986e6ade3a..2a195ac90f 100644
--- a/gtk2_ardour/window_manager.cc
+++ b/gtk2_ardour/window_manager.cc
@@ -130,12 +130,19 @@ Manager::set_session (ARDOUR::Session* s)
void
Manager::set_transient_for (Gtk::Window* parent)
{
+ /* OS X has a richer concept of window layering than X does (or
+ * certainly, than any accepted conventions on X), and so the use of
+ * Manager::set_transient_for() is not necessary on that platform.
+ *
+ * On OS X this is mostly taken care of by using the window type rather
+ * than explicit 1:1 transient-for relationships.
+ */
+
#ifndef __APPLE__
if (parent) {
for (Windows::const_iterator i = _windows.begin(); i != _windows.end(); ++i) {
Gtk::Window* win = (*i)->get();
if (win) {
- std::cerr << "marked " << win->get_title() << " as transient of " << parent->get_title() << std::endl;
win->set_transient_for (*parent);
}
}