diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0b79c16 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +*.suo +*.user +Debug/* +CommandCam/Debug/* +*.pdb +Photos diff --git a/CommandCam.cpp b/CommandCam.cpp index 929008e..c2461b0 100644 --- a/CommandCam.cpp +++ b/CommandCam.cpp @@ -27,6 +27,9 @@ // DirectShow header file #include +#include +#include +#include // This is a workaround for the missing header // file qedit.h which seems to be absent from the @@ -98,7 +101,7 @@ int main(int argc, char **argv) int device_number = 1; char device_name[100]; char filename[100]; - + // Other variables char char_buffer[100]; @@ -159,6 +162,23 @@ int main(int argc, char **argv) else { strcpy(filename, char_buffer); + + // idegani: add a timestamp in the filename if it contains wildcard {TS} + char *ts = strstr(filename, "{TS}"); + if(ts != 0) { + char temp[100]; + time_t rawtime; + struct tm * timeinfo; + size_t dateLen; + + time (&rawtime); + timeinfo = localtime(&rawtime); + strcpy(temp, ts + strlen("{TS}")); + // TODO: might be nice to have another cmd line arg where format can be specified + dateLen = strftime(ts, 80,"%Y-%m-%d_%H-%M-%S", timeinfo); + strcpy(ts + dateLen, temp); + int i = 4; + } } } else exit_message("Error: no filename specified", 1); diff --git a/CommandCam.exe b/CommandCam.exe index d304a3e..23fce46 100644 Binary files a/CommandCam.exe and b/CommandCam.exe differ diff --git a/CommandCam.sln b/CommandCam.sln new file mode 100644 index 0000000..f8f5c12 --- /dev/null +++ b/CommandCam.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CommandCam", "CommandCam\CommandCam.vcxproj", "{5C02AC0A-FE24-465C-B3A5-155D642F62C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5C02AC0A-FE24-465C-B3A5-155D642F62C5}.Debug|Win32.ActiveCfg = Debug|Win32 + {5C02AC0A-FE24-465C-B3A5-155D642F62C5}.Debug|Win32.Build.0 = Debug|Win32 + {5C02AC0A-FE24-465C-B3A5-155D642F62C5}.Release|Win32.ActiveCfg = Release|Win32 + {5C02AC0A-FE24-465C-B3A5-155D642F62C5}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/CommandCam/ClassDiagram1.cd b/CommandCam/ClassDiagram1.cd new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/CommandCam/ClassDiagram1.cd @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/CommandCam/CommandCam.vcxproj b/CommandCam/CommandCam.vcxproj new file mode 100644 index 0000000..b5244e9 --- /dev/null +++ b/CommandCam/CommandCam.vcxproj @@ -0,0 +1,78 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {5C02AC0A-FE24-465C-B3A5-155D642F62C5} + CommandCam + + + + Application + true + MultiByte + + + Application + false + true + MultiByte + + + + + + + + + + + + + $(SolutionDir)\ + + + $(SolutionDir)\ + + + + Level3 + Disabled + + + true + ole32.lib;strmiids.lib;oleaut32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + MaxSpeed + true + true + + + true + true + true + ole32.lib;strmiids.lib;oleaut32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + + + + + + \ No newline at end of file diff --git a/CommandCam/CommandCam.vcxproj.filters b/CommandCam/CommandCam.vcxproj.filters new file mode 100644 index 0000000..45e9ee1 --- /dev/null +++ b/CommandCam/CommandCam.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + + + + \ No newline at end of file