├── .gitignore ├── .tfignore ├── .travis.yml ├── Images └── OpenRecorder.png ├── LICENSE.txt ├── README.md ├── ScreenRecorder.sln ├── ScreenRecorder ├── About │ ├── AboutBox.Designer.cs │ ├── AboutBox.cs │ ├── AboutBox.resx │ └── FfMpeg.txt ├── App.config ├── Codecs │ ├── Avi │ │ ├── Avi.cs │ │ └── AviManager.cs │ ├── Gif │ │ ├── AnimatedGifEncoder.cs │ │ ├── GifDecoder.cs │ │ ├── GifFormat.txt │ │ ├── LZWEncoder.cs │ │ └── NeuQuant.cs │ └── ffmpeg │ │ ├── GNULicense.txt │ │ ├── avcodec-55.dll │ │ ├── avdevice-55.dll │ │ ├── avfilter-4.dll │ │ ├── avformat-55.dll │ │ ├── avutil-52.dll │ │ ├── ffmpeg.exe │ │ ├── ffplay.exe │ │ ├── ffprobe.exe │ │ ├── postproc-52.dll │ │ ├── swresample-0.dll │ │ └── swscale-2.dll ├── ContentPages │ ├── AppSettings.Designer.cs │ ├── AppSettings.cs │ ├── AppSettings.resx │ ├── IContentPage.cs │ ├── InformationCP.Designer.cs │ ├── InformationCP.cs │ ├── InformationCP.resx │ ├── Settings.Designer.cs │ ├── Settings.cs │ └── Settings.resx ├── Extern │ └── log4net.dll ├── Hooks │ ├── GlobalKeyboardHook.cs │ ├── HookData.cs │ ├── HookParser.cs │ └── ffmpeg.hook ├── MessageBox.Designer.cs ├── MessageBox.cs ├── MessageBox.resx ├── NotificationForm.Designer.cs ├── NotificationForm.cs ├── NotificationForm.resx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.es.Designer.cs │ ├── Resources.es.resx │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── AVRecorder.ico │ ├── AVRecorder.png │ ├── Bug.png │ ├── Bug_256.png │ ├── Bug_32.png │ ├── Close.png │ ├── Comment.png │ ├── EditPencil.png │ ├── Email.png │ ├── FfMpegLogo.png │ ├── Help.png │ ├── Information.png │ ├── LeftSide.png │ ├── Like.png │ ├── MaximizeMinus.png │ ├── MaximizePlus.png │ ├── Minimize.png │ ├── Pause.png │ ├── Record.png │ ├── Reset.png │ ├── RightSide.png │ ├── Search.png │ ├── Settings.png │ ├── Settings_Edit.png │ ├── Stop.png │ ├── Warning.png │ └── Warning_32x.png ├── ScreenRecorder.Designer.cs ├── ScreenRecorder.cs ├── ScreenRecorder.csproj ├── ScreenRecorder.resx ├── VariablesParser.cs └── Win32Api.cs ├── UML Modelling ├── ComponentView.uxf ├── DeploymentView.uxf └── UseCases.uxf └── WPF ├── CAM.Bootscreen ├── BootSplasher.cs ├── Bootscreen.xaml ├── Bootscreen.xaml.cs ├── BootscreenModule.cs ├── BootscreenViewModel.cs ├── CAM.Bootscreen.csproj └── Properties │ └── AssemblyInfo.cs ├── CAM.Common ├── AppExitEvent.cs ├── CAM.Common.csproj ├── ColorPalatte.cs ├── EncoderInfo.cs ├── Properties │ └── AssemblyInfo.cs ├── RelayCommand.cs ├── Resources │ ├── Bug.png │ ├── Comment.png │ ├── EditPencil.png │ ├── Email.png │ ├── FfMpegLogo.png │ ├── Help.png │ ├── Information.png │ ├── LeftSide.png │ ├── Like.png │ ├── MaximizeMinus.png │ ├── MaximizePlus.png │ ├── Minimize.png │ ├── RightSide.png │ ├── Search.png │ ├── Settings_Edit.png │ └── Warning.png ├── ViewModelBase.cs └── packages.config ├── CAM.Configuration ├── CAM.Configuration.csproj ├── Configuration.cs ├── ConfigurationModule.cs ├── Hook │ ├── HookConfigurationSection.csd │ ├── HookConfigurationSection.csd.config │ ├── HookConfigurationSection.csd.cs │ ├── HookConfigurationSection.csd.diagram │ └── HookConfigurationSection.csd.xsd ├── Hooks.config ├── IConfiguration.cs ├── Properties │ └── AssemblyInfo.cs ├── VariablesParser.cs ├── VideoSettings.cs └── packages.config ├── CAM.Setup ├── CAM.Setup.isl └── CAM.Setup.isproj ├── CAM.Starter ├── App.config ├── App.xaml ├── App.xaml.cs ├── Bootstrapper.cs ├── CAM.Starter.csproj ├── Extern │ └── procdump.exe ├── Logger │ └── Log4NetLogger.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── AVRecorder.ico │ └── AVRecorder.png ├── ViewModel │ └── UIContainerViewModel.cs ├── Views │ ├── ExceptionViewer.xaml.cs │ ├── UIContainerView.xaml │ └── UIContainerView.xaml.cs └── packages.config ├── CAM.Tools ├── BasicToolsModule.cs ├── CAM.Tools.csproj ├── Helper │ ├── VisualTargetPresentationSource.cs │ ├── VisualThreadedHelper.cs │ └── VisualWrapper.cs ├── Model │ └── ToolsModel.cs ├── Properties │ └── AssemblyInfo.cs ├── Resources │ ├── Close.png │ ├── Pause.png │ ├── Pin.png │ ├── Record.png │ ├── Reset.png │ ├── Settings.png │ └── Stop.png ├── ViewModel │ └── ToolsViewModel.cs ├── Views │ ├── SettingsView.xaml │ ├── SettingsView.xaml.cs │ ├── ToolsView.xaml │ ├── ToolsView.xaml.cs │ ├── TransparentView.xaml │ └── TransparentView.xaml.cs ├── Win32 │ ├── Gdi32.cs │ └── User32.cs └── packages.config ├── CAM.VideoCodec.FFMPEG ├── CAM.VideoCodec.FFMPEG.csproj ├── Extern │ ├── GNULicense.txt │ ├── avcodec-55.dll │ ├── avdevice-55.dll │ ├── avfilter-4.dll │ ├── avformat-55.dll │ ├── avutil-52.dll │ ├── ffmpeg.exe │ ├── ffplay.exe │ ├── ffprobe.exe │ ├── postproc-52.dll │ ├── swresample-0.dll │ └── swscale-2.dll ├── FFMpegEncoder.cs ├── FFMpegModule.cs ├── Properties │ └── AssemblyInfo.cs └── packages.config └── CAM.VideoCodec.Interfaces ├── CAM.VideoCodec.Interfaces.csproj ├── IFFMpegEncoder.cs └── Properties └── AssemblyInfo.cs /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | *.obj 3 | ScreenRecorder.exe 4 | *.pdb 5 | *.user 6 | *.aps 7 | *.pch 8 | *.vspscc 9 | *_i.c 10 | *_p.c 11 | *.ncb 12 | *.suo 13 | *.sln.docstates 14 | *.tlb 15 | *.tlh 16 | *.bak 17 | *.cache 18 | *.ilk 19 | *.log 20 | [Bb]in 21 | [Dd]ebug*/ 22 | *.lib 23 | *.sbr 24 | obj/ 25 | [Rr]elease*/ 26 | _ReSharper*/ 27 | [Tt]est[Rr]esult* 28 | *.vssscc 29 | $tf*/ -------------------------------------------------------------------------------- /.tfignore: -------------------------------------------------------------------------------- 1 | \.git -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: csharp 2 | 3 | solution: ScreenRecorder.sln 4 | 5 | script: 6 | - xbuild /p:Configuration=Debug /p:Platform=x64 ScreenRecorder.sln 7 | -------------------------------------------------------------------------------- /Images/OpenRecorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/Images/OpenRecorder.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ScreenRecorder 2 | ============== 3 | 4 | Screen capture in C# 5 | 6 | ![alt tag](https://github.com/Sunhick/ScreenRecorder/blob/master/Images/OpenRecorder.png) 7 | -------------------------------------------------------------------------------- /ScreenRecorder/About/AboutBox.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.IO; 18 | using System.Reflection; 19 | using System.Windows.Forms; 20 | 21 | namespace ScreenRecorder.ContentPages 22 | { 23 | partial class AboutBox : Form 24 | { 25 | public AboutBox() 26 | { 27 | InitializeComponent(); 28 | Text = String.Format("About {0}", AssemblyTitle); 29 | labelProductName.Text = AssemblyProduct; 30 | labelVersion.Text = String.Format("Version {0}", AssemblyVersion); 31 | labelCopyright.Text = AssemblyCopyright; 32 | labelCompanyName.Text = AssemblyCompany; 33 | textBoxDescription.Text = AssemblyDescription; 34 | } 35 | 36 | #region Assembly Attribute Accessors 37 | 38 | public string AssemblyTitle 39 | { 40 | get 41 | { 42 | var attributes = 43 | Assembly.GetExecutingAssembly().GetCustomAttributes(typeof (AssemblyTitleAttribute), false); 44 | if (attributes.Length > 0) 45 | { 46 | var titleAttribute = (AssemblyTitleAttribute) attributes[0]; 47 | if (titleAttribute.Title != "") 48 | { 49 | return titleAttribute.Title; 50 | } 51 | } 52 | return Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); 53 | } 54 | } 55 | 56 | public string AssemblyVersion 57 | { 58 | get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); } 59 | } 60 | 61 | public string AssemblyDescription 62 | { 63 | get 64 | { 65 | var attributes = 66 | Assembly.GetExecutingAssembly().GetCustomAttributes(typeof (AssemblyDescriptionAttribute), false); 67 | if (attributes.Length == 0) 68 | { 69 | return ""; 70 | } 71 | return ((AssemblyDescriptionAttribute) attributes[0]).Description; 72 | } 73 | } 74 | 75 | public string AssemblyProduct 76 | { 77 | get 78 | { 79 | var attributes = 80 | Assembly.GetExecutingAssembly().GetCustomAttributes(typeof (AssemblyProductAttribute), false); 81 | if (attributes.Length == 0) 82 | { 83 | return ""; 84 | } 85 | return ((AssemblyProductAttribute) attributes[0]).Product; 86 | } 87 | } 88 | 89 | public string AssemblyCopyright 90 | { 91 | get 92 | { 93 | var attributes = 94 | Assembly.GetExecutingAssembly().GetCustomAttributes(typeof (AssemblyCopyrightAttribute), false); 95 | if (attributes.Length == 0) 96 | { 97 | return ""; 98 | } 99 | return ((AssemblyCopyrightAttribute) attributes[0]).Copyright; 100 | } 101 | } 102 | 103 | public string AssemblyCompany 104 | { 105 | get 106 | { 107 | var attributes = 108 | Assembly.GetExecutingAssembly().GetCustomAttributes(typeof (AssemblyCompanyAttribute), false); 109 | if (attributes.Length == 0) 110 | { 111 | return ""; 112 | } 113 | return ((AssemblyCompanyAttribute) attributes[0]).Company; 114 | } 115 | } 116 | 117 | #endregion 118 | 119 | private void okButton_Click(object sender, EventArgs e) 120 | { 121 | Close(); 122 | } 123 | } 124 | } -------------------------------------------------------------------------------- /ScreenRecorder/About/FfMpeg.txt: -------------------------------------------------------------------------------- 1 | FFmpeg is a free software project that produces libraries and programs for handling multimedia data. 2 | FFmpeg includes libavcodec, an audio/video codec library used by several other projects, libavformat, 3 | an audio/video container mux and demux library, and the ffmpeg command line program for transcoding 4 | multimedia files. 5 | 6 | 7 | FFmpeg is published under the GNU Lesser General Public License 2.1+ or 8 | GNU General Public License 2+ (depending on which options are enabled). 9 | 10 | 11 | Legal status of codecs 12 | __________________________________________________________________________________________________ 13 | 14 | FFmpeg contains more than 100 codecs, most of which do not just store uncompressed data. Most codecs 15 | that compress information could be claimed by patent holders. Such claims may be enforceable in 16 | countries like the United States which have implemented software patents, but are considered 17 | unenforceable or void in countries that have not implemented software patents. Furthermore, 18 | many of these codecs are only released under terms that forbid reverse engineering, even for 19 | purposes of interoperability. These terms of use are forbidden in certain countries. 20 | 21 | For example, some European Union nations have not implemented software patents and have laws expressly 22 | allowing reverse engineering for purposes of interoperability. 23 | -------------------------------------------------------------------------------- /ScreenRecorder/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 2 36 | 37 | 38 | 0.9 39 | 40 | 41 | D:\temp\samples_code\ScreenRecorder_v2.0\ScreenRecorder\bin\x64\Debug\Bitmaps 42 | 43 | 44 | en 45 | 46 | 47 | 48 | 49 | 50 | mp4 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/Avi/AviManager.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | namespace ScreenRecorder.Codecs 17 | { 18 | /// 19 | /// TODO: Update summary. 20 | /// 21 | public class AviManager 22 | { 23 | } // class AviManager 24 | } // namespace ScreenRecorder.Codecs.Avi -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/Gif/GifFormat.txt: -------------------------------------------------------------------------------- 1 | GIF format 2 | Byte Order: Little-endian 3 | 4 | GIF Header 5 | Offset Length Contents 6 | 0 3 bytes "GIF" 7 | 3 3 bytes "87a" or "89a" 8 | 6 2 bytes 9 | 8 2 bytes 10 | 10 1 byte bit 0: Global Color Table Flag (GCTF) 11 | bit 1..3: Color Resolution 12 | bit 4: Sort Flag to Global Color Table 13 | bit 5..7: Size of Global Color Table: 2^(1+n) 14 | 11 1 byte 15 | 12 1 byte 16 | 13 ? bytes 17 | ? bytes 18 | 1 bytes (0x3b) 19 | 20 | 21 | Image Block 22 | Offset Length Contents 23 | 0 1 byte Image Separator (0x2c) 24 | 1 2 bytes Image Left Position 25 | 3 2 bytes Image Top Position 26 | 5 2 bytes Image Width 27 | 7 2 bytes Image Height 28 | 8 1 byte bit 0: Local Color Table Flag (LCTF) 29 | bit 1: Interlace Flag 30 | bit 2: Sort Flag 31 | bit 2..3: Reserved 32 | bit 4..7: Size of Local Color Table: 2^(1+n) 33 | ? bytes Local Color Table(0..255 x 3 bytes) if LCTF is one 34 | 1 byte LZW Minimum Code Size 35 | [ // Blocks 36 | 1 byte Block Size (s) 37 | (s)bytes Image Data 38 | ]* 39 | 1 byte Block Terminator(0x00) 40 | 41 | 42 | Graphic Control Extension Block 43 | Offset Length Contents 44 | 0 1 byte Extension Introducer (0x21) 45 | 1 1 byte Graphic Control Label (0xf9) 46 | 2 1 byte Block Size (0x04) 47 | 3 1 byte bit 0..2: Reserved 48 | bit 3..5: Disposal Method 49 | bit 6: User Input Flag 50 | bit 7: Transparent Color Flag 51 | 4 2 bytes Delay Time (1/100ths of a second) 52 | 6 1 byte Transparent Color Index 53 | 7 1 byte Block Terminator(0x00) 54 | 55 | 56 | Comment Extension Block 57 | Offset Length Contents 58 | 0 1 byte Extension Introducer (0x21) 59 | 1 1 byte Comment Label (0xfe) 60 | [ 61 | 1 byte Block Size (s) 62 | (s)bytes Comment Data 63 | ]* 64 | 1 byte Block Terminator(0x00) 65 | 66 | 67 | Plain Text Extension Block 68 | Offset Length Contents 69 | 0 1 byte Extension Introducer (0x21) 70 | 1 1 byte Plain Text Label (0x01) 71 | 2 1 byte Block Size (0x0c) 72 | 3 2 bytes Text Grid Left Position 73 | 5 2 bytes Text Grid Top Position 74 | 7 2 bytes Text Grid Width 75 | 9 2 bytes Text Grid Height 76 | 10 1 byte Character Cell Width( 77 | 11 1 byte Character Cell Height 78 | 12 1 byte Text Foreground Color Index( 79 | 13 1 byte Text Background Color Index( 80 | [ 81 | 1 byte Block Size (s) 82 | (s)bytes Plain Text Data 83 | ]* 84 | 1 byte Block Terminator(0x00) 85 | 86 | 87 | Application Extension Block 88 | Offset Length Contents 89 | 0 1 byte Extension Introducer (0x21) 90 | 1 1 byte Application Label (0xff) 91 | 2 1 byte Block Size (0x0b) 92 | 3 8 bytes Application Identifire 93 | [ 94 | 1 byte Block Size (s) 95 | (s)bytes Application Data 96 | ]* 97 | 1 byte Block Terminator(0x00) 98 | 99 | 100 | GIF87a: 101 | 102 | GIF Header 103 | Image Block 104 | Trailer 105 | 106 | 107 | GIF89a: 108 | 109 | GIF Header 110 | Graphic Control Extension 111 | Image Block 112 | Trailer 113 | 114 | 115 | GIF Animation 116 | 117 | GIF Header 118 | Application Extension 119 | [ 120 | Graphic Control Extension 121 | Image Block 122 | ]* 123 | Trailer 124 | 125 | -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/ffmpeg/avcodec-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Codecs/ffmpeg/avcodec-55.dll -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/ffmpeg/avdevice-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Codecs/ffmpeg/avdevice-55.dll -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/ffmpeg/avfilter-4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Codecs/ffmpeg/avfilter-4.dll -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/ffmpeg/avformat-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Codecs/ffmpeg/avformat-55.dll -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/ffmpeg/avutil-52.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Codecs/ffmpeg/avutil-52.dll -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/ffmpeg/ffmpeg.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Codecs/ffmpeg/ffmpeg.exe -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/ffmpeg/ffplay.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Codecs/ffmpeg/ffplay.exe -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/ffmpeg/ffprobe.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Codecs/ffmpeg/ffprobe.exe -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/ffmpeg/postproc-52.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Codecs/ffmpeg/postproc-52.dll -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/ffmpeg/swresample-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Codecs/ffmpeg/swresample-0.dll -------------------------------------------------------------------------------- /ScreenRecorder/Codecs/ffmpeg/swscale-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Codecs/ffmpeg/swscale-2.dll -------------------------------------------------------------------------------- /ScreenRecorder/ContentPages/AppSettings.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | #region Using directives 17 | 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Windows.Forms; 21 | using ScreenRecorder.Hooks; 22 | using ScreenRecorder.Properties; 23 | 24 | #endregion 25 | 26 | namespace ScreenRecorder.ContentPages 27 | { 28 | /// 29 | /// App settings 30 | /// 31 | public partial class AppSettings : UserControl, IContentPage 32 | { 33 | /// 34 | /// Initializes a new instance of the AppSettings class. 35 | /// 36 | public AppSettings() 37 | { 38 | InitializeComponent(); 39 | OpacityBar.Maximum = 10; 40 | OpacityBar.Minimum = 1; 41 | OpacityBar.Value = 9; 42 | 43 | ReadUserSettings(); 44 | } 45 | 46 | /// 47 | /// Read config 48 | /// 49 | private void ReadUserSettings() 50 | { 51 | numericUpDown1.Value = Settings.Default.FramesPerSec; 52 | saveLocBox.Text = Settings.Default.BitmapTempLoc; 53 | langComboBox.SelectedItem = (string) Settings.Default.Language; 54 | voutLocBox.Text = Settings.Default.VideoLoc; 55 | videoTypeBox.Text = Settings.Default.VideoType; 56 | 57 | var parser = new HookParser(); 58 | var data = parser.Parse(); 59 | 60 | foreach (var item in data) 61 | { 62 | videoTypeBox.Items.Add(item.HookId); 63 | } 64 | } 65 | 66 | /// 67 | /// Opacity scroll 68 | /// 69 | /// Sender of the event 70 | /// Event arguments 71 | private void Opacity_Scroll(object sender, EventArgs e) 72 | { 73 | var v = OpacityBar.Value; 74 | } 75 | 76 | /// 77 | /// Save click 78 | /// 79 | /// Sender of the event 80 | /// Event arguments 81 | private void save_Click(object sender, EventArgs e) 82 | { 83 | Settings.Default.FramesPerSec = (int) numericUpDown1.Value; 84 | Settings.Default.BitmapTempLoc = saveLocBox.Text; 85 | Settings.Default.Language = langComboBox.SelectedItem as string; 86 | Settings.Default.VideoLoc = voutLocBox.Text; 87 | Settings.Default.VideoType = videoTypeBox.SelectedItem as string; 88 | 89 | //save all the user settings. 90 | Settings.Default.Save(); 91 | 92 | //MessageBox.Show("Application must be restarted inorder to apply the changes", "Restart", 93 | // MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, 94 | // MessageBoxOptions.ServiceNotification); 95 | if (MessageBox.Show("Application must be restarted inorder to apply the changes", "Restart", "Cancel") == 96 | YesNo.Yes) 97 | { 98 | Application.Restart(); 99 | } 100 | //Settings.Default.Opacity = (decimal)OpacityBar.Value/10; 101 | } 102 | 103 | /// 104 | /// About us 105 | /// 106 | /// 107 | /// 108 | private void aboutusBtn_Click(object sender, EventArgs e) 109 | { 110 | var aboutUs = new AboutBox(); 111 | aboutUs.ShowDialog(); 112 | } 113 | } // class AppSettings 114 | } // namespace ScreenRecorder -------------------------------------------------------------------------------- /ScreenRecorder/ContentPages/IContentPage.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | namespace ScreenRecorder.ContentPages 17 | { 18 | /// 19 | /// TODO: Update summary. 20 | /// 21 | public interface IContentPage 22 | { 23 | } 24 | } // namespace ScreenRecorder.ContentPages -------------------------------------------------------------------------------- /ScreenRecorder/ContentPages/InformationCP.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.IO; 18 | using System.Windows.Forms; 19 | 20 | namespace ScreenRecorder.ContentPages 21 | { 22 | /// 23 | /// Information CP 24 | /// 25 | public partial class InformationCP : UserControl, IContentPage 26 | { 27 | /// 28 | /// Constructor CP 29 | /// 30 | public InformationCP() 31 | { 32 | InitializeComponent(); 33 | 34 | //load the file contents 35 | aboutffmpegBox.LoadFile( 36 | Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "About\\FfMpeg.txt"), 37 | RichTextBoxStreamType.PlainText 38 | ); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /ScreenRecorder/ContentPages/Settings.cs: -------------------------------------------------------------------------------- 1 | #region File Header 2 | /*[ Compilation unit ---------------------------------------------------------- 3 | 4 | Component : ScreenRecorderMP 5 | 6 | Name : Settings.cs 7 | 8 | Author : Sunil 9 | 10 | -----------------------------------------------------------------------------*/ 11 | /*] END */ 12 | #endregion 13 | 14 | #region Using directives 15 | using ScreenRecorder.ContentPages; 16 | using ScreenRecorder.Properties; 17 | using System; 18 | using System.Windows.Forms; 19 | using System.Collections.Generic; 20 | #endregion 21 | 22 | namespace ScreenRecorder 23 | { 24 | /// 25 | /// App settings 26 | /// 27 | public partial class AppSettings : UserControl, IContentPage 28 | { 29 | /// 30 | /// Initializes a new instance of the AppSettings class. 31 | /// 32 | public AppSettings() 33 | { 34 | InitializeComponent(); 35 | OpacityBar.Maximum = 10; 36 | OpacityBar.Minimum = 1; 37 | OpacityBar.Value = 9; 38 | ReadUserSettings(); 39 | } 40 | 41 | /// 42 | /// Read config 43 | /// 44 | private void ReadUserSettings() 45 | { 46 | numericUpDown1.Value = Settings.Default.FramesPerSec; 47 | saveLocBox.Text = Settings.Default.BitmapTempLoc; 48 | langComboBox.SelectedItem = (string)Settings.Default.Language; 49 | HookParser parser = new HookParser(); 50 | List data = parser.Parse(); 51 | 52 | foreach (HookData item in data) 53 | { 54 | videoTypeBox.Items.Add(item.HookID); 55 | } 56 | } 57 | 58 | /// 59 | /// Opacity scroll 60 | /// 61 | /// Sender of the event 62 | /// Event arguments 63 | private void Opacity_Scroll(object sender, EventArgs e) 64 | { 65 | 66 | } 67 | 68 | /// 69 | /// Save click 70 | /// 71 | /// Sender of the event 72 | /// Event arguments 73 | private void save_Click(object sender, EventArgs e) 74 | { 75 | Settings.Default.FramesPerSec = (int)numericUpDown1.Value; 76 | Settings.Default.BitmapTempLoc = saveLocBox.Text; 77 | Settings.Default.Language = langComboBox.SelectedItem as string; 78 | Settings.Default.VideoLoc = voutLocBox.Text; 79 | Settings.Default.VideoType = videoTypeBox.SelectedItem as string; 80 | 81 | //save all the user settings. 82 | Settings.Default.Save(); 83 | 84 | //MessageBox.Show("Application must be restarted inorder to apply the changes", "Restart", 85 | // MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, 86 | // MessageBoxOptions.ServiceNotification); 87 | if (MessageBox.Show("Application must be restarted inorder to apply the changes", "Restart", "Cancel") == YesNo.Yes) 88 | { 89 | Application.Restart(); 90 | } 91 | //Settings.Default.Opacity = (decimal)OpacityBar.Value/10; 92 | } 93 | 94 | /// 95 | /// About us 96 | /// 97 | /// 98 | /// 99 | private void aboutusBtn_Click(object sender, EventArgs e) 100 | { 101 | AboutBox aboutUs = new AboutBox(); 102 | aboutUs.ShowDialog(); 103 | } 104 | } // class AppSettings 105 | } // namespace ScreenRecorder 106 | -------------------------------------------------------------------------------- /ScreenRecorder/Extern/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Extern/log4net.dll -------------------------------------------------------------------------------- /ScreenRecorder/Hooks/GlobalKeyboardHook.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Collections.Generic; 18 | using System.ComponentModel; 19 | using System.Runtime.InteropServices; 20 | using System.Windows.Forms; 21 | using log4net; 22 | 23 | namespace ScreenRecorder.Hooks 24 | { 25 | public class GlobalKeyboardHook 26 | { 27 | private static readonly ILog log = LogManager.GetLogger(typeof (GlobalKeyboardHook).Name); 28 | 29 | private static HookProc keyboardProcHook; 30 | public List HookedKeys = new List(); 31 | private IntPtr keyboardHook = IntPtr.Zero; 32 | 33 | /// 34 | /// ctor 35 | /// 36 | public GlobalKeyboardHook() 37 | { 38 | Hook(); 39 | } 40 | 41 | public event KeyEventHandler KeyDown; 42 | public event KeyEventHandler KeyUp; 43 | 44 | /// 45 | /// Keyboard hook proc 46 | /// 47 | /// 48 | /// 49 | /// 50 | /// 51 | private int KeyboardHookProc(int nCode, int wParam, keyboardHookStruct lParam) 52 | { 53 | if (nCode >= 0) 54 | { 55 | var key = (Keys) lParam.vkCode; 56 | if (HookedKeys.Contains(key)) 57 | { 58 | var kArgs = new KeyEventArgs(key); 59 | if ((wParam == Win32Api.WM_KEYDOWN || wParam == Win32Api.WM_SYSKEYDOWN) && (KeyDown != null)) 60 | { 61 | KeyDown(this, kArgs); 62 | } 63 | else if ((wParam == Win32Api.WM_KEYUP || wParam == Win32Api.WM_SYSKEYUP) && (KeyUp != null)) 64 | { 65 | KeyUp(this, kArgs); 66 | } 67 | if (kArgs.Handled) 68 | return 1; 69 | } 70 | } 71 | return Win32Api.CallNextHookEx(keyboardHook, nCode, wParam, ref lParam); 72 | } 73 | 74 | /// 75 | /// subscribe for Keyboard hook 76 | /// 77 | public void Hook() 78 | { 79 | // Create an instance of HookProc. 80 | keyboardProcHook = new HookProc(KeyboardHookProc); 81 | 82 | var hInstance = Win32Api.LoadLibrary("User32"); 83 | 84 | //install hook 85 | keyboardHook = Win32Api.SetWindowsHookEx( 86 | Win32Api.WH_KEYBOARD_LL, 87 | keyboardProcHook, 88 | hInstance, 89 | 0); 90 | 91 | //If SetWindowsHookEx fails. 92 | if (keyboardHook == IntPtr.Zero) 93 | { 94 | //Returns the error code returned by the last unmanaged function called using platform invoke that has the DllImportAttribute.SetLastError flag set. 95 | var errorCode = Marshal.GetLastWin32Error(); 96 | 97 | log.Error("Unable to install keyboard hook.", new Win32Exception(errorCode)); 98 | } 99 | } 100 | 101 | /// 102 | /// Unsubscribe for keyboard hook 103 | /// 104 | public void Unhook() 105 | { 106 | if (keyboardHook != IntPtr.Zero) 107 | { 108 | //uninstall hook 109 | var retKeyboard = Win32Api.UnhookWindowsHookEx(keyboardHook); 110 | //reset invalid handle 111 | keyboardHook = IntPtr.Zero; 112 | //if failed and exception must be thrown 113 | if (retKeyboard == 0) 114 | { 115 | //Returns the error code returned by the last unmanaged function called using platform invoke that has the DllImportAttribute.SetLastError flag set. 116 | var errorCode = Marshal.GetLastWin32Error(); 117 | //Initializes and throws a new instance of the Win32Exception class with the specified error. 118 | log.Error("Error while uninstalling keyboard hook", new Win32Exception(errorCode)); 119 | } 120 | } 121 | } 122 | } 123 | } -------------------------------------------------------------------------------- /ScreenRecorder/Hooks/HookData.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | #region Using directives 17 | 18 | using System; 19 | using System.Diagnostics; 20 | using System.IO; 21 | using ScreenRecorder.Properties; 22 | 23 | #endregion 24 | 25 | namespace ScreenRecorder.Hooks 26 | { 27 | /// 28 | /// Hook Data 29 | /// 30 | public class HookData 31 | { 32 | /// 33 | /// Arguments 34 | /// 35 | public string Arguments; 36 | 37 | /// 38 | /// Executable 39 | /// 40 | public string Executable; 41 | 42 | /// 43 | /// Hook ID 44 | /// 45 | public string HookId; 46 | 47 | /// 48 | /// Mode 49 | /// 50 | public string Mode; 51 | 52 | /// 53 | /// Path 54 | /// 55 | public string WorkingDir; 56 | 57 | /// 58 | /// Execute 59 | /// 60 | public void Execute() 61 | { 62 | var avMaker = new Process(); //Audio-Video maker process 63 | 64 | avMaker.StartInfo.FileName = Path.Combine(WorkingDir, Executable); 65 | 66 | //TODO: ask If output.mp4 need to be overwritten? 67 | 68 | #if DEBUG 69 | avMaker.StartInfo.UseShellExecute = false; 70 | avMaker.StartInfo.CreateNoWindow = false; 71 | #else 72 | avMaker.StartInfo.UseShellExecute = false; 73 | avMaker.StartInfo.CreateNoWindow = true; 74 | #endif 75 | 76 | var outFile = GetOutputFile(); 77 | 78 | //avMaker.StartInfo.Arguments = String.Format(@"-i bitmaps\{0} -vcodec huffyuv output.avi", pngLoc); 79 | //avMaker.StartInfo.Arguments = String.Format(@"-i bitmaps\{0} -r 20 output.mp4", pngLoc); 80 | 81 | avMaker.StartInfo.Arguments = VariablesParser.ExpandVariables(Arguments); 82 | // String.Format(@"-i {0} -r {2} -c:v libx264 -preset slow -crf 21 {1}", ifile, outFile, Settings.Default.FramesPerSec); 83 | // avMaker.StartInfo.Arguments = String.Format(@" -r 20 -i bitmaps\{0} -c:v libx264 -r 20 -pix_fmt yuv420p output.mp4", pngLoc); 84 | 85 | if (!avMaker.Start()) 86 | { 87 | Console.WriteLine(Resources.AVError); 88 | return; 89 | } 90 | 91 | //output 92 | // log.Info(avMaker.StandardOutput.ReadToEnd()); 93 | //errors 94 | //log.Error(avMaker.StandardError.ReadToEnd()); 95 | 96 | avMaker.WaitForExit(); 97 | avMaker.Close(); 98 | } 99 | 100 | /// 101 | /// Get output file 102 | /// 103 | private string GetOutputFile() 104 | { 105 | var file = Path.Combine( 106 | Settings.Default.VideoLoc, "ScreenCapture" 107 | ); 108 | 109 | if (File.Exists(file)) 110 | { 111 | //create unique name 112 | var index = 1; 113 | while (true) 114 | { 115 | file = Path.Combine( 116 | Settings.Default.VideoLoc, string.Format("ScreenCapture({0})", index) 117 | ); 118 | 119 | if (!File.Exists(file)) break; 120 | index++; 121 | } 122 | } 123 | 124 | if (string.IsNullOrEmpty(Path.GetExtension(file))) 125 | { 126 | file = Path.ChangeExtension(file, Settings.Default.VideoType.ToString()); 127 | } 128 | 129 | VariablesParser.PushVariable("VIDEO_LOCATION", file); 130 | 131 | return file; 132 | } 133 | } // class HookData 134 | } // namespace ScreenRecorder -------------------------------------------------------------------------------- /ScreenRecorder/Hooks/HookParser.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | #region Using directives 17 | 18 | using System; 19 | using System.Collections.Generic; 20 | using System.IO; 21 | using System.Linq; 22 | using System.Xml.Linq; 23 | 24 | #endregion 25 | 26 | namespace ScreenRecorder.Hooks 27 | { 28 | /// 29 | /// Parses all the hook files 30 | /// 31 | public class HookParser 32 | { 33 | private const string hookLocation = @"Hooks\"; 34 | 35 | /// 36 | /// Parse 37 | /// 38 | /// 39 | public List Parse() 40 | { 41 | //get all hook files with extension *.hook 42 | var files = Directory.GetFiles( 43 | Path.Combine(AppDomain.CurrentDomain.BaseDirectory, hookLocation), "*.hook" 44 | ); 45 | 46 | var data = new List(); 47 | 48 | foreach (var hookFile in files) 49 | { 50 | var doc = XDocument.Load(hookFile); 51 | var query = from d in doc.Root.Descendants("Command") select d; 52 | 53 | foreach (var q in query) 54 | { 55 | var hook = new HookData(); 56 | 57 | var exe = q.Element("Executable").Value; 58 | var path = q.Element("Path").Value; 59 | var arg = q.Element("Arguments").Value; 60 | var hookid = q.FirstAttribute.Value; 61 | var mode = q.LastAttribute.Value; 62 | 63 | hook.HookId = hookid; 64 | hook.WorkingDir = path; 65 | hook.Executable = exe; 66 | hook.Arguments = arg; 67 | hook.Mode = mode; 68 | 69 | data.Add(hook); 70 | } 71 | } 72 | 73 | return data; 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /ScreenRecorder/Hooks/ffmpeg.hook: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ffmpeg.exe 7 | Codecs\ffmpeg\ 8 | 10 | 14 | -sn -i $BITMAPS$\img%d.png -r $FPS$ -c:v libx264 -preset slow -crf 21 $VIDEO_LOCATION$ 15 | 16 | 17 | 18 | 19 | ffmpeg.exe 20 | Codecs\ffmpeg\ 21 | -i $BITMAPS$\img%d.png -s 1024x768 -c:v mjpeg -qscale:v 0 $VIDEO_LOCATION$ 22 | 23 | 24 | 25 | ffmpeg.exe 26 | Codecs\ffmpeg\ 27 | 28 | 29 | 30 | 31 | ffmpeg.exe 32 | Codecs\ffmpeg\ 33 | 34 | 35 | 36 | 37 | ffmpeg.exe 38 | Codecs\ffmpeg\ 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ScreenRecorder/MessageBox.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ScreenRecorder 2 | { 3 | partial class MessageBox 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.yesBtn = new System.Windows.Forms.Button(); 32 | this.noBtn = new System.Windows.Forms.Button(); 33 | this.userTextBox = new System.Windows.Forms.TextBox(); 34 | this.SuspendLayout(); 35 | // 36 | // yesBtn 37 | // 38 | this.yesBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 39 | this.yesBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 40 | this.yesBtn.Location = new System.Drawing.Point(154, 93); 41 | this.yesBtn.Name = "yesBtn"; 42 | this.yesBtn.Size = new System.Drawing.Size(75, 23); 43 | this.yesBtn.TabIndex = 0; 44 | this.yesBtn.Text = "Yes"; 45 | this.yesBtn.UseVisualStyleBackColor = true; 46 | this.yesBtn.Click += new System.EventHandler(this.restartBtn_Click); 47 | // 48 | // noBtn 49 | // 50 | this.noBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 51 | this.noBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 52 | this.noBtn.Location = new System.Drawing.Point(238, 93); 53 | this.noBtn.Name = "noBtn"; 54 | this.noBtn.Size = new System.Drawing.Size(75, 23); 55 | this.noBtn.TabIndex = 1; 56 | this.noBtn.Text = "No"; 57 | this.noBtn.UseVisualStyleBackColor = true; 58 | this.noBtn.Click += new System.EventHandler(this.cancelBtn_Click); 59 | // 60 | // userTextBox 61 | // 62 | this.userTextBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); 63 | this.userTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; 64 | this.userTextBox.Enabled = false; 65 | this.userTextBox.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 66 | this.userTextBox.ForeColor = System.Drawing.Color.Black; 67 | this.userTextBox.Location = new System.Drawing.Point(12, 12); 68 | this.userTextBox.Multiline = true; 69 | this.userTextBox.Name = "userTextBox"; 70 | this.userTextBox.ReadOnly = true; 71 | this.userTextBox.Size = new System.Drawing.Size(301, 71); 72 | this.userTextBox.TabIndex = 2; 73 | // 74 | // MessageBox 75 | // 76 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 77 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 78 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); 79 | this.ClientSize = new System.Drawing.Size(327, 128); 80 | this.Controls.Add(this.userTextBox); 81 | this.Controls.Add(this.noBtn); 82 | this.Controls.Add(this.yesBtn); 83 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; 84 | this.Name = "MessageBox"; 85 | this.Opacity = 0.9D; 86 | this.ShowInTaskbar = false; 87 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 88 | this.Text = "MessageBox"; 89 | this.TopMost = true; 90 | this.ResumeLayout(false); 91 | this.PerformLayout(); 92 | 93 | } 94 | 95 | #endregion 96 | 97 | private System.Windows.Forms.Button yesBtn; 98 | private System.Windows.Forms.Button noBtn; 99 | private System.Windows.Forms.TextBox userTextBox; 100 | } 101 | } -------------------------------------------------------------------------------- /ScreenRecorder/MessageBox.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Drawing; 18 | using System.Windows.Forms; 19 | 20 | namespace ScreenRecorder 21 | { 22 | /// 23 | /// yes no 24 | /// 25 | public enum YesNo 26 | { 27 | Yes, 28 | No 29 | }; 30 | 31 | /// 32 | /// user message box 33 | /// 34 | public partial class MessageBox : Form 35 | { 36 | /// 37 | /// Yes no status 38 | /// 39 | private static YesNo yesno; 40 | 41 | /// 42 | /// userBox Singleton 43 | /// 44 | private static MessageBox userBox; 45 | 46 | /// 47 | /// Ctor 48 | /// 49 | private MessageBox() 50 | { 51 | InitializeComponent(); 52 | } 53 | 54 | /// 55 | /// On paint 56 | /// 57 | /// 58 | protected override void OnPaint(PaintEventArgs e) 59 | { 60 | e.Graphics.DrawRectangle(new Pen(Brushes.Black), new Rectangle(DisplayRectangle.Location, 61 | new Size(DisplayRectangle.Size.Width - 1, DisplayRectangle.Size.Height - 1))); 62 | base.OnPaint(e); 63 | } 64 | 65 | /// 66 | /// on yes click 67 | /// 68 | /// 69 | /// 70 | private void restartBtn_Click(object sender, EventArgs e) 71 | { 72 | yesno = YesNo.Yes; 73 | 74 | Close(); 75 | } 76 | 77 | /// 78 | /// On No click 79 | /// 80 | /// 81 | /// 82 | private void cancelBtn_Click(object sender, EventArgs e) 83 | { 84 | yesno = YesNo.No; 85 | 86 | Close(); 87 | } 88 | 89 | /// 90 | /// Show user box 91 | /// 92 | /// 93 | /// 94 | /// 95 | /// 96 | public static YesNo Show(string message, string yes, string no) 97 | { 98 | if (userBox == null) userBox = new MessageBox(); 99 | 100 | userBox.userTextBox.Text = message; 101 | userBox.yesBtn.Text = yes; 102 | userBox.noBtn.Text = no; 103 | 104 | userBox.ShowDialog(); 105 | 106 | return yesno; 107 | } 108 | } 109 | } -------------------------------------------------------------------------------- /ScreenRecorder/NotificationForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ScreenRecorder 2 | { 3 | partial class NotificationForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.userMsgBox = new System.Windows.Forms.Label(); 32 | this.SuspendLayout(); 33 | // 34 | // userMsgBox 35 | // 36 | this.userMsgBox.AutoSize = true; 37 | this.userMsgBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 19F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 38 | this.userMsgBox.ForeColor = System.Drawing.Color.DarkSlateBlue; 39 | this.userMsgBox.Location = new System.Drawing.Point(12, 19); 40 | this.userMsgBox.Name = "userMsgBox"; 41 | this.userMsgBox.Size = new System.Drawing.Size(108, 30); 42 | this.userMsgBox.TabIndex = 0; 43 | this.userMsgBox.Text = "Dummy"; 44 | // 45 | // NotificationForm 46 | // 47 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 48 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 49 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); 50 | this.ClientSize = new System.Drawing.Size(376, 69); 51 | this.Controls.Add(this.userMsgBox); 52 | this.ForeColor = System.Drawing.Color.Transparent; 53 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; 54 | this.Name = "NotificationForm"; 55 | this.ShowInTaskbar = false; 56 | this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; 57 | this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; 58 | this.Text = "NotificationForm"; 59 | this.TopMost = true; 60 | this.TransparencyKey = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); 61 | this.ResumeLayout(false); 62 | this.PerformLayout(); 63 | 64 | } 65 | 66 | #endregion 67 | 68 | private System.Windows.Forms.Label userMsgBox; 69 | 70 | 71 | 72 | } 73 | } -------------------------------------------------------------------------------- /ScreenRecorder/NotificationForm.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | #region Using directives 17 | 18 | using System; 19 | using System.Windows.Forms; 20 | 21 | #endregion 22 | 23 | namespace ScreenRecorder 24 | { 25 | /// 26 | /// Notification form 27 | /// 28 | /// Form 29 | public partial class NotificationForm : Form 30 | { 31 | ///// 32 | ///// Animation timer 33 | ///// 34 | //Timer animationTimer; 35 | 36 | /// 37 | /// My appearing 38 | /// 39 | private bool myAppearing; 40 | 41 | /// 42 | /// Wait timer 43 | /// 44 | private Timer waitTimer; 45 | 46 | /// 47 | /// Initializes a new instance of the NotificationForm class. 48 | /// 49 | public NotificationForm() 50 | { 51 | InitializeComponent(); 52 | 53 | ShowInTaskbar = false; 54 | Load += new EventHandler(OnNotifierLoad); 55 | } 56 | 57 | /// 58 | /// On notifier load 59 | /// 60 | /// Sender of the event 61 | /// Event arguments 62 | private void OnNotifierLoad(object sender, EventArgs e) 63 | { 64 | //Opacity = 0; 65 | 66 | //animationTimer = new Timer { Interval = 100 }; 67 | myAppearing = true; 68 | //animationTimer.Tick += new EventHandler(animationTimer_Tick); 69 | //animationTimer.Start(); 70 | 71 | waitTimer = new Timer {Interval = 700 /*wait for 0.7secs*/}; 72 | waitTimer.Tick += new EventHandler(waitTimer_Tick); 73 | waitTimer.Start(); 74 | 75 | Show(); 76 | } 77 | 78 | /// 79 | /// Wait timer tick 80 | /// 81 | /// Sender of the event 82 | /// Event arguments 83 | private void waitTimer_Tick(object sender, EventArgs e) 84 | { 85 | waitTimer.Stop(); 86 | myAppearing = false; 87 | 88 | Close(); 89 | // animationTimer.Start(); 90 | } 91 | 92 | /// 93 | /// Animation timer tick 94 | /// 95 | /// Sender of the event 96 | /// Event arguments 97 | private void animationTimer_Tick(object sender, EventArgs e) 98 | { 99 | if (myAppearing) 100 | { 101 | if (Opacity == 1) 102 | { 103 | //animationTimer.Stop(); 104 | } 105 | 106 | Opacity += 0.05; 107 | } 108 | else 109 | { 110 | if (Opacity == 0) 111 | { 112 | Close(); 113 | //this.Hide(); 114 | } 115 | 116 | Opacity -= 0.05; 117 | } 118 | } 119 | 120 | /// 121 | /// Popup 122 | /// 123 | /// Message 124 | /// Location 125 | public void Popup(string message) 126 | { 127 | userMsgBox.Text = message; 128 | //this.Location = location; 129 | 130 | //this.Show(); 131 | Application.Run(this); 132 | 133 | //animationTimer.Dispose(); 134 | } 135 | } // class NotificationForm 136 | } // namespace ScreenRecorder -------------------------------------------------------------------------------- /ScreenRecorder/Program.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Globalization; 18 | using System.Threading; 19 | using System.Windows.Forms; 20 | using log4net; 21 | using ScreenRecorder.Properties; 22 | 23 | namespace ScreenRecorder 24 | { 25 | internal static class Program 26 | { 27 | private static readonly ILog log = LogManager.GetLogger(typeof (Program).Name); 28 | 29 | /// 30 | /// The main entry point for the application. 31 | /// 32 | [STAThread] 33 | private static void Main() 34 | { 35 | Setup(); 36 | 37 | Application.EnableVisualStyles(); 38 | Application.SetCompatibleTextRenderingDefault(false); 39 | Application.Run(new ScreenRecorderMP.ScreenRecorder()); 40 | } 41 | 42 | /// 43 | /// initial setup 44 | /// 45 | private static void Setup() 46 | { 47 | var root = AppDomain.CurrentDomain; 48 | var setup = new AppDomainSetup 49 | { 50 | ApplicationBase = root.SetupInformation.ApplicationBase 51 | }; 52 | 53 | log.Info("Setting the UI language to " + Settings.Default.Language); 54 | Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Default.Language); 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /ScreenRecorder/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System.Reflection; 17 | using System.Runtime.InteropServices; 18 | using log4net.Config; 19 | 20 | // General Information about an assembly is controlled through the following 21 | // set of attributes. Change these attribute values to modify the information 22 | // associated with an assembly. 23 | 24 | [assembly: AssemblyTitle("ScreenRecorder")] 25 | [assembly: AssemblyDescription("Screen capture")] 26 | [assembly: AssemblyConfiguration("")] 27 | [assembly: AssemblyProduct("ScreenRecorder")] 28 | [assembly: AssemblyCopyright("Copyright © Licence Owner 2014")] 29 | [assembly: XmlConfigurator(Watch = true)] //For log4net 1.2.10.0 30 | 31 | [assembly: AssemblyTrademark("")] 32 | 33 | // Setting ComVisible to false makes the types in this assembly not visible 34 | // to COM components. If you need to access a type in this assembly from 35 | // COM, set the ComVisible attribute to true on that type. 36 | 37 | [assembly: ComVisible(false)] 38 | 39 | // The following GUID is for the ID of the typelib if this project is exposed to COM 40 | 41 | [assembly: Guid("374eb3cf-e453-405a-9f3f-76d2f2391cb0")] 42 | 43 | // Version information for an assembly consists of the following four values: 44 | // 45 | // Major Version 46 | // Minor Version 47 | // Build Number 48 | // Revision 49 | // 50 | // You can specify all the values or you can default the Build and Revision Numbers 51 | // by using the '*' as shown below: 52 | // [assembly: AssemblyVersion("1.0.*")] 53 | 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /ScreenRecorder/Properties/Resources.es.Designer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Properties/Resources.es.Designer.cs -------------------------------------------------------------------------------- /ScreenRecorder/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1022 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ScreenRecorder.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("2")] 29 | public int FramesPerSec { 30 | get { 31 | return ((int)(this["FramesPerSec"])); 32 | } 33 | set { 34 | this["FramesPerSec"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("0.9")] 41 | public decimal Opacity { 42 | get { 43 | return ((decimal)(this["Opacity"])); 44 | } 45 | set { 46 | this["Opacity"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("D:\\temp\\samples_code\\ScreenRecorder_v2.0\\ScreenRecorder\\bin\\x64\\Debug\\Bitmaps")] 53 | public string BitmapTempLoc { 54 | get { 55 | return ((string)(this["BitmapTempLoc"])); 56 | } 57 | set { 58 | this["BitmapTempLoc"] = value; 59 | } 60 | } 61 | 62 | [global::System.Configuration.UserScopedSettingAttribute()] 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 | [global::System.Configuration.DefaultSettingValueAttribute("en")] 65 | public string Language { 66 | get { 67 | return ((string)(this["Language"])); 68 | } 69 | set { 70 | this["Language"] = value; 71 | } 72 | } 73 | 74 | [global::System.Configuration.UserScopedSettingAttribute()] 75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 76 | [global::System.Configuration.DefaultSettingValueAttribute("")] 77 | public string VideoLoc { 78 | get { 79 | return ((string)(this["VideoLoc"])); 80 | } 81 | set { 82 | this["VideoLoc"] = value; 83 | } 84 | } 85 | 86 | [global::System.Configuration.UserScopedSettingAttribute()] 87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 88 | [global::System.Configuration.DefaultSettingValueAttribute("mp4")] 89 | public string VideoType { 90 | get { 91 | return ((string)(this["VideoType"])); 92 | } 93 | set { 94 | this["VideoType"] = value; 95 | } 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /ScreenRecorder/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 2 7 | 8 | 9 | 0.9 10 | 11 | 12 | D:\temp\samples_code\ScreenRecorder_v2.0\ScreenRecorder\bin\x64\Debug\Bitmaps 13 | 14 | 15 | en 16 | 17 | 18 | 19 | 20 | 21 | mp4 22 | 23 | 24 | -------------------------------------------------------------------------------- /ScreenRecorder/Resources/AVRecorder.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/AVRecorder.ico -------------------------------------------------------------------------------- /ScreenRecorder/Resources/AVRecorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/AVRecorder.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Bug.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Bug_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Bug_256.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Bug_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Bug_32.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Close.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Comment.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/EditPencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/EditPencil.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Email.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/FfMpegLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/FfMpegLogo.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Help.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Information.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/LeftSide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/LeftSide.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Like.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/MaximizeMinus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/MaximizeMinus.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/MaximizePlus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/MaximizePlus.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Minimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Minimize.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Pause.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Record.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Reset.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/RightSide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/RightSide.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Search.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Settings.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Settings_Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Settings_Edit.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Stop.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Warning.png -------------------------------------------------------------------------------- /ScreenRecorder/Resources/Warning_32x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/ScreenRecorder/Resources/Warning_32x.png -------------------------------------------------------------------------------- /ScreenRecorder/VariablesParser.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Collections; 18 | using log4net; 19 | using ScreenRecorder.Properties; 20 | 21 | namespace ScreenRecorder 22 | { 23 | /// 24 | /// Expand the environment varibles in the hooks files. 25 | /// 26 | public class VariablesParser 27 | { 28 | private static readonly ILog log = LogManager.GetLogger(typeof (VariablesParser).Name); 29 | 30 | /// 31 | /// application environment variables 32 | /// 33 | private static readonly Hashtable appVariables = new Hashtable() 34 | { 35 | {"BITMAPS", Settings.Default.BitmapTempLoc}, 36 | {"FPS", Settings.Default.FramesPerSec} 37 | }; 38 | 39 | /// 40 | /// Push App environment variable 41 | /// 42 | /// 43 | /// 44 | public static void PushVariable(string envName, object envValue) 45 | { 46 | if (string.IsNullOrEmpty(envName)) 47 | throw new ArgumentNullException("envName", "Environment name cannot be null or empty"); 48 | 49 | appVariables.Remove(envName); 50 | appVariables.Add(envName, envValue); 51 | } 52 | 53 | 54 | /// 55 | /// Expand relative path to absolute path 56 | /// 57 | /// 58 | /// 59 | public static string ExpandVariables(string content) 60 | { 61 | if (string.IsNullOrEmpty(content)) return content; 62 | 63 | log.Info("Before Expand contents: " + content); 64 | 65 | var expandedContent = content; 66 | 67 | foreach (DictionaryEntry anEntry in appVariables) 68 | { 69 | var oldString = "$" + ((string) (anEntry.Key)) + "$"; 70 | var newString = (anEntry.Value != null) ? anEntry.Value.ToString() : null; 71 | 72 | // check whether Value is of type string and contains Key 73 | if (newString != null && newString.IndexOf(oldString, StringComparison.OrdinalIgnoreCase) < 0) 74 | { 75 | var startIndex = 0; 76 | while (startIndex < expandedContent.Length) 77 | { 78 | var beginIndexOfOldString = expandedContent.IndexOf(oldString, startIndex, 79 | StringComparison.OrdinalIgnoreCase); 80 | if (beginIndexOfOldString >= 0) 81 | { 82 | var oldStringLength = oldString.Length; 83 | var endIndexOfOldString = beginIndexOfOldString + oldStringLength - 1; 84 | expandedContent = expandedContent.Substring(0, beginIndexOfOldString) + newString + 85 | expandedContent.Substring(endIndexOfOldString + 1); 86 | startIndex = beginIndexOfOldString + newString.Length; 87 | } 88 | else 89 | { 90 | break; 91 | } 92 | } 93 | } 94 | } 95 | 96 | log.Info("After Expand contents: " + expandedContent); 97 | return expandedContent; 98 | } 99 | } 100 | } -------------------------------------------------------------------------------- /ScreenRecorder/Win32Api.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Runtime.InteropServices; 18 | 19 | namespace ScreenRecorder 20 | { 21 | /// 22 | /// Hook proc 23 | /// 24 | /// 25 | /// 26 | /// 27 | /// 28 | public delegate int HookProc(int nCode, int wParam, keyboardHookStruct lParam); 29 | 30 | /// 31 | /// Pcursor info 32 | /// 33 | [StructLayout(LayoutKind.Sequential)] 34 | public struct PCURSORINFO 35 | { 36 | public Int32 Size; 37 | public Int32 Flags; 38 | public IntPtr Cursor; 39 | public POINTAPI ScreenPos; 40 | } 41 | 42 | /// 43 | /// Point 44 | /// 45 | [StructLayout(LayoutKind.Sequential)] 46 | public struct POINTAPI 47 | { 48 | public int x; 49 | public int y; 50 | } 51 | 52 | /// 53 | /// keyboard hook struct 54 | /// 55 | public struct keyboardHookStruct 56 | { 57 | public int dwExtraInfo; 58 | public int flags; 59 | public int scanCode; 60 | public int time; 61 | public int vkCode; 62 | } 63 | 64 | /// 65 | /// Wrapper for windows 32 calls. 66 | /// 67 | public class Win32Api 68 | { 69 | public const Int32 CURSOR_SHOWING = 0x00000001; 70 | public const int WH_KEYBOARD_LL = 13; 71 | public const int WM_KEYDOWN = 0x100; 72 | public const int WM_KEYUP = 0x101; 73 | public const int WM_SYSKEYDOWN = 0x104; 74 | public const int WM_SYSKEYUP = 0x105; 75 | 76 | [DllImport("user32.dll")] 77 | public static extern bool GetCursorInfo(out PCURSORINFO cinfo); 78 | 79 | [DllImport("user32.dll")] 80 | public static extern bool DrawIcon(IntPtr hDC, int X, int Y, IntPtr hIcon); 81 | 82 | [DllImport("winmm.dll")] 83 | private static extern int mciSendString(string MciComando, string MciRetorno, int MciRetornoLeng, int CallBack); 84 | 85 | [DllImport("user32")] 86 | private static extern int GetKeyboardState(byte[] pbKeyState); 87 | 88 | [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] 89 | private static extern short GetKeyState(int vKey); 90 | 91 | [DllImport("user32")] 92 | public static extern int ToAscii( 93 | int uVirtKey, 94 | int uScanCode, 95 | byte[] lpbKeyState, 96 | byte[] lpwTransKey, 97 | int fuState); 98 | 99 | [DllImport("user32.dll", CharSet = CharSet.Auto, 100 | CallingConvention = CallingConvention.StdCall)] 101 | public static extern int CallNextHookEx( 102 | IntPtr idHook, 103 | int nCode, 104 | int wParam, 105 | ref keyboardHookStruct lParam); 106 | 107 | [DllImport("user32.dll", CharSet = CharSet.Auto, 108 | CallingConvention = CallingConvention.StdCall, SetLastError = true)] 109 | public static extern int UnhookWindowsHookEx(IntPtr idHook); 110 | 111 | [DllImport("user32.dll", CharSet = CharSet.Auto, 112 | CallingConvention = CallingConvention.StdCall, SetLastError = true)] 113 | public static extern IntPtr SetWindowsHookEx( 114 | int idHook, 115 | HookProc lpfn, 116 | IntPtr hMod, 117 | int dwThreadId); 118 | 119 | [DllImport("kernel32.dll")] 120 | public static extern IntPtr LoadLibrary(string dllToLoad); 121 | 122 | //Constants 123 | } // class Win32 124 | } -------------------------------------------------------------------------------- /UML Modelling/ComponentView.uxf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 4 | 5 | UMLGeneric 6 | 7 | 210 8 | 440 9 | 140 10 | 50 11 | 12 | <<component>> 13 | FFMPEG Module 14 | 15 | 16 | 17 | UMLGeneric 18 | 19 | 430 20 | 440 21 | 140 22 | 40 23 | 24 | <<component>> 25 | Configuration Module 26 | 27 | 28 | 29 | UMLGeneric 30 | 31 | 300 32 | 310 33 | 140 34 | 40 35 | 36 | <<component>> 37 | Tools Model 38 | 39 | 40 | 41 | UMLGeneric 42 | 43 | 300 44 | 220 45 | 140 46 | 40 47 | 48 | <<component>> 49 | Tools View Model 50 | 51 | 52 | 53 | 54 | UMLGeneric 55 | 56 | 300 57 | 130 58 | 140 59 | 40 60 | 61 | <<component>> 62 | Tools View 63 | 64 | 65 | 66 | 67 | UMLGeneric 68 | 69 | 300 70 | 60 71 | 140 72 | 50 73 | 74 | <<component>> 75 | UI Container 76 | 77 | 78 | 79 | UMLGeneric 80 | 81 | 200 82 | 570 83 | 140 84 | 40 85 | 86 | <<component>> 87 | FFMPEG 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /UML Modelling/DeploymentView.uxf: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Uncomment the following line to change the fontsize and font: 4 | fontsize=10 5 | // fontfamily=SansSerif //possible: SansSerif,Serif,Monospaced 6 | 7 | 8 | ////////////////////////////////////////////////////////////////////////////////////////////// 9 | // Welcome to UMLet! 10 | // 11 | // Double-click on elements to add them to the diagram, or to copy them 12 | // Edit elements by modifying the text in this panel 13 | // Hold Ctrl to select multiple elements 14 | // Use Ctrl+mouse to select via lasso 15 | // 16 | // Use +/- or Ctrl+mouse wheel to zoom 17 | // Drag a whole relation at its central square icon 18 | // 19 | // Press Ctrl+C to copy the whole diagram to the system clipboard (then just paste it to, eg, Word) 20 | // Edit the files in the "palettes" directory to create your own element palettes 21 | // 22 | // Select "Custom Elements > New..." to create new element types 23 | ////////////////////////////////////////////////////////////////////////////////////////////// 24 | 25 | 26 | // This text will be stored with each diagram; use it for notes. 27 | 10 28 | 29 | UMLDeployment 30 | 31 | 30 32 | 40 33 | 930 34 | 580 35 | 36 | CAM Recorder 37 | 38 | 39 | 40 | UMLDeployment 41 | 42 | 160 43 | 270 44 | 780 45 | 160 46 | 47 | CAM Backend 48 | bg=light_gray 49 | 50 | 51 | 52 | UMLDeployment 53 | 54 | 40 55 | 450 56 | 900 57 | 160 58 | 59 | 3rd PARTY 60 | bg=gray 61 | 62 | 63 | 64 | UMLDeployment 65 | 66 | 160 67 | 90 68 | 780 69 | 160 70 | 71 | CAM Frontend 72 | bg=light_gray 73 | 74 | 75 | 76 | UMLGeneric 77 | 78 | 470 79 | 140 80 | 140 81 | 80 82 | 83 | symbol=component 84 | Tools View 85 | 86 | 87 | 88 | UMLGeneric 89 | 90 | 710 91 | 310 92 | 150 93 | 80 94 | 95 | symbol=component 96 | Configuration 97 | Module 98 | 99 | 100 | 101 | UMLGeneric 102 | 103 | 220 104 | 140 105 | 140 106 | 80 107 | 108 | symbol=component 109 | UI Container 110 | 111 | 112 | 113 | UMLGeneric 114 | 115 | 210 116 | 310 117 | 140 118 | 80 119 | 120 | symbol=component 121 | FFMPEG 122 | Module 123 | 124 | 125 | 126 | UMLGeneric 127 | 128 | 200 129 | 500 130 | 140 131 | 80 132 | 133 | symbol=component 134 | FFMPEG 135 | 136 | 137 | 138 | UMLGeneric 139 | 140 | 470 141 | 310 142 | 140 143 | 80 144 | 145 | symbol=component 146 | Tools 147 | Module 148 | 149 | 150 | 151 | UMLGeneric 152 | 153 | 470 154 | 500 155 | 140 156 | 80 157 | 158 | symbol=component 159 | Log4Net 160 | 161 | 162 | 163 | UMLGeneric 164 | 165 | 40 166 | 90 167 | 110 168 | 340 169 | 170 | PRISM 171 | bg=dark_gray 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /UML Modelling/UseCases.uxf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 4 | 5 | UMLActor 6 | 7 | 270 8 | 210 9 | 60 10 | 100 11 | 12 | Actor 13 | 14 | 15 | 16 | UMLUseCase 17 | 18 | 510 19 | 140 20 | 120 21 | 40 22 | 23 | Start recording 24 | 25 | 26 | 27 | UMLUseCase 28 | 29 | 510 30 | 200 31 | 120 32 | 40 33 | 34 | Stop recording 35 | 36 | 37 | 38 | UMLUseCase 39 | 40 | 510 41 | 280 42 | 120 43 | 40 44 | 45 | Video Settings 46 | 47 | 48 | 49 | UMLUseCase 50 | 51 | 510 52 | 360 53 | 120 54 | 40 55 | 56 | Audio Settings 57 | 58 | 59 | 60 | Relation 61 | 62 | 300 63 | 150 64 | 230 65 | 130 66 | 67 | lt=->> 68 | 10.0;110.0;210.0;10.0 69 | 70 | 71 | Relation 72 | 73 | 300 74 | 210 75 | 230 76 | 70 77 | 78 | lt=->> 79 | 10.0;50.0;210.0;10.0 80 | 81 | 82 | Relation 83 | 84 | 300 85 | 250 86 | 230 87 | 70 88 | 89 | lt=->> 90 | 10.0;10.0;210.0;50.0 91 | 92 | 93 | Relation 94 | 95 | 300 96 | 250 97 | 230 98 | 150 99 | 100 | lt=->> 101 | 10.0;10.0;210.0;130.0 102 | 103 | 104 | -------------------------------------------------------------------------------- /WPF/CAM.Bootscreen/BootSplasher.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Diagnostics; 18 | using System.Threading; 19 | using System.Windows.Threading; 20 | using log4net; 21 | 22 | namespace CAM.Bootscreen 23 | { 24 | public interface IBootSplasher 25 | { 26 | void ShowSplash(); 27 | void CloseSplash(); 28 | void ShowStatus(string theMessage); 29 | } 30 | 31 | public class BootSplasher : IBootSplasher 32 | { 33 | private readonly ILog Log = LogManager.GetLogger(typeof (BootSplasher)); 34 | private Bootscreen myBootscreen; 35 | private Dispatcher myDispatcher; 36 | 37 | public void ShowSplash() 38 | { 39 | var aCurrentProcess = Process.GetCurrentProcess(); 40 | Log.Info(string.Format("ShowSplash() :: Process ID: {0} Thread ID: {1}", aCurrentProcess.Id, 41 | Thread.CurrentThread.ManagedThreadId)); 42 | 43 | if (!myDispatcher.CheckAccess()) 44 | { 45 | myDispatcher.BeginInvoke(new Action(ShowSplash), DispatcherPriority.Render); 46 | return; 47 | } 48 | 49 | myBootscreen.Show(); 50 | Dispatcher.Run(); 51 | } 52 | 53 | public void CloseSplash() 54 | { 55 | var aCurrentProcess = Process.GetCurrentProcess(); 56 | Log.Info(string.Format("CloseSplash() :: Process ID: {0} Thread ID: {1}", aCurrentProcess.Id, 57 | Thread.CurrentThread.ManagedThreadId)); 58 | 59 | if (!myDispatcher.CheckAccess()) 60 | { 61 | myDispatcher.BeginInvoke(new Action(CloseSplash), DispatcherPriority.Render); 62 | return; 63 | } 64 | 65 | myBootscreen.Close(); 66 | } 67 | 68 | public void ShowStatus(string theMessage) 69 | { 70 | if (!myDispatcher.CheckAccess()) 71 | { 72 | myDispatcher.BeginInvoke(new Func(() => 73 | { 74 | ShowStatus(theMessage); 75 | return null; 76 | }), DispatcherPriority.Normal); 77 | return; 78 | } 79 | 80 | var aBootscreenViewModel = (myBootscreen.DataContext) as BootscreenViewModel; 81 | if (aBootscreenViewModel != null) 82 | aBootscreenViewModel.ShowStatus(theMessage); 83 | } 84 | 85 | public void Init() 86 | { 87 | var aCurrentProcess = Process.GetCurrentProcess(); 88 | Log.Info(string.Format("Init Process ID: {0} Thread ID: {1}", aCurrentProcess.Id, 89 | Thread.CurrentThread.ManagedThreadId)); 90 | myBootscreen = new Bootscreen(new BootscreenViewModel()); 91 | myDispatcher = myBootscreen.Dispatcher; 92 | } 93 | } 94 | } -------------------------------------------------------------------------------- /WPF/CAM.Bootscreen/Bootscreen.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /WPF/CAM.Bootscreen/Bootscreen.xaml.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | namespace CAM.Bootscreen 17 | { 18 | /// 19 | /// Interaction logic for Bootscreen.xaml 20 | /// 21 | public partial class Bootscreen 22 | { 23 | public Bootscreen(BootscreenViewModel theViewModel) 24 | { 25 | InitializeComponent(); 26 | DataContext = theViewModel; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /WPF/CAM.Bootscreen/BootscreenModule.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Diagnostics; 18 | using System.Threading; 19 | using System.Threading.Tasks; 20 | using log4net; 21 | using Microsoft.Practices.Prism.Modularity; 22 | using Microsoft.Practices.Unity; 23 | 24 | namespace CAM.Bootscreen 25 | { 26 | public class BootscreenModule : IModule 27 | { 28 | private readonly ILog Log = LogManager.GetLogger(typeof (BootscreenModule)); 29 | private readonly IUnityContainer myContainer; 30 | private readonly BootSplasher mySplasher = new BootSplasher(); 31 | 32 | public BootscreenModule(IUnityContainer theContainer) 33 | { 34 | myContainer = theContainer; 35 | } 36 | 37 | public void Initialize() 38 | { 39 | Log.Info("Initialzing the Bootscreen Module"); 40 | var aCurrentProcess = Process.GetCurrentProcess(); 41 | Log.Info(string.Format("Process ID: {0} Thread ID: {1}", aCurrentProcess.Id, 42 | Thread.CurrentThread.ManagedThreadId)); 43 | 44 | StartSTATask(Splasher); 45 | myContainer.RegisterInstance("Bootscreen", mySplasher, 46 | new ContainerControlledLifetimeManager()); 47 | } 48 | 49 | private object Splasher() 50 | { 51 | mySplasher.Init(); 52 | mySplasher.ShowSplash(); 53 | return null; 54 | } 55 | 56 | // ReSharper disable once InconsistentNaming 57 | public static Task StartSTATask(Func theFunc) 58 | { 59 | var aTcs = new TaskCompletionSource(); 60 | var aThread = new Thread(() => 61 | { 62 | try 63 | { 64 | aTcs.SetResult(theFunc()); 65 | } 66 | catch (Exception aE) 67 | { 68 | aTcs.SetException(aE); 69 | throw; 70 | } 71 | }); 72 | aThread.SetApartmentState(ApartmentState.STA); 73 | aThread.Start(); 74 | return aTcs.Task; 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /WPF/CAM.Bootscreen/BootscreenViewModel.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using CAM.Common; 18 | 19 | namespace CAM.Bootscreen 20 | { 21 | public class BootscreenViewModel : ViewModelBase 22 | { 23 | private string myStatus; 24 | 25 | public BootscreenViewModel() 26 | { 27 | StatusBar = "Loading CAM Recorder..."; 28 | } 29 | 30 | public String StatusBar 31 | { 32 | get { return myStatus; } 33 | set 34 | { 35 | myStatus = value; 36 | OnPropertyChanged("StatusBar"); 37 | } 38 | } 39 | 40 | public void ShowStatus(string theMessage) 41 | { 42 | StatusBar = theMessage; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /WPF/CAM.Bootscreen/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System.Reflection; 17 | using System.Runtime.InteropServices; 18 | 19 | // General Information about an assembly is controlled through the following 20 | // set of attributes. Change these attribute values to modify the information 21 | // associated with an assembly. 22 | 23 | [assembly: AssemblyTitle("CAM.Bootscreen")] 24 | [assembly: AssemblyDescription("")] 25 | [assembly: AssemblyConfiguration("")] 26 | [assembly: AssemblyCompany("Hewlett-Packard")] 27 | [assembly: AssemblyProduct("CAM.Bootscreen")] 28 | [assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2015")] 29 | [assembly: AssemblyTrademark("")] 30 | [assembly: AssemblyCulture("")] 31 | 32 | // Setting ComVisible to false makes the types in this assembly not visible 33 | // to COM components. If you need to access a type in this assembly from 34 | // COM, set the ComVisible attribute to true on that type. 35 | 36 | [assembly: ComVisible(false)] 37 | 38 | // The following GUID is for the ID of the typelib if this project is exposed to COM 39 | 40 | [assembly: Guid("b56acae6-c7da-4ca9-b6dd-f67ac660149a")] 41 | 42 | // Version information for an assembly consists of the following four values: 43 | // 44 | // Major Version 45 | // Minor Version 46 | // Build Number 47 | // Revision 48 | // 49 | // You can specify all the values or you can default the Build and Revision Numbers 50 | // by using the '*' as shown below: 51 | // [assembly: AssemblyVersion("1.0.*")] 52 | 53 | [assembly: AssemblyVersion("1.0.0.0")] 54 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /WPF/CAM.Common/AppExitEvent.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using Microsoft.Practices.Prism.PubSubEvents; 17 | 18 | namespace CAM.Common 19 | { 20 | public enum AppExitType 21 | { 22 | Normal, 23 | Forced, 24 | Error 25 | } 26 | 27 | public class AppExitEvent : PubSubEvent 28 | { 29 | } 30 | } -------------------------------------------------------------------------------- /WPF/CAM.Common/ColorPalatte.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | namespace CAM.Common 17 | { 18 | public class ColorPalatte 19 | { 20 | public const string BlueGrey = "#607D8B"; 21 | public const string Grey = "#9E9E9E"; 22 | public const string Brown = "#795548"; 23 | public const string DeepOrange = "#FF5722"; 24 | public const string Orange = "#FF9800"; 25 | public const string Amber = "#FFC107"; 26 | public const string Yellow = "#FFEB3B"; 27 | public const string Lime = "#CDDC39"; 28 | public const string LightGreen = "#8BC34A"; 29 | public const string Green = "#4CAF50"; 30 | public const string Teal = "#009688"; 31 | public const string Cyan = "#00BCD4"; 32 | public const string LightBlue = "#03A9F4"; 33 | public const string Blue = "#2196F3"; 34 | public const string Indigo = "#3F51B5"; 35 | public const string DeepPurple = "#673AB7"; 36 | } 37 | } -------------------------------------------------------------------------------- /WPF/CAM.Common/EncoderInfo.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | 18 | namespace CAM.Common 19 | { 20 | public class EncoderInfo 21 | { 22 | public String HookId { get; set; } 23 | public String Mode { get; set; } 24 | public String ExeName { get; set; } 25 | public String ExePath { get; set; } 26 | public String Arguments { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /WPF/CAM.Common/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System.Reflection; 17 | using System.Runtime.InteropServices; 18 | 19 | // General Information about an assembly is controlled through the following 20 | // set of attributes. Change these attribute values to modify the information 21 | // associated with an assembly. 22 | 23 | [assembly: AssemblyTitle("CAM.Common")] 24 | [assembly: AssemblyDescription("")] 25 | [assembly: AssemblyConfiguration("")] 26 | [assembly: AssemblyCompany("Hewlett-Packard")] 27 | [assembly: AssemblyProduct("CAM.Common")] 28 | [assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2015")] 29 | [assembly: AssemblyTrademark("")] 30 | [assembly: AssemblyCulture("")] 31 | 32 | // Setting ComVisible to false makes the types in this assembly not visible 33 | // to COM components. If you need to access a type in this assembly from 34 | // COM, set the ComVisible attribute to true on that type. 35 | 36 | [assembly: ComVisible(false)] 37 | 38 | // The following GUID is for the ID of the typelib if this project is exposed to COM 39 | 40 | [assembly: Guid("7bbe96d0-eb71-45e6-b5cf-011d8c2eef66")] 41 | 42 | // Version information for an assembly consists of the following four values: 43 | // 44 | // Major Version 45 | // Minor Version 46 | // Build Number 47 | // Revision 48 | // 49 | // You can specify all the values or you can default the Build and Revision Numbers 50 | // by using the '*' as shown below: 51 | // [assembly: AssemblyVersion("1.0.*")] 52 | 53 | [assembly: AssemblyVersion("1.0.0.0")] 54 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /WPF/CAM.Common/RelayCommand.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Diagnostics; 18 | using System.Windows.Input; 19 | 20 | namespace CAM.Common 21 | { 22 | public class RelayCommand : ICommand 23 | { 24 | private readonly Predicate myCanExecute; 25 | 26 | private readonly Action myExecute; 27 | 28 | public RelayCommand(Action theExecute) 29 | : this(null, theExecute) 30 | { 31 | } 32 | 33 | public RelayCommand(Predicate theCanExecute, Action theExecute) 34 | { 35 | if (theExecute == null) 36 | { 37 | throw new ArgumentNullException("theExecute"); 38 | } 39 | 40 | myExecute = theExecute; 41 | myCanExecute = theCanExecute; 42 | } 43 | 44 | public event EventHandler CanExecuteChanged 45 | { 46 | add { CommandManager.RequerySuggested += value; } 47 | 48 | remove { CommandManager.RequerySuggested -= value; } 49 | } 50 | 51 | [DebuggerStepThrough] 52 | public bool CanExecute(object theParameter) 53 | { 54 | return myCanExecute == null || myCanExecute(theParameter); 55 | } 56 | 57 | public void Execute(object theParameter) 58 | { 59 | myExecute(theParameter); 60 | } 61 | 62 | public static RelayCommand RegisterCommand(Predicate theCanExecute, Action theExecute) 63 | { 64 | return new RelayCommand(theCanExecute, theExecute); 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/Bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/Bug.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/Comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/Comment.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/EditPencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/EditPencil.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/Email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/Email.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/FfMpegLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/FfMpegLogo.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/Help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/Help.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/Information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/Information.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/LeftSide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/LeftSide.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/Like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/Like.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/MaximizeMinus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/MaximizeMinus.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/MaximizePlus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/MaximizePlus.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/Minimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/Minimize.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/RightSide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/RightSide.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/Search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/Search.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/Settings_Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/Settings_Edit.png -------------------------------------------------------------------------------- /WPF/CAM.Common/Resources/Warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Common/Resources/Warning.png -------------------------------------------------------------------------------- /WPF/CAM.Common/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.ComponentModel; 18 | using System.Diagnostics; 19 | 20 | namespace CAM.Common 21 | { 22 | public abstract class ViewModelBase : INotifyPropertyChanged 23 | { 24 | protected ViewModelBase() 25 | { 26 | ThrowOnInvalidPropertyName = true; 27 | } 28 | 29 | protected bool ThrowOnInvalidPropertyName { get; private set; } 30 | public event PropertyChangedEventHandler PropertyChanged; 31 | 32 | [Conditional("DEBUG"), DebuggerStepThrough] 33 | public void VerifyPropertyName(string thePropertyName) 34 | { 35 | // Verify that the property name matches a real, 36 | // public, instance property on this object. 37 | if (TypeDescriptor.GetProperties(this)[thePropertyName] == null) 38 | { 39 | var aMsg = "Invalid property name: " + thePropertyName; 40 | 41 | if (ThrowOnInvalidPropertyName) 42 | { 43 | throw new Exception(aMsg); 44 | } 45 | 46 | Debug.Fail(aMsg); 47 | } 48 | } 49 | 50 | public virtual void OnPropertyChanged(string thePropertyName) 51 | { 52 | VerifyPropertyName(thePropertyName); 53 | 54 | var aHandler = PropertyChanged; 55 | if (aHandler != null) 56 | { 57 | var aE = new PropertyChangedEventArgs(thePropertyName); 58 | aHandler(this, aE); 59 | } 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /WPF/CAM.Common/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /WPF/CAM.Configuration/Configuration.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Collections.Generic; 18 | using System.Configuration; 19 | using System.IO; 20 | using System.Linq; 21 | using CAM.Common; 22 | using log4net; 23 | using Microsoft.Practices.Prism.PubSubEvents; 24 | 25 | namespace CAM.Configuration 26 | { 27 | internal class Configuration : IConfiguration 28 | { 29 | private const string HookFile = "Hooks.config"; 30 | private readonly ILog Log = LogManager.GetLogger(typeof (Configuration)); 31 | private readonly IList myConfiguredHooks = new List(); 32 | private readonly IEventAggregator myEventAggregator; 33 | 34 | public Configuration(IEventAggregator theEventAggregator) 35 | { 36 | myEventAggregator = theEventAggregator; 37 | myEventAggregator.GetEvent().Subscribe(SaveConfigurationSettings); 38 | 39 | VideoConfiguration = new VideoSettings(); 40 | SetupApplicationVariables(); 41 | 42 | var aFileMap = new ExeConfigurationFileMap {ExeConfigFilename = HookFile}; 43 | 44 | if (!File.Exists(aFileMap.ExeConfigFilename)) 45 | { 46 | throw new Exception("Configuration file could not be found :" + aFileMap.ExeConfigFilename); 47 | } 48 | 49 | // Load configuration 50 | var aOpenMappedExeConfiguration = ConfigurationManager.OpenMappedExeConfiguration(aFileMap, 51 | ConfigurationUserLevel.None); 52 | var aConfigurationSection = aOpenMappedExeConfiguration.GetSection("hook"); 53 | var aHook = aConfigurationSection as Hook; 54 | if (aHook == null) 55 | { 56 | Log.Error("No Hooks configured! No command targeted for FFMPEG. CAM Recorder may not work!"); 57 | return; 58 | } 59 | 60 | var aEnumerator = aHook.Commands.GetEnumerator(); 61 | do 62 | { 63 | var aCurrent = aEnumerator.Current as Command; 64 | if (aCurrent == null) continue; 65 | myConfiguredHooks.Add(new EncoderInfo() 66 | { 67 | HookId = aCurrent.HookId, 68 | Mode = aCurrent.Mode, 69 | ExeName = aCurrent.Executable.Name, 70 | ExePath = aCurrent.Executable.ExeLocation, 71 | Arguments = VariablesParser.ExpandVariables(aCurrent.Arguments.CommandLine) 72 | }); 73 | } while (aEnumerator.MoveNext()); 74 | } 75 | 76 | public EncoderInfo GetHook(String theHookId) 77 | { 78 | if (myConfiguredHooks.Count == 0) 79 | { 80 | Log.Info("No Hooks available!"); 81 | return null; 82 | } 83 | 84 | foreach ( 85 | var aConfiguredHook in 86 | myConfiguredHooks.Where(theConfiguredHook => theConfiguredHook.HookId == theHookId)) 87 | { 88 | return aConfiguredHook; 89 | } 90 | 91 | Log.Info("No hook configured with hook Id:" + theHookId); 92 | return null; 93 | } 94 | 95 | public VideoSettings VideoConfiguration { get; set; } 96 | 97 | private void SetupApplicationVariables() 98 | { 99 | VariablesParser.PushVariable("VIDEO_LOCATION", VideoConfiguration.OutputLocation); 100 | VariablesParser.PushVariable("FPS", VideoConfiguration.FPS); 101 | VariablesParser.PushVariable("BITMAPS", VideoConfiguration.BitmapLocation); 102 | } 103 | 104 | private void SaveConfigurationSettings(AppExitType theExitType) 105 | { 106 | switch (theExitType) 107 | { 108 | case AppExitType.Normal: 109 | VideoConfiguration.Save(); 110 | Log.Debug("Video settings saved."); 111 | break; 112 | 113 | case AppExitType.Forced: 114 | case AppExitType.Error: 115 | Log.Info("Error in application close. Not saving configuration settings"); 116 | break; 117 | } 118 | } 119 | } 120 | } -------------------------------------------------------------------------------- /WPF/CAM.Configuration/ConfigurationModule.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using log4net; 17 | using Microsoft.Practices.Prism.Modularity; 18 | using Microsoft.Practices.Prism.PubSubEvents; 19 | using Microsoft.Practices.Unity; 20 | 21 | namespace CAM.Configuration 22 | { 23 | internal class ConfigurationModule : IModule 24 | { 25 | private readonly ILog Log = LogManager.GetLogger(typeof (ConfigurationModule)); 26 | private readonly IUnityContainer myContainer; 27 | private readonly IEventAggregator myEventAggregator; 28 | 29 | public ConfigurationModule(IUnityContainer theContainer, IEventAggregator theEventAggregator) 30 | { 31 | myContainer = theContainer; 32 | myEventAggregator = theEventAggregator; 33 | } 34 | 35 | public void Initialize() 36 | { 37 | Log.Info("Initialize Configuration Module"); 38 | IConfiguration aConfig = new Configuration(myEventAggregator); 39 | myContainer.RegisterInstance(aConfig, new ContainerControlledLifetimeManager()); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /WPF/CAM.Configuration/Hook/HookConfigurationSection.csd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /WPF/CAM.Configuration/Hook/HookConfigurationSection.csd.config: -------------------------------------------------------------------------------- 1 |  2 | 10 | 11 | 12 |
13 |
14 | 15 | 16 | 24 | 25 | 26 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /WPF/CAM.Configuration/Hook/HookConfigurationSection.csd.xsd: -------------------------------------------------------------------------------- 1 |  2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | The Commands. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | The Name. 26 | 27 | 28 | 29 | 30 | The ExeLocation. 31 | 32 | 33 | 34 | 35 | 36 | 37 | The CommandLine. 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | The Command Configuration Section. 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | The Executable. 55 | 56 | 57 | 58 | 59 | The Arguments. 60 | 61 | 62 | 63 | 64 | 65 | The HookId. 66 | 67 | 68 | 69 | 70 | The Mode. 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /WPF/CAM.Configuration/Hooks.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /WPF/CAM.Configuration/IConfiguration.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using CAM.Common; 18 | 19 | namespace CAM.Configuration 20 | { 21 | public interface IConfiguration 22 | { 23 | VideoSettings VideoConfiguration { get; set; } 24 | EncoderInfo GetHook(String theHookId); 25 | } 26 | } -------------------------------------------------------------------------------- /WPF/CAM.Configuration/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System.Reflection; 17 | using System.Runtime.InteropServices; 18 | 19 | // General Information about an assembly is controlled through the following 20 | // set of attributes. Change these attribute values to modify the information 21 | // associated with an assembly. 22 | 23 | [assembly: AssemblyTitle("CAM.Configuration")] 24 | [assembly: AssemblyDescription("")] 25 | [assembly: AssemblyConfiguration("")] 26 | [assembly: AssemblyCompany("Hewlett-Packard")] 27 | [assembly: AssemblyProduct("CAM.Configuration")] 28 | [assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2015")] 29 | [assembly: AssemblyTrademark("")] 30 | [assembly: AssemblyCulture("")] 31 | 32 | // Setting ComVisible to false makes the types in this assembly not visible 33 | // to COM components. If you need to access a type in this assembly from 34 | // COM, set the ComVisible attribute to true on that type. 35 | 36 | [assembly: ComVisible(false)] 37 | 38 | // The following GUID is for the ID of the typelib if this project is exposed to COM 39 | 40 | [assembly: Guid("86545489-dcc4-4182-8225-49fa2f1aaaf8")] 41 | 42 | // Version information for an assembly consists of the following four values: 43 | // 44 | // Major Version 45 | // Minor Version 46 | // Build Number 47 | // Revision 48 | // 49 | // You can specify all the values or you can default the Build and Revision Numbers 50 | // by using the '*' as shown below: 51 | // [assembly: AssemblyVersion("1.0.*")] 52 | 53 | [assembly: AssemblyVersion("1.0.0.0")] 54 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /WPF/CAM.Configuration/VariablesParser.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Collections; 18 | using log4net; 19 | 20 | namespace CAM.Configuration 21 | { 22 | /// 23 | /// Expand the environment varibles in the hooks files. 24 | /// 25 | internal class VariablesParser 26 | { 27 | private static readonly ILog Log = LogManager.GetLogger(typeof (VariablesParser).Name); 28 | 29 | /// 30 | /// application environment variables 31 | /// 32 | private static readonly Hashtable AppVariables = new Hashtable(); 33 | 34 | /// 35 | /// Push App environment variable 36 | /// 37 | /// 38 | /// 39 | public static void PushVariable(string theEnvName, object theEnvValue) 40 | { 41 | if (string.IsNullOrEmpty(theEnvName)) 42 | throw new ArgumentNullException("theEnvName", "Environment name cannot be null or empty"); 43 | 44 | AppVariables.Remove(theEnvName); 45 | AppVariables.Add(theEnvName, theEnvValue); 46 | } 47 | 48 | 49 | /// 50 | /// Expand relative path to absolute path 51 | /// 52 | /// 53 | /// 54 | public static string ExpandVariables(string theContent) 55 | { 56 | if (string.IsNullOrEmpty(theContent)) return theContent; 57 | 58 | Log.Debug("Before Expand contents: " + theContent); 59 | 60 | var aExpandedContent = theContent; 61 | 62 | foreach (DictionaryEntry aEntry in AppVariables) 63 | { 64 | var aOldString = "$" + ((string) (aEntry.Key)) + "$"; 65 | var aNewString = (aEntry.Value != null) ? aEntry.Value.ToString() : null; 66 | 67 | // check whether Value is of type string and contains Key 68 | if (aNewString != null && aNewString.IndexOf(aOldString, StringComparison.OrdinalIgnoreCase) < 0) 69 | { 70 | var aStartIndex = 0; 71 | while (aStartIndex < aExpandedContent.Length) 72 | { 73 | var aBeginIndexOfOldString = aExpandedContent.IndexOf(aOldString, aStartIndex, 74 | StringComparison.OrdinalIgnoreCase); 75 | if (aBeginIndexOfOldString >= 0) 76 | { 77 | var aOldStringLength = aOldString.Length; 78 | var aEndIndexOfOldString = aBeginIndexOfOldString + aOldStringLength - 1; 79 | aExpandedContent = aExpandedContent.Substring(0, aBeginIndexOfOldString) + aNewString + 80 | aExpandedContent.Substring(aEndIndexOfOldString + 1); 81 | aStartIndex = aBeginIndexOfOldString + aNewString.Length; 82 | } 83 | else 84 | { 85 | break; 86 | } 87 | } 88 | } 89 | } 90 | 91 | Log.Debug("After Expand contents: " + aExpandedContent); 92 | return aExpandedContent; 93 | } 94 | } 95 | } -------------------------------------------------------------------------------- /WPF/CAM.Configuration/VideoSettings.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Configuration; 18 | using System.IO; 19 | 20 | namespace CAM.Configuration 21 | { 22 | public class VideoSettings : ApplicationSettingsBase 23 | { 24 | public VideoSettings() 25 | { 26 | var aTempDir = Path.Combine(Path.GetTempPath(), "Bitmaps"); 27 | if (string.IsNullOrEmpty(BitmapLocation)) BitmapLocation = aTempDir; 28 | if (string.IsNullOrEmpty(OutputLocation)) OutputLocation = aTempDir; 29 | } 30 | 31 | [UserScopedSetting] 32 | [DefaultSettingValue("20")] 33 | // ReSharper disable once InconsistentNaming 34 | public int FPS 35 | { 36 | get { return (int) this["FPS"]; } 37 | set { this["FPS"] = value; } 38 | } 39 | 40 | [UserScopedSetting] 41 | public String BitmapLocation 42 | { 43 | get { return (String) this["BitmapLocation"]; } 44 | set { this["BitmapLocation"] = value; } 45 | } 46 | 47 | [UserScopedSetting] 48 | [DefaultSettingValue("en-US")] 49 | public String Language 50 | { 51 | get { return (String) this["Language"]; } 52 | set { this["Language"] = value; } 53 | } 54 | 55 | [UserScopedSetting] 56 | [DefaultSettingValue("MKV")] 57 | public String PreferedVideoType 58 | { 59 | get { return (String) this["PreferedVideoType"]; } 60 | set { this["PreferedVideoType"] = value; } 61 | } 62 | 63 | [UserScopedSetting] 64 | public String OutputLocation 65 | { 66 | get { return (String) this["OutputLocation"]; } 67 | set { this["OutputLocation"] = value; } 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /WPF/CAM.Configuration/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WPF/CAM.Setup/CAM.Setup.isproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Express 6 | 7 | Debug 8 | $(Configuration) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | CAM.Bootscreen 34 | {8C937354-DD59-4857-B824-C8516F0A9C99} 35 | 36 | 37 | CAM.Common 38 | {033C00D7-1510-462C-B67A-6C14C09905FE} 39 | 40 | 41 | CAM.Configuration 42 | {AFB8EF06-74AF-48FF-8450-45CFDDE6A5C6} 43 | 44 | 45 | CAM.Starter 46 | {619D8E20-4836-43E4-BF76-40A98964F133} 47 | 48 | 49 | CAM.Tools 50 | {BF99F2F8-B18E-484B-B9C9-58EDC207D7D5} 51 | 52 | 53 | CAM.VideoCodec.FFMPEG 54 | {4CA51786-35A6-48D6-A402-245D51CFACCD} 55 | 56 | 57 | CAM.VideoCodec.Interfaces 58 | {5E170C42-D6BB-4C17-938B-A968821C64F6} 59 | 60 | 61 | -------------------------------------------------------------------------------- /WPF/CAM.Starter/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /WPF/CAM.Starter/App.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WPF/CAM.Starter/App.xaml.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Diagnostics; 18 | using System.Globalization; 19 | using System.IO; 20 | using System.Reflection; 21 | using System.Windows; 22 | using log4net; 23 | 24 | namespace CAM.Starter 25 | { 26 | /// 27 | /// Interaction logic for App.xaml 28 | /// 29 | public partial class App 30 | { 31 | private static readonly ILog Log = LogManager.GetLogger(typeof(App)); 32 | 33 | public App() 34 | { 35 | AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException; 36 | } 37 | 38 | private void CurrentDomainUnhandledException(object theSender, UnhandledExceptionEventArgs theArgs) 39 | { 40 | Log.Fatal("Unhandled exception from CAM Recorder!", (Exception)theArgs.ExceptionObject); 41 | CreateDump(); 42 | } 43 | 44 | private void CreateDump() 45 | { 46 | string aDirectoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 47 | 48 | var aDumpProcess = new Process(); 49 | var aCurrentProcess = Process.GetCurrentProcess(); 50 | 51 | var aPId = aCurrentProcess.Id.ToString(CultureInfo.InvariantCulture); 52 | 53 | string aDumpFilePath = Path.Combine(aDirectoryName, "CAM.Starter_" + aPId + ".dmp"); 54 | 55 | Log.Info("Dumping process to file :" + aDumpFilePath); 56 | 57 | aDumpProcess.StartInfo = new ProcessStartInfo("Extern\\procdump.exe", 58 | string.Format("{0} {1}", aPId, aDumpFilePath)); 59 | aDumpProcess.Start(); 60 | aDumpProcess.WaitForExit(); 61 | 62 | Log.Info("Killing CAM.Starter.exe...."); 63 | aCurrentProcess.Kill(); 64 | } 65 | 66 | protected override void OnStartup(StartupEventArgs theArgs) 67 | { 68 | var aBootstrapper = new Bootstrapper(); 69 | aBootstrapper.Run(); 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /WPF/CAM.Starter/Bootstrapper.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Windows; 18 | using CAM.Starter.Logger; 19 | using CAM.Starter.Views; 20 | using log4net; 21 | using Microsoft.Practices.Prism.Logging; 22 | using Microsoft.Practices.Prism.Modularity; 23 | using Microsoft.Practices.Prism.UnityExtensions; 24 | using Microsoft.Practices.Unity; 25 | 26 | namespace CAM.Starter 27 | { 28 | internal class Bootstrapper : UnityBootstrapper 29 | { 30 | private static readonly ILog Log = LogManager.GetLogger(typeof (Bootstrapper)); 31 | 32 | protected override ILoggerFacade CreateLogger() 33 | { 34 | return new Log4NetLogger(); 35 | } 36 | 37 | protected override IModuleCatalog CreateModuleCatalog() 38 | { 39 | return new ConfigurationModuleCatalog(); 40 | } 41 | 42 | protected override DependencyObject CreateShell() 43 | { 44 | return Container.Resolve(); 45 | } 46 | 47 | protected override void InitializeShell() 48 | { 49 | Log.Info("Starting the CAM Application"); 50 | Application.Current.MainWindow = (UIContainerView) Shell; 51 | Application.Current.MainWindow.Show(); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /WPF/CAM.Starter/Extern/procdump.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Starter/Extern/procdump.exe -------------------------------------------------------------------------------- /WPF/CAM.Starter/Logger/Log4NetLogger.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using log4net; 17 | using Microsoft.Practices.Prism.Logging; 18 | 19 | namespace CAM.Starter.Logger 20 | { 21 | internal class Log4NetLogger : ILoggerFacade 22 | { 23 | private readonly ILog Logger = LogManager.GetLogger(typeof (Log4NetLogger)); 24 | 25 | public void Log(string theMessage, Category theCategory, Priority thePriority) 26 | { 27 | switch (theCategory) 28 | { 29 | case Category.Debug: 30 | Logger.Debug(theMessage); 31 | break; 32 | case Category.Warn: 33 | Logger.Warn(theMessage); 34 | break; 35 | case Category.Exception: 36 | Logger.Error(theMessage); 37 | break; 38 | case Category.Info: 39 | Logger.Info(theMessage); 40 | break; 41 | } 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /WPF/CAM.Starter/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System.Reflection; 17 | using System.Runtime.InteropServices; 18 | using System.Windows; 19 | using log4net.Config; 20 | 21 | // General Information about an assembly is controlled through the following 22 | // set of attributes. Change these attribute values to modify the information 23 | // associated with an assembly. 24 | 25 | [assembly: AssemblyTitle("CAM.Starter")] 26 | [assembly: AssemblyDescription("")] 27 | [assembly: AssemblyConfiguration("")] 28 | [assembly: AssemblyCompany("Hewlett-Packard")] 29 | [assembly: AssemblyProduct("CAM.Starter")] 30 | [assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2015")] 31 | [assembly: AssemblyTrademark("")] 32 | [assembly: AssemblyCulture("")] 33 | [assembly: XmlConfigurator(Watch = true, ConfigFile = "CAM.Starter.exe.config")] 34 | 35 | // Setting ComVisible to false makes the types in this assembly not visible 36 | // to COM components. If you need to access a type in this assembly from 37 | // COM, set the ComVisible attribute to true on that type. 38 | 39 | [assembly: ComVisible(false)] 40 | 41 | //In order to begin building localizable applications, set 42 | //CultureYouAreCodingWith in your .csproj file 43 | //inside a . For example, if you are using US english 44 | //in your source files, set the to en-US. Then uncomment 45 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 46 | //the line below to match the UICulture setting in the project file. 47 | 48 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 49 | 50 | 51 | [assembly: ThemeInfo( 52 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 53 | //(used if a resource is not found in the page, 54 | // or application resource dictionaries) 55 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 56 | //(used if a resource is not found in the page, 57 | // app, or any theme specific resource dictionaries) 58 | )] 59 | 60 | 61 | // Version information for an assembly consists of the following four values: 62 | // 63 | // Major Version 64 | // Minor Version 65 | // Build Number 66 | // Revision 67 | // 68 | // You can specify all the values or you can default the Build and Revision Numbers 69 | // by using the '*' as shown below: 70 | // [assembly: AssemblyVersion("1.0.*")] 71 | 72 | [assembly: AssemblyVersion("1.0.0.0")] 73 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /WPF/CAM.Starter/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34209 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CAM.Starter.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CAM.Starter.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /WPF/CAM.Starter/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34209 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CAM.Starter.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /WPF/CAM.Starter/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /WPF/CAM.Starter/Resources/AVRecorder.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Starter/Resources/AVRecorder.ico -------------------------------------------------------------------------------- /WPF/CAM.Starter/Resources/AVRecorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Starter/Resources/AVRecorder.png -------------------------------------------------------------------------------- /WPF/CAM.Starter/ViewModel/UIContainerViewModel.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using CAM.Common; 18 | using log4net; 19 | using Microsoft.Practices.Prism.PubSubEvents; 20 | 21 | namespace CAM.Starter.ViewModel 22 | { 23 | // ReSharper disable once InconsistentNaming 24 | public class UIContainerViewModel : ViewModelBase 25 | { 26 | private static readonly ILog Log = LogManager.GetLogger(typeof (UIContainerViewModel)); 27 | 28 | private string myActionAlertColor; 29 | 30 | public UIContainerViewModel(IEventAggregator theEventAggregator) 31 | { 32 | ActionAlertColor = ColorPalatte.BlueGrey; 33 | EventAggregator = theEventAggregator; 34 | EventAggregator.GetEvent().Subscribe(CloseApplication); 35 | } 36 | 37 | public String ActionAlertColor 38 | { 39 | get { return myActionAlertColor; } 40 | set 41 | { 42 | myActionAlertColor = value; 43 | OnPropertyChanged("ActionAlertColor"); 44 | } 45 | } 46 | 47 | public IEventAggregator EventAggregator { get; set; } 48 | 49 | private void CloseApplication(AppExitType theExitType) 50 | { 51 | switch (theExitType) 52 | { 53 | case AppExitType.Normal: 54 | Log.Info("Exiting CAM Application. Normal Exit"); 55 | break; 56 | 57 | case AppExitType.Forced: 58 | Log.Info("Exiting CAM Application. Forced Exit!"); 59 | break; 60 | 61 | case AppExitType.Error: 62 | Log.Info("Exiting CAM Application. Unknown error happened!"); 63 | break; 64 | } 65 | 66 | Environment.Exit(0); 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /WPF/CAM.Starter/Views/ExceptionViewer.xaml.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Windows; 18 | 19 | namespace CAM.Starter.Views 20 | { 21 | /// 22 | /// Interaction logic for ExceptionViewer.xaml 23 | /// 24 | public partial class ExceptionViewer : Window 25 | { 26 | public ExceptionViewer() 27 | { 28 | InitializeComponent(); 29 | } 30 | 31 | private void OnAbortClicked(object theSender, RoutedEventArgs theE) 32 | { 33 | Environment.Exit(1); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /WPF/CAM.Starter/Views/UIContainerView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /WPF/CAM.Starter/Views/UIContainerView.xaml.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System.Windows; 17 | using CAM.Starter.ViewModel; 18 | 19 | namespace CAM.Starter.Views 20 | { 21 | /// 22 | /// Interaction logic for UIContainer.xaml 23 | /// 24 | // ReSharper disable once InconsistentNaming 25 | public partial class UIContainerView : Window 26 | { 27 | public UIContainerView(UIContainerViewModel theViewModel) 28 | { 29 | InitializeComponent(); 30 | DataContext = theViewModel; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /WPF/CAM.Starter/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /WPF/CAM.Tools/BasicToolsModule.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using CAM.Tools.Views; 17 | using log4net; 18 | using Microsoft.Practices.Prism.Modularity; 19 | using Microsoft.Practices.Prism.PubSubEvents; 20 | using Microsoft.Practices.Prism.Regions; 21 | using Microsoft.Practices.Unity; 22 | 23 | namespace CAM.Tools 24 | { 25 | public class BasicToolsModule : IModule 26 | { 27 | private readonly ILog Log = LogManager.GetLogger(typeof (BasicToolsModule)); 28 | private readonly IUnityContainer myContainer; 29 | private readonly IEventAggregator myEventAggregator; 30 | private readonly IRegionManager myRegionManager; 31 | 32 | public BasicToolsModule(IUnityContainer theContainer, IRegionManager theRegionManager, 33 | IEventAggregator theEventAggregator) 34 | { 35 | myContainer = theContainer; 36 | myRegionManager = theRegionManager; 37 | myEventAggregator = theEventAggregator; 38 | } 39 | 40 | public void Initialize() 41 | { 42 | Log.Info("Initializing Basic Tools Module"); 43 | myRegionManager.RegisterViewWithRegion("ToolsRegion", typeof (ToolsView)); 44 | myRegionManager.RegisterViewWithRegion("ViewingRegion", typeof (TransparentView)); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /WPF/CAM.Tools/Helper/VisualTargetPresentationSource.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Windows; 18 | using System.Windows.Media; 19 | 20 | namespace CAM.Tools.Helper 21 | { 22 | public class VisualTargetPresentationSource : PresentationSource 23 | { 24 | private readonly VisualTarget myVisualTarget; 25 | 26 | public VisualTargetPresentationSource(HostVisual theHostVisual) 27 | { 28 | myVisualTarget = new VisualTarget(theHostVisual); 29 | } 30 | 31 | public override Visual RootVisual 32 | { 33 | get { return myVisualTarget.RootVisual; } 34 | 35 | set 36 | { 37 | var aOldRoot = myVisualTarget.RootVisual; 38 | 39 | // Set the root visual of the VisualTarget. This visual will 40 | // now be used to visually compose the scene. 41 | myVisualTarget.RootVisual = value; 42 | 43 | // Tell the PresentationSource that the root visual has 44 | // changed. This kicks off a bunch of stuff like the 45 | // Loaded event. 46 | RootChanged(aOldRoot, value); 47 | 48 | // Kickoff layout... 49 | var aRootElement = value as UIElement; 50 | if (aRootElement != null) 51 | { 52 | aRootElement.Measure(new Size(Double.PositiveInfinity, 53 | Double.PositiveInfinity)); 54 | aRootElement.Arrange(new Rect(aRootElement.DesiredSize)); 55 | } 56 | } 57 | } 58 | 59 | public override bool IsDisposed 60 | { 61 | get 62 | { 63 | // We don't support disposing this object. 64 | return false; 65 | } 66 | } 67 | 68 | protected override CompositionTarget GetCompositionTargetCore() 69 | { 70 | return myVisualTarget; 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /WPF/CAM.Tools/Helper/VisualWrapper.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Windows; 18 | using System.Windows.Markup; 19 | using System.Windows.Media; 20 | 21 | namespace CAM.Tools.Helper 22 | { 23 | /// 24 | /// Visual wrapper 25 | /// 26 | [ContentProperty("Child")] 27 | public class VisualWrapper : FrameworkElement 28 | { 29 | private Visual myChild; 30 | 31 | public Visual Child 32 | { 33 | get { return myChild; } 34 | 35 | set 36 | { 37 | if (myChild != null) 38 | { 39 | RemoveVisualChild(myChild); 40 | } 41 | 42 | myChild = value; 43 | 44 | if (myChild != null) 45 | { 46 | AddVisualChild(myChild); 47 | } 48 | } 49 | } 50 | 51 | protected override int VisualChildrenCount 52 | { 53 | get { return myChild != null ? 1 : 0; } 54 | } 55 | 56 | protected override Visual GetVisualChild(int theIndex) 57 | { 58 | if (myChild != null && theIndex == 0) 59 | { 60 | return myChild; 61 | } 62 | else 63 | { 64 | throw new ArgumentOutOfRangeException("theIndex"); 65 | } 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /WPF/CAM.Tools/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System.Reflection; 17 | using System.Runtime.InteropServices; 18 | 19 | // General Information about an assembly is controlled through the following 20 | // set of attributes. Change these attribute values to modify the information 21 | // associated with an assembly. 22 | 23 | [assembly: AssemblyTitle("CAM.Tools")] 24 | [assembly: AssemblyDescription("")] 25 | [assembly: AssemblyConfiguration("")] 26 | [assembly: AssemblyCompany("Hewlett-Packard")] 27 | [assembly: AssemblyProduct("CAM.Tools")] 28 | [assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2015")] 29 | [assembly: AssemblyTrademark("")] 30 | [assembly: AssemblyCulture("")] 31 | 32 | // Setting ComVisible to false makes the types in this assembly not visible 33 | // to COM components. If you need to access a type in this assembly from 34 | // COM, set the ComVisible attribute to true on that type. 35 | 36 | [assembly: ComVisible(false)] 37 | 38 | // The following GUID is for the ID of the typelib if this project is exposed to COM 39 | 40 | [assembly: Guid("4e291b0a-596a-40fb-8015-50be08c20555")] 41 | 42 | // Version information for an assembly consists of the following four values: 43 | // 44 | // Major Version 45 | // Minor Version 46 | // Build Number 47 | // Revision 48 | // 49 | // You can specify all the values or you can default the Build and Revision Numbers 50 | // by using the '*' as shown below: 51 | // [assembly: AssemblyVersion("1.0.*")] 52 | 53 | [assembly: AssemblyVersion("1.0.0.0")] 54 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /WPF/CAM.Tools/Resources/Close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Tools/Resources/Close.png -------------------------------------------------------------------------------- /WPF/CAM.Tools/Resources/Pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Tools/Resources/Pause.png -------------------------------------------------------------------------------- /WPF/CAM.Tools/Resources/Pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Tools/Resources/Pin.png -------------------------------------------------------------------------------- /WPF/CAM.Tools/Resources/Record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Tools/Resources/Record.png -------------------------------------------------------------------------------- /WPF/CAM.Tools/Resources/Reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Tools/Resources/Reset.png -------------------------------------------------------------------------------- /WPF/CAM.Tools/Resources/Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Tools/Resources/Settings.png -------------------------------------------------------------------------------- /WPF/CAM.Tools/Resources/Stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.Tools/Resources/Stop.png -------------------------------------------------------------------------------- /WPF/CAM.Tools/Views/SettingsView.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /WPF/CAM.Tools/Views/SettingsView.xaml.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | 18 | namespace CAM.Tools.Views 19 | { 20 | public interface ISettingsView : IDisposable 21 | { 22 | } 23 | 24 | /// 25 | /// Interaction logic for SettingsView.xaml 26 | /// 27 | public partial class SettingsView : ISettingsView 28 | { 29 | public SettingsView() 30 | { 31 | InitializeComponent(); 32 | } 33 | 34 | public void Dispose() 35 | { 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /WPF/CAM.Tools/Views/ToolsView.xaml.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System.Windows; 17 | using CAM.Tools.Helper; 18 | using CAM.Tools.ViewModel; 19 | 20 | namespace CAM.Tools.Views 21 | { 22 | /// 23 | /// Interaction logic for ToolsView.xaml 24 | /// 25 | public partial class ToolsView 26 | { 27 | private readonly VisualThreadedHelper myVisualThreadedHelper; 28 | 29 | public ToolsView(ToolsViewModel theViewModel) 30 | { 31 | InitializeComponent(); 32 | DataContext = theViewModel; 33 | 34 | myVisualThreadedHelper = new VisualThreadedHelper(); 35 | } 36 | 37 | private void OnLoadedToolsView(object theSender, RoutedEventArgs theE) 38 | { 39 | RecordTimer.Child = myVisualThreadedHelper.CreateThreadedLabelTimer(); 40 | } 41 | 42 | private void OnStartRecording(object theSender, RoutedEventArgs theArgs) 43 | { 44 | myVisualThreadedHelper.StartTimer(); 45 | } 46 | 47 | private void OnStopRecording(object theSender, RoutedEventArgs theArgs) 48 | { 49 | myVisualThreadedHelper.StopTimer(); 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /WPF/CAM.Tools/Views/TransparentView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /WPF/CAM.Tools/Views/TransparentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace CAM.Tools.Views 17 | { 18 | /// 19 | /// Interaction logic for TransparentView.xaml 20 | /// 21 | public partial class TransparentView : UserControl 22 | { 23 | public TransparentView() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WPF/CAM.Tools/Win32/Gdi32.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Runtime.InteropServices; 18 | 19 | namespace CAM.Tools.Win32 20 | { 21 | public static class Gdi32 22 | { 23 | [DllImport("gdi32.dll", EntryPoint = "DeleteObject")] 24 | public static extern IntPtr DeleteObject(IntPtr hDc); 25 | } 26 | } -------------------------------------------------------------------------------- /WPF/CAM.Tools/Win32/User32.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System; 17 | using System.Runtime.InteropServices; 18 | 19 | namespace CAM.Tools.Win32 20 | { 21 | public static class User32 22 | { 23 | public const Int32 CURSOR_SHOWING = 0x00000001; 24 | 25 | [DllImport("user32.dll")] 26 | public static extern bool GetCursorInfo(out CURSORINFO pci); 27 | 28 | [DllImport("user32.dll")] 29 | public static extern IntPtr CopyIcon(IntPtr hIcon); 30 | 31 | [DllImport("user32.dll")] 32 | public static extern bool DrawIcon(IntPtr hdc, int x, int y, IntPtr hIcon); 33 | 34 | [DllImport("user32.dll", CharSet = CharSet.Auto)] 35 | public static extern bool DestroyIcon(IntPtr handle); 36 | 37 | [DllImport("user32.dll")] 38 | public static extern bool GetIconInfo(IntPtr hIcon, out ICONINFO piconinfo); 39 | 40 | [StructLayout(LayoutKind.Sequential)] 41 | public struct CURSORINFO 42 | { 43 | public Int32 cbSize; 44 | public Int32 flags; 45 | public IntPtr hCursor; 46 | public POINT ptScreenPos; 47 | } 48 | 49 | [StructLayout(LayoutKind.Sequential)] 50 | public struct ICONINFO 51 | { 52 | public bool fIcon; 53 | public Int32 xHotspot; 54 | public Int32 yHotspot; 55 | public IntPtr hbmMask; 56 | public IntPtr hbmColor; 57 | } 58 | 59 | [StructLayout(LayoutKind.Sequential)] 60 | public struct POINT 61 | { 62 | public Int32 x; 63 | public Int32 y; 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /WPF/CAM.Tools/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/Extern/avcodec-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.VideoCodec.FFMPEG/Extern/avcodec-55.dll -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/Extern/avdevice-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.VideoCodec.FFMPEG/Extern/avdevice-55.dll -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/Extern/avfilter-4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.VideoCodec.FFMPEG/Extern/avfilter-4.dll -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/Extern/avformat-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.VideoCodec.FFMPEG/Extern/avformat-55.dll -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/Extern/avutil-52.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.VideoCodec.FFMPEG/Extern/avutil-52.dll -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/Extern/ffmpeg.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.VideoCodec.FFMPEG/Extern/ffmpeg.exe -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/Extern/ffplay.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.VideoCodec.FFMPEG/Extern/ffplay.exe -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/Extern/ffprobe.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.VideoCodec.FFMPEG/Extern/ffprobe.exe -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/Extern/postproc-52.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.VideoCodec.FFMPEG/Extern/postproc-52.dll -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/Extern/swresample-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.VideoCodec.FFMPEG/Extern/swresample-0.dll -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/Extern/swscale-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunhick/ScreenRecorder/e0ec6061adf27bfbcdde0402c91898602fd475f9/WPF/CAM.VideoCodec.FFMPEG/Extern/swscale-2.dll -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/FFMpegModule.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using CAM.VideoCodec.Interfaces; 17 | using log4net; 18 | using Microsoft.Practices.Prism.Modularity; 19 | using Microsoft.Practices.Unity; 20 | 21 | namespace CAM.VideoCodec.FFMPEG 22 | { 23 | // ReSharper disable once InconsistentNaming 24 | internal class FFMpegModule : IModule 25 | { 26 | private readonly ILog Log = LogManager.GetLogger(typeof (FFMpegModule)); 27 | private readonly IUnityContainer myContainer; 28 | 29 | public FFMpegModule(IUnityContainer theContainer) 30 | { 31 | myContainer = theContainer; 32 | } 33 | 34 | public void Initialize() 35 | { 36 | Log.Info("Initialize FFMpeg Module"); 37 | var aFfMpegEncoder = new FFMpegEncoder(); 38 | myContainer.RegisterInstance(aFfMpegEncoder, new ContainerControlledLifetimeManager()); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System.Reflection; 17 | using System.Runtime.InteropServices; 18 | 19 | // General Information about an assembly is controlled through the following 20 | // set of attributes. Change these attribute values to modify the information 21 | // associated with an assembly. 22 | 23 | [assembly: AssemblyTitle("CAM.VideoCodec.FFMPEG")] 24 | [assembly: AssemblyDescription("")] 25 | [assembly: AssemblyConfiguration("")] 26 | [assembly: AssemblyCompany("Hewlett-Packard")] 27 | [assembly: AssemblyProduct("CAM.VideoCodec.FFMPEG")] 28 | [assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2015")] 29 | [assembly: AssemblyTrademark("")] 30 | [assembly: AssemblyCulture("")] 31 | 32 | // Setting ComVisible to false makes the types in this assembly not visible 33 | // to COM components. If you need to access a type in this assembly from 34 | // COM, set the ComVisible attribute to true on that type. 35 | 36 | [assembly: ComVisible(false)] 37 | 38 | // The following GUID is for the ID of the typelib if this project is exposed to COM 39 | 40 | [assembly: Guid("ed2c5ac8-69d3-4559-aee8-92aaf2104732")] 41 | 42 | // Version information for an assembly consists of the following four values: 43 | // 44 | // Major Version 45 | // Minor Version 46 | // Build Number 47 | // Revision 48 | // 49 | // You can specify all the values or you can default the Build and Revision Numbers 50 | // by using the '*' as shown below: 51 | // [assembly: AssemblyVersion("1.0.*")] 52 | 53 | [assembly: AssemblyVersion("1.0.0.0")] 54 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.FFMPEG/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.Interfaces/CAM.VideoCodec.Interfaces.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {5E170C42-D6BB-4C17-938B-A968821C64F6} 8 | Library 9 | Properties 10 | CAM.VideoCodec.Interfaces 11 | CAM.VideoCodec.Interfaces 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | true 34 | ..\bin\x64\Debug\ 35 | DEBUG;TRACE 36 | full 37 | x64 38 | prompt 39 | MinimumRecommendedRules.ruleset 40 | ..\bin\x64\Debug\CAM.VideoCodec.Interfaces.XML 41 | 42 | 43 | ..\bin\x64\Release\ 44 | TRACE 45 | true 46 | pdbonly 47 | x64 48 | prompt 49 | MinimumRecommendedRules.ruleset 50 | ..\bin\x64\Release\CAM.VideoCodec.Interfaces.XML 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | {033C00D7-1510-462C-B67A-6C14C09905FE} 68 | CAM.Common 69 | 70 | 71 | 72 | 79 | -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.Interfaces/IFFMpegEncoder.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using CAM.Common; 17 | 18 | namespace CAM.VideoCodec.Interfaces 19 | { 20 | /// 21 | /// FFMpeg encoder interface 22 | /// 23 | // ReSharper disable once InconsistentNaming 24 | public interface IFFMpegEncoder 25 | { 26 | string Encode(EncoderInfo theEncoderInfo); 27 | } 28 | } -------------------------------------------------------------------------------- /WPF/CAM.VideoCodec.Interfaces/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // This file is part of ScreenRecorder 2 | // 3 | // ScreenRecorder is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 3 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // ScreenRecorder is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with ScreenRecorder. If not, see . 15 | 16 | using System.Reflection; 17 | using System.Runtime.InteropServices; 18 | 19 | // General Information about an assembly is controlled through the following 20 | // set of attributes. Change these attribute values to modify the information 21 | // associated with an assembly. 22 | 23 | [assembly: AssemblyTitle("CAM.VideoCodec.Interfaces")] 24 | [assembly: AssemblyDescription("")] 25 | [assembly: AssemblyConfiguration("")] 26 | [assembly: AssemblyCompany("Hewlett-Packard")] 27 | [assembly: AssemblyProduct("CAM.VideoCodec.Interfaces")] 28 | [assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2015")] 29 | [assembly: AssemblyTrademark("")] 30 | [assembly: AssemblyCulture("")] 31 | 32 | // Setting ComVisible to false makes the types in this assembly not visible 33 | // to COM components. If you need to access a type in this assembly from 34 | // COM, set the ComVisible attribute to true on that type. 35 | 36 | [assembly: ComVisible(false)] 37 | 38 | // The following GUID is for the ID of the typelib if this project is exposed to COM 39 | 40 | [assembly: Guid("9aa4dc6c-3e08-4c0a-b17b-4c5f6c67d61b")] 41 | 42 | // Version information for an assembly consists of the following four values: 43 | // 44 | // Major Version 45 | // Minor Version 46 | // Build Number 47 | // Revision 48 | // 49 | // You can specify all the values or you can default the Build and Revision Numbers 50 | // by using the '*' as shown below: 51 | // [assembly: AssemblyVersion("1.0.*")] 52 | 53 | [assembly: AssemblyVersion("1.0.0.0")] 54 | [assembly: AssemblyFileVersion("1.0.0.0")] --------------------------------------------------------------------------------