[matroska] r1114 - in trunk/MatroskaUtils: . ShellExtension ShellExtension/DShowTools

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: jcsston
Date: 2005-04-03 11:03:55 +0400 (Sun, 03 Apr 2005)
New Revision: 1114

Added:
   trunk/MatroskaUtils/ShellExtension/Http.cpp
   trunk/MatroskaUtils/ShellExtension/Http.h
   trunk/MatroskaUtils/appsetup05.ico
Modified:
   trunk/MatroskaUtils/JCThread.h
   trunk/MatroskaUtils/MatroskaCDL.rc
   trunk/MatroskaUtils/MatroskaPages.cpp
   trunk/MatroskaUtils/MatroskaPages.h
   trunk/MatroskaUtils/MatroskaTrackData.h
   trunk/MatroskaUtils/MatroskaUtils.vcproj
   trunk/MatroskaUtils/ShellExtension/DShowTools/DShowTools.h
   trunk/MatroskaUtils/ShellExtension/DShowTools/DShowTools.vcproj
   trunk/MatroskaUtils/ShellExtension/MatroskaProp.cpp
   trunk/MatroskaUtils/ShellExtension/MatroskaProp.sln
   trunk/MatroskaUtils/ShellExtension/MatroskaProp.vcproj
   trunk/MatroskaUtils/ShellExtension/MatroskaProp_Language.nsi
   trunk/MatroskaUtils/build.py
   trunk/MatroskaUtils/resource.h
Log:


Modified: trunk/MatroskaUtils/JCThread.h
===================================================================
--- trunk/MatroskaUtils/JCThread.h	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/JCThread.h	2005-04-03 07:03:55 UTC (rev 1114)
@@ -178,10 +178,12 @@
 		return m_RefCount++;
 	}
 	long JCThread_RemoveRef() {
-		JCAutoLockCritSec refCountLock(&m_RefCountCrit);	
+    {
+		  JCAutoLockCritSec refCountLock(&m_RefCountCrit);	
 
-		if (--m_RefCount)
-			return m_RefCount;
+		  if (--m_RefCount)
+			  return m_RefCount;
+    }
 
 		delete this;
 

Modified: trunk/MatroskaUtils/MatroskaCDL.rc
===================================================================
--- trunk/MatroskaUtils/MatroskaCDL.rc	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/MatroskaCDL.rc	2005-04-03 07:03:55 UTC (rev 1114)
@@ -647,8 +647,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2, 7, 0, 2164
- PRODUCTVERSION 2, 7, 0, 2164
+ FILEVERSION 2, 8, 0, 2219
+ PRODUCTVERSION 2, 8, 0, 2219
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -666,12 +666,12 @@
             VALUE "Comments", "Get the lastest version at http://www.matroska.org/"
             VALUE "CompanyName", " "
             VALUE "FileDescription", "Matroska Shell Ext"
-            VALUE "FileVersion", "2, 7, 0, 2164\0" 
+            VALUE "FileVersion", "2, 8, 0, 2219\0" 
             VALUE "InternalName", "MatroskaCDL"
-            VALUE "LegalCopyright", "Copyright © 2003-2004 Jory Stone ([email protected])"
+            VALUE "LegalCopyright", "Copyright © 2003-2005 Jory Stone ([email protected])"
             VALUE "OriginalFilename", "MatroskaCDL.rc"
             VALUE "ProductName", "Matroska Shell Ext"
-            VALUE "ProductVersion", "2, 7, 0, 2164\0" 
+            VALUE "ProductVersion", "2, 8, 0, 2219\0" 
         END
     END
     BLOCK "VarFileInfo"
@@ -699,6 +699,7 @@
 IDI_ICON_AUDIO          ICON                    "audio.ico"
 IDI_ICON_SUBTITLE       ICON                    "subtitle.ico"
 IDI_ICON_VIDEO          ICON                    "video.ico"
+IDI_ICON_SETUP          ICON                    "appsetup05.ico"
 
 /////////////////////////////////////////////////////////////////////////////
 //

Modified: trunk/MatroskaUtils/MatroskaPages.cpp
===================================================================
--- trunk/MatroskaUtils/MatroskaPages.cpp	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/MatroskaPages.cpp	2005-04-03 07:03:55 UTC (rev 1114)
@@ -99,7 +99,7 @@
 
 	about_txt.append("\r\n");
 	about_txt.append(_W("Developed by"));
-	about_txt.append(" Jory Stone ([email protected])\r\n\r\n");
+	about_txt.append(" Jory Stone ([email protected])\r\n\r\n");
 	
 	about_txt.append(_W("Reads infomation about a Matroska file and R/W the Tags of a Matroska file"
 		"via a Property sheet, also allows Tooltips, Thumbnails, and more for Matroska files in Windows Explorer."));
@@ -2569,6 +2569,9 @@
 	TOOLINFO ti;
 	RECT rect;
 
+  memset(&ti, 0, sizeof(TOOLINFO));
+  memset(&rect, 0, sizeof(RECT));
+
 	if (hwndClient == NULL && strText == NULL) {
 		// Remove all the tooltips from the control
 		
@@ -2580,33 +2583,36 @@
 			SendMessage(hwndTooltip, TTM_ENUMTOOLS, 0, (LPARAM)(LPTOOLINFO)&ti);
 			SendMessage(hwndTooltip, TTM_DELTOOL, 0, (LPARAM)(LPTOOLINFO)&ti);		
 		}
-	}
-	// Get the coordinates of the client control
-	GetClientRect(hwndClient, &rect);
+  } else {    
+	  // Get the coordinates of the client control
+	  GetClientRect(hwndClient, &rect);
 
-  // Setup the toolinfo structure
-	ti.cbSize = sizeof(TOOLINFO);
-	ti.uFlags = TTF_SUBCLASS;
-	ti.hwnd = hwndClient;
-#ifdef MATROSKA_PROP
-	ti.hinst = GetModuleHandle(_T("MatroskaProp"));
-#else
-	ti.hinst = GetModuleHandle(_T("MatroskaCDL"));
-#endif
-	ti.uId = id;
-	ti.lpszText = strText;
+    // Setup the toolinfo structure
+	  ti.cbSize = sizeof(TOOLINFO);
+	  ti.uFlags = TTF_SUBCLASS;
+	  ti.hwnd = hwndClient;
+  #ifdef MATROSKA_PROP
+	  ti.hinst = GetModuleHandle(_T("MatroskaProp"));
+  #else
+	  ti.hinst = GetModuleHandle(_T("MatroskaCDL"));
+  #endif
+	  ti.uId = id;
+	  ti.lpszText = strText;
 
-	// Tooltip control will cover the whole window
-	ti.rect.left	= rect.left;
-	ti.rect.top		= rect.top;
-	ti.rect.right	= rect.right;
-	ti.rect.bottom	= rect.bottom;
+	  // Tooltip control will cover the whole window
+	  ti.rect.left	= rect.left;
+	  ti.rect.top		= rect.top;
+	  ti.rect.right	= rect.right;
+	  ti.rect.bottom	= rect.bottom;
 
-	// Add the tooltip
-	SendMessage(hwndTooltip, TTM_ADDTOOL, 0, (LPARAM)(LPTOOLINFO)&ti);
+	  // Add the tooltip
+	  SendMessage(hwndTooltip, TTM_ADDTOOL, 0, (LPARAM)(LPTOOLINFO)&ti);
 
-	// Return the id of the tooltip
-	return id++;
+    // Return the id of the tooltip
+    return id++;
+  }
+
+  return 0;
 };
 
 void CrashMe()

