├── .gitignore ├── LICENSE ├── Model ├── Alert.cs ├── Alert │ ├── IEmailAlertService.cs │ └── TextEmailAlertService.cs ├── AppSettings.cs ├── Camera.cs ├── CameraNameView.cs ├── Hint.cs ├── Locale.cs ├── Locales │ ├── en.txt │ ├── fr.txt │ ├── pl.txt │ ├── ru.txt │ ├── sp.txt │ └── zh_cn.txt ├── Model.csproj ├── Properties │ └── AssemblyInfo.cs └── Settings │ ├── ISettingsService.cs │ └── XmlFileSettingsService.cs ├── Presenter ├── Common │ ├── ApplicationController.cs │ ├── BasePresener.cs │ ├── BasePresenterControl.cs │ ├── IApplicationController.cs │ ├── IContainer.cs │ ├── IPresenter.cs │ ├── IPresenterControl.cs │ ├── IView.cs │ └── IViewControl.cs ├── Presenter.csproj ├── Presenters │ ├── AlertSetupPresenter.cs │ ├── MainPresenter.cs │ ├── MatrixSetupPresenter.cs │ ├── ModifySettingsPresenter.cs │ ├── ModifySourcePresenter.cs │ ├── NameViewSetupPresener.cs │ ├── PlayerControlPresenter.cs │ ├── PlayerPresenter.cs │ ├── SourceGridPresenter.cs │ ├── SourceListPresenter.cs │ └── SourcePresenter.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx └── Views │ ├── IAlertSetupView.cs │ ├── IMainView.cs │ ├── IMatrixSetupView.cs │ ├── IModifySettingsView.cs │ ├── IModifySourceView.cs │ ├── INameViewSetupView.cs │ ├── IPlayerControlView.cs │ ├── IPlayerView.cs │ ├── ISourceGridView.cs │ ├── ISourceListView.cs │ └── ISourceView.cs ├── README.md ├── Tests ├── MainPresenterTests.cs ├── Properties │ └── AssemblyInfo.cs ├── Tests.csproj └── packages.config ├── View ├── AlertSetupForm.Designer.cs ├── AlertSetupForm.cs ├── AlertSetupForm.resx ├── Components │ ├── ModifySettingsControl.Designer.cs │ ├── ModifySettingsControl.cs │ ├── ModifySettingsControl.resx │ ├── ModifySourceControl.Designer.cs │ ├── ModifySourceControl.cs │ ├── ModifySourceControl.resx │ ├── PlayerControlControl.Designer.cs │ ├── PlayerControlControl.cs │ ├── SourceControl.Designer.cs │ ├── SourceControl.cs │ ├── SourceControl.resx │ ├── SourceGridControl.Designer.cs │ ├── SourceGridControl.cs │ ├── SourceGridControl.resx │ ├── SourceListControl.Designer.cs │ ├── SourceListControl.cs │ └── SourceListControl.resx ├── LightInjectAdapter.cs ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── MatrixSetupForm.Designer.cs ├── MatrixSetupForm.cs ├── MatrixSetupForm.resx ├── NameViewSetupForm.Designer.cs ├── NameViewSetupForm.cs ├── NameViewSetupForm.resx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── View.csproj ├── app.config ├── appicon-1.ico ├── formicon-1.ico ├── ico │ ├── appicon-1.ai │ ├── appicon-1.ico │ ├── appicon-1.png │ ├── btn-close.png │ ├── btn-eject.png │ ├── btn-maximize.png │ ├── btn-minimize.png │ ├── btn-options.png │ ├── btn-play.png │ ├── btn-stop.png │ ├── btn-vol-minus.png │ ├── btn-vol-plus.png │ ├── btn-wait.png │ ├── cam1.png │ ├── cam2.png │ ├── cameras-set.png │ └── icon-set.png └── packages.config ├── ViewVlc215 ├── AxInterop.AXVLC.dll ├── Interop.AXVLC.dll ├── Player.cs ├── Properties │ └── AssemblyInfo.cs └── ViewVlc215.csproj └── rtsp-camera-view.sln /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | [Bb]in/ 3 | [Oo]bj/ 4 | 5 | # mstest test results 6 | TestResults 7 | 8 | ## Ignore Visual Studio temporary files, build results, and 9 | ## files generated by popular Visual Studio add-ons. 10 | 11 | # User-specific files 12 | *.suo 13 | *.user 14 | *.sln.docstates 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Rr]elease/ 19 | x64/ 20 | *_i.c 21 | *_p.c 22 | *.ilk 23 | *.meta 24 | *.obj 25 | *.pch 26 | *.pdb 27 | *.pgc 28 | *.pgd 29 | *.rsp 30 | *.sbr 31 | *.tlb 32 | *.tli 33 | *.tlh 34 | *.tmp 35 | *.log 36 | *.vspscc 37 | *.vssscc 38 | .builds 39 | 40 | # Visual C++ cache files 41 | ipch/ 42 | *.aps 43 | *.ncb 44 | *.opensdf 45 | *.sdf 46 | 47 | # Visual Studio profiler 48 | *.psess 49 | *.vsp 50 | *.vspx 51 | 52 | # Guidance Automation Toolkit 53 | *.gpState 54 | 55 | # ReSharper is a .NET coding add-in 56 | _ReSharper* 57 | 58 | # NCrunch 59 | *.ncrunch* 60 | .*crunch*.local.xml 61 | 62 | # Installshield output folder 63 | [Ee]xpress 64 | 65 | # DocProject is a documentation generator add-in 66 | DocProject/buildhelp/ 67 | DocProject/Help/*.HxT 68 | DocProject/Help/*.HxC 69 | DocProject/Help/*.hhc 70 | DocProject/Help/*.hhk 71 | DocProject/Help/*.hhp 72 | DocProject/Help/Html2 73 | DocProject/Help/html 74 | 75 | # Click-Once directory 76 | publish 77 | 78 | # Publish Web Output 79 | *.Publish.xml 80 | 81 | # NuGet Packages Directory 82 | packages 83 | 84 | # Windows Azure Build Output 85 | csx 86 | *.build.csdef 87 | 88 | # Windows Store app package directory 89 | AppPackages/ 90 | 91 | # Others 92 | [Bb]in 93 | [Oo]bj 94 | sql 95 | TestResults 96 | [Tt]est[Rr]esult* 97 | *.Cache 98 | ClientBin 99 | [Ss]tyle[Cc]op.* 100 | ~$* 101 | *.dbmdl 102 | Generated_Code #added for RIA/Silverlight projects 103 | 104 | # Backup & report files from converting an old project file to a newer 105 | # Visual Studio version. Backup files are not needed, because we have git ;-) 106 | _UpgradeReport_Files/ 107 | Backup*/ 108 | UpgradeLog*.XML 109 | 110 | # Visual Studio temp something 111 | .vs/ 112 | -------------------------------------------------------------------------------- /Model/Alert.cs: -------------------------------------------------------------------------------- 1 | using System.Xml.Serialization; 2 | 3 | namespace Model 4 | { 5 | public class Alert 6 | { 7 | public EmailAlert email = new EmailAlert(); 8 | 9 | public void SaveTo(Alert alert) 10 | { 11 | email.SaveTo(alert.email); 12 | } 13 | public bool Equals(Alert alert) 14 | { 15 | return email.Equals(alert.email); 16 | } 17 | } 18 | 19 | public class EmailAlert 20 | { 21 | public int whenDissapearMin = 30; 22 | [XmlIgnore] 23 | public bool onSignalLost = false; 24 | [XmlElement("onSignalLost")] 25 | public int OnSignalLostBit 26 | { 27 | get => onSignalLost ? 1 : 0; 28 | set => onSignalLost = value == 1; 29 | } 30 | [XmlIgnore] 31 | public bool onSignalRecover = false; 32 | [XmlElement("onSignalRecover")] 33 | public int OnSignalRecoverBit 34 | { 35 | get => onSignalRecover ? 1 : 0; 36 | set => onSignalRecover = value == 1; 37 | } 38 | public string serverUrl = "gmail.com"; 39 | public int serverPort = 587; 40 | public string emailFrom = "noreply-alert@rtsp-camera-view.app"; 41 | public string emailTo = ""; 42 | public string authUser = ""; 43 | public string authPassword = ""; 44 | 45 | public void SaveTo(EmailAlert alert) 46 | { 47 | alert.serverPort = this.serverPort; 48 | alert.emailFrom = this.emailFrom; 49 | alert.onSignalLost = this.onSignalLost; 50 | alert.whenDissapearMin = this.whenDissapearMin; 51 | alert.authPassword = this.authPassword; 52 | alert.onSignalRecover = this.onSignalRecover; 53 | alert.serverUrl = this.serverUrl; 54 | alert.emailTo = this.emailTo; 55 | alert.authUser = this.authUser; 56 | } 57 | public bool Equals(EmailAlert alert) 58 | { 59 | return (alert.serverPort == this.serverPort) && 60 | (alert.emailFrom == this.emailFrom) && 61 | (alert.onSignalLost == this.onSignalLost) && 62 | (alert.whenDissapearMin == this.whenDissapearMin) && 63 | (alert.authPassword == this.authPassword) && 64 | (alert.onSignalRecover == this.onSignalRecover) && 65 | (alert.serverUrl == this.serverUrl) && 66 | (alert.emailTo == this.emailTo) && 67 | (alert.authUser == this.authUser); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Model/Alert/IEmailAlertService.cs: -------------------------------------------------------------------------------- 1 | namespace Model 2 | { 3 | public interface IEmailAlertService 4 | { 5 | void SetSettings(Alert alert); 6 | 7 | void SendAlert(string header, string text); 8 | 9 | void SendAlertRecover(string header, string text); 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Model/Alert/TextEmailAlertService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Net.Mail; 4 | 5 | namespace Model 6 | { 7 | public class TextEmailAlertService : IEmailAlertService 8 | { 9 | private EmailAlert _config = null; 10 | 11 | public void SetSettings(Alert alert) 12 | { 13 | _config = alert.email; 14 | } 15 | 16 | public void SendAlert(string header, string text) 17 | { 18 | SendEmail(header, text); 19 | } 20 | 21 | public void SendAlertRecover(string header, string text) 22 | { 23 | SendEmail(header, text); 24 | } 25 | 26 | private void SendEmail(string subject, string body) 27 | { 28 | if (_config == null) throw new NullReferenceException( 29 | "EmailAlertService.SendEmail: Settings was not set. Cannot send letter." + 30 | "\n\nSubject:\n" + subject + "\n\nBody:\n" + body); 31 | try 32 | { 33 | MailMessage mail = new MailMessage() 34 | { 35 | From = new MailAddress(_config.emailFrom), 36 | Subject = subject + " [rtsp-camera-view]", 37 | Body = body + "\n\n\nThis message was sent by rtsp-camera-view\nhttps://github.com/grigory-lobkov/rtsp-camera-view", 38 | }; 39 | mail.To.Add(new MailAddress(_config.emailTo)); 40 | //if (!string.IsNullOrEmpty(attachFile)) mail.Attachments.Add(new Attachment(attachFile)); 41 | SmtpClient client = new SmtpClient() 42 | { 43 | Host = _config.serverUrl, 44 | Port = _config.serverPort, 45 | EnableSsl = _config.serverPort != 25, 46 | UseDefaultCredentials = String.IsNullOrEmpty(_config.authUser), 47 | DeliveryMethod = SmtpDeliveryMethod.Network, 48 | Timeout = 30000, 49 | }; 50 | if (!client.UseDefaultCredentials) 51 | { 52 | client.Credentials = new NetworkCredential(_config.authUser, _config.authPassword); 53 | } 54 | client.Send(mail); 55 | mail.Dispose(); 56 | } 57 | catch (Exception e) 58 | { 59 | throw new Exception("TextEmailAlertService.SendEmail:\n" + e.GetType() + "\n" + e.Message + 60 | "\n\nSubject:\n" + subject + "\n\nBody:\n" + body); 61 | } 62 | } 63 | 64 | 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Model/AppSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Serialization; 3 | 4 | namespace Model 5 | { 6 | [XmlRoot(ElementName = "appSettings")] 7 | public class AppSettings 8 | { 9 | public int screen = -1; // screen number to open window on start 10 | public int fullscreen = 0; // fullscreen: 0-no, 1-yes 11 | public int maximize = 0; // expand window: 0-no, 1-yes 12 | public int autoplay = 1; // auto start all sources: 0-no, 1-auto play 13 | [XmlIgnore] 14 | public int autoplay_now = -1; // runtime(can be set by command line) 15 | public int priority = -1; // application base priority: 0-Idle, 1-BelowNormal, 2-Normal, 3-AboveNormal, 4-High 16 | public int unmute = 0; // do not mute audio: 0-silent, 1-enable sounds 17 | [XmlIgnore] 18 | public int unmute_now = -1; // runtime(can be set by command line) 19 | public int controlPanelWidth = 250; // width of control panel 20 | public int camListView = 1; // cameras list type of view (1-4:largeIcon/smallIcon/largeList/smallList) 21 | public int camListSort = 3; // cameras list sort type (1-3:asc/desc/none) 22 | 23 | public Matrix matrix = new Matrix(); // matrix parameters (rows and columns count) 24 | public NameView nameView = new NameView(); // camera name show global option 25 | public Alert alert = new Alert(); // alert messages 26 | 27 | [XmlArrayItem(ElementName = "cam", Type = typeof(Camera))] 28 | public Camera[] cams; 29 | 30 | [XmlIgnore] 31 | public Hint hint; 32 | } 33 | 34 | public class Matrix 35 | { 36 | public int cntX = 2; 37 | public int cntY = 2; 38 | public void SaveTo(Matrix m) 39 | { 40 | m.cntX = cntX; 41 | m.cntY = cntY; 42 | m.joins = new MatrixJoin[joins.Length]; 43 | Array.Copy(joins, m.joins, joins.Length); 44 | } 45 | public bool Equals(Matrix m) 46 | { 47 | if ((m.cntX == cntX) && (m.cntY == cntY) && ( 48 | m.joins == joins || joins != null && m.joins != null && joins.Length == m.joins.Length 49 | )) 50 | { 51 | int i = joins.Length - 1; 52 | for (; i >= 0; i--) 53 | if (!joins[i].Equals(m.joins[i])) break; 54 | if (i < 0) return true; 55 | } 56 | return false; 57 | } 58 | [XmlArrayItem(ElementName = "join", Type = typeof(MatrixJoin))] 59 | public MatrixJoin[] joins = { }; 60 | } 61 | public class MatrixJoin 62 | { 63 | public int x; 64 | public int y; 65 | public int w; 66 | public int h; 67 | public MatrixJoin() { } 68 | public MatrixJoin(int X, int Y, int W, int H) 69 | { 70 | x = X; 71 | y = Y; 72 | w = W; 73 | h = H; 74 | } 75 | public void SaveTo(MatrixJoin j) 76 | { 77 | j.x = x; 78 | j.y = y; 79 | j.w = w; 80 | j.h = h; 81 | } 82 | public bool Equals(MatrixJoin j) 83 | { 84 | return (j.x == x) && (j.y == y) && (j.w == w) && (j.h == h); 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /Model/Camera.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Serialization; 3 | 4 | namespace Model 5 | { 6 | public class Camera 7 | { 8 | public string name = ""; // name of camera 9 | public string rtspBad = ""; // url to stream with low resolution 10 | public string rtspGood = ""; // url to good stream 11 | public string aspectRatio = "16:9"; // camera aspect ratio 12 | public int camIcon = 1; // camera icon in the list 13 | public int position = -1; // camera position in the grid (-1-nowhere) 14 | public int goodOnlyInFullview = 0; // show good RTSP only when in fullview mode (0-disabled, 1-enabled) 15 | 16 | [XmlIgnore] 17 | public Action Edit; 18 | 19 | public NameView nameView = new NameView(); // name show parameters 20 | } 21 | } -------------------------------------------------------------------------------- /Model/CameraNameView.cs: -------------------------------------------------------------------------------- 1 | using System.Xml.Serialization; 2 | using System.Drawing; 3 | 4 | namespace Model 5 | { 6 | //public enum NamePosition { TopLeft = 1, TopCenter = 2, TopRight = 3, BottomLeft = 4, BottomCenter = 5, BottomRight = 6 }; 7 | public enum TextPosition { TopLeft = 1, TopCenter = 2, TopRight = 3, MiddleLeft = 4, MiddleCenter = 5, MiddleRight = 6, BottomLeft = 7, BottomCenter = 8, BottomRight = 9 }; 8 | 9 | public class NameView 10 | { 11 | public bool enabled = true; 12 | public bool inheritGlobal = true; 13 | public TextPosition position = TextPosition.BottomCenter; 14 | [XmlIgnore] 15 | public Color color = Color.White; 16 | [XmlElement("color")] 17 | public int colorAsArgb 18 | { 19 | get { return color.ToArgb(); } 20 | set { color = Color.FromArgb(value); } 21 | } 22 | public int size = 5; 23 | public bool autoHide = false; 24 | public int autoHideSec = 4; 25 | public bool paintBg = true; 26 | [XmlIgnore] 27 | public Color bgColor = Color.ForestGreen; 28 | [XmlElement("bgColor")] 29 | public int bgColorAsArgb 30 | { 31 | get { return bgColor.ToArgb(); } 32 | set { bgColor = Color.FromArgb(value); } 33 | } 34 | 35 | public void SaveTo(NameView nv) 36 | { 37 | nv.autoHide = autoHide; 38 | nv.autoHideSec = autoHideSec; 39 | nv.bgColor = bgColor; 40 | nv.color = color; 41 | nv.enabled = enabled; 42 | nv.inheritGlobal = inheritGlobal; 43 | nv.paintBg = paintBg; 44 | nv.position = position; 45 | nv.size = size; 46 | } 47 | public bool Equals(NameView nv) 48 | { 49 | return (nv.autoHide == this.autoHide) && 50 | (nv.autoHideSec == this.autoHideSec) && 51 | (nv.bgColor == this.bgColor) && 52 | (nv.color == this.color) && 53 | (nv.enabled == this.enabled) && 54 | (nv.inheritGlobal == this.inheritGlobal) && 55 | (nv.paintBg == this.paintBg) && 56 | (nv.position == this.position) && 57 | (nv.size == this.size); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /Model/Hint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Model 4 | { 5 | 6 | public enum HintType { None = 0, OpenCtrl = 1, AddCamera = 2, DropCamera = 3, NewRtspBad = 5, NewRtspGood = 6 }; 7 | 8 | public class Hint 9 | { 10 | public HintType lastType = HintType.None; 11 | private bool lastHidden = true; 12 | public Action onShow; 13 | public Action onHide; 14 | public void Show(HintType hintType) 15 | { 16 | if (lastType != hintType && !lastHidden) Hide(lastType); 17 | lastType = hintType; 18 | onShow?.Invoke(); 19 | lastHidden = false; 20 | } 21 | public void Hide(HintType hintType = HintType.None) 22 | { 23 | if (lastHidden) return; 24 | //if (lastType != hintType) Hide(lastType); 25 | onHide?.Invoke(); 26 | lastHidden = true; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Model/Locale.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading; 4 | using System.Globalization; 5 | using System.IO; 6 | 7 | namespace Model 8 | { 9 | // Singleton pattern: 10 | /*public sealed class Singleton 11 | { 12 | private static readonly Object s_lock = new Object(); 13 | private static Singleton instance = null; 14 | 15 | private Singleton() 16 | { 17 | } 18 | 19 | public static Singleton Instance 20 | { 21 | get 22 | { 23 | if (instance != null) return instance; 24 | Monitor.Enter(s_lock); 25 | Singleton temp = new Singleton(); 26 | Interlocked.Exchange(ref instance, temp); 27 | Monitor.Exit(s_lock); 28 | return instance; 29 | } 30 | } 31 | }*/ 32 | // Singleton class 33 | public sealed class Locale 34 | { 35 | private static readonly Object s_lock = new Object(); 36 | private static Locale instance = null; 37 | 38 | private string[] keys; 39 | private string[] values; 40 | private const int maxKeys = 100; 41 | private const string localesPath = "Locales/"; 42 | private const string localesExt = ".txt"; 43 | 44 | private Locale() // init 45 | { 46 | string culture = CultureInfo.CurrentCulture.Name; 47 | ReadLocaleFile(culture, out string[] k1, out string[] v1, out int c1); 48 | 49 | string[] k2 = null, v2 = null; 50 | int c2 = 0; 51 | string[] lang = culture.Split(new Char[] { '-' }, 2); 52 | if (lang.Count() > 1) 53 | { 54 | k2 = new string[maxKeys]; 55 | v2 = new string[maxKeys]; 56 | ReadLocaleFile(lang[0], out k2, out v2, out c2); 57 | } 58 | if (c1 == 0 && c2 == 0) 59 | { 60 | keys = new string[0]; 61 | values = new string[0]; 62 | } 63 | else if (c2 == 0) 64 | { 65 | FillArray(c1, k1, v1); 66 | } 67 | else if (c1 == 0) 68 | { 69 | FillArray(c2, k2, v2); 70 | } 71 | else 72 | { 73 | int i1, i2; 74 | for (i2 = 0; i2 < c2; i2++) 75 | for (i1 = 0; i1 < c1; i1++) 76 | if (k1[i1] == k2[i2]) 77 | { 78 | k2[i2] = ""; 79 | break; 80 | } 81 | for (i2 = 0; i2 < c2; i2++) 82 | if (k2[i2] != "") 83 | { 84 | k1[c1] = k2[i2]; 85 | v1[c1] = v2[i2]; 86 | c1++; 87 | if (c1 >= maxKeys) throw new Exception("Count of params in " + culture 88 | + " and " + lang[0] + " is greater than maximum (" + maxKeys + ")"); 89 | } 90 | FillArray(c1, k1, v1); 91 | } 92 | } 93 | 94 | private void FillArray(int c, string[] k, string[] v) 95 | { 96 | keys = new string[c]; 97 | values = new string[c]; 98 | for (int i = 0; i < c; i++) 99 | { 100 | keys[i] = k[i]; 101 | values[i] = v[i].Replace("\\n","\n"); 102 | } 103 | } 104 | 105 | private void ReadLocaleFile(string file_name, out string[] keys, out string[] values, out int count) 106 | { 107 | count = 0; 108 | string fn = localesPath + file_name + localesExt; 109 | if (File.Exists(fn)) 110 | { 111 | keys = new string[maxKeys]; 112 | values = new string[maxKeys]; 113 | using (StreamReader sr = File.OpenText(fn)) 114 | { 115 | string s = ""; 116 | while ((s = sr.ReadLine()) != null) 117 | { 118 | if (s != "" && s[0] >= 'A' && s[0] <= 'z') 119 | { 120 | string[] t = s.Split(new Char[] { '=' }, 2); 121 | if (t.Count() == 2) 122 | { 123 | if (count >= maxKeys) throw new Exception("Count of params in Locale file " 124 | + fn + " is greater than maximum (" + maxKeys + ")"); 125 | keys[count] = t[0].Trim(); 126 | values[count] = t[1].Trim(); 127 | count++; 128 | } 129 | } 130 | } 131 | sr.Close(); 132 | } 133 | } 134 | else 135 | { 136 | keys = new string[0]; 137 | values = new string[0]; 138 | } 139 | } 140 | 141 | public string Get(string key) 142 | { 143 | for (int i = keys.Count() - 1; i >= 0; i--) 144 | { 145 | if (keys[i] == key) return values[i]; 146 | } 147 | return ""; 148 | } 149 | 150 | public static Locale Instance 151 | { 152 | get 153 | { 154 | if (instance != null) return instance; 155 | Monitor.Enter(s_lock); 156 | Locale temp = new Locale(); 157 | Interlocked.Exchange(ref instance, temp); 158 | Monitor.Exit(s_lock); 159 | return instance; 160 | } 161 | } 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /Model/Locales/en.txt: -------------------------------------------------------------------------------- 1 | # Translated to English by Gregory Lobkov 2 | # https://github.com/grigory-lobkov 3 | ##### Main 4 | 5 | # Control panel tab names 6 | Main/sourcesPage = Sources 7 | Main/settingsPage = Settings 8 | 9 | # Question to add some examples 10 | Main/AskAddSamples = Would you like to add sample cameras to your sources? 11 | 12 | # Error messages 13 | Main/CreateGridCommonError = Error creating players grid 14 | Main/CreateGridNoLibError = Can't find VLC and/or ActiveX Web-plugin installed 15 | Main/CreateGridBadVerError = Please, check your VLC version is 2.1.x 16 | Main/CreateGridEndError = Please, install VLC 2.1.x with ActiveX Web-module to the default\ninstallation folder ''Program Files (x86)'' or ''Program Files''\n\nYou can download VLC here:\n{url}\n\nWould you like to download VLC now? 17 | 18 | # Settings file errors 19 | Main/SettingsSaveError = Error saving settings file 20 | Main/SettingsLoadError = Error loading settings file 21 | Main/SettingsAccesError = Error accessing settings file, your work won't be saved 22 | 23 | # Hint messages 24 | Main/hintOpenCtrl = Open control panel to Add/View\navailable cameras 25 | Main/hintAddCamera = Right-click on this area to Add\nnew camera 26 | Main/hintDropCamera = Drag camera by mouse left-button\nand drop somewhere on grid here 27 | Main/hintRTSP1 = Bad RTSP connect string, which\nproduces minimal network load.\nTo show in small windows. 28 | Main/hintRTSP2 = Good RTSP connect string, which\nproduces high network load.\nTo show in big windows.\nSwiching between RTSPs is automated. 29 | 30 | # Context menu 31 | Main/fullScreenMenuItem = Full screen 32 | Main/exitFullScreenMenuItem = Exit Full screen 33 | 34 | 35 | 36 | ##### SourceList 37 | 38 | # Typeview submenu 39 | SourceList/typeViewToolStripMenuItem = Type View 40 | SourceList/largeIconsToolStripMenuItem = Large Icons 41 | SourceList/smallIconsToolStripMenuItem = Small Icons 42 | SourceList/largeListToolStripMenuItem = Large List 43 | SourceList/smallListToolStripMenuItem = Small List 44 | 45 | # Sort submenu 46 | SourceList/sortTypeToolStripMenuItem = Sorting 47 | SourceList/ascendingToolStripMenuItem = Ascending 48 | SourceList/descendingToolStripMenuItem = Descending 49 | SourceList/disabledToolStripMenuItem = Disabled 50 | 51 | # Actions 52 | SourceList/newCameraToolStripMenuItem = New Camera 53 | SourceList/modifyCameraToolStripMenuItem = Modify Camera 54 | 55 | 56 | 57 | ##### ModifySettings 58 | 59 | ModifySettings/camNameViewGlbButton = Camera name display 60 | ModifySettings/alertSetupButton = Alert control 61 | ModifySettings/matrixSetupButton = Matrix dimensions 62 | ModifySettings/commandLineHelpButton = Command Line parameters help 63 | ModifySettings/commandLineHelp = Program actions, while start\n\nRtspCameraView.exe [fullscreen] [screen=N] [autoplay] [unmute] [priority=N]\n\n fullscreen - hide taskbar and app name\n screen=N - move window to screen number N (0,1,2,...)\n maximize - maximize window\n autoplay - automatically play positioned cameras\n unmute - unmute sound, if it exist on start playing\n priority=N - change program priority, N:\n 0 - Idle\n 1 - Below Normal\n 2 - Normal\n 3 - Above Normal\n 4 - High 64 | ModifySettings/githubLinkLabel = Visit project page 65 | 66 | 67 | 68 | ##### ModifySource 69 | 70 | ModifySource/camNameLabel = Camera name 71 | ModifySource/camName = Place of mount, view area, e.t.c. 72 | ModifySource/camNameShow = show 73 | ModifySource/camNameInherit = inherit global 74 | ModifySource/camNameModify = modify... 75 | ModifySource/camEditRtsp1Label = Bad quality RTSP connect string 76 | ModifySource/rtspBad = Ask camera vendor. Examples:\nrtsp://admin:1111@192.168.1.3/live/sub\nrtsp://192.168.1.4:554/av0_1&user=admin&password=1111 77 | ModifySource/camEditRtsp2Label = Good quality RTSP connect string 78 | ModifySource/rtspGood = Ask camera vendor. Examples:\nrtsp://admin:1111@192.168.1.3/live/main\nrtsp://192.168.1.4:554/av0_0&user=admin&password=1111 79 | ModifySource/camEditIconLabel = Camera icon 80 | ModifySource/aspectRatioLabel = Aspect ratio 81 | ModifySource/aspectRatio = 82 | ModifySource/createCamButton = Create 83 | ModifySource/saveCamButton = Save 84 | ModifySource/cancelCamButton = Cancel 85 | ModifySource/delCamLabel = Delete camera 86 | ModifySource/cameraDeleteConfirm1 = Do you really want to delete camera 87 | ModifySource/cameraDeleteConfirm2 = You are watching this camera now. Are you sure? 88 | ModifySource/rtspGoodOnlyInFullview = show only when in fullview mode 89 | 90 | 91 | ##### NameViewSetup 92 | 93 | NameViewSetup/this = Source name view setup 94 | NameViewSetup/positioningLabel = Positioning 95 | NameViewSetup/camNameLabel = Name 96 | NameViewSetup/textColorLabel = Text color 97 | NameViewSetup/backgroundCheckBox = Background 98 | NameViewSetup/textSizeLabel = Text size 99 | NameViewSetup/autoHideCheckBox = Hide automatically 100 | NameViewSetup/okButton = Ok 101 | NameViewSetup/cancelButton = Cancel 102 | 103 | 104 | 105 | ##### SourceGrid 106 | 107 | SourceGrid/EmailOnLostSignalTitle = {name} LOST link 108 | SourceGrid/EmailOnLostSignalSubject = Signal of {name} is lost\n\nBad stream url:\n{bad}\n\nGood stream url:\n{good}\n\n 109 | SourceGrid/EmailOnRestoreSignalTitle = {name} recovered link 110 | SourceGrid/EmailOnRestoreSignalSubject = Signal of {name} is recovered\n\nBad stream url:\n{bad}\n\nGood stream url:\n{good}\n\n 111 | 112 | 113 | 114 | ##### MatrixSetup 115 | 116 | MatrixSetup/this = Customize view matrix 117 | MatrixSetup/joinButton = Join 118 | MatrixSetup/splitButton = Split 119 | MatrixSetup/saveButton = Save 120 | MatrixSetup/cancelButton = Cancel 121 | 122 | 123 | 124 | ##### AlertSetup 125 | 126 | # Email page 127 | AlertSetup/emailPage = Email 128 | AlertSetup/emLostCheckBox = When connection is lost for (min) 129 | AlertSetup/emRecoverCheckBox = When connection is recovered 130 | AlertSetup/emToLabel = To 131 | AlertSetup/emFromLabel = From 132 | 133 | # Mail server setup 134 | AlertSetup/emServerGroupBox = Mail server 135 | AlertSetup/emNameLabel = Name 136 | AlertSetup/emPortLabel = Port 137 | AlertSetup/emTestLinkLabel = Send test letter 138 | AlertSetup/emUsernameLabel = Username 139 | AlertSetup/emPasswordLabel = Password 140 | 141 | # Common 142 | AlertSetup/this = Lost stream alert setup 143 | AlertSetup/okButton = Ok 144 | AlertSetup/cancelButton = Cancel 145 | AlertSetup/testTitle = Alert test 146 | AlertSetup/testText = Congratulations!\nYour settings are working! -------------------------------------------------------------------------------- /Model/Locales/pl.txt: -------------------------------------------------------------------------------- 1 | # Translated to Polish by Michal, ATMEL 2 | ##### Main 3 | 4 | # Control panel tab names 5 | Main/sourcesPage = Strumienie 6 | Main/settingsPage = Ustawienia 7 | 8 | # Question to add some examples 9 | Main/AskAddSamples = Czy chcesz dodać przykładowe strumienie kamer? 10 | 11 | # Error messages 12 | Main/CreateGridCommonError = Błąd tworzenia widoku 13 | Main/CreateGridNoLibError = Nie można odnaleźć VLC i/lub wtyczki ActiveX 14 | Main/CreateGridBadVerError = Upewnij się, że wersja VLC to 2.1.x 15 | Main/CreateGridEndError = Zainstaluj VLC wraz z wtyczką ActiveX do domyślnej lokalizacji\n''Program Files (x86)'' lub ''Program Files''\n\nVLC możesz pobrać stąd:\n{url}\n\nCzy pobrać teraz? 16 | 17 | # Settings file errors 18 | Main/SettingsSaveError = Błąd zapisu pliku ustawień 19 | Main/SettingsLoadError = Błąd odczytu pliku ustawień 20 | Main/SettingsAccesError = Błąd dostępu do pliku ustawień. Twoje zmiany nie będą zapisane. 21 | 22 | # Hint messages 23 | Main/hintOpenCtrl = Otwiera panel ustawień, gdzie\nmożesz dodać/podejrzeć kamery 24 | Main/hintAddCamera = Kliknij prawy przycisk myszki w tym\nobszarze, aby dodać nową kamerę 25 | Main/hintDropCamera = Przeciągnij kamerę lewym przyciskiem\nmyszki i upuść w wybranym polu siatki 26 | Main/hintRTSP1 = Strumień RSTP niskiej jakości.\nDo podglądu w małych oknach.\nWykorzystuje niewielkie pasmo sieci. 27 | Main/hintRTSP2 = Strumień RSTP wysokiej jakości.\nDo podglądu w dużym oknie.\nPrzełączanie rodzajów strumieni następuje automatycznie. 28 | 29 | # Context menu 30 | Main/fullScreenMenuItem = Pełny ekran 31 | Main/exitFullScreenMenuItem = Wyłącz pełny ekran 32 | 33 | 34 | 35 | ##### SourceList 36 | 37 | # Typeview submenu 38 | SourceList/typeViewToolStripMenuItem = Widok 39 | SourceList/largeIconsToolStripMenuItem = Duże ikony 40 | SourceList/smallIconsToolStripMenuItem = Małe ikony 41 | SourceList/largeListToolStripMenuItem = Duża lista 42 | SourceList/smallListToolStripMenuItem = Mała lista 43 | 44 | # Sort submenu 45 | SourceList/sortTypeToolStripMenuItem = Sortowanie 46 | SourceList/ascendingToolStripMenuItem = Rosnąco 47 | SourceList/descendingToolStripMenuItem = Malejąco 48 | SourceList/disabledToolStripMenuItem = Nieaktywne 49 | 50 | # Actions 51 | SourceList/newCameraToolStripMenuItem = Nowa kamera 52 | SourceList/modifyCameraToolStripMenuItem = Modyfikacja kamery 53 | 54 | 55 | 56 | ##### ModifySettings 57 | 58 | ModifySettings/camNameViewGlbButton = Opis kamery 59 | ModifySettings/alertSetupButton = Ustawienia alarmów 60 | ModifySettings/matrixSetupButton = Wymiary siatki 61 | ModifySettings/commandLineHelpButton = Pomoc uruchamiania z wiersza poleceń 62 | ModifySettings/commandLineHelp = Zachowanie programu podczas startu\n\nRtspCameraView.exe [fullscreen] [screen=N] [autoplay] [unmute] [priority=N]\n\n fullscreen - pełny ekran bez paska statusu i menu\n screen=N - przenieś na ekran o numerze N (0,1,2,...)\n maximize - okno zmaksymalizowane\n autoplay - autoodtwarzanie skonfigurowanych kamer\n unmute - nie wyciszaj dźwięku\n priority=N - zmień priorytet dla programu, N:\n 0 - wstrzymany\n 1 - średnio-niski\n 2 - średni\n 3 - średnio-wysoki\n 4 - wysoki 63 | ModifySettings/githubLinkLabel = Odwiedź stronę projektu 64 | 65 | 66 | 67 | ##### ModifySource 68 | 69 | ModifySource/camNameLabel = Nazwa kamery 70 | ModifySource/camName = Dodatkowe informacje (np. lokalizacja, kierunek) 71 | ModifySource/camNameShow = Wyświetlaj 72 | ModifySource/camNameInherit = Dziedzicz 73 | ModifySource/camNameModify = zmień... 74 | ModifySource/camEditRtsp1Label = Adres url strumienia niskiej jakości 75 | ModifySource/rtspBad = Sprawdź ustawienia producenta kamery. Np.:\nrtsp://admin:1111@192.168.1.3/live/sub\nrtsp://192.168.1.4:554/av0_1&user=admin&password=1111 76 | ModifySource/camEditRtsp2Label = Adres url strumienia wysokiej jakości 77 | ModifySource/rtspGood = Sprawdź ustawienia producenta kamery. Np.:\nrtsp://admin:1111@192.168.1.3/live/main\nrtsp://192.168.1.4:554/av0_0&user=admin&password=1111 78 | ModifySource/camEditIconLabel = Ikona kamery 79 | ModifySource/aspectRatioLabel = Proporcje 80 | ModifySource/aspectRatio = 81 | ModifySource/createCamButton = Utwórz 82 | ModifySource/saveCamButton = Zapisz 83 | ModifySource/cancelCamButton = Anuluj 84 | ModifySource/delCamLabel = Usuń kamerę 85 | ModifySource/cameraDeleteConfirm1 = Czy na pewno usunąć kamerę? 86 | ModifySource/cameraDeleteConfirm2 = Właśnie oglądasz widok z tej kamery. Na pewno? 87 | ModifySource/rtspGoodOnlyInFullview = pokaż tylko w trybie pełnego widoku 88 | 89 | 90 | 91 | ##### NameViewSetup 92 | 93 | NameViewSetup/this = Ustawienia nazw strumieni 94 | NameViewSetup/positioningLabel = Ustawienie 95 | NameViewSetup/camNameLabel = Nazwa 96 | NameViewSetup/textColorLabel = Kolor tekstu 97 | NameViewSetup/backgroundCheckBox = Kolor tła 98 | NameViewSetup/textSizeLabel = Rozmiar tekstu 99 | NameViewSetup/autoHideCheckBox = Ukrywaj automatycznie 100 | NameViewSetup/okButton = Ok 101 | NameViewSetup/cancelButton = Anuluj 102 | 103 | 104 | 105 | ##### SourceGrid 106 | 107 | SourceGrid/EmailOnLostSignalTitle = {name} brak sygnału 108 | SourceGrid/EmailOnLostSignalSubject = Sygnał z {name} utracony\n\nAdres url niskiej jakości:\n{bad}\n\nAdres url wysokiej jakości:\n{good}\n\n 109 | SourceGrid/EmailOnRestoreSignalTitle = {name} sygnał przywrócony 110 | SourceGrid/EmailOnRestoreSignalSubject = Sygnał z {name} został przywrócony\n\nAdres url niskiej jakości:\n{bad}\n\nAdres url wysokiej jakości:\n{good}\n\n 111 | 112 | 113 | 114 | ##### MatrixSetup 115 | 116 | MatrixSetup/this = Dostosuj ustawienia siatki 117 | MatrixSetup/joinButton = Połącz 118 | MatrixSetup/splitButton = Podziel 119 | MatrixSetup/saveButton = Zapisz 120 | MatrixSetup/cancelButton = Anuluj 121 | 122 | 123 | 124 | ##### AlertSetup 125 | 126 | # Email page 127 | AlertSetup/emailPage = Alarm Email 128 | AlertSetup/emLostCheckBox = W przypadku braku sygnału przez czas (min) 129 | AlertSetup/emRecoverCheckBox = W przypadku przywrócenia sygnału 130 | AlertSetup/emToLabel = Wyślij do 131 | AlertSetup/emFromLabel = Wyślij z 132 | 133 | # Mail server setup 134 | AlertSetup/emServerGroupBox = Adres serwera poczty 135 | AlertSetup/emNameLabel = Nazwa 136 | AlertSetup/emPortLabel = Port 137 | AlertSetup/emTestLinkLabel = Wyślij wiadomość testową 138 | AlertSetup/emUsernameLabel = Nazwa użytkownika 139 | AlertSetup/emPasswordLabel = Hasło 140 | 141 | # Common 142 | AlertSetup/this = Ustawienia alarmu utraty sygnału 143 | AlertSetup/okButton = Ok 144 | AlertSetup/cancelButton = Anuluj 145 | AlertSetup/testTitle = Alert test 146 | AlertSetup/testText = Gratulacje! Twoje ustawienia działają! 147 | -------------------------------------------------------------------------------- /Model/Locales/ru.txt: -------------------------------------------------------------------------------- 1 | # Translated to Russian by Gregory Lobkov 2 | # https://github.com/grigory-lobkov 3 | ##### Main 4 | 5 | # Вкладки панели управления 6 | Main/sourcesPage = Источники 7 | Main/settingsPage = Настройки 8 | 9 | # Вопрос на добавление нескольких примеров источников 10 | Main/AskAddSamples = Добавить несколько примеров в список источников? 11 | 12 | # Сообщения об ошибках 13 | Main/CreateGridCommonError = Ошибка создания сетки проигрывателей 14 | Main/CreateGridNoLibError = Не могу найти установленных VLC и/или ActiveX Web-plugin 15 | Main/CreateGridBadVerError = Пожалуйста, проверьте, что Ваш VLC версии 2.1.x 16 | Main/CreateGridEndError = Пожалуйста, установите VLC 2.1.x с выбранным ActiveX Web-module в папку\nпо умолчанию ''Program Files (x86)'' или ''Program Files''\n\nВы можете загрузить VLC здесь:\n{url}\n\nВы хотите загрузить VLC сейчас? 17 | 18 | # Ошибки файла настройки 19 | Main/SettingsSaveError = Ошибка сохранения файла настроек 20 | Main/SettingsLoadError = Ошибка загрузки файла настроек 21 | Main/SettingsAccesError = Не хватает прав на доступ к файлу настроек, работа сохранена не будет 22 | 23 | # Подсказки 24 | Main/hintOpenCtrl = Откройте панель управления, чтобы\nдобавить/посмотреть список камер 25 | Main/hintAddCamera = Правый клик в этой области,\nчтобы добавить камеру 26 | Main/hintDropCamera = Перетащите камеру левой кнопкой мыши\nи отпустите на сетке справа 27 | Main/hintRTSP1 = Строка подключения RTSP плохого качества, которое\nпроизводит минимальную нагрузку на сеть.\nДля показа в маленьких окнах. 28 | Main/hintRTSP2 = Строка подключения RTSP хорошего качества, которое\nсоздает высокую нагрузку на сеть.\nДля показа в больших окнах.\nПереключение между потоками RTSP автоматизировано. 29 | 30 | # Контекстное меню 31 | Main/fullScreenMenuItem = Полный экран 32 | Main/exitFullScreenMenuItem = Выход из полного экрана 33 | 34 | 35 | 36 | ##### SourceList 37 | 38 | # Подменю "Вид" 39 | SourceList/typeViewToolStripMenuItem = Вид 40 | SourceList/largeIconsToolStripMenuItem = Большие иконки 41 | SourceList/smallIconsToolStripMenuItem = Маленькие иконки 42 | SourceList/largeListToolStripMenuItem = Большой список 43 | SourceList/smallListToolStripMenuItem = Маленький список 44 | 45 | # Подменю "Сортировка" 46 | SourceList/sortTypeToolStripMenuItem = Сортировка 47 | SourceList/ascendingToolStripMenuItem = По возрастанию 48 | SourceList/descendingToolStripMenuItem = По убыванию 49 | SourceList/disabledToolStripMenuItem = Отключена 50 | 51 | # Действия 52 | SourceList/newCameraToolStripMenuItem = Новая камера 53 | SourceList/modifyCameraToolStripMenuItem = Изменить камеру 54 | 55 | 56 | 57 | ##### ModifySettings 58 | 59 | ModifySettings/camNameViewGlbButton = Отображение имени 60 | ModifySettings/alertSetupButton = Тревожные события 61 | ModifySettings/matrixSetupButton = Параметры сетки 62 | ModifySettings/commandLineHelpButton = Параметры командной строки 63 | ModifySettings/commandLineHelp = Действия программы во время запуска\n\nRtspCameraView.exe [fullscreen] [screen=N] [autoplay] [unmute] [priority=N]\n\n fullscreen - скрыть заголовок и панель задач\n screen=N - переместить программу в экран N (0,1,2,...)\n maximize - развернуть на весь экран\n autoplay - автозапуск камер\n unmute - включить звук, если есть\n priority=N - сменить приоритет программы, N:\n 0 - Низкий\n 1 - Ниже среднего\n 2 - Средний\n 3 - Выше среднего\n 4 - Высокий 64 | ModifySettings/githubLinkLabel = Посетить страницу проекта 65 | 66 | 67 | 68 | ##### ModifySource 69 | 70 | ModifySource/camNameLabel = Имя камеры 71 | ModifySource/camName = Место установки, просмотра, и т.п. 72 | ModifySource/camNameShow = показать 73 | ModifySource/camNameInherit = глобальные 74 | ModifySource/camNameModify = изменить... 75 | ModifySource/camEditRtsp1Label = Строка подключения RTSP плохого качества 76 | ModifySource/rtspBad = Выясните у поставщика. Примеры:\nrtsp://admin:1111@192.168.1.3/live/sub\nrtsp://192.168.1.4:554/av0_1&user=admin&password=1111 77 | ModifySource/camEditRtsp2Label = Строка подключения RTSP хорошего качества 78 | ModifySource/rtspGood = Выясните у поставщика. Примеры:\nrtsp://admin:1111@192.168.1.3/live/main\nrtsp://192.168.1.4:554/av0_0&user=admin&password=1111 79 | ModifySource/camEditIconLabel = Иконка камеры 80 | ModifySource/aspectRatioLabel = Соотношение сторон 81 | ModifySource/aspectRatio = 82 | ModifySource/createCamButton = Добавить 83 | ModifySource/saveCamButton = Сохранить 84 | ModifySource/cancelCamButton = Отмена 85 | ModifySource/delCamLabel = Удалить камеру 86 | ModifySource/cameraDeleteConfirm1 = Вы действительно хотите удалить камеру? 87 | ModifySource/cameraDeleteConfirm2 = Вы сейчас просматриваете эту камеру. Удалять? 88 | ModifySource/rtspGoodOnlyInFullview = Только при открытии во все окно 89 | 90 | 91 | 92 | ##### NameViewSetup 93 | 94 | NameViewSetup/this = Параметры отображения названия 95 | NameViewSetup/positioningLabel = Расположение 96 | NameViewSetup/camNameLabel = Имя 97 | NameViewSetup/textColorLabel = Цвет текста 98 | NameViewSetup/backgroundCheckBox = Фон 99 | NameViewSetup/textSizeLabel = Размер текста 100 | NameViewSetup/autoHideCheckBox = Скрывать автоматически 101 | NameViewSetup/okButton = Ок 102 | NameViewSetup/cancelButton = Отмена 103 | 104 | 105 | 106 | ##### SourceGrid 107 | 108 | SourceGrid/EmailOnLostSignalTitle = {name} связь прервана 109 | SourceGrid/EmailOnLostSignalSubject = Связь с источником {name} утеряна\n\nСтрока плохого потока:\n{bad}\n\nСтрока хорошего потока:\n{good}\n\n 110 | SourceGrid/EmailOnRestoreSignalTitle = {name} связь восстановлена 111 | SourceGrid/EmailOnRestoreSignalSubject = Связь с источником {name} восстановлена\n\nСтрока плохого потока:\n{bad}\n\nСтрока хорошего потока:\n{good}\n\n 112 | 113 | 114 | 115 | ##### MatrixSetup 116 | 117 | MatrixSetup/this = Параметры сетки просмотра 118 | MatrixSetup/joinButton = Склеить 119 | MatrixSetup/splitButton = Разделить 120 | MatrixSetup/saveButton = Сохранить 121 | MatrixSetup/cancelButton = Отмена 122 | 123 | 124 | 125 | ##### AlertSetup 126 | 127 | # Тревоги по Email 128 | AlertSetup/emailPage = Email 129 | AlertSetup/emLostCheckBox = Когда соединение утеряно на (min) 130 | AlertSetup/emRecoverCheckBox = Когда соединение восстановлено 131 | AlertSetup/emToLabel = Кому 132 | AlertSetup/emFromLabel = От кого 133 | 134 | # Mail server setup 135 | AlertSetup/emServerGroupBox = Почтовый сервер 136 | AlertSetup/emNameLabel = Имя 137 | AlertSetup/emPortLabel = Порт 138 | AlertSetup/emTestLinkLabel = Тестовое сообщение 139 | AlertSetup/emUsernameLabel = Имя пользователя 140 | AlertSetup/emPasswordLabel = Пароль 141 | 142 | # Common 143 | AlertSetup/this = Настройка тревожных событий 144 | AlertSetup/okButton = Ок 145 | AlertSetup/cancelButton = Отмена 146 | AlertSetup/testTitle = Тест тревожного сообщения 147 | AlertSetup/testText = Поздравляем!\nВаши настройки работают! -------------------------------------------------------------------------------- /Model/Locales/sp.txt: -------------------------------------------------------------------------------- 1 | # Translated to Spanish by Fernando-Kiernan 2 | # https://github.com/Fernando-Kiernan 3 | ##### Main 4 | 5 | # Control panel tab names 6 | Main/sourcesPage = Orígenes 7 | Main/settingsPage = Configuraciòn 8 | 9 | # Question to add some examples 10 | Main/AskAddSamples = ¿Quiere agregar las cámaras de ejemplo a sus orígenes? 11 | 12 | # Error messages 13 | Main/CreateGridCommonError = Error creando la grilla de reproductores 14 | Main/CreateGridNoLibError = No se encuentra que el VLC y/o el Plugin-Web Activex estén instalados 15 | Main/CreateGridBadVerError = Por favor, chequee que su versión de VLC sea 2.1.x 16 | Main/CreateGridEndError = Por favor, instale el VLC 2.1.x con el módulo Activex Web en la carpeta\npor defecto''Archivos de Programa (x86)'' or ''Archivos de Programa''\n\nPuede descargar el VLC aquí:\n{url}\n\n¿Quiere descargar el VLC ahora? 17 | 18 | # Settings file errors 19 | Main/SettingsSaveError = Error grabando el archivo de configuración 20 | Main/SettingsLoadError = Error cargando el archivo de configuración 21 | Main/SettingsAccesError = Error accediendo al archivo de configuración, sus cambios no se grabarán 22 | 23 | # Hint messages 24 | Main/hintOpenCtrl = Abrir el panel de control para Agregar/Ver\nlas cámaras disponibles 25 | Main/hintAddCamera = Haga Click-derecho en este área para Agregar\nuna nueva cámara 26 | Main/hintDropCamera = Arrastre la cámara con el botón izquierdo del mouse\ny suéltela en algún lugar de la grilla aquí 27 | Main/hintRTSP1 = Cadena de conexión RTSP de calidad baja, que\nproduce carga mínima en la red.\nPara mostrar en ventanas pequeñas. 28 | Main/hintRTSP2 = Cadena de conexión RTSP de calidad alta, que\nproduce alta carga de red.\Para mostrar en ventanas grandes.\nEl cambio entre calidades es automático. 29 | # Context menu 30 | Main/fullScreenMenuItem = Pantalla completa 31 | Main/exitFullScreenMenuItem = Salir de Pantalla completa 32 | 33 | 34 | 35 | ##### SourceList 36 | 37 | # Typeview submenu 38 | SourceList/typeViewToolStripMenuItem = Tipo de Vista 39 | SourceList/largeIconsToolStripMenuItem = Iconos Grandes 40 | SourceList/smallIconsToolStripMenuItem = Iconos Pequeños 41 | SourceList/largeListToolStripMenuItem = Lista Grande 42 | SourceList/smallListToolStripMenuItem = Lista Pequeña 43 | 44 | # Sort submenu 45 | SourceList/sortTypeToolStripMenuItem = Orden 46 | SourceList/ascendingToolStripMenuItem = Ascendente 47 | SourceList/descendingToolStripMenuItem = Descendente 48 | SourceList/disabledToolStripMenuItem = Desactivado 49 | 50 | # Actions 51 | SourceList/newCameraToolStripMenuItem = Nueva Cámara 52 | SourceList/modifyCameraToolStripMenuItem = Modificar Cámara 53 | 54 | 55 | 56 | ##### ModifySettings 57 | 58 | ModifySettings/camNameViewGlbButton = Mostrar nombre de la cámara 59 | ModifySettings/alertSetupButton = Control de alertas 60 | ModifySettings/matrixSetupButton = Dimensiones de la matriz 61 | ModifySettings/commandLineHelpButton = Ayuda de Parámetros de la Línea de Comando 62 | ModifySettings/commandLineHelp = Acciones del programa, al iniciar\n\nRtspCameraView.exe [fullscreen] [screen=N] [autoplay] [unmute] [priority=N]\n\n fullscreen - pantalla completa\n screen=N - mover la ventana a la pantalla número N (0,1,2,...)\n maximize - maximizar la ventana\n autoplay - iniciar automáticamente las cámaras ya ubicadas\n unmute - no silenciar sonido, si existe repoducirlo\n priority=N - cambiar la prioridad del programa, N:\n 0 - Mínima\n 1 - Menor que Normal\n 2 - Normal\n 3 - Sobre la Normal\n 4 - Alta 63 | ModifySettings/githubLinkLabel = Visitar la página del proyecto 64 | 65 | 66 | 67 | ##### ModifySource 68 | 69 | ModifySource/camNameLabel = Nombre de la cámara 70 | ModifySource/camName = Ubicación, área de vista, etc. 71 | ModifySource/camNameShow = mostrar 72 | ModifySource/camNameInherit = heredar el global 73 | ModifySource/camNameModify = modificar... 74 | ModifySource/camEditRtsp1Label = Cadena de conexión RTSP de baja calidad 75 | ModifySource/rtspBad = Consulte al fabricante de su cámara. Ejemplos:\nrtsp://admin:1111@192.168.1.3/live/sub\nrtsp://192.168.1.4:554/av0_1&user=admin&password=1111 76 | ModifySource/camEditRtsp2Label = Cadena de conexión RTSP de alta calidad 77 | ModifySource/rtspGood = Consulte al fabricante de su cámara. Ejemplos:\nrtsp://admin:1111@192.168.1.3/live/main\nrtsp://192.168.1.4:554/av0_0&user=admin&password=1111 78 | ModifySource/camEditIconLabel = Icono de la cámara 79 | ModifySource/aspectRatioLabel = Relación de aspecto 80 | ModifySource/aspectRatio = 81 | ModifySource/createCamButton = Crear 82 | ModifySource/saveCamButton = Guardar 83 | ModifySource/cancelCamButton = Cancelar 84 | ModifySource/delCamLabel = Eliminar cámara 85 | ModifySource/cameraDeleteConfirm1 = ¿Seguro que quiere eliminar la cámara? 86 | ModifySource/cameraDeleteConfirm2 = ¿La cámara se está reproduciendo ahora. Está seguro? 87 | ModifySource/rtspGoodOnlyInFullview = mostrar solo cuando está en modo de vista completa 88 | 89 | 90 | 91 | ##### NameViewSetup 92 | 93 | NameViewSetup/this = Configuración de nombre de origen 94 | NameViewSetup/positioningLabel = Posición 95 | NameViewSetup/camNameLabel = Nombre 96 | NameViewSetup/textColorLabel = Color de texto 97 | NameViewSetup/backgroundCheckBox = Fondo 98 | NameViewSetup/textSizeLabel = Tamaño de texto 99 | NameViewSetup/autoHideCheckBox = Ocultar automáticamente 100 | NameViewSetup/okButton = Ok 101 | NameViewSetup/cancelButton = Cancelar 102 | 103 | 104 | 105 | ##### SourceGrid 106 | 107 | SourceGrid/EmailOnLostSignalTitle = {name} Link PERDIDO 108 | SourceGrid/EmailOnLostSignalSubject = La señal de {name} se perdió\n\nURL baja calidad:\n{bad}\n\nURL alta calidad:\n{good}\n\n 109 | SourceGrid/EmailOnRestoreSignalTitle = {name} recuperó el link 110 | SourceGrid/EmailOnRestoreSignalSubject = La señal de {name} se recuperó\n\nURL baja calidad:\n{bad}\n\nURL alta calidad:\n{good}\n\n 111 | 112 | 113 | 114 | ##### MatrixSetup 115 | 116 | MatrixSetup/this = Personalizar la matriz de visualización 117 | MatrixSetup/joinButton = Unir 118 | MatrixSetup/splitButton = Separar 119 | MatrixSetup/saveButton = Guardar 120 | MatrixSetup/cancelButton = Cancelar 121 | 122 | 123 | 124 | ##### AlertSetup 125 | 126 | # Email page 127 | AlertSetup/emailPage = Email 128 | AlertSetup/emLostCheckBox = Cuando la conexión se pierde por (min) 129 | AlertSetup/emRecoverCheckBox = Cuando la conexión se recupera 130 | AlertSetup/emToLabel = Para 131 | AlertSetup/emFromLabel = De 132 | 133 | # Mail server setup 134 | AlertSetup/emServerGroupBox = Servidor de correo 135 | AlertSetup/emNameLabel = Nombre 136 | AlertSetup/emPortLabel = Puerto 137 | AlertSetup/emTestLinkLabel = Mandar email de prueba 138 | AlertSetup/emUsernameLabel = Nombre de usuario 139 | AlertSetup/emPasswordLabel = Contraseña 140 | 141 | # Common 142 | AlertSetup/this = Configuración de alerta de pérdida de señal 143 | AlertSetup/okButton = Ok 144 | AlertSetup/cancelButton = Cancelar 145 | AlertSetup/testTitle = Prueba de alerta 146 | AlertSetup/testText = ¡Felicidades!\n¡Tu configuración está funcionando! -------------------------------------------------------------------------------- /Model/Locales/zh_cn.txt: -------------------------------------------------------------------------------- 1 | # Translated to Chinese Simplified by Samuel Freeman 2 | # https://github.com/sndnvaps 3 | ##### Main 4 | 5 | # Control panel tab names 6 | Main/sourcesPage = 摄像头列表 7 | Main/settingsPage = 设置 8 | 9 | # Question to add some examples 10 | Main/AskAddSamples = 你需要添加一个摄像头到挺像头列表当中不? 11 | 12 | # Error messages 13 | Main/CreateGridCommonError = 设置播放器表格出错 14 | Main/CreateGridNoLibError = 无法找到VLC或者ActiveX Web-plugin程序 15 | Main/CreateGridBadVerError = 请检查一下,你的VLc版本是否为2.1.x 16 | Main/CreateGridEndError = 请安装VLC 2.1.x版本,并安装ActiveX Web-module模块到默认目录\n''Program Files (x86)'' or ''Program Files''\n\n你可以从这里:\n{url}下载\n\n你现在需要下载? 17 | 18 | # Settings file errors 19 | Main/SettingsSaveError = 保存配置文件出错 20 | Main/SettingsLoadError = 加载配置文件出错 21 | Main/SettingsAccesError = 加载配置文件出错,你的修改将无法保存 22 | 23 | # Hint messages 24 | Main/hintOpenCtrl = 打开操作面板去添加/预览\n可操作的摄像头 25 | Main/hintAddCamera = 在此处右击去添加\n新摄像头 26 | Main/hintDropCamera = 使用鼠标左键拖放摄像头\n到你想要的方格中 27 | Main/hintRTSP1 = RTSP连接状态不佳, \n这需要提供最小的网络连接.\n让它能在小窗口中显示出来. 28 | Main/hintRTSP2 = RTSP连接状态非常好, \n这能提供更高效的网络连接.\n让它能在大窗口中显示出来.\n连接状态是自动切换的. 29 | 30 | # Context menu 31 | Main/fullScreenMenuItem = 全屏 32 | Main/exitFullScreenMenuItem = 退出全屏 33 | 34 | 35 | 36 | ##### SourceList 37 | 38 | # Typeview submenu 39 | SourceList/typeViewToolStripMenuItem = 查看状态 40 | SourceList/largeIconsToolStripMenuItem = 大图标 41 | SourceList/smallIconsToolStripMenuItem = 小图标 42 | SourceList/largeListToolStripMenuItem = 大列表 43 | SourceList/smallListToolStripMenuItem = 小列表 44 | 45 | # Sort submenu 46 | SourceList/sortTypeToolStripMenuItem = 排序 47 | SourceList/ascendingToolStripMenuItem = 升序 48 | SourceList/descendingToolStripMenuItem = 降序 49 | SourceList/disabledToolStripMenuItem = 禁止 50 | 51 | # Actions 52 | SourceList/newCameraToolStripMenuItem = 添加摄像头 53 | SourceList/modifyCameraToolStripMenuItem = 修改摄像头 54 | 55 | 56 | 57 | ##### ModifySettings 58 | 59 | ModifySettings/camNameViewGlbButton = 显示摄像头名称 60 | ModifySettings/alertSetupButton = 警报设置Alert control 61 | ModifySettings/matrixSetupButton = 摄像头阵列 62 | ModifySettings/commandLineHelpButton = 命令行帮忙 63 | ModifySettings/commandLineHelp = 程序运行, 当输入\n\nRtspCameraView.exe [fullscreen] [screen=N] [autoplay] [unmute] [priority=N]\n\n fullscreen - 隐藏任务栏和程序名字\n screen=N - 移动屏幕到第N个屏幕中 N = (0,1,2,...)\n maximize - 最大窗口尺寸\n autoplay - 自动播放已经定义好的摄像头\n unmute - 关闭静音, 如果打开的时间存在\n priority=N - 更换程序优先级, N:\n 0 - 闲置状态\n 1 - 低于常规\n 2 - 常规\n 3 - 高于常规\n 4 - 最高状态 64 | ModifySettings/githubLinkLabel = 打开项目页面 65 | 66 | 67 | 68 | ##### ModifySource 69 | 70 | ModifySource/camNameLabel = 摄像头名称 71 | ModifySource/camName = 安装位置,视野区域, 等。。。 72 | ModifySource/camNameShow = 显示摄像头 73 | ModifySource/camNameInherit =继承全局 74 | ModifySource/camNameModify = 设置... 75 | ModifySource/camEditRtsp1Label = RTSP连接字符串状态差 76 | ModifySource/rtspBad = 设置RTSP连接参数. 示例:\nrtsp://admin:1111@192.168.1.3/live/sub\nrtsp://192.168.1.4:554/av0_1&user=admin&password=1111 77 | ModifySource/camEditRtsp2Label = RTSP连接字符串状态良好 78 | ModifySource/rtspGood = 设置RTSP连接参数. 示例:\nrtsp://admin:1111@192.168.1.3/live/main\nrtsp://192.168.1.4:554/av0_0&user=admin&password=1111 79 | ModifySource/camEditIconLabel = 摄像头图标 80 | ModifySource/aspectRatioLabel = 纵横比 81 | ModifySource/aspectRatio = 82 | ModifySource/createCamButton = 创建 83 | ModifySource/saveCamButton = 保存 84 | ModifySource/cancelCamButton = 取消 85 | ModifySource/delCamLabel = 删除摄像头 86 | ModifySource/cameraDeleteConfirm1 = 你真是要删除这个摄像头 87 | ModifySource/cameraDeleteConfirm2 = 你正在浏览当前摄像. 你确认要删除? 88 | ModifySource/rtspGoodOnlyInFullview = 僅在全屏模式下顯示 89 | 90 | 91 | 92 | ##### NameViewSetup 93 | 94 | NameViewSetup/this = 预览名称设置 95 | NameViewSetup/positioningLabel = 位置 96 | NameViewSetup/camNameLabel = 名称 97 | NameViewSetup/textColorLabel = 文本颜色 98 | NameViewSetup/backgroundCheckBox = 背景 99 | NameViewSetup/textSizeLabel = 文本大小 100 | NameViewSetup/autoHideCheckBox = 隐藏自动播放 101 | NameViewSetup/okButton = 确认 102 | NameViewSetup/cancelButton = 取消 103 | 104 | 105 | 106 | ##### SourceGrid 107 | 108 | SourceGrid/EmailOnLostSignalTitle = {name} 连接丢失 109 | SourceGrid/EmailOnLostSignalSubject = {name} 信号已经丢失 \n\n坏连接地址 url:\n{bad}\n\n好的连接地址:\n{good}\n\n 110 | SourceGrid/EmailOnRestoreSignalTitle = {name} 已经恢复 111 | SourceGrid/EmailOnRestoreSignalSubject = {name} 已经恢复\n\n坏连接地址:\n{bad}\n\n好的连接地址:\n{good}\n\n 112 | 113 | 114 | 115 | ##### MatrixSetup 116 | 117 | MatrixSetup/this = 个性化浏览窗口 118 | MatrixSetup/joinButton = 加入 119 | MatrixSetup/splitButton = 分割 120 | MatrixSetup/saveButton = 保存 121 | MatrixSetup/cancelButton = 取消 122 | 123 | 124 | 125 | ##### AlertSetup 126 | 127 | # Email page 128 | AlertSetup/emailPage = 邮件 129 | AlertSetup/emLostCheckBox = 当连接丢失时 130 | AlertSetup/emRecoverCheckBox = 当连接恢复时 131 | AlertSetup/emToLabel = 发送给 132 | AlertSetup/emFromLabel = 来自 133 | 134 | # Mail server setup 135 | AlertSetup/emServerGroupBox = 邮件服务器 136 | AlertSetup/emNameLabel = 名称 137 | AlertSetup/emPortLabel = 端口 138 | AlertSetup/emTestLinkLabel = 发送测试邮件 139 | AlertSetup/emUsernameLabel = 用户 140 | AlertSetup/emPasswordLabel = 密码 141 | 142 | # Common 143 | AlertSetup/this = 丢信号时警报 144 | AlertSetup/okButton = 确认 145 | AlertSetup/cancelButton = 取消 146 | AlertSetup/testTitle = 警报测试 147 | AlertSetup/testText = 恭喜!\n你的设置已经完成! -------------------------------------------------------------------------------- /Model/Model.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {DEF7792E-23EE-42C4-B9F8-28D32BABFC94} 8 | Library 9 | Properties 10 | Model 11 | Model 12 | v4.0 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 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 | PreserveNewest 57 | 58 | 59 | PreserveNewest 60 | 61 | 62 | PreserveNewest 63 | 64 | 65 | PreserveNewest 66 | 67 | 68 | PreserveNewest 69 | 70 | 71 | PreserveNewest 72 | 73 | 74 | 75 | 82 | -------------------------------------------------------------------------------- /Model/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("MVP Domain Model")] 8 | [assembly: AssemblyDescription("https://github.com/grigory-lobkov/rtsp-camera-view")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("RTSP Camera View")] 12 | [assembly: AssemblyCopyright("Copyright © 2018 Grigory Lobkov")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("c3a9e7dd-842b-47c8-b63e-6e847c0c9b6a")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.1")] 35 | [assembly: AssemblyFileVersion("1.0.1")] 36 | -------------------------------------------------------------------------------- /Model/Settings/ISettingsService.cs: -------------------------------------------------------------------------------- 1 | namespace Model 2 | { 3 | public interface ISettingsService 4 | { 5 | AppSettings GetSettings(); 6 | bool Save(); 7 | void AddSampleCameras(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Model/Settings/XmlFileSettingsService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Serialization; 3 | 4 | namespace Model 5 | { 6 | public class XmlFileSettingsService: ISettingsService 7 | { 8 | private AppSettings _settings = null; 9 | private string storeFileName = "settings.xml"; 10 | private bool errorOnLoadHappen = false; // to prevent save, if error on load happen and user didn't do any changes 11 | private bool saveThrown = false; 12 | private bool loadThrown = false; 13 | private bool hasWriteRights = false; 14 | public bool HasWriteRights { get => hasWriteRights; } 15 | 16 | public AppSettings GetSettings() 17 | { 18 | if (_settings != null) return _settings; 19 | try { Load(); } 20 | catch { 21 | _settings = new AppSettings() { cams = new Camera[0], hint = new Hint() }; 22 | throw; 23 | } 24 | if (_settings == null) _settings = new AppSettings(); 25 | if (_settings.cams == null) _settings.cams = new Camera[0]; 26 | _settings.hint = new Hint(); 27 | return _settings; 28 | } 29 | public void AddSampleCameras() 30 | { 31 | foreach (Camera c in _settings.cams) c.position = -1; 32 | int l = _settings.cams.Length; 33 | Array.Resize(ref _settings.cams, l + 4); 34 | // A lot of public cameras: https://www.insecam.org/en/byrating/?page=24 35 | _settings.cams[l] = new Camera 36 | { 37 | name = "Tokyo", 38 | rtspBad = "http://210.148.114.53/-wvhttp-01-/GetOneShot?image_size=640x480&frame_count=1000000000", 39 | position = 0, 40 | camIcon = 1, 41 | aspectRatio = "4:3" 42 | }; 43 | _settings.cams[l + 1] = new Camera 44 | { 45 | name = "Krasnodar, Sochi", 46 | rtspBad = "http://158.58.130.148:80/mjpg/video.mjpg", 47 | position = 1, 48 | camIcon = 0, 49 | aspectRatio = "4:3" 50 | }; 51 | _settings.cams[l + 2] = new Camera 52 | { 53 | name = "Antwerpen, Antwerpen", 54 | rtspBad = "http://81.83.10.9:8001/mjpg/video.mjpg", 55 | position = 2, 56 | camIcon = 0, 57 | aspectRatio = "4:3" 58 | }; 59 | _settings.cams[l + 3] = new Camera 60 | { 61 | name = "Colorado, Glenwood Springs", 62 | rtspBad = "http://208.72.70.172/mjpg/video.mjpg", 63 | rtspGood = "http://208.72.70.171:80/mjpg/video.mjpg", 64 | position = 3, 65 | camIcon = 1, 66 | aspectRatio = "4:3", 67 | goodOnlyInFullview = 1 68 | }; 69 | } 70 | 71 | ~XmlFileSettingsService() 72 | { 73 | try { 74 | if (!errorOnLoadHappen) Save(); 75 | } finally { } 76 | } 77 | 78 | public bool Load() 79 | { 80 | if (!System.IO.File.Exists(storeFileName)) return false; 81 | try {// when renaming something in xml 82 | // AppSettings -> appSettings beta 1.0.0.0-1.0.0.2 -> 1.0.0.3 83 | System.IO.File.WriteAllText(storeFileName,System.IO.File.ReadAllText(storeFileName) 84 | .Replace("", "appSettings>")); 85 | } catch { } 86 | try 87 | { 88 | using (System.IO.Stream stream = new System.IO.FileStream(storeFileName, System.IO.FileMode.Open)) 89 | { 90 | XmlSerializer serializer = new XmlSerializer(typeof(AppSettings)); 91 | _settings = (AppSettings)serializer.Deserialize(stream); 92 | } 93 | } 94 | catch 95 | { 96 | //MessageBox.Show(errorLoadSettings.Text + "\n" + settings.storeFileName, "", MessageBoxButtons.OK, MessageBoxIcon.Error); 97 | //if (settings == null) settings = new AppSettings(); 98 | //return false; 99 | if (!loadThrown) 100 | { 101 | errorOnLoadHappen = true; 102 | loadThrown = true; 103 | throw; //UnauthorizedAccessException - no rights to read 104 | } 105 | return false; 106 | } 107 | return true; 108 | } 109 | 110 | public bool Save() 111 | { 112 | if (_settings == null) return false; 113 | try 114 | { 115 | using (System.IO.Stream writer = new System.IO.FileStream(storeFileName, System.IO.FileMode.Create)) 116 | { 117 | XmlSerializer serializer = new XmlSerializer(typeof(AppSettings)); 118 | serializer.Serialize(writer, _settings); 119 | writer.Close(); 120 | } 121 | } 122 | catch 123 | { 124 | //MessageBox.Show(errorSaveSettings.Text + "\n" + Properties.Resources.settingsFileName, "", MessageBoxButtons.OK, MessageBoxIcon.Error); 125 | //return false; 126 | if (!saveThrown) { saveThrown = true; throw; }//UnauthorizedAccessException - no rights to write 127 | return false; 128 | } 129 | errorOnLoadHappen = false; 130 | return true; 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /Presenter/Common/ApplicationController.cs: -------------------------------------------------------------------------------- 1 | namespace Presenter.Common 2 | { 3 | public class ApplicationController : IApplicationController 4 | { 5 | private readonly IContainer _container; 6 | 7 | public ApplicationController(IContainer container) 8 | { 9 | _container = container; 10 | _container.RegisterInstance(this); 11 | } 12 | 13 | public IApplicationController RegisterView() 14 | where TImplementation : class, TView 15 | where TView : IView 16 | { 17 | _container.Register(); 18 | return this; 19 | } 20 | 21 | public IApplicationController RegisterControl() 22 | where TImplementation : class, TViewControl 23 | where TViewControl : IViewControl 24 | { 25 | _container.Register(); 26 | return this; 27 | } 28 | 29 | public IApplicationController RegisterInstance(TInstance instance) 30 | { 31 | _container.RegisterInstance(instance); 32 | return this; 33 | } 34 | 35 | public IApplicationController RegisterService() 36 | where TImplementation : class, TModel 37 | { 38 | _container.Register(); 39 | return this; 40 | } 41 | 42 | public void Run() where TPresenter : class, IPresenter 43 | { 44 | if (!_container.IsRegistered()) 45 | _container.Register(); 46 | 47 | var presenter = _container.Resolve(); 48 | presenter.Run(); 49 | } 50 | 51 | public void Run(TArgumnent argumnent) where TPresenter : class, IPresenter 52 | { 53 | if (!_container.IsRegistered()) 54 | _container.Register(); 55 | 56 | var presenter = _container.Resolve(); 57 | presenter.Run(argumnent); 58 | } 59 | 60 | public TPresenter Get() where TPresenter : class, IPresenterControl 61 | { 62 | if (!_container.IsRegistered()) 63 | _container.Register(); 64 | 65 | var presenter = _container.Resolve(); 66 | presenter.Get(); 67 | return presenter; 68 | } 69 | 70 | public TPresenter Get(TArgumnent argumnent) where TPresenter : class, IPresenterControl 71 | { 72 | if (!_container.IsRegistered()) 73 | _container.Register(); 74 | 75 | var presenter = _container.Resolve(); 76 | presenter.Get(argumnent); 77 | return presenter; 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /Presenter/Common/BasePresener.cs: -------------------------------------------------------------------------------- 1 | namespace Presenter.Common 2 | { 3 | public abstract class BasePresener : IPresenter 4 | where TView : IView 5 | { 6 | protected TView View { get; private set; } 7 | protected IApplicationController Controller { get; private set; } 8 | 9 | protected BasePresener(IApplicationController controller, TView view) 10 | { 11 | Controller = controller; 12 | View = view; 13 | } 14 | 15 | public void Run() 16 | { 17 | View.Show(); 18 | } 19 | } 20 | 21 | public abstract class BasePresener : IPresenter 22 | where TView : IView 23 | { 24 | protected TView View { get; private set; } 25 | protected IApplicationController Controller { get; private set; } 26 | 27 | protected BasePresener(IApplicationController controller, TView view) 28 | { 29 | Controller = controller; 30 | View = view; 31 | } 32 | 33 | public abstract void Run(TArg argument); 34 | } 35 | } -------------------------------------------------------------------------------- /Presenter/Common/BasePresenterControl.cs: -------------------------------------------------------------------------------- 1 | namespace Presenter.Common 2 | { 3 | public abstract class BasePresenterControl : IPresenterControl 4 | where TView : IViewControl 5 | { 6 | protected TView View { get; private set; } 7 | protected IApplicationController Controller { get; private set; } 8 | 9 | protected BasePresenterControl(IApplicationController controller, TView view) 10 | { 11 | Controller = controller; 12 | View = view; 13 | } 14 | 15 | public IViewControl Control { get { return View; } } 16 | 17 | public void Get() { } 18 | } 19 | 20 | public abstract class BasePresenterControl : IPresenterControl 21 | where TView : IViewControl 22 | { 23 | protected TView View { get; private set; } 24 | protected IApplicationController Controller { get; private set; } 25 | 26 | protected BasePresenterControl(IApplicationController controller, TView view) 27 | { 28 | Controller = controller; 29 | View = view; 30 | } 31 | 32 | public IViewControl Control { get { return View; } } 33 | 34 | public abstract void Get(TArg argument); 35 | } 36 | } -------------------------------------------------------------------------------- /Presenter/Common/IApplicationController.cs: -------------------------------------------------------------------------------- 1 | namespace Presenter.Common 2 | { 3 | public interface IApplicationController 4 | { 5 | IApplicationController RegisterView() 6 | where TImplementation : class, TView 7 | where TView : IView; 8 | 9 | IApplicationController RegisterControl() 10 | where TImplementation : class, TViewControl 11 | where TViewControl : IViewControl; 12 | 13 | IApplicationController RegisterInstance(TArgument instance); 14 | 15 | IApplicationController RegisterService() 16 | where TImplementation : class, TService; 17 | 18 | void Run() 19 | where TPresenter : class, IPresenter; 20 | 21 | void Run(TArgumnent argumnent) 22 | where TPresenter : class, IPresenter; 23 | 24 | TPresenter Get() 25 | where TPresenter : class, IPresenterControl; 26 | TPresenter Get(TArgumnent argumnent) 27 | where TPresenter : class, IPresenterControl; 28 | } 29 | } -------------------------------------------------------------------------------- /Presenter/Common/IContainer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | 4 | namespace Presenter.Common 5 | { 6 | public interface IContainer 7 | { 8 | void Register() where TImplementation : TService; 9 | void Register(); 10 | void RegisterInstance(T instance); 11 | TService Resolve(); 12 | bool IsRegistered(); 13 | void Register(Expression> factory); 14 | } 15 | } -------------------------------------------------------------------------------- /Presenter/Common/IPresenter.cs: -------------------------------------------------------------------------------- 1 | namespace Presenter.Common 2 | { 3 | public interface IPresenter 4 | { 5 | void Run(); 6 | } 7 | 8 | public interface IPresenter 9 | { 10 | void Run(TArg argument); 11 | } 12 | } -------------------------------------------------------------------------------- /Presenter/Common/IPresenterControl.cs: -------------------------------------------------------------------------------- 1 | namespace Presenter.Common 2 | { 3 | public interface IPresenterControl 4 | { 5 | void Get(); 6 | IViewControl Control { get; } 7 | } 8 | 9 | public interface IPresenterControl 10 | { 11 | void Get(TArg argument); 12 | IViewControl Control { get; } 13 | } 14 | } -------------------------------------------------------------------------------- /Presenter/Common/IView.cs: -------------------------------------------------------------------------------- 1 | namespace Presenter.Common 2 | { 3 | public interface IView 4 | { 5 | void Show(); 6 | void Close(); 7 | } 8 | } -------------------------------------------------------------------------------- /Presenter/Common/IViewControl.cs: -------------------------------------------------------------------------------- 1 | namespace Presenter.Common 2 | { 3 | public interface IViewControl 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /Presenter/Presenter.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {D0AA12D1-4F7B-497C-8C31-A1F346D80C60} 8 | Library 9 | Properties 10 | Presenter 11 | Presenter 12 | v4.0 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 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 | True 64 | True 65 | Resources.resx 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | {DEF7792E-23EE-42C4-B9F8-28D32BABFC94} 83 | DomainModel 84 | 85 | 86 | 87 | 88 | ResXFileCodeGenerator 89 | Resources.Designer.cs 90 | Designer 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 105 | -------------------------------------------------------------------------------- /Presenter/Presenters/AlertSetupPresenter.cs: -------------------------------------------------------------------------------- 1 | using Model; 2 | using System; 3 | using Presenter.Common; 4 | using Presenter.Views; 5 | 6 | namespace Presenter.Presenters 7 | { 8 | public class AlertSetupPresenter : BasePresener 9 | { 10 | private Alert _alert; 11 | private IEmailAlertService _eMalertService; 12 | 13 | public AlertSetupPresenter(IApplicationController controller, IAlertSetupView view, IEmailAlertService eMalertService) : base(controller, view) 14 | { 15 | // View localization 16 | View.ThisText = Locale.Instance.Get("AlertSetup/this"); 17 | View.EmailPageText = Locale.Instance.Get("AlertSetup/emailPage"); 18 | View.EmLostCheckBoxText = Locale.Instance.Get("AlertSetup/emLostCheckBox"); 19 | View.EmRecoverCheckBoxText = Locale.Instance.Get("AlertSetup/emRecoverCheckBox"); 20 | View.EmToLabelText = Locale.Instance.Get("AlertSetup/emToLabel"); 21 | View.EmFromLabelText = Locale.Instance.Get("AlertSetup/emFromLabel"); 22 | View.EmServerGroupBoxText = Locale.Instance.Get("AlertSetup/emServerGroupBox"); 23 | View.EmNameLabelText = Locale.Instance.Get("AlertSetup/emNameLabel"); 24 | View.EmPortLabelText = Locale.Instance.Get("AlertSetup/emPortLabel"); 25 | View.EmTestLinkLabelText = Locale.Instance.Get("AlertSetup/emTestLinkLabel"); 26 | View.EmUsernameLabelText = Locale.Instance.Get("AlertSetup/emUsernameLabel"); 27 | View.EmPasswordLabelText = Locale.Instance.Get("AlertSetup/emPasswordLabel"); 28 | View.OkButtonText = Locale.Instance.Get("AlertSetup/okButton"); 29 | View.CancelButtonText = Locale.Instance.Get("AlertSetup/cancelButton"); 30 | 31 | // View actions 32 | View.OkClick += OkClick; 33 | View.CancelClick += CancelClick; 34 | View.EmTestClick += TestClick; 35 | _eMalertService = eMalertService; 36 | } 37 | 38 | public override void Run(Alert alert) 39 | { 40 | _alert = alert; 41 | ViewRefresh(); 42 | _eMalertService.SetSettings(alert); 43 | View.Show(); 44 | } 45 | 46 | private void ViewRefresh() 47 | { 48 | View.EmFrom = _alert.email.emailFrom; 49 | View.EmLost = _alert.email.onSignalLost; 50 | View.EmLostMin = _alert.email.whenDissapearMin; 51 | View.EmPassword = _alert.email.authPassword; 52 | View.EmRecover = _alert.email.onSignalRecover; 53 | View.EmSerName = _alert.email.serverUrl; 54 | View.EmSerPort = _alert.email.serverPort; 55 | View.EmTo = _alert.email.emailTo; 56 | View.EmUsername = _alert.email.authUser; 57 | } 58 | 59 | private void ViewRead() 60 | { 61 | _alert.email.emailFrom = View.EmFrom; 62 | _alert.email.onSignalLost = View.EmLost; 63 | _alert.email.whenDissapearMin = View.EmLostMin; 64 | _alert.email.authPassword = View.EmPassword; 65 | _alert.email.onSignalRecover = View.EmRecover; 66 | _alert.email.serverUrl = View.EmSerName; 67 | _alert.email.serverPort = View.EmSerPort; 68 | _alert.email.emailTo = View.EmTo; 69 | _alert.email.authUser = View.EmUsername; 70 | } 71 | 72 | private void OkClick() 73 | { 74 | ViewRead(); 75 | View.Close(); 76 | } 77 | 78 | private void CancelClick() 79 | { 80 | View.Close(); 81 | } 82 | 83 | private void TestClick() 84 | { 85 | //ToDo: check emailFrom, emailTo 86 | ViewRead(); 87 | try 88 | { 89 | _eMalertService.SendAlert( 90 | Locale.Instance.Get("AlertSetup/testTitle"), 91 | Locale.Instance.Get("AlertSetup/testText") 92 | ); 93 | } catch (Exception e) 94 | { 95 | View.ShowError(e.Message); 96 | } 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Presenter/Presenters/MatrixSetupPresenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Model; 3 | using Presenter.Common; 4 | using Presenter.Views; 5 | 6 | namespace Presenter.Presenters 7 | { 8 | public class MatrixSetupPresenter : BasePresener 9 | { 10 | private Matrix matrix; // contains global variable 11 | private Matrix _matrix = new Matrix(); // local matrix 12 | 13 | public MatrixSetupPresenter(IApplicationController controller, IMatrixSetupView view) : base(controller, view) 14 | { 15 | // View localization 16 | View.ThisText = Locale.Instance.Get("MatrixSetup/this"); 17 | View.JoinButtonText = Locale.Instance.Get("MatrixSetup/joinButton"); 18 | View.SplitButtonText = Locale.Instance.Get("MatrixSetup/splitButton"); 19 | View.SaveButtonText = Locale.Instance.Get("MatrixSetup/saveButton"); 20 | View.CancelButtonText = Locale.Instance.Get("MatrixSetup/cancelButton"); 21 | 22 | // View actions 23 | View.SaveClick += OkClick; 24 | View.CancelClick += CancelClick; 25 | View.SizeChange += SizeChange; 26 | View.JoinClick += JoinClick; 27 | View.SplitClick += SplitClick; 28 | } 29 | 30 | public override void Run(Matrix matrix) 31 | { 32 | matrix.SaveTo(_matrix); 33 | this.matrix = matrix; 34 | View.SizeX = _matrix.cntX; 35 | View.SizeY = _matrix.cntY; 36 | CreateGrid(); 37 | View.Show(); 38 | } 39 | 40 | private void CreateGrid() 41 | { 42 | View.Clear(); //todo: do not clear, if some _matrix already exists, using View.ModifyItem 43 | int cx = _matrix.cntX; 44 | int cy = _matrix.cntY; 45 | float mx = (float)0.02; 46 | float my = (float)0.04; 47 | for (int y = 0; y < cy; y++) 48 | for (int x = 0; x < cx; x++) 49 | View.AddItem(x, y, 1, 1, 50 | (x + mx) / cx, (y + my) / cy, (1 - mx - mx) / cx, (1 - my - my) / cy); 51 | // Do joins 52 | MatrixJoin j; 53 | int i = _matrix.joins.Length; 54 | while (i > 0) 55 | { 56 | i--; 57 | j = _matrix.joins[i]; 58 | if (j.w + j.x > cx) j.w = cx - j.x; // shrink if too big width 59 | if (j.h + j.y > cy) j.h = cy - j.y; // shrink if too big height 60 | if (j.h <= 1 && j.w <= 1) 61 | { // remove join if size = 1x1 62 | _matrix.joins = (MatrixJoin[])RemoveArrayItem(_matrix.joins, i); 63 | } 64 | else 65 | { // stretch block 66 | View.ModifyItem(j.x, j.y, j.w - 1, j.h - 1, 67 | (j.x + mx) / cx, (j.y + my) / cy, (j.w - mx - mx) / cx, (j.h - my - my) / cy); 68 | } 69 | } 70 | View.Repaint(); 71 | } 72 | 73 | private void OkClick() 74 | { 75 | _matrix.SaveTo(matrix); 76 | View.Close(); 77 | } 78 | 79 | private void CancelClick() 80 | { 81 | View.Close(); 82 | } 83 | 84 | private void SizeChange() 85 | { 86 | int x = View.SizeX; 87 | int y = View.SizeY; 88 | if (_matrix.cntX != x || _matrix.cntY != y) 89 | { 90 | _matrix.cntX = x; 91 | _matrix.cntY = y; 92 | CreateGrid(); 93 | } 94 | } 95 | 96 | 97 | public static Array RemoveArrayItem(Array source, int index, int add = 0) 98 | { 99 | if (source == null) 100 | throw new ArgumentNullException("source"); 101 | 102 | if (0 > index || index >= source.Length) 103 | throw new ArgumentOutOfRangeException("index", index, "index is outside the bounds of source array"); 104 | 105 | Array dest = Array.CreateInstance(source.GetType().GetElementType(), source.Length - 1 + add); 106 | Array.Copy(source, 0, dest, 0, index); 107 | Array.Copy(source, index + 1, dest, index, source.Length - index - 1); 108 | 109 | return dest; 110 | } 111 | private void CleanMatrixAtRect(int x1, int y1, int x2, int y2, int add = 0) 112 | { 113 | MatrixJoin j; 114 | bool added = add == 0; 115 | int i = _matrix.joins.Length; 116 | while (i > 0) 117 | { 118 | i--; 119 | j = _matrix.joins[i]; 120 | if (j.x >= x1 && j.x <= x2 && j.y >= y1 && j.y <= y2) 121 | { 122 | _matrix.joins = (MatrixJoin[])RemoveArrayItem(_matrix.joins, i, added ? 0 : add); 123 | added = true; 124 | } 125 | } 126 | if (!added) Array.Resize(ref _matrix.joins, _matrix.joins.Length + add); 127 | } 128 | private void JoinClick() 129 | { 130 | int cx = _matrix.cntX; 131 | int cy = _matrix.cntY; 132 | float mx = (float)0.02; 133 | float my = (float)0.04; 134 | int x1 = View.SelX1; 135 | int y1 = View.SelY1; 136 | int x2 = View.SelX2; 137 | int y2 = View.SelY2; 138 | int w = x2 - x1 + 1; 139 | int h = y2 - y1 + 1; 140 | if (w > 1 || h > 1) 141 | { 142 | View.ModifyItem(x1, y1, w, h, 143 | (x1 + mx) / cx, (y1 + my) / cy, (w - mx - mx) / cx, (h - my - my) / cy); 144 | View.Repaint(); 145 | CleanMatrixAtRect(x1, y1, x2, y2, 1); 146 | _matrix.joins[_matrix.joins.Length - 1] = new MatrixJoin(x1, y1, w, h); 147 | } 148 | } 149 | private void SplitClick() 150 | { 151 | int cx = _matrix.cntX; 152 | int cy = _matrix.cntY; 153 | float mx = (float)0.02; 154 | float my = (float)0.04; 155 | int x1 = View.SelX1; 156 | int y1 = View.SelY1; 157 | int x2 = View.SelX2; 158 | int y2 = View.SelY2; 159 | for (int y = y1; y <= y2; y++) 160 | for (int x = x1; x <= x2; x++) 161 | View.ModifyItem(x, y, 1, 1, 162 | (x + mx) / cx, (y + my) / cy, (1 - mx - mx) / cx, (1 - my - my) / cy); 163 | View.Repaint(); 164 | CleanMatrixAtRect(x1, y1, x2, y2); 165 | } 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /Presenter/Presenters/ModifySettingsPresenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Model; 3 | using Presenter.Common; 4 | using Presenter.Views; 5 | 6 | namespace Presenter.Presenters 7 | { 8 | class ModifySettingsPresenter : BasePresenterControl 9 | { 10 | private AppSettings _appSettings = null; 11 | 12 | public ModifySettingsPresenter(IApplicationController controller, IModifySettingsView view) 13 | : base(controller, view) 14 | { 15 | // View localization 16 | View.CamNameViewGlbButtonText = Locale.Instance.Get("ModifySettings/camNameViewGlbButton"); 17 | View.AlertSetupButtonText = Locale.Instance.Get("ModifySettings/alertSetupButton"); 18 | View.MatrixSetupButtonText = Locale.Instance.Get("ModifySettings/matrixSetupButton"); 19 | View.CommandLineHelpButtonText = Locale.Instance.Get("ModifySettings/commandLineHelpButton"); 20 | View.CommandLineHelpText = Locale.Instance.Get("ModifySettings/commandLineHelp"); 21 | View.GithubLinkLabelText = Locale.Instance.Get("ModifySettings/githubLinkLabel"); 22 | 23 | // View actions 24 | View.CommandLineHelpClick += View.ShowCommandLineHelp; 25 | View.GitHubSiteClick += View.OpenGitHubSite; 26 | View.ApplyMatrixSizeClick += ModifyMatrixSize; 27 | View.ModifyNameViewClick += ModifyNameView; 28 | View.AlertSetupClick += AlertSetup; 29 | View.MatrixSetupClick += MatrixSetup; 30 | } 31 | 32 | public void SetSettings(AppSettings appSettings) 33 | { 34 | _appSettings = appSettings; 35 | View.MatrixX = appSettings.matrix.cntX; 36 | View.MatrixY = appSettings.matrix.cntY; 37 | } 38 | public event Action MatrixSizeChanged; 39 | public event Action NameViewChanged; 40 | public event Action AlertSettingsChanged; 41 | 42 | private void ModifyMatrixSize() 43 | { 44 | _appSettings.matrix.cntX = View.MatrixX; 45 | _appSettings.matrix.cntY = View.MatrixY; 46 | MatrixSizeChanged?.Invoke(); 47 | } 48 | 49 | private void ModifyNameView() 50 | { 51 | NameView nv = new NameView(); 52 | _appSettings.nameView.SaveTo(nv); 53 | Controller.Run(nv); 54 | if(!_appSettings.nameView.Equals(nv)) 55 | { 56 | _appSettings.nameView = nv; 57 | NameViewChanged?.Invoke(); 58 | } 59 | } 60 | 61 | private void AlertSetup() 62 | { 63 | Alert alert = new Alert(); 64 | _appSettings.alert.SaveTo(alert); 65 | Controller.Run(alert); 66 | if (!_appSettings.alert.Equals(alert)) 67 | { 68 | _appSettings.alert = alert; 69 | AlertSettingsChanged?.Invoke(); 70 | } 71 | } 72 | 73 | private void MatrixSetup() 74 | { 75 | Matrix matrix = new Matrix(); 76 | _appSettings.matrix.SaveTo(matrix); 77 | Controller.Run(matrix); 78 | if (!_appSettings.matrix.Equals(matrix)) 79 | { 80 | _appSettings.matrix = matrix; 81 | MatrixSizeChanged?.Invoke(); 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Presenter/Presenters/ModifySourcePresenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Model; 3 | using Presenter.Common; 4 | using Presenter.Views; 5 | 6 | namespace Presenter.Presenters 7 | { 8 | class ModifySourcePresenter : BasePresenterControl 9 | { 10 | private AppSettings _settings = null; 11 | private Camera _camera = null; 12 | private NameView _nameView = null; 13 | 14 | public ModifySourcePresenter(IApplicationController controller, IModifySourceView view) 15 | : base(controller, view) 16 | { 17 | // View localization 18 | View.CamNameLabelText = Locale.Instance.Get("ModifySource/camNameLabel"); 19 | View.CamNameText = Locale.Instance.Get("ModifySource/camName"); 20 | View.CamNameShowText = Locale.Instance.Get("ModifySource/camNameShow"); 21 | View.CamNameInheritText = Locale.Instance.Get("ModifySource/camNameInherit"); 22 | View.CamNameModifyText = Locale.Instance.Get("ModifySource/camNameModify"); 23 | View.CamEditRtsp1LabelText = Locale.Instance.Get("ModifySource/camEditRtsp1Label"); 24 | View.RtspBadText = Locale.Instance.Get("ModifySource/rtspBad"); 25 | View.CamEditRtsp2LabelText = Locale.Instance.Get("ModifySource/camEditRtsp2Label"); 26 | View.RtspGoodText = Locale.Instance.Get("ModifySource/rtspGood"); 27 | View.CamEditIconLabelText = Locale.Instance.Get("ModifySource/camEditIconLabel"); 28 | View.AspectRatioLabelText = Locale.Instance.Get("ModifySource/aspectRatioLabel"); 29 | View.AspectRatioText = Locale.Instance.Get("ModifySource/aspectRatio"); 30 | View.CreateCamButtonText = Locale.Instance.Get("ModifySource/createCamButton"); 31 | View.SaveCamButtonText = Locale.Instance.Get("ModifySource/saveCamButton"); 32 | View.CancelCamButtonText = Locale.Instance.Get("ModifySource/cancelCamButton"); 33 | View.DelCamLabelText = Locale.Instance.Get("ModifySource/delCamLabel"); 34 | View.CameraDeleteConfirm1Text = Locale.Instance.Get("ModifySource/cameraDeleteConfirm1"); 35 | View.CameraDeleteConfirm2Text = Locale.Instance.Get("ModifySource/cameraDeleteConfirm2"); 36 | View.RtspGoodOnlyInFullviewText = Locale.Instance.Get("ModifySource/rtspGoodOnlyInFullview"); 37 | 38 | // View actions 39 | View.CreateClick += SaveClick; 40 | View.SaveClick += SaveClick; 41 | View.CancelClick += CancelClick; 42 | View.DeleteClick += DeleteClick; 43 | View.NameViewClick += ModifyNameView; 44 | View.RtspBadEnter += RtspBadEnter; 45 | View.RtspGoodEnter += RtspGoodEnter; 46 | View.Hide(); 47 | } 48 | 49 | public void SetImageList(object imageList) 50 | { 51 | View.SetImges(imageList); 52 | } 53 | public void SetSettings(AppSettings settings) 54 | { 55 | _settings = settings; 56 | } 57 | public void Run(Camera camera, bool newSource = false) 58 | { 59 | _camera = camera; 60 | _nameView = new NameView(); 61 | if (_camera.nameView != null) _camera.nameView.SaveTo(_nameView); 62 | View.Show(); 63 | View.IsNewSource = newSource; 64 | View.SrcName = _camera.name; 65 | View.RtspBad = _camera.rtspBad; 66 | View.RtspGood = _camera.rtspGood; 67 | View.AspectRatio = _camera.aspectRatio; 68 | View.CamIcon = _camera.camIcon; 69 | View.Position = _camera.position; 70 | View.IsGoodOnlyInFullview = _camera.goodOnlyInFullview; 71 | View.IsNameShow = _nameView.enabled; 72 | View.IsNameInherit = _nameView.inheritGlobal; 73 | } 74 | 75 | public event Action Create; 76 | public event Action Save; 77 | public event Action Cancel; 78 | public event Action Delete; 79 | 80 | private void SaveClick() 81 | { 82 | _nameView.enabled = View.IsNameShow; 83 | _nameView.inheritGlobal = View.IsNameInherit; 84 | NameView nv = _camera.nameView == null ? new NameView() : _camera.nameView; 85 | bool notModified = nv.Equals(_nameView) && 86 | _camera.name == View.SrcName && 87 | _camera.rtspBad == View.RtspBad && 88 | _camera.rtspGood == View.RtspGood && 89 | _camera.aspectRatio == View.AspectRatio && 90 | _camera.goodOnlyInFullview == View.IsGoodOnlyInFullview && 91 | _camera.camIcon == View.CamIcon; 92 | if (notModified) 93 | { 94 | View.Hide(); 95 | Cancel?.Invoke(); 96 | } 97 | else 98 | { 99 | _camera.nameView = _nameView; 100 | _camera.name = View.SrcName; 101 | _camera.rtspBad = View.RtspBad; 102 | _camera.rtspGood = View.RtspGood; 103 | _camera.aspectRatio = View.AspectRatio; 104 | _camera.camIcon = View.CamIcon; 105 | _camera.goodOnlyInFullview = View.IsGoodOnlyInFullview; 106 | if (View.IsNewSource) Create?.Invoke(); else Save?.Invoke(); 107 | View.Hide(); 108 | } 109 | } 110 | 111 | private void CancelClick() 112 | { 113 | View.Hide(); 114 | Cancel?.Invoke(); 115 | } 116 | 117 | private void DeleteClick() 118 | { 119 | View.Hide(); 120 | Delete?.Invoke(); 121 | } 122 | 123 | private void ModifyNameView() 124 | { 125 | Controller.Run(_nameView); 126 | } 127 | 128 | private void RtspBadEnter() 129 | { 130 | bool camPosFound = false; 131 | foreach (Camera c in _settings.cams) if (c.position >= 0) camPosFound = true; 132 | if (!camPosFound) _settings.hint.Show(HintType.NewRtspBad); 133 | } 134 | private void RtspGoodEnter() 135 | { 136 | bool camPosFound = false; 137 | foreach (Camera c in _settings.cams) if (c.position >= 0) camPosFound = true; 138 | if (!camPosFound) _settings.hint.Show(HintType.NewRtspGood); 139 | } 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /Presenter/Presenters/NameViewSetupPresener.cs: -------------------------------------------------------------------------------- 1 | using Model; 2 | using Presenter.Common; 3 | using Presenter.Views; 4 | 5 | namespace Presenter.Presenters 6 | { 7 | public class NameViewSetupPresenter : BasePresener 8 | { 9 | public NameView _nameView; 10 | 11 | public NameViewSetupPresenter(IApplicationController controller, INameViewSetupView view) : base(controller, view) 12 | { 13 | // View localization 14 | View.ThisText = Locale.Instance.Get("NameViewSetup/this"); 15 | View.PositioningLabelText = Locale.Instance.Get("NameViewSetup/positioningLabel"); 16 | View.CamNameLabelText = Locale.Instance.Get("NameViewSetup/camNameLabel"); 17 | View.TextColorLabelText = Locale.Instance.Get("NameViewSetup/textColorLabel"); 18 | View.BackgroundCheckBoxText = Locale.Instance.Get("NameViewSetup/backgroundCheckBox"); 19 | View.TextSizeLabelText = Locale.Instance.Get("NameViewSetup/textSizeLabel"); 20 | View.AutoHideCheckBoxText = Locale.Instance.Get("NameViewSetup/autoHideCheckBox"); 21 | View.OkButtonText = Locale.Instance.Get("NameViewSetup/okButton"); 22 | View.CancelButtonText = Locale.Instance.Get("NameViewSetup/cancelButton"); 23 | 24 | // View actions 25 | View.OkClick += OkClick; 26 | View.CancelClick += CancelClick; 27 | } 28 | 29 | public override void Run(NameView nv) 30 | { 31 | _nameView = nv; 32 | ViewRefresh(); 33 | View.Show(); 34 | } 35 | 36 | private void ViewRefresh() 37 | { 38 | View.TextColor = _nameView.color; 39 | View.BgEnabled = _nameView.paintBg; 40 | View.BgColor = _nameView.bgColor; 41 | View.Position = (int)_nameView.position; 42 | View.TextSize = _nameView.size; 43 | View.AutoHideEnabled = _nameView.autoHide; 44 | View.AutoHideSec = _nameView.autoHideSec; 45 | } 46 | 47 | private void OkClick() 48 | { 49 | _nameView.color = View.TextColor; 50 | _nameView.paintBg = View.BgEnabled; 51 | _nameView.bgColor = View.BgColor; 52 | _nameView.position = (TextPosition)View.Position; 53 | _nameView.size = View.TextSize; 54 | _nameView.autoHide = View.AutoHideEnabled; 55 | _nameView.autoHideSec = View.AutoHideSec; 56 | View.Close(); 57 | } 58 | 59 | private void CancelClick() 60 | { 61 | View.Close(); 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /Presenter/Presenters/PlayerControlPresenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Presenter.Common; 3 | using Presenter.Views; 4 | 5 | namespace Presenter.Presenters 6 | { 7 | class PlayerControlPresenter : BasePresenterControl 8 | { 9 | public PlayerControlPresenter(IApplicationController controller, IPlayerControlView view) 10 | : base(controller, view) 11 | { 12 | View.Play += () => Invoke(Play); 13 | View.Stop += () => Invoke(Stop); 14 | View.VolumeUp += () => Invoke(VolumeUp); 15 | View.VolumeDown += () => Invoke(VolumeDown); 16 | View.OpenOptions += () => Invoke(OpenOptions); 17 | View.Maximize += () => Invoke(Maximize); 18 | View.Remove += () => Invoke(Remove); 19 | View.SourceReset(); 20 | } 21 | private void Invoke(Action action) 22 | { 23 | action?.Invoke(); 24 | } 25 | 26 | public void SourceSet() 27 | { 28 | View.SourceSet(); 29 | } 30 | public void SourceReset() { View.SourceReset(); } 31 | public void Playing() { View.Playing(); } 32 | public void Stopped() { View.Stopped(); } 33 | public void Buffering() { View.Buffering(); } 34 | public void SoundFound() { View.SoundFound(); } 35 | public void Maximized() { View.Maximized(); } 36 | public void Minimized() { View.Minimized(); } 37 | 38 | public event Action Play; 39 | public event Action Stop; 40 | public event Action VolumeUp; 41 | public event Action VolumeDown; 42 | public event Action OpenOptions; 43 | public event Action Maximize; 44 | public event Action Remove; 45 | } 46 | } -------------------------------------------------------------------------------- /Presenter/Presenters/PlayerPresenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Presenter.Common; 3 | using Presenter.Views; 4 | 5 | namespace Presenter.Presenters 6 | { 7 | class PlayerPresenter : BasePresenterControl 8 | { 9 | public PlayerPresenter(IApplicationController controller, IPlayerView view) 10 | : base(controller, view) 11 | { 12 | View.Playing += () => Invoke(Playing); 13 | View.Buffering += () => Invoke(Buffering); 14 | View.Stopped += () => Invoke(Stopped); 15 | View.SoundDetected += () => Invoke(SoundDetected); 16 | View.LostStream += () => Invoke(LostStream); 17 | View.LostStreamRestored += () => Invoke(LostStreamRestored); 18 | View.SizeDetected += () => Invoke(SizeDetected); 19 | } 20 | 21 | private void Invoke(Action action) 22 | { 23 | action?.Invoke(); 24 | } 25 | 26 | public bool Play() { 27 | return View.Play(); 28 | } 29 | public bool Stop() { return View.Stop(); } 30 | public bool IsPlaying { get => View.IsPlaying; } 31 | 32 | public event Action Playing; 33 | public event Action Buffering; 34 | public event Action Stopped; 35 | public event Action SoundDetected; 36 | public event Action SizeDetected; 37 | public event Action LostStream; 38 | public event Action LostStreamRestored; 39 | 40 | public int Volume { get => View.Volume; set => View.Volume = value; } 41 | 42 | public void SetSourceString(string value) { View.SourceString = value; } 43 | public void SetAspectRatio(string value) { View.AspectRatio = value; } 44 | public string SourceString { get => View.SourceString; } 45 | public int SrcHeight { get => View.SrcHeight; } 46 | public int SrcWidth { get => View.SrcWidth; } 47 | 48 | public int LostRtspRetryMin { get => View.LostRtspRetryMin; set => View.LostRtspRetryMin = value; } 49 | } 50 | } -------------------------------------------------------------------------------- /Presenter/Presenters/SourceListPresenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Model; 3 | using Presenter.Common; 4 | using Presenter.Views; 5 | 6 | namespace Presenter.Presenters 7 | { 8 | public class SourceListPresenter : BasePresenterControl 9 | { 10 | private AppSettings _settings = null; 11 | private ModifySourcePresenter _srcEdit = null; 12 | private Camera _camEdit = null; 13 | public Camera SourceEditedVar = null; 14 | public Camera SourceDeletedVar = null; 15 | 16 | public SourceListPresenter(IApplicationController controller, ISourceListView view) 17 | : base(controller, view) 18 | { 19 | // View localization 20 | View.TypeViewToolStripMenuItemText = Locale.Instance.Get("SourceList/typeViewToolStripMenuItem"); 21 | View.LargeIconsToolStripMenuItemText = Locale.Instance.Get("SourceList/largeIconsToolStripMenuItem"); 22 | View.SmallIconsToolStripMenuItemText = Locale.Instance.Get("SourceList/smallIconsToolStripMenuItem"); 23 | View.LargeListToolStripMenuItemText = Locale.Instance.Get("SourceList/largeListToolStripMenuItem"); 24 | View.SmallListToolStripMenuItemText = Locale.Instance.Get("SourceList/smallListToolStripMenuItem"); 25 | View.SortTypeToolStripMenuItemText = Locale.Instance.Get("SourceList/sortTypeToolStripMenuItem"); 26 | View.AscendingToolStripMenuItemText = Locale.Instance.Get("SourceList/ascendingToolStripMenuItem"); 27 | View.DescendingToolStripMenuItemText = Locale.Instance.Get("SourceList/descendingToolStripMenuItem"); 28 | View.DisabledToolStripMenuItemText = Locale.Instance.Get("SourceList/disabledToolStripMenuItem"); 29 | View.NewCameraToolStripMenuItemText = Locale.Instance.Get("SourceList/newCameraToolStripMenuItem"); 30 | View.ModifyCameraToolStripMenuItemText = Locale.Instance.Get("SourceList/modifyCameraToolStripMenuItem"); 31 | 32 | // View actions 33 | View.SortChanged += SortChanged; 34 | View.ViewChanged += ViewChanged; 35 | View.NameChanged += NameChanged; 36 | View.DoDragDropping += DoDragDropping; 37 | View.DoneDragDropping += DoneDragDropping; 38 | View.EditClick += () => EditClick(); 39 | View.NewClick += NewClick; 40 | } 41 | 42 | public event Action SourceModified; 43 | public event Action SourceDeleted; 44 | public event Action SourceCreated; 45 | 46 | public void SetSettings(AppSettings settings) 47 | { 48 | _settings = settings; 49 | View.Clear(); 50 | foreach (Camera m in _settings.cams) 51 | View.AddItem(m, m.name, m.camIcon); 52 | } 53 | 54 | public void SortChanged() 55 | { 56 | _settings.camListSort = View.ListSort; 57 | } 58 | public void ViewChanged() 59 | { 60 | _settings.camListView = View.ListView; 61 | } 62 | public void NameChanged() 63 | { 64 | Camera c = (Camera)View.SelectedObject; 65 | if (c == null) return; 66 | c.name = View.SelectedName; 67 | SourceEditedVar = c; 68 | SourceModified?.Invoke(); 69 | } 70 | 71 | private void CheckSrcEdit() 72 | { 73 | if (_srcEdit == null) 74 | { 75 | _srcEdit = Controller.Get(); 76 | View.SetModifySourceControl(_srcEdit.Control); 77 | _srcEdit.SetImageList(View.GetImageList()); 78 | _srcEdit.SetSettings(_settings); 79 | _srcEdit.Create += NewSrcCreated; 80 | _srcEdit.Save += SrcModified; 81 | _srcEdit.Delete += SrcDeleted; 82 | _srcEdit.Cancel += SrcCancelled; 83 | } 84 | } 85 | 86 | public void EditClick(Camera m = null) 87 | { 88 | if (m != null) View.SelectObject(m); 89 | _camEdit = (Camera)View.SelectedObject; 90 | if (_camEdit != null) 91 | { 92 | CheckSrcEdit(); 93 | _srcEdit.Run(_camEdit); 94 | } 95 | } 96 | public void NewClick() 97 | { 98 | _settings.hint.Hide(); 99 | _camEdit = new Camera(); 100 | CheckSrcEdit(); 101 | _srcEdit.Run(_camEdit, true); 102 | } 103 | private void NewSrcCreated() 104 | { 105 | int l = _settings.cams.Length; 106 | Array.Resize(ref _settings.cams, l + 1); 107 | _settings.cams[l] = _camEdit; 108 | View.AddItem(_camEdit, _camEdit.name, _camEdit.camIcon); 109 | View.SelectObject(_camEdit); 110 | SourceEditedVar = _camEdit; 111 | SourceCreated?.Invoke(); 112 | bool camPosFound = false; 113 | foreach (Camera c in _settings.cams) if (c.position >= 0) camPosFound = true; 114 | if (!camPosFound) _settings.hint.Show(HintType.DropCamera); 115 | } 116 | private void SrcModified() 117 | { 118 | _settings.hint.Hide(); 119 | SourceEditedVar = _camEdit; 120 | View.UpdateSelected(_camEdit.name, _camEdit.camIcon); 121 | SourceModified?.Invoke(); 122 | } 123 | private void SrcDeleted() 124 | { 125 | _settings.hint.Hide(); 126 | SourceDeletedVar = _camEdit; 127 | View.RemoveSelected(); 128 | int i = 0; 129 | Camera[] tmp = new Camera[_settings.cams.Length - 1]; 130 | foreach (Camera c in _settings.cams) if (c != SourceDeletedVar) { tmp[i] = c; i++; } 131 | Array.Resize(ref _settings.cams, 0); 132 | _settings.cams = tmp; 133 | SourceDeleted?.Invoke(); 134 | } 135 | private void SrcCancelled() 136 | { 137 | _settings.hint.Hide(); 138 | } 139 | 140 | /***** 141 | * Drag & Drop functions 142 | */ 143 | public event Action DoDragDrop; 144 | public event Action DoneDragDrop; 145 | private void DoDragDropping() { DoDragDrop?.Invoke(); } 146 | private void DoneDragDropping() { DoneDragDrop?.Invoke(); } 147 | public object DragObject { get => View.DragObject; } 148 | } 149 | } -------------------------------------------------------------------------------- /Presenter/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("MVP Presenter")] 8 | [assembly: AssemblyDescription("https://github.com/grigory-lobkov/rtsp-camera-view")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("RTSP Camera View")] 12 | [assembly: AssemblyCopyright("Copyright © 2018 Grigory Lobkov")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("a6262091-3ac6-47f2-bedd-a9b54e197c1c")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.2")] 35 | [assembly: AssemblyFileVersion("1.0.2")] 36 | -------------------------------------------------------------------------------- /Presenter/Views/IAlertSetupView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Presenter.Common; 3 | 4 | namespace Presenter.Views 5 | { 6 | public interface IAlertSetupView : IView 7 | { 8 | event Action OkClick; 9 | event Action CancelClick; 10 | 11 | void ShowError(string errorMessage); 12 | 13 | // Email 14 | event Action EmTestClick; 15 | bool EmLost { get; set; } 16 | int EmLostMin { get; set; } 17 | bool EmRecover { get; set; } 18 | string EmTo { get; set; } 19 | string EmFrom { get; set; } 20 | string EmSerName { get; set; } 21 | int EmSerPort { get; set; } 22 | string EmUsername { get; set; } 23 | string EmPassword { get; set; } 24 | 25 | // Localization 26 | string ThisText { set; } 27 | string EmailPageText { set; } 28 | string EmLostCheckBoxText { set; } 29 | string EmRecoverCheckBoxText { set; } 30 | string EmToLabelText { set; } 31 | string EmFromLabelText { set; } 32 | string EmServerGroupBoxText { set; } 33 | string EmNameLabelText { set; } 34 | string EmPortLabelText { set; } 35 | string EmTestLinkLabelText { set; } 36 | string EmUsernameLabelText { set; } 37 | string EmPasswordLabelText { set; } 38 | string OkButtonText { set; } 39 | string CancelButtonText { set; } 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Presenter/Views/IMainView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Presenter.Common; 3 | 4 | namespace Presenter.Views 5 | { 6 | public interface IMainView : IView 7 | { 8 | void SetSourceListControl(IViewControl control); 9 | void SetSettingsControl(IViewControl control); 10 | void SetGridControl(IViewControl control); 11 | 12 | void ShowError(string errorMessage); 13 | 14 | event Action OpenClosePanelClick; 15 | 16 | bool PanelState { get; set; } 17 | 18 | event Action SplitterMoved; 19 | 20 | int CtrlPanelWidth { get; set; } 21 | 22 | event Action SourcesPageSelected; 23 | event Action SettingsPageSelected; 24 | 25 | void DoFullscreen(); 26 | void ExitFullscreen(); 27 | void DoAlwaysOnTop(); 28 | void ExitAlwaysOnTop(); 29 | void MoveToScreen(int screen); 30 | void Maximize(); 31 | void SetPriority(int priority); 32 | void SetAppCaption(); 33 | 34 | void ErrorAccessSettings(string msg); 35 | void ErrorOnLoadSettings(string msg); 36 | void ErrorOnSaveSettings(string msg); 37 | void ErrorOnCreateGridNoLib(string msg); 38 | void ErrorOnCreateGridBadVer(string msg); 39 | void ErrorOnCreateGridOther(string msg); 40 | 41 | event Action ShowHintTimer; 42 | event Action HideHintTimer; 43 | bool HintShowTimer { get; set; } 44 | bool HintOpenCtrlShow { get; set; } 45 | bool HintAddCameraShow { get; set; } 46 | bool HintDropCameraShow { get; set; } 47 | bool HintNewRtspBadShow { get; set; } 48 | bool HintNewRtspGoodShow { get; set; } 49 | 50 | bool AskIfAddSamples(); 51 | 52 | string SourcesPageText { set; } 53 | string SettingsPageText { set; } 54 | string AskAddSamplesText { set; } 55 | string CreateGridCommonErrorText { set; } 56 | string CreateGridNoLibErrorText { set; } 57 | string CreateGridBadVerErrorText { set; } 58 | string CreateGridEndErrorText { set; } 59 | string SettingsSaveErrorText { set; } 60 | string SettingsLoadErrorText { set; } 61 | string SettingsAccesErrorText { set; } 62 | string HintOpenCtrlText { set; } 63 | string HintAddCameraText { set; } 64 | string HintDropCameraText { set; } 65 | string HintRTSP1Text { set; } 66 | string HintRTSP2Text { set; } 67 | string FullScreenMenuItemText { set; } 68 | string ExitFullScreenMenuItemText { set; } 69 | } 70 | } -------------------------------------------------------------------------------- /Presenter/Views/IMatrixSetupView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Presenter.Common; 3 | 4 | namespace Presenter.Views 5 | { 6 | public interface IMatrixSetupView : IView 7 | { 8 | event Action SaveClick; 9 | event Action CancelClick; 10 | event Action SizeChange; 11 | event Action JoinClick; 12 | event Action SplitClick; 13 | 14 | int SizeMaxX { set; } 15 | int SizeMaxY { set; } 16 | int SizeX { get; set; } 17 | int SizeY { get; set; } 18 | //void ResizeGrid(); 19 | 20 | void Clear(); 21 | void AddItem(int gx, int gy, int gw, int gh, float x, float y, float w, float h); 22 | void ModifyItem(int gx, int gy, int gw, int gh, float x, float y, float w, float h); 23 | void Repaint(); 24 | 25 | int SelX1 { get; } 26 | int SelX2 { get; } 27 | int SelY1 { get; } 28 | int SelY2 { get; } 29 | 30 | // Localization 31 | string ThisText { set; } 32 | string JoinButtonText { set; } 33 | string SplitButtonText { set; } 34 | string SaveButtonText { set; } 35 | string CancelButtonText { set; } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Presenter/Views/IModifySettingsView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Presenter.Common; 3 | 4 | namespace Presenter.Views 5 | { 6 | public interface IModifySettingsView : IViewControl 7 | { 8 | event Action CommandLineHelpClick; 9 | void ShowCommandLineHelp(); 10 | event Action GitHubSiteClick; 11 | void OpenGitHubSite(); 12 | int MatrixMaxX { set; } 13 | int MatrixMaxY { set; } 14 | int MatrixX { get; set; } 15 | int MatrixY { get; set; } 16 | event Action ApplyMatrixSizeClick; 17 | event Action ModifyNameViewClick; 18 | event Action AlertSetupClick; 19 | event Action MatrixSetupClick; 20 | 21 | string CamNameViewGlbButtonText { set; } 22 | string AlertSetupButtonText { set; } 23 | string MatrixSetupButtonText { set; } 24 | string CommandLineHelpButtonText { set; } 25 | string CommandLineHelpText { set; } 26 | string GithubLinkLabelText { set; } 27 | } 28 | } -------------------------------------------------------------------------------- /Presenter/Views/IModifySourceView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Presenter.Common; 3 | 4 | namespace Presenter.Views 5 | { 6 | public interface IModifySourceView : IViewControl 7 | { 8 | void SetImges(object imageList); 9 | 10 | string SrcName { get; set; } 11 | event Action NameViewClick; 12 | string RtspBad { get; set; } 13 | string RtspGood { get; set; } 14 | string AspectRatio { get; set; } 15 | int CamIcon { get; set; } 16 | int Position { get; set; } 17 | bool IsNewSource { get; set; } 18 | bool IsNameShow { get; set; } 19 | bool IsNameInherit { get; set; } 20 | int IsGoodOnlyInFullview { get; set; } 21 | 22 | event Action CreateClick; 23 | event Action SaveClick; 24 | event Action CancelClick; 25 | event Action DeleteClick; 26 | event Action RtspBadEnter; 27 | event Action RtspGoodEnter; 28 | 29 | void Show(); 30 | void Hide(); 31 | 32 | // Localization 33 | string CamNameLabelText { set; } 34 | string CamNameText { set; } 35 | string CamNameShowText { set; } 36 | string CamNameInheritText { set; } 37 | string CamNameModifyText { set; } 38 | string CamEditRtsp1LabelText { set; } 39 | string RtspBadText { set; } 40 | string CamEditRtsp2LabelText { set; } 41 | string RtspGoodText { set; } 42 | string CamEditIconLabelText { set; } 43 | string AspectRatioLabelText { set; } 44 | string AspectRatioText { set; } 45 | string CreateCamButtonText { set; } 46 | string SaveCamButtonText { set; } 47 | string CancelCamButtonText { set; } 48 | string DelCamLabelText { set; } 49 | string CameraDeleteConfirm1Text { set; } 50 | string CameraDeleteConfirm2Text { set; } 51 | string RtspGoodOnlyInFullviewText { set; } 52 | 53 | } 54 | } -------------------------------------------------------------------------------- /Presenter/Views/INameViewSetupView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using Presenter.Common; 4 | 5 | namespace Presenter.Views 6 | { 7 | public interface INameViewSetupView : IView 8 | { 9 | //event Action PositionChanged; 10 | int Position { get; set; } 11 | 12 | //event Action TextColorChanged; 13 | Color TextColor { get; set; } 14 | 15 | //event Action BgEnabledChanged; 16 | bool BgEnabled { get; set; } 17 | 18 | //event Action BgColorChanged; 19 | Color BgColor { get; set; } 20 | 21 | //event Action TextSizeChanged; 22 | int TextSize { get; set; } 23 | 24 | //event Action AutoHideEnabledChanged; 25 | bool AutoHideEnabled { get; set; } 26 | 27 | //event Action AutoHideSecChanged; 28 | int AutoHideSec { get; set; } 29 | 30 | event Action OkClick; 31 | event Action CancelClick; 32 | 33 | // Localization 34 | string ThisText { set; } 35 | string PositioningLabelText { set; } 36 | string CamNameLabelText { set; } 37 | string TextColorLabelText { set; } 38 | string BackgroundCheckBoxText { set; } 39 | string TextSizeLabelText { set; } 40 | string AutoHideCheckBoxText { set; } 41 | string OkButtonText { set; } 42 | string CancelButtonText { set; } 43 | 44 | } 45 | } -------------------------------------------------------------------------------- /Presenter/Views/IPlayerControlView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Presenter.Common; 3 | 4 | namespace Presenter.Views 5 | { 6 | public interface IPlayerControlView : IViewControl 7 | { 8 | void SourceSet(); 9 | void SourceReset(); 10 | void Playing(); 11 | void Stopped(); 12 | void Buffering(); 13 | void SoundFound(); 14 | void Maximized(); 15 | void Minimized(); 16 | 17 | event Action Play; 18 | event Action Stop; 19 | event Action VolumeUp; 20 | event Action VolumeDown; 21 | event Action OpenOptions; 22 | event Action Maximize; 23 | event Action Remove; 24 | } 25 | } -------------------------------------------------------------------------------- /Presenter/Views/IPlayerView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Presenter.Common; 3 | 4 | namespace Presenter.Views 5 | { 6 | public interface IPlayerView : IViewControl 7 | { 8 | bool Play(); 9 | bool Stop(); 10 | bool IsPlaying { get; } 11 | 12 | event Action Playing; 13 | event Action Buffering; 14 | event Action Stopped; 15 | event Action SoundDetected; 16 | event Action SizeDetected; 17 | event Action LostStream; 18 | event Action LostStreamRestored; 19 | 20 | int Volume { get; set; } 21 | string SourceString { get; set; } 22 | string AspectRatio { set; } 23 | int SrcHeight { get; } 24 | int SrcWidth { get; } 25 | int LostRtspRetryMin { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /Presenter/Views/ISourceGridView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Presenter.Common; 3 | 4 | namespace Presenter.Views 5 | { 6 | public interface ISourceGridView : IViewControl 7 | { 8 | void Clear(); 9 | void AddItem(object obj, float x, float y, float w, float h, int jw, int jh); 10 | void ModifyItem(object obj, float x, float y, float w, float h, int jw, int jh); 11 | void SwapItems(object obj1, object obj2); 12 | void Repaint(); 13 | bool OneMaximized { get; set; } 14 | 15 | event Action WatchDog; 16 | bool WatchDogTimerEnabled { get; set; } 17 | 18 | string EmLostSignalTitle { get; } 19 | string EmLostSignalSubject { get; } 20 | string EmRestoreSignalTitle { get; } 21 | string EmRestoreSignalSubject { get; } 22 | 23 | // Localization 24 | string EmailOnLostSignalTitleText { set; } 25 | string EmailOnLostSignalSubjectText { set; } 26 | string EmailOnRestoreSignalTitleText { set; } 27 | string EmailOnRestoreSignalSubjectText { set; } 28 | } 29 | } -------------------------------------------------------------------------------- /Presenter/Views/ISourceListView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Presenter.Common; 3 | 4 | namespace Presenter.Views 5 | { 6 | public interface ISourceListView : IViewControl 7 | { 8 | void Clear(); 9 | void AddItem(object obj, string name, int icoNr); 10 | object SelectedObject { get; set; } 11 | int ListSort { get; set; } 12 | event Action SortChanged; 13 | int ListView { get; set; } 14 | event Action ViewChanged; 15 | event Action EditClick; 16 | event Action NewClick; 17 | void SetModifySourceControl(IViewControl control); 18 | object GetImageList(); 19 | 20 | void SelectObject(object obj); 21 | void UpdateSelected(string name, int icoNr); 22 | void RemoveSelected(); 23 | 24 | event Action NameChanged; 25 | string SelectedName { get; set; } 26 | 27 | event Action DoDragDropping; 28 | event Action DoneDragDropping; 29 | object DragObject { get; } 30 | 31 | string TypeViewToolStripMenuItemText { set; } 32 | string LargeIconsToolStripMenuItemText { set; } 33 | string SmallIconsToolStripMenuItemText { set; } 34 | string LargeListToolStripMenuItemText { set; } 35 | string SmallListToolStripMenuItemText { set; } 36 | string SortTypeToolStripMenuItemText { set; } 37 | string AscendingToolStripMenuItemText { set; } 38 | string DescendingToolStripMenuItemText { set; } 39 | string DisabledToolStripMenuItemText { set; } 40 | string NewCameraToolStripMenuItemText { set; } 41 | string ModifyCameraToolStripMenuItemText { set; } 42 | 43 | } 44 | } -------------------------------------------------------------------------------- /Presenter/Views/ISourceView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using Presenter.Common; 4 | 5 | namespace Presenter.Views 6 | { 7 | public interface ISourceView : IViewControl 8 | { 9 | void SetBadPlayerControl(IViewControl control); 10 | void SetGoodPlayerControl(IViewControl control); 11 | void SetPlayerControlControl(IViewControl control); 12 | 13 | bool HidePlayer { get; set; } 14 | 15 | int ControlShowSec { get; set; } 16 | void ShowControl(); 17 | 18 | string SrcName { get; set; } 19 | bool SrcNameShow { get; set; } 20 | Color SrcNameColor { get; set; } 21 | bool SrcNameBg { get; set; } 22 | Color SrcNameBgColor { get; set; } 23 | int SrcNameSize { get; set; } 24 | int SrcNameAlign { get; set; } 25 | bool SrcNameAutoHide { get; set; } 26 | int SrcNameShowSec { get; set; } 27 | void SrcNameRefresh(); 28 | int Height { get; } 29 | int Width { get; } 30 | 31 | event Action MouseMoved; 32 | event Action DoubleClicked; 33 | event Action SizeChange; 34 | 35 | bool Maximized { get; set; } 36 | void Log(string str); 37 | 38 | bool SwitchToBadTimerEnabled { get; set; } 39 | bool SwitchToGoodTimerEnabled { get; set; } 40 | bool StopBadTimerEnabled { get; set; } 41 | bool StopGoodTimerEnabled { get; set; } 42 | bool StopOnInvisibleTimerEnabled { get; set; } 43 | event Action SwitchToGood; 44 | event Action SwitchToBad; 45 | event Action StopBadPlayer; 46 | event Action StopGoodPlayer; 47 | event Action StopOnInvisible; 48 | void ShowBadPlayer(); 49 | void ShowGoodPlayer(); 50 | 51 | bool SourceDragging { get; set; } 52 | event Action DragDropAccept; 53 | event Action DragDropInit; 54 | event Action DragDropInitFinish; 55 | } 56 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RTSP Camera view   [![Share](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Watch%20your%20cameras%20in%20one%20place%20for%20free&url=https://github.com/grigory-lobkov/rtsp-camera-view&hashtags=rtsp,ip-camera,windows,c#) 2 | 3 | [![FREE](https://img.shields.io/badge/price-FREE-0098f7.svg?style=flat-square)](https://github.com/grigory-lobkov/rtsp-camera-view/blob/master/LICENSE) 4 | [![Open Source](https://img.shields.io/github/last-commit/grigory-lobkov/rtsp-camera-view.svg?style=flat-square)](https://github.com/grigory-lobkov/rtsp-camera-view) 5 | [![Pro](https://img.shields.io/github/license/grigory-lobkov/rtsp-camera-view.svg?style=flat-square)](https://github.com/grigory-lobkov/rtsp-camera-view/blob/master/LICENSE) 6 | 7 | Monitoring of IP-cameras, view any streaming video sources in the grid mode 8 | 9 | Release       [![GitHub release](https://img.shields.io/github/release/grigory-lobkov/rtsp-camera-view.svg?style=flat-square)](https://github.com/grigory-lobkov/rtsp-camera-view/releases) 10 | [![Github Releases](https://img.shields.io/github/downloads-pre/grigory-lobkov/rtsp-camera-view/latest/total.svg?style=flat-square)](https://github.com/grigory-lobkov/rtsp-camera-view/releases) 11 | 12 | Beta         [![GitHub (pre-)release](https://img.shields.io/github/release/grigory-lobkov/rtsp-camera-view/all.svg?style=flat-square)](https://github.com/grigory-lobkov/rtsp-camera-view/releases) 13 | [![Github Releases](https://img.shields.io/github/downloads/grigory-lobkov/rtsp-camera-view/latest/total.svg?style=flat-square)](https://github.com/grigory-lobkov/rtsp-camera-view/releases) 14 | 15 | 16 | 17 | ![](https://user-images.githubusercontent.com/36440722/39676355-b801a8b2-5182-11e8-9d37-1002c36ac873.jpg) 18 | 19 | 20 | 21 | ## Table of contents 22 | 23 | - [Installation](#installation) 24 | - [Contributing](#contributing) 25 | - [Supported formats](#supported-formats) 26 | - [Supported languages](#supported-languages) 27 | - [Features](#features) 28 | - [Overview](#overview) 29 | - [Contributors](#contributors) 30 | - [Copyright and license](#copyright-and-license) 31 | 32 | 33 | 34 | ## Installation 35 | Dependencies 36 | - Windows XP or higher 37 | - .NET Framework 4.0 or higher 38 | - VLC 2.1.3 / 2.1.5 39 | 40 | Download executable from [Releases](https://github.com/grigory-lobkov/rtsp-camera-view/releases) and unpack 41 | 42 | You have to know url of RTSP stream to your cameras, to add them to camera list 43 | 44 | 45 | ## Contributing 46 | All contributions are more than welcomed. Contributions may close an issue, fix a bug (reported or not reported), improve the existing code, localize, add new feature, and so on. 47 | 48 | 49 | 50 | ## Supported formats 51 | - UDP/RTP Unicast, UDP/RTP Multicast, HTTP / FTP, TCP/RTP Unicast, DCCP/RTP Unicast 52 | - any video for fun: file:////Movies/Shrek.mkv 53 | 54 | 55 | 56 | ## Supported languages 57 | - English 58 | - Russian 59 | 60 | 61 | 62 | ## Features 63 | - expanding the entire window by double-clicking on the stream 64 | - automatic switching to high / low resolution stream 65 | - support for command line parameters 66 | - launching on the screen with the specified number, full-screen'ed 67 | - customizable source name 68 | - alert on video lost 69 | 70 | 71 | ## Overview 72 | [Screenshots, examples](https://github.com/grigory-lobkov/rtsp-camera-view/wiki/Overview) 73 | 74 | 75 | 76 | ## Contributors 77 | 78 | Special thanks to everyone who contributed to getting the RTSP Camera View to the current state. 79 | 80 | - [Gregory Lobkov](https://github.com/grigory-lobkov) - idea, programming, testing, design, etc 81 | 82 | 83 | 84 | ## Copyright and license 85 | 86 | Code and documentation copyright 2018-2020 [Gregory Lobkov](https://github.com/grigory-lobkov). Code released under the [Apache License 2.0](https://github.com/grigory-lobkov/rtsp-camera-view/blob/master/LICENSE). 87 | -------------------------------------------------------------------------------- /Tests/MainPresenterTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Model; 3 | using Presenter.Common; 4 | using Presenter.Presenters; 5 | using Presenter.Views; 6 | using NSubstitute; 7 | using NUnit.Framework; 8 | 9 | namespace Tests 10 | { 11 | [TestFixture] 12 | public class MainPresenterTests 13 | { 14 | } 15 | } -------------------------------------------------------------------------------- /Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("MVP Tests")] 8 | [assembly: AssemblyDescription("https://github.com/grigory-lobkov/rtsp-camera-view")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("RTSP Camera View")] 12 | [assembly: AssemblyCopyright("Copyright © 2018 Grigory Lobkov")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("4d7ff170-3020-4f61-9aa3-bf89b73acac3")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.1")] 35 | [assembly: AssemblyFileVersion("1.0.1")] 36 | -------------------------------------------------------------------------------- /Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /View/AlertSetupForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using Presenter.Views; 4 | 5 | namespace View 6 | { 7 | public partial class AlertSetupForm : Form, IAlertSetupView 8 | { 9 | public event Action OkClick; 10 | public event Action CancelClick; 11 | 12 | public AlertSetupForm() 13 | { 14 | InitializeComponent(); 15 | okButton.Click += (sender, args) => Invoke(OkClick); 16 | cancelButton.Click += (sender, args) => Invoke(CancelClick); 17 | emTestLinkLabel.LinkClicked += (sender, args) => Invoke(EmTestClick); 18 | } 19 | 20 | public new void Show() 21 | { 22 | ShowDialog(); 23 | } 24 | 25 | private void Invoke(Action action) 26 | { 27 | action?.Invoke(); 28 | } 29 | 30 | public void ShowError(string errorMessage) 31 | { 32 | MessageBox.Show(errorMessage, Application.ProductName, 33 | MessageBoxButtons.OK, MessageBoxIcon.Error); 34 | } 35 | 36 | private void NumberInput_KeyDown(object sender, KeyEventArgs e) 37 | { 38 | switch (e.KeyCode) 39 | { 40 | case Keys.Up: 41 | try 42 | { 43 | int v = Convert.ToInt32(((TextBox)sender).Text); 44 | if (v < 65536) ((TextBox)sender).Text = (v + 1).ToString(); 45 | } 46 | catch (Exception) { } 47 | break; 48 | case Keys.Down: 49 | try 50 | { 51 | int v = Convert.ToInt32(((TextBox)sender).Text); 52 | if (v > 1) ((TextBox)sender).Text = (v - 1).ToString(); 53 | if (v > 65536) ((TextBox)sender).Text = "65536"; 54 | } 55 | catch (Exception) { } 56 | break; 57 | default: 58 | base.OnKeyDown(e); 59 | break; 60 | } 61 | } 62 | private void NumberInput_KeyPress(object sender, KeyPressEventArgs e) 63 | { 64 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { e.Handled = true; } 65 | } 66 | 67 | 68 | /*** 69 | * Email tab 70 | */ 71 | 72 | public event Action EmTestClick; 73 | public bool EmLost { get => emLostCheckBox.Checked; set => emLostCheckBox.Checked = value; } 74 | public int EmLostMin { get => Convert.ToInt32(emLostMinTextBox.Text); set => emLostMinTextBox.Text = value.ToString(); } 75 | public bool EmRecover { get => emRecoverCheckBox.Checked; set => emRecoverCheckBox.Checked = value; } 76 | public string EmTo { get => emToTextBox.Text; set => emToTextBox.Text = value; } 77 | public string EmFrom { get => emFromTextBox.Text; set => emFromTextBox.Text = value; } 78 | public string EmSerName { get => emNameTextBox.Text; set => emNameTextBox.Text = value; } 79 | public int EmSerPort { get => Convert.ToInt32(emPortTextBox.Text); set => emPortTextBox.Text = value.ToString(); } 80 | public string EmUsername { get => emUsernameTextBox.Text; set => emUsernameTextBox.Text = value; } 81 | public string EmPassword { get => emPasswordTextBox.Text; set => emPasswordTextBox.Text = value; } 82 | 83 | // Localization 84 | public string ThisText { set { if (value != "") this.Text = value; } } 85 | public string EmailPageText { set { if (value != "") emailPage.Text = value; } } 86 | public string EmLostCheckBoxText { set { if (value != "") emLostCheckBox.Text = value; } } 87 | public string EmRecoverCheckBoxText { set { if (value != "") emRecoverCheckBox.Text = value; } } 88 | public string EmToLabelText { set { if (value != "") emToLabel.Text = value; } } 89 | public string EmFromLabelText { set { if (value != "") emFromLabel.Text = value; } } 90 | public string EmServerGroupBoxText { set { if (value != "") emServerGroupBox.Text = value; } } 91 | public string EmNameLabelText { set { if (value != "") emNameLabel.Text = value; } } 92 | public string EmPortLabelText { set { if (value != "") emPortLabel.Text = value; } } 93 | public string EmTestLinkLabelText { set { if (value != "") emTestLinkLabel.Text = value; } } 94 | public string EmUsernameLabelText { set { if (value != "") emUsernameLabel.Text = value; } } 95 | public string EmPasswordLabelText { set { if (value != "") emPasswordLabel.Text = value; } } 96 | public string OkButtonText { set { if (value != "") okButton.Text = value; } } 97 | public string CancelButtonText { set { if (value != "") cancelButton.Text = value; } } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /View/Components/ModifySettingsControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | using Presenter.Views; 5 | 6 | namespace View.Components 7 | { 8 | public partial class ModifySettingsControl : UserControl, IModifySettingsView 9 | { 10 | int _matrixMaxX = 8; 11 | int _matrixMaxY = 8; 12 | int _lastX; 13 | int _lastY; 14 | 15 | public event Action ModifyNameViewClick; 16 | public event Action AlertSetupClick; 17 | public event Action MatrixSetupClick; 18 | 19 | public ModifySettingsControl() 20 | { 21 | InitializeComponent(); 22 | commandLineHelpButton.Click += (sender, args) => Invoke(CommandLineHelpClick); 23 | githubLinkLabel.Click += (sender, args) => Invoke(GitHubSiteClick); 24 | camNameViewGlbButton.Click += (sender, args) => Invoke(ModifyNameViewClick); 25 | alertSetupButton.Click += (sender, args) => Invoke(AlertSetupClick); 26 | matrixSetupButton.Click += (sender, args) => Invoke(MatrixSetupClick); 27 | } 28 | 29 | private void Invoke(Action action) 30 | { 31 | action?.Invoke(); 32 | } 33 | 34 | public int MatrixMaxX 35 | { 36 | set { _matrixMaxX = value; } 37 | } 38 | 39 | public int MatrixMaxY 40 | { 41 | set { _matrixMaxY = value; } 42 | } 43 | 44 | public int MatrixX 45 | { 46 | get { return Convert.ToInt32(matrixXinput.Text); } 47 | set { matrixXinput.Text = value.ToString(); _lastX = value; } 48 | } 49 | 50 | public int MatrixY 51 | { 52 | get { return Convert.ToInt32(matrixYinput.Text); } 53 | set { matrixYinput.Text = value.ToString(); _lastY = value; } 54 | } 55 | 56 | public event Action ApplyMatrixSizeClick; 57 | 58 | public event Action CommandLineHelpClick; 59 | 60 | public void ShowCommandLineHelp() 61 | { 62 | MessageBox.Show(commandLineHelp.Text, commandLineHelpButton.Text, MessageBoxButtons.OK, MessageBoxIcon.None); 63 | } 64 | 65 | public event Action GitHubSiteClick; 66 | 67 | public void OpenGitHubSite() 68 | { 69 | System.Diagnostics.Process.Start("https://github.com/grigory-lobkov/rtsp-camera-view"); 70 | githubLinkLabel.LinkVisited = true; 71 | } 72 | 73 | private void ApplyMatrixSize_MouseEnter(object sender, EventArgs e) 74 | { 75 | ((Label)sender).ForeColor = Color.Blue; 76 | } 77 | 78 | private void ApplyMatrixSize_MouseLeave(object sender, EventArgs e) 79 | { 80 | ((Label)sender).ForeColor = SystemColors.ControlText; 81 | } 82 | 83 | private void MatrixInput_KeyDown(object sender, KeyEventArgs e) 84 | { 85 | switch (e.KeyCode) 86 | { 87 | case Keys.Up: 88 | try 89 | { 90 | int v = Convert.ToInt32(((TextBox)sender).Text); 91 | if (sender == matrixXinput && v < _matrixMaxX 92 | || sender == matrixYinput && v < _matrixMaxY) 93 | { 94 | ((TextBox)sender).Text = (v + 1).ToString(); 95 | } 96 | } 97 | catch (Exception) { } 98 | break; 99 | case Keys.Down: 100 | try 101 | { 102 | int v = Convert.ToInt32(((TextBox)sender).Text); 103 | if (v > 1) ((TextBox)sender).Text = (v - 1).ToString(); 104 | if (sender == matrixXinput) 105 | { 106 | if (v > _matrixMaxX) ((TextBox)sender).Text = _matrixMaxX.ToString(); 107 | } 108 | else if (v > _matrixMaxY) ((TextBox)sender).Text = _matrixMaxY.ToString(); 109 | } 110 | catch (Exception) { } 111 | break; 112 | default: 113 | base.OnKeyDown(e); 114 | break; 115 | } 116 | } 117 | 118 | private void MatrixInput_KeyUp(object sender, KeyEventArgs e) 119 | { 120 | try 121 | { 122 | int x = Convert.ToInt32(matrixXinput.Text); 123 | int y = Convert.ToInt32(matrixYinput.Text); 124 | applyMatrixSize.Visible = (x > 0 && y > 0 && (x != _lastX || y != _lastY) 125 | && x <= _matrixMaxX && y <= _matrixMaxY); 126 | } 127 | catch 128 | { 129 | applyMatrixSize.Visible = false; 130 | } 131 | } 132 | 133 | private void MatrixInput_KeyPress(object sender, KeyPressEventArgs e) 134 | { 135 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { e.Handled = true; } 136 | } 137 | 138 | private void ApplyMatrixSize_Click(object sender, EventArgs e) 139 | { 140 | applyMatrixSize.Visible = false; 141 | Invoke(ApplyMatrixSizeClick); 142 | _lastX = Convert.ToInt32(matrixXinput.Text); 143 | _lastY = Convert.ToInt32(matrixYinput.Text); 144 | } 145 | 146 | public string CamNameViewGlbButtonText { set { if (value != "") camNameViewGlbButton.Text = value; } } 147 | public string AlertSetupButtonText { set { if (value != "") alertSetupButton.Text = value; } } 148 | public string MatrixSetupButtonText { set { if (value != "") matrixSetupButton.Text = value; } } 149 | public string CommandLineHelpButtonText { set { if (value != "") commandLineHelpButton.Text = value; } } 150 | public string CommandLineHelpText { set { if (value != "") commandLineHelp.Text = value; } } 151 | public string GithubLinkLabelText { set { if (value != "") githubLinkLabel.Text = value; } } 152 | 153 | } 154 | } -------------------------------------------------------------------------------- /View/Components/ModifySourceControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /View/Components/SourceControl.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace View.Components 4 | { 5 | partial class SourceControl 6 | { 7 | /// 8 | /// Required designer variable. 9 | /// 10 | private System.ComponentModel.IContainer components = null; 11 | 12 | /// 13 | /// Clean up any resources being used. 14 | /// 15 | /// true if managed resources should be disposed; otherwise, false. 16 | protected override void Dispose(bool disposing) 17 | { 18 | if (disposing && (components != null)) 19 | { 20 | components.Dispose(); 21 | } 22 | base.Dispose(disposing); 23 | } 24 | 25 | #region Component Designer generated code 26 | 27 | /// 28 | /// Required method for Designer support - do not modify 29 | /// the contents of this method with the code editor. 30 | /// 31 | private void InitializeComponent() 32 | { 33 | this.components = new System.ComponentModel.Container(); 34 | this.controlHideTimer = new System.Windows.Forms.Timer(this.components); 35 | this.nameHideTimer = new System.Windows.Forms.Timer(this.components); 36 | this.switchToBadTimer = new System.Windows.Forms.Timer(this.components); 37 | this.switchToGoodTimer = new System.Windows.Forms.Timer(this.components); 38 | this.stopBadTimer = new System.Windows.Forms.Timer(this.components); 39 | this.stopGoodTimer = new System.Windows.Forms.Timer(this.components); 40 | this.stopOnInvisibleTimer = new System.Windows.Forms.Timer(this.components); 41 | this.srcName = new System.Windows.Forms.Label(); 42 | this.log = new System.Windows.Forms.ListBox(); 43 | this.topPanel = new View.Components.TopPanel(); 44 | this.hidePlayerPanel = new System.Windows.Forms.Panel(); 45 | this.SuspendLayout(); 46 | // 47 | // controlHideTimer 48 | // 49 | this.controlHideTimer.Interval = 10000; 50 | // 51 | // nameHideTimer 52 | // 53 | this.nameHideTimer.Interval = 20000; 54 | // 55 | // switchToBadTimer 56 | // 57 | this.switchToBadTimer.Interval = 10000; 58 | // 59 | // switchToGoodTimer 60 | // 61 | this.switchToGoodTimer.Interval = 5000; 62 | // 63 | // stopBadTimer 64 | // 65 | this.stopBadTimer.Interval = 60000; 66 | // 67 | // stopGoodTimer 68 | // 69 | this.stopGoodTimer.Interval = 120000; 70 | // 71 | // stopOnInvisibleTimer 72 | // 73 | this.stopOnInvisibleTimer.Interval = 240000; 74 | // 75 | // srcName 76 | // 77 | this.srcName.AutoSize = true; 78 | this.srcName.BackColor = System.Drawing.Color.Black; 79 | this.srcName.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 80 | this.srcName.ForeColor = System.Drawing.Color.White; 81 | this.srcName.Location = new System.Drawing.Point(46, 18); 82 | this.srcName.Name = "srcName"; 83 | this.srcName.Size = new System.Drawing.Size(59, 14); 84 | this.srcName.TabIndex = 0; 85 | this.srcName.Text = "nameLabel"; 86 | // 87 | // log 88 | // 89 | this.log.FormattingEnabled = true; 90 | this.log.Location = new System.Drawing.Point(124, 84); 91 | this.log.Name = "log"; 92 | this.log.ScrollAlwaysVisible = true; 93 | this.log.Size = new System.Drawing.Size(80, 108); 94 | this.log.TabIndex = 0; 95 | this.log.Visible = false; 96 | // 97 | // topPanel 98 | // 99 | this.topPanel.AllowDrop = true; 100 | this.topPanel.Dock = System.Windows.Forms.DockStyle.Fill; 101 | this.topPanel.Location = new System.Drawing.Point(0, 0); 102 | this.topPanel.Name = "topPanel"; 103 | this.topPanel.Size = new System.Drawing.Size(150, 150); 104 | this.topPanel.TabIndex = 1; 105 | this.topPanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.TopPanel_DragDrop); 106 | this.topPanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.TopPanel_DragEnter); 107 | this.topPanel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TopPanel_MouseDown); 108 | this.topPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.TopPanel_MouseMove); 109 | this.topPanel.MouseUp += new System.Windows.Forms.MouseEventHandler(this.TopPanel_MouseUp); 110 | // 111 | // hidePlayerPanel 112 | // 113 | this.hidePlayerPanel.Dock = System.Windows.Forms.DockStyle.Fill; 114 | this.hidePlayerPanel.ForeColor = System.Drawing.Color.White; 115 | this.hidePlayerPanel.Location = new System.Drawing.Point(0, 0); 116 | this.hidePlayerPanel.Name = "hidePlayerPanel"; 117 | this.hidePlayerPanel.Size = new System.Drawing.Size(150, 150); 118 | this.hidePlayerPanel.TabIndex = 2; 119 | // 120 | // SourceControl 121 | // 122 | this.AllowDrop = true; 123 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 124 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 125 | this.BackColor = System.Drawing.Color.Black; 126 | this.Controls.Add(this.log); 127 | this.Controls.Add(this.srcName); 128 | this.Controls.Add(this.topPanel); 129 | this.Controls.Add(this.hidePlayerPanel); 130 | this.Name = "SourceControl"; 131 | this.Resize += new System.EventHandler(this.SourceControl_Resize); 132 | this.ResumeLayout(false); 133 | this.PerformLayout(); 134 | 135 | } 136 | 137 | #endregion 138 | 139 | private Timer controlHideTimer; 140 | private Timer nameHideTimer; 141 | private Timer switchToGoodTimer; 142 | private Timer switchToBadTimer; 143 | private Timer stopBadTimer; 144 | private Timer stopGoodTimer; 145 | private Timer stopOnInvisibleTimer; 146 | private Label srcName; 147 | private TopPanel topPanel; 148 | private ListBox log; 149 | private Panel hidePlayerPanel; 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /View/Components/SourceGridControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace View.Components 2 | { 3 | partial class SourceGridControl 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 Component 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.components = new System.ComponentModel.Container(); 32 | this.WatchDogTimer = new System.Windows.Forms.Timer(this.components); 33 | this.EmailOnLostSignalTitle = new System.Windows.Forms.Label(); 34 | this.EmailOnLostSignalSubject = new System.Windows.Forms.Label(); 35 | this.EmailOnRestoreSignalSubject = new System.Windows.Forms.Label(); 36 | this.EmailOnRestoreSignalTitle = new System.Windows.Forms.Label(); 37 | this.SuspendLayout(); 38 | // 39 | // WatchDogTimer 40 | // 41 | this.WatchDogTimer.Interval = 50000; 42 | // 43 | // EmailOnLostSignalTitle 44 | // 45 | this.EmailOnLostSignalTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 46 | this.EmailOnLostSignalTitle.AutoSize = true; 47 | this.EmailOnLostSignalTitle.Location = new System.Drawing.Point(3, 251); 48 | this.EmailOnLostSignalTitle.Name = "EmailOnLostSignalTitle"; 49 | this.EmailOnLostSignalTitle.Size = new System.Drawing.Size(91, 13); 50 | this.EmailOnLostSignalTitle.TabIndex = 0; 51 | this.EmailOnLostSignalTitle.Text = "{name} LOST link"; 52 | this.EmailOnLostSignalTitle.Visible = false; 53 | // 54 | // EmailOnLostSignalSubject 55 | // 56 | this.EmailOnLostSignalSubject.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 57 | this.EmailOnLostSignalSubject.AutoSize = true; 58 | this.EmailOnLostSignalSubject.Location = new System.Drawing.Point(3, 273); 59 | this.EmailOnLostSignalSubject.Name = "EmailOnLostSignalSubject"; 60 | this.EmailOnLostSignalSubject.Size = new System.Drawing.Size(114, 104); 61 | this.EmailOnLostSignalSubject.TabIndex = 1; 62 | this.EmailOnLostSignalSubject.Text = "Signal of {name} is lost\r\n\r\nBad stream url:\r\n{bad}\r\n\r\nGood stream url:\r\n{good}\r\n\r" + 63 | "\n"; 64 | this.EmailOnLostSignalSubject.Visible = false; 65 | // 66 | // EmailOnRestoreSignalSubject 67 | // 68 | this.EmailOnRestoreSignalSubject.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 69 | this.EmailOnRestoreSignalSubject.AutoSize = true; 70 | this.EmailOnRestoreSignalSubject.Location = new System.Drawing.Point(157, 273); 71 | this.EmailOnRestoreSignalSubject.Name = "EmailOnRestoreSignalSubject"; 72 | this.EmailOnRestoreSignalSubject.Size = new System.Drawing.Size(146, 104); 73 | this.EmailOnRestoreSignalSubject.TabIndex = 3; 74 | this.EmailOnRestoreSignalSubject.Text = "Signal of {name} is recovered\r\n\r\nBad stream url:\r\n{bad}\r\n\r\nGood stream url:\r\n{goo" + 75 | "d}\r\n\r\n"; 76 | this.EmailOnRestoreSignalSubject.Visible = false; 77 | // 78 | // EmailOnRestoreSignalTitle 79 | // 80 | this.EmailOnRestoreSignalTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 81 | this.EmailOnRestoreSignalTitle.AutoSize = true; 82 | this.EmailOnRestoreSignalTitle.Location = new System.Drawing.Point(157, 251); 83 | this.EmailOnRestoreSignalTitle.Name = "EmailOnRestoreSignalTitle"; 84 | this.EmailOnRestoreSignalTitle.Size = new System.Drawing.Size(111, 13); 85 | this.EmailOnRestoreSignalTitle.TabIndex = 2; 86 | this.EmailOnRestoreSignalTitle.Text = "{name} recovered link"; 87 | this.EmailOnRestoreSignalTitle.Visible = false; 88 | // 89 | // SourceGridControl 90 | // 91 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 92 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 93 | this.BackColor = System.Drawing.SystemColors.ControlDarkDark; 94 | this.Controls.Add(this.EmailOnRestoreSignalSubject); 95 | this.Controls.Add(this.EmailOnRestoreSignalTitle); 96 | this.Controls.Add(this.EmailOnLostSignalSubject); 97 | this.Controls.Add(this.EmailOnLostSignalTitle); 98 | this.Name = "SourceGridControl"; 99 | this.Size = new System.Drawing.Size(470, 377); 100 | this.Resize += new System.EventHandler(this.SourceGridControl_Resize); 101 | this.ResumeLayout(false); 102 | this.PerformLayout(); 103 | 104 | } 105 | 106 | #endregion 107 | 108 | private System.Windows.Forms.Timer WatchDogTimer; 109 | private System.Windows.Forms.Label EmailOnLostSignalTitle; 110 | private System.Windows.Forms.Label EmailOnLostSignalSubject; 111 | private System.Windows.Forms.Label EmailOnRestoreSignalSubject; 112 | private System.Windows.Forms.Label EmailOnRestoreSignalTitle; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /View/Components/SourceGridControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Windows.Forms; 5 | using Presenter.Views; 6 | 7 | namespace View.Components 8 | { 9 | public partial class SourceGridControl : UserControl, ISourceGridView 10 | { 11 | List _items = new List(); 12 | 13 | public SourceGridControl() 14 | { 15 | InitializeComponent(); 16 | WatchDogTimer.Tick += (sender, args) => { WatchDogTimer.Enabled = false; Invoke(WatchDog); }; 17 | } 18 | 19 | public void Clear() 20 | { 21 | foreach (GridItem i in _items) 22 | { 23 | Controls.Remove(i.control); 24 | i.control.Dispose(); 25 | } 26 | _items.Clear(); 27 | } 28 | 29 | public void AddItem(object obj, float x, float y, float w, float h, int jw, int jh) 30 | { 31 | this.SuspendLayout(); 32 | Control control = (Control)obj; 33 | Controls.Add(control); 34 | _items.Add(new GridItem(control, x, y, w, h, jw, jh)); 35 | this.ResumeLayout(false); 36 | } 37 | 38 | public void ModifyItem(object obj, float x, float y, float w, float h, int jw, int jh) 39 | { 40 | foreach (GridItem i in _items) 41 | { 42 | if (i.control == obj) 43 | { 44 | i.x = x; 45 | i.y = y; 46 | i.w = w; 47 | i.h = h; 48 | i.jw = jw; 49 | i.jh = jh; 50 | } 51 | } 52 | } 53 | 54 | public void SwapItems(object obj1, object obj2) 55 | { 56 | GridItem fi = null, ti = null; 57 | foreach (GridItem i in _items) 58 | { 59 | if (i.control == obj1) fi = i; 60 | if (i.control == obj2) ti = i; 61 | } 62 | if (fi != null && ti != null) 63 | { 64 | Control t = fi.control; 65 | fi.control = ti.control; 66 | ti.control = t; 67 | } 68 | Repaint(); 69 | } 70 | 71 | public void Repaint() 72 | { 73 | if (!oneMaximized) 74 | { 75 | int h = ClientRectangle.Height, w = ClientRectangle.Width; 76 | foreach (GridItem i in _items) 77 | { 78 | i.control.MinimumSize = new Size(i.jw, i.jh); 79 | i.control.Location = new Point((int)(i.x * w), (int)(i.y * h)); 80 | i.control.Size = new Size((int)(i.w * w), (int)(i.h * h)); 81 | } 82 | } 83 | } 84 | 85 | private void SourceGridControl_Resize(object sender, EventArgs e) 86 | { 87 | Repaint(); 88 | } 89 | 90 | private bool oneMaximized = false; 91 | public bool OneMaximized 92 | { 93 | get => oneMaximized; 94 | set { oneMaximized = value; Repaint(); } 95 | } 96 | 97 | public event Action WatchDog; 98 | public bool WatchDogTimerEnabled 99 | { 100 | get => WatchDogTimer.Enabled; 101 | set { if (value) WatchDogTimer.Enabled = false; WatchDogTimer.Enabled = value; } 102 | } 103 | 104 | public string EmLostSignalTitle { get => EmailOnLostSignalTitle.Text; } 105 | public string EmLostSignalSubject { get => EmailOnLostSignalSubject.Text; } 106 | public string EmRestoreSignalTitle { get => EmailOnRestoreSignalTitle.Text; } 107 | public string EmRestoreSignalSubject { get => EmailOnRestoreSignalSubject.Text; } 108 | 109 | // Localization 110 | public string EmailOnLostSignalTitleText { set { if (value != "") EmailOnLostSignalTitle.Text = value; } } 111 | public string EmailOnLostSignalSubjectText { set { if (value != "") EmailOnLostSignalSubject.Text = value; } } 112 | public string EmailOnRestoreSignalTitleText { set { if (value != "") EmailOnRestoreSignalTitle.Text = value; } } 113 | public string EmailOnRestoreSignalSubjectText { set { if (value != "") EmailOnRestoreSignalSubject.Text = value; } } 114 | 115 | } 116 | 117 | public class GridItem 118 | { 119 | public Control control; 120 | public float x; 121 | public float y; 122 | public float w; 123 | public float h; 124 | public int jw; 125 | public int jh; 126 | public GridItem(Control Obj, float X, float Y, float W, float H, int JW, int JH) 127 | { 128 | control = Obj; 129 | x = X; 130 | y = Y; 131 | w = W; 132 | h = H; 133 | jw = JW; 134 | jh = JH; 135 | } 136 | } 137 | } -------------------------------------------------------------------------------- /View/Components/SourceGridControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 1, 1 122 | 123 | 124 | 25 125 | 126 | -------------------------------------------------------------------------------- /View/LightInjectAdapter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | using Presenter.Common; 4 | using LightInject; 5 | 6 | namespace View 7 | { 8 | public class LightInjectAdapter : IContainer 9 | { 10 | private readonly ServiceContainer _container = new ServiceContainer(); 11 | 12 | public void Register() where TImplementation : TService 13 | { 14 | _container.Register(); 15 | } 16 | 17 | public void Register() 18 | { 19 | _container.Register(); 20 | } 21 | 22 | public void RegisterInstance(T instance) 23 | { 24 | _container.RegisterInstance(instance); 25 | } 26 | 27 | public void Register(Expression> factory) 28 | { 29 | _container.Register(serviceFactory => factory); 30 | } 31 | 32 | public TService Resolve() 33 | { 34 | return _container.GetInstance(); 35 | } 36 | 37 | public bool IsRegistered() 38 | { 39 | return _container.CanGetInstance(typeof (TService), string.Empty); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /View/MatrixSetupForm.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace View 4 | { 5 | partial class MatrixSetupForm 6 | { 7 | /// 8 | /// Required designer variable. 9 | /// 10 | private System.ComponentModel.IContainer components = null; 11 | 12 | /// 13 | /// Clean up any resources being used. 14 | /// 15 | /// true if managed resources should be disposed; otherwise, false. 16 | protected override void Dispose(bool disposing) 17 | { 18 | if (disposing && (components != null)) 19 | { 20 | components.Dispose(); 21 | } 22 | base.Dispose(disposing); 23 | } 24 | 25 | #region Windows Form Designer generated code 26 | 27 | /// 28 | /// Required method for Designer support - do not modify 29 | /// the contents of this method with the code editor. 30 | /// 31 | private void InitializeComponent() 32 | { 33 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MatrixSetupForm)); 34 | this.controlPanel = new System.Windows.Forms.Panel(); 35 | this.sizeYinput = new System.Windows.Forms.TextBox(); 36 | this.splitButton = new System.Windows.Forms.Button(); 37 | this.sizeXinput = new System.Windows.Forms.TextBox(); 38 | this.xLabel = new System.Windows.Forms.Label(); 39 | this.joinButton = new System.Windows.Forms.Button(); 40 | this.gridPanel = new System.Windows.Forms.Panel(); 41 | this.panel1 = new System.Windows.Forms.Panel(); 42 | this.cancelButton = new System.Windows.Forms.Button(); 43 | this.saveButton = new System.Windows.Forms.Button(); 44 | this.topPanel = new View.SelectRectPanel(); 45 | this.controlPanel.SuspendLayout(); 46 | this.panel1.SuspendLayout(); 47 | this.SuspendLayout(); 48 | // 49 | // controlPanel 50 | // 51 | this.controlPanel.Controls.Add(this.sizeYinput); 52 | this.controlPanel.Controls.Add(this.splitButton); 53 | this.controlPanel.Controls.Add(this.sizeXinput); 54 | this.controlPanel.Controls.Add(this.xLabel); 55 | this.controlPanel.Controls.Add(this.joinButton); 56 | resources.ApplyResources(this.controlPanel, "controlPanel"); 57 | this.controlPanel.Name = "controlPanel"; 58 | // 59 | // sizeYinput 60 | // 61 | resources.ApplyResources(this.sizeYinput, "sizeYinput"); 62 | this.sizeYinput.Name = "sizeYinput"; 63 | this.sizeYinput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.IntInput_KeyDown); 64 | this.sizeYinput.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.IntInput_KeyPress); 65 | this.sizeYinput.KeyUp += new System.Windows.Forms.KeyEventHandler(this.IntInput_KeyUp); 66 | // 67 | // splitButton 68 | // 69 | resources.ApplyResources(this.splitButton, "splitButton"); 70 | this.splitButton.Name = "splitButton"; 71 | this.splitButton.UseVisualStyleBackColor = true; 72 | // 73 | // sizeXinput 74 | // 75 | resources.ApplyResources(this.sizeXinput, "sizeXinput"); 76 | this.sizeXinput.Name = "sizeXinput"; 77 | this.sizeXinput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.IntInput_KeyDown); 78 | this.sizeXinput.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.IntInput_KeyPress); 79 | this.sizeXinput.KeyUp += new System.Windows.Forms.KeyEventHandler(this.IntInput_KeyUp); 80 | // 81 | // xLabel 82 | // 83 | resources.ApplyResources(this.xLabel, "xLabel"); 84 | this.xLabel.Name = "xLabel"; 85 | // 86 | // joinButton 87 | // 88 | resources.ApplyResources(this.joinButton, "joinButton"); 89 | this.joinButton.Name = "joinButton"; 90 | this.joinButton.UseVisualStyleBackColor = true; 91 | // 92 | // gridPanel 93 | // 94 | resources.ApplyResources(this.gridPanel, "gridPanel"); 95 | this.gridPanel.Name = "gridPanel"; 96 | // 97 | // panel1 98 | // 99 | this.panel1.Controls.Add(this.cancelButton); 100 | this.panel1.Controls.Add(this.saveButton); 101 | resources.ApplyResources(this.panel1, "panel1"); 102 | this.panel1.Name = "panel1"; 103 | // 104 | // cancelButton 105 | // 106 | resources.ApplyResources(this.cancelButton, "cancelButton"); 107 | this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 108 | this.cancelButton.Name = "cancelButton"; 109 | this.cancelButton.UseVisualStyleBackColor = true; 110 | // 111 | // saveButton 112 | // 113 | resources.ApplyResources(this.saveButton, "saveButton"); 114 | this.saveButton.BackColor = System.Drawing.SystemColors.ControlLight; 115 | this.saveButton.Name = "saveButton"; 116 | this.saveButton.UseVisualStyleBackColor = false; 117 | // 118 | // topPanel 119 | // 120 | resources.ApplyResources(this.topPanel, "topPanel"); 121 | this.topPanel.Name = "topPanel"; 122 | // 123 | // MatrixSetupForm 124 | // 125 | resources.ApplyResources(this, "$this"); 126 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 127 | this.Controls.Add(this.topPanel); 128 | this.Controls.Add(this.gridPanel); 129 | this.Controls.Add(this.panel1); 130 | this.Controls.Add(this.controlPanel); 131 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; 132 | this.Name = "MatrixSetupForm"; 133 | this.Shown += new System.EventHandler(this.MatrixSetupForm_Shown); 134 | this.controlPanel.ResumeLayout(false); 135 | this.controlPanel.PerformLayout(); 136 | this.panel1.ResumeLayout(false); 137 | this.ResumeLayout(false); 138 | 139 | } 140 | 141 | #endregion 142 | 143 | private Panel controlPanel; 144 | private TextBox sizeYinput; 145 | private Button splitButton; 146 | private TextBox sizeXinput; 147 | private Label xLabel; 148 | private Button joinButton; 149 | private Panel gridPanel; 150 | private Panel panel1; 151 | private Button cancelButton; 152 | private Button saveButton; 153 | private SelectRectPanel topPanel; 154 | } 155 | } -------------------------------------------------------------------------------- /View/NameViewSetupForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | using Presenter.Views; 5 | 6 | namespace View 7 | { 8 | public partial class NameViewSetupForm : Form, INameViewSetupView 9 | { 10 | private readonly ApplicationContext _context; 11 | 12 | private int _position; 13 | public int Position { 14 | get { return _position; } 15 | set { _position = value; RefreshPositionBottons(); } 16 | } 17 | 18 | public Color TextColor { 19 | get { return textColorPanel.BackColor; } 20 | set { textColorPanel.BackColor = value; RefreshPositionBottons(); } 21 | } 22 | 23 | public bool BgEnabled 24 | { 25 | get { return backgroundCheckBox.Checked; } 26 | set { backgroundCheckBox.Checked = value; RefreshPositionBottons(); } 27 | } 28 | 29 | public Color BgColor { 30 | get { return backgroundPanel.BackColor; } 31 | set { backgroundPanel.BackColor = value; RefreshPositionBottons(); } 32 | } 33 | 34 | public int TextSize 35 | { 36 | get { return textSizeTrackBar.Value; } 37 | set { textSizeTrackBar.Value = value; } 38 | } 39 | 40 | public bool AutoHideEnabled 41 | { 42 | get { return autoHideCheckBox.Checked; } 43 | set 44 | { 45 | autoHideCheckBox.Checked = value; 46 | autoHideTrackBar.Enabled = value; 47 | } 48 | } 49 | 50 | public int AutoHideSec 51 | { 52 | get { return autoHideTrackBar.Value; } 53 | set { autoHideTrackBar.Value = value; } 54 | } 55 | 56 | public event Action OkClick; 57 | public event Action CancelClick; 58 | 59 | public NameViewSetupForm(ApplicationContext context) 60 | { 61 | _context = context; 62 | InitializeComponent(); 63 | okButton.Click += (sender, args) => Invoke(OkClick); 64 | cancelButton.Click += (sender, args) => Invoke(CancelClick); 65 | backgroundCheckBox.CheckedChanged += (sender, args) => RefreshPositionBottons(); 66 | topLeftButton.Click += (sender, args) => RefreshPositionBottons(1); 67 | topCenterButton.Click += (sender, args) => RefreshPositionBottons(2); 68 | topRightButton.Click += (sender, args) => RefreshPositionBottons(3); 69 | bottomLeftButton.Click += (sender, args) => RefreshPositionBottons(7); 70 | bottomCenterButton.Click += (sender, args) => RefreshPositionBottons(8); 71 | bottomRightButton.Click += (sender, args) => RefreshPositionBottons(9); 72 | textColorPanel.MouseDoubleClick += (sender, args) => TextColorButton_Click(sender, null); 73 | backgroundPanel.MouseDoubleClick += (sender, args) => BackgroundButton_Click(sender, null); 74 | } 75 | 76 | public new void Show() 77 | { 78 | ShowDialog(); 79 | } 80 | 81 | private void Invoke(Action action) 82 | { 83 | action?.Invoke(); 84 | } 85 | 86 | 87 | 88 | /***** 89 | * Positioning area actions 90 | */ 91 | private void RefreshPositionBottons(int position = 0) 92 | { 93 | if (position > 0) _position = position; 94 | if (_position > 0) 95 | { 96 | RefreshPositionBotton(topLeftButton, _position == 1); 97 | RefreshPositionBotton(topCenterButton, _position == 2); 98 | RefreshPositionBotton(topRightButton, _position == 3); 99 | RefreshPositionBotton(bottomLeftButton, _position == 7); 100 | RefreshPositionBotton(bottomCenterButton, _position == 8); 101 | RefreshPositionBotton(bottomRightButton, _position == 9); 102 | } 103 | } 104 | 105 | private void RefreshPositionBotton(Button b, bool selected) 106 | { 107 | b.Text = selected ? camNameLabel.Text : null; 108 | if (backgroundCheckBox.Checked) 109 | b.BackColor = selected ? backgroundPanel.BackColor : Color.Transparent; 110 | else b.BackColor = Color.Transparent; 111 | b.ForeColor = selected ? textColorPanel.BackColor : SystemColors.ControlText; 112 | } 113 | 114 | /***** 115 | * Color area actions 116 | */ 117 | private void TextColorButton_Click(object sender, EventArgs e) 118 | { 119 | colorDialog.Color = textColorPanel.BackColor; 120 | if (colorDialog.ShowDialog() == DialogResult.OK) 121 | { 122 | textColorPanel.BackColor = colorDialog.Color; 123 | RefreshPositionBottons(); 124 | } 125 | } 126 | 127 | private void BackgroundButton_Click(object sender, EventArgs e) 128 | { 129 | colorDialog.Color = backgroundPanel.BackColor; 130 | if (colorDialog.ShowDialog() == DialogResult.OK) 131 | { 132 | backgroundPanel.BackColor = colorDialog.Color; 133 | RefreshPositionBottons(); 134 | } 135 | } 136 | 137 | private void AutoHideCheckBox_Click(object sender, EventArgs e) 138 | { 139 | autoHideTrackBar.Enabled = autoHideCheckBox.Checked; 140 | } 141 | 142 | // Localization 143 | public string ThisText { set { if (value != "") this.Text = value; } } 144 | public string PositioningLabelText { set { if (value != "") positioningLabel.Text = value; } } 145 | public string CamNameLabelText { set { if (value != "") camNameLabel.Text = value; } } 146 | public string TextColorLabelText { set { if (value != "") textColorLabel.Text = value; } } 147 | public string BackgroundCheckBoxText { set { if (value != "") backgroundCheckBox.Text = value; } } 148 | public string TextSizeLabelText { set { if (value != "") textSizeLabel.Text = value; } } 149 | public string AutoHideCheckBoxText { set { if (value != "") autoHideCheckBox.Text = value; } } 150 | public string OkButtonText { set { if (value != "") okButton.Text = value; } } 151 | public string CancelButtonText { set { if (value != "") cancelButton.Text = value; } } 152 | 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /View/NameViewSetupForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /View/Program.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | using Model; 3 | using Presenter.Views; 4 | using View; 5 | using View.Components; 6 | 7 | namespace UI 8 | { 9 | internal static class Program 10 | { 11 | public static readonly ApplicationContext Context = new ApplicationContext(); 12 | [System.STAThread] 13 | private static void Main() 14 | { 15 | //System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr-CA"); 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | 19 | var controller = new Presenter.Common.ApplicationController(new LightInjectAdapter()) 20 | .RegisterControl() 21 | .RegisterControl() 22 | .RegisterControl() 23 | .RegisterControl() 24 | .RegisterControl() 25 | .RegisterControl() 26 | .RegisterControl() 27 | .RegisterView() 28 | .RegisterView() 29 | .RegisterView() 30 | .RegisterView() 31 | .RegisterService() 32 | .RegisterService() 33 | .RegisterInstance(Context); 34 | 35 | controller.Run(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /View/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("View multiple RTSP-streams of IP-cameras in grid")] 8 | [assembly: AssemblyDescription("https://github.com/grigory-lobkov/rtsp-camera-view")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("RTSP Camera View")] 12 | [assembly: AssemblyCopyright("Copyright © 2020 Grigory Lobkov")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("c3659464-924d-482e-8092-395a0cd89247")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.3")] 35 | [assembly: AssemblyFileVersion("1.0.3")] 36 | -------------------------------------------------------------------------------- /View/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 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 RtspCameraView.Properties { 12 | using System; 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", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RtspCameraView.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap btn_close { 67 | get { 68 | object obj = ResourceManager.GetObject("btn_close", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap btn_eject { 77 | get { 78 | object obj = ResourceManager.GetObject("btn_eject", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap btn_maximize { 87 | get { 88 | object obj = ResourceManager.GetObject("btn_maximize", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap btn_minimize { 97 | get { 98 | object obj = ResourceManager.GetObject("btn_minimize", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap btn_options { 107 | get { 108 | object obj = ResourceManager.GetObject("btn_options", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Drawing.Bitmap. 115 | /// 116 | internal static System.Drawing.Bitmap btn_play { 117 | get { 118 | object obj = ResourceManager.GetObject("btn_play", resourceCulture); 119 | return ((System.Drawing.Bitmap)(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// Looks up a localized resource of type System.Drawing.Bitmap. 125 | /// 126 | internal static System.Drawing.Bitmap btn_stop { 127 | get { 128 | object obj = ResourceManager.GetObject("btn_stop", resourceCulture); 129 | return ((System.Drawing.Bitmap)(obj)); 130 | } 131 | } 132 | 133 | /// 134 | /// Looks up a localized resource of type System.Drawing.Bitmap. 135 | /// 136 | internal static System.Drawing.Bitmap btn_vol_minus { 137 | get { 138 | object obj = ResourceManager.GetObject("btn_vol_minus", resourceCulture); 139 | return ((System.Drawing.Bitmap)(obj)); 140 | } 141 | } 142 | 143 | /// 144 | /// Looks up a localized resource of type System.Drawing.Bitmap. 145 | /// 146 | internal static System.Drawing.Bitmap btn_vol_plus { 147 | get { 148 | object obj = ResourceManager.GetObject("btn_vol_plus", resourceCulture); 149 | return ((System.Drawing.Bitmap)(obj)); 150 | } 151 | } 152 | 153 | /// 154 | /// Looks up a localized resource of type System.Drawing.Bitmap. 155 | /// 156 | internal static System.Drawing.Bitmap btn_wait { 157 | get { 158 | object obj = ResourceManager.GetObject("btn_wait", resourceCulture); 159 | return ((System.Drawing.Bitmap)(obj)); 160 | } 161 | } 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /View/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /View/appicon-1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/appicon-1.ico -------------------------------------------------------------------------------- /View/formicon-1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/formicon-1.ico -------------------------------------------------------------------------------- /View/ico/appicon-1.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/appicon-1.ai -------------------------------------------------------------------------------- /View/ico/appicon-1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/appicon-1.ico -------------------------------------------------------------------------------- /View/ico/appicon-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/appicon-1.png -------------------------------------------------------------------------------- /View/ico/btn-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/btn-close.png -------------------------------------------------------------------------------- /View/ico/btn-eject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/btn-eject.png -------------------------------------------------------------------------------- /View/ico/btn-maximize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/btn-maximize.png -------------------------------------------------------------------------------- /View/ico/btn-minimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/btn-minimize.png -------------------------------------------------------------------------------- /View/ico/btn-options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/btn-options.png -------------------------------------------------------------------------------- /View/ico/btn-play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/btn-play.png -------------------------------------------------------------------------------- /View/ico/btn-stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/btn-stop.png -------------------------------------------------------------------------------- /View/ico/btn-vol-minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/btn-vol-minus.png -------------------------------------------------------------------------------- /View/ico/btn-vol-plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/btn-vol-plus.png -------------------------------------------------------------------------------- /View/ico/btn-wait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/btn-wait.png -------------------------------------------------------------------------------- /View/ico/cam1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/cam1.png -------------------------------------------------------------------------------- /View/ico/cam2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/cam2.png -------------------------------------------------------------------------------- /View/ico/cameras-set.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/cameras-set.png -------------------------------------------------------------------------------- /View/ico/icon-set.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/View/ico/icon-set.png -------------------------------------------------------------------------------- /View/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ViewVlc215/AxInterop.AXVLC.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/ViewVlc215/AxInterop.AXVLC.dll -------------------------------------------------------------------------------- /ViewVlc215/Interop.AXVLC.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grigory-lobkov/rtsp-camera-view/7f2251885d21d7814d0409dc66514511c80c2496/ViewVlc215/Interop.AXVLC.dll -------------------------------------------------------------------------------- /ViewVlc215/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("VLC 2.1.5 view")] 9 | [assembly: AssemblyDescription("https://github.com/grigory-lobkov/rtsp-camera-view")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("RTSP Camera View")] 13 | [assembly: AssemblyCopyright("Copyright © 2018 Grigory Lobkov")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5d6a8f8c-07e2-4c4e-b584-0383ef1b769d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.1")] 36 | [assembly: AssemblyFileVersion("1.0.1")] 37 | -------------------------------------------------------------------------------- /ViewVlc215/ViewVlc215.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {5D6A8F8C-07E2-4C4E-B584-0383EF1B769D} 8 | Library 9 | Properties 10 | ViewVlc215 11 | ViewVlc215 12 | v4.0 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | x86 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | x86 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | {DF2BBE39-40A8-433B-A279-073F48DA94B6} 47 | 1 48 | 0 49 | 0 50 | aximp 51 | False 52 | 53 | 54 | {DF2BBE39-40A8-433B-A279-073F48DA94B6} 55 | 1 56 | 0 57 | 0 58 | tlbimp 59 | False 60 | True 61 | 62 | 63 | 64 | 65 | UserControl 66 | 67 | 68 | 69 | 70 | 71 | {d0aa12d1-4f7b-497c-8c31-a1f346d80c60} 72 | Presenter 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /rtsp-camera-view.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2015 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Presenter", "Presenter\Presenter.csproj", "{D0AA12D1-4F7B-497C-8C31-A1F346D80C60}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj", "{DEF7792E-23EE-42C4-B9F8-28D32BABFC94}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "View", "View\View.csproj", "{88F1173C-005E-4302-A370-6CDCE55A4D58}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{48A433BE-3627-4952-9A2C-3962AC1852E6}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ViewVlc215", "ViewVlc215\ViewVlc215.csproj", "{5D6A8F8C-07E2-4C4E-B584-0383EF1B769D}" 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Release|Any CPU = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {D0AA12D1-4F7B-497C-8C31-A1F346D80C60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {D0AA12D1-4F7B-497C-8C31-A1F346D80C60}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {D0AA12D1-4F7B-497C-8C31-A1F346D80C60}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {D0AA12D1-4F7B-497C-8C31-A1F346D80C60}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {DEF7792E-23EE-42C4-B9F8-28D32BABFC94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {DEF7792E-23EE-42C4-B9F8-28D32BABFC94}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {DEF7792E-23EE-42C4-B9F8-28D32BABFC94}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {DEF7792E-23EE-42C4-B9F8-28D32BABFC94}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {88F1173C-005E-4302-A370-6CDCE55A4D58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {88F1173C-005E-4302-A370-6CDCE55A4D58}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {88F1173C-005E-4302-A370-6CDCE55A4D58}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {88F1173C-005E-4302-A370-6CDCE55A4D58}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {48A433BE-3627-4952-9A2C-3962AC1852E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {48A433BE-3627-4952-9A2C-3962AC1852E6}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {48A433BE-3627-4952-9A2C-3962AC1852E6}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {48A433BE-3627-4952-9A2C-3962AC1852E6}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {5D6A8F8C-07E2-4C4E-B584-0383EF1B769D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {5D6A8F8C-07E2-4C4E-B584-0383EF1B769D}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {5D6A8F8C-07E2-4C4E-B584-0383EF1B769D}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {5D6A8F8C-07E2-4C4E-B584-0383EF1B769D}.Release|Any CPU.Build.0 = Release|Any CPU 42 | EndGlobalSection 43 | GlobalSection(SolutionProperties) = preSolution 44 | HideSolutionNode = FALSE 45 | EndGlobalSection 46 | GlobalSection(ExtensibilityGlobals) = postSolution 47 | SolutionGuid = {43180BB9-2D74-49A5-B0AA-1DF4C9E952BB} 48 | EndGlobalSection 49 | EndGlobal 50 | --------------------------------------------------------------------------------