\r
private void okButton_Click(object sender, EventArgs e) {\r
DialogResult = DialogResult.OK;\r
- parameters.audio_device_name = deviceNames[audioDevicesComboBox.SelectedIndex];\r
+ parameters.DeviceName = deviceNames[audioDevicesComboBox.SelectedIndex];\r
Close();\r
}\r
\r
<DependentUpon>AudioDeviceSelectorForm.cs</DependentUpon>\r
</Compile>\r
<Compile Include="AudioRecorderSettings.cs" />\r
- <Compile Include="CustomTrackBar.cs">\r
- <SubType>UserControl</SubType>\r
+ <Compile Include="OctopusIDSelectorForm.cs">\r
+ <SubType>Form</SubType>\r
</Compile>\r
- <Compile Include="CustomTrackBar.Designer.cs">\r
- <DependentUpon>CustomTrackBar.cs</DependentUpon>\r
+ <Compile Include="OctopusIDSelectorForm.Designer.cs">\r
+ <DependentUpon>OctopusIDSelectorForm.cs</DependentUpon>\r
</Compile>\r
- <Compile Include="FileNameForm.cs">\r
+ <Compile Include="Form1.cs">\r
<SubType>Form</SubType>\r
</Compile>\r
- <Compile Include="FileNameForm.Designer.cs">\r
- <DependentUpon>FileNameForm.cs</DependentUpon>\r
+ <Compile Include="Form1.Designer.cs">\r
+ <DependentUpon>Form1.cs</DependentUpon>\r
</Compile>\r
- <Compile Include="FileWorker.cs" />\r
- <Compile Include="IFileWorker.cs" />\r
<Compile Include="IMainForm.cs" />\r
<Compile Include="KnownTypesBinder.cs" />\r
<Compile Include="MainForm.cs">\r
<Compile Include="Settings.cs" />\r
<Compile Include="StringResources.cs" />\r
<Compile Include="TimeCodeWorker.cs" />\r
- <Compile Include="VerticalProgressBar.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
<Compile Include="WavRecorder.cs" />\r
<EmbeddedResource Include="AudioDeviceSelectorForm.resx">\r
<DependentUpon>AudioDeviceSelectorForm.cs</DependentUpon>\r
</EmbeddedResource>\r
- <EmbeddedResource Include="CustomTrackBar.resx">\r
- <DependentUpon>CustomTrackBar.cs</DependentUpon>\r
+ <EmbeddedResource Include="OctopusIDSelectorForm.resx">\r
+ <DependentUpon>OctopusIDSelectorForm.cs</DependentUpon>\r
</EmbeddedResource>\r
- <EmbeddedResource Include="FileNameForm.resx">\r
- <DependentUpon>FileNameForm.cs</DependentUpon>\r
+ <EmbeddedResource Include="Form1.resx">\r
+ <DependentUpon>Form1.cs</DependentUpon>\r
</EmbeddedResource>\r
<EmbeddedResource Include="MainForm.resx">\r
<DependentUpon>MainForm.cs</DependentUpon>\r
using System;\r
using Newtonsoft.Json;\r
using System.IO;\r
-using System.Windows.Forms;\r
+using MaestroShared.Configuration;\r
+using MaestroShared.Commons;\r
\r
namespace AudioRecorder {\r
public class AudioRecorderSettings {\r
- public String audio_device_name { get; set; }\r
- public String unc_path { get; set; }\r
- public int loud_percent { get; set; }\r
- public String working_dir { get; set; }\r
-\r
- public Uri address { get; set; }\r
- public String userName { get; set; }\r
- public String password { get; set; }\r
- public int timeout { get; set; }\r
-\r
+ public string DeviceName { get; set; }\r
+ public int PeekMeterStep { get; set; }\r
+ public Uri WorkingDirectory { get; set; }\r
+ public OctopusMetadata Metadata { get; set; }\r
+ public Target Target { get; set; }\r
\r
public void Save(string fileName) {\r
try {\r
- File.WriteAllText(fileName, JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented));\r
+ File.WriteAllText(fileName, JsonConvert.SerializeObject(this, Formatting.Indented));\r
}\r
catch (Exception e) {\r
- MessageBox.Show(e.Message);\r
+ MsgBox.Error(e.Message);\r
}\r
}\r
}\r
{\r
- "audio_device_name": "",\r
- "working_dir": "C:\\temp",\r
- "loud_percent": 200,\r
- "target" : {\r
+ "deviceName": "",\r
+ "workingDirectory": "file://C:\\temp",\r
+ "peekMeterStep": 200,\r
+ "target": {\r
"label": "Octopus mappába küldés",\r
"processor": "FTPTargetProcessor",\r
"tag": "Betöltés",\r
"outputFormat": "%ID%",\r
"subFolderFormat": "%IDROOT%-%TEXT%",\r
"killDateDays": 7,\r
- "saveArchiveMetadata": false,\r
"remote": {\r
"address": "ftp://10.10.1.100/OCTOPUS",\r
"userName": "mediacube",\r
"timeout": 1000\r
}\r
},\r
- "address": "http://10.10.1.27/services/rest/octopus/",\r
- "userName": "dani",\r
- "password": "dani",\r
- "timeout": 1000\r
+ "metadata" : {\r
+ "disableStoryCheck": true,\r
+ "server": {\r
+ "address": "http://10.10.1.27/services/rest/octopus/",\r
+ "timeout": 1000\r
+ }\r
+ }\r
}
\ No newline at end of file
+++ /dev/null
-namespace AudioRecorder\r
-{\r
- partial class CustomTrackBar\r
- {\r
- /// <summary> \r
- /// Required designer variable.\r
- /// </summary>\r
- private System.ComponentModel.IContainer components = null;\r
-\r
- /// <summary> \r
- /// Clean up any resources being used.\r
- /// </summary>\r
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>\r
- protected override void Dispose(bool disposing)\r
- {\r
- if (disposing && (components != null))\r
- {\r
- components.Dispose();\r
- }\r
- base.Dispose(disposing);\r
- }\r
-\r
- #region Component Designer generated code\r
-\r
- /// <summary> \r
- /// Required method for Designer support - do not modify \r
- /// the contents of this method with the code editor.\r
- /// </summary>\r
- private void InitializeComponent()\r
- {\r
- this.tickLabel = new System.Windows.Forms.Label();\r
- this.trackBar1 = new System.Windows.Forms.TrackBar();\r
- ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();\r
- this.SuspendLayout();\r
- // \r
- // tickLabel\r
- // \r
- this.tickLabel.AutoSize = true;\r
- this.tickLabel.ForeColor = System.Drawing.SystemColors.AppWorkspace;\r
- this.tickLabel.Location = new System.Drawing.Point(19, 100);\r
- this.tickLabel.Name = "tickLabel";\r
- this.tickLabel.Size = new System.Drawing.Size(13, 13);\r
- this.tickLabel.TabIndex = 1;\r
- this.tickLabel.Text = "_";\r
- // \r
- // trackBar1\r
- // \r
- this.trackBar1.Location = new System.Drawing.Point(0, 0);\r
- this.trackBar1.Name = "trackBar1";\r
- this.trackBar1.Orientation = System.Windows.Forms.Orientation.Vertical;\r
- this.trackBar1.Size = new System.Drawing.Size(45, 214);\r
- this.trackBar1.TabIndex = 0;\r
- this.trackBar1.TickFrequency = 0;\r
- this.trackBar1.ValueChanged += new System.EventHandler(this.trackBar1_ValueChanged);\r
- // \r
- // CustomTrackBar\r
- // \r
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
- this.Controls.Add(this.tickLabel);\r
- this.Controls.Add(this.trackBar1);\r
- this.Name = "CustomTrackBar";\r
- this.Size = new System.Drawing.Size(40, 213);\r
- ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();\r
- this.ResumeLayout(false);\r
- this.PerformLayout();\r
-\r
- }\r
-\r
- #endregion\r
-\r
- private System.Windows.Forms.Label tickLabel;\r
- private System.Windows.Forms.TrackBar trackBar1;\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Drawing;\r
-using System.Windows.Forms;\r
-\r
-namespace AudioRecorder {\r
- public partial class CustomTrackBar : UserControl {\r
- public delegate void SetValueDelegate(int value);\r
-\r
- public MainForm MainForm { get; set; }\r
-\r
- private SetValueDelegate setValueDelegate;\r
-\r
- public CustomTrackBar() {\r
- InitializeComponent();\r
- }\r
-\r
- public void setMinimumMaximumSizesAndVolume(int minimum, int maximum, int value) {\r
- trackBar1.Maximum = maximum;\r
- trackBar1.Minimum = minimum;\r
- trackBar1.Value = value;\r
- }\r
-\r
- public void setTickLabelLocationByPercentage(int percentage) {\r
- //mert a magasága a trackbarnak 200\r
- tickLabel.Location = new Point(tickLabel.Location.X, 200 - (percentage * 2));\r
- }\r
-\r
- private void trackBar1_ValueChanged(object sender, EventArgs e) {\r
- MainForm.volumeChanged(sender, e);\r
- }\r
-\r
- public void SetValue(int value) {\r
- if (trackBar1.InvokeRequired) {\r
- setValueDelegate = SetTrackBarValue;\r
- this.Invoke(setValueDelegate, new Object[] { value });\r
- } else SetTrackBarValue(value);\r
- }\r
-\r
- private void SetTrackBarValue(int value) {\r
- trackBar1.Value = value;\r
- }\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Windows.Forms;\r
-using OctopusClient;\r
-using MaestroShared.Configuration;\r
-\r
-namespace AudioRecorder {\r
- public partial class FileNameForm : Form {\r
- private String result;\r
- private MainForm mainForm;\r
- public string ID { get; internal set; }\r
-\r
- public FileNameForm(MainForm mainForm, AudioRecorderSettings settings) {\r
- InitializeComponent();\r
- this.mainForm = mainForm;\r
- octopusIDSelector1.IDChangedEvent = IdChangedEvent;\r
- octopusIDSelector1.Parameters = new OctopusParameters() {\r
- UserName = "Hangalámondó",\r
- Configuration = new OctopusMetadata() {\r
- Server = new Connection() {\r
- Address = settings.address,\r
- Password = settings.password,\r
- UserName = settings.userName,\r
- Timeout = settings.timeout\r
- }\r
- }\r
- };\r
- }\r
-\r
- private void IdChangedEvent(string id, string name, string text) {\r
- buttonOK.Enabled = !String.IsNullOrEmpty(id);\r
- ID = name;\r
- }\r
-\r
- \r
- private void cancelButton_Click(object sender, EventArgs e) {\r
- DialogResult = DialogResult.Cancel;\r
- Close();\r
- }\r
-\r
- private void buttonOK_Click(object sender, EventArgs e) {\r
- DialogResult = DialogResult.OK;\r
- Close();\r
- }\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.IO;\r
-\r
-namespace AudioRecorder {\r
- public class FileWorker : IFileWorker {\r
-\r
- public void copy(String source, String destination) {\r
- File.Copy(source, destination, true);\r
- }\r
-\r
- public void deleteFiles(List<String> files) {\r
- foreach (String actual in files)\r
- if (File.Exists(actual))\r
- File.Delete(actual);\r
- }\r
- }\r
-}\r
--- /dev/null
+namespace AudioRecorder {\r
+ partial class Form1 {\r
+ /// <summary>\r
+ /// Required designer variable.\r
+ /// </summary>\r
+ private System.ComponentModel.IContainer components = null;\r
+\r
+ /// <summary>\r
+ /// Clean up any resources being used.\r
+ /// </summary>\r
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>\r
+ protected override void Dispose(bool disposing) {\r
+ if (disposing && (components != null)) {\r
+ components.Dispose();\r
+ }\r
+ base.Dispose(disposing);\r
+ }\r
+\r
+ #region Windows Form Designer generated code\r
+\r
+ /// <summary>\r
+ /// Required method for Designer support - do not modify\r
+ /// the contents of this method with the code editor.\r
+ /// </summary>\r
+ private void InitializeComponent() {\r
+ this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();\r
+ this.checkBox1 = new System.Windows.Forms.CheckBox();\r
+ this.checkBox2 = new System.Windows.Forms.CheckBox();\r
+ this.checkBox3 = new System.Windows.Forms.CheckBox();\r
+ this.textBox1 = new System.Windows.Forms.TextBox();\r
+ this.flowLayoutPanel1.SuspendLayout();\r
+ this.SuspendLayout();\r
+ // \r
+ // flowLayoutPanel1\r
+ // \r
+ this.flowLayoutPanel1.Controls.Add(this.checkBox1);\r
+ this.flowLayoutPanel1.Controls.Add(this.checkBox2);\r
+ this.flowLayoutPanel1.Controls.Add(this.checkBox3);\r
+ this.flowLayoutPanel1.Controls.Add(this.textBox1);\r
+ this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;\r
+ this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);\r
+ this.flowLayoutPanel1.Name = "flowLayoutPanel1";\r
+ this.flowLayoutPanel1.Size = new System.Drawing.Size(305, 100);\r
+ this.flowLayoutPanel1.TabIndex = 0;\r
+ // \r
+ // checkBox1\r
+ // \r
+ this.checkBox1.Appearance = System.Windows.Forms.Appearance.Button;\r
+ this.checkBox1.AutoSize = true;\r
+ this.checkBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
+ this.checkBox1.Location = new System.Drawing.Point(3, 3);\r
+ this.checkBox1.Name = "checkBox1";\r
+ this.checkBox1.Size = new System.Drawing.Size(71, 23);\r
+ this.checkBox1.TabIndex = 0;\r
+ this.checkBox1.Text = "checkBox1";\r
+ this.checkBox1.UseVisualStyleBackColor = true;\r
+ // \r
+ // checkBox2\r
+ // \r
+ this.checkBox2.Appearance = System.Windows.Forms.Appearance.Button;\r
+ this.checkBox2.AutoSize = true;\r
+ this.checkBox2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
+ this.checkBox2.Location = new System.Drawing.Point(80, 3);\r
+ this.checkBox2.Name = "checkBox2";\r
+ this.checkBox2.Size = new System.Drawing.Size(71, 23);\r
+ this.checkBox2.TabIndex = 1;\r
+ this.checkBox2.Text = "checkBox2";\r
+ this.checkBox2.UseVisualStyleBackColor = true;\r
+ this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);\r
+ // \r
+ // checkBox3\r
+ // \r
+ this.checkBox3.Appearance = System.Windows.Forms.Appearance.Button;\r
+ this.checkBox3.AutoSize = true;\r
+ this.checkBox3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
+ this.flowLayoutPanel1.SetFlowBreak(this.checkBox3, true);\r
+ this.checkBox3.Location = new System.Drawing.Point(157, 3);\r
+ this.checkBox3.Name = "checkBox3";\r
+ this.checkBox3.Size = new System.Drawing.Size(71, 23);\r
+ this.checkBox3.TabIndex = 2;\r
+ this.checkBox3.Text = "checkBox3";\r
+ this.checkBox3.UseVisualStyleBackColor = true;\r
+ // \r
+ // textBox1\r
+ // \r
+ this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
+ this.textBox1.Location = new System.Drawing.Point(3, 32);\r
+ this.textBox1.Name = "textBox1";\r
+ this.textBox1.Size = new System.Drawing.Size(243, 20);\r
+ this.textBox1.TabIndex = 3;\r
+ // \r
+ // Form1\r
+ // \r
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
+ this.ClientSize = new System.Drawing.Size(305, 346);\r
+ this.Controls.Add(this.flowLayoutPanel1);\r
+ this.Name = "Form1";\r
+ this.Text = "Form1";\r
+ this.flowLayoutPanel1.ResumeLayout(false);\r
+ this.flowLayoutPanel1.PerformLayout();\r
+ this.ResumeLayout(false);\r
+\r
+ }\r
+\r
+ #endregion\r
+\r
+ private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;\r
+ private System.Windows.Forms.CheckBox checkBox1;\r
+ private System.Windows.Forms.CheckBox checkBox2;\r
+ private System.Windows.Forms.CheckBox checkBox3;\r
+ private System.Windows.Forms.TextBox textBox1;\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+using System;\r
+using System.Collections.Generic;\r
+using System.ComponentModel;\r
+using System.Data;\r
+using System.Drawing;\r
+using System.Linq;\r
+using System.Text;\r
+using System.Threading.Tasks;\r
+using System.Windows.Forms;\r
+\r
+namespace AudioRecorder {\r
+ public partial class Form1 : Form {\r
+ public Form1() {\r
+ InitializeComponent();\r
+ }\r
+\r
+ private void checkBox2_CheckedChanged(object sender, EventArgs e) {\r
+\r
+ }\r
+ }\r
+}\r
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-\r
-namespace AudioRecorder {\r
- public interface IFileWorker {\r
- void copy(String source, String destination);\r
- void deleteFiles(List<String> files);\r
- }\r
-}\r
this.groupBox1 = new System.Windows.Forms.GroupBox();\r
this.pauseButton = new System.Windows.Forms.Button();\r
this.groupBox2 = new System.Windows.Forms.GroupBox();\r
+ this.tbVolume = new System.Windows.Forms.TrackBar();\r
this.pmVolume = new Ernzo.WinForms.Controls.PeakMeterCtrl();\r
- this.txtRecordFilePath = new System.Windows.Forms.Label();\r
this.playButton = new System.Windows.Forms.Button();\r
this.groupBox3 = new System.Windows.Forms.GroupBox();\r
- this.tbVolume = new System.Windows.Forms.TrackBar();\r
+ this.txtRecordFilePath = new System.Windows.Forms.TextBox();\r
+ this.pbUpload = new System.Windows.Forms.ProgressBar();\r
this.groupBox1.SuspendLayout();\r
this.groupBox2.SuspendLayout();\r
- this.groupBox3.SuspendLayout();\r
((System.ComponentModel.ISupportInitialize)(this.tbVolume)).BeginInit();\r
+ this.groupBox3.SuspendLayout();\r
this.SuspendLayout();\r
// \r
// recordButton\r
this.recordButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;\r
this.recordButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
this.recordButton.Image = ((System.Drawing.Image)(resources.GetObject("recordButton.Image")));\r
- this.recordButton.Location = new System.Drawing.Point(51, 85);\r
+ this.recordButton.Location = new System.Drawing.Point(33, 79);\r
this.recordButton.Name = "recordButton";\r
- this.recordButton.Size = new System.Drawing.Size(129, 56);\r
+ this.recordButton.Size = new System.Drawing.Size(181, 56);\r
this.recordButton.TabIndex = 0;\r
this.recordButton.Text = "Record";\r
- this.recordButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;\r
+ this.recordButton.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;\r
this.recordButton.UseVisualStyleBackColor = false;\r
this.recordButton.Click += new System.EventHandler(this.OnRecordClick);\r
// \r
this.stopButton.Enabled = false;\r
this.stopButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
this.stopButton.Image = ((System.Drawing.Image)(resources.GetObject("stopButton.Image")));\r
- this.stopButton.Location = new System.Drawing.Point(51, 186);\r
+ this.stopButton.Location = new System.Drawing.Point(33, 180);\r
this.stopButton.Name = "stopButton";\r
- this.stopButton.Size = new System.Drawing.Size(129, 38);\r
+ this.stopButton.Size = new System.Drawing.Size(181, 38);\r
this.stopButton.TabIndex = 1;\r
this.stopButton.Text = "Stop ";\r
- this.stopButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;\r
+ this.stopButton.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;\r
this.stopButton.UseVisualStyleBackColor = false;\r
- this.stopButton.Click += new System.EventHandler(this.stop_Click);\r
+ this.stopButton.Click += new System.EventHandler(this.OnStopClick);\r
// \r
// timecodeLabel\r
// \r
// btnSelectAudio\r
// \r
this.btnSelectAudio.BackColor = System.Drawing.Color.White;\r
- this.btnSelectAudio.Location = new System.Drawing.Point(8, 19);\r
+ this.btnSelectAudio.Location = new System.Drawing.Point(9, 19);\r
this.btnSelectAudio.Name = "btnSelectAudio";\r
- this.btnSelectAudio.Size = new System.Drawing.Size(307, 23);\r
+ this.btnSelectAudio.Size = new System.Drawing.Size(312, 23);\r
this.btnSelectAudio.TabIndex = 3;\r
this.btnSelectAudio.Text = "Select audio";\r
this.btnSelectAudio.UseVisualStyleBackColor = false;\r
- this.btnSelectAudio.Click += new System.EventHandler(this.selectAudioButton_Click);\r
+ this.btnSelectAudio.Click += new System.EventHandler(this.OnSelectAudioClick);\r
// \r
// groupBox1\r
// \r
this.pauseButton.Enabled = false;\r
this.pauseButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);\r
this.pauseButton.Image = ((System.Drawing.Image)(resources.GetObject("pauseButton.Image")));\r
- this.pauseButton.Location = new System.Drawing.Point(51, 148);\r
+ this.pauseButton.Location = new System.Drawing.Point(33, 142);\r
this.pauseButton.Name = "pauseButton";\r
- this.pauseButton.Size = new System.Drawing.Size(129, 32);\r
+ this.pauseButton.Size = new System.Drawing.Size(181, 32);\r
this.pauseButton.TabIndex = 3;\r
this.pauseButton.Text = "Pause ";\r
- this.pauseButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;\r
+ this.pauseButton.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;\r
this.pauseButton.UseVisualStyleBackColor = false;\r
- this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click);\r
+ this.pauseButton.Click += new System.EventHandler(this.OnPauseClick);\r
// \r
// groupBox2\r
// \r
this.groupBox2.TabIndex = 6;\r
this.groupBox2.TabStop = false;\r
// \r
+ // tbVolume\r
+ // \r
+ this.tbVolume.LargeChange = 10;\r
+ this.tbVolume.Location = new System.Drawing.Point(27, 16);\r
+ this.tbVolume.Maximum = 100;\r
+ this.tbVolume.Name = "tbVolume";\r
+ this.tbVolume.Orientation = System.Windows.Forms.Orientation.Vertical;\r
+ this.tbVolume.Size = new System.Drawing.Size(45, 220);\r
+ this.tbVolume.SmallChange = 2;\r
+ this.tbVolume.TabIndex = 13;\r
+ this.tbVolume.TickFrequency = 10;\r
+ this.tbVolume.TickStyle = System.Windows.Forms.TickStyle.Both;\r
+ this.tbVolume.ValueChanged += new System.EventHandler(this.OnVolumeChanged);\r
+ // \r
// pmVolume\r
// \r
this.pmVolume.BandsCount = 1;\r
this.pmVolume.TabIndex = 12;\r
this.pmVolume.Text = "pmVolume";\r
// \r
- // fileNameLabel\r
- // \r
- this.txtRecordFilePath.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
- this.txtRecordFilePath.Location = new System.Drawing.Point(8, 45);\r
- this.txtRecordFilePath.Name = "fileNameLabel";\r
- this.txtRecordFilePath.Size = new System.Drawing.Size(233, 23);\r
- this.txtRecordFilePath.TabIndex = 8;\r
- // \r
// playButton\r
// \r
this.playButton.BackColor = System.Drawing.Color.White;\r
this.playButton.Enabled = false;\r
+ this.playButton.FlatAppearance.BorderSize = 0;\r
+ this.playButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
this.playButton.Image = ((System.Drawing.Image)(resources.GetObject("playButton.Image")));\r
this.playButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;\r
- this.playButton.Location = new System.Drawing.Point(247, 45);\r
+ this.playButton.Location = new System.Drawing.Point(250, 46);\r
this.playButton.Name = "playButton";\r
- this.playButton.Size = new System.Drawing.Size(68, 23);\r
+ this.playButton.Size = new System.Drawing.Size(71, 23);\r
this.playButton.TabIndex = 9;\r
this.playButton.Text = "Play";\r
this.playButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;\r
// \r
// groupBox3\r
// \r
+ this.groupBox3.Controls.Add(this.pbUpload);\r
+ this.groupBox3.Controls.Add(this.txtRecordFilePath);\r
this.groupBox3.Controls.Add(this.btnSelectAudio);\r
this.groupBox3.Controls.Add(this.playButton);\r
- this.groupBox3.Controls.Add(this.txtRecordFilePath);\r
this.groupBox3.Location = new System.Drawing.Point(15, 258);\r
this.groupBox3.Name = "groupBox3";\r
- this.groupBox3.Size = new System.Drawing.Size(332, 86);\r
+ this.groupBox3.Size = new System.Drawing.Size(332, 97);\r
this.groupBox3.TabIndex = 10;\r
this.groupBox3.TabStop = false;\r
// \r
- // tbVolume\r
+ // txtRecordFilePath\r
// \r
- this.tbVolume.LargeChange = 10;\r
- this.tbVolume.Location = new System.Drawing.Point(27, 16);\r
- this.tbVolume.Maximum = 100;\r
- this.tbVolume.Name = "tbVolume";\r
- this.tbVolume.Orientation = System.Windows.Forms.Orientation.Vertical;\r
- this.tbVolume.Size = new System.Drawing.Size(45, 220);\r
- this.tbVolume.SmallChange = 2;\r
- this.tbVolume.TabIndex = 13;\r
- this.tbVolume.TickFrequency = 10;\r
- this.tbVolume.TickStyle = System.Windows.Forms.TickStyle.Both;\r
- this.tbVolume.ValueChanged += new System.EventHandler(this.OnVolumeChanged);\r
+ this.txtRecordFilePath.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ this.txtRecordFilePath.Location = new System.Drawing.Point(10, 46);\r
+ this.txtRecordFilePath.Name = "txtRecordFilePath";\r
+ this.txtRecordFilePath.Size = new System.Drawing.Size(233, 23);\r
+ this.txtRecordFilePath.TabIndex = 10;\r
+ // \r
+ // pbUpload\r
+ // \r
+ this.pbUpload.Location = new System.Drawing.Point(9, 75);\r
+ this.pbUpload.Name = "pbUpload";\r
+ this.pbUpload.Size = new System.Drawing.Size(312, 9);\r
+ this.pbUpload.TabIndex = 11;\r
// \r
// MainForm\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
this.BackColor = System.Drawing.Color.White;\r
- this.ClientSize = new System.Drawing.Size(365, 350);\r
+ this.ClientSize = new System.Drawing.Size(363, 370);\r
this.Controls.Add(this.groupBox3);\r
this.Controls.Add(this.groupBox2);\r
this.Controls.Add(this.groupBox1);\r
this.groupBox1.ResumeLayout(false);\r
this.groupBox2.ResumeLayout(false);\r
this.groupBox2.PerformLayout();\r
- this.groupBox3.ResumeLayout(false);\r
((System.ComponentModel.ISupportInitialize)(this.tbVolume)).EndInit();\r
+ this.groupBox3.ResumeLayout(false);\r
+ this.groupBox3.PerformLayout();\r
this.ResumeLayout(false);\r
\r
}\r
private System.Windows.Forms.Button btnSelectAudio;\r
private System.Windows.Forms.GroupBox groupBox1;\r
private System.Windows.Forms.GroupBox groupBox2;\r
- private System.Windows.Forms.Label txtRecordFilePath;\r
private System.Windows.Forms.Button playButton;\r
private System.Windows.Forms.Button pauseButton;\r
private System.Windows.Forms.GroupBox groupBox3;\r
private Ernzo.WinForms.Controls.PeakMeterCtrl pmVolume;\r
private System.Windows.Forms.TrackBar tbVolume;\r
+ private System.Windows.Forms.TextBox txtRecordFilePath;\r
+ private System.Windows.Forms.ProgressBar pbUpload;\r
}\r
}\r
\r
using System.IO;\r
using MaestroShared.Configuration;\r
using System.ComponentModel;\r
+using MaestroShared.Commons;\r
+using MaestroShared.Target;\r
+using OctopusClient;\r
+using System.Security.Principal;\r
+using MaestroShared.Targets;\r
\r
namespace AudioRecorder {\r
public delegate void RefreshPanelDelegate();\r
public partial class MainForm : Form {\r
\r
private const String CONFIG_FILE = "Configuration/audiorecorder.json";\r
-\r
+ private const string WAV_EXT = ".WAV";\r
private IAudioDevicesDetector devicesDetector;\r
private List<string> audioDevicesNames;\r
private int selectedDeviceIndex = -1;\r
private WavRecorder recorder;\r
private AudioRecorderSettings parameters;\r
private ITimeCodeWorker timeCodeWorker;\r
- private IFileWorker fileWorker;\r
private bool recording;\r
private Timer countDownTimer;\r
private int countDown = 3;\r
private MMDevice currentDevice;\r
private bool pausing;\r
private BackgroundWorker volumeMonitor;\r
+ private string currentRecordingPath;\r
+ private Story currentStory;\r
+ ITargetProcessor processor;\r
\r
public MainForm() {\r
InitializeComponent();\r
\r
private void Cleanup() {\r
if (CurrentDevice != null)\r
- CurrentDevice.AudioEndpointVolume.OnVolumeNotification -= AudioEndpointVolume_OnVolumeNotification;\r
+ CurrentDevice.AudioEndpointVolume.OnVolumeNotification -= OnAudioEndpointVolumeChanged;\r
if (recorder != null)\r
- recorder = null;\r
+ recorder.Dispose();\r
+\r
}\r
\r
private void OnMainShown(object sender, EventArgs e) {\r
-\r
try {\r
parameters = Loader.Get<AudioRecorderSettings>(CONFIG_FILE);\r
- UpdateGUI();\r
+ processor = TargetProcessor.Create(parameters.Target.Processor);\r
+ pbUpload.DataBindings.Add(new Binding("Value", processor, "Progress"));\r
\r
- fileWorker = new FileWorker();\r
+ UpdateGUI();\r
timeCodeWorker = new TimeCodeWorker(timecodeLabel);\r
countDownTimer = new Timer();\r
countDownTimer.Interval = 1000;\r
- countDownTimer.Tick += new EventHandler(timer_Tick);\r
+ countDownTimer.Tick += new EventHandler(OnCountDownTick);\r
devicesDetector = new AudioDevicesDetector();\r
devicesDetector.findDevices();\r
audioDevicesNames = devicesDetector.getDeviceNames();\r
- if (!String.IsNullOrEmpty(parameters.audio_device_name) && audioDevicesNames != null)\r
- SelectedDeviceIndex = audioDevicesNames.IndexOf(parameters.audio_device_name);\r
+ if (!String.IsNullOrEmpty(parameters.DeviceName) && audioDevicesNames != null)\r
+ SelectedDeviceIndex = audioDevicesNames.IndexOf(parameters.DeviceName);\r
if (SelectedDeviceIndex < 0)\r
ShowAudioDeviceSelectorForm();\r
}\r
catch (Exception ex) {\r
- MessageBox.Show(ex.Message, StringResources.ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+ MsgBox.Error(ex.Message);\r
}\r
}\r
\r
while (!e.Cancel) {\r
try {\r
float value = currentDevice.AudioMeterInformation.MasterPeakValue * 1000;\r
- int[] levels = { (int) Math.Floor(value) };\r
- Debug.WriteLine(String.Format($"Values {levels[0]}"));\r
+ int[] levels = { (int)Math.Floor(value) };\r
+ //Debug.WriteLine(String.Format($"Values {levels[0]}"));\r
pmVolume.SetData(levels, 0, 1);\r
System.Threading.Thread.Sleep(100);\r
- } catch (Exception ex) {\r
+ }\r
+ catch (Exception ex) {\r
Debug.WriteLine(ex.Message);\r
}\r
}\r
\r
private void UpdateGUI() {\r
if (CurrentDevice == null) {\r
- int steps = parameters.loud_percent;\r
+ int steps = parameters.PeekMeterStep;\r
pmVolume.SetRange(steps * 3, steps * 4, steps * 5);\r
pmVolume.SetData(new int[] { 0 }, 0, 1);\r
recordButton.Enabled = false;\r
Debug.WriteLine($"Levels {CurrentDevice.AudioEndpointVolume.VolumeRange.MinDecibels} {CurrentDevice.AudioEndpointVolume.VolumeRange.MaxDecibels} V {CurrentDevice.AudioEndpointVolume.MasterVolumeLevel}");\r
recordButton.Enabled = true;\r
recordButton.BackColor = Color.Lime;\r
- btnSelectAudio.Text = parameters.audio_device_name;\r
+ btnSelectAudio.Text = parameters.DeviceName;\r
volumeMonitor = new BackgroundWorker();\r
volumeMonitor.WorkerSupportsCancellation = true;\r
volumeMonitor.DoWork += OnMonitorVolume;\r
}\r
\r
public void Initialize() {\r
- currentDevice.AudioEndpointVolume.OnVolumeNotification += AudioEndpointVolume_OnVolumeNotification;\r
- recorder = new WavRecorder(SelectedDeviceIndex, CurrentDevice, this);\r
- }\r
-\r
- void AudioEndpointVolume_OnVolumeNotification(AudioVolumeNotificationData data) {\r
- this.BeginInvoke(new Action(() => {\r
- tbVolume.Value = (int)Math.Round(CurrentDevice.AudioEndpointVolume.MasterVolumeLevel);\r
- }));\r
- }\r
-\r
-\r
- private void stop_Click(object sender, EventArgs e) {\r
- stopRecording();\r
+ currentDevice.AudioEndpointVolume.OnVolumeNotification += OnAudioEndpointVolumeChanged;\r
+ try {\r
+ //if (!Directory.Exists(parameters.WorkingDirectory.LocalPath))\r
+ Directory.CreateDirectory(parameters.WorkingDirectory.LocalPath);\r
+ recorder = new WavRecorder(SelectedDeviceIndex, CurrentDevice);\r
+ }\r
+ catch (Exception ex) {\r
+ MsgBox.Error(ex.Message);\r
+ }\r
}\r
\r
- private void startRecord() {\r
+ private void StartRecord() {\r
try {\r
recording = true;\r
recorder.StartRecording(txtRecordFilePath.Text);\r
recordButton.BackColor = Color.White;\r
}\r
catch (Exception e) {\r
- MessageBox.Show(e.Message, StringResources.ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+ MsgBox.Error(e.Message);\r
}\r
}\r
\r
+ private void OnCountDownTick(object sender, EventArgs e) {\r
+ recordButton.Text = countDown.ToString();\r
+ if (countDown-- < 0) {\r
+ countDownTimer.Stop();\r
+ recordButton.Text = StringResources.RECORD;\r
+ StartRecord();\r
+ countDown = 3;\r
+ }\r
+ }\r
\r
- private void stopRecording() {\r
+ private void StopRecord() {\r
try {\r
recording = false;\r
recordButton.Enabled = true;\r
btnSelectAudio.Enabled = true;\r
pauseButton.Enabled = false;\r
\r
- recorder.StopRecording();\r
+ recorder.StopRecord();\r
timeCodeWorker.Stop();\r
playButton.Enabled = true;\r
stopButton.BackColor = Color.White;\r
recordButton.BackColor = Color.Lime;\r
- //copyFileToUncPath();\r
+ Export();\r
}\r
catch (Exception e) {\r
- MessageBox.Show(e.Message, StringResources.ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+ MsgBox.Error(e.Message);\r
}\r
}\r
\r
- private void copyFileToUncPath() {\r
- FileInfo fileInfo = new FileInfo(recorder.getCurentWavFilePath());\r
- String wavFileName = fileInfo.Name;\r
- String wavUncPath = DetermineWorkingDirectory(parameters.unc_path, fileInfo.Name);\r
- if (!Directory.Exists(wavUncPath))\r
- Directory.CreateDirectory(wavUncPath);\r
- wavUncPath = Path.Combine(wavUncPath, fileInfo.Name);\r
- //String.Format("{0}{1}{2}", settings.getUncPath(), Path.DirectorySeparatorChar, wavFileName);\r
- fileWorker.copy(recorder.getCurentWavFilePath(), wavUncPath);\r
- }\r
-\r
- protected String DetermineWorkingDirectory(string path, string ID) {\r
- string result = path;\r
- string subDir = ID;\r
- if (ID.Contains("_")) \r
- subDir = ID.Split('_')[0];\r
- if (ID.Contains(".")) \r
- subDir = ID.Split('.')[0];\r
- result = Path.Combine(path, subDir);\r
- return result;\r
- }\r
-\r
private void OnRecordClick(object sender, EventArgs e) {\r
- FileNameForm idSelectorForm = new FileNameForm(this, parameters);\r
+ OctopusIDSelectorForm idSelectorForm = new OctopusIDSelectorForm(parameters);\r
if (idSelectorForm.ShowDialog() == DialogResult.Cancel)\r
return;\r
- //string fileName = String.Format("{0}{1}", StringResources.DOT_WAV);\r
- //currentFilePath = Path.Combine(parameters.working_dir, fileName);\r
- recordFireEvent(idSelectorForm.ID);\r
+ currentStory = idSelectorForm.SelectedStory;\r
+ currentRecordingPath = CreateCurrenRecordingPath(parameters.WorkingDirectory.LocalPath, currentStory.ID);\r
+ txtRecordFilePath.Text = currentRecordingPath;\r
+ if (String.IsNullOrEmpty(currentRecordingPath))\r
+ return;\r
+ txtRecordFilePath.SelectionStart = txtRecordFilePath.Text.Length - 1;\r
+ txtRecordFilePath.SelectionLength = 0;\r
+ recordButton.Enabled = false;\r
+ countDownTimer.Start();\r
//startRecord();\r
}\r
\r
- public void recordFireEvent(String id) {\r
- recordButton.Enabled = false;\r
- if (!Directory.Exists(parameters.working_dir))\r
- Directory.CreateDirectory(parameters.working_dir);\r
- \r
- txtRecordFilePath.Text = GetCurrentFileNameAndPath(parameters.working_dir, id); ;\r
- countDownTimer.Start();\r
+ private void OnStopClick(object sender, EventArgs e) {\r
+ StopRecord();\r
+ }\r
+\r
+ private void OnPauseClick(object sender, EventArgs e) {\r
+ pausing = !pausing;\r
+ recorder.pauseRecording(pausing);\r
+ timeCodeWorker.Pause(pausing);\r
+ }\r
+\r
+ private void OnPlayClick(object sender, EventArgs e) {\r
+ if (String.IsNullOrEmpty(currentRecordingPath) || !File.Exists(currentRecordingPath))\r
+ return;\r
+ Process process = new Process();\r
+ process.StartInfo = new ProcessStartInfo() {\r
+ FileName = currentRecordingPath\r
+ };\r
+ process.Start();\r
}\r
\r
- private string GetCurrentFileNameAndPath(string path, string id) {\r
- string fileName = String.Format("{0}{1}", id, ".WAV");\r
+ private string CreateCurrenRecordingPath(string path, string id) {\r
+ string fileName = String.Format("{0}{1}", id, WAV_EXT);\r
int i = 1;\r
string fullPath = Path.Combine(path, fileName);\r
while (File.Exists(fullPath)) {\r
- fileName = String.Format("{0}-{1}{2}", id, i, ".WAV");\r
+ fileName = String.Format("{0}-{1}{2}", id, i, WAV_EXT);\r
fullPath = Path.Combine(path, fileName);\r
i++;\r
}\r
- return fileName;\r
+ return fullPath;\r
}\r
\r
- void timer_Tick(object sender, EventArgs e) {\r
- recordButton.Text = countDown.ToString();\r
- countDown -= 1;\r
- if (countDown < 0) {\r
- countDownTimer.Stop();\r
- recordButton.Text = StringResources.RECORD;\r
- startRecord();\r
- countDown = 3;\r
- }\r
- }\r
-\r
- private void selectAudioButton_Click(object sender, EventArgs e) {\r
+ private void OnSelectAudioClick(object sender, EventArgs e) {\r
ShowAudioDeviceSelectorForm(true);\r
}\r
\r
parameters.Save(CONFIG_FILE);\r
}\r
\r
- private void MainForm_FormClosing(object sender, FormClosingEventArgs e) {\r
- if (recording)\r
- e.Cancel = true;\r
- else\r
- deleteTemporariFiles();\r
- }\r
-\r
- private void deleteTemporariFiles() {\r
- //if (recorder != null) {\r
- // List<String> createdFiles = recorder.getCreatedFiles();\r
- // fileWorker.deleteFiles(createdFiles);\r
- //}\r
- }\r
-\r
- private void OnPlayClick(object sender, EventArgs e) {\r
- Process process = new Process();\r
- ProcessStartInfo startInfo = new ProcessStartInfo();\r
- startInfo.FileName = new FileInfo(txtRecordFilePath.Text).FullName;\r
- process.StartInfo = startInfo;\r
- process.Start();\r
- }\r
-\r
- private void volumeTrackBar_ValueChanged(object sender, EventArgs e) {\r
- TrackBar trackbar = sender as TrackBar;\r
- if (trackbar == null)\r
- return;\r
- if (CurrentDevice == null)\r
- return;\r
- int value = trackbar.Value;\r
- CurrentDevice.AudioEndpointVolume.MasterVolumeLevel = value;\r
+ void OnAudioEndpointVolumeChanged(AudioVolumeNotificationData data) {\r
+ this.BeginInvoke(new Action(() => {\r
+ tbVolume.Value = (int)Math.Round(CurrentDevice.AudioEndpointVolume.MasterVolumeLevel);\r
+ }));\r
}\r
\r
- private void pauseButton_Click(object sender, EventArgs e) {\r
- pausing = !pausing;\r
- recorder.pauseRecording(pausing);\r
- timeCodeWorker.Pause(pausing);\r
+ private void OnVolumeChanged(object sender, EventArgs e) {\r
+ CurrentDevice.AudioEndpointVolume.MasterVolumeLevel = tbVolume.Value;\r
+ Debug.WriteLine($"Levels {CurrentDevice.AudioEndpointVolume.VolumeRange.MinDecibels} {CurrentDevice.AudioEndpointVolume.VolumeRange.MaxDecibels} V {CurrentDevice.AudioEndpointVolume.MasterVolumeLevel}");\r
}\r
\r
- public void volumeChanged(object sender, EventArgs e) {\r
- TrackBar trackbar = sender as TrackBar;\r
- if (trackbar == null)\r
- return;\r
- if (CurrentDevice == null)\r
- return;\r
- int value = trackbar.Value;\r
- CurrentDevice.AudioEndpointVolume.MasterVolumeLevel = value;\r
+ private void Export() {\r
+ TargetProcessorParameter processorParameter = new TargetProcessorParameter() {\r
+ SourceConfig = new Source() {\r
+ Local = new Connection() {\r
+ Address = parameters.WorkingDirectory\r
+ }\r
+ },\r
+ TargetConfig = parameters.Target,\r
+ ID = currentStory.ID,\r
+ MetadataText = currentStory.Name,\r
+ InputFileName = Path.GetFileName(currentRecordingPath),\r
+ UserName = WindowsIdentity.GetCurrent().Name\r
+ };\r
+\r
+ ITargetProcessor processor = TargetProcessor.Create(parameters.Target.Processor);\r
+ processor.Initialize(null, processorParameter);\r
+ processor.Execute();\r
+\r
+ if (TargetProcessor.READY.Equals(processor.Status))\r
+ MsgBox.Info(String.Format($"Sikeres betöltés: {processor.Output}"));\r
+ else\r
+ MsgBox.Error(processor.Message);\r
}\r
\r
- private void OnVolumeChanged(object sender, EventArgs e) {\r
- CurrentDevice.AudioEndpointVolume.MasterVolumeLevel = tbVolume.Value;\r
- Debug.WriteLine($"Levels {CurrentDevice.AudioEndpointVolume.VolumeRange.MinDecibels} {CurrentDevice.AudioEndpointVolume.VolumeRange.MaxDecibels} V {CurrentDevice.AudioEndpointVolume.MasterVolumeLevel}");\r
+ private void MainForm_FormClosing(object sender, FormClosingEventArgs e) {\r
+ if (recording)\r
+ e.Cancel = true;\r
+ else\r
+ Cleanup();\r
}\r
}\r
}\r
namespace AudioRecorder {\r
- partial class FileNameForm {\r
+ partial class OctopusIDSelectorForm {\r
/// <summary>\r
/// Required designer variable.\r
/// </summary>\r
/// the contents of this method with the code editor.\r
/// </summary>\r
private void InitializeComponent() {\r
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FileNameForm));\r
- this.octopusIDSelector1 = new OctopusClient.OctopusIDSelector();\r
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OctopusIDSelectorForm));\r
+ this.octopusIDSelector = new OctopusClient.OctopusIDSelector();\r
this.buttonCancel = new System.Windows.Forms.Button();\r
this.buttonOK = new System.Windows.Forms.Button();\r
+ this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();\r
+ this.flowLayoutPanel1.SuspendLayout();\r
this.SuspendLayout();\r
// \r
- // octopusIDSelector1\r
+ // octopusIDSelector\r
// \r
- this.octopusIDSelector1.BackColor = System.Drawing.Color.White;\r
- this.octopusIDSelector1.IDChangedEvent = null;\r
- this.octopusIDSelector1.Location = new System.Drawing.Point(7, 8);\r
- this.octopusIDSelector1.Margin = new System.Windows.Forms.Padding(10);\r
- this.octopusIDSelector1.Name = "octopusIDSelector1";\r
- this.octopusIDSelector1.Padding = new System.Windows.Forms.Padding(10);\r
- this.octopusIDSelector1.Size = new System.Drawing.Size(271, 337);\r
- this.octopusIDSelector1.TabIndex = 5;\r
+ this.octopusIDSelector.BackColor = System.Drawing.Color.White;\r
+ this.octopusIDSelector.Dock = System.Windows.Forms.DockStyle.Fill;\r
+ this.octopusIDSelector.IDChangedEvent = null;\r
+ this.octopusIDSelector.Location = new System.Drawing.Point(0, 0);\r
+ this.octopusIDSelector.Margin = new System.Windows.Forms.Padding(0);\r
+ this.octopusIDSelector.Name = "octopusIDSelector";\r
+ this.octopusIDSelector.Padding = new System.Windows.Forms.Padding(4);\r
+ this.octopusIDSelector.Size = new System.Drawing.Size(395, 355);\r
+ this.octopusIDSelector.TabIndex = 5;\r
// \r
// buttonCancel\r
// \r
this.buttonCancel.Anchor = System.Windows.Forms.AnchorStyles.Right;\r
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;\r
- this.buttonCancel.Location = new System.Drawing.Point(118, 356);\r
+ this.buttonCancel.Location = new System.Drawing.Point(228, 7);\r
this.buttonCancel.Name = "buttonCancel";\r
this.buttonCancel.Size = new System.Drawing.Size(75, 23);\r
this.buttonCancel.TabIndex = 6;\r
- this.buttonCancel.Text = "Mégse";\r
+ this.buttonCancel.Text = "Mégsem";\r
this.buttonCancel.UseVisualStyleBackColor = true;\r
// \r
- // buttonRendben\r
+ // buttonOK\r
// \r
this.buttonOK.Enabled = false;\r
- this.buttonOK.Location = new System.Drawing.Point(195, 356);\r
- this.buttonOK.Name = "buttonRendben";\r
+ this.buttonOK.Location = new System.Drawing.Point(309, 7);\r
+ this.buttonOK.Name = "buttonOK";\r
this.buttonOK.Size = new System.Drawing.Size(75, 23);\r
this.buttonOK.TabIndex = 7;\r
this.buttonOK.Text = "Rendben";\r
this.buttonOK.UseVisualStyleBackColor = true;\r
- this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);\r
+ this.buttonOK.Click += new System.EventHandler(this.OnOKClick);\r
// \r
- // FileNameForm\r
+ // flowLayoutPanel1\r
+ // \r
+ this.flowLayoutPanel1.Controls.Add(this.buttonOK);\r
+ this.flowLayoutPanel1.Controls.Add(this.buttonCancel);\r
+ this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;\r
+ this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;\r
+ this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 355);\r
+ this.flowLayoutPanel1.Name = "flowLayoutPanel1";\r
+ this.flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(4);\r
+ this.flowLayoutPanel1.Size = new System.Drawing.Size(395, 37);\r
+ this.flowLayoutPanel1.TabIndex = 8;\r
+ // \r
+ // OctopusIDSelectorForm\r
// \r
- this.AcceptButton = this.buttonOK;\r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
this.BackColor = System.Drawing.Color.White;\r
this.CancelButton = this.buttonCancel;\r
- this.ClientSize = new System.Drawing.Size(276, 383);\r
+ this.ClientSize = new System.Drawing.Size(395, 392);\r
this.ControlBox = false;\r
- this.Controls.Add(this.buttonOK);\r
- this.Controls.Add(this.buttonCancel);\r
- this.Controls.Add(this.octopusIDSelector1);\r
+ this.Controls.Add(this.octopusIDSelector);\r
+ this.Controls.Add(this.flowLayoutPanel1);\r
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;\r
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
this.MaximizeBox = false;\r
this.MinimizeBox = false;\r
- this.Name = "FileNameForm";\r
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;\r
+ this.Name = "OctopusIDSelectorForm";\r
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\r
this.Text = "File Name";\r
+ this.flowLayoutPanel1.ResumeLayout(false);\r
this.ResumeLayout(false);\r
\r
}\r
\r
#endregion\r
- private OctopusClient.OctopusIDSelector octopusIDSelector1;\r
+ private OctopusClient.OctopusIDSelector octopusIDSelector;\r
private System.Windows.Forms.Button buttonCancel;\r
private System.Windows.Forms.Button buttonOK;\r
+ private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;\r
}\r
}
\ No newline at end of file
--- /dev/null
+using System;\r
+using System.Windows.Forms;\r
+using OctopusClient;\r
+using System.Security.Principal;\r
+\r
+namespace AudioRecorder {\r
+ public partial class OctopusIDSelectorForm : Form {\r
+ public Story SelectedStory { get; internal set; }\r
+\r
+ public OctopusIDSelectorForm(AudioRecorderSettings settings) {\r
+ InitializeComponent();\r
+ octopusIDSelector.IDChangedEvent = IdChangedEvent;\r
+ octopusIDSelector.Parameters = new OctopusParameters() {\r
+ UserName = WindowsIdentity.GetCurrent().Name,\r
+ Configuration = settings.Metadata,\r
+ };\r
+ }\r
+\r
+ private void IdChangedEvent(string id, string name, string text) {\r
+ buttonOK.Enabled = !String.IsNullOrEmpty(id);\r
+ SelectedStory = new Story() {\r
+ ID = name,\r
+ Name = text\r
+ };\r
+ }\r
+ \r
+ private void OnCancelClick(object sender, EventArgs e) {\r
+ DialogResult = DialogResult.Cancel;\r
+ Close();\r
+ }\r
+\r
+ private void OnOKClick(object sender, EventArgs e) {\r
+ DialogResult = DialogResult.OK;\r
+ Close();\r
+ }\r
+ }\r
+}\r
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Threading.Tasks;\r
-using System.Windows.Forms;\r
-using System.Runtime.InteropServices;\r
-\r
-namespace AudioRecorder {\r
- class VerticalProgressBar : ProgressBar {\r
-\r
- [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]\r
- public extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList);\r
-\r
- public VerticalProgressBar() {\r
- Style = ProgressBarStyle.Blocks;\r
- }\r
-\r
- protected override void CreateHandle() {\r
- base.CreateHandle();\r
- try {\r
- SetWindowTheme(this.Handle, "", "");\r
- }\r
- catch { }\r
- }\r
-\r
- protected override CreateParams CreateParams {\r
- get {\r
- CreateParams cp = base.CreateParams;\r
- cp.Style |= 0x04;\r
- return cp;\r
- }\r
- }\r
- }\r
-}\r
using System.Collections.Generic;\r
using NAudio.Wave;\r
using NAudio.CoreAudioApi;\r
+using System.IO;\r
+using MaestroShared.Commons;\r
\r
namespace AudioRecorder {\r
public class WavRecorder {\r
private IWaveIn sourceStream;\r
private WaveFileWriter waveWriter;\r
private String filePath;\r
- private List<String> createdWavFiles;\r
+ private List<String> recordedFiles;\r
private MMDevice device;\r
- private MainForm mainForm;\r
private volatile bool pausing;\r
\r
- public WavRecorder(int inputDeviceIndex, MMDevice device, MainForm mainForm) {\r
+ public WavRecorder(int inputDeviceIndex, MMDevice device) {\r
this.inputDeviceIndex = inputDeviceIndex;\r
- createdWavFiles = new List<String>();\r
+ recordedFiles = new List<String>();\r
this.device = device;\r
- this.mainForm = mainForm;\r
}\r
\r
public void StartRecording(String filePath) {\r
sourceStream.DataAvailable += newEventHandler();\r
waveWriter = newWavFileWriter();\r
sourceStream.StartRecording();\r
- createdWavFiles.Add(filePath);\r
+ recordedFiles.Add(filePath);\r
}\r
\r
protected virtual EventHandler<WaveInEventArgs> newEventHandler() {\r
}\r
}\r
\r
- public void StopRecording() {\r
+ public void Dispose() {\r
+ foreach (String file in recordedFiles) {\r
+ if (File.Exists(file)) {\r
+ try {\r
+ File.Delete(file);\r
+ }\r
+ catch (Exception ex) {\r
+ MsgBox.Exclamation(ex.Message);\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ public void StopRecord() {\r
if (sourceStream != null) {\r
sourceStream.StopRecording();\r
sourceStream.Dispose();\r
this.pausing = pausing;\r
}\r
\r
- public List<String> getCreatedFiles() {\r
- return createdWavFiles;\r
- }\r
-\r
- public String getCurentWavFilePath() {\r
- return filePath;\r
- }\r
}\r
}\r
--- /dev/null
+using System.Windows.Forms;\r
+\r
+namespace MaestroShared.Commons {\r
+ public class MsgBox {\r
+ public static void Info(string text) {\r
+ MessageBox.Show(text, null, MessageBoxButtons.OK, MessageBoxIcon.Information);\r
+ }\r
+\r
+ public static void Error(string text) {\r
+ MessageBox.Show(text, null, MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+ }\r
+\r
+ public static void Warning(string text) {\r
+ MessageBox.Show(text, null, MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ }\r
+\r
+ public static void Exclamation(string text) {\r
+ MessageBox.Show(text, null, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);\r
+ }\r
+ }\r
+}\r
<Reference Include="System.Xml" />\r
</ItemGroup>\r
<ItemGroup>\r
+ <Compile Include="Commons\MsgBox.cs" />\r
<Compile Include="Commons\MorpheusXML.cs" />\r
<Compile Include="Commons\NexioXML.cs" />\r
<Compile Include="Commons\ObjectExtensions.cs" />\r
<Compile Include="Metadata\Timecode.cs" />\r
<Compile Include="Properties\AssemblyInfo.cs" />\r
<Compile Include="Metadata\ArchiveMetadata.cs" />\r
+ <Compile Include="Properties\Resources.Designer.cs">\r
+ <AutoGen>True</AutoGen>\r
+ <DesignTime>True</DesignTime>\r
+ <DependentUpon>Resources.resx</DependentUpon>\r
+ </Compile>\r
<Compile Include="Resources\MaestroColors.cs" />\r
<Compile Include="Targets\FTPTargetProcessor.cs" />\r
<Compile Include="Targets\FXPTargetProcessor.cs" />\r
<EmbeddedResource Include="Controls\ColorSlider.resx">\r
<DependentUpon>ColorSlider.cs</DependentUpon>\r
</EmbeddedResource>\r
+ <EmbeddedResource Include="Properties\Resources.resx">\r
+ <Generator>PublicResXFileCodeGenerator</Generator>\r
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>\r
+ </EmbeddedResource>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="Resources\ic_pause_black_24dp_2x.png" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="Resources\ic_play_arrow_black_24dp_2x.png" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="Resources\ic_stop_black_24dp_2x.png" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="Resources\ic_pause_black_24dp_1x.png" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="Resources\ic_play_arrow_black_24dp_1x.png" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="Resources\ic_stop_black_24dp_1x.png" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="Resources\ic_fiber_manual_record_black_24dp_1x.png" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <None Include="Resources\ic_fiber_manual_record_black_24dp_2x.png" />\r
</ItemGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
</Project>
\ No newline at end of file
--- /dev/null
+//------------------------------------------------------------------------------\r
+// <auto-generated>\r
+// This code was generated by a tool.\r
+// Runtime Version:4.0.30319.42000\r
+//\r
+// Changes to this file may cause incorrect behavior and will be lost if\r
+// the code is regenerated.\r
+// </auto-generated>\r
+//------------------------------------------------------------------------------\r
+\r
+namespace MaestroShared.Properties {\r
+ using System;\r
+ \r
+ \r
+ /// <summary>\r
+ /// A strongly-typed resource class, for looking up localized strings, etc.\r
+ /// </summary>\r
+ // This class was auto-generated by the StronglyTypedResourceBuilder\r
+ // class via a tool like ResGen or Visual Studio.\r
+ // To add or remove a member, edit your .ResX file then rerun ResGen\r
+ // with the /str option, or rebuild your VS project.\r
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]\r
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r
+ public class Resources {\r
+ \r
+ private static global::System.Resources.ResourceManager resourceMan;\r
+ \r
+ private static global::System.Globalization.CultureInfo resourceCulture;\r
+ \r
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]\r
+ internal Resources() {\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Returns the cached ResourceManager instance used by this class.\r
+ /// </summary>\r
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\r
+ public static global::System.Resources.ResourceManager ResourceManager {\r
+ get {\r
+ if (object.ReferenceEquals(resourceMan, null)) {\r
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MaestroShared.Properties.Resources", typeof(Resources).Assembly);\r
+ resourceMan = temp;\r
+ }\r
+ return resourceMan;\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Overrides the current thread's CurrentUICulture property for all\r
+ /// resource lookups using this strongly typed resource class.\r
+ /// </summary>\r
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\r
+ public static global::System.Globalization.CultureInfo Culture {\r
+ get {\r
+ return resourceCulture;\r
+ }\r
+ set {\r
+ resourceCulture = value;\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized resource of type System.Drawing.Bitmap.\r
+ /// </summary>\r
+ public static System.Drawing.Bitmap ic_fiber_manual_record_black_24dp_1x {\r
+ get {\r
+ object obj = ResourceManager.GetObject("ic_fiber_manual_record_black_24dp_1x", resourceCulture);\r
+ return ((System.Drawing.Bitmap)(obj));\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized resource of type System.Drawing.Bitmap.\r
+ /// </summary>\r
+ public static System.Drawing.Bitmap ic_fiber_manual_record_black_24dp_2x {\r
+ get {\r
+ object obj = ResourceManager.GetObject("ic_fiber_manual_record_black_24dp_2x", resourceCulture);\r
+ return ((System.Drawing.Bitmap)(obj));\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized resource of type System.Drawing.Bitmap.\r
+ /// </summary>\r
+ public static System.Drawing.Bitmap ic_pause_black_24dp_1x {\r
+ get {\r
+ object obj = ResourceManager.GetObject("ic_pause_black_24dp_1x", resourceCulture);\r
+ return ((System.Drawing.Bitmap)(obj));\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized resource of type System.Drawing.Bitmap.\r
+ /// </summary>\r
+ public static System.Drawing.Bitmap ic_pause_black_24dp_2x {\r
+ get {\r
+ object obj = ResourceManager.GetObject("ic_pause_black_24dp_2x", resourceCulture);\r
+ return ((System.Drawing.Bitmap)(obj));\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized resource of type System.Drawing.Bitmap.\r
+ /// </summary>\r
+ public static System.Drawing.Bitmap ic_play_arrow_black_24dp_1x {\r
+ get {\r
+ object obj = ResourceManager.GetObject("ic_play_arrow_black_24dp_1x", resourceCulture);\r
+ return ((System.Drawing.Bitmap)(obj));\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized resource of type System.Drawing.Bitmap.\r
+ /// </summary>\r
+ public static System.Drawing.Bitmap ic_play_arrow_black_24dp_2x {\r
+ get {\r
+ object obj = ResourceManager.GetObject("ic_play_arrow_black_24dp_2x", resourceCulture);\r
+ return ((System.Drawing.Bitmap)(obj));\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized resource of type System.Drawing.Bitmap.\r
+ /// </summary>\r
+ public static System.Drawing.Bitmap ic_stop_black_24dp_1x {\r
+ get {\r
+ object obj = ResourceManager.GetObject("ic_stop_black_24dp_1x", resourceCulture);\r
+ return ((System.Drawing.Bitmap)(obj));\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized resource of type System.Drawing.Bitmap.\r
+ /// </summary>\r
+ public static System.Drawing.Bitmap ic_stop_black_24dp_2x {\r
+ get {\r
+ object obj = ResourceManager.GetObject("ic_stop_black_24dp_2x", resourceCulture);\r
+ return ((System.Drawing.Bitmap)(obj));\r
+ }\r
+ }\r
+ }\r
+}\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<root>\r
+ <!-- \r
+ Microsoft ResX Schema \r
+ \r
+ Version 2.0\r
+ \r
+ The primary goals of this format is to allow a simple XML format \r
+ that is mostly human readable. The generation and parsing of the \r
+ various data types are done through the TypeConverter classes \r
+ associated with the data types.\r
+ \r
+ Example:\r
+ \r
+ ... ado.net/XML headers & schema ...\r
+ <resheader name="resmimetype">text/microsoft-resx</resheader>\r
+ <resheader name="version">2.0</resheader>\r
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
+ <value>[base64 mime encoded serialized .NET Framework object]</value>\r
+ </data>\r
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
+ <comment>This is a comment</comment>\r
+ </data>\r
+ \r
+ There are any number of "resheader" rows that contain simple \r
+ name/value pairs.\r
+ \r
+ Each data row contains a name, and value. The row also contains a \r
+ type or mimetype. Type corresponds to a .NET class that support \r
+ text/value conversion through the TypeConverter architecture. \r
+ Classes that don't support this are serialized and stored with the \r
+ mimetype set.\r
+ \r
+ The mimetype is used for serialized objects, and tells the \r
+ ResXResourceReader how to depersist the object. This is currently not \r
+ extensible. For a given mimetype the value must be set accordingly:\r
+ \r
+ Note - application/x-microsoft.net.object.binary.base64 is the format \r
+ that the ResXResourceWriter will generate, however the reader can \r
+ read any of the formats listed below.\r
+ \r
+ mimetype: application/x-microsoft.net.object.binary.base64\r
+ value : The object must be serialized with \r
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
+ : and then encoded with base64 encoding.\r
+ \r
+ mimetype: application/x-microsoft.net.object.soap.base64\r
+ value : The object must be serialized with \r
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
+ : and then encoded with base64 encoding.\r
+\r
+ mimetype: application/x-microsoft.net.object.bytearray.base64\r
+ value : The object must be serialized into a byte array \r
+ : using a System.ComponentModel.TypeConverter\r
+ : and then encoded with base64 encoding.\r
+ -->\r
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
+ <xsd:element name="root" msdata:IsDataSet="true">\r
+ <xsd:complexType>\r
+ <xsd:choice maxOccurs="unbounded">\r
+ <xsd:element name="metadata">\r
+ <xsd:complexType>\r
+ <xsd:sequence>\r
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" use="required" type="xsd:string" />\r
+ <xsd:attribute name="type" type="xsd:string" />\r
+ <xsd:attribute name="mimetype" type="xsd:string" />\r
+ <xsd:attribute ref="xml:space" />\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ <xsd:element name="assembly">\r
+ <xsd:complexType>\r
+ <xsd:attribute name="alias" type="xsd:string" />\r
+ <xsd:attribute name="name" type="xsd:string" />\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ <xsd:element name="data">\r
+ <xsd:complexType>\r
+ <xsd:sequence>\r
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
+ <xsd:attribute ref="xml:space" />\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ <xsd:element name="resheader">\r
+ <xsd:complexType>\r
+ <xsd:sequence>\r
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="required" />\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ </xsd:choice>\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ </xsd:schema>\r
+ <resheader name="resmimetype">\r
+ <value>text/microsoft-resx</value>\r
+ </resheader>\r
+ <resheader name="version">\r
+ <value>2.0</value>\r
+ </resheader>\r
+ <resheader name="reader">\r
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+ </resheader>\r
+ <resheader name="writer">\r
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+ </resheader>\r
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />\r
+ <data name="ic_fiber_manual_record_black_24dp_1x" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+ <value>..\Resources\ic_fiber_manual_record_black_24dp_1x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+ </data>\r
+ <data name="ic_fiber_manual_record_black_24dp_2x" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+ <value>..\Resources\ic_fiber_manual_record_black_24dp_2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+ </data>\r
+ <data name="ic_pause_black_24dp_1x" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+ <value>..\Resources\ic_pause_black_24dp_1x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+ </data>\r
+ <data name="ic_pause_black_24dp_2x" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+ <value>..\Resources\ic_pause_black_24dp_2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+ </data>\r
+ <data name="ic_play_arrow_black_24dp_1x" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+ <value>..\Resources\ic_play_arrow_black_24dp_1x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+ </data>\r
+ <data name="ic_play_arrow_black_24dp_2x" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+ <value>..\Resources\ic_play_arrow_black_24dp_2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+ </data>\r
+ <data name="ic_stop_black_24dp_1x" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+ <value>..\Resources\ic_stop_black_24dp_1x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+ </data>\r
+ <data name="ic_stop_black_24dp_2x" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+ <value>..\Resources\ic_stop_black_24dp_2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+ </data>\r
+</root>
\ No newline at end of file
public override void Initialize(Control parent, TargetProcessorParameter parameters) {\r
base.Initialize(parent, parameters);\r
FtpTrace.LogFunctions = false;\r
- if (!(parameters.SourceConfig is UNCSource)) {\r
- inputFile = null;\r
- string address = parameters?.SourceConfig?.Remote?.Address.ToString();\r
- if (address == null)\r
- throw new Exception("Missing 'source.remote' parameter.");\r
- Uri inputUri = new Uri(Path.Combine(address, parameters.InputFileName));\r
- Input = inputUri.ToString();\r
- }\r
+ string address = parameters?.SourceConfig?.Remote?.Address.ToString();\r
+ if (address == null)\r
+ return;\r
+ inputFile = null;\r
+ //if (address == null)\r
+ // throw new Exception("Missing 'source.remote' parameter.");\r
+ Uri inputUri = new Uri(Path.Combine(address, parameters.InputFileName));\r
+ Input = inputUri.ToString();\r
}\r
\r
protected override void BeforeExecute() {\r
<Loggers>\r
<Root level="INFO">\r
<AppenderRef ref="Console" />\r
- <AppenderRef ref="MarkeredConsole" />\r
+<!-- <AppenderRef ref="MarkeredConsole" /> -->\r
<!-- <AppenderRef ref="RollingFile" /> -->\r
- <AppenderRef ref="MarkeredMail" />\r
+<!-- <AppenderRef ref="MarkeredMail" /> -->\r
</Root>\r
<Logger name="org.zkoss" level="trace" additivity="false" />\r
<Logger name="org.quartz" level="ERROR" additivity="false" />\r
<?xml version="1.0" encoding="UTF-8"?>\r
<executors>\r
+ <executor className="user.jobengine.server.steps.FakeStep" maxConcurrent="2"/>\r
<executor className="user.jobengine.server.steps.ArchiveMaterialSubmitStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.ArchiveListBuilderStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.CheckTRAFFICMissingMaterialsStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.CheckMORPHEUSMissingMaterialsStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.DeleteMaterialsStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.DeleteNEXIOMaterialsStep" maxConcurrent="1"/>\r
- <executor className="user.jobengine.server.steps.FakeStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.MetadataTransformStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.SyncOCTOPUSDataStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.TranscodeSELENIOStep" maxConcurrent="4"/>\r
if (!canContinue())\r
break;\r
jobRuntime.incrementProgress((i + 1) * count);\r
- Thread.sleep(100);\r
+ Thread.sleep(1000);\r
logger.info(getMarker(), "Log markered");\r
logger.info("Progress {}", jobRuntime.getProgress());\r
- logger.info("Progress {}", jobRuntime.getProgress());\r
- logger.info("Progress {}", jobRuntime.getProgress());\r
- logger.info("Progress {}", jobRuntime.getProgress());\r
}\r
} catch (Exception e) {\r
logger.error(e.getMessage());\r
<image src="/img/mediacube_logo_v2_50x50.png">\r
<!-- <custom-attributes org.zkoss.zul.image.preload="true" /> -->\r
</image>\r
- <label style="color:#e3e3e3;font-size:20px;font-weight:bold">MediaCube v2.1.3</label>\r
+ <label style="color:#e3e3e3;font-size:20px;font-weight:bold">MediaCube v2.1.4</label>\r
</div>\r
</west>\r
<center border="0">\r
<div align="left" width="50%">\r
<space bar="false" />\r
<spinner constraint="no empty,min 1 max 10" value="@bind(jlm.newPriority)" width="60px" disabled="@load(jlm.updatePriorityDisabled)" />\r
- <button sclass="buttonboldfont" label="Repriorizálás" onClick="@command('changeJobsPriority')" autodisable="self" disabled="@load(jlm.updatePriorityDisabled)" />\r
- <button sclass="buttonboldfont" label="Futtatás" onClick="@command('executeJob')" />\r
+ <button label="Repriorizálás" onClick="@command('changeJobsPriority')" autodisable="self" disabled="@load(jlm.updatePriorityDisabled)" />\r
+ <button label="Futtatás" onClick="@command('executeJob')" />\r
+ <button sclass="buttonboldfont" label="Leállítás" onClick="@command('shutdown')" autodisable="self" disabled="@load(jlm.shutdownDisabled)" />\r
+ <button sclass="buttonboldfont" label="Elindítás" onClick="@command('startup')" autodisable="self" disabled="@load(jlm.startupDisabled)" />\r
</div>\r
\r
\r
onSelect="@command('selectJob')" style="border: none; background: #e3e3e3 !important;" oddRowSclass="listbox-odd-style" sclass="listbox-normal-style" >\r
<listhead sizable="true">\r
<listheader label="Id" hflex="min" align="left"/>\r
- <listheader label="Submitted" hflex="min" align="left"/>\r
- <listheader label="Finished" hflex="min" align="left"/>\r
- <listheader label="Name" hflex="min" align="left"/>\r
- <listheader label="Priority" hflex="min" align="left"/>\r
- <listheader label="Status" hflex="min" align="left"/>\r
- <listheader label="Progress" width="100px" align="left"/>\r
- <listheader label="Message" align="max"/>\r
+ <listheader label="Indításs" hflex="min" align="left"/>\r
+ <listheader label="Kész" hflex="min" align="left"/>\r
+ <listheader label="Név" hflex="min" align="left"/>\r
+ <listheader label="Prioritás" hflex="min" align="left"/>\r
+ <listheader label="Állapot" hflex="min" align="left"/>\r
+ <listheader label="Készültség" width="100px" align="left"/>\r
+ <listheader label="Üzenet" align="max"/>\r
</listhead>\r
\r
<template name="model">\r
IUserMessageQueues getUserMessageQueues();
+ boolean isRunning();
+
void loadExecutors();
void loadProgram(String fileName) throws Exception;
return itemManager;
}
+ private boolean isRunning;
+
private volatile boolean shutdown = false;
private final BlockingQueue<IJobRuntime> runQueue;
private final BlockingQueue<IJobMessage> messageQueue;
runQueue = new PriorityBlockingQueue<IJobRuntime>();
messageQueue = new LinkedBlockingQueue<IJobMessage>();
jobTemplates = Collections.synchronizedList(new ArrayList<JobTemplate>());
+ executors = new LinkedHashMap<String, IJobStepExecutor>();
worker = new VM();
dispatcher = new MessageDispatcher();
- executors = new LinkedHashMap<String, IJobStepExecutor>();
+ userMessageQueues = new UserMessageQueues();
+
jobs = createJobs();
barrier = new CyclicBarrier(3);
- userMessageQueues = new UserMessageQueues();
nextJobId = new AtomicLong(0);
programs = new HashMap<String, IProgram>();
statusMachine = createStatusMachine();
}
}
+ @Override
+ public boolean isRunning() {
+ return isRunning;
+ }
+
private void jobCleanup(IJobRuntime jobRuntime) {
statusMachine.processAction(JobAction.FINISH, jobRuntime);
}
for (IJobStepExecutor executor : executorList)
addStepExecutor(executor);
}
- loadUnregisteredExecutors(stepRoot);
- loadUnregisteredExecutors(stepsAlternateRoot);
+ // loadUnregisteredExecutors(stepRoot);
+ // loadUnregisteredExecutors(stepsAlternateRoot);
} catch (Exception e) {
logger.error("Error loading executors: " + e);
} finally {
} catch (TSMException e) {
logger.catching(e);
}
-
+ isRunning = false;
logger.info("JobEngine stopped");
}
barrier.await();
schedulerService = new SchedulerService(this);
- schedulerService.statrtup();
+ schedulerService.startup();
bootstrap();
+ isRunning = true;
TSMClient.SetUpMultithread();
} catch (Exception e) {
logger.error(e);
}
-
logger.info("JobEngine started");
}
import java.util.ArrayList;
import java.util.List;
-import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.CountDownLatch;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.TimeUnit;
public void run() {
//setName(String.format("%s step executor thread", stepClass.getSimpleName()));
try {
- barrier.await();
+ barrier.countDown();
} catch (Exception e) {
}
IJobRuntime jobRuntime = null;
IJobStep step = null;
- while (!shutdown) {
+ while (true) {
try {
jobRuntime = queue.poll(50, TimeUnit.MILLISECONDS);
if (jobRuntime != null) {
if (step == null)
throw new Exception("Step object is null");
logger.info("Executing {}", jobRuntime);
- //TODO ez biztosan kell?
- //jobRuntime.IncrementPriority();
+ jobRuntime.IncrementPriority();
// logger.info("Executor thread name is {} id is {}", Thread.currentThread().getName(),
// Thread.currentThread().getId());
outputs = step.run(jobEngine, jobRuntime, inputs);
jobEngine.sendMessage(new JobStepCompletedMessage(jobRuntime.getId(), outputs));
+ } else {
+ if (shutdown)
+ break;
}
} catch (Exception e) {
logger.error("Error in {}", jobRuntime);
private PriorityBlockingQueue<IJobRuntime> queue;
private List<Worker> workers;
protected IJobEngine jobEngine;
- private CyclicBarrier barrier;
+ private CountDownLatch barrier;
private Class<IJobStep> stepClass;
private int maxConcurrent;
queue = new PriorityBlockingQueue<IJobRuntime>();
this.maxConcurrent = maxConcurrent;
if (maxConcurrent > 0) {
- barrier = new CyclicBarrier(2);
+ barrier = new CountDownLatch(maxConcurrent);
workers = new ArrayList<Worker>();
for (int index = 0; index < maxConcurrent; index++)
workers.add(new Worker());
barrier.await();
} catch (Exception e) {
}
- barrier.reset();
+ //barrier.reset();
}
}
}\r
}\r
\r
- public void statrtup() throws Exception {\r
+ public void startup() throws Exception {\r
scheduler.start();\r
loadStartupJobsFromConfig();\r
}\r
private ListModelList<IJobRuntime> jobList = new ListModelList<IJobRuntime>();\r
private IJobRuntime selectedJob = null;\r
private IJobEngine jobEngine = null;\r
-\r
private int newPriority = 1;\r
-\r
private JobTweaker jobTweaker = null;\r
-\r
private int nofJobs = 10;\r
+ private boolean shutdownDisabled;\r
+ private boolean startupDisabled;\r
\r
@Command\r
public void changeJobsPriority() {\r
\r
this.jobEngine = JobEngine.getInstance();\r
\r
+ if (jobEngine == null) {\r
+ setStartupDisabled(true);\r
+ setShutdownDisabled(true);\r
+ }\r
+ setShutdownDisabled(true);\r
+ setStartupDisabled(true);\r
+\r
//TESTJOBOK\r
//test();\r
\r
}\r
}\r
\r
+ public boolean isShutdownDisabled() {\r
+ return shutdownDisabled;\r
+ }\r
+\r
+ //TEST CODE *****************************************************\r
+\r
+ public boolean isStartupDisabled() {\r
+ return startupDisabled;\r
+ }\r
+\r
public boolean isUpdatePriorityDisabled() {\r
if (this.jobList.getSelection() != null) {\r
if (this.jobList.getSelection().size() > 0) {\r
return true;\r
}\r
\r
- //TEST CODE *****************************************************\r
-\r
@Override\r
public void jobChanged(JobChangedEvent event) {\r
if (event != null) {\r
this.selectedJob = _selectedJob;\r
}\r
\r
+ @NotifyChange({ "shutdownDisabled" })\r
+ public void setShutdownDisabled(boolean shutdownDisabled) {\r
+ this.shutdownDisabled = shutdownDisabled;\r
+ }\r
+\r
+ @NotifyChange({ "startupDisabled" })\r
+ public void setStartupDisabled(boolean startupDisabled) {\r
+ this.startupDisabled = startupDisabled;\r
+ }\r
+\r
+ @Command\r
+ public void shutdown() {\r
+ setShutdownDisabled(true);\r
+ jobEngine.shutdown();\r
+ setStartupDisabled(false);\r
+ }\r
+\r
+ @Command\r
+ public void startup() {\r
+ setStartupDisabled(true);\r
+ jobEngine.startup();\r
+ setShutdownDisabled(false);\r
+ }\r
+\r
private void test() {\r
this.jobEngine = new JobEngine();\r
for (int j = 0; j < nofJobs; j++) {\r
SchedulerService scheduler = jobEngine.getScheduler();\r
ScheduledJob scheduledJob = scheduler.createScheduledJob(selectedJobElement.getDbObject());\r
scheduledJob.setJobEngine(jobEngine);\r
- for (int i = 0; i < 1; i++) {\r
+ for (int i = 0; i < 4; i++) {\r
\r
try {\r
if (!scheduledJob.isActive())\r