Modified: trunk/MatroskaUtils/MatroskaPages.h
===================================================================
--- trunk/MatroskaUtils/MatroskaPages.h	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/MatroskaPages.h	2005-04-03 07:03:55 UTC (rev 1114)
@@ -33,7 +33,7 @@
 */
 
 #define MATROSKA_CDL_APP_NAME "The Matroska Infomation CDL v1.8"
-#define MATROSKA_SHELL_EXT_APP_NAME "Matroska Shell Extension v2.7"
+#define MATROSKA_SHELL_EXT_APP_NAME "Matroska Shell Extension v2.8"
 
 #ifndef _MATROSKA_PAGES_H_
 #define _MATROSKA_PAGES_H_

Modified: trunk/MatroskaUtils/MatroskaTrackData.h
===================================================================
--- trunk/MatroskaUtils/MatroskaTrackData.h	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/MatroskaTrackData.h	2005-04-03 07:03:55 UTC (rev 1114)
@@ -170,7 +170,8 @@
 		MatroskaTrackInfo(MatroskaSegmentInfo *segment, uint64 trackUID);
 		/// Destroys the class
 		virtual ~MatroskaTrackInfo();
-		/// Returns the track number of this track, please note that using UID's is highly recommend
+		
+    /// Returns the track number of this track, please note that using UID's is highly recommend
 		/// \return The number of this track
 		virtual uint16 GetTrackNumber();
 		/// Sets the track number of this track, please note that using UID's is highly recommend

Modified: trunk/MatroskaUtils/MatroskaUtils.vcproj
===================================================================
--- trunk/MatroskaUtils/MatroskaUtils.vcproj	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/MatroskaUtils.vcproj	2005-04-03 07:03:55 UTC (rev 1114)
@@ -19,11 +19,12 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".\;.\..\libebml\;.\..\libebml\src\platform\win32;.\..\libmatroska\"
-				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;USING_BITRATE_INFO"
+				AdditionalIncludeDirectories=".\;.\..\libebml\;.\..\libebml\src\platform\win32;.\..\libmatroska\;.\tinyxml;.\gettext;.\..\CxImage\;&quot;.\..\CxImage\zlib-1.2.1-1&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;MATROSKA_PROP;USING_CXIMAGE;USING_TINYXML;USING_GETTTEXT;USING_BITRATE_INFO"
 				MinimalRebuild="TRUE"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
