X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fvideo_tool_paths.cc;h=012690205a8a799e43dc071796cb211a3b8d0db5;hb=cf52d6e4b40111eb04b244ec054055a4ec15dbe0;hp=5b8f0725ca1a33015d2bcf39aca38cd29afc3d4f;hpb=274522b1a4cb67de96edf9f1c2c198362862e99b;p=ardour.git diff --git a/gtk2_ardour/video_tool_paths.cc b/gtk2_ardour/video_tool_paths.cc index 5b8f0725ca..012690205a 100644 --- a/gtk2_ardour/video_tool_paths.cc +++ b/gtk2_ardour/video_tool_paths.cc @@ -27,8 +27,9 @@ #endif #include "pbd/file_utils.h" +#include "ui_config.h" #include "video_tool_paths.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace PBD; @@ -66,7 +67,7 @@ ArdourVideoToolPaths::harvid_exe (std::string &harvid_exe) #ifdef PLATFORM_WINDOWS std::string reg; - const char *program_files = PBD::get_win_special_folder (CSIDL_PROGRAM_FILES); + std::string program_files = PBD::get_win_special_folder_path (CSIDL_PROGRAM_FILES); #endif harvid_exe = ""; @@ -84,9 +85,9 @@ ArdourVideoToolPaths::harvid_exe (std::string &harvid_exe) { harvid_exe = g_build_filename(reg.c_str(), "harvid.exe", NULL); } - else if (program_files && Glib::file_test(g_build_filename(program_files, "harvid", "harvid.exe", NULL), Glib::FILE_TEST_EXISTS)) + else if (!program_files.empty() && Glib::file_test(g_build_filename(program_files.c_str(), "harvid", "harvid.exe", NULL), Glib::FILE_TEST_EXISTS)) { - harvid_exe = g_build_filename(program_files, "harvid", "harvid.exe", NULL); + harvid_exe = g_build_filename(program_files.c_str(), "harvid", "harvid.exe", NULL); } else if (Glib::file_test(X_("C:\\Program Files\\harvid\\harvid.exe"), Glib::FILE_TEST_EXISTS)) { harvid_exe = X_("C:\\Program Files\\harvid\\harvid.exe"); @@ -105,21 +106,31 @@ ArdourVideoToolPaths::xjadeo_exe (std::string &xjadeo_exe) std::string xjadeo_file_path; #ifdef PLATFORM_WINDOWS std::string reg; - const char *program_files = PBD::get_win_special_folder (CSIDL_PROGRAM_FILES); + std::string program_files = PBD::get_win_special_folder_path (CSIDL_PROGRAM_FILES); #endif + xjadeo_exe = X_(""); + if (getenv("XJREMOTE")) { xjadeo_exe = getenv("XJREMOTE"); +#ifdef __APPLE__ + } else if (!UIConfiguration::instance().get_xjadeo_binary().empty() + && Glib::file_test (UIConfiguration::instance().get_xjadeo_binary() + "/Contents/MacOS/xjadeo", Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) { + xjadeo_exe = UIConfiguration::instance().get_xjadeo_binary() + "/Contents/MacOS/xjadeo"; +#endif + } else if (!UIConfiguration::instance().get_xjadeo_binary().empty() + && Glib::file_test (UIConfiguration::instance().get_xjadeo_binary(), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) { + xjadeo_exe = UIConfiguration::instance().get_xjadeo_binary(); } else if (find_file (Searchpath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) { xjadeo_exe = xjadeo_file_path; } else if (find_file (Searchpath(Glib::getenv("PATH")), X_("xjadeo"), xjadeo_file_path)) { xjadeo_exe = 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_exe = X_("/Applications/Xjadeo.app/Contents/MacOS/xjremote"); + else if (Glib::file_test(X_("/Applications/Xjadeo.app/Contents/MacOS/xjadeo"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) { + xjadeo_exe = X_("/Applications/Xjadeo.app/Contents/MacOS/xjadeo"); } - else if (Glib::file_test(X_("/Applications/Jadeo.app/Contents/MacOS/xjremote"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) { - xjadeo_exe = X_("/Applications/Jadeo.app/Contents/MacOS/xjremote"); + else if (Glib::file_test(X_("/Applications/Jadeo.app/Contents/MacOS/Jadeo-bin"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) { + xjadeo_exe = X_("/Applications/Jadeo.app/Contents/MacOS/Jadeo-bin"); } #endif #ifdef PLATFORM_WINDOWS @@ -131,19 +142,16 @@ ArdourVideoToolPaths::xjadeo_exe (std::string &xjadeo_exe) { xjadeo_exe = std::string(g_build_filename(reg.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)) + else if (!program_files.empty() && Glib::file_test(g_build_filename(program_files.c_str(), "xjadeo", "xjadeo.exe", NULL), Glib::FILE_TEST_EXISTS)) { - xjadeo_exe = std::string(g_build_filename(program_files, "xjadeo", "xjadeo.exe", NULL)); + xjadeo_exe = std::string(g_build_filename(program_files.c_str(), "xjadeo", "xjadeo.exe", NULL)); } else if (Glib::file_test(X_("C:\\Program Files\\xjadeo\\xjadeo.exe"), Glib::FILE_TEST_EXISTS)) { xjadeo_exe = X_("C:\\Program Files\\xjadeo\\xjadeo.exe"); } #endif - else { - xjadeo_exe = X_(""); - return false; - } - return true; + + return (!xjadeo_exe.empty() && Glib::file_test(xjadeo_exe, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)); } bool @@ -151,7 +159,7 @@ ArdourVideoToolPaths::transcoder_exe (std::string &ffmpeg_exe, std::string &ffpr { #ifdef PLATFORM_WINDOWS std::string reg; - const char *program_files = PBD::get_win_special_folder (CSIDL_PROGRAM_FILES); + std::string program_files = PBD::get_win_special_folder_path (CSIDL_PROGRAM_FILES); #endif ffmpeg_exe = X_(""); @@ -176,8 +184,8 @@ ArdourVideoToolPaths::transcoder_exe (std::string &ffmpeg_exe, std::string &ffpr if (Glib::file_test(ffmpeg_exe, Glib::FILE_TEST_EXISTS)) { ; } - else if (program_files && Glib::file_test(g_build_filename(program_files, "harvid", "ffmpeg.exe", NULL), Glib::FILE_TEST_EXISTS)) { - ffmpeg_exe = g_build_filename(program_files, "harvid", "ffmpeg.exe", NULL); + else if (!program_files.empty() && Glib::file_test(g_build_filename(program_files.c_str(), "harvid", "ffmpeg.exe", NULL), Glib::FILE_TEST_EXISTS)) { + ffmpeg_exe = g_build_filename(program_files.c_str(), "harvid", "ffmpeg.exe", NULL); } else if (Glib::file_test(X_("C:\\Program Files\\ffmpeg\\ffmpeg.exe"), Glib::FILE_TEST_EXISTS)) { ffmpeg_exe = X_("C:\\Program Files\\ffmpeg\\ffmpeg.exe"); @@ -193,8 +201,8 @@ ArdourVideoToolPaths::transcoder_exe (std::string &ffmpeg_exe, std::string &ffpr if (Glib::file_test(ffprobe_exe, Glib::FILE_TEST_EXISTS)) { ; } - else if (program_files && Glib::file_test(g_build_filename(program_files, "harvid", "ffprobe.exe", NULL), Glib::FILE_TEST_EXISTS)) { - ffprobe_exe = g_build_filename(program_files, "harvid", "ffprobe.exe", NULL); + else if (!program_files.empty() && Glib::file_test(g_build_filename(program_files.c_str(), "harvid", "ffprobe.exe", NULL), Glib::FILE_TEST_EXISTS)) { + ffprobe_exe = g_build_filename(program_files.c_str(), "harvid", "ffprobe.exe", NULL); } else if (Glib::file_test(X_("C:\\Program Files\\ffmpeg\\ffprobe.exe"), Glib::FILE_TEST_EXISTS)) { ffprobe_exe = X_("C:\\Program Files\\ffmpeg\\ffprobe.exe");