git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Mon, 6 Nov 2017 15:46:54 +0000 (15:46 +0000)
committerVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Mon, 6 Nov 2017 15:46:54 +0000 (15:46 +0000)
38 files changed:
client/DxPlay/DxPlay.csproj
client/DxPlay/DxPlayer.cs
client/DxPlay/LAVInterfaces.cs [new file with mode: 0644]
client/DxPlay/PlayerForm.cs
client/Maestro/Configuration/configuration-editor.json
client/Maestro/Configuration/configuration-playout-ingest.json
client/Maestro/Configuration/configuration-studio.json
client/Maestro/Configuration/configuration-sxs.json
client/Maestro/Maestro.csproj
client/Maestro/MaestroForm.Designer.cs
client/Maestro/MaestroForm.Source.cs
client/Maestro/MaestroForm.Target.cs
client/Maestro/MaestroForm.cs
client/Maestro/Properties/AssemblyInfo.cs
client/Maestro/Properties/Resources.Designer.cs
client/Maestro/Properties/Resources.resx
client/Maestro/Resources/ic_clear_black_24dp_1x.png [new file with mode: 0644]
client/Maestro/Sources/FileSystemSource.cs
client/Maestro/Sources/NexioRESTSource.cs
client/OctopusClient/OctopusAPI.cs
client/OctopusClient/OctopusIDSelector.cs
server/-configuration/run-mediacube-server-bsh.launch
server/-configuration/scheduledjobs.json
server/user.jobengine.executors/jobtemplates/retrieve-material.xml
server/user.jobengine.executors/jobtemplates/retrieve-morpheus-missing-materials.xml
server/user.jobengine.executors/jobtemplates/retrieve-ondemand.xml
server/user.jobengine.executors/jobtemplates/retrieve-traffic-missing-materials.xml
server/user.jobengine.executors/src/user/jobengine/server/steps/CheckMORPHEUSMissingMaterialsStep.java
server/user.jobengine.executors/src/user/jobengine/server/steps/CheckTrafficMissingMaterialsStep.java
server/user.jobengine.executors/src/user/jobengine/server/steps/TSMBackupStep.java
server/user.jobengine.executors/src/user/jobengine/server/steps/TSMRestoreStep.java
server/user.jobengine.osgi.commons/src/user/commons/nexio/INexioAPI.java
server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioClipEventDispatcher.java
server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedIDFromIDHandleCommand.java
server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java
server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java
server/user.jobengine.osgi.server/pages/index.zul
server/user.jobengine.osgi.server/src/user/jobengine/zk/model/RetrieveSelectorModel.java

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