+				RuntimeTypeInfo="TRUE"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				Detect64BitPortabilityProblems="TRUE"
@@ -60,9 +61,10 @@
 			CharacterSet="1">
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".\;.\..\libebml\;.\..\libebml\src\platform\win32;.\..\libmatroska\"
-				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;USING_BITRATE_INFO"
+				AdditionalIncludeDirectories=".\;.\..\libebml\;.\..\libebml\src\platform\win32;.\..\libmatroska\;.\tinyxml;.\gettext;.\..\CxImage\;&quot;.\..\CxImage\zlib-1.2.1-1&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;MATROSKA_PROP;USING_CXIMAGE;USING_TINYXML;USING_GETTTEXT;USING_BITRATE_INFO"
 				RuntimeLibrary="2"
+				RuntimeTypeInfo="TRUE"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				Detect64BitPortabilityProblems="TRUE"

Modified: trunk/MatroskaUtils/ShellExtension/DShowTools/DShowTools.h
===================================================================
--- trunk/MatroskaUtils/ShellExtension/DShowTools/DShowTools.h	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/ShellExtension/DShowTools/DShowTools.h	2005-04-03 07:03:55 UTC (rev 1114)
@@ -35,11 +35,14 @@
 #include <windows.h>
 #include "CxImage/ximage.h"
 
+#define DSHOWTOOLS_DLL_EXPORT
+#ifndef DSHOWTOOLS_DLL_EXPORT
 #ifdef DSHOWTOOLS_DLL
 #define DSHOWTOOLS_DLL_EXPORT __declspec(dllexport)
 #else
 #define DSHOWTOOLS_DLL_EXPORT __declspec(dllimport)
 #endif
+#endif
 
 // Mode 1 = CxImageRenderer
 // Mode 2 = IMediaDet

Modified: trunk/MatroskaUtils/ShellExtension/DShowTools/DShowTools.vcproj
===================================================================
--- trunk/MatroskaUtils/ShellExtension/DShowTools/DShowTools.vcproj	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/ShellExtension/DShowTools/DShowTools.vcproj	2005-04-03 07:03:55 UTC (rev 1114)
@@ -124,7 +124,7 @@
 				ProgramDataBaseFileName=".\Release/"
 				WarningLevel="4"
 				SuppressStartupBanner="TRUE"
-				DebugInformationFormat="0"/>
+				DebugInformationFormat="3"/>
 			<Tool
 				Name="VCCustomBuildTool"/>
 			<Tool
@@ -175,6 +175,131 @@
 			<Tool
 				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
 		</Configuration>
+		<Configuration
+			Name="ReleaseLib|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="1"
+			WholeProgramOptimization="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="1"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="FALSE"
+				ImproveFloatingPointConsistency="FALSE"
+				FavorSizeOrSpeed="2"
+				OmitFramePointers="FALSE"
+				OptimizeForProcessor="0"
+				AdditionalIncludeDirectories=".\;..\..\..\CxImage;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;UNICODE;_UNICODE;DSHOWTOOLS_DLL"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="TRUE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderThrough=""
+				PrecompiledHeaderFile=".\Release/DShowTools.pch"
+				ExpandAttributedSource="FALSE"
+				AssemblerOutput="0"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="4"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				AdditionalLibraryDirectories=""/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="TRUE"
+				SuppressStartupBanner="TRUE"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/DShowTools.tlb"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="DebugLib|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				InlineFunctionExpansion="0"
+				AdditionalIncludeDirectories=".\;..\..\..\CxImage\;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;UNICODE;_UNICODE;DSHOWTOOLS_DLL"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				TreatWChar_tAsBuiltInType="FALSE"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/DShowTools.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="4"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"
+				Description="Copying DLL to C:\Program Files\MatroskaProp\ directory..."
+				CommandLine="copy &quot;$(TargetPath)&quot; &quot;C:\Program Files\MatroskaProp\&quot;
+"
+				Outputs="&quot;C:\Program Files\MatroskaProp\DShowTools.dll&quot;"/>
+			<Tool
+				Name="VCLibrarianTool"/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="TRUE"
+				SuppressStartupBanner="TRUE"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/DShowTools.tlb"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
 	</Configurations>
 	<References>
 	</References>
@@ -218,6 +343,24 @@
 "
 						Outputs="&quot;$(ProjectDir)$(InputName).obj&quot;"/>
 				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseLib|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Assembling: $(InputFileName)"
+						CommandLine="ml /nologo /c &quot;$(InputPath)&quot;
+"
+						Outputs="&quot;$(ProjectDir)$(InputName).obj&quot;"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="DebugLib|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						Description="Assembling: $(InputFileName)"
+						CommandLine="ml /nologo /c &quot;$(InputPath)&quot;
+"
+						Outputs="&quot;$(ProjectDir)$(InputName).obj&quot;"/>
+				</FileConfiguration>
 			</File>
 		</Filter>
 	</Files>

