summaryrefslogtreecommitdiff
path: root/gtk2_ardour/video_timeline.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-12-23 18:28:45 +0100
committerRobin Gareus <robin@gareus.org>2014-12-23 23:43:24 +0100
commit9c251037f006f189916d9fd647a4b7d517a6b94d (patch)
treea3514bc7bee8cebbbf25d5e4c63b2556b815171a /gtk2_ardour/video_timeline.cc
parent62355de33a00e40c20b79d7db1ac2139fd042743 (diff)
consolidate video-tool filepaths - step one
1:1 cut/paste
Diffstat (limited to 'gtk2_ardour/video_timeline.cc')
-rw-r--r--gtk2_ardour/video_timeline.cc55
1 files changed, 3 insertions, 52 deletions
diff --git a/gtk2_ardour/video_timeline.cc b/gtk2_ardour/video_timeline.cc
index f87883377f..8093ecdb1f 100644
--- a/gtk2_ardour/video_timeline.cc
+++ b/gtk2_ardour/video_timeline.cc
@@ -25,18 +25,13 @@
#include "pbd/convert.h"
#include "ardour/session_directory.h"
-#ifdef PLATFORM_WINDOWS
-#include <windows.h>
-#include <shlobj.h> // CSIDL_*
-#include "pbd/windows_special_dirs.h"
-#endif
-
#include "ardour_ui.h"
#include "public_editor.h"
#include "gui_thread.h"
#include "utils_videotl.h"
#include "rgb_macros.h"
#include "video_timeline.h"
+#include "video_tool_paths.h"
#include <gtkmm2ext/utils.h>
#include <pthread.h>
@@ -725,52 +720,7 @@ VideoTimeLine::xjadeo_readversion (std::string d, size_t /* s */) {
void
VideoTimeLine::find_xjadeo () {
- std::string xjadeo_file_path;
-#ifdef PLATFORM_WINDOWS
- HKEY key;
- DWORD size = PATH_MAX;
- char tmp[PATH_MAX+1];
- const char *program_files = PBD::get_win_special_folder (CSIDL_PROGRAM_FILES);
-#endif
- if (getenv("XJREMOTE")) {
- _xjadeo_bin = getenv("XJREMOTE");
- } else if (find_file (Searchpath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) {
- _xjadeo_bin = xjadeo_file_path;
- } else if (find_file (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");
- }
-#endif
-#ifdef PLATFORM_WINDOWS
- else if ( (ERROR_SUCCESS == RegOpenKeyExA (HKEY_LOCAL_MACHINE, "Software\\RSS\\xjadeo", 0, KEY_READ, &key))
- && (ERROR_SUCCESS == RegQueryValueExA (key, "Install_Dir", 0, NULL, reinterpret_cast<LPBYTE>(tmp), &size))
- )
- {
- _xjadeo_bin = std::string(g_build_filename(Glib::locale_to_utf8(tmp).c_str(), "xjadeo.exe", NULL));
- }
- else if ( (ERROR_SUCCESS == RegOpenKeyExA (HKEY_LOCAL_MACHINE, "Software\\RSS\\xjadeo", 0, KEY_READ | KEY_WOW64_32KEY, &key))
- && (ERROR_SUCCESS == RegQueryValueExA (key, "Install_Dir", 0, NULL, reinterpret_cast<LPBYTE>(tmp), &size))
- )
- {
- _xjadeo_bin = std::string(g_build_filename(Glib::locale_to_utf8(tmp).c_str(), "xjadeo.exe", NULL));
- }
- else if (program_files && Glib::file_test(g_build_filename(program_files, "xjadeo", "xjadeo.exe", NULL), Glib::FILE_TEST_EXISTS))
- {
- _xjadeo_bin = std::string(g_build_filename(program_files, "xjadeo", "xjadeo.exe", NULL));
- }
- /* generic fallback to try */
- else if (Glib::file_test(X_("C:\\Program Files\\xjadeo\\xjadeo.exe"), Glib::FILE_TEST_EXISTS)) {
- _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjadeo.exe");
- }
-#endif
- else {
- _xjadeo_bin = X_("");
+ if (!ArdourVideoToolPaths::xjadeo_exe(_xjadeo_bin)) {
warning << _("Video-monitor 'xjadeo' was not found. Please install http://xjadeo.sf.net/ "
"(a custom path to xjadeo can be specified by setting the XJREMOTE environment variable. "
"It should point to an application compatible with xjadeo's remote-control interface 'xjremote').\n"
@@ -778,6 +728,7 @@ VideoTimeLine::find_xjadeo () {
"see also http://manual.ardour.org/video-timeline/setup/")
<< endmsg;
}
+
if (found_xjadeo ()) {
ARDOUR::SystemExec version_check(_xjadeo_bin, X_("--version"));
xjadeo_version = "";