summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-08-16 13:30:00 +0200
committerRobin Gareus <robin@gareus.org>2014-08-16 13:30:00 +0200
commitab22a06ec7cc0027caffe521e7a53fc12379570c (patch)
tree6497d66ce7c9874d944f5d6eb005d31c854c1d61
parentffd5c24fa51e32667a48137f905673794841b3e6 (diff)
prepare for upcoming Jadeo.app -> Xjadeo.app rename on OSX.
also add Windows code while we're at it and fallback to xjadeo on GNU/Linux.
-rw-r--r--gtk2_ardour/video_timeline.cc35
1 files changed, 32 insertions, 3 deletions
diff --git a/gtk2_ardour/video_timeline.cc b/gtk2_ardour/video_timeline.cc
index 33331dbc8a..fd6a6f8dc2 100644
--- a/gtk2_ardour/video_timeline.cc
+++ b/gtk2_ardour/video_timeline.cc
@@ -39,6 +39,10 @@
#include <pthread.h>
#include <curl/curl.h>
+#ifdef PLATFORM_WINDOWS
+#include <windows.h>
+#endif
+
#include "i18n.h"
using namespace std;
@@ -718,20 +722,45 @@ void
VideoTimeLine::find_xjadeo () {
std::string xjadeo_file_path;
if (getenv("XJREMOTE")) {
- _xjadeo_bin = strdup(getenv("XJREMOTE")); // XXX TODO: free it?!
- } else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) {
+ _xjadeo_bin = getenv("XJREMOTE");
+ }
+ else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) {
_xjadeo_bin = xjadeo_file_path;
}
+ else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjadeo"), xjadeo_file_path)) {
+ _xjadeo_bin = xjadeo_file_path;
+ }
+#ifdef __APPLE__
+ else if (Glib::file_test(X_("/Applications/Xjadeo.app/Contents/MacOS/xjremote"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) {
+ _xjadeo_bin = X_("/Applications/Xjadeo.app/Contents/MacOS/xjremote");
+ }
else if (Glib::file_test(X_("/Applications/Jadeo.app/Contents/MacOS/xjremote"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) {
_xjadeo_bin = X_("/Applications/Jadeo.app/Contents/MacOS/xjremote");
}
- /* TODO: win32: allow to configure PATH to xjremote */
+#endif
+#ifdef PLATFORM_WINDOWS
+ else {
+ HKEY key;
+ DWORD size = PATH_MAX;
+ char path[PATH_MAX+1];
+ xjadeo_file_path = X_("");
+ if ( (ERROR_SUCCESS == RegOpenKeyExA (HKEY_LOCAL_MACHINE, "Software\\RSS\\xjadeo", 0, KEY_READ, &key))
+ && (ERROR_SUCCESS == RegQueryValueExA (key, "Install_Dir", 0, NULL, (LPBYTE)path, &size))
+ )
+ {
+ xjadeo_file_path = g_build_filename(path, X_("xjadeo.exe"));
+ }
+ }
+ if (Glib::file_test(xjadeo_file_path, Glib::FILE_TEST_EXISTS)) {
+ _xjadeo_bin = xjadeo_file_path;
+ }
else if (Glib::file_test(X_("C:\\Program Files\\xjadeo\\xjremote.exe"), Glib::FILE_TEST_EXISTS)) {
_xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.exe");
}
else if (Glib::file_test(X_("C:\\Program Files\\xjadeo\\xjremote.bat"), Glib::FILE_TEST_EXISTS)) {
_xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.bat");
}
+#endif
else {
_xjadeo_bin = X_("");
warning << _("Video-monitor 'xjadeo' was not found. Please install http://xjadeo.sf.net/ "