Added: trunk/MatroskaUtils/ShellExtension/Http.cpp
===================================================================
--- trunk/MatroskaUtils/ShellExtension/Http.cpp	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/ShellExtension/Http.cpp	2005-04-03 07:03:55 UTC (rev 1114)
@@ -0,0 +1,123 @@
+#include "Http.h"
+
+#define MAX_PAGE (1024*64)
+
+static char PageBuffer[MAX_PAGE];
+
+static int GetAddr(const char* HostName, int Port, struct sockaddr* Result)
+{
+  struct hostent* Host;
+  SOCKADDR_IN Address;
+
+  memset(Result, 0, sizeof(*Result));
+  memset(&Address, 0, sizeof(Address));
+
+  Host                = gethostbyname(HostName);
+  if(Host != NULL)
+  {
+    Address.sin_family  = AF_INET;
+    Address.sin_port    = htons((short)Port);
+    memcpy(&Address.sin_addr, Host->h_addr_list[0], Host->h_length);
+    memcpy(Result, &Address, sizeof(Address));
+  }
+  return Host != NULL;
+}
+
+static void ReadPage(const char* Host, const char* Page)
+{
+  struct sockaddr SockAddr;
+  SOCKET Socket;
+  int Port = 80; /* HTTP */
+
+  if(GetAddr(Host, Port, &SockAddr))
+  {
+    int     Status;
+
+    Socket = socket(AF_INET, SOCK_STREAM, 0);
+    Status = connect(Socket, &SockAddr, sizeof(SockAddr));
+    if(Status >= 0)
+    {
+      DWORD   StartTime, EndTime;
+      char    Request[512];
+      char*   Rover   = PageBuffer;
+      int     Read;
+
+      sprintf(Request, "GET %s HTTP/1.0\nHost: %s\n\n", Page, Host);
+      send(Socket, Request, strlen(Request), 0);
+
+      StartTime = GetTickCount();
+      for(Read=0;Read < MAX_PAGE;)
+      {
+        int     ThisRead;
+
+        ThisRead = recv(Socket, Rover, MAX_PAGE-Read, 0);
+        if(ThisRead == SOCKET_ERROR || ThisRead == 0)
+          break;
+        else
+        {
+          Read    += ThisRead;
+          Rover   += ThisRead;
+        }
+      }
+      EndTime = GetTickCount();
+      printf("%d milliseconds to read %d-byte page\n",
+        EndTime-StartTime, Read);
+      closesocket(Socket);
+    }
+    else
+      fprintf(stderr, "connect failed (%d)\n",
+      WSAGetLastError());
+  }
+  else
+    fprintf(stderr, "Can't map hostname '%s'\n", Host);
+}
+
+CHttp::CHttp()
+{  
+  WSAStartup(0x0001, &m_WsaData);  
+}
+
+CHttp::~CHttp()
+{
+  WSACleanup();
+}
+
+std::string CHttp::ReadPage(const std::string &Host, const std::string &Page)
+{
+  PageBuffer[0] = '\0';
+  ::ReadPage(Host.c_str(), Page.c_str());
+  return PageBuffer;
+}
+
+JString CHttp::ConvertToValidURI(JString uri)
+{
+  JString out_str;
+  JString hexa_code;
+  size_t i;
+
+  for (i = 0; i < uri.length(); i++)
+  {
+    char c = uri[i];
+
+    if (c == ' ')
+    {
+      out_str += "%20";
+    }
+    else
+    {
+      static const char marks[] = "-_!~*'";
+
+      if (!isalnum(c) && !strchr(marks, c))
+      {
+        hexa_code = JString::Format("%%%02X", c);
+        out_str += hexa_code;
+      }
+      else
+      {
+        out_str += c;
+      }
+    }
+  }
+
+  return out_str;
+}
\ No newline at end of file

Added: trunk/MatroskaUtils/ShellExtension/Http.h
===================================================================
--- trunk/MatroskaUtils/ShellExtension/Http.h	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/ShellExtension/Http.h	2005-04-03 07:03:55 UTC (rev 1114)
@@ -0,0 +1,33 @@
+#ifndef _HTTP_H_
+#define _HTTP_H_
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <winsock.h>
+#include <windows.h>
+#include <string>
+#include "JString.h"
+
+// try to tell linker where WinSock library is
+#if defined(_MSC_VER)
+#   pragma comment(lib,"wsock32.lib")
+#elif defined(__BORLANDC__)
+#   pragma comment(lib,"mswsock.lib")
+#endif
+
+
+class CHttp
+{
+public:
+  CHttp();
+  ~CHttp();
+
+  std::string ReadPage(const std::string &Host, const std::string &Page);
+  
+  static JString ConvertToValidURI(JString uri);
+private:
+  WSADATA m_WsaData;
+};
+
+#endif // _HTTP_H_
\ No newline at end of file

Modified: trunk/MatroskaUtils/ShellExtension/MatroskaProp.cpp
===================================================================
--- trunk/MatroskaUtils/ShellExtension/MatroskaProp.cpp	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/ShellExtension/MatroskaProp.cpp	2005-04-03 07:03:55 UTC (rev 1114)
@@ -54,6 +54,8 @@
 #include "MatroskaProp.h"
 #pragma data_seg()
 
+#include "Http.h"
+
 #include "mdump.h"
 CrashCatcher *g_objCrasher = NULL;
 
