From cbda4a87d1c6bae7f4d456791eb5d09c9ce1bb75 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Wed, 21 Oct 2020 18:25:19 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C31996 --- client/DxPlay/PlayerGraph.cs | 18 ++- client/DxPlay/Properties/AssemblyInfo.cs | 4 +- .../Maestro/Configuration/configuration.json | 9 +- client/Maestro/MaestroForm.Source.cs | 3 + client/Maestro/Properties/AssemblyInfo.cs | 4 +- client/MaestroShared/Commons/MsgBox.cs | 10 +- .../Commons/TopMostMessageBox.cs | 43 ++++++ .../Configuration/ConfigurationInfo.cs | 2 + client/MaestroShared/MaestroShared.csproj | 1 + .../MaestroShared/Properties/AssemblyInfo.cs | 4 +- client/MediaCube.sln | 14 +- .../MediaCubeApiTest/MediaCubeApiTest.vbproj | 136 ++++++++++++++++++ client/MediaCubeApiTest/Module1.vb | 28 ++++ .../My Project/Application.Designer.vb | 13 ++ .../My Project/Application.myapp | 10 ++ .../My Project/AssemblyInfo.vb | 35 +++++ .../My Project/Resources.Designer.vb | 63 ++++++++ .../My Project/Resources.resx | 117 +++++++++++++++ .../My Project/Settings.Designer.vb | 73 ++++++++++ .../My Project/Settings.settings | 7 + client/MediaCubeApiTest/app.config | 23 +++ client/MediaCubeClient/MediaCubeStrings.cs | 1 + client/MediaCubeClient/MediaCubeWSApi.cs | 15 +- 23 files changed, 601 insertions(+), 32 deletions(-) create mode 100644 client/MaestroShared/Commons/TopMostMessageBox.cs create mode 100644 client/MediaCubeApiTest/MediaCubeApiTest.vbproj create mode 100644 client/MediaCubeApiTest/Module1.vb create mode 100644 client/MediaCubeApiTest/My Project/Application.Designer.vb create mode 100644 client/MediaCubeApiTest/My Project/Application.myapp create mode 100644 client/MediaCubeApiTest/My Project/AssemblyInfo.vb create mode 100644 client/MediaCubeApiTest/My Project/Resources.Designer.vb create mode 100644 client/MediaCubeApiTest/My Project/Resources.resx create mode 100644 client/MediaCubeApiTest/My Project/Settings.Designer.vb create mode 100644 client/MediaCubeApiTest/My Project/Settings.settings create mode 100644 client/MediaCubeApiTest/app.config diff --git a/client/DxPlay/PlayerGraph.cs b/client/DxPlay/PlayerGraph.cs index 4c2391a2..7a8b0503 100644 --- a/client/DxPlay/PlayerGraph.cs +++ b/client/DxPlay/PlayerGraph.cs @@ -40,8 +40,9 @@ namespace DxPlay { EnableDeinterlace(videoDecoder); IBaseFilter sampleGrabber = AddSampleGrabber(graphBuilder, videoDecoder); SampleGrabber = (ISampleGrabber)sampleGrabber; - //IBaseFilter videoRenderer = AddRenderer(graphBuilder, sampleGrabber, handle); - IBaseFilter videoRenderer = AddSimpleRenderer(graphBuilder, sampleGrabber, handle); + //IBaseFilter videoRenderer = AddRenderer(graphBuilder, sampleGrabber); + //IBaseFilter videoRenderer = AddSimpleRenderer(graphBuilder, sampleGrabber); + //IBaseFilter videoRenderer = AddEVRRenderer(graphBuilder, sampleGrabber); FilterGraphTools.RenderPin(graphBuilder, sampleGrabber, "Output"); ConfigureSimpleRenderer(handle); @@ -88,7 +89,7 @@ namespace DxPlay { return audioDecoder; } - private IBaseFilter AddRenderer(IGraphBuilder graphBuilder, IBaseFilter sampleGrabber, IntPtr handle) { + private IBaseFilter AddRenderer(IGraphBuilder graphBuilder, IBaseFilter sampleGrabber) { logger.Debug("Add VideoMixingRenderer9 to graph"); IBaseFilter videoRenderer = (IBaseFilter)new VideoMixingRenderer9(); DsError.ThrowExceptionForHR(graphBuilder.AddFilter(videoRenderer, "Video Mixing Renderer 9")); @@ -105,7 +106,7 @@ namespace DxPlay { logger.Error(e); graphBuilder.RemoveFilter(videoRenderer); logger.Info("Trying default VideoRenderer instead Video Mixing Renderer 9"); - AddSimpleRenderer(graphBuilder, sampleGrabber, handle); + AddSimpleRenderer(graphBuilder, sampleGrabber); } return videoRenderer; @@ -130,13 +131,20 @@ namespace DxPlay { DsError.ThrowExceptionForHR(hr); } - private IBaseFilter AddSimpleRenderer(IGraphBuilder graphBuilder, IBaseFilter sampleGrabber, IntPtr handle) { + private IBaseFilter AddSimpleRenderer(IGraphBuilder graphBuilder, IBaseFilter sampleGrabber) { logger.Debug("Add default VideoRenderer to graph"); IBaseFilter videoRenderer = (IBaseFilter)new VideoRendererDefault(); DsError.ThrowExceptionForHR(graphBuilder.AddFilter(videoRenderer, "VideoRendererDefault")); //FilterGraphTools.ConnectFilters(graphBuilder, sampleGrabber, "Output", videoRenderer, "VMR Input0", true); return videoRenderer; } + private IBaseFilter AddEVRRenderer(IGraphBuilder graphBuilder, IBaseFilter sampleGrabber) { + logger.Debug("Add EVR VideoRenderer to graph"); + IBaseFilter videoRenderer = (IBaseFilter)new EnhancedVideoRenderer(); + DsError.ThrowExceptionForHR(graphBuilder.AddFilter(videoRenderer, "EnhancedVideoRenderer")); + //FilterGraphTools.ConnectFilters(graphBuilder, sampleGrabber, "Output", videoRenderer, "VMR Input0", true); + return videoRenderer; + } private IBaseFilter AddSampleGrabber(IGraphBuilder graphBuilder, IBaseFilter videoDecoder) { logger.Debug("Add SampleGrabber to graph"); diff --git a/client/DxPlay/Properties/AssemblyInfo.cs b/client/DxPlay/Properties/AssemblyInfo.cs index 067dc019..6816984a 100644 --- a/client/DxPlay/Properties/AssemblyInfo.cs +++ b/client/DxPlay/Properties/AssemblyInfo.cs @@ -26,7 +26,7 @@ using System.Runtime.CompilerServices; // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("2.0.9.0")] +[assembly: AssemblyVersion("2.0.9.1")] // // In order to sign your assembly you must specify a key to use. Refer to the @@ -56,5 +56,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] -[assembly: AssemblyFileVersion("2.0.9.0")] +[assembly: AssemblyFileVersion("2.0.9.1")] diff --git a/client/Maestro/Configuration/configuration.json b/client/Maestro/Configuration/configuration.json index 05e339a1..49934f32 100644 --- a/client/Maestro/Configuration/configuration.json +++ b/client/Maestro/Configuration/configuration.json @@ -14,14 +14,9 @@ "filter": "avi,wav,mxf,mts", "useAlternateCopy": true, "autoTarget": "AUTOTARGET", + "autoTags": [ "AUTOTAG" ], "local": { - "address": "file://f:/Clip", - "userName": "mediacube", - "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", - "timeout": 1000 - }, - "remote": { - "address": "ftp://10.10.1.105/TESZT/TC", + "address": "file://c:/_XDCAM/Clip", "userName": "mediacube", "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", "timeout": 1000 diff --git a/client/Maestro/MaestroForm.Source.cs b/client/Maestro/MaestroForm.Source.cs index 2815a8b4..e51b6464 100644 --- a/client/Maestro/MaestroForm.Source.cs +++ b/client/Maestro/MaestroForm.Source.cs @@ -88,6 +88,8 @@ namespace Maestro { } private void MaestroForm_OnListReadCompleted(string[] files) { + logger.Info("Checking AUTOTARGET"); + //nem UNC forras if (!(Configuration?.Source is UNCSource)) return; @@ -165,6 +167,7 @@ namespace Maestro { try { //mxf metadata + duration ArchiveMetadata metadata = MXFMetadataReader.Read(file, true); + metadata.tags = Configuration?.Source?.AutoTags; metadata.itemHouseId = itemHouseId; metadata.mediaHouseId = metadata.mediaTitle; metadata.mediaTitle = sourceItem.FileInfo.Name; diff --git a/client/Maestro/Properties/AssemblyInfo.cs b/client/Maestro/Properties/AssemblyInfo.cs index 0b130400..0d9faa6e 100644 --- a/client/Maestro/Properties/AssemblyInfo.cs +++ b/client/Maestro/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.0.9")] -[assembly: AssemblyFileVersion("2.1.0.9")] +[assembly: AssemblyVersion("2.1.1.0")] +[assembly: AssemblyFileVersion("2.1.1.0")] diff --git a/client/MaestroShared/Commons/MsgBox.cs b/client/MaestroShared/Commons/MsgBox.cs index 7aa333be..5a9d369a 100644 --- a/client/MaestroShared/Commons/MsgBox.cs +++ b/client/MaestroShared/Commons/MsgBox.cs @@ -6,23 +6,23 @@ namespace MaestroShared.Commons { private static InputForm inputForm; public static void Info(string text) { - MessageBox.Show(text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information); + TopMostMessageBox.Show(text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information); } public static void Error(string text) { - MessageBox.Show(text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error); + TopMostMessageBox.Show(text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error); } public static void Warning(string text) { - MessageBox.Show(text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Warning); + TopMostMessageBox.Show(text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Warning); } public static void Exclamation(string text) { - MessageBox.Show(text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + TopMostMessageBox.Show(text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } public static bool YesNoQuestion(string text) { - return MessageBox.Show(text, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes; + return TopMostMessageBox.Show(text, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes; } public static string InputBox(string label) { if (inputForm == null) diff --git a/client/MaestroShared/Commons/TopMostMessageBox.cs b/client/MaestroShared/Commons/TopMostMessageBox.cs new file mode 100644 index 00000000..9679d80e --- /dev/null +++ b/client/MaestroShared/Commons/TopMostMessageBox.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace MaestroShared.Commons { + static public class TopMostMessageBox { + static public DialogResult Show(string message) { + return Show(message, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + static public DialogResult Show(string message, string title) { + return Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + static public DialogResult Show(string message, string title, + MessageBoxButtons buttons, MessageBoxIcon icon) { + // Create a host form that is a TopMost window which will be the + // parent of the MessageBox. + Form topmostForm = new Form(); + // We do not want anyone to see this window so position it off the + // visible screen and make it as small as possible + topmostForm.Size = new System.Drawing.Size(1, 1); + topmostForm.StartPosition = FormStartPosition.Manual; + System.Drawing.Rectangle rect = SystemInformation.VirtualScreen; + topmostForm.Location = new System.Drawing.Point(rect.Bottom + 10, + rect.Right + 10); + topmostForm.Show(); + // Make this form the active form and make it TopMost + topmostForm.Focus(); + topmostForm.BringToFront(); + topmostForm.TopMost = true; + // Finally show the MessageBox with the form just created as its owner + DialogResult result = MessageBox.Show(topmostForm, message, title, + buttons, icon); + topmostForm.Dispose(); // clean it up all the way + + return result; + } + } +} diff --git a/client/MaestroShared/Configuration/ConfigurationInfo.cs b/client/MaestroShared/Configuration/ConfigurationInfo.cs index 3cf7a364..be37e789 100644 --- a/client/MaestroShared/Configuration/ConfigurationInfo.cs +++ b/client/MaestroShared/Configuration/ConfigurationInfo.cs @@ -144,6 +144,8 @@ namespace MaestroShared.Configuration { public Connection Remote { get; set; } public string Filter { get; set; } public string AutoTarget { get; set; } + public string[] AutoTags { get; set; } + } public class UNCSource : Source { diff --git a/client/MaestroShared/MaestroShared.csproj b/client/MaestroShared/MaestroShared.csproj index a5f4b279..d66f3880 100644 --- a/client/MaestroShared/MaestroShared.csproj +++ b/client/MaestroShared/MaestroShared.csproj @@ -96,6 +96,7 @@ + diff --git a/client/MaestroShared/Properties/AssemblyInfo.cs b/client/MaestroShared/Properties/AssemblyInfo.cs index fe815e63..44a99e1f 100644 --- a/client/MaestroShared/Properties/AssemblyInfo.cs +++ b/client/MaestroShared/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.0.5")] -[assembly: AssemblyFileVersion("2.1.0.5")] +[assembly: AssemblyVersion("2.1.0.6")] +[assembly: AssemblyFileVersion("2.1.0.6")] diff --git a/client/MediaCube.sln b/client/MediaCube.sln index b7397f5a..0fe27c6b 100644 --- a/client/MediaCube.sln +++ b/client/MediaCube.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27004.2010 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29905.134 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DxPlay", "DxPlay\DxPlay.csproj", "{0B44B3D7-52D7-4C0E-9B1C-F48CEEDA36FE}" EndProject @@ -34,6 +34,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{B29016BD-2 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NativeOctopusClient", "NativeOctopusClient\NativeOctopusClient.csproj", "{C1A664BE-7852-4418-BF33-6F59434FC5DC}" EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MediaCubeApiTest", "MediaCubeApiTest\MediaCubeApiTest.vbproj", "{912B247F-B2ED-4A2F-A464-FCAA265EB415}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -146,6 +148,14 @@ Global {C1A664BE-7852-4418-BF33-6F59434FC5DC}.Release|Any CPU.Build.0 = Release|Any CPU {C1A664BE-7852-4418-BF33-6F59434FC5DC}.Release|x64.ActiveCfg = Release|x64 {C1A664BE-7852-4418-BF33-6F59434FC5DC}.Release|x64.Build.0 = Release|x64 + {912B247F-B2ED-4A2F-A464-FCAA265EB415}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {912B247F-B2ED-4A2F-A464-FCAA265EB415}.Debug|Any CPU.Build.0 = Debug|Any CPU + {912B247F-B2ED-4A2F-A464-FCAA265EB415}.Debug|x64.ActiveCfg = Debug|Any CPU + {912B247F-B2ED-4A2F-A464-FCAA265EB415}.Debug|x64.Build.0 = Debug|Any CPU + {912B247F-B2ED-4A2F-A464-FCAA265EB415}.Release|Any CPU.ActiveCfg = Release|Any CPU + {912B247F-B2ED-4A2F-A464-FCAA265EB415}.Release|Any CPU.Build.0 = Release|Any CPU + {912B247F-B2ED-4A2F-A464-FCAA265EB415}.Release|x64.ActiveCfg = Release|Any CPU + {912B247F-B2ED-4A2F-A464-FCAA265EB415}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/client/MediaCubeApiTest/MediaCubeApiTest.vbproj b/client/MediaCubeApiTest/MediaCubeApiTest.vbproj new file mode 100644 index 00000000..738f784d --- /dev/null +++ b/client/MediaCubeApiTest/MediaCubeApiTest.vbproj @@ -0,0 +1,136 @@ + + + + + Debug + AnyCPU + {912B247F-B2ED-4A2F-A464-FCAA265EB415} + Exe + MediaCubeApiTest.Module1 + MediaCubeApiTest + MediaCubeApiTest + 512 + Console + v4.6.1 + true + + + + AnyCPU + true + full + true + true + bin\Debug\ + MediaCubeApiTest.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + false + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + MediaCubeApiTest.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + false + + + On + + + Binary + + + Off + + + On + + + + api\LinkDotNet.MessageHandling.dll + + + False + api\LinkDotNet.MessageHandling.Contracts.dll + + + + False + api\MediaCubeClient.dll + + + False + api\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/MediaCubeApiTest/Module1.vb b/client/MediaCubeApiTest/Module1.vb new file mode 100644 index 00000000..bdcbeac8 --- /dev/null +++ b/client/MediaCubeApiTest/Module1.vb @@ -0,0 +1,28 @@ +Imports LinkDotNet.MessageHandling.Contracts +Imports MaestroShared.Configuration +Imports MediaCubeClient +Imports Newtonsoft.Json.Linq + +Module Module1 + + Sub Main() + Dim messageBus As IMessageBus = New LinkDotNet.MessageHandling.MessageBus() + + Dim writeline = Sub(x As MediaCubeWSMessage) + Console.WriteLine(x.Content) + End Sub + + + messageBus.Subscribe(Of MediaCubeWSMessage)(writeline) + + Dim connection As Connection = New Connection() + connection.Address = New Uri("ws://192.168.0.10/services/wsapi") + connection.Timeout = 1000 + Dim api As MediaCubeWSApi = New MediaCubeWSApi(connection, messageBus) + Dim Data As JObject = New JObject() + Data.Add("param", 1) + api.SubmitJob("cancelable.xml", "teszt név", Data) + + End Sub + +End Module diff --git a/client/MediaCubeApiTest/My Project/Application.Designer.vb b/client/MediaCubeApiTest/My Project/Application.Designer.vb new file mode 100644 index 00000000..db8b8b32 --- /dev/null +++ b/client/MediaCubeApiTest/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/client/MediaCubeApiTest/My Project/Application.myapp b/client/MediaCubeApiTest/My Project/Application.myapp new file mode 100644 index 00000000..23b627fb --- /dev/null +++ b/client/MediaCubeApiTest/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 2 + true + diff --git a/client/MediaCubeApiTest/My Project/AssemblyInfo.vb b/client/MediaCubeApiTest/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..3b7f7c65 --- /dev/null +++ b/client/MediaCubeApiTest/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + +' Review the values of the assembly attributes + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' + + + diff --git a/client/MediaCubeApiTest/My Project/Resources.Designer.vb b/client/MediaCubeApiTest/My Project/Resources.Designer.vb new file mode 100644 index 00000000..123792d3 --- /dev/null +++ b/client/MediaCubeApiTest/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("MediaCubeApiTest.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/client/MediaCubeApiTest/My Project/Resources.resx b/client/MediaCubeApiTest/My Project/Resources.resx new file mode 100644 index 00000000..ffecec85 --- /dev/null +++ b/client/MediaCubeApiTest/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/MediaCubeApiTest/My Project/Settings.Designer.vb b/client/MediaCubeApiTest/My Project/Settings.Designer.vb new file mode 100644 index 00000000..958b6d75 --- /dev/null +++ b/client/MediaCubeApiTest/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.MediaCubeApiTest.My.MySettings + Get + Return Global.MediaCubeApiTest.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/client/MediaCubeApiTest/My Project/Settings.settings b/client/MediaCubeApiTest/My Project/Settings.settings new file mode 100644 index 00000000..377f56d6 --- /dev/null +++ b/client/MediaCubeApiTest/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/client/MediaCubeApiTest/app.config b/client/MediaCubeApiTest/app.config new file mode 100644 index 00000000..0257f46c --- /dev/null +++ b/client/MediaCubeApiTest/app.config @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/MediaCubeClient/MediaCubeStrings.cs b/client/MediaCubeClient/MediaCubeStrings.cs index 85667f89..84d28223 100644 --- a/client/MediaCubeClient/MediaCubeStrings.cs +++ b/client/MediaCubeClient/MediaCubeStrings.cs @@ -1,6 +1,7 @@ namespace MediaCubeClient { class MediaCubeStrings { public static readonly string ACTION = "action"; + public static readonly string NAME = "name"; public static readonly string LIST = "list"; public static readonly string STARTJOB = "startjob"; public static readonly string ERROR = "error"; diff --git a/client/MediaCubeClient/MediaCubeWSApi.cs b/client/MediaCubeClient/MediaCubeWSApi.cs index 08f50b07..7e023a13 100644 --- a/client/MediaCubeClient/MediaCubeWSApi.cs +++ b/client/MediaCubeClient/MediaCubeWSApi.cs @@ -60,7 +60,7 @@ namespace MediaCubeClient { return result; } */ - public void SubmitJob(string template, JObject parameters) { + public void SubmitJob(string template, string name, JObject parameters) { ws.SslConfiguration.ServerCertificateValidationCallback = (s, c, ch, e) => { return true; }; @@ -68,36 +68,37 @@ namespace MediaCubeClient { JObject jo = JObject.Parse(e.Data); if ("SUSPENDED".Equals(jo.As(MediaCubeStrings.STATUS))) { ws.Close(); - messageBus.Send(new MediaCubeWSMessage("Hiba a MediaCube szolgáltatás használata során. Rendszerüzenet: " + jo.As(MediaCubeStrings.ERROR))); + messageBus?.Send(new MediaCubeWSMessage("Hiba a MediaCube szolgáltatás használata során. Rendszerüzenet: " + jo.As(MediaCubeStrings.ERROR))); return; } if ("FINISHED".Equals(jo.As(MediaCubeStrings.STATUS))) { ws.Close(); - messageBus.Send(new MediaCubeWSMessage()); + messageBus?.Send(new MediaCubeWSMessage()); return; } - messageBus.Send(new MediaCubeWSMessage(jo)); + messageBus?.Send(new MediaCubeWSMessage(jo)); }; ws.OnError += (s, e) => { ws.Close(); - messageBus.Send(new MediaCubeWSMessage("Hiba a MediaCube szolgáltatás használata során. Rendszerüzenet: " + e.Message)); + messageBus?.Send(new MediaCubeWSMessage("Hiba a MediaCube szolgáltatás használata során. Rendszerüzenet: " + e.Message)); }; try { ws.Connect(); } catch { ws.Close(); - messageBus.Send(new MediaCubeWSMessage("Sikertelen kapcsolódás a MediaCube szolgáltatáshoz.")); + messageBus?.Send(new MediaCubeWSMessage("Sikertelen kapcsolódás a MediaCube szolgáltatáshoz.")); } try { JObject data = new JObject(); + data.Add(MediaCubeStrings.NAME, JToken.FromObject(name)); data.Add(MediaCubeStrings.ACTION, JToken.FromObject(MediaCubeStrings.STARTJOB)); data.Add(MediaCubeStrings.TEMPLATE, JToken.FromObject(template)); data.Add(MediaCubeStrings.PARAMETERS, JToken.FromObject(parameters)); ws.Send(data.Serialize()); } catch (Exception e) { ws.Close(); - messageBus.Send(new MediaCubeWSMessage("Sikertelen MediaCube folyamatindítás.")); + messageBus?.Send(new MediaCubeWSMessage("Sikertelen MediaCube folyamatindítás.")); } } -- 2.54.0