From d7c43ccc96c11a5e971f4f84af5af1db4155127c Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Mon, 6 Nov 2017 15:46:54 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30691 --- client/DxPlay/DxPlay.csproj | 1 + client/DxPlay/DxPlayer.cs | 58 +- client/DxPlay/LAVInterfaces.cs | 1076 +++++++++++++++++ client/DxPlay/PlayerForm.cs | 8 +- .../Configuration/configuration-editor.json | 4 +- .../configuration-playout-ingest.json | 2 +- .../Configuration/configuration-studio.json | 2 +- .../Configuration/configuration-sxs.json | 2 +- client/Maestro/Maestro.csproj | 1 + client/Maestro/MaestroForm.Designer.cs | 480 ++++---- client/Maestro/MaestroForm.Source.cs | 45 +- client/Maestro/MaestroForm.Target.cs | 4 +- client/Maestro/MaestroForm.cs | 22 +- client/Maestro/Properties/AssemblyInfo.cs | 4 +- .../Maestro/Properties/Resources.Designer.cs | 10 + client/Maestro/Properties/Resources.resx | 3 + .../Resources/ic_clear_black_24dp_1x.png | Bin 0 -> 164 bytes client/Maestro/Sources/FileSystemSource.cs | 115 +- client/Maestro/Sources/NexioRESTSource.cs | 57 +- client/OctopusClient/OctopusAPI.cs | 86 +- client/OctopusClient/OctopusIDSelector.cs | 11 +- .../run-mediacube-server-bsh.launch | 2 +- server/-configuration/scheduledjobs.json | 6 +- .../jobtemplates/retrieve-material.xml | 4 + .../retrieve-morpheus-missing-materials.xml | 6 +- .../jobtemplates/retrieve-ondemand.xml | 4 + .../retrieve-traffic-missing-materials.xml | 4 + .../CheckMORPHEUSMissingMaterialsStep.java | 9 +- .../CheckTrafficMissingMaterialsStep.java | 11 +- .../jobengine/server/steps/TSMBackupStep.java | 6 +- .../server/steps/TSMRestoreStep.java | 8 +- .../src/user/commons/nexio/INexioAPI.java | 1 + .../nexio/NexioClipEventDispatcher.java | 50 +- .../GetExtendedIDFromIDHandleCommand.java | 4 +- .../src/user/commons/octopus/OctopusAPI.java | 228 ++-- .../commons/octopus/OctopusDataMiner.java | 4 +- .../pages/index.zul | 2 +- .../zk/model/RetrieveSelectorModel.java | 3 +- 38 files changed, 1768 insertions(+), 575 deletions(-) create mode 100644 client/DxPlay/LAVInterfaces.cs create mode 100644 client/Maestro/Resources/ic_clear_black_24dp_1x.png diff --git a/client/DxPlay/DxPlay.csproj b/client/DxPlay/DxPlay.csproj index 107cb7ff..0b8f4c4c 100644 --- a/client/DxPlay/DxPlay.csproj +++ b/client/DxPlay/DxPlay.csproj @@ -186,6 +186,7 @@ + diff --git a/client/DxPlay/DxPlayer.cs b/client/DxPlay/DxPlayer.cs index 9b310caa..b1e9f86e 100644 --- a/client/DxPlay/DxPlayer.cs +++ b/client/DxPlay/DxPlayer.cs @@ -14,6 +14,7 @@ using System.Drawing.Drawing2D; using System.Collections.Generic; namespace DxPlay { + internal class DxPlayer : ISampleGrabberCB, IDisposable { [DllImport("Kernel32.dll", EntryPoint = "RtlMoveMemory")] @@ -37,8 +38,6 @@ namespace DxPlay { private IFilterGraph2 m_FilterGraph; private IMediaControl m_mediaCtrl; private IMediaEvent m_mediaEvent; - private int m_videoWidth; - private int m_videoHeight; // Event used by Media Event thread private ManualResetEvent m_mre; @@ -74,17 +73,13 @@ namespace DxPlay { // Play an avi file into a window. Allow for snapshots. // (Control to show video in, Avi file to play - public DxPlayer(Control hWin, MediaDescription mediaDesc) { + public DxPlayer(Control hWin, ref MediaDescription mediaDesc) { FillTheHunStringvalues(); State = GraphState.Stopped; try { int hr; IntPtr hEvent; MediaDescription = mediaDesc; - if (mediaDesc != null) { - //todo ez itt nem biztos, hogy jó - CurrentTC = new Timecode(mediaDesc.FirstFrame); - } Debug.WriteLine("SetupGraph"); // Set up the graph SetupGraph(hWin); @@ -206,8 +201,7 @@ namespace DxPlay { long currentPosition; int hr = m_mediaSeek.GetCurrentPosition(out currentPosition); DsError.ThrowExceptionForHR(hr); - long AvgTimePerFrame = (long)Math.Ceiling(MEDIATIME_REFERENCE / MediaDescription.FrameRate); - int frames = (int)Math.Abs((double)currentPosition / AvgTimePerFrame); + int frames = ReferenceTimeToFrames(currentPosition); if (CurrentTC.ZeroBasedFrames != frames) { CurrentTC.Set(frames); //Debug.WriteLine("Current frame is {0} ({1}), media position is {2}, AVG frame time is {3}", frames, CurrentTC.ToString(), currentPosition, AvgTimePerFrame); @@ -216,15 +210,20 @@ namespace DxPlay { } + private int ReferenceTimeToFrames(long refTime) { + long AvgTimePerFrame = (long)Math.Ceiling(MEDIATIME_REFERENCE / MediaDescription.FrameRate); + return (int)Math.Abs((double)refTime / AvgTimePerFrame); + } + // Build the capture graph for grabber and renderer. // (Control to show video in, Filename to play) private void SetupGraph(Control hWin) { int hr; - if (MediaDescription != null) { - m_videoWidth = MediaDescription.Resolution.Width; - m_videoHeight = MediaDescription.Resolution.Height; - } + //if (MediaDescription != null) { + // m_videoWidth = MediaDescription.Resolution.Width; + // m_videoHeight = MediaDescription.Resolution.Height; + //} try { m_FilterGraph = new FilterGraph() as IFilterGraph2; @@ -279,9 +278,6 @@ namespace DxPlay { FilterGraphTools.ConnectFilters(graphBuilder, sampGrabber, "Output", m_videoRenderer, "VMR Input0", true); - - ConfigureVideoWindow(hWin); - if (DsFindPin.ByName(splitter, "Audio") != null) { IBaseFilter audioDecoder = FilterGraphTools.AddFilterByName(graphBuilder, FilterCategory.LegacyAmFilterCategory, "LAV Audio Decoder"); if (audioDecoder == null) @@ -292,7 +288,13 @@ namespace DxPlay { } SaveSizeInfo(sampGrabber as ISampleGrabber); + SetTimeCodes(); + ConfigureVideoWindow(hWin); + ILAVVideoSettings settings = (ILAVVideoSettings) videoDecoder; + //settings.SetSWDeintMode(LAVSWDeintModes.SWDeintMode_None); + settings.SetSWDeintMode(LAVSWDeintModes.SWDeintMode_YADIF); + settings.SetSWDeintOutput(LAVDeintOutput.DeintOutput_FramePer2Field); } catch (Exception e) { Debug.WriteLine(e.Message); @@ -307,6 +309,17 @@ namespace DxPlay { #endif } + private void SetTimeCodes() { + int hr; + long duration; + hr = m_mediaSeek.GetDuration(out duration); + DsError.ThrowExceptionForHR(hr); + MediaDescription.duration = new Timecode(); + MediaDescription.Duration.Set(ReferenceTimeToFrames(duration)); + MediaDescription.firstFrame = new Timecode(); + CurrentTC = new Timecode(MediaDescription.FirstFrame); + } + // Configure the video window private void ConfigureVideoWindow(Control hWin) { @@ -331,10 +344,13 @@ namespace DxPlay { } public void UpdateVideoWindow(Control hWin) { + Size resolution = MediaDescription.Resolution; + if (resolution.Width == 0 || resolution.Height == 0) + return; int hr; // Position the playing location Rectangle rc = hWin.ClientRectangle; - double x = (double)m_videoWidth / m_videoHeight; + double x = (double)resolution.Width / resolution.Height; double y = (double)rc.Right / rc.Bottom; int playerWidth = 0; int playerHeight = 0; @@ -342,7 +358,7 @@ namespace DxPlay { playerWidth = (int)Math.Ceiling(rc.Bottom * x); playerHeight = rc.Bottom; } else { - x = (double)m_videoHeight / m_videoWidth; + x = (double)resolution.Height / resolution.Width; playerWidth = rc.Right; playerHeight = (int)Math.Ceiling(rc.Right * x); ; } @@ -400,10 +416,10 @@ namespace DxPlay { // Grab the size info VideoInfoHeader videoInfoHeader = (VideoInfoHeader)Marshal.PtrToStructure(media.formatPtr, typeof(VideoInfoHeader)); - m_videoWidth = videoInfoHeader.BmiHeader.Width; - m_videoHeight = videoInfoHeader.BmiHeader.Height; - m_stride = m_videoWidth * (videoInfoHeader.BmiHeader.BitCount / 8); + MediaDescription.resolution = new Size(videoInfoHeader.BmiHeader.Width, videoInfoHeader.BmiHeader.Height); + MediaDescription.frameRate = MEDIATIME_REFERENCE / videoInfoHeader.AvgTimePerFrame; + m_stride = videoInfoHeader.BmiHeader.Width * (videoInfoHeader.BmiHeader.BitCount / 8); DsUtils.FreeAMMediaType(media); media = null; } diff --git a/client/DxPlay/LAVInterfaces.cs b/client/DxPlay/LAVInterfaces.cs new file mode 100644 index 00000000..0608fc89 --- /dev/null +++ b/client/DxPlay/LAVInterfaces.cs @@ -0,0 +1,1076 @@ +using DirectShowLib; +using System; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; + +namespace DxPlay { + #region "LAV COM classes" + + // use these if LAV is already registered (regsvr32) + // you will need the apropriate architecture (ie. if your player is 64 bits a 64 bit LAv filter must be installed) + // if you want to use your own supplied LAV filter without registration see FilterProvider class + + [ComImport, Guid("E8E73B6B-4CB3-44A4-BE99-4F7BCB96E491")] + public class LAVAudio { + } + [ComImport, Guid("B98D13E7-55DB-4385-A33D-09FD1BA26338")] + public class LAVSplitterSource { + } + [ComImport, Guid("171252A0-8820-4AFE-9DF8-5C92B2D66B04")] + public class LAVSplitter { + } + + [ComImport, Guid("EE30215D-164F-4A92-A4EB-9D4C13390F9F")] + public class LAVVideo { + } + + #endregion + + #region "Lav Video settings interface, implemented by LAVVideo" + + + // Codecs supported in the LAV Video configuration + // Codecs not listed here cannot be turned off. You can request codecs to be added to this list, if you wish. + public enum LAVVideoCodec { + Codec_H264, + Codec_VC1, + Codec_MPEG1, + Codec_MPEG2, + Codec_MPEG4, + Codec_MSMPEG4, + Codec_VP8, + Codec_WMV3, + Codec_WMV12, + Codec_MJPEG, + Codec_Theora, + Codec_FLV1, + Codec_VP6, + Codec_SVQ, + Codec_H261, + Codec_H263, + Codec_Indeo, + Codec_TSCC, + Codec_Fraps, + Codec_HuffYUV, + Codec_QTRle, + Codec_DV, + Codec_Bink, + Codec_Smacker, + Codec_RV12, + Codec_RV34, + Codec_Lagarith, + Codec_Cinepak, + Codec_Camstudio, + Codec_QPEG, + Codec_ZLIB, + Codec_QTRpza, + Codec_PNG, + Codec_MSRLE, + Codec_ProRes, + Codec_UtVideo, + Codec_Dirac, + Codec_DNxHD, + Codec_MSVideo1, + Codec_8BPS, + Codec_LOCO, + Codec_ZMBV, + Codec_VCR1, + Codec_Snow, + Codec_FFV1, + Codec_v210, + //Codec_NB // Number of entrys (do not use when dynamically linking) + }; + + // Codecs with hardware acceleration + public enum LAVVideoHWCodec { + HWCodec_H264 = LAVVideoCodec.Codec_H264, + HWCodec_VC1 = LAVVideoCodec.Codec_VC1, + HWCodec_MPEG2 = LAVVideoCodec.Codec_MPEG2, + HWCodec_MPEG4 = LAVVideoCodec.Codec_MPEG4, + + HWCodec_NB = LAVVideoHWCodec.HWCodec_MPEG4 + 1 + }; + + // Type of hardware accelerations + public enum LAVHWAccel { + HWAccel_None, + HWAccel_CUDA, + HWAccel_QuickSync, + HWAccel_DXVA2, + HWAccel_DXVA2CopyBack = HWAccel_DXVA2, + HWAccel_DXVA2Native + }; + + // Deinterlace algorithms offered by the hardware decoders + public enum LAVHWDeintModes { + HWDeintMode_Weave, + HWDeintMode_BOB, + HWDeintMode_Hardware + }; + + // Software deinterlacing algorithms + public enum LAVSWDeintModes { + SWDeintMode_None, + SWDeintMode_YADIF + }; + + // Type of deinterlacing to perform + // - FramePerField re-constructs one frame from every field, resulting in 50/60 fps. + // - FramePer2Field re-constructs one frame from every 2 fields, resulting in 25/30 fps. + // Note: Weave will always use FramePer2Field + public enum LAVDeintOutput { + DeintOutput_FramePerField, + DeintOutput_FramePer2Field + }; + + // Control the field order of the deinterlacer + public enum LAVDeintFieldOrder { + DeintFieldOrder_Auto, + DeintFieldOrder_TopFieldFirst, + DeintFieldOrder_BottomFieldFirst, + }; + + // Supported output pixel formats + public enum LAVOutPixFmts { + LAVOutPixFmt_None = -1, + LAVOutPixFmt_YV12, // 4:2:0, 8bit, planar + LAVOutPixFmt_NV12, // 4:2:0, 8bit, Y planar, U/V packed + LAVOutPixFmt_YUY2, // 4:2:2, 8bit, packed + LAVOutPixFmt_UYVY, // 4:2:2, 8bit, packed + LAVOutPixFmt_AYUV, // 4:4:4, 8bit, packed + LAVOutPixFmt_P010, // 4:2:0, 10bit, Y planar, U/V packed + LAVOutPixFmt_P210, // 4:2:2, 10bit, Y planar, U/V packed + LAVOutPixFmt_Y410, // 4:4:4, 10bit, packed + LAVOutPixFmt_P016, // 4:2:0, 16bit, Y planar, U/V packed + LAVOutPixFmt_P216, // 4:2:2, 16bit, Y planar, U/V packed + LAVOutPixFmt_Y416, // 4:4:4, 16bit, packed + LAVOutPixFmt_RGB32, // 32-bit RGB (BGRA) + LAVOutPixFmt_RGB24, // 24-bit RGB (BGR) + + LAVOutPixFmt_v210, // 4:2:2, 10bit, packed + LAVOutPixFmt_v410, // 4:4:4, 10bit, packed + + LAVOutPixFmt_YV16, // 4:2:2, 8-bit, planar + LAVOutPixFmt_YV24, // 4:4:4, 8-bit, planar + + //LAVOutPixFmt_NB // Number of formats + }; + + // dithering mode used by the filter + public enum LAVDitherMode { + LAVDither_Ordered, + LAVDither_Random + }; + + // LAV Video configuration interface + [ComVisible(true), ComImport, SuppressUnmanagedCodeSecurity, + Guid("FA40D6E9-4D38-4761-ADD2-71A9EC5FD32F"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface ILAVVideoSettings { + // Switch to Runtime Config mode. This will reset all settings to default, and no changes to the settings will be saved + // You can use this to programmatically configure LAV Audio without interfering with the users settings in the registry. + // Subsequent calls to this function will reset all settings back to defaults, even if the mode does not change. + // + // Note that calling this function during playback is not supported and may exhibit undocumented behaviour. + // For smooth operations, it must be called before LAV Audio is connected to other filters. + [PreserveSig] + int SetRuntimeConfig(bool bRuntimeConfig); + + // Configure which codecs are enabled + // If vCodec is invalid (possibly a version difference), Get will return FALSE, and Set E_FAIL. + [PreserveSig] + bool GetFormatConfiguration(LAVVideoCodec vCodec); + [PreserveSig] + int SetFormatConfiguration(LAVVideoCodec vCodec, bool bEnabled); + + // Set the number of threads to use for Multi-Threaded decoding (where available) + // 0 = Auto Detect (based on number of CPU cores) + // 1 = 1 Thread -- No Multi-Threading + // >1 = Multi-Threading with the specified number of threads + [PreserveSig] + int SetNumThreads(int dwNum); + + // Get the number of threads to use for Multi-Threaded decoding (where available) + // 0 = Auto Detect (based on number of CPU cores) + // 1 = 1 Thread -- No Multi-Threading + // >1 = Multi-Threading with the specified number of threads + [PreserveSig] + int GetNumThreads(); + + // Set wether the aspect ratio encoded in the stream should be forwarded to the renderer, + // or the aspect ratio specified by the source filter should be kept. + // TRUE = AR from the Stream + // FALSE = AR from the source filter + [PreserveSig] + int SetStreamAR(bool bStreamAR); + + // Get wether the aspect ratio encoded in the stream should be forwarded to the renderer, + // or the aspect ratio specified by the source filter should be kept. + // TRUE = AR from the Stream + // FALSE = AR from the source filter + [PreserveSig] + bool GetStreamAR(); + + // Configure which pixel formats are enabled for output + // If pixFmt is invalid, Get will return FALSE and Set E_FAIL + [PreserveSig] + bool GetPixelFormat(LAVOutPixFmts pixFmt); + [PreserveSig] + int SetPixelFormat(LAVOutPixFmts pixFmt, bool bEnabled); + + // Set the RGB output range for the YUV->RGB conversion + // 0 = Auto (same as input), 1 = Limited (16-235), 2 = Full (0-255) + [PreserveSig] + int SetRGBOutputRange(int dwRange); + + // Get the RGB output range for the YUV->RGB conversion + // 0 = Auto (same as input), 1 = Limited (16-235), 2 = Full (0-255) + [PreserveSig] + int GetRGBOutputRange(); + + // Set the deinterlacing field order of the hardware decoder + [PreserveSig] + int SetDeintFieldOrder(LAVDeintFieldOrder fieldOrder); + + // get the deinterlacing field order of the hardware decoder + [PreserveSig] + LAVDeintFieldOrder GetDeintFieldOrder(); + + // Set wether all frames should be deinterlaced if the stream is flagged interlaced + [PreserveSig] + int SetDeintAggressive(bool bAggressive); + + // Get wether all frames should be deinterlaced if the stream is flagged interlaced + [PreserveSig] + bool GetDeintAggressive(); + + // Set wether all frames should be deinterlaced, even ones marked as progressive + [PreserveSig] + int SetDeintForce(bool bForce); + + // Get wether all frames should be deinterlaced, even ones marked as progressive + [PreserveSig] + bool GetDeintForce(); + + // Check if the specified HWAccel is supported + // Note: This will usually only check the availability of the required libraries (ie. for NVIDIA if a recent enough NVIDIA driver is installed) + // and not check actual hardware support + // Returns: 0 = Unsupported, 1 = Supported, 2 = Currently running + [PreserveSig] + int CheckHWAccelSupport(LAVHWAccel hwAccel); + + // Set which HW Accel method is used + // See LAVHWAccel for options. + [PreserveSig] + int SetHWAccel(LAVHWAccel hwAccel); + + // Get which HW Accel method is active + [PreserveSig] + LAVHWAccel GetHWAccel(); + + // Set which codecs should use HW Acceleration + [PreserveSig] + int SetHWAccelCodec(LAVVideoHWCodec hwAccelCodec, bool bEnabled); + + // Get which codecs should use HW Acceleration + [PreserveSig] + bool GetHWAccelCodec(LAVVideoHWCodec hwAccelCodec); + + // Set the deinterlacing mode used by the hardware decoder + [PreserveSig] + int SetHWAccelDeintMode(LAVHWDeintModes deintMode); + + // Get the deinterlacing mode used by the hardware decoder + [PreserveSig] + LAVHWDeintModes GetHWAccelDeintMode(); + + // Set the deinterlacing output for the hardware decoder + [PreserveSig] + int SetHWAccelDeintOutput(LAVDeintOutput deintOutput); + + // Get the deinterlacing output for the hardware decoder + [PreserveSig] + LAVDeintOutput GetHWAccelDeintOutput(); + + // Set wether the hardware decoder should force high-quality deinterlacing + // Note: this option is not supported on all decoder implementations and/or all operating systems + [PreserveSig] + int SetHWAccelDeintHQ(bool bHQ); + + // Get wether the hardware decoder should force high-quality deinterlacing + // Note: this option is not supported on all decoder implementations and/or all operating systems + [PreserveSig] + bool GetHWAccelDeintHQ(); + + // Set the software deinterlacing mode used + [PreserveSig] + int SetSWDeintMode(LAVSWDeintModes deintMode); + + // Get the software deinterlacing mode used + [PreserveSig] + LAVSWDeintModes GetSWDeintMode(); + + // Set the software deinterlacing output + [PreserveSig] + int SetSWDeintOutput(LAVDeintOutput deintOutput); + + // Get the software deinterlacing output + [PreserveSig] + LAVDeintOutput GetSWDeintOutput(); + + // Set wether all content is treated as progressive, and any interlaced flags are ignored + [PreserveSig] + int SetDeintTreatAsProgressive(bool bEnabled); + + // Get wether all content is treated as progressive, and any interlaced flags are ignored + [PreserveSig] + bool GetDeintTreatAsProgressive(); + + // Set the dithering mode used + [PreserveSig] + int SetDitherMode(LAVDitherMode ditherMode); + + // Get the dithering mode used + [PreserveSig] + LAVDitherMode GetDitherMode(); + }; + + #endregion + + #region "Lav Audio settings and status interfaces, implemented by LavAudio" + + // Codecs supported in the LAV Audio configuration + // Codecs not listed here cannot be turned off. You can request codecs to be added to this list, if you wish. + public enum LAVAudioCodec { + Codec_AAC, + Codec_AC3, + Codec_EAC3, + Codec_DTS, + Codec_MP2, + Codec_MP3, + Codec_TRUEHD, + Codec_FLAC, + Codec_VORBIS, + Codec_LPCM, + Codec_PCM, + Codec_WAVPACK, + Codec_TTA, + Codec_WMA2, + Codec_WMAPRO, + Codec_Cook, + Codec_RealAudio + + //Codec_NB // Number of entrys (do not use when dynamically linking) + }; + + // Bitstreaming Codecs supported in LAV Audio + public enum LAVBitstreamCodec { + Bitstream_AC3, + Bitstream_EAC3, + Bitstream_TRUEHD, + Bitstream_DTS, + Bitstream_DTSHD + + //Bitstream_NB // Number of entrys (do not use when dynamically linking) + }; + + + // Supported Sample Formats in LAV Audio + public enum LAVAudioSampleFormat { + SampleFormat_16, + SampleFormat_24, + SampleFormat_32, + SampleFormat_U8, + SampleFormat_FP32, + SampleFormat_Bitstream + + //SampleFormat_NB // Number of entrys (do not use when dynamically linking) + }; + + // LAV Audio status interface + [ComVisible(true), ComImport, SuppressUnmanagedCodeSecurity, + Guid("A668B8F2-BA87-4F63-9D41-768F7DE9C50E"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface ILAVAudioStatus { + // Check if the given sample format is supported by the current playback chain + [PreserveSig] + bool IsSampleFormatSupported(LAVAudioSampleFormat sfCheck); + + // Get details about the current decoding format + [PreserveSig] + int GetDecodeDetails([MarshalAs(UnmanagedType.LPStr)]out string pCodec, [MarshalAs(UnmanagedType.LPStr)]out string pDecodeFormat, out int pnChannels, out int pSampleRate, out int pChannelMask); + + // Get details about the current output format + [PreserveSig] + int GetOutputDetails([MarshalAs(UnmanagedType.LPStr)]out string pOutputFormat, out int pnChannels, out int pSampleRate, out int pChannelMask); + + // Enable Volume measurements + [PreserveSig] + int EnableVolumeStats(); + + // Disable Volume measurements + [PreserveSig] + int DisableVolumeStats(); + + // Get Volume Average for the given channel + [PreserveSig] + int GetChannelVolumeAverage(int nChannel, out float pfDb); + }; + + // LAV Audio configuration interface + [ComVisible(true), ComImport, SuppressUnmanagedCodeSecurity, + Guid("4158A22B-6553-45D0-8069-24716F8FF171"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface ILAVAudioSettings { + // Switch to Runtime Config mode. This will reset all settings to default, and no changes to the settings will be saved + // You can use this to programmatically configure LAV Audio without interfering with the users settings in the registry. + // Subsequent calls to this function will reset all settings back to defaults, even if the mode does not change. + // + // Note that calling this function during playback is not supported and may exhibit undocumented behaviour. + // For smooth operations, it must be called before LAV Audio is connected to other filters. + [PreserveSig] + int SetRuntimeConfig(bool bRuntimeConfig); + + // Dynamic Range Compression + // pbDRCEnabled: The state of DRC + // piDRCLevel: The DRC strength (0-100, 100 is maximum) + [PreserveSig] + int GetDRC(out bool pbDRCEnabled, out int piDRCLevel); + [PreserveSig] + int SetDRC(bool bDRCEnabled, int iDRCLevel); + + // Configure which codecs are enabled + // If aCodec is invalid (possibly a version difference), Get will return FALSE, and Set E_FAIL. + [PreserveSig] + bool GetFormatConfiguration(LAVAudioCodec aCodec); + [PreserveSig] + int SetFormatConfiguration(LAVAudioCodec aCodec, bool bEnabled); + + // Control Bitstreaming + // If bsCodec is invalid (possibly a version difference), Get will return FALSE, and Set E_FAIL. + [PreserveSig] + bool GetBitstreamConfig(LAVBitstreamCodec bsCodec); + [PreserveSig] + int SetBitstreamConfig(LAVBitstreamCodec bsCodec, bool bEnabled); + + // Should "normal" DTS frames be encapsulated in DTS-HD frames when bitstreaming? + [PreserveSig] + bool GetDTSHDFraming(); + [PreserveSig] + int SetDTSHDFraming(bool bHDFraming); + + // Control Auto A/V syncing + [PreserveSig] + bool GetAutoAVSync(); + [PreserveSig] + int SetAutoAVSync(bool bAutoSync); + + // Convert all Channel Layouts to standard layouts + // Standard are: Mono, Stereo, 5.1, 6.1, 7.1 + [PreserveSig] + bool GetOutputStandardLayout(); + [PreserveSig] + int SetOutputStandardLayout(bool bStdLayout); + + // Expand Mono to Stereo by simply doubling the audio + [PreserveSig] + bool GetExpandMono(); + [PreserveSig] + int SetExpandMono(bool bExpandMono); + + // Expand 6.1 to 7.1 by doubling the back center + [PreserveSig] + bool GetExpand61(); + [PreserveSig] + int SetExpand61(bool bExpand61); + + // Allow Raw PCM and SPDIF encoded input + [PreserveSig] + bool GetAllowRawSPDIFInput(); + [PreserveSig] + int SetAllowRawSPDIFInput(bool bAllow); + + // Configure which sample formats are enabled + // Note: SampleFormat_Bitstream cannot be controlled by this + [PreserveSig] + bool GetSampleFormat(LAVAudioSampleFormat format); + [PreserveSig] + int SetSampleFormat(LAVAudioSampleFormat format, bool bEnabled); + + // Configure a delay for the audio + [PreserveSig] + int GetAudioDelay(out bool pbEnabled, out int pDelay); + [PreserveSig] + int SetAudioDelay(bool bEnabled, int delay); + } + + #endregion + + #region "Lav splitter settings interface, implemented by LAVSplitter and LAVSplitterSource" + + public enum LAVSubtitleMode { + LAVSubtitleMode_NoSubs = 0, + LAVSubtitleMode_ForcedOnly, + LAVSubtitleMode_Default, + LAVSubtitleMode_Advanced + }; + + [ComVisible(true), ComImport, SuppressUnmanagedCodeSecurity, + Guid("774A919D-EA95-4A87-8A1E-F48ABE8499C7"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface ILAVSplitterSettings { + // Switch to Runtime Config mode. This will reset all settings to default, and no changes to the settings will be saved + // You can use this to programmatically configure LAV Splitter without interfering with the users settings in the registry. + // Subsequent calls to this function will reset all settings back to defaults, even if the mode does not change. + // + // Note that calling this function during playback is not supported and may exhibit undocumented behaviour. + // For smooth operations, it must be called before LAV Splitter opens a file. + [PreserveSig] + int SetRuntimeConfig(bool runtime); + + + // Retrieve the preferred languages as ISO 639-2 language codes, comma seperated + // If the result is NULL, no language has been set + // Memory for the string will be allocated, and has to be free'ed by the caller with CoTaskMemFree + [PreserveSig] + int GetPreferredLanguages([MarshalAs(UnmanagedType.LPWStr)]out string langs); + + // Set the preferred languages as ISO 639-2 language codes, comma seperated + // To reset to no preferred language, pass NULL or the empty string + [PreserveSig] + int SetPreferredLanguages([MarshalAs(UnmanagedType.LPWStr)]string langs); + + // Retrieve the preferred subtitle languages as ISO 639-2 language codes, comma seperated + // If the result is NULL, no language has been set + // If no subtitle language is set, the main language preference is used. + // Memory for the string will be allocated, and has to be free'ed by the caller with CoTaskMemFree + [PreserveSig] + int GetPreferredSubtitleLanguages([MarshalAs(UnmanagedType.LPWStr)]out string langs); + + // Set the preferred subtitle languages as ISO 639-2 language codes, comma seperated + // To reset to no preferred language, pass NULL or the empty string + // If no subtitle language is set, the main language preference is used. + [PreserveSig] + int SetPreferredSubtitleLanguages([MarshalAs(UnmanagedType.LPWStr)]string langs); + + // Get the current subtitle mode + // See enum for possible values + [PreserveSig] + LAVSubtitleMode GetSubtitleMode(); + + // Set the current subtitle mode + // See enum for possible values + [PreserveSig] + int SetSubtitleMode(LAVSubtitleMode mode); + + // Get the subtitle matching language flag + // TRUE = Only subtitles with a language in the preferred list will be used; FALSE = All subtitles will be used + // @deprecated - do not use anymore, deprecated and non-functional, replaced by advanced subtitle mode + [PreserveSig] + bool GetSubtitleMatchingLanguage(); + + // Set the subtitle matching language flag + // TRUE = Only subtitles with a language in the preferred list will be used; FALSE = All subtitles will be used + // @deprecated - do not use anymore, deprecated and non-functional, replaced by advanced subtitle mode + [PreserveSig] + int SetSubtitleMatchingLanguage(bool mode); + + // Control wether a special "Forced Subtitles" stream will be created for PGS subs + [PreserveSig] + bool GetPGSForcedStream(); + + // Control wether a special "Forced Subtitles" stream will be created for PGS subs + [PreserveSig] + int SetPGSForcedStream(bool enabled); + + // Get the PGS forced subs config + // TRUE = only forced PGS frames will be shown, FALSE = all frames will be shown + [PreserveSig] + bool GetPGSOnlyForced(); + + // Set the PGS forced subs config + // TRUE = only forced PGS frames will be shown, FALSE = all frames will be shown + [PreserveSig] + int SetPGSOnlyForced(bool forced); + + // Get the VC-1 Timestamp Processing mode + // 0 - No Timestamp Correction, 1 - Always Timestamp Correction, 2 - Auto (Correction for Decoders that need it) + [PreserveSig] + int GetVC1TimestampMode(); + + // Set the VC-1 Timestamp Processing mode + // 0 - No Timestamp Correction, 1 - Always Timestamp Correction, 2 - Auto (Correction for Decoders that need it) + [PreserveSig] + int SetVC1TimestampMode(short enabled); + + // Set whether substreams (AC3 in TrueHD, for example) should be shown as a seperate stream + [PreserveSig] + int SetSubstreamsEnabled(bool enabled); + + // Check whether substreams (AC3 in TrueHD, for example) should be shown as a seperate stream + [PreserveSig] + bool GetSubstreamsEnabled(); + + // Set if the ffmpeg parsers should be used for video streams + [PreserveSig] + int SetVideoParsingEnabled(bool enabled); + + // Query if the ffmpeg parsers are being used for video streams + [PreserveSig] + bool GetVideoParsingEnabled(); + + // Set if LAV Splitter should try to fix broken HD-PVR streams + [PreserveSig] + int SetFixBrokenHDPVR(bool enabled); + + // Query if LAV Splitter should try to fix broken HD-PVR streams + [PreserveSig] + bool GetFixBrokenHDPVR(); + + // Control wether the givne format is enabled + [PreserveSig] + int SetFormatEnabled([MarshalAs(UnmanagedType.LPStr)]string strFormat, bool bEnabled); + + // Check if the given format is enabled + [PreserveSig] + bool IsFormatEnabled([MarshalAs(UnmanagedType.LPStr)]string strFormat); + + // Set if LAV Splitter should always completely remove the filter connected to its Audio Pin when the audio stream is changed + [PreserveSig] + int SetStreamSwitchRemoveAudio(bool enabled); + + // Query if LAV Splitter should always completely remove the filter connected to its Audio Pin when the audio stream is changed + [PreserveSig] + bool GetStreamSwitchRemoveAudio(); + + // Advanced Subtitle configuration. Refer to the documention for details. + // If no advanced config exists, will be NULL. + // Memory for the string will be allocated, and has to be free'ed by the caller with CoTaskMemFree + [PreserveSig] + int GetAdvancedSubtitleConfig([MarshalAs(UnmanagedType.LPWStr)]out string ec); + + // Advanced Subtitle configuration. Refer to the documention for details. + // To reset the config, pass NULL or the empty string. + // If no subtitle language is set, the main language preference is used. + [PreserveSig] + int SetAdvancedSubtitleConfig([MarshalAs(UnmanagedType.LPWStr)]string config); + + } + + #endregion + + #region "FIlterProvider - methods to get all the interfaces without having a registered COM object" + + /// + /// Class used to provide LAV filters as COM object without the need to register the filters + /// (using native methods to extract the com object with the IClassFactory interface) + /// + public static class FilterProvider { + /// + /// Delegate signature of GetClassObject in COM libraries + /// + internal delegate int LavVideoDllGetClassObject([MarshalAs(UnmanagedType.LPStruct)] Guid clsid, + [MarshalAs(UnmanagedType.LPStruct)] Guid riid, + [MarshalAs(UnmanagedType.IUnknown)] out object ppv); + + [DllImport("kernel32.dll")] + internal static extern IntPtr LoadLibrary(String dllname); + + [DllImport("kernel32.dll")] + internal static extern IntPtr GetProcAddress(IntPtr hModule, String procname); + + /// + /// The GUID of IUnknown + /// + public static readonly Guid IUNKNOWN_GUID = new Guid("{00000000-0000-0000-C000-000000000046}"); + + /// + /// The GUID of LAVVideo + /// + public static readonly Guid ILAVVIDEO_GUID = typeof(LAVVideo).GUID; //new Guid("{EE30215D-164F-4A92-A4EB-9D4C13390F9F}"); + + /// + /// The GUID of LAVAudio + /// + public static readonly Guid ILAVAUDIO_GUID = typeof(LAVAudio).GUID; //new Guid("{E8E73B6B-4CB3-44A4-BE99-4F7BCB96E491}"); + + /// + /// The GUID of LAVSplitter + /// + public static readonly Guid ILAVSPLITTER_GUID = typeof(LAVSplitter).GUID; //new Guid("{171252A0-8820-4AFE-9DF8-5C92B2D66B04}"); + + /// + /// The GUID of LAVSplitterSource + /// + public static readonly Guid ILAVSPLITTERSOURCE_GUID = typeof(LAVSplitterSource).GUID; //new Guid("{B98D13E7-55DB-4385-A33D-09FD1BA26338}"); + + /// + /// Will use this to make the method thread safe + /// + public static object threadSync = new object(); + + /// + /// Gets the IBaseFilter interface for the LAVVideo filter - you must release this when finished using it with Marshal.ReleaseComObject + /// + /// Get the Lav video settings interface used to controls and get info about the video filter + /// - you must release this when finished using it with Marshal.ReleaseComObject + /// subdirectory of your app where you store codec files (LAV*.ax) - default "codecs\" + /// LAVVideo interface to put into filterGraph + public static IBaseFilter GetVideoFilter(out ILAVVideoSettings settings, string subDir = @"codecs\") { + lock (threadSync) { + settings = null; + object oFactory = null; + object oFilter = null; + object oSettings = null; + IBaseFilter filter = null; + string currentDir = Directory.GetCurrentDirectory(); + // we have the filters in the subdirectory 'codecs' of the running app + string path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), subDir); + + try { + // we need to be in the filter directory since it will load a bunch + // of other dlls that are there, and they won't resolve otherwise + Directory.SetCurrentDirectory(path); + + path = Path.Combine(path, "LAVVideo.ax"); + + IntPtr lavVideoDll = LoadLibrary(path); + IntPtr proc = GetProcAddress(lavVideoDll, "DllGetClassObject"); + + var getClassObject = (LavVideoDllGetClassObject)Marshal.GetDelegateForFunctionPointer(proc, typeof(LavVideoDllGetClassObject)); + + int hr = getClassObject(ILAVVIDEO_GUID, IUNKNOWN_GUID, out oFactory); + + IClassFactory factory = oFactory as IClassFactory; + + if (factory == null) { + if (oFactory != null) Marshal.ReleaseComObject(oFactory); + throw new Exception("Could not QueryInterface for the IClassFactory interface"); + } + + Guid baseFilterGUID = typeof(IBaseFilter).GUID; + hr = factory.CreateInstance(null, baseFilterGUID, out oFilter); + + filter = oFilter as IBaseFilter; + if (filter == null) { + if (oFilter != null) Marshal.ReleaseComObject(oFilter); + throw new Exception("Could not QueryInterface for the IBaseFilter interface"); + } + + Guid videoSettingsGUID = new Guid("{FA40D6E9-4D38-4761-ADD2-71A9EC5FD32F}"); + hr = factory.CreateInstance(null, videoSettingsGUID, out oSettings); + + settings = oSettings as ILAVVideoSettings; + if (filter == null) { + if (oSettings != null) Marshal.ReleaseComObject(oSettings); + throw new Exception("Could not QueryInterface for the ILAVVideoSettings interface"); + } + + } + catch { + // if somehting bad happens give back the path since we will rethrow the exception ater cleanup + Directory.SetCurrentDirectory(currentDir); + + if (oFactory != null) + Marshal.FinalReleaseComObject(oFactory); + + if (oFilter != null) + Marshal.FinalReleaseComObject(oFilter); + + if (oSettings != null) + Marshal.FinalReleaseComObject(oSettings); + + throw; + } + finally { + // even if nothing bad happens we need to clenup and give back to the original path + Directory.SetCurrentDirectory(currentDir); + + if (oFactory != null) + Marshal.FinalReleaseComObject(oFactory); + + } + + return filter; + } + } + + /// + /// Gets the IBaseFilter interface for the LAVAudio filter - you must release this when finished using it with Marshal.ReleaseComObject + /// + /// Get the Lav audio settings interface used to control the audio filter + /// - you must release this when finished using it with Marshal.ReleaseComObject + /// Get the Lav audio status interface used to get info about the video filter status + /// - you must release this when finished using it with Marshal.ReleaseComObject + /// subdirectory of your app where you store codec files (LAV*.ax) - default "codecs\" + /// LAVVideo audio to put into filterGraph + public static IBaseFilter GetAudioFilter(out ILAVAudioSettings settings, out ILAVAudioStatus status, string subDir = @"codecs\") { + lock (threadSync) { + settings = null; + status = null; + object oFactory = null; + object oFilter = null; + object oSettings = null; + object oStatus = null; + IBaseFilter filter = null; + string currentDir = Directory.GetCurrentDirectory(); + // we have the filters in the subdirectory 'codecs' of the running app + string path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), subDir); + + try { + // we need to be in the filter directory since it will load a bunch + // of other dlls that are there, and they won't resolve otherwise + Directory.SetCurrentDirectory(path); + + path = Path.Combine(path, "LAVAudio.ax"); + + IntPtr lavVideoDll = LoadLibrary(path); + IntPtr proc = GetProcAddress(lavVideoDll, "DllGetClassObject"); + + var getClassObject = (LavVideoDllGetClassObject)Marshal.GetDelegateForFunctionPointer(proc, typeof(LavVideoDllGetClassObject)); + + int hr = getClassObject(ILAVAUDIO_GUID, IUNKNOWN_GUID, out oFactory); + + IClassFactory factory = oFactory as IClassFactory; + + if (factory == null) { + if (oFactory != null) Marshal.ReleaseComObject(oFactory); + throw new Exception("Could not QueryInterface for the IClassFactory interface"); + } + + Guid baseFilterGUID = typeof(IBaseFilter).GUID; + hr = factory.CreateInstance(null, baseFilterGUID, out oFilter); + + filter = oFilter as IBaseFilter; + if (filter == null) { + if (oFilter != null) Marshal.ReleaseComObject(oFilter); + throw new Exception("Could not QueryInterface for the IBaseFilter interface"); + } + + Guid audioSettingsGUID = typeof(ILAVAudioSettings).GUID; + hr = factory.CreateInstance(null, audioSettingsGUID, out oSettings); + + settings = oSettings as ILAVAudioSettings; + if (filter == null) { + if (oSettings != null) Marshal.ReleaseComObject(oSettings); + throw new Exception("Could not QueryInterface for the ILAVAudioSettings interface"); + } + + Guid audioStatusGUID = typeof(ILAVAudioStatus).GUID; + hr = factory.CreateInstance(null, audioStatusGUID, out oStatus); + + status = oStatus as ILAVAudioStatus; + if (filter == null) { + if (oStatus != null) Marshal.ReleaseComObject(oStatus); + throw new Exception("Could not QueryInterface for the ILAVAudioStatus interface"); + } + } + catch { + // if somehting bad happens give back the path since we will rethrow the exception ater cleanup + Directory.SetCurrentDirectory(currentDir); + + if (oFactory != null) + Marshal.FinalReleaseComObject(oFactory); + + if (oFilter != null) + Marshal.FinalReleaseComObject(oFilter); + + if (oStatus != null) + Marshal.FinalReleaseComObject(oStatus); + + if (oSettings != null) + Marshal.FinalReleaseComObject(oSettings); + + throw; + } + finally { + // even if nothing bad happens we need to clenup and give back to the original path + Directory.SetCurrentDirectory(currentDir); + + if (oFactory != null) + Marshal.FinalReleaseComObject(oFactory); + + } + + return filter; + } + } + + /// + /// Gets the IFileSourceFilter interface for the LAVSplitter filter - you must release this when finished using it with Marshal.ReleaseComObject + /// + /// Get the Lav splitter settings interface used to control the splitter filter + /// - you must release this when finished using it with Marshal.ReleaseComObject + /// subdirectory of your app where you store codec files (LAV*.ax) - default "codecs\" + /// LAVSplitterSource filter to put into filterGraph - set the filesource on it and release when finished + public static IFileSourceFilter GetSplitterSource(out ILAVSplitterSettings settings, string subDir = @"codecs\") { + lock (threadSync) { + settings = null; + object oFactory = null; + object oFilter = null; + object oSettings = null; + IFileSourceFilter filter = null; + string currentDir = Directory.GetCurrentDirectory(); + // we have the filters in the subdirectory 'codecs' of the running app + string path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), subDir); + + try { + // we need to be in the filter directory since it will load a bunch + // of other dlls that are there, and they won't resolve otherwise + Directory.SetCurrentDirectory(path); + + path = Path.Combine(path, "LAVSplitter.ax"); + + IntPtr lavVideoDll = LoadLibrary(path); + IntPtr proc = GetProcAddress(lavVideoDll, "DllGetClassObject"); + + var getClassObject = (LavVideoDllGetClassObject)Marshal.GetDelegateForFunctionPointer(proc, typeof(LavVideoDllGetClassObject)); + + int hr = getClassObject(ILAVSPLITTERSOURCE_GUID, IUNKNOWN_GUID, out oFactory); + + IClassFactory factory = oFactory as IClassFactory; + + if (factory == null) { + if (oFactory != null) Marshal.ReleaseComObject(oFactory); + throw new Exception("Could not QueryInterface for the IClassFactory interface"); + } + + Guid baseFilterGUID = typeof(IFileSourceFilter).GUID; + hr = factory.CreateInstance(null, baseFilterGUID, out oFilter); + + filter = oFilter as IFileSourceFilter; + if (filter == null) { + if (oFilter != null) Marshal.ReleaseComObject(oFilter); + throw new Exception("Could not QueryInterface for the IFileSourceFilter interface"); + } + + Guid splitterSettingsGUID = typeof(ILAVSplitterSettings).GUID; + hr = factory.CreateInstance(null, splitterSettingsGUID, out oSettings); + + settings = oSettings as ILAVSplitterSettings; + if (filter == null) { + if (oSettings != null) Marshal.ReleaseComObject(oSettings); + throw new Exception("Could not QueryInterface for the ILAVSplitterSettings interface"); + } + + } + catch { + // if somehting bad happens give back the path since we will rethrow the exception ater cleanup + Directory.SetCurrentDirectory(currentDir); + + if (oFactory != null) + Marshal.FinalReleaseComObject(oFactory); + + if (oFilter != null) + Marshal.FinalReleaseComObject(oFilter); + + if (oSettings != null) + Marshal.FinalReleaseComObject(oSettings); + + throw; + } + finally { + // even if nothing bad happens we need to clenup and give back to the original path + Directory.SetCurrentDirectory(currentDir); + + if (oFactory != null) + Marshal.FinalReleaseComObject(oFactory); + + } + + return filter; + } + } + + /// + /// Gets the IBaseFilter interface for the LAVSplitter filter - you must release this when finished using it with Marshal.ReleaseComObject + /// + /// Get the Lav splitter settings interface used to control the splitter filter + /// - you must release this when finished using it with Marshal.ReleaseComObject + /// subdirectory of your app where you store codec files (LAV*.ax) - default "codecs\" + /// LAVSplitter filter to put into filterGraph - release when finished + public static IBaseFilter GetSplitter(out ILAVSplitterSettings settings, string subDir = @"codecs\") { + lock (threadSync) { + settings = null; + object oFactory = null; + object oFilter = null; + object oSettings = null; + IBaseFilter filter = null; + string currentDir = Directory.GetCurrentDirectory(); + // we have the filters in the subdirectory 'codecs' of the running app + string path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), subDir); + + try { + // we need to be in the filter directory since it will load a bunch + // of other dlls that are there, and they won't resolve otherwise + Directory.SetCurrentDirectory(path); + + path = Path.Combine(path, "LAVSplitter.ax"); + + IntPtr lavVideoDll = LoadLibrary(path); + IntPtr proc = GetProcAddress(lavVideoDll, "DllGetClassObject"); + + var getClassObject = (LavVideoDllGetClassObject)Marshal.GetDelegateForFunctionPointer(proc, typeof(LavVideoDllGetClassObject)); + + int hr = getClassObject(ILAVSPLITTER_GUID, IUNKNOWN_GUID, out oFactory); + + IClassFactory factory = oFactory as IClassFactory; + + if (factory == null) { + if (oFactory != null) Marshal.ReleaseComObject(oFactory); + throw new Exception("Could not QueryInterface for the IClassFactory interface"); + } + + Guid baseFilterGUID = typeof(IBaseFilter).GUID; + hr = factory.CreateInstance(null, baseFilterGUID, out oFilter); + + filter = oFilter as IBaseFilter; + if (filter == null) { + if (oFilter != null) Marshal.ReleaseComObject(oFilter); + throw new Exception("Could not QueryInterface for the IBaseFilter interface"); + } + + Guid splitterSettingsGUID = typeof(ILAVSplitterSettings).GUID; + hr = factory.CreateInstance(null, splitterSettingsGUID, out oSettings); + + settings = oSettings as ILAVSplitterSettings; + if (filter == null) { + if (oSettings != null) Marshal.ReleaseComObject(oSettings); + throw new Exception("Could not QueryInterface for the ILAVSplitterSettings interface"); + } + + } + catch { + // if somehting bad happens give back the path since we will rethrow the exception ater cleanup + Directory.SetCurrentDirectory(currentDir); + + if (oFactory != null) + Marshal.FinalReleaseComObject(oFactory); + + if (oFilter != null) + Marshal.FinalReleaseComObject(oFilter); + + if (oSettings != null) + Marshal.FinalReleaseComObject(oSettings); + + throw; + } + finally { + // even if nothing bad happens we need to clenup and give back to the original path + Directory.SetCurrentDirectory(currentDir); + + if (oFactory != null) + Marshal.FinalReleaseComObject(oFactory); + + } + + return filter; + } + } + } + + #endregion + +} \ No newline at end of file diff --git a/client/DxPlay/PlayerForm.cs b/client/DxPlay/PlayerForm.cs index da203d15..83a7e899 100644 --- a/client/DxPlay/PlayerForm.cs +++ b/client/DxPlay/PlayerForm.cs @@ -60,14 +60,14 @@ namespace DxPlay { private void cueue() { m_play = null; try { - m_mediaDescription = MediaDetector.GetDescription(selectedFile); - + //m_mediaDescription = MediaDetector.GetDescription(selectedFile); + m_mediaDescription = new MediaDescription() { fileName = selectedFile }; trackBar1.Value = 0; trackBar1.Minimum = 0; - m_play = new DxPlayer(panelVideo, m_mediaDescription); + m_play = new DxPlayer(panelVideo, ref m_mediaDescription); m_play.PlayEvent += new DxPlayEvent(playEvent); if (m_mediaDescription != null) { - trackBar1.Maximum = m_mediaDescription.Duration.Frames + 1; + trackBar1.Maximum = m_mediaDescription.Duration.Frames; txtStartTC.Text = m_mediaDescription.FirstFrame.ToString(); txtEndTC.Text = m_mediaDescription.Duration.ToString(); } diff --git a/client/Maestro/Configuration/configuration-editor.json b/client/Maestro/Configuration/configuration-editor.json index 67d782db..8b84f8a3 100644 --- a/client/Maestro/Configuration/configuration-editor.json +++ b/client/Maestro/Configuration/configuration-editor.json @@ -1,7 +1,7 @@ { "title": "Szerkesztő", - "active": false, - "startInTray": true, + "active": true, + "startInTray": false, "enableCustomMetadataId": true, "player": { "enabled": true, diff --git a/client/Maestro/Configuration/configuration-playout-ingest.json b/client/Maestro/Configuration/configuration-playout-ingest.json index bb755209..26deea8e 100644 --- a/client/Maestro/Configuration/configuration-playout-ingest.json +++ b/client/Maestro/Configuration/configuration-playout-ingest.json @@ -1,6 +1,6 @@ { "title": "Lebony betöltő", - "active": true, + "active": false, "startInTray": false, "enableCustomMetadataId": true, "player": { diff --git a/client/Maestro/Configuration/configuration-studio.json b/client/Maestro/Configuration/configuration-studio.json index 6bd90e02..8682b163 100644 --- a/client/Maestro/Configuration/configuration-studio.json +++ b/client/Maestro/Configuration/configuration-studio.json @@ -1,7 +1,7 @@ { "title": "Stúdió", "active": false, - "startInTray": true, + "startInTray": false, "enableCustomMetadataId": true, "filter": "avi", "player": { diff --git a/client/Maestro/Configuration/configuration-sxs.json b/client/Maestro/Configuration/configuration-sxs.json index 31e6ae47..37437d74 100644 --- a/client/Maestro/Configuration/configuration-sxs.json +++ b/client/Maestro/Configuration/configuration-sxs.json @@ -1,7 +1,7 @@ { "title": "SxS", "active": false, - "startInTray": true, + "startInTray": false, "enableCustomMetadataId": true, "player": { "enabled": true, diff --git a/client/Maestro/Maestro.csproj b/client/Maestro/Maestro.csproj index 5ff8fe44..26e65fd6 100644 --- a/client/Maestro/Maestro.csproj +++ b/client/Maestro/Maestro.csproj @@ -331,6 +331,7 @@ + diff --git a/client/Maestro/MaestroForm.Designer.cs b/client/Maestro/MaestroForm.Designer.cs index 0e5d6e6b..04146eb2 100644 --- a/client/Maestro/MaestroForm.Designer.cs +++ b/client/Maestro/MaestroForm.Designer.cs @@ -26,28 +26,30 @@ namespace Maestro { /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle(); this.groupSource = new System.Windows.Forms.GroupBox(); - this.dataGridSource = new System.Windows.Forms.DataGridView(); + this.dgSource = new System.Windows.Forms.DataGridView(); this.bindingSource = new System.Windows.Forms.BindingSource(this.components); + this.pSourceFilter = new System.Windows.Forms.TableLayoutPanel(); + this.txtSourceFilter = new System.Windows.Forms.TextBox(); + this.btnClearFilter = new System.Windows.Forms.Button(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.textSelectedSource = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.buttonMetadata = new System.Windows.Forms.Button(); - this.lbSourceTitle = new System.Windows.Forms.Label(); this.ctxmActions = new System.Windows.Forms.ContextMenuStrip(this.components); this.ctxiDefineSegments = new System.Windows.Forms.ToolStripMenuItem(); this.ctxiModifyArchiveMetadata = new System.Windows.Forms.ToolStripMenuItem(); @@ -71,7 +73,7 @@ namespace Maestro { this.groupActions = new System.Windows.Forms.GroupBox(); this.tabSystem = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); - this.dataGridJobs = new System.Windows.Forms.DataGridView(); + this.dgJobs = new System.Windows.Forms.DataGridView(); this.columnLabel = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.columnID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Progress = new Maestro.Commons.DataGridViewProgressColumn(); @@ -83,14 +85,17 @@ namespace Maestro { this.columnKillDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.bindingSourceJobs = new System.Windows.Forms.BindingSource(this.components); this.tabPage2 = new System.Windows.Forms.TabPage(); - this.dataGridMessages = new System.Windows.Forms.DataGridView(); - this.systemMessageBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.metadataInfoBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.dgMessages = new System.Windows.Forms.DataGridView(); this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.timeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.messageDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.systemMessageBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.metadataInfoBindingSource = new System.Windows.Forms.BindingSource(this.components); this.groupSource.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridSource)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit(); + this.pSourceFilter.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); this.ctxmActions.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); @@ -115,10 +120,10 @@ namespace Maestro { this.groupActions.SuspendLayout(); this.tabSystem.SuspendLayout(); this.tabPage1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridJobs)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgJobs)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSourceJobs)).BeginInit(); this.tabPage2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridMessages)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgMessages)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.systemMessageBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.metadataInfoBindingSource)).BeginInit(); this.SuspendLayout(); @@ -126,9 +131,9 @@ namespace Maestro { // groupSource // this.groupSource.BackColor = System.Drawing.Color.Transparent; - this.groupSource.Controls.Add(this.dataGridSource); + this.groupSource.Controls.Add(this.dgSource); + this.groupSource.Controls.Add(this.pSourceFilter); this.groupSource.Controls.Add(this.tableLayoutPanel2); - this.groupSource.Controls.Add(this.lbSourceTitle); this.groupSource.Dock = System.Windows.Forms.DockStyle.Fill; this.groupSource.Location = new System.Drawing.Point(0, 0); this.groupSource.Name = "groupSource"; @@ -140,54 +145,93 @@ namespace Maestro { this.groupSource.Enter += new System.EventHandler(this.groupBox_Enter); this.groupSource.Leave += new System.EventHandler(this.groupBox_Leave); // - // dataGridSource - // - this.dataGridSource.AllowUserToAddRows = false; - this.dataGridSource.AllowUserToDeleteRows = false; - this.dataGridSource.AllowUserToResizeRows = false; - this.dataGridSource.AutoGenerateColumns = false; - this.dataGridSource.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; - this.dataGridSource.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; - this.dataGridSource.BackgroundColor = System.Drawing.Color.White; - this.dataGridSource.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.dataGridSource.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.Raised; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridSource.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; - this.dataGridSource.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridSource.DataSource = this.bindingSource; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.Gainsboro; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.Black; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dataGridSource.DefaultCellStyle = dataGridViewCellStyle2; - this.dataGridSource.Dock = System.Windows.Forms.DockStyle.Fill; - this.dataGridSource.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.dataGridSource.EnableHeadersVisualStyles = false; - this.dataGridSource.Location = new System.Drawing.Point(10, 36); - this.dataGridSource.Name = "dataGridSource"; - this.dataGridSource.RowHeadersVisible = false; - dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dataGridSource.RowsDefaultCellStyle = dataGridViewCellStyle3; - this.dataGridSource.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dataGridSource.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridSource.Size = new System.Drawing.Size(347, 363); - this.dataGridSource.TabIndex = 0; - this.dataGridSource.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.sourceGridView_CellContentClick); - this.dataGridSource.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridSource_CellEnter); - this.dataGridSource.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridSource_CellMouseDoubleClick); - this.dataGridSource.CellMouseEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridSource_CellMouseEnter); - this.dataGridSource.CellMouseLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridSource_CellMouseLeave); - this.dataGridSource.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.dataGridSource_CellPainting); - this.dataGridSource.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridSource_KeyDown); + // dgSource + // + this.dgSource.AllowUserToAddRows = false; + this.dgSource.AllowUserToDeleteRows = false; + this.dgSource.AllowUserToResizeRows = false; + this.dgSource.AutoGenerateColumns = false; + this.dgSource.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; + this.dgSource.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; + this.dgSource.BackgroundColor = System.Drawing.Color.White; + this.dgSource.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.dgSource.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.Raised; + dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle15.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle15.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle15.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle15.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle15.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgSource.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle15; + this.dgSource.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgSource.DataSource = this.bindingSource; + dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle16.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle16.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle16.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.Gainsboro; + dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgSource.DefaultCellStyle = dataGridViewCellStyle16; + this.dgSource.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgSource.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.dgSource.EnableHeadersVisualStyles = false; + this.dgSource.Location = new System.Drawing.Point(10, 51); + this.dgSource.Name = "dgSource"; + this.dgSource.RowHeadersVisible = false; + dataGridViewCellStyle17.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgSource.RowsDefaultCellStyle = dataGridViewCellStyle17; + this.dgSource.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgSource.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgSource.Size = new System.Drawing.Size(347, 348); + this.dgSource.TabIndex = 0; + this.dgSource.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.sourceGridView_CellContentClick); + this.dgSource.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridSource_CellEnter); + this.dgSource.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridSource_CellMouseDoubleClick); + this.dgSource.CellMouseEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridSource_CellMouseEnter); + this.dgSource.CellMouseLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridSource_CellMouseLeave); + this.dgSource.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.dataGridSource_CellPainting); + this.dgSource.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridSource_KeyDown); + // + // pSourceFilter + // + this.pSourceFilter.AutoSize = true; + this.pSourceFilter.ColumnCount = 2; + this.pSourceFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 94.5245F)); + this.pSourceFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.475504F)); + this.pSourceFilter.Controls.Add(this.txtSourceFilter, 0, 0); + this.pSourceFilter.Controls.Add(this.btnClearFilter, 1, 0); + this.pSourceFilter.Dock = System.Windows.Forms.DockStyle.Top; + this.pSourceFilter.Location = new System.Drawing.Point(10, 23); + this.pSourceFilter.Margin = new System.Windows.Forms.Padding(0); + this.pSourceFilter.Name = "pSourceFilter"; + this.pSourceFilter.Padding = new System.Windows.Forms.Padding(0, 4, 0, 4); + this.pSourceFilter.RowCount = 1; + this.pSourceFilter.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.pSourceFilter.Size = new System.Drawing.Size(347, 28); + this.pSourceFilter.TabIndex = 17; + // + // txtSourceFilter + // + this.txtSourceFilter.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtSourceFilter.Location = new System.Drawing.Point(0, 4); + this.txtSourceFilter.Margin = new System.Windows.Forms.Padding(0); + this.txtSourceFilter.Name = "txtSourceFilter"; + this.txtSourceFilter.Size = new System.Drawing.Size(328, 20); + this.txtSourceFilter.TabIndex = 16; + this.txtSourceFilter.TextChanged += new System.EventHandler(this.txtSourceFilter_TextChanged); + // + // btnClearFilter + // + this.btnClearFilter.Image = global::Maestro.Properties.Resources.ic_clear_black_24dp_1x; + this.btnClearFilter.Location = new System.Drawing.Point(328, 4); + this.btnClearFilter.Margin = new System.Windows.Forms.Padding(0); + this.btnClearFilter.Name = "btnClearFilter"; + this.btnClearFilter.Size = new System.Drawing.Size(19, 20); + this.btnClearFilter.TabIndex = 17; + this.btnClearFilter.UseVisualStyleBackColor = true; + this.btnClearFilter.Click += new System.EventHandler(this.btnClearFilter_Click); // // tableLayoutPanel2 // @@ -247,15 +291,6 @@ namespace Maestro { this.buttonMetadata.UseVisualStyleBackColor = false; this.buttonMetadata.Click += new System.EventHandler(this.buttonMetadata_Click); // - // lbSourceTitle - // - this.lbSourceTitle.Dock = System.Windows.Forms.DockStyle.Top; - this.lbSourceTitle.Location = new System.Drawing.Point(10, 23); - this.lbSourceTitle.Name = "lbSourceTitle"; - this.lbSourceTitle.Size = new System.Drawing.Size(347, 13); - this.lbSourceTitle.TabIndex = 15; - this.lbSourceTitle.Text = "source"; - // // ctxmActions // this.ctxmActions.ImageScalingSize = new System.Drawing.Size(19, 19); @@ -551,7 +586,7 @@ namespace Maestro { // // tabPage1 // - this.tabPage1.Controls.Add(this.dataGridJobs); + this.tabPage1.Controls.Add(this.dgJobs); this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3); @@ -560,26 +595,26 @@ namespace Maestro { this.tabPage1.Text = global::Maestro.StringResources.FOLYAMATOK; this.tabPage1.UseVisualStyleBackColor = true; // - // dataGridJobs - // - this.dataGridJobs.AllowUserToAddRows = false; - this.dataGridJobs.AllowUserToOrderColumns = true; - this.dataGridJobs.AllowUserToResizeRows = false; - this.dataGridJobs.AutoGenerateColumns = false; - this.dataGridJobs.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; - this.dataGridJobs.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; - this.dataGridJobs.BackgroundColor = System.Drawing.Color.White; - this.dataGridJobs.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridJobs.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; - this.dataGridJobs.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridJobs.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + // dgJobs + // + this.dgJobs.AllowUserToAddRows = false; + this.dgJobs.AllowUserToOrderColumns = true; + this.dgJobs.AllowUserToResizeRows = false; + this.dgJobs.AutoGenerateColumns = false; + this.dgJobs.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; + this.dgJobs.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; + this.dgJobs.BackgroundColor = System.Drawing.Color.White; + this.dgJobs.BorderStyle = System.Windows.Forms.BorderStyle.None; + dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle18.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle18.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle18.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle18.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle18.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgJobs.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle18; + this.dgJobs.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgJobs.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.columnLabel, this.columnID, this.Progress, @@ -589,39 +624,39 @@ namespace Maestro { this.columnInput, this.columnOutput, this.columnKillDate}); - this.dataGridJobs.DataSource = this.bindingSourceJobs; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle7.NullValue = null; - dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.Gainsboro; - dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.Black; - dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dataGridJobs.DefaultCellStyle = dataGridViewCellStyle7; - this.dataGridJobs.Dock = System.Windows.Forms.DockStyle.Fill; - this.dataGridJobs.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.dataGridJobs.EnableHeadersVisualStyles = false; - this.dataGridJobs.GridColor = System.Drawing.Color.White; - this.dataGridJobs.Location = new System.Drawing.Point(3, 3); - this.dataGridJobs.Name = "dataGridJobs"; - dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridJobs.RowHeadersDefaultCellStyle = dataGridViewCellStyle8; - this.dataGridJobs.RowHeadersVisible = false; - dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dataGridJobs.RowsDefaultCellStyle = dataGridViewCellStyle9; - this.dataGridJobs.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dataGridJobs.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridJobs.Size = new System.Drawing.Size(988, 92); - this.dataGridJobs.TabIndex = 0; - this.dataGridJobs.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridJobs_CellEnter); - this.dataGridJobs.MouseClick += new System.Windows.Forms.MouseEventHandler(this.dataGridJobs_MouseClick); + this.dgJobs.DataSource = this.bindingSourceJobs; + dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle21.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle21.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle21.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle21.NullValue = null; + dataGridViewCellStyle21.SelectionBackColor = System.Drawing.Color.Gainsboro; + dataGridViewCellStyle21.SelectionForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgJobs.DefaultCellStyle = dataGridViewCellStyle21; + this.dgJobs.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgJobs.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.dgJobs.EnableHeadersVisualStyles = false; + this.dgJobs.GridColor = System.Drawing.Color.White; + this.dgJobs.Location = new System.Drawing.Point(3, 3); + this.dgJobs.Name = "dgJobs"; + dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle22.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle22.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle22.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle22.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle22.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle22.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgJobs.RowHeadersDefaultCellStyle = dataGridViewCellStyle22; + this.dgJobs.RowHeadersVisible = false; + dataGridViewCellStyle23.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgJobs.RowsDefaultCellStyle = dataGridViewCellStyle23; + this.dgJobs.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgJobs.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgJobs.Size = new System.Drawing.Size(988, 92); + this.dgJobs.TabIndex = 0; + this.dgJobs.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridJobs_CellEnter); + this.dgJobs.MouseClick += new System.Windows.Forms.MouseEventHandler(this.dataGridJobs_MouseClick); // // columnLabel // @@ -635,8 +670,8 @@ namespace Maestro { // this.columnID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; this.columnID.DataPropertyName = "ID"; - dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.columnID.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle19.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.columnID.DefaultCellStyle = dataGridViewCellStyle19; this.columnID.HeaderText = "ID"; this.columnID.Name = "columnID"; this.columnID.Width = 44; @@ -653,8 +688,8 @@ namespace Maestro { // this.columnStatus.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; this.columnStatus.DataPropertyName = "Status"; - dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.columnStatus.DefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle20.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.columnStatus.DefaultCellStyle = dataGridViewCellStyle20; this.columnStatus.HeaderText = "Status"; this.columnStatus.Name = "columnStatus"; this.columnStatus.Width = 66; @@ -701,7 +736,7 @@ namespace Maestro { // // tabPage2 // - this.tabPage2.Controls.Add(this.dataGridMessages); + this.tabPage2.Controls.Add(this.dgMessages); this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(3); @@ -710,67 +745,61 @@ namespace Maestro { this.tabPage2.Text = global::Maestro.StringResources.UZENETEK; this.tabPage2.UseVisualStyleBackColor = true; // - // dataGridMessages - // - this.dataGridMessages.AllowUserToAddRows = false; - this.dataGridMessages.AllowUserToResizeRows = false; - this.dataGridMessages.AutoGenerateColumns = false; - this.dataGridMessages.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; - this.dataGridMessages.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; - this.dataGridMessages.BackgroundColor = System.Drawing.Color.White; - this.dataGridMessages.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridMessages.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10; - this.dataGridMessages.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridMessages.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + // dgMessages + // + this.dgMessages.AllowUserToAddRows = false; + this.dgMessages.AllowUserToResizeRows = false; + this.dgMessages.AutoGenerateColumns = false; + this.dgMessages.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; + this.dgMessages.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; + this.dgMessages.BackgroundColor = System.Drawing.Color.White; + this.dgMessages.BorderStyle = System.Windows.Forms.BorderStyle.None; + dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle24.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle24.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle24.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle24.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle24.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgMessages.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle24; + this.dgMessages.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgMessages.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn1, - this.dataGridViewTextBoxColumn2}); - this.dataGridMessages.DataSource = this.systemMessageBindingSource; - dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle12.ForeColor = System.Drawing.Color.Red; - dataGridViewCellStyle12.NullValue = null; - dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.Gainsboro; - dataGridViewCellStyle12.SelectionForeColor = System.Drawing.Color.Red; - dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dataGridMessages.DefaultCellStyle = dataGridViewCellStyle12; - this.dataGridMessages.Dock = System.Windows.Forms.DockStyle.Fill; - this.dataGridMessages.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.dataGridMessages.EnableHeadersVisualStyles = false; - this.dataGridMessages.GridColor = System.Drawing.Color.White; - this.dataGridMessages.Location = new System.Drawing.Point(3, 3); - this.dataGridMessages.Name = "dataGridMessages"; - this.dataGridMessages.ReadOnly = true; - dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle13.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle13.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle13.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridMessages.RowHeadersDefaultCellStyle = dataGridViewCellStyle13; - this.dataGridMessages.RowHeadersVisible = false; - dataGridViewCellStyle14.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dataGridMessages.RowsDefaultCellStyle = dataGridViewCellStyle14; - this.dataGridMessages.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dataGridMessages.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridMessages.Size = new System.Drawing.Size(988, 92); - this.dataGridMessages.TabIndex = 1; - // - // systemMessageBindingSource - // - this.systemMessageBindingSource.DataSource = typeof(Maestro.SystemMessage); - // - // metadataInfoBindingSource - // - this.metadataInfoBindingSource.DataSource = typeof(Maestro.Metadata.MetadataInfo); + this.dataGridViewTextBoxColumn2, + this.timeDataGridViewTextBoxColumn, + this.messageDataGridViewTextBoxColumn}); + this.dgMessages.DataSource = this.systemMessageBindingSource; + dataGridViewCellStyle26.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle26.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle26.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle26.ForeColor = System.Drawing.Color.Red; + dataGridViewCellStyle26.NullValue = null; + dataGridViewCellStyle26.SelectionBackColor = System.Drawing.Color.Gainsboro; + dataGridViewCellStyle26.SelectionForeColor = System.Drawing.Color.Red; + dataGridViewCellStyle26.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgMessages.DefaultCellStyle = dataGridViewCellStyle26; + this.dgMessages.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgMessages.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.dgMessages.EnableHeadersVisualStyles = false; + this.dgMessages.GridColor = System.Drawing.Color.White; + this.dgMessages.Location = new System.Drawing.Point(3, 3); + this.dgMessages.Name = "dgMessages"; + this.dgMessages.ReadOnly = true; + dataGridViewCellStyle27.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle27.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle27.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle27.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle27.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle27.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle27.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgMessages.RowHeadersDefaultCellStyle = dataGridViewCellStyle27; + this.dgMessages.RowHeadersVisible = false; + dataGridViewCellStyle28.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgMessages.RowsDefaultCellStyle = dataGridViewCellStyle28; + this.dgMessages.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgMessages.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgMessages.Size = new System.Drawing.Size(988, 92); + this.dgMessages.TabIndex = 1; // // dataGridViewTextBoxColumn1 // @@ -785,12 +814,36 @@ namespace Maestro { // this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.dataGridViewTextBoxColumn2.DataPropertyName = "Message"; - dataGridViewCellStyle11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle11; + dataGridViewCellStyle25.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle25; this.dataGridViewTextBoxColumn2.HeaderText = "Üzenet"; this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; this.dataGridViewTextBoxColumn2.ReadOnly = true; // + // timeDataGridViewTextBoxColumn + // + this.timeDataGridViewTextBoxColumn.DataPropertyName = "Time"; + this.timeDataGridViewTextBoxColumn.HeaderText = "Time"; + this.timeDataGridViewTextBoxColumn.Name = "timeDataGridViewTextBoxColumn"; + this.timeDataGridViewTextBoxColumn.ReadOnly = true; + this.timeDataGridViewTextBoxColumn.Width = 60; + // + // messageDataGridViewTextBoxColumn + // + this.messageDataGridViewTextBoxColumn.DataPropertyName = "Message"; + this.messageDataGridViewTextBoxColumn.HeaderText = "Message"; + this.messageDataGridViewTextBoxColumn.Name = "messageDataGridViewTextBoxColumn"; + this.messageDataGridViewTextBoxColumn.ReadOnly = true; + this.messageDataGridViewTextBoxColumn.Width = 83; + // + // systemMessageBindingSource + // + this.systemMessageBindingSource.DataSource = typeof(Maestro.SystemMessage); + // + // metadataInfoBindingSource + // + this.metadataInfoBindingSource.DataSource = typeof(Maestro.Metadata.MetadataInfo); + // // MaestroForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -806,8 +859,11 @@ namespace Maestro { this.Shown += new System.EventHandler(this.MaestroForm_Shown); this.Resize += new System.EventHandler(this.MaestroForm_Resize); this.groupSource.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.dataGridSource)).EndInit(); + this.groupSource.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).EndInit(); + this.pSourceFilter.ResumeLayout(false); + this.pSourceFilter.PerformLayout(); this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.PerformLayout(); this.ctxmActions.ResumeLayout(false); @@ -835,10 +891,10 @@ namespace Maestro { this.groupActions.ResumeLayout(false); this.tabSystem.ResumeLayout(false); this.tabPage1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.dataGridJobs)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgJobs)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSourceJobs)).EndInit(); this.tabPage2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.dataGridMessages)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgMessages)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.systemMessageBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.metadataInfoBindingSource)).EndInit(); this.ResumeLayout(false); @@ -848,7 +904,7 @@ namespace Maestro { #endregion private System.Windows.Forms.GroupBox groupSource; - private System.Windows.Forms.DataGridView dataGridSource; + private System.Windows.Forms.DataGridView dgSource; private System.Windows.Forms.BindingSource bindingSource; private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.SplitContainer splitContainer2; @@ -861,7 +917,7 @@ namespace Maestro { private System.Windows.Forms.TextBox textSelectedMetadata; private System.Windows.Forms.TableLayoutPanel panelActions; private System.Windows.Forms.GroupBox groupActions; - private System.Windows.Forms.DataGridView dataGridJobs; + private System.Windows.Forms.DataGridView dgJobs; private System.Windows.Forms.BindingSource bindingSourceJobs; private System.Windows.Forms.TabControl tabMetadata; private System.Windows.Forms.TabPage tpOctopus; @@ -882,8 +938,7 @@ namespace Maestro { private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabPage tabPage2; private System.Windows.Forms.BindingSource systemMessageBindingSource; - private System.Windows.Forms.Label lbSourceTitle; - private System.Windows.Forms.DataGridView dataGridMessages; + private System.Windows.Forms.DataGridView dgMessages; private System.Windows.Forms.DataGridViewTextBoxColumn columnLabel; private System.Windows.Forms.DataGridViewTextBoxColumn columnID; private Commons.DataGridViewProgressColumn Progress; @@ -895,6 +950,11 @@ namespace Maestro { private System.Windows.Forms.DataGridViewTextBoxColumn columnKillDate; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2; + private System.Windows.Forms.TableLayoutPanel pSourceFilter; + private System.Windows.Forms.TextBox txtSourceFilter; + private System.Windows.Forms.DataGridViewTextBoxColumn timeDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn messageDataGridViewTextBoxColumn; + private System.Windows.Forms.Button btnClearFilter; } } diff --git a/client/Maestro/MaestroForm.Source.cs b/client/Maestro/MaestroForm.Source.cs index 8745a84b..0587ec38 100644 --- a/client/Maestro/MaestroForm.Source.cs +++ b/client/Maestro/MaestroForm.Source.cs @@ -42,9 +42,9 @@ namespace Maestro { Uri remoteAddress = Configuration?.Source?.Remote?.Address; if (String.IsNullOrEmpty(remoteAddress?.ToString())) { if (!String.IsNullOrEmpty(localAddress?.ToString())) - SetSourceTitle(localAddress?.ToString()); + formTooltip.SetToolTip(groupSource, localAddress?.ToString()); } else - SetSourceTitle(remoteAddress?.ToString()); + formTooltip.SetToolTip(groupSource, remoteAddress?.ToString()); if (Configuration?.Source is UNCSource) { logger.Debug("UNC source initialization"); @@ -62,18 +62,7 @@ namespace Maestro { source.Startup(localAddress); bindingSource.DataSource = source; //dataGridSource.Columns.AddRange(new DataGridViewCheckBoxColumn()); - dataGridSource.Columns.AddRange(source.Columns); - } - - private void SetSourceTitle(String text) { - try { - lbSourceTitle.Text = text; - Size sz = new Size(lbSourceTitle.Width, Int32.MaxValue); - sz = TextRenderer.MeasureText(text, lbSourceTitle.Font, sz, TextFormatFlags.WordBreak); - lbSourceTitle.Height = sz.Height; - } - finally { - } + dgSource.Columns.AddRange(source.Columns); } private void OnFileInvolved(FileActionMsg m) { @@ -82,16 +71,16 @@ namespace Maestro { private void dataGridSource_CellMouseEnter(object sender, DataGridViewCellEventArgs e) { if (IsPlayColumn(e.ColumnIndex)) - dataGridSource.Cursor = Cursors.Hand; + dgSource.Cursor = Cursors.Hand; } private bool IsPlayColumn(int columnIndex) { - return columnIndex > -1 && dataGridSource.Columns[columnIndex] is DataGridViewImageColumn; + return columnIndex > -1 && dgSource.Columns[columnIndex] is DataGridViewImageColumn; } private void dataGridSource_CellMouseLeave(object sender, DataGridViewCellEventArgs e) { if (IsPlayColumn(e.ColumnIndex)) - dataGridSource.Cursor = Cursors.Default; + dgSource.Cursor = Cursors.Default; } private void dataGridSource_CellEnter(object sender, DataGridViewCellEventArgs e) { @@ -101,7 +90,7 @@ namespace Maestro { } private void sourceGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { - var selectedrows = dataGridSource.SelectedRows; + var selectedrows = dgSource.SelectedRows; var selectedItems = bindingSource.Current; if (selectedrows == null) return; @@ -135,7 +124,7 @@ namespace Maestro { private void UpdateCheckStates(DataGridViewSelectedRowCollection rows) { bool hasChecked = GetHasChecked(rows); - var nameColumn = dataGridSource.Columns.Cast().Where(x => x.HeaderText == StringResources.NEV).FirstOrDefault(); + var nameColumn = dgSource.Columns.Cast().Where(x => x.HeaderText == StringResources.NEV).FirstOrDefault(); if (nameColumn == null) return; int nameCellIndex = nameColumn.Index; @@ -196,10 +185,10 @@ namespace Maestro { private void dataGridSource_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { if (e.RowIndex < 0) return; - ISourceItem item = dataGridSource.Rows[e.RowIndex].DataBoundItem as ISourceItem; + ISourceItem item = dgSource.Rows[e.RowIndex].DataBoundItem as ISourceItem; if (item == null) return; - DataGridViewRow row = dataGridSource.Rows[e.RowIndex]; + DataGridViewRow row = dgSource.Rows[e.RowIndex]; if (item.IsHighlighted) { row.DefaultCellStyle.BackColor = Color.DarkGreen; row.DefaultCellStyle.ForeColor = Color.White; @@ -210,13 +199,13 @@ namespace Maestro { private void dataGridSource_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex < 0) return; - UpdateCheckStates(dataGridSource.SelectedRows); + UpdateCheckStates(dgSource.SelectedRows); } private void dataGridSource_KeyDown(object sender, KeyEventArgs e) { - if (e.KeyCode != Keys.Space || dataGridSource.CurrentCell.GetType() == typeof(DataGridViewCheckBoxCell)) + if (e.KeyCode != Keys.Space || dgSource.CurrentCell.GetType() == typeof(DataGridViewCheckBoxCell)) return; - UpdateCheckStates(dataGridSource.SelectedRows); + UpdateCheckStates(dgSource.SelectedRows); } private void buttonMetadata_Click(object sender, EventArgs e) { @@ -311,5 +300,13 @@ namespace Maestro { buttonMetadata.Enabled = metadataType != MetadataType.MediaCube && metadataType != MetadataType.None; } + private void txtSourceFilter_TextChanged(object sender, EventArgs e) { + bindingSource.Filter = txtSourceFilter.Text; + } + + private void btnClearFilter_Click(object sender, EventArgs e) { + txtSourceFilter.Text = null; + } + } } diff --git a/client/Maestro/MaestroForm.Target.cs b/client/Maestro/MaestroForm.Target.cs index 2cba2172..73764e89 100644 --- a/client/Maestro/MaestroForm.Target.cs +++ b/client/Maestro/MaestroForm.Target.cs @@ -28,10 +28,8 @@ namespace Maestro { public partial class MaestroForm { private SegmentConverter segmentConverter; - private ToolTip targetTooltip; private void InitializeTarget() { - targetTooltip = new ToolTip(); btnExecute.Enabled = false; if (Configuration.Targets == null) return; @@ -56,7 +54,7 @@ namespace Maestro { Dock = DockStyle.Top, Tag = target }; - targetTooltip.SetToolTip(checkBox, target.Remote?.Address?.ToString()); + formTooltip.SetToolTip(checkBox, target.Remote?.Address?.ToString()); checkBox.CheckStateChanged += (s, e) => OnChecked(checkBox, target); panelActions.Controls.Add(checkBox); panelActions.RowCount = panelActions.Controls.Count; diff --git a/client/Maestro/MaestroForm.cs b/client/Maestro/MaestroForm.cs index 5845a393..8ff1f3b7 100644 --- a/client/Maestro/MaestroForm.cs +++ b/client/Maestro/MaestroForm.cs @@ -29,6 +29,7 @@ namespace Maestro { private BackgroundWorker processorWorker; public IMessageBus MessageBus { get; set; } private IMessageBus errorMessageBus = new MessageBus(); + private ToolTip formTooltip = new ToolTip(); private ConfigurationInfo configuration; public ConfigurationInfo Configuration { @@ -72,7 +73,7 @@ namespace Maestro { } private void InitializeComponents() { - dataGridMessages.AutoGenerateColumns = false; + dgMessages.AutoGenerateColumns = false; errorMessageBus.Subscribe(OnMessage); errorMessageBus.Subscribe(OnMessage); errorMessageBus.Subscribe(OnMessage); @@ -86,7 +87,7 @@ namespace Maestro { private void OnMessage(IMessage message) { var pi = message.GetType().GetProperty("Content"); string text = pi.GetValue(message) as string; - ObjectExtensions.SafeCall(dataGridMessages, () => { + ObjectExtensions.SafeCall(dgMessages, () => { systemMessageBindingSource.Insert(0, new SystemMessage() { Time = DateTime.Now, Message = text }); ActivateTab(1); }); @@ -95,8 +96,8 @@ namespace Maestro { private void InitializeJobs() { bindingSourceJobs.DataSource = jobs; - foreach (DataGridViewColumn column in dataGridJobs.Columns) { - column.HeaderCell.Style.Font = new Font(dataGridJobs.Font, FontStyle.Regular); + foreach (DataGridViewColumn column in dgJobs.Columns) { + column.HeaderCell.Style.Font = new Font(dgJobs.Font, FontStyle.Regular); } } @@ -124,7 +125,7 @@ namespace Maestro { if (position == -1) return; bindingSourceJobs.Position = position; - dataGridJobs.FirstDisplayedScrollingRowIndex = position; + dgJobs.FirstDisplayedScrollingRowIndex = position; }); job.Execute(); } else { @@ -161,7 +162,7 @@ namespace Maestro { ITargetProcessor item = bindingSourceJobs.Current as ITargetProcessor; if (item == null || e.RowIndex < 0 || e.ColumnIndex < 0) return; - DataGridViewCell cell = dataGridJobs.Rows[e.RowIndex].Cells[e.ColumnIndex]; + DataGridViewCell cell = dgJobs.Rows[e.RowIndex].Cells[e.ColumnIndex]; cell.ToolTipText = item.Message; } @@ -197,7 +198,7 @@ namespace Maestro { //} private void dataGridJobs_MouseClick(object sender, MouseEventArgs e) { - if (e.Button == MouseButtons.Right && dataGridJobs.SelectedRows.Count == 1) { + if (e.Button == MouseButtons.Right && dgJobs.SelectedRows.Count == 1) { ContextMenu popupMenu = new ContextMenu(); MenuItem makeFileToProtected = new MenuItem(StringResources.ALLOMANY_VEDETTE_TETELE); makeFileToProtected.Click += MakeFileToProtected_click; @@ -205,7 +206,7 @@ namespace Maestro { deleteProcess.Click += DeleteProcess_click; popupMenu.MenuItems.Add(makeFileToProtected); popupMenu.MenuItems.Add(deleteProcess); - popupMenu.Show(dataGridJobs, new Point(e.X, e.Y)); + popupMenu.Show(dgJobs, new Point(e.X, e.Y)); } } @@ -235,8 +236,9 @@ namespace Maestro { } } }; - var actualRow = dataGridJobs.SelectedRows[0]; - dataGridJobs.Rows.Remove(actualRow); + var actualRow = dgJobs.SelectedRows[0]; + dgJobs.Rows.Remove(actualRow); } + } } diff --git a/client/Maestro/Properties/AssemblyInfo.cs b/client/Maestro/Properties/AssemblyInfo.cs index 5ff6cda9..af6aa6fb 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("1.9.4.2")] -[assembly: AssemblyFileVersion("1.9.4.2")] +[assembly: AssemblyVersion("1.9.5")] +[assembly: AssemblyFileVersion("1.9.5")] diff --git a/client/Maestro/Properties/Resources.Designer.cs b/client/Maestro/Properties/Resources.Designer.cs index f2000603..ea490d5f 100644 --- a/client/Maestro/Properties/Resources.Designer.cs +++ b/client/Maestro/Properties/Resources.Designer.cs @@ -70,6 +70,16 @@ namespace Maestro.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap ic_clear_black_24dp_1x { + get { + object obj = ResourceManager.GetObject("ic_clear_black_24dp_1x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// diff --git a/client/Maestro/Properties/Resources.resx b/client/Maestro/Properties/Resources.resx index 36fe5867..e37b6e60 100644 --- a/client/Maestro/Properties/Resources.resx +++ b/client/Maestro/Properties/Resources.resx @@ -121,6 +121,9 @@ ..\Resources\mediacube_logo_small.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ic_clear_black_24dp_1x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Pause.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/client/Maestro/Resources/ic_clear_black_24dp_1x.png b/client/Maestro/Resources/ic_clear_black_24dp_1x.png new file mode 100644 index 0000000000000000000000000000000000000000..40a1a84e34f4fb9c31b1dccf1b2bd7f5a50ac00d GIT binary patch literal 164 zcmV;V09*fwP)sk-JD0khitqTXh)pRMJG@i$s0?u7=-9w79C44_C)lX zz(X)uOrq9x(!B0yds6FqsOrxLT1JZ%dT8WI*T|)=kuAA(6FISb{yyJ}v-ts@i9+gL S?1Y&B0000 acceptableExtensions = new List(); - private List cache = new List(); + private List cache; private BackgroundWorker pathWatcherWorker = new BackgroundWorker(); private string path; - private bool initialized; - private ClearAndInitialize clearAndInitialize; + FileSystemWatcher watcher; public DataGridViewColumn[] Columns { get { @@ -66,14 +63,30 @@ namespace Maestro.Sources { public string Filter { get => filter; set { - if (cache.Count == 0) - cache.AddRange(this); filter = value; - Clear(); - cache.Where(i => i.Name.ToLower().Contains(filter.ToLower())).ToList().ForEach(i => Add(i)); + if (String.IsNullOrEmpty(filter)) { + RemoveFilter(); + } else { + ApplyFilter(filter); + } } } + private void ApplyFilter(string value) { + if (cache == null) + cache = new List(this); + Clear(); + IEnumerable filteredItems = cache.Where(i => (i.Name == null) ? false : i.Name.ToLower().Contains(filter.ToLower())); + filteredItems.ToList().ForEach(i => parent.SafeCall(() => Add(i))); + + } + + public void RemoveFilter() { + Clear(); + cache = null; + Shutdown(); + } + public ListSortDescriptionCollection SortDescriptions => throw new NotImplementedException(); public bool SupportsAdvancedSorting => throw new NotImplementedException(); @@ -91,12 +104,11 @@ namespace Maestro.Sources { private void pathWatcherWorker_watchPath(object sender, DoWorkEventArgs e) { while (true) { - if (!(Directory.Exists(path))) { - if (initialized) { - WatchedDirDeleted(); - } + if (!Directory.Exists(path)) { + if (watcher != null) + Shutdown(); } else { - if (!initialized) + if (watcher == null) InnerStartUp(); } System.Threading.Thread.Sleep(100); @@ -104,15 +116,10 @@ namespace Maestro.Sources { } - private void WatchedDirDeleted() { - clearAndInitialize = new ClearAndInitialize(ClearDataGridView); - clearAndInitialize?.Invoke(); - } - - private void ClearDataGridView() { + private void Shutdown() { parent.SafeCall(() => Clear()); - cache.Clear(); - initialized = false; + watcher.Dispose(); + watcher = null; } private void SetAcceptableExtensions(string fileExtensionFilter) { @@ -123,26 +130,14 @@ namespace Maestro.Sources { public void Startup(Uri address) { string path = address.LocalPath; this.path = path; - clearAndInitialize = ClearDataGridView; - //if (Directory.Exists(path)) - // InnerStartUp(); pathWatcherWorker.RunWorkerAsync(); } private void InnerStartUp() { createWatch(path); - //Task.Run(() => initializeList(path)); initializeList(path); - initialized = true; } - - - //private void AddItem(FileInfo fi, bool highlight) { - // FileSourceItem item = CreateItem(fi, highlight); - // Add(item); - //} - private FileSourceItem CreateItem(FileInfo fi, bool highlight) { return new FileSourceItem() { FileInfo = fi, @@ -151,16 +146,26 @@ namespace Maestro.Sources { }; } + private void SafeRemove(FileSourceItem item) { + if (String.IsNullOrEmpty(filter)) + parent.SafeCall(() => this.Remove(item)); + else + parent.SafeCall(() => cache.Remove(item)); + } + private void initializeList(string path) { string[] files = Directory.GetFiles(path); - //files.Select(f => CreateItem(new FileInfo(f), false)).Where(x => x.Name.EndsWith("avi")).OrderByDescending(i => i.Created).ToList().ForEach(i => parent.SafeCall(() => Add(i))); var fileSourceItems = files.Select(f => CreateItem(new FileInfo(f), false)).OrderByDescending(i => i.Created); - fileSourceItems.Where(x => x.CanHandle(acceptableExtensions)).ToList().ForEach(i => parent.SafeCall(() => Add(i))); - //cache.AddRange(this); + try { + fileSourceItems.Where(x => x.CanHandle(acceptableExtensions)).ToList().ForEach(i => parent.SafeCall(() => Add(i))); + } + catch (Exception e) { + Shutdown(); + } } private void createWatch(string path) { - FileSystemWatcher watcher = new FileSystemWatcher(); + watcher = new FileSystemWatcher(); watcher.Path = path; //watcher.NotifyFilter = NotifyFilters.LastWrite; watcher.Filter = "*.*"; @@ -177,7 +182,9 @@ namespace Maestro.Sources { } public void OnRenamed(object sender, RenamedEventArgs e) { - logger.Debug("{0} {1} {2}", e.ChangeType, e.OldName, e.Name); + if (!String.IsNullOrEmpty(filter)) + return; + //logger.Debug("{0} {1} {2}", e.ChangeType, e.OldName, e.Name); FileInfo fiOld = new FileInfo(e.OldFullPath); FileInfo fiNew = new FileInfo(e.FullPath); if (fiOld.Extension.Equals(fiNew.Extension)) { @@ -204,7 +211,9 @@ namespace Maestro.Sources { } private void OnChanged(object sender, FileSystemEventArgs e) { - logger.Debug("{0} {1}", e.ChangeType, e.Name); + if (!String.IsNullOrEmpty(filter)) + return; + //logger.Debug("{0} {1}", e.ChangeType, e.Name); var item = this.Where(x => x.Name == e.Name).FirstOrDefault(); if (item == null || !item.CanHandle(acceptableExtensions)) return; @@ -219,7 +228,8 @@ namespace Maestro.Sources { } private void OnCreated(object sender, FileSystemEventArgs e) { - //TODO enable cancel + if (!String.IsNullOrEmpty(filter)) + return; var item = CreateItem(new FileInfo(e.FullPath), true); if (!item.CanHandle(acceptableExtensions)) return; @@ -232,6 +242,16 @@ namespace Maestro.Sources { logger.Debug("{0} {1}", e.ChangeType, e.Name); } + private void OnDeleted(object sender, FileSystemEventArgs e) { + if (!String.IsNullOrEmpty(filter)) + return; + logger.Debug("{0} {1}", e.ChangeType, e.Name); + FileSourceItem item = this.Where(i => i.Name.Equals(e.Name)).FirstOrDefault(); + if (item == null || !item.CanHandle(acceptableExtensions)) + return; + SafeDeleteItem(item); + } + private void SafeCreateItem(FileSourceItem item) { parent.SafeCall(() => { Insert(0, item); @@ -242,14 +262,6 @@ namespace Maestro.Sources { }); } - private void OnDeleted(object sender, FileSystemEventArgs e) { - logger.Debug("{0} {1}", e.ChangeType, e.Name); - FileSourceItem item = this.Where(i => i.Name.Equals(e.Name)).FirstOrDefault(); - if (item == null || !item.CanHandle(acceptableExtensions)) - return; - SafeDeleteItem(item); - } - private void SafeDeleteItem(FileSourceItem item) { parent.SafeCall(() => { Remove(item); @@ -263,10 +275,5 @@ namespace Maestro.Sources { public void ApplySort(ListSortDescriptionCollection sorts) { throw new NotImplementedException(); } - - public void RemoveFilter() { - Clear(); - cache.ForEach(i => Add(i)); - } } } diff --git a/client/Maestro/Sources/NexioRESTSource.cs b/client/Maestro/Sources/NexioRESTSource.cs index 7e65d23e..7aeb5cc0 100644 --- a/client/Maestro/Sources/NexioRESTSource.cs +++ b/client/Maestro/Sources/NexioRESTSource.cs @@ -11,9 +11,7 @@ using WebSocketSharp; using System; using System.Drawing; using NLog; -using MediaCubeClient; using System.Collections.Generic; -using System.Collections.Concurrent; namespace Maestro.Sources { class NexioRESTSource : BindingList, ISource { @@ -25,15 +23,19 @@ namespace Maestro.Sources { private const string DURATION = "duration"; private const string MODIFIED = "modifiedtimestamp"; private List acceptableAgencies = new List(); - //private ConcurrentBag cache = new ConcurrentBag(); + private List cache; private IMessageBus messageBus; private Control parent; - private NexioAPI dataClient; + private NexioAPI nexioAPI; private string filter; + private string path; public DataGridViewColumn[] Columns { get { DataGridViewColumn[] result = new DataGridViewColumn[] { + new DataGridViewCheckBoxColumn(){ + DataPropertyName = "IsChecked" + }, new DataGridViewTextBoxColumn(){ DataPropertyName = "Name", HeaderText = StringResources.NEV, @@ -43,7 +45,7 @@ namespace Maestro.Sources { new DataGridViewTextBoxColumn(){ DataPropertyName = "Agency", HeaderText = StringResources.UGYNOKSEG, - AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader + AutoSizeMode = DataGridViewAutoSizeColumnMode.None }, new DataGridViewTextBoxColumn() { DataPropertyName = "Created", @@ -66,15 +68,22 @@ namespace Maestro.Sources { public string Filter { get => filter; set { filter = value; - if (String.IsNullOrEmpty(value)) { + if (String.IsNullOrEmpty(filter)) RemoveFilter(); - } else { - Clear(); - //cache.Where(i => i.Name.ToLower().Contains(filter.ToLower())).ToList().ForEach(i => Add(i)); - } + else + ApplyFilter(filter); } } + private void ApplyFilter(string value) { + if (cache == null) + cache = new List(this); + Clear(); + IEnumerable filteredItems = cache.Where(i => (i.Name == null) ? false : i.Name.ToLower().Contains(filter.ToLower())); + filteredItems.ToList().ForEach(i => parent.SafeCall(() => Add(i))); + + } + public ListSortDescriptionCollection SortDescriptions => throw new NotImplementedException(); public bool SupportsAdvancedSorting => throw new NotImplementedException(); @@ -93,18 +102,22 @@ namespace Maestro.Sources { } public void Startup(Uri address) { - string path = address.OriginalString; + path = address.OriginalString; + InnerStartup(); + } + + private void InnerStartup() { CreateWatch(path); initializeList(path); } private void CreateWatch(string path) { - dataClient = new NexioAPI(path, messageBus); - dataClient.Open(OnResponse); + nexioAPI = new NexioAPI(path, messageBus); + nexioAPI.Open(OnResponse); } private void initializeList(string path) { - dataClient.GetListAsync(); + nexioAPI.GetListAsync(); } private void OnResponse(object sender, MessageEventArgs e) { @@ -131,10 +144,6 @@ namespace Maestro.Sources { } } - //private void AddItem(JToken token, Boolean highlight) { - // //Add(item); - //} - private NexioSourceItem CreateItem(JToken token, bool highlight) { NexioSourceItem item = new NexioSourceItem() { IsHighlighted = highlight @@ -159,11 +168,12 @@ namespace Maestro.Sources { private void OnList(JToken l) { if (l == null) return; - //l.Children().ToList().Select(t => CreateItem(t, false)).OrderByDescending(i => i.Created).ToList().ForEach(i => parent.SafeCall(() => Add(i))); l.Children().ToList().Select(t => CreateItem(t, false)).Where(x => x.CanHandle(acceptableAgencies)).OrderByDescending(i => i.Created).ToList().ForEach(i => parent.SafeCall(() => Add(i))); } private void OnChanged(JToken token) { + if (!String.IsNullOrEmpty(filter)) + return; string id = token[ID].ToString(); var item = Items.Where(x => x.ID == id).SingleOrDefault(); if (item == null) { @@ -193,6 +203,8 @@ namespace Maestro.Sources { } private void OnCreated(JToken token) { + if (!String.IsNullOrEmpty(filter)) + return; var item = CreateItem(token, true); if (!item.CanHandle(acceptableAgencies)) return; @@ -207,6 +219,8 @@ namespace Maestro.Sources { } private void OnDeleted(JToken d) { + if (!String.IsNullOrEmpty(filter)) + return; string id = d[ID].ToString(); var item = this.Where(i => i.ID != null && i.ID.Equals(id)).SingleOrDefault(); if (item == null) @@ -225,8 +239,11 @@ namespace Maestro.Sources { } public void RemoveFilter() { + if (nexioAPI != null) + nexioAPI.Close(); + nexioAPI = null; Clear(); - //cache.ToList().ForEach(i => Add(i)); + InnerStartup(); } diff --git a/client/OctopusClient/OctopusAPI.cs b/client/OctopusClient/OctopusAPI.cs index 2c73ff1b..d766c817 100644 --- a/client/OctopusClient/OctopusAPI.cs +++ b/client/OctopusClient/OctopusAPI.cs @@ -24,12 +24,10 @@ namespace OctopusClient { public class Story { public string ID { get; set; } public string Name { get; set; } - public MosObject[] MosObjects { get; set; } - public string Script { get; set; } - + public string Format { get; set; } + public MosObject[] MosObjects { get; set; } public StoryFolder[] StoryFolders { get; set; } - public Rundown[] Rundowns { get; set; } public override String ToString() { @@ -130,18 +128,7 @@ namespace OctopusClient { JArray resultObject = JArray.Parse(response.Content); result = resultObject.Children().Select(d => { - List objs = GetMosObjectsFromStory(d); - Story r = new Story { - ID = d["id"].ToString(), - Name = d["name"].ToString(), - MosObjects = objs?.ToArray() - }; - if (d["script"] != null) - r.Script = d["script"].ToString(); - if (d["story_folder"] != null) - r.StoryFolders = GetStoryFolderFromStory(d).ToArray(); - if (d["rundown"] != null) - r.Rundowns = GetRundownFromStory(d).ToArray(); + Story r = ToStory(d); logger.Debug($"{r}"); return r; }).OrderBy(r => { @@ -154,6 +141,18 @@ namespace OctopusClient { return result; } + private Story ToStory(JToken d) { + return new Story { + ID = d["id"]?.ToString(), + Name = d["name"]?.ToString(), + Format = d["format"]?.ToString(), + MosObjects = GetMosObjectsFromStory(d)?.ToArray(), + Script = d["script"]?.ToString(), + StoryFolders = GetStoryFolderFromStory(d)?.ToArray(), + Rundowns = GetRundownFromStory(d)?.ToArray() + }; + } + public IEnumerable GetStoryFolderStories(string storyFolderID) { IEnumerable result = null; try { @@ -168,19 +167,7 @@ namespace OctopusClient { JArray resultObject = JArray.Parse(response.Content); result = resultObject.Children().Select(d => { - List objs = GetMosObjectsFromStory(d); - Story r = new Story { - ID = d["id"].ToString(), - Name = d["name"].ToString(), - MosObjects = objs?.ToArray() - }; - if (d["script"] != null) { - r.Script = d["script"].ToString(); - } - if (d["story_folder"] != null) - r.StoryFolders = GetStoryFolderFromStory(d).ToArray(); - if (d["rundown"] != null) - r.Rundowns = GetRundownFromStory(d).ToArray(); + Story r = ToStory(d); logger.Debug($"{r}"); return r; }).OrderBy(r => { @@ -194,6 +181,8 @@ namespace OctopusClient { } private List GetRundownFromStory(JToken d) { + if (d["rundown"] == null) + return null; JToken[] array = d["rundown"].ToArray(); List objs = new List(); foreach (JToken token in array) { @@ -204,6 +193,8 @@ namespace OctopusClient { } private List GetStoryFolderFromStory(JToken d) { + if (d["story_folder"] == null) + return null; JToken[] array = d["story_folder"].ToArray(); List objs = new List(); foreach (JToken token in array) { @@ -273,16 +264,7 @@ namespace OctopusClient { JArray resultObject = JArray.Parse(response.Content); result = resultObject.Children().Select(d => { - Story r = new Story { - ID = d["id"].ToString(), - Name = d["name"].ToString() - }; - if (d["script"] != null) - r.Script = d["script"].ToString(); - if (d["story_folder"] != null) - r.StoryFolders = GetStoryFolderFromStory(d).ToArray(); - if (d["rundown"] != null) - r.Rundowns = GetRundownFromStory(d).ToArray(); + Story r = ToStory(d); logger.Debug($"{r}"); return r; }); @@ -307,17 +289,7 @@ namespace OctopusClient { JArray resultObject = JArray.Parse(response.Content); result = resultObject.Children().Select(d => { - Story r = new Story { - ID = d["id"].ToString(), - Name = String.IsNullOrEmpty(d["name"].ToString()) ? OctopusAPI.UNNAMED : d["name"].ToString() - }; - if (d["script"] != null) - r.Script = d["script"].ToString(); - //script_content - if (d["story_folder"] != null) - r.StoryFolders = GetStoryFolderFromStory(d).ToArray(); - if (d["rundown"] != null) - r.Rundowns = GetRundownFromStory(d).ToArray(); + Story r = ToStory(d); //logger.Debug($"{r}"); return r; }); @@ -490,19 +462,7 @@ namespace OctopusClient { JArray resultObject = JArray.Parse(response.Content); result = resultObject.Children().Select(d => { - List objs = GetMosObjectsFromStory(d); - Story r = new Story { - ID = d["id"].ToString(), - Name = d["name"].ToString(), - MosObjects = objs.ToArray() - }; - if (d["script_content"] != null) { - r.Script = d["script_content"].ToString(); - } - if (d["story_folder"] != null) - r.StoryFolders = GetStoryFolderFromStory(d).ToArray(); - if (d["rundown"] != null) - r.Rundowns = GetRundownFromStory(d).ToArray(); + Story r = ToStory(d); logger.Debug($"{r}"); return r; }).OrderBy(r => { diff --git a/client/OctopusClient/OctopusIDSelector.cs b/client/OctopusClient/OctopusIDSelector.cs index 9b9718d1..46350fe8 100644 --- a/client/OctopusClient/OctopusIDSelector.cs +++ b/client/OctopusClient/OctopusIDSelector.cs @@ -70,6 +70,8 @@ namespace OctopusClient { if (rundown == null) return; logger.Info("Selected rundown {0} {1}", rundown.ID, rundown.Name); + if ("0".Equals(rundown.ID)) + return; IEnumerable stories = client.GetRundownStories(rundown.ID); if (stories == null) return; @@ -80,7 +82,12 @@ namespace OctopusClient { private void AddStories(IEnumerable stories) { foreach (var story in stories) { string name = story.Name == null ? "" : story.Name; - TreeNode actualNode = treeOctopus.Nodes.Add(story.ID, String.Format($"{story.ID} {story.Name}")); + string label = story.ID; + if (!String.IsNullOrEmpty(story.Format)) + label += String.Format($" [{story.Format}] {story.Name}"); + else + label += String.Format($" {story.Name}"); + TreeNode actualNode = treeOctopus.Nodes.Add(story.ID, label); HideCheckBox(treeOctopus, actualNode); MosObject[] mosObjects = story.MosObjects; if (mosObjects == null) @@ -98,7 +105,7 @@ namespace OctopusClient { return; treeOctopus.Nodes.Clear(); logger.Info("Selected StoryFolder {0} {1}", storyFolder.ID, storyFolder.Name); - if (storyFolder.ID.Equals("0")) + if ("0".Equals(storyFolder.ID)) return; var stories = client.GetStoryFolderStories(storyFolder.ID); if (stories == null) diff --git a/server/-configuration/run-mediacube-server-bsh.launch b/server/-configuration/run-mediacube-server-bsh.launch index f957593d..d0240306 100644 --- a/server/-configuration/run-mediacube-server-bsh.launch +++ b/server/-configuration/run-mediacube-server-bsh.launch @@ -19,7 +19,7 @@ - + diff --git a/server/-configuration/scheduledjobs.json b/server/-configuration/scheduledjobs.json index 58bc474b..410e2004 100644 --- a/server/-configuration/scheduledjobs.json +++ b/server/-configuration/scheduledjobs.json @@ -24,7 +24,8 @@ {"name": "userName", "value": "MAM", "type": "java.lang.String"}, {"name": "password", "value": "Echotv.hu", "type": "java.lang.String"}, {"name": "lookupDays", "value": 7, "type": "java.lang.Integer"}, - {"name": "targetPath", "value": "\\\\10.10.1.100\\BRAAVOS\\PLAYOUT", "type": "java.lang.String"} + {"name": "targetPath", "value": "\\\\10.10.1.100\\BRAAVOS\\PLAYOUT", "type": "java.lang.String"}, + {"name": "killDateDays", "value": 10, "type": "java.lang.Integer"} ] }, { @@ -35,7 +36,8 @@ "cronexpression": "0 0 0/1 1/1 * ? *", "parameters": [ {"name": "sourcePath", "value": "\\\\10.10.1.100\\BRAAVOS\\PLAYOUT\\MORPHEUS", "type": "java.lang.String"}, - {"name": "targetPath", "value": "\\\\10.10.1.100\\BRAAVOS\\PLAYOUT", "type": "java.lang.String"} + {"name": "targetPath", "value": "\\\\10.10.1.100\\BRAAVOS\\PLAYOUT", "type": "java.lang.String"}, + {"name": "killDateDays", "value": 10, "type": "java.lang.Integer"} ] }, { diff --git a/server/user.jobengine.executors/jobtemplates/retrieve-material.xml b/server/user.jobengine.executors/jobtemplates/retrieve-material.xml index b36cf922..d8088ad6 100644 --- a/server/user.jobengine.executors/jobtemplates/retrieve-material.xml +++ b/server/user.jobengine.executors/jobtemplates/retrieve-material.xml @@ -6,6 +6,7 @@ + @@ -23,6 +24,9 @@ + + + diff --git a/server/user.jobengine.executors/jobtemplates/retrieve-morpheus-missing-materials.xml b/server/user.jobengine.executors/jobtemplates/retrieve-morpheus-missing-materials.xml index 0f9c1eb6..94a21ba1 100644 --- a/server/user.jobengine.executors/jobtemplates/retrieve-morpheus-missing-materials.xml +++ b/server/user.jobengine.executors/jobtemplates/retrieve-morpheus-missing-materials.xml @@ -1,9 +1,10 @@ - + + @@ -15,6 +16,9 @@ + + + diff --git a/server/user.jobengine.executors/jobtemplates/retrieve-ondemand.xml b/server/user.jobengine.executors/jobtemplates/retrieve-ondemand.xml index cc492ecc..e3ded320 100644 --- a/server/user.jobengine.executors/jobtemplates/retrieve-ondemand.xml +++ b/server/user.jobengine.executors/jobtemplates/retrieve-ondemand.xml @@ -8,6 +8,7 @@ + @@ -53,6 +54,9 @@ + + + diff --git a/server/user.jobengine.executors/jobtemplates/retrieve-traffic-missing-materials.xml b/server/user.jobengine.executors/jobtemplates/retrieve-traffic-missing-materials.xml index c31360cb..ab02fc57 100644 --- a/server/user.jobengine.executors/jobtemplates/retrieve-traffic-missing-materials.xml +++ b/server/user.jobengine.executors/jobtemplates/retrieve-traffic-missing-materials.xml @@ -7,6 +7,7 @@ + @@ -27,6 +28,9 @@ + + + diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckMORPHEUSMissingMaterialsStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckMORPHEUSMissingMaterialsStep.java index 8071c713..843b2734 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckMORPHEUSMissingMaterialsStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckMORPHEUSMissingMaterialsStep.java @@ -23,6 +23,7 @@ import user.jobengine.server.IJobRuntime; public class CheckMORPHEUSMissingMaterialsStep extends JobStep { private static final Logger logger = LogManager.getLogger(); + private static final String KILLDATEDAYS = "killDateDays"; private static final String SUCCESSRECIPIENT = "successRecipient"; private static final String TARGETNAMEPATTERN = "targetNamePattern"; private static final String MATERIAL_ID = "Material ID"; @@ -34,9 +35,11 @@ public class CheckMORPHEUSMissingMaterialsStep extends JobStep { private String targetPath; private MediaFileDAO dao; private IJobEngine jobEngine; + private int killDateDays; @StepEntry - public Object[] execute(String sourcePath, String targetPath, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + public Object[] execute(String sourcePath, String targetPath, int killDateDays, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + this.killDateDays = killDateDays; setAndCheck(sourcePath, targetPath, jobEngine); DirectoryStream directoryStream = null; try { @@ -66,8 +69,8 @@ public class CheckMORPHEUSMissingMaterialsStep extends JobStep { return; } - jobEngine.submit(JOBTEMPLATE, RETRIEVE_MATERIAL, - ListUtils.asMap(MEDIACUBEMEDIA, medias.get(0), TARGETPATH, targetPath, TARGETNAMEPATTERN, "%s", SUCCESSRECIPIENT, null)); + jobEngine.submit(JOBTEMPLATE, RETRIEVE_MATERIAL, ListUtils.asMap(MEDIACUBEMEDIA, medias.get(0), TARGETPATH, targetPath, TARGETNAMEPATTERN, "%s", + SUCCESSRECIPIENT, null, KILLDATEDAYS, killDateDays)); } private void processMissingMaterialCSV(Path csvFilePath) throws Exception { diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckTrafficMissingMaterialsStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckTrafficMissingMaterialsStep.java index 39c1648f..fc1dc5e4 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckTrafficMissingMaterialsStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckTrafficMissingMaterialsStep.java @@ -19,6 +19,7 @@ import user.jobengine.server.IJobEngine; import user.jobengine.server.IJobRuntime; public class CheckTRAFFICMissingMaterialsStep extends JobStep { + private static final String KILLDATEDAYS = "killDateDays"; private static final Logger logger = LogManager.getLogger(); private static final String TARGET_NAME_PATTERN = "targetNamePattern"; private static final String TARGET_PATH = "targetPath"; @@ -27,11 +28,13 @@ public class CheckTRAFFICMissingMaterialsStep extends JobStep { private static final String SQL = "{call dbo.clIFsp_EC_MAM(1001, 32, Null, Null, ?)}"; private static final String JOBTEMPLATE = "retrieve-material.xml"; private static final String SUCCESSRECIPIENT = "successRecipient"; + private int killDateDays; @StepEntry - public Object[] execute(String dbUrl, String userName, String password, int lookupDays, String targetPath, IJobEngine jobEngine, IJobRuntime jobRuntime) - throws Exception { + public Object[] execute(String dbUrl, String userName, String password, int lookupDays, String targetPath, int killDateDays, IJobEngine jobEngine, + IJobRuntime jobRuntime) throws Exception { + this.killDateDays = killDateDays; try (Connection con = getConnection(dbUrl, userName, password); PreparedStatement stmt = con.prepareStatement(SQL)) { stmt.setInt(1, lookupDays); try (ResultSet rs = stmt.executeQuery()) { @@ -83,8 +86,8 @@ public class CheckTRAFFICMissingMaterialsStep extends JobStep { } String title = "Traffic adásanyag visszatöltés: " + trafficId; - jobEngine.submit(JOBTEMPLATE, title, - ListUtils.asMap(MEDIA_CUBE_MEDIA, medias.get(0), TARGET_PATH, targetPath, TARGET_NAME_PATTERN, "%s", SUCCESSRECIPIENT, null)); + jobEngine.submit(JOBTEMPLATE, title, ListUtils.asMap(MEDIA_CUBE_MEDIA, medias.get(0), TARGET_PATH, targetPath, TARGET_NAME_PATTERN, "%s", + SUCCESSRECIPIENT, null, KILLDATEDAYS, killDateDays)); } } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMBackupStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMBackupStep.java index 4c950e0c..1ff54b96 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMBackupStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMBackupStep.java @@ -58,8 +58,10 @@ public class TSMBackupStep extends JobStep { saveMetadata(mediaCubeMedia, sourceFileName); logger.info(getMarker(), "Az '{}' állomány archiválása sikeres.", archiveItem.getMediaFile().toFile().getName()); - KillDateFile killDateFile = new KillDateFile(sourceMediaFile.getParent().toString(), sourceMediaFile.getFileName().toString()); - killDateFile.create(killDateDays); + if (killDateDays > 0) { + KillDateFile killDateFile = new KillDateFile(sourceMediaFile.getParent().toString(), sourceMediaFile.getFileName().toString()); + killDateFile.create(killDateDays); + } } catch (Exception e) { logger.catching(e); logger.error(getMarker(), "Az '{}' állomány archiválása sikertelen. A rendszer hibaüzenete: {}", archiveItem.getMediaFile().toFile().getName(), diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMRestoreStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMRestoreStep.java index 7b8b90ea..48fbcf8c 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMRestoreStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMRestoreStep.java @@ -29,7 +29,7 @@ public class TSMRestoreStep extends JobStep { private String sourceFileName; @StepEntry - public Object[] execute(Media mediaCubeMedia, String targetPath, String targetNamePattern, String successRecipient, IJobEngine jobEngine, + public Object[] execute(Media mediaCubeMedia, String targetPath, String targetNamePattern, String successRecipient, int killDateDays, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { setAndCheck(mediaCubeMedia, targetPath, targetNamePattern, jobEngine); String targetFileName = null; @@ -55,6 +55,12 @@ public class TSMRestoreStep extends JobStep { if (StringUtils.isNotBlank(successRecipient)) logger.info(new MediaCubeMarker(successRecipient), successMessage, sourceFileName, targetPath, targetFileName); logger.info(getMarker(), successMessage, sourceFileName, targetPath, targetFileName); + + if (killDateDays > 0) { + KillDateFile killDateFile = new KillDateFile(targetPath, targetFileName); + killDateFile.create(killDateDays); + } + } catch (Exception e) { logger.error(getMarker(), "Az '{}' állomány visszatöltése sikertelen. A rendszer hibaüzenete: {}", sourceFileName, e.getMessage()); logger.catching(e); diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/INexioAPI.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/INexioAPI.java index 0f7c16a2..8501e898 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/nexio/INexioAPI.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/INexioAPI.java @@ -6,6 +6,7 @@ import java.util.List; import com.ibm.nosql.json.api.DBObject; public interface INexioAPI { + final String ENCODING = "ISO-8859-2"; List getItems(Date modified, boolean itemsWithAgency); diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioClipEventDispatcher.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioClipEventDispatcher.java index 23205567..78a9f920 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioClipEventDispatcher.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioClipEventDispatcher.java @@ -1,5 +1,6 @@ package user.commons.nexio; +import java.io.UnsupportedEncodingException; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -202,12 +203,14 @@ public class NexioClipEventDispatcher implements ClipEventListener { private BasicDBObject convertClipToJSON(Clip clip) throws Exception { BasicDBObject jsClip = new BasicDBObject(); try { - jsClip.put(ID, clip.getId().get()); //Unique internal ID + String xid = clip.getId().get(); + jsClip.put(ID, xid); //Unique internal ID } catch (Exception e) { // System.out.println(e); } try { - jsClip.put(LONGNAMEID, clip.getXid().get()); //Extended ID (Filename) + String xid = clip.getXid().get(); + jsClip.put(LONGNAMEID, xid); //Extended ID (Filename) } catch (Exception e) { // System.out.println(e); } @@ -243,7 +246,8 @@ public class NexioClipEventDispatcher implements ClipEventListener { // System.out.println(e); } try { - jsClip.put(EXTAGENCY, new String(clip.getExtendedField(GetExtendedFieldCommand.FN_AGENCY))); + String agency = new String(clip.getExtendedField(GetExtendedFieldCommand.FN_AGENCY), INexioAPI.ENCODING); + jsClip.put(EXTAGENCY, agency); } catch (Exception e) { // System.out.println(e); } @@ -279,8 +283,9 @@ public class NexioClipEventDispatcher implements ClipEventListener { clip = clips.next(); BasicDBObject jsonClip = convertClipToJSON(clip); String fileName = jsonClip.getString(LONGNAMEID); + String agency = jsonClip.getString(EXTAGENCY); if (fileName != null && !"".equals(fileName)) { - logger.debug("Found NEXIO clip: {} {}", clip.getId(), fileName); //clip.getXid() hibat dob + logger.debug("Found NEXIO clip: {} {} {}", clip.getId(), fileName, agency); this.saveClipIntoMongo(jsonClip, emptyMap, emptyMap); } else { logger.debug("Found NEXIO clip: {} XID IS MISSING!!", clip.getId()); @@ -396,22 +401,6 @@ public class NexioClipEventDispatcher implements ClipEventListener { progressListenerList.remove(IProgressEventListener.class, listener); } - /* - BasicDBObject clip = new BasicDBObject(); - clip.put(LONGNAMEID, rs.getString(i++)); - clip.put(RECORDDATE, new DateTime(rs.getString(i++)).toDate()); - clip.put(EXTAGENCY, rs.getString(i++)); - clip.put(MODIFIEDTIMESTAMP, new DateTime(rs.getString(i++)).toDate()); - clip.put(START, rs.getString(i++)); - clip.put(DURATION, rs.getLong(i++)); - result.put(clip.getString(LONGNAMEID), clip); - int progress = idx * 50 / count; - if (progress - progressEvent.getProgress() > 0) { - progressEvent.setProgress(progress); - fireProgressEvent(progressEvent); - } - */ - private void saveClipIntoMongo(BasicDBObject clip, Map clipsForXID, Map clipsForID) { DBCollection collection = db.getCollection(CLIP_COLLECTION_NAME); String xid = clip.getString(LONGNAMEID); @@ -435,8 +424,29 @@ public class NexioClipEventDispatcher implements ClipEventListener { } } + /* + BasicDBObject clip = new BasicDBObject(); + clip.put(LONGNAMEID, rs.getString(i++)); + clip.put(RECORDDATE, new DateTime(rs.getString(i++)).toDate()); + clip.put(EXTAGENCY, rs.getString(i++)); + clip.put(MODIFIEDTIMESTAMP, new DateTime(rs.getString(i++)).toDate()); + clip.put(START, rs.getString(i++)); + clip.put(DURATION, rs.getLong(i++)); + result.put(clip.getString(LONGNAMEID), clip); + int progress = idx * 50 / count; + if (progress - progressEvent.getProgress() > 0) { + progressEvent.setProgress(progress); + fireProgressEvent(progressEvent); + } + */ + public void setNexioChangeListener(INexioChangeListener nexioChangeListener) { this.nexioChangeListener = nexioChangeListener; } + private String toUTF8(String iso88592) throws UnsupportedEncodingException { + byte[] bytes = iso88592.getBytes("ISO-8859-2"); + return new String(bytes, "UTF-8"); + } + } diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedIDFromIDHandleCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedIDFromIDHandleCommand.java index 26c6723e..1219f6e1 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedIDFromIDHandleCommand.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedIDFromIDHandleCommand.java @@ -2,6 +2,8 @@ package user.commons.nexio.server.protocol; import java.io.IOException; +import user.commons.nexio.INexioAPI; + public class GetExtendedIDFromIDHandleCommand extends Command { private static final String INVALID_RESPONSE = "Invalid response length, response should be 2-258 characters long, but 1 got"; @@ -47,7 +49,7 @@ public class GetExtendedIDFromIDHandleCommand extends Command { throw getException_InvalidXIDLength(toRead, new String(buffer)); } - ret = new Xid(new String(buffer)); + ret = new Xid(new String(buffer, INexioAPI.ENCODING)); } return ret; diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java index a6cd6cca..44f69bf9 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java @@ -37,72 +37,45 @@ public class OctopusAPI implements IOctopusAPI { db = NoSQLUtils.getDB(); } - @Override - public List getRundowns(Date scheduledDate) { - List result = null; - DBCollection collection = db.getCollection(RUNDOWN_COLLECTION_NAME); - Calendar calStart = CalendarUtils.createZeroCalendar(scheduledDate); - Calendar calStop = CalendarUtils.createZeroCalendar(scheduledDate); - calStop.add(Calendar.DAY_OF_MONTH, 1); - - DBObject query = null; - QueryBuilder builder = QueryBuilder.start(); - if (scheduledDate == null) { - query = builder.get(); - } else { - query = builder.and(QueryBuilder.start("scheduledStart").greaterThanEquals(calStart.getTime()).get(), - QueryBuilder.start("scheduledStart").lessThan(calStop.getTime()).get()).get(); + private List getIDsFromReferences(List list, String referenceName) { + List result = new ArrayList<>(); + for (DBObject dbObject : list) { + BasicDBObject object = (BasicDBObject) dbObject; + BasicDBList l = (BasicDBList) object.get(referenceName); + BasicDBObject o = (BasicDBObject) l.get(0); + long id = o.getLong("id"); + result.add(id); } - - logger.info(query); - DBCursor find = collection.find(query).sort(new BasicDBObject("scheduledStart", new BasicDBList(1, "$date"))); - if (find.hasNext()) - result = find.toArray(); return result; } @Override - public List getStories(long rundownID) { + public List getMosObjectsByID(String id) { List result = null; + List mosObjectsResult = new ArrayList<>(); DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); - // db.stories.find({ rundown: { $elemMatch: { id: 92950867 } }}) - - // { rundown: { $elemMatch: { id: 44622396 } }} - DBCursor find = collection.find( - new BasicDBObject(RUNDOWN, new BasicDBObject("$elemMatch", new BasicDBObject(ID, rundownID))), - new BasicDBObject(ID, 1).append("name", 1).append("modified", 1).append(RUNDOWN, 1).append("type", 1). - append("mosObjects", 1)) + DBCursor find = collection + .find(new BasicDBObject(MOS_OBJECTS, new BasicDBObject("$elemMatch", new BasicDBObject(ID, id))), + new BasicDBObject(ID, 1).append("name", 1).append("modified", 1).append(STORY_FOLDER, 1).append("type", 1).append("mosObjects", 1)) .sort(new BasicDBObject("name", 1)); if (find.hasNext()) + // return the story result = find.toArray(); - return result; - } - - @Override - public List getStoryFolders() { - List result = null; - DBCollection collection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); - DBCursor find = collection.find(); - if (find.hasNext()) - result = find.toArray(); - return result; - } - - @Override - public List getStoryFolders(long storyID) { - List result = null; - List queryedStory_FoldersFromStoryCollection = null; - DBCollection storyCollection = db.getCollection(STORY_COLLECTION_NAME); - DBCollection storyFolderCollection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); - DBCursor find = storyCollection.find(new BasicDBObject("id", storyID), - new BasicDBObject(STORY_FOLDER, 1).append("_id", 0)); - result = getParentsByReferences(find, storyFolderCollection, queryedStory_FoldersFromStoryCollection, - STORY_FOLDER); - return result; + for (DBObject actual : result) { + BasicDBList actualList = (BasicDBList) actual.get("mosObjects"); + if (!actualList.isEmpty()) { + List mosObjectList = NoSQLUtils.asList(actualList); + for (BasicDBObject actualMosObject : mosObjectList) { + long mosID = actualMosObject.getLong(ID); + if (id.equals(String.format("%d", mosID))) + mosObjectsResult.add(actualMosObject); + } + } + } + return mosObjectsResult; } - private List getParentsByReferences(DBCursor find, DBCollection collection, - List referenceObjects, String referenceName) { + private List getParentsByReferences(DBCursor find, DBCollection collection, List referenceObjects, String referenceName) { List result = null; if (find.hasNext()) referenceObjects = find.toArray(); @@ -115,19 +88,6 @@ public class OctopusAPI implements IOctopusAPI { } return result; } - - - private List getIDsFromReferences(List list, String referenceName) { - List result = new ArrayList<>(); - for (DBObject dbObject : list) { - BasicDBObject object = (BasicDBObject) dbObject; - BasicDBList l = (BasicDBList) object.get(referenceName); - BasicDBObject o = (BasicDBObject) l.get(0); - long id = o.getLong("id"); - result.add(id); - } - return result; - } @Override public List getRundownByStoryID(long storyID) { @@ -135,12 +95,35 @@ public class OctopusAPI implements IOctopusAPI { List queryedRundownsFromStoryCollection = null; DBCollection storyCollection = db.getCollection(STORY_COLLECTION_NAME); DBCollection rundownCollection = db.getCollection(RUNDOWN_COLLECTION_NAME); - DBCursor find = storyCollection.find(new BasicDBObject("id", storyID), - new BasicDBObject(RUNDOWN, 1).append("_id", 0)); + DBCursor find = storyCollection.find(new BasicDBObject("id", storyID), new BasicDBObject(RUNDOWN, 1).append("_id", 0)); result = getParentsByReferences(find, rundownCollection, queryedRundownsFromStoryCollection, RUNDOWN); return result; } + @Override + public List getRundowns(Date scheduledDate) { + List result = null; + DBCollection collection = db.getCollection(RUNDOWN_COLLECTION_NAME); + Calendar calStart = CalendarUtils.createZeroCalendar(scheduledDate); + Calendar calStop = CalendarUtils.createZeroCalendar(scheduledDate); + calStop.add(Calendar.DAY_OF_MONTH, 1); + + DBObject query = null; + QueryBuilder builder = QueryBuilder.start(); + if (scheduledDate == null) { + query = builder.get(); + } else { + query = builder.and(QueryBuilder.start("scheduledStart").greaterThanEquals(calStart.getTime()).get(), + QueryBuilder.start("scheduledStart").lessThan(calStop.getTime()).get()).get(); + } + + logger.info(query); + DBCursor find = collection.find(query).sort(new BasicDBObject("scheduledStart", new BasicDBList(1, "$date"))); + if (find.hasNext()) + result = find.toArray(); + return result; + } + @Override public List getRundownsByPlaceHolderId(String placeHolderID) { List result = null; @@ -155,45 +138,33 @@ public class OctopusAPI implements IOctopusAPI { result = getParentsByReferences(find, rundownCollection, queryedRundownsFromStoryCollection, RUNDOWN); return result; } - - @Override - public List getStoryFoldersByPlaceHolderId(String placeHolderID) { - List result = null; - DBCollection storyCollection = db.getCollection(STORY_COLLECTION_NAME); - DBCollection rundownCollection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); - List queryedRundownsFromStoryCollection = null; - BasicDBObject globalId = new BasicDBObject("id", placeHolderID); - BasicDBObject elemmatch = new BasicDBObject("$elemMatch", globalId); - BasicDBObject mosObjects = new BasicDBObject("mosObjects", elemmatch); - DBCursor find = storyCollection.find(mosObjects, new BasicDBObject(STORY_FOLDER, 1).append("_id", 0)); - result = getParentsByReferences(find, rundownCollection, queryedRundownsFromStoryCollection, STORY_FOLDER); - return result; - } @Override - public List getStoriesByStoryFolderId(long storyFolderId) { + public List getStories() { List result = null; DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); - DBCursor find = collection.find( - new BasicDBObject(STORY_FOLDER, new BasicDBObject("$elemMatch", new BasicDBObject(ID, storyFolderId))), - new BasicDBObject(ID, 1).append("name", 1).append("modified", 1).append(STORY_FOLDER, 1).append("type", - 1).append("mosObjects", 1)) - .sort(new BasicDBObject("name", 1)); + DBCursor find = collection.find(); if (find.hasNext()) result = find.toArray(); return result; } @Override - public List getStories() { + public List getStories(long rundownID) { List result = null; DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); - DBCursor find = collection.find(); + // db.stories.find({ rundown: { $elemMatch: { id: 92950867 } }}) + + // { rundown: { $elemMatch: { id: 44622396 } }} + DBCursor find = collection + .find(new BasicDBObject(RUNDOWN, new BasicDBObject("$elemMatch", new BasicDBObject(ID, rundownID))), + new BasicDBObject(ID, 1).append("name", 1).append("modified", 1).append(RUNDOWN, 1).append("format", 1).append("mosObjects", 1)) + .sort(new BasicDBObject("name", 1)); if (find.hasNext()) result = find.toArray(); return result; } - + @Override public List getStoriesByIDRegex(String id) { List result = null; @@ -207,46 +178,67 @@ public class OctopusAPI implements IOctopusAPI { result = find.toArray(); return result; } - + @Override - public List getMosObjectsByID(String id) { + public List getStoriesByPlaceHolderId(String placeHolderID) { + List result = new ArrayList<>(); + DBCollection storyCollection = db.getCollection(STORY_COLLECTION_NAME); + DBCollection rundownCollection = db.getCollection(RUNDOWN_COLLECTION_NAME); + BasicDBObject globalId = new BasicDBObject("id", placeHolderID); + BasicDBObject elemmatch = new BasicDBObject("$elemMatch", globalId); + BasicDBObject mosObjects = new BasicDBObject("mosObjects", elemmatch); + + DBCursor find = storyCollection.find(mosObjects); + if (find.hasNext()) + result.add(find.next()); + return result; + } + + @Override + public List getStoriesByStoryFolderId(long storyFolderId) { List result = null; - List mosObjectsResult = new ArrayList<>(); DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); DBCursor find = collection - .find(new BasicDBObject(MOS_OBJECTS, new BasicDBObject("$elemMatch", new BasicDBObject(ID, id))), - new BasicDBObject(ID, 1).append("name", 1).append("modified", 1).append(STORY_FOLDER, 1) - .append("type", 1).append("mosObjects", 1)) + .find(new BasicDBObject(STORY_FOLDER, new BasicDBObject("$elemMatch", new BasicDBObject(ID, storyFolderId))), + new BasicDBObject(ID, 1).append("name", 1).append("modified", 1).append(STORY_FOLDER, 1).append("format", 1).append("mosObjects", 1)) .sort(new BasicDBObject("name", 1)); if (find.hasNext()) - // return the story result = find.toArray(); - for (DBObject actual : result) { - BasicDBList actualList = (BasicDBList) actual.get("mosObjects"); - if (!actualList.isEmpty()) { - List mosObjectList = NoSQLUtils.asList(actualList); - for (BasicDBObject actualMosObject : mosObjectList) { - long mosID = actualMosObject.getLong(ID); - if (id.equals(String.format("%d", mosID))) - mosObjectsResult.add(actualMosObject); - } - } - } - return mosObjectsResult; + return result; } @Override - public List getStoriesByPlaceHolderId(String placeHolderID) { - List result = new ArrayList<>(); + public List getStoryFolders() { + List result = null; + DBCollection collection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); + DBCursor find = collection.find(); + if (find.hasNext()) + result = find.toArray(); + return result; + } + + @Override + public List getStoryFolders(long storyID) { + List result = null; + List queryedStory_FoldersFromStoryCollection = null; DBCollection storyCollection = db.getCollection(STORY_COLLECTION_NAME); - DBCollection rundownCollection = db.getCollection(RUNDOWN_COLLECTION_NAME); + DBCollection storyFolderCollection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); + DBCursor find = storyCollection.find(new BasicDBObject("id", storyID), new BasicDBObject(STORY_FOLDER, 1).append("_id", 0)); + result = getParentsByReferences(find, storyFolderCollection, queryedStory_FoldersFromStoryCollection, STORY_FOLDER); + return result; + } + + @Override + public List getStoryFoldersByPlaceHolderId(String placeHolderID) { + List result = null; + DBCollection storyCollection = db.getCollection(STORY_COLLECTION_NAME); + DBCollection rundownCollection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); + List queryedRundownsFromStoryCollection = null; BasicDBObject globalId = new BasicDBObject("id", placeHolderID); BasicDBObject elemmatch = new BasicDBObject("$elemMatch", globalId); BasicDBObject mosObjects = new BasicDBObject("mosObjects", elemmatch); - - DBCursor find = storyCollection.find(mosObjects); - if(find.hasNext()) - result.add(find.next()); + DBCursor find = storyCollection.find(mosObjects, new BasicDBObject(STORY_FOLDER, 1).append("_id", 0)); + result = getParentsByReferences(find, rundownCollection, queryedRundownsFromStoryCollection, STORY_FOLDER); return result; } } diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java index a9095921..97614b64 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java @@ -60,8 +60,8 @@ public class OctopusDataMiner implements Runnable { private static final String SCHEDULED_START = "scheduledStart"; private static final String SLUGS = "slugs"; private static final String CHECKING_RUNDOWN_S_D_D = "Checking Rundown %s (%d/%d)"; - private static final String FIELDS_STORIES = "stories,Story.modified,Story.name,Story.id,Story.mosObjects,Story.script,Story.type,customColumns,CustomColumn.label,CustomColumn.value"; - private static final String FIELDS_SLUGS = "slugs,Slug.story,Slug.position,Story.name,Story.id,Story.modified,Story.mosObjects,Story.script,Story.type,Story.customColumns,CustomColumn.label,CustomColumn.value"; + private static final String FIELDS_STORIES = "stories,Story.modified,Story.name,Story.id,Story.mosObjects,Story.script,Story.type,Story.format,customColumns,CustomColumn.label,CustomColumn.value"; + private static final String FIELDS_SLUGS = "slugs,Slug.story,Slug.position,Story.name,Story.id,Story.modified,Story.mosObjects,Story.script,Story.type,Story.format,Story.customColumns,CustomColumn.label,CustomColumn.value"; private static final String RUNDOWN = "Rundown"; private static final String FIELDS_RUNDOWN_LIST = "id,name,modified,scheduledStart,slugs,Slug.storyId,Slug.position"; private static final String FIELDS_STORY_FOLDER_LIST = "id,name,modified,stories,Story.id"; diff --git a/server/user.jobengine.osgi.server/pages/index.zul b/server/user.jobengine.osgi.server/pages/index.zul index 927d5442..951f430b 100644 --- a/server/user.jobengine.osgi.server/pages/index.zul +++ b/server/user.jobengine.osgi.server/pages/index.zul @@ -57,7 +57,7 @@ - +
diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/zk/model/RetrieveSelectorModel.java b/server/user.jobengine.osgi.server/src/user/jobengine/zk/model/RetrieveSelectorModel.java index 00dd97f5..4cc25574 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/zk/model/RetrieveSelectorModel.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/zk/model/RetrieveSelectorModel.java @@ -26,6 +26,7 @@ import user.jobengine.server.JobEngine; public class RetrieveSelectorModel extends BaseModel { private static final Logger logger = LogManager.getLogger(); + private static final String KILLDATEDAYS = "killDateDays"; private static final String MEDIACUBEMEDIA = "mediaCubeMedia"; private static final String SUCCESSRECIPIENT = "successRecipient"; private static final String GENERICOUTPUTPATH = "genericOutputPath"; @@ -60,7 +61,7 @@ public class RetrieveSelectorModel extends BaseModel { if (StringUtils.isBlank(houseId)) throw new Exception("Az azonosító megadása kötelező!"); Map parameters = ListUtils.asMap(TRAFFICOUTPUTPATH, trafficOutputPath, OCTOPUSOUTPUTPATH, octopusOutputPath, GENERICOUTPUTPATH, - genericOutputPath, MEDIACUBEMEDIA, this.selectedMedia, HOUSEID, houseId, SUCCESSRECIPIENT, email); + genericOutputPath, MEDIACUBEMEDIA, this.selectedMedia, HOUSEID, houseId, SUCCESSRECIPIENT, email, KILLDATEDAYS, 7); IJobEngine jobEngine = JobEngine.getInstance(); IJobRuntime runtime1 = jobEngine.submit(JOBTEMPLATE, RESTORE, parameters); close(); -- 2.54.0