@@ -249,7 +251,55 @@
 
 STDAPI SubmitSurvey()
 {
+  JString survey = MatroskaShellExt_GetRegistryValueStr(_T("Survey"), _T("SelectedLanguage=English"));
+  
+  OSVERSIONINFO osVer;
+  osVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+  if (GetVersionEx(&osVer)) {
+    survey += ":OS=";
+    if (osVer.dwMajorVersion == 4 && osVer.dwMinorVersion == 0) {
+      survey += _T("Windows 95");
 
+    } else if (osVer.dwMajorVersion == 4 && osVer.dwMinorVersion == 10) {
+      survey += _T("Windows 98");
+
+    } else if (osVer.dwMajorVersion == 4 && osVer.dwMinorVersion == 90) {
+      survey += _T("Windows ME");
+
+    } else if (osVer.dwMajorVersion == 3 && osVer.dwMinorVersion == 51) {
+      survey += _T("Windows NT 3.51");
+
+    } else if (osVer.dwMajorVersion == 4 && osVer.dwMinorVersion == 0) {
+      survey += _T("Windows NT 4.0");
+
+    } else if (osVer.dwMajorVersion == 5 && osVer.dwMinorVersion == 0) {
+      survey += _T("Windows NT 2000");
+
+    } else if (osVer.dwMajorVersion == 5 && osVer.dwMinorVersion == 1) {
+      survey += _T("Windows XP");
+    
+    } else {
+      survey += JString::Format(_T("Unknown %i.%i"), osVer.dwMajorVersion, osVer.dwMinorVersion);
+    }
+  }
+    
+  char szBuffer[256];
+  szBuffer[0] = 0;
+  GetLocaleInfoA(LOCALE_SYSTEM_DEFAULT, LOCALE_SLANGUAGE, szBuffer, 255);
+  if (strlen(szBuffer) > 0) {
+    survey += ":SystemLanguage=";
+    survey += szBuffer;
+  }
+
+  survey = CHttp::ConvertToValidURI(survey);
+
+  std::string url;
+  url = "/MatroskaProp.php?Survey=";
+  url += survey.mb_str();
+
+  CHttp http;
+  std::string result = http.ReadPage("www.jory.info", url);  
+  //MessageBoxA(NULL, result.c_str(), "Survey Results", 0);
   return S_OK;
 }
 

Modified: trunk/MatroskaUtils/ShellExtension/MatroskaProp.sln
===================================================================
--- trunk/MatroskaUtils/ShellExtension/MatroskaProp.sln	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/ShellExtension/MatroskaProp.sln	2005-04-03 07:03:55 UTC (rev 1114)
@@ -51,14 +51,14 @@
 		{168C0F0D-9975-4D24-885C-87A9B018617E}.Debug.Build.0 = Debug|Win32
 		{168C0F0D-9975-4D24-885C-87A9B018617E}.Release.ActiveCfg = Release|Win32
 		{168C0F0D-9975-4D24-885C-87A9B018617E}.Release.Build.0 = Release|Win32
-		{F0438224-54EC-4618-B906-7DD31CFC9235}.Debug.ActiveCfg = Debug|Win32
-		{F0438224-54EC-4618-B906-7DD31CFC9235}.Debug.Build.0 = Debug|Win32
-		{F0438224-54EC-4618-B906-7DD31CFC9235}.Release.ActiveCfg = Release|Win32
-		{F0438224-54EC-4618-B906-7DD31CFC9235}.Release.Build.0 = Release|Win32
-		{E31A72D4-7501-4BCF-85D1-4859B85C13FE}.Debug.ActiveCfg = Debug|Win32
-		{E31A72D4-7501-4BCF-85D1-4859B85C13FE}.Debug.Build.0 = Debug|Win32
-		{E31A72D4-7501-4BCF-85D1-4859B85C13FE}.Release.ActiveCfg = Release|Win32
-		{E31A72D4-7501-4BCF-85D1-4859B85C13FE}.Release.Build.0 = Release|Win32
+		{F0438224-54EC-4618-B906-7DD31CFC9235}.Debug.ActiveCfg = DebugLib|Win32
+		{F0438224-54EC-4618-B906-7DD31CFC9235}.Debug.Build.0 = DebugLib|Win32
+		{F0438224-54EC-4618-B906-7DD31CFC9235}.Release.ActiveCfg = ReleaseLib|Win32
+		{F0438224-54EC-4618-B906-7DD31CFC9235}.Release.Build.0 = ReleaseLib|Win32
+		{E31A72D4-7501-4BCF-85D1-4859B85C13FE}.Debug.ActiveCfg = DebugLib|Win32
+		{E31A72D4-7501-4BCF-85D1-4859B85C13FE}.Debug.Build.0 = DebugLib|Win32
+		{E31A72D4-7501-4BCF-85D1-4859B85C13FE}.Release.ActiveCfg = ReleaseLib|Win32
+		{E31A72D4-7501-4BCF-85D1-4859B85C13FE}.Release.Build.0 = ReleaseLib|Win32
 		{001097C4-F5EA-405F-ABE9-D05F8437D632}.Debug.ActiveCfg = Debug|Win32
 		{001097C4-F5EA-405F-ABE9-D05F8437D632}.Debug.Build.0 = Debug|Win32
 		{001097C4-F5EA-405F-ABE9-D05F8437D632}.Release.ActiveCfg = Release|Win32

Modified: trunk/MatroskaUtils/ShellExtension/MatroskaProp.vcproj
===================================================================
--- trunk/MatroskaUtils/ShellExtension/MatroskaProp.vcproj	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/ShellExtension/MatroskaProp.vcproj	2005-04-03 07:03:55 UTC (rev 1114)
@@ -18,7 +18,8 @@
 			IntermediateDirectory=".\Debug"
 			ConfigurationType="2"
 			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="1">
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
@@ -51,15 +52,15 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalOptions="/MACHINE:I386"
-				AdditionalDependencies="delayimp.lib Shlwapi.lib oldnames.lib comctl32.lib wsock32.lib quartz.lib strmiids.lib ..\..\CxImage\CxImage\CxImageDLL\Release\cximagecrt.lib ..\..\CxImage\zlib-1.2.1-1\libz.lib UnicoWS.lib"
+				AdditionalDependencies="Shlwapi.lib oldnames.lib comctl32.lib wsock32.lib quartz.lib strmiids.lib cximage.lib zlib.lib winmm.lib STRMBASEUD.lib UnicoWS.lib"
 				OutputFile=".\Debug/MatroskaProp.dll"
 				LinkIncremental="2"
 				SuppressStartupBanner="TRUE"
-				AdditionalLibraryDirectories=""
+				AdditionalLibraryDirectories="..\..\..\RAC\BaseClasses\Debug_Unicode;..\..\CxImage\CxImage\Debug;..\..\CxImage\zlib\Debug"
 				IgnoreAllDefaultLibraries="FALSE"
 				IgnoreDefaultLibraryNames="LIBCMT.LIB;..\..\CxImage\CxImage\CxImageDLL\Debug\cximagecrtd.lib"
 				ModuleDefinitionFile=".\MatroskaProp.def"
-				DelayLoadDLLs="DShowTools.dll;cximagecrt.dll;zlib1.dll;TinyXml.dll"
+				DelayLoadDLLs=""
 				GenerateDebugInformation="TRUE"
 				GenerateMapFile="TRUE"
 				MapFileName="$(OutDir)/$(ProjectName).map"
@@ -110,6 +111,7 @@
 			ConfigurationType="2"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="FALSE"
+			CharacterSet="1"
 			WholeProgramOptimization="FALSE">
 			<Tool
 				Name="VCCLCompilerTool"
@@ -147,15 +149,16 @@
 				Outputs="&quot;C:\Program Files\MatroskaProp\MatroskaProp.dll&quot;"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="delayimp.lib Shlwapi.lib oldnames.lib comctl32.lib wsock32.lib ..\..\CxImage\CxImage\CxImageDLL\Release\cximagecrt.lib ..\..\CxImage\zlib-1.2.1-1\libz.lib UnicoWS.lib"
+				AdditionalDependencies="Shlwapi.lib oldnames.lib comctl32.lib wsock32.lib cximage.lib zlib.lib winmm.lib quartz.lib strmiids.lib STRMBASEU.lib UnicoWS.lib"
 				OutputFile=".\Release/MatroskaProp.dll"
-				Version="2.6"
+				Version="2.7"
 				LinkIncremental="1"
 				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="..\..\..\RAC\BaseClasses\Release_Unicode;..\..\CxImage\CxImage\Release\;..\..\CxImage\zlib\Release\"
 				IgnoreAllDefaultLibraries="FALSE"
 				IgnoreDefaultLibraryNames="LIBCMT.LIB;..\..\CxImage\CxImage\CxImageDLL\Debug\cximagecrtd.lib"
 				ModuleDefinitionFile=".\MatroskaProp.def"
-				DelayLoadDLLs="DShowTools.dll;zlib1.dll;TinyXml.dll"
+				DelayLoadDLLs=""
 				GenerateDebugInformation="TRUE"
 				GenerateMapFile="TRUE"
 				MapFileName="$(OutDir)/$(ProjectName).map"
@@ -232,6 +235,9 @@
 				RelativePath=".\Exports.cpp">
 			</File>
 			<File
+				RelativePath=".\Http.cpp">
+			</File>
+			<File
 				RelativePath=".\MatroskaInfoParserCache.cpp">
 			</File>
 			<File
@@ -421,6 +427,12 @@
 			</File>
 		</Filter>
 		<File
+			RelativePath="..\appsetup05.ico">
+		</File>
+		<File
+			RelativePath=".\Http.h">
+		</File>
+		<File
 			RelativePath="..\JCThread.h">
 		</File>
 		<File

Modified: trunk/MatroskaUtils/ShellExtension/MatroskaProp_Language.nsi
===================================================================
--- trunk/MatroskaUtils/ShellExtension/MatroskaProp_Language.nsi	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/ShellExtension/MatroskaProp_Language.nsi	2005-04-03 07:03:55 UTC (rev 1114)
@@ -1,11 +1,10 @@
 
 !define MATROSKAPROP_VERSION_MAJOR 2
-!define MATROSKAPROP_VERSION_MINOR 7
-!define MATROSKAPROP_VERSION_BUILD 2164
+!define MATROSKAPROP_VERSION_MINOR 8
+!define MATROSKAPROP_VERSION_BUILD 2219
 
-!define INCLUDE_SOURCE_CODE
-!define MATROSKAPROP_SOURCE_ARCHIVE "D:\Visual Studio Projects\matroska\MatroskaUtils\ShellExtension\MatroskaProp-20050325-src.tar.bz2"
-!define MATROSKAPROP_SOURCE_ARCHIVE "D:\Visual Studio Projects\matroska\MatroskaUtils\ShellExtension\MatroskaProp-20050325-src.tar.bz2"
+#!define INCLUDE_SOURCE_CODE
+!define MATROSKAPROP_SOURCE_ARCHIVE "D:\Visual Studio Projects\matroska\MatroskaUtils\ShellExtension\MatroskaProp-20050402-src.tar.bz2"
 
 !include "${NSISDIR}\Include\WinMessages.nsh"
 !include "${NSISDIR}\Include\Sections.nsh"
@@ -71,7 +70,7 @@
 
 VIAddVersionKey /LANG=${LANG_ENGLISH} FileDescription "Matroska Shell Ext Installer"
 VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName "MatroskaProp"
-VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright "(c) 2003-2004 Jory Stone <[email protected]>"
+VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright "(c) 2003-2005 Jory Stone <[email protected]>"
 VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion "${MATROSKAPROP_VERSION_MAJOR}, ${MATROSKAPROP_VERSION_MINOR}, 0, ${MATROSKAPROP_VERSION_BUILD}"
 VIAddVersionKey /LANG=${LANG_ENGLISH} ProductVersion "${MATROSKAPROP_VERSION_MAJOR}, ${MATROSKAPROP_VERSION_MINOR}, 0, ${MATROSKAPROP_VERSION_BUILD}"
 VIProductVersion "${MATROSKAPROP_VERSION_MAJOR}.${MATROSKAPROP_VERSION_MINOR}.0.${MATROSKAPROP_VERSION_BUILD}"
@@ -153,11 +152,6 @@
   File "MatroskaProp_ChooseIcon.exe"
   File "MatroskaProp_Configure.exe"
   File "..\gettext\gnu_gettext.dll"
-  ;File "id3lib.dll"
-  File "cximagecrt.dll"
-  File "zlib1.dll"
-  File "DShowTools\Release\DShowTools.dll"
-  File "..\tinyxml\Release\TinyXml.dll"
 
   ; Set the default language to be used
   WriteRegStr HKLM "Software\MatroskaProp" "Translation" $(translationKey)
@@ -223,8 +217,8 @@
 
 Section "Send Usage Stats"
 SectionIn 1 2 3
-  StrCpy $3 "Selected_Language=$(LanguageName)&Version=${MATROSKAPROP_VERSION_MAJOR}.${MATROSKAPROP_VERSION_MINOR}.${MATROSKAPROP_VERSION_BUILD}"
-  WriteRegStr HKLM "Software\MatroskaProp" "Survery" $3
+  StrCpy $3 "SelectedLanguage=$(LanguageName):Version=${MATROSKAPROP_VERSION_MAJOR}.${MATROSKAPROP_VERSION_MINOR}.${MATROSKAPROP_VERSION_BUILD}"  
+  WriteRegStr HKLM "Software\MatroskaProp" "Survey" $3
   RegDLL "$INSTDIR\MatroskaProp.dll" "SubmitSurvey"
   #MatroskaPropSurvey::SubmitSurvey $3
   #Pop $0
@@ -327,11 +321,6 @@
   UnRegDll $INSTDIR\MatroskaProp.dll
   Delete /REBOOTOK $INSTDIR\MatroskaProp.dll
   Delete /REBOOTOK $INSTDIR\gnu_gettext.dll
-  Delete /REBOOTOK $INSTDIR\cximagecrt.dll
-  Delete /REBOOTOK $INSTDIR\id3lib.dll
-  Delete /REBOOTOK $INSTDIR\zlib1.dll
-  Delete /REBOOTOK $INSTDIR\DShowTools.dll
-  Delete /REBOOTOK $INSTDIR\TinyXml.dll
   Delete $INSTDIR\MatroskaProp_ChooseIcon.exe
   Delete $INSTDIR\MatroskaProp_Configure.exe
   Delete $INSTDIR\CheckUsage.exe
@@ -376,5 +365,4 @@
    IfRebootFlag 0 NoReboot
       MessageBox MB_OK "A File Couldn't be deleted. It will be deleted when you reboot next"
    NoReboot:
-FunctionEnd
-
+FunctionEnd
\ No newline at end of file

Added: trunk/MatroskaUtils/appsetup05.ico
===================================================================
(Binary files differ)


Property changes on: trunk/MatroskaUtils/appsetup05.ico
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/MatroskaUtils/build.py
===================================================================
--- trunk/MatroskaUtils/build.py	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/build.py	2005-04-03 07:03:55 UTC (rev 1114)
@@ -6,12 +6,13 @@
 """Custom Build Step Python script for compiling MatroskaProp and MatroskaUtil
 LGPL license - (c) 2004 Jory Stone <[email protected]>
 
-Usage: build.py [-v] [-f file] [-i file] [-r file]
+Usage: build.py [-v] [-f file] [-i file] [-r file] [-m file]
 
  -v         Verbose output
  -h         This usage help
  -f file    Input version resource file to update
  -i file    NSIS installer script to update
+ -m file    The .vdproj installer project to update
  -r file    resource.cpp object file location (deletes it so it will be rebuilt)
  -p file    VC7.1 project file to archive
 """
@@ -37,6 +38,7 @@
     version_build = -1
     version_filename = None
     installer_script_filename = None
+    vdproj_installer_filename = None
     resource_object_file = None
     project_filename = None
     solution_filename = None
@@ -52,7 +54,7 @@
     def __init__(self):        
         print "MatroskaUtil Custom Build Step Python Script"
         try:
-            opts, args = getopt.getopt(sys.argv[1:], "vhaf:i:r:p:s:", ["verbose", "help", "autoincrement", "file=", "installer=", "resouceobj=", "project=", "solution="])
+            opts, args = getopt.getopt(sys.argv[1:], "vhaf:i:r:p:s:m:", ["verbose", "help", "autoincrement", "file=", "installer=", "resouceobj=", "project=", "solution=", "msi="])
         except getopt.GetoptError, msg:
             print msg
             print __doc__,
@@ -65,6 +67,8 @@
                 self.version_filename = a
             elif o in ("-i", "--installer"):
                 self.installer_script_filename = a
+            elif o in ("-m", "--msi"):
+                self.vdproj_installer_filename = a                
             elif o in ("-p", "--project"):
                 self.project_filename = a
             elif o in ("-s", "--solution"):
@@ -319,6 +323,30 @@
         installer_script_file = open(self.installer_script_filename, "w")
         installer_script_file.writelines(installer_script_lines)
 
+    def UpdateMSIInstallerFile(self):
+        if self.vdproj_installer_filename is None:
+            raise ("Error: MSI Installer Script Filename is required.\n" + __doc__)
+
+        print "Updating MSI installer script..."
+        # Update the NSIS installer script
+        installer_script_bak = self.vdproj_installer_filename + ".bak"
+        installer_script_file = open(self.vdproj_installer_filename, "r")
+
+        # Backup the version file before changing it
+        shutil.copyfileobj(installer_script_file, open(installer_script_bak, "w"))
+        installer_script_file.seek(0)
+
+        # Go through the file line-by-line
+        installer_script_lines = installer_script_file.readlines()
+        for installer_script_line_index, installer_script_line in enumerate(installer_script_lines):
+            if (installer_script_line.find("\"ProductVersion\" = ") > -1):
+                installer_script_lines[installer_script_line_index] = "\"ProductVersion\" = \"8:" + str(self.version_major) + "." + str(self.version_minor) + "." + str(self.version_build) + "\" \n"                
+                            
+        # Close and reopen the file for writing
+        installer_script_file.close() 
+        installer_script_file = open(self.vdproj_installer_filename, "w")
+        installer_script_file.writelines(installer_script_lines)
+
         
     def Build(self):
         #self.version_filename = "D:\Visual Studio Projects\matroska\MatroskaUtils\\MatroskaCDL.rc"

Modified: trunk/MatroskaUtils/resource.h
===================================================================
--- trunk/MatroskaUtils/resource.h	2005-03-28 14:49:40 UTC (rev 1113)
+++ trunk/MatroskaUtils/resource.h	2005-04-03 07:03:55 UTC (rev 1114)
@@ -2,6 +2,8 @@
 // Microsoft Visual C++ generated include file.
 // Used by MatroskaCDL.rc
 //
+#define RESOURCE_VERSION_MAJOR 2
+#define RESOURCE_VERSION_MINOR 8
 #define IDD_CFGDIALOG                   101
 #define IDD_TREEDIALOG                  102
 #define IDD_DIALOG1                     104
@@ -41,6 +43,8 @@
 #define IDD_DIALOG_ADD_UID              156
 #define IDD_PROPPAGE_CHAPTER            157
 #define IDR_MP31                        158
+#define IDI_ICON1                       159
+#define IDI_ICON_SETUP                  159
 #define IDC_EDIT_TITLE                  1001
 #define IDC_LIST_TAGS                   1003
 #define IDC_BUTTON_SAVE                 1004
@@ -221,16 +225,14 @@
 #define IDC_BUTTON_ABOUT_LISTEN         1182
 #define IDC_BUTTON_BITRATE_SAVE         1182
 #define IDC_BUTTON_EXPORT_CHAPTERS_XML  1182
+#define RESOURCE_VERSION_BUILD 2219
 #define IDC_MENU_COPY_CLIPBOARD         40001
-#define RESOURCE_VERSION_MAJOR 2
-#define RESOURCE_VERSION_MINOR 7
-#define RESOURCE_VERSION_BUILD 2164
 
 // Next default values for new objects
 // 
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        159
+#define _APS_NEXT_RESOURCE_VALUE        160
 #define _APS_NEXT_COMMAND_VALUE         40002
 #define _APS_NEXT_CONTROL_VALUE         1183
 #define _APS_NEXT_SYMED_VALUE           101
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.