]> git.sesse.net Git - vlc/commitdiff
ProjectM/Milkdrop default presets path on windows using datadir
authorSébastien Toque <xilasz@gmail.com>
Sun, 9 Jan 2011 20:40:52 +0000 (21:40 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 9 Jan 2011 20:40:52 +0000 (21:40 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/visualization/projectm.cpp

index 8ab159ed67e8537cedb865de728b1d9ad79c6ab0..e0154590035fd79c5bb6f4f13a3c327fee0e170a 100644 (file)
@@ -82,8 +82,12 @@ vlc_module_begin ()
 #ifndef HAVE_PROJECTM2
     add_loadfile( "projectm-config", "/usr/share/projectM/config.inp",
                   CONFIG_TEXT, CONFIG_LONGTEXT, true )
+#else
+#ifdef WIN32
+    add_directory( "projectm-preset-path", NULL,
 #else
     add_directory( "projectm-preset-path", "/usr/share/projectM/presets",
+#endif
                   PRESET_PATH_TXT, PRESET_PATH_LONGTXT, true )
     add_font( "projectm-title-font", "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf",
                   TITLE_FONT_TXT, TITLE_FONT_LONGTXT, true )
@@ -349,6 +353,14 @@ static void *Thread( void *p_data )
     free( psz_config );
 #else
     psz_preset_path = var_InheritString( p_filter, "projectm-preset-path" );
+#ifdef WIN32
+    if ( psz_preset_path == NULL )
+    {
+        char *psz_data_path = config_GetDataDir( p_filter );
+        asprintf( &psz_preset_path, "%s" DIR_SEP "visualisation", psz_data_path );
+        free( psz_data_path );
+    }
+#endif
     psz_title_font = var_InheritString( p_filter, "projectm-title-font" );
     psz_menu_font = var_InheritString( p_filter, "projectm-menu-font" );