tentative fix for requesting driver+device list from backend
[ardour.git] / gtk2_ardour / video_server_dialog.cc
index f9a50821b54527580c05281ac446788b04b38e1d..add7ea42de8dd22224d8fb5c4152190f8acb44a2 100644 (file)
 #include "ardour/template_utils.h"
 #include "ardour/session.h"
 
+#ifdef PLATFORM_WINDOWS
+#include <windows.h>
+#include <shlobj.h> // CSIDL_*
+#include "pbd/windows_special_dirs.h"
+#endif
+
 #ifdef interface
 #undef interface
 #endif
 #include "utils_videotl.h"
 #include "i18n.h"
 
+#ifdef PLATFORM_WINDOWS
+#include <windows.h>
+#endif
+
 using namespace Gtk;
 using namespace std;
 using namespace PBD;
@@ -87,6 +97,7 @@ VideoServerDialog::VideoServerDialog (Session* s)
        HKEY key;
        DWORD size = PATH_MAX;
        char tmp[PATH_MAX+1];
+       const char *program_files = PBD::get_win_special_folder (CSIDL_PROGRAM_FILES);
 #endif
 
        std::string icsd_file_path;
@@ -100,15 +111,25 @@ VideoServerDialog::VideoServerDialog (Session* s)
        {
                path_entry.set_text(g_build_filename(Glib::locale_to_utf8(tmp).c_str(), "harvid.exe", 0));
        }
+       else if (program_files && Glib::file_test(g_build_filename(program_files, "harvid", "harvid.exe", 0), Glib::FILE_TEST_EXISTS))
+       {
+               path_entry.set_text(g_build_filename(program_files, "harvid", "harvid.exe", 0));
+       }
 #endif
+       /* generic fallbacks to try */
        else if (Glib::file_test(X_("C:\\Program Files\\harvid\\harvid.exe"), Glib::FILE_TEST_EXISTS)) {
                path_entry.set_text(X_("C:\\Program Files\\harvid\\harvid.exe"));
        }
        else {
                PBD::warning <<
                        string_compose(
-                       _("The external video server 'harvid' can not be found. The tool is included with the %1 releases from ardour.org, "
-                         "alternatively you can download it from http://x42.github.com/harvid/ or acquire it from your distribution."), PROGRAM_NAME)
+                                       _("The external video server 'harvid' can not be found.\n"
+                                               "The tool is included with the %1 releases from ardour.org, "
+                                               "alternatively you can download it from http://x42.github.com/harvid/ "
+                                               "or acquire it from your distribution.\n"
+                                               "\n"
+                                               "see also http://manual.ardour.org/video-timeline/setup/"
+                                        ), PROGRAM_NAME)
                        << endmsg;
        }