# HG changeset patch # User StephaneLenclud # Date 1453475302 -3600 # Node ID e9a5dc5092fd6766941c968fc011da2229b502e1 # Parent bf8a2fcac0d213a3b11e4347d060dc799c356029 Support for recording text. diff -r bf8a2fcac0d2 -r e9a5dc5092fd Client/MainForm.Designer.cs --- a/Client/MainForm.Designer.cs Thu Jan 21 23:01:53 2016 +0100 +++ b/Client/MainForm.Designer.cs Fri Jan 22 16:08:22 2016 +0100 @@ -28,169 +28,169 @@ /// private void InitializeComponent() { - this.buttonSetText = new System.Windows.Forms.Button(); - this.textBoxTop = new System.Windows.Forms.TextBox(); - this.textBoxBottom = new System.Windows.Forms.TextBox(); - this.buttonAlignRight = new System.Windows.Forms.Button(); - this.buttonAlignCenter = new System.Windows.Forms.Button(); - this.buttonAlignLeft = new System.Windows.Forms.Button(); - this.buttonSetTopText = new System.Windows.Forms.Button(); - this.buttonLayoutUpdate = new System.Windows.Forms.Button(); - this.buttonSetBitmap = new System.Windows.Forms.Button(); - this.buttonBitmapLayout = new System.Windows.Forms.Button(); - this.buttonIndicatorsLayout = new System.Windows.Forms.Button(); - this.buttonUpdateTexts = new System.Windows.Forms.Button(); - this.buttonLayoutOneTextField = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // buttonSetText - // - this.buttonSetText.Location = new System.Drawing.Point(13, 132); - this.buttonSetText.Name = "buttonSetText"; - this.buttonSetText.Size = new System.Drawing.Size(75, 23); - this.buttonSetText.TabIndex = 0; - this.buttonSetText.Text = "Set Text"; - this.buttonSetText.UseVisualStyleBackColor = true; - this.buttonSetText.Click += new System.EventHandler(this.buttonSetText_Click); - // - // textBoxTop - // - this.textBoxTop.Location = new System.Drawing.Point(12, 31); - this.textBoxTop.Name = "textBoxTop"; - this.textBoxTop.Size = new System.Drawing.Size(419, 20); - this.textBoxTop.TabIndex = 1; - // - // textBoxBottom - // - this.textBoxBottom.Location = new System.Drawing.Point(12, 57); - this.textBoxBottom.Name = "textBoxBottom"; - this.textBoxBottom.Size = new System.Drawing.Size(419, 20); - this.textBoxBottom.TabIndex = 2; - // - // buttonAlignRight - // - this.buttonAlignRight.Location = new System.Drawing.Point(176, 160); - this.buttonAlignRight.Name = "buttonAlignRight"; - this.buttonAlignRight.Size = new System.Drawing.Size(75, 23); - this.buttonAlignRight.TabIndex = 23; - this.buttonAlignRight.Text = "Align Right"; - this.buttonAlignRight.UseVisualStyleBackColor = true; - this.buttonAlignRight.Click += new System.EventHandler(this.buttonAlignRight_Click); - // - // buttonAlignCenter - // - this.buttonAlignCenter.Location = new System.Drawing.Point(94, 161); - this.buttonAlignCenter.Name = "buttonAlignCenter"; - this.buttonAlignCenter.Size = new System.Drawing.Size(75, 23); - this.buttonAlignCenter.TabIndex = 22; - this.buttonAlignCenter.Text = "Align Center"; - this.buttonAlignCenter.UseVisualStyleBackColor = true; - this.buttonAlignCenter.Click += new System.EventHandler(this.buttonAlignCenter_Click); - // - // buttonAlignLeft - // - this.buttonAlignLeft.Location = new System.Drawing.Point(12, 161); - this.buttonAlignLeft.Name = "buttonAlignLeft"; - this.buttonAlignLeft.Size = new System.Drawing.Size(75, 23); - this.buttonAlignLeft.TabIndex = 21; - this.buttonAlignLeft.Text = "Align Left"; - this.buttonAlignLeft.UseVisualStyleBackColor = true; - this.buttonAlignLeft.Click += new System.EventHandler(this.buttonAlignLeft_Click); - // - // buttonSetTopText - // - this.buttonSetTopText.Location = new System.Drawing.Point(94, 132); - this.buttonSetTopText.Name = "buttonSetTopText"; - this.buttonSetTopText.Size = new System.Drawing.Size(75, 23); - this.buttonSetTopText.TabIndex = 24; - this.buttonSetTopText.Text = "Set Top Text"; - this.buttonSetTopText.UseVisualStyleBackColor = true; - this.buttonSetTopText.Click += new System.EventHandler(this.buttonSetTopText_Click); - // - // buttonLayoutUpdate - // - this.buttonLayoutUpdate.Location = new System.Drawing.Point(176, 131); - this.buttonLayoutUpdate.Name = "buttonLayoutUpdate"; - this.buttonLayoutUpdate.Size = new System.Drawing.Size(75, 23); - this.buttonLayoutUpdate.TabIndex = 25; - this.buttonLayoutUpdate.Text = "Layout 2x2"; - this.buttonLayoutUpdate.UseVisualStyleBackColor = true; - this.buttonLayoutUpdate.Click += new System.EventHandler(this.buttonLayoutUpdate_Click); - // - // buttonSetBitmap - // - this.buttonSetBitmap.Location = new System.Drawing.Point(12, 190); - this.buttonSetBitmap.Name = "buttonSetBitmap"; - this.buttonSetBitmap.Size = new System.Drawing.Size(75, 23); - this.buttonSetBitmap.TabIndex = 26; - this.buttonSetBitmap.Text = "Set Bitmap"; - this.buttonSetBitmap.UseVisualStyleBackColor = true; - this.buttonSetBitmap.Click += new System.EventHandler(this.buttonSetBitmap_Click); - // - // buttonBitmapLayout - // - this.buttonBitmapLayout.Location = new System.Drawing.Point(176, 189); - this.buttonBitmapLayout.Name = "buttonBitmapLayout"; - this.buttonBitmapLayout.Size = new System.Drawing.Size(75, 35); - this.buttonBitmapLayout.TabIndex = 27; - this.buttonBitmapLayout.Text = "Bitmap Layout"; - this.buttonBitmapLayout.UseVisualStyleBackColor = true; - this.buttonBitmapLayout.Click += new System.EventHandler(this.buttonBitmapLayout_Click); - // - // buttonIndicatorsLayout - // - this.buttonIndicatorsLayout.Location = new System.Drawing.Point(94, 189); - this.buttonIndicatorsLayout.Name = "buttonIndicatorsLayout"; - this.buttonIndicatorsLayout.Size = new System.Drawing.Size(75, 35); - this.buttonIndicatorsLayout.TabIndex = 28; - this.buttonIndicatorsLayout.Text = "Indicators Layout "; - this.buttonIndicatorsLayout.UseVisualStyleBackColor = true; - this.buttonIndicatorsLayout.Click += new System.EventHandler(this.buttonIndicatorsLayout_Click); - // - // buttonUpdateTexts - // - this.buttonUpdateTexts.Location = new System.Drawing.Point(257, 189); - this.buttonUpdateTexts.Name = "buttonUpdateTexts"; - this.buttonUpdateTexts.Size = new System.Drawing.Size(75, 35); - this.buttonUpdateTexts.TabIndex = 29; - this.buttonUpdateTexts.Text = "Update Texts"; - this.buttonUpdateTexts.UseVisualStyleBackColor = true; - this.buttonUpdateTexts.Click += new System.EventHandler(this.buttonUpdateTexts_Click); - // - // buttonLayoutOneTextField - // - this.buttonLayoutOneTextField.Location = new System.Drawing.Point(257, 131); - this.buttonLayoutOneTextField.Name = "buttonLayoutOneTextField"; - this.buttonLayoutOneTextField.Size = new System.Drawing.Size(75, 23); - this.buttonLayoutOneTextField.TabIndex = 30; - this.buttonLayoutOneTextField.Text = "Layout 1x1"; - this.buttonLayoutOneTextField.UseVisualStyleBackColor = true; - this.buttonLayoutOneTextField.Click += new System.EventHandler(this.buttonLayoutOneTextField_Click); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(443, 252); - this.Controls.Add(this.buttonLayoutOneTextField); - this.Controls.Add(this.buttonUpdateTexts); - this.Controls.Add(this.buttonIndicatorsLayout); - this.Controls.Add(this.buttonBitmapLayout); - this.Controls.Add(this.buttonSetBitmap); - this.Controls.Add(this.buttonLayoutUpdate); - this.Controls.Add(this.buttonSetTopText); - this.Controls.Add(this.buttonAlignRight); - this.Controls.Add(this.buttonAlignCenter); - this.Controls.Add(this.buttonAlignLeft); - this.Controls.Add(this.textBoxBottom); - this.Controls.Add(this.textBoxTop); - this.Controls.Add(this.buttonSetText); - this.Name = "MainForm"; - this.Text = "Client"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); - this.Load += new System.EventHandler(this.MainForm_Load); - this.ResumeLayout(false); - this.PerformLayout(); + this.buttonSetText = new System.Windows.Forms.Button(); + this.textBoxTop = new System.Windows.Forms.TextBox(); + this.textBoxBottom = new System.Windows.Forms.TextBox(); + this.buttonAlignRight = new System.Windows.Forms.Button(); + this.buttonAlignCenter = new System.Windows.Forms.Button(); + this.buttonAlignLeft = new System.Windows.Forms.Button(); + this.buttonSetTopText = new System.Windows.Forms.Button(); + this.buttonLayoutUpdate = new System.Windows.Forms.Button(); + this.buttonSetBitmap = new System.Windows.Forms.Button(); + this.buttonBitmapLayout = new System.Windows.Forms.Button(); + this.buttonIndicatorsLayout = new System.Windows.Forms.Button(); + this.buttonUpdateTexts = new System.Windows.Forms.Button(); + this.buttonLayoutOneTextField = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // buttonSetText + // + this.buttonSetText.Location = new System.Drawing.Point(13, 132); + this.buttonSetText.Name = "buttonSetText"; + this.buttonSetText.Size = new System.Drawing.Size(75, 23); + this.buttonSetText.TabIndex = 0; + this.buttonSetText.Text = "Set Text"; + this.buttonSetText.UseVisualStyleBackColor = true; + this.buttonSetText.Click += new System.EventHandler(this.buttonSetText_Click); + // + // textBoxTop + // + this.textBoxTop.Location = new System.Drawing.Point(12, 31); + this.textBoxTop.Name = "textBoxTop"; + this.textBoxTop.Size = new System.Drawing.Size(419, 20); + this.textBoxTop.TabIndex = 1; + // + // textBoxBottom + // + this.textBoxBottom.Location = new System.Drawing.Point(12, 57); + this.textBoxBottom.Name = "textBoxBottom"; + this.textBoxBottom.Size = new System.Drawing.Size(419, 20); + this.textBoxBottom.TabIndex = 2; + // + // buttonAlignRight + // + this.buttonAlignRight.Location = new System.Drawing.Point(176, 160); + this.buttonAlignRight.Name = "buttonAlignRight"; + this.buttonAlignRight.Size = new System.Drawing.Size(75, 23); + this.buttonAlignRight.TabIndex = 23; + this.buttonAlignRight.Text = "Align Right"; + this.buttonAlignRight.UseVisualStyleBackColor = true; + this.buttonAlignRight.Click += new System.EventHandler(this.buttonAlignRight_Click); + // + // buttonAlignCenter + // + this.buttonAlignCenter.Location = new System.Drawing.Point(94, 161); + this.buttonAlignCenter.Name = "buttonAlignCenter"; + this.buttonAlignCenter.Size = new System.Drawing.Size(75, 23); + this.buttonAlignCenter.TabIndex = 22; + this.buttonAlignCenter.Text = "Align Center"; + this.buttonAlignCenter.UseVisualStyleBackColor = true; + this.buttonAlignCenter.Click += new System.EventHandler(this.buttonAlignCenter_Click); + // + // buttonAlignLeft + // + this.buttonAlignLeft.Location = new System.Drawing.Point(12, 161); + this.buttonAlignLeft.Name = "buttonAlignLeft"; + this.buttonAlignLeft.Size = new System.Drawing.Size(75, 23); + this.buttonAlignLeft.TabIndex = 21; + this.buttonAlignLeft.Text = "Align Left"; + this.buttonAlignLeft.UseVisualStyleBackColor = true; + this.buttonAlignLeft.Click += new System.EventHandler(this.buttonAlignLeft_Click); + // + // buttonSetTopText + // + this.buttonSetTopText.Location = new System.Drawing.Point(94, 132); + this.buttonSetTopText.Name = "buttonSetTopText"; + this.buttonSetTopText.Size = new System.Drawing.Size(75, 23); + this.buttonSetTopText.TabIndex = 24; + this.buttonSetTopText.Text = "Set Top Text"; + this.buttonSetTopText.UseVisualStyleBackColor = true; + this.buttonSetTopText.Click += new System.EventHandler(this.buttonSetTopText_Click); + // + // buttonLayoutUpdate + // + this.buttonLayoutUpdate.Location = new System.Drawing.Point(176, 131); + this.buttonLayoutUpdate.Name = "buttonLayoutUpdate"; + this.buttonLayoutUpdate.Size = new System.Drawing.Size(156, 23); + this.buttonLayoutUpdate.TabIndex = 25; + this.buttonLayoutUpdate.Text = "Layout 2x2 and Recording"; + this.buttonLayoutUpdate.UseVisualStyleBackColor = true; + this.buttonLayoutUpdate.Click += new System.EventHandler(this.buttonLayoutUpdate_Click); + // + // buttonSetBitmap + // + this.buttonSetBitmap.Location = new System.Drawing.Point(12, 190); + this.buttonSetBitmap.Name = "buttonSetBitmap"; + this.buttonSetBitmap.Size = new System.Drawing.Size(75, 23); + this.buttonSetBitmap.TabIndex = 26; + this.buttonSetBitmap.Text = "Set Bitmap"; + this.buttonSetBitmap.UseVisualStyleBackColor = true; + this.buttonSetBitmap.Click += new System.EventHandler(this.buttonSetBitmap_Click); + // + // buttonBitmapLayout + // + this.buttonBitmapLayout.Location = new System.Drawing.Point(176, 189); + this.buttonBitmapLayout.Name = "buttonBitmapLayout"; + this.buttonBitmapLayout.Size = new System.Drawing.Size(75, 35); + this.buttonBitmapLayout.TabIndex = 27; + this.buttonBitmapLayout.Text = "Bitmap Layout"; + this.buttonBitmapLayout.UseVisualStyleBackColor = true; + this.buttonBitmapLayout.Click += new System.EventHandler(this.buttonBitmapLayout_Click); + // + // buttonIndicatorsLayout + // + this.buttonIndicatorsLayout.Location = new System.Drawing.Point(94, 189); + this.buttonIndicatorsLayout.Name = "buttonIndicatorsLayout"; + this.buttonIndicatorsLayout.Size = new System.Drawing.Size(75, 35); + this.buttonIndicatorsLayout.TabIndex = 28; + this.buttonIndicatorsLayout.Text = "Indicators Layout "; + this.buttonIndicatorsLayout.UseVisualStyleBackColor = true; + this.buttonIndicatorsLayout.Click += new System.EventHandler(this.buttonIndicatorsLayout_Click); + // + // buttonUpdateTexts + // + this.buttonUpdateTexts.Location = new System.Drawing.Point(257, 189); + this.buttonUpdateTexts.Name = "buttonUpdateTexts"; + this.buttonUpdateTexts.Size = new System.Drawing.Size(75, 35); + this.buttonUpdateTexts.TabIndex = 29; + this.buttonUpdateTexts.Text = "Update Texts"; + this.buttonUpdateTexts.UseVisualStyleBackColor = true; + this.buttonUpdateTexts.Click += new System.EventHandler(this.buttonUpdateTexts_Click); + // + // buttonLayoutOneTextField + // + this.buttonLayoutOneTextField.Location = new System.Drawing.Point(257, 160); + this.buttonLayoutOneTextField.Name = "buttonLayoutOneTextField"; + this.buttonLayoutOneTextField.Size = new System.Drawing.Size(75, 23); + this.buttonLayoutOneTextField.TabIndex = 30; + this.buttonLayoutOneTextField.Text = "Layout 1x1"; + this.buttonLayoutOneTextField.UseVisualStyleBackColor = true; + this.buttonLayoutOneTextField.Click += new System.EventHandler(this.buttonLayoutOneTextField_Click); + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(443, 252); + this.Controls.Add(this.buttonLayoutOneTextField); + this.Controls.Add(this.buttonUpdateTexts); + this.Controls.Add(this.buttonIndicatorsLayout); + this.Controls.Add(this.buttonBitmapLayout); + this.Controls.Add(this.buttonSetBitmap); + this.Controls.Add(this.buttonLayoutUpdate); + this.Controls.Add(this.buttonSetTopText); + this.Controls.Add(this.buttonAlignRight); + this.Controls.Add(this.buttonAlignCenter); + this.Controls.Add(this.buttonAlignLeft); + this.Controls.Add(this.textBoxBottom); + this.Controls.Add(this.textBoxTop); + this.Controls.Add(this.buttonSetText); + this.Name = "MainForm"; + this.Text = "Client"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); + this.Load += new System.EventHandler(this.MainForm_Load); + this.ResumeLayout(false); + this.PerformLayout(); } diff -r bf8a2fcac0d2 -r e9a5dc5092fd Client/MainForm.cs --- a/Client/MainForm.cs Thu Jan 21 23:01:53 2016 +0100 +++ b/Client/MainForm.cs Fri Jan 22 16:08:22 2016 +0100 @@ -230,7 +230,7 @@ // RecordingField recording = new RecordingField(); recording.IsActive = true; - + recording.Text = "Recording Tame of Gone until 22:05"; //Set texts iClient.CreateFields(new DataField[] { diff -r bf8a2fcac0d2 -r e9a5dc5092fd Client/SharpDisplayClient.csproj --- a/Client/SharpDisplayClient.csproj Thu Jan 21 23:01:53 2016 +0100 +++ b/Client/SharpDisplayClient.csproj Fri Jan 22 16:08:22 2016 +0100 @@ -85,7 +85,7 @@ - ..\packages\SharpLibDisplay.0.1.3\lib\net40\SharpLibDisplay.dll + ..\packages\SharpLibDisplay.0.2.4\lib\net40\SharpLibDisplay.dll True diff -r bf8a2fcac0d2 -r e9a5dc5092fd Client/packages.config --- a/Client/packages.config Thu Jan 21 23:01:53 2016 +0100 +++ b/Client/packages.config Fri Jan 22 16:08:22 2016 +0100 @@ -1,4 +1,4 @@  - + \ No newline at end of file diff -r bf8a2fcac0d2 -r e9a5dc5092fd Server/MainForm.cs --- a/Server/MainForm.cs Thu Jan 21 23:01:53 2016 +0100 +++ b/Server/MainForm.cs Fri Jan 22 16:08:22 2016 +0100 @@ -1759,6 +1759,17 @@ } /// + /// + /// + /// + /// + /// + public static string Truncate(string value, int maxChars) + { + return value.Length <= maxChars ? value : value.Substring(0, maxChars-3) + "..."; + } + + /// /// Update our recording notification. /// private void UpdateRecordingNotification() @@ -1773,19 +1784,33 @@ if (rec!=null && rec.IsActive) { activeRecording = true; - //Don't break cause we are collecting the names. - text += client.Value.Name + " recording\n"; + //Don't break cause we are collecting the names/texts. + if (!String.IsNullOrEmpty(rec.Text)) + { + text += (rec.Text + "\n"); + } + else + { + //Not text for that recording, use client name instead + text += client.Value.Name + " recording\n"; + } + } } + //Update our text no matter what, can't have more than 63 characters otherwise it throws an exception. + iRecordingNotification.Text = Truncate(text,63); + //Change visibility of notification if needed if (iRecordingNotification.Visible != activeRecording) - { - iRecordingNotification.Text = text; + { iRecordingNotification.Visible = activeRecording; //Assuming the notification icon is in sync with our display icon //Take care of our REC icon - iDisplay.SetIconOnOff(MiniDisplay.IconType.Recording, activeRecording); + if (iDisplay.IsOpen()) + { + iDisplay.SetIconOnOff(MiniDisplay.IconType.Recording, activeRecording); + } } } diff -r bf8a2fcac0d2 -r e9a5dc5092fd Server/SharpDisplayManager.csproj --- a/Server/SharpDisplayManager.csproj Thu Jan 21 23:01:53 2016 +0100 +++ b/Server/SharpDisplayManager.csproj Fri Jan 22 16:08:22 2016 +0100 @@ -121,11 +121,11 @@ ..\packages\NAudio.1.7.3\lib\net35\NAudio.dll - ..\packages\SharpLibDisplay.0.1.3\lib\net40\SharpLibDisplay.dll + ..\packages\SharpLibDisplay.0.2.4\lib\net40\SharpLibDisplay.dll True - - ..\packages\SharpLibHid.1.2.1\lib\net20\SharpLibHid.dll + + ..\packages\SharpLibHid.1.3.1\lib\net20\SharpLibHid.dll True diff -r bf8a2fcac0d2 -r e9a5dc5092fd Server/packages.config --- a/Server/packages.config Thu Jan 21 23:01:53 2016 +0100 +++ b/Server/packages.config Fri Jan 22 16:08:22 2016 +0100 @@ -2,8 +2,8 @@ - - + + \ No newline at end of file