From: <che...@us...> - 2010-11-14 14:20:31
|
Revision: 3933 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3933&view=rev Author: chef_koch Date: 2010-11-14 14:20:19 +0000 (Sun, 14 Nov 2010) Log Message: ----------- added video editor plugin from official MP Added Paths: ----------- trunk/plugins/VideoEditor/ trunk/plugins/VideoEditor/Skin/ trunk/plugins/VideoEditor/Skin/Blue3/ trunk/plugins/VideoEditor/Skin/Blue3/Media/ trunk/plugins/VideoEditor/Skin/Blue3/Media/hover_videoeditor.png trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCompressSettings.xml trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCutScreen.xml trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorStartScreen.xml trunk/plugins/VideoEditor/Skin/Blue3wide/ trunk/plugins/VideoEditor/Skin/Blue3wide/Media/ trunk/plugins/VideoEditor/Skin/Blue3wide/Media/hover_videoeditor.png trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCompressSettings.xml trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCutScreen.xml trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorStartScreen.xml trunk/plugins/VideoEditor/VideoEditor/ trunk/plugins/VideoEditor/VideoEditor/BufferedTsFileReader.cs trunk/plugins/VideoEditor/VideoEditor/CompressSettings.cs trunk/plugins/VideoEditor/VideoEditor/Converter.cs trunk/plugins/VideoEditor/VideoEditor/DvrMsModifier.cs trunk/plugins/VideoEditor/VideoEditor/EditSettings.cs trunk/plugins/VideoEditor/VideoEditor/GUIVideoEditor.cs trunk/plugins/VideoEditor/VideoEditor/Mpeg2Divx.cs trunk/plugins/VideoEditor/VideoEditor/Mpeg2Splitter.cs trunk/plugins/VideoEditor/VideoEditor/MpegModifier.cs trunk/plugins/VideoEditor/VideoEditor/PcrUtils.cs trunk/plugins/VideoEditor/VideoEditor/Properties/ trunk/plugins/VideoEditor/VideoEditor/Properties/AssemblyInfo.cs trunk/plugins/VideoEditor/VideoEditor/TimeDomain.cs trunk/plugins/VideoEditor/VideoEditor/TsFileCutter.cs trunk/plugins/VideoEditor/VideoEditor/VideoEditor.csproj trunk/plugins/VideoEditor/VideoEditor/VideoEditor.gif trunk/plugins/VideoEditor/VideoEditor/VideoEditorConfiguration.Designer.cs trunk/plugins/VideoEditor/VideoEditor/VideoEditorConfiguration.cs trunk/plugins/VideoEditor/VideoEditor/VideoEditorConfiguration.resx trunk/plugins/VideoEditor/VideoEditor/VideoEditorPreview.cs trunk/plugins/VideoEditor/VideoEditor/VideoEditorSettings.cs trunk/plugins/VideoEditor/VideoEditor/VideoEditorSetup.cs trunk/plugins/VideoEditor/VideoEditor/VideoEditor_disabled.gif trunk/plugins/VideoEditor/VideoEditor.sln Property changes on: trunk/plugins/VideoEditor ___________________________________________________________________ Added: svn:ignore + *.suo *.user _ReSharper.VideoEditor Added: trunk/plugins/VideoEditor/Skin/Blue3/Media/hover_videoeditor.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/VideoEditor/Skin/Blue3/Media/hover_videoeditor.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCompressSettings.xml =================================================================== --- trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCompressSettings.xml (rev 0) +++ trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCompressSettings.xml 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>2960</id> + <defaultcontrol>104</defaultcontrol> + <allowoverlay>no</allowoverlay> + <controls> + <control> + <type>image</type> + <id>0</id> + <posX>158</posX> + <posY>100</posY> + <width>404</width> + <height>350</height> + <texture>context_background.png</texture> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="250">WindowClose</animation> + </control> + <control> + <description>Header</description> + <type>label</type> + <id>23</id> + <posX>270</posX> + <posY>133</posY> + <align>left</align> + <font>font16</font> + <label>2055</label> + </control> + <control> + <type>label</type> + <id>34</id> + <posX>230</posX> + <posY>199</posY> + <align>left</align> + <font>font14</font> + <label>2056</label> + </control> + <control> + <description>VideoqualySelect</description> + <type>spincontrol</type> + <id>402</id> + <posX>356</posX> + <posY>201</posY> + <height>20</height> + <width>20</width> + <font>font14</font> + <reverse>yes</reverse> + <onup>302</onup> + <ondown>403</ondown> + <onleft>104</onleft> + <onright>101</onright> + <align>left</align> + <textcolor>FFFFFFFF</textcolor> + <showrange>no</showrange> + <spintype>text</spintype> + <subitems> + <subitem>2062</subitem> + <subitem>2063</subitem> + <subitem>2064</subitem> + </subitems> + </control> + <control> + <type>label</type> + <id>44</id> + <posX>230</posX> + <posY>236</posY> + <align>left</align> + <font>font14</font> + <label>2057</label> + </control> + <control> + <description>VideoqualySelect</description> + <type>spincontrol</type> + <id>403</id> + <posX>356</posX> + <posY>238</posY> + <height>20</height> + <width>20</width> + <font>font14</font> + <reverse>yes</reverse> + <onup>402</onup> + <ondown>100</ondown> + <onleft>104</onleft> + <onright>101</onright> + <align>left</align> + <textcolor>FFFFFFFF</textcolor> + <showrange>no</showrange> + <spintype>text</spintype> + <subitems> + <subitem>2062</subitem> + <subitem>2063</subitem> + <subitem>2064</subitem> + </subitems> + </control> + <control> + <type>label</type> + <id>55</id> + <posX>230</posX> + <posY>272</posY> + <align>left</align> + <font>font14</font> + <label>2058</label> + </control> + <control> + <type>slider</type> + <description>movie slider</description> + <id>100</id> + <posX>230</posX> + <posY>302</posY> + <onup>403</onup> + <ondown>104</ondown> + <textureSliderBar>osd_slider_bg.png</textureSliderBar> + <textureSliderNib>osd_slider_nibNF.png</textureSliderNib> + <label>2089</label> + <textureSliderNibFocus>osd_slider_nibFO.png</textureSliderNibFocus> + </control> + <control> + <type>label</type> + <id>102</id> + <posX>330</posX> + <posY>272</posY> + <font>font14</font> + <label>720x576</label> + </control> + <control> + <type>button</type> + <description>Abort</description> + <id>24</id> + <posX>210</posX> + <posY>380</posY> + <width>100</width> + <onup>100</onup> + <ondown>302</ondown> + <onright>104</onright> + <onleft>104</onleft> + <label>712</label> + <align>center</align> + </control> + <control> + <type>button</type> + <description>OK</description> + <id>104</id> + <posX>390</posX> + <posY>380</posY> + <width>100</width> + <onup>100</onup> + <ondown>302</ondown> + <onright>24</onright> + <onleft>24</onleft> + <label>OK</label> + <align>center</align> + </control> + </controls> +</window> Added: trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCutScreen.xml =================================================================== --- trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCutScreen.xml (rev 0) +++ trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCutScreen.xml 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,332 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>170602</id> + <defaultcontrol>100</defaultcontrol> + <allowoverlay>no</allowoverlay> + <controls> + <control> + <description>BG</description> + <type>image</type> + <id>1</id> + <width>720</width> + <height>576</height> + </control> + <control> + <type>button</type> + <description>cut</description> + <id>24</id> + <posX>56</posX> + <posY>107</posY> + <onup>25</onup> + <ondown>25</ondown> + <onright>100</onright> + <label>2095</label> + </control> + <control> + <type>button</type> + <id>25</id> + <posX>56</posX> + <posY>137</posY> + <onup>24</onup> + <ondown>101</ondown> + <onright>100</onright> + <label>510</label> + </control> + <control> + <type>label</type> + <description>Title</description> + <posX>160</posX> + <posY>55</posY> + <align>left</align> + <font>font14</font> + <label>178</label> + </control> + <control> + <description>scrolling info label</description> + <type>fadelabel</type> + <posX>200</posX> + <posY>55</posY> + <width>435</width> + <font>font14</font> + <label>#Play.Current.Title</label> + <id>0</id> + </control> + <control> + <type>label</type> + <description>old duration</description> + <id>26</id> + <posX>58</posX> + <posY>180</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>2097</label> + </control> + <control> + <type>label</type> + <id>35</id> + <description>Label Alte Länge</description> + <posX>58</posX> + <posY>198</posY> + <onup>24</onup> + <ondown>24</ondown> + <label /> + </control> + <control> + <type>label</type> + <description>Neue Länge</description> + <id>27</id> + <posX>58</posX> + <posY>220</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>2098</label> + </control> + <control> + <type>label</type> + <description>Label Neue Länge</description> + <id>36</id> + <posX>58</posX> + <posY>238</posY> + <onup>24</onup> + <ondown>24</ondown> + <label /> + </control> + <control> + <type>label</type> + <description>aktuelle Position</description> + <id>32</id> + <posX>58</posX> + <posY>260</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>2099</label> + </control> + <control> + <type>label</type> + <description>Label Aktuelle Position</description> + <id>33</id> + <posX>58</posX> + <posY>278</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>#currentplaytime</label> + </control> + <control> + <type>button</type> + <description>Hinzufügen</description> + <id>28</id> + <posX>515</posX> + <posY>410</posY> + <width>120</width> + <height>28</height> + <onup>31</onup> + <ondown>28</ondown> + <onleft>30</onleft> + <label /> + </control> + <control> + <type>label</type> + <label>Hinzufügen</label> + <posX>575</posX> + <posY>423</posY> + <align>center</align> + <label>2093</label> + </control> + <control> + <type>button</type> + <description>Start</description> + <id>29</id> + <posX>313</posX> + <posY>410</posY> + <width>94</width> + <height>28</height> + <onup>34</onup> + <ondown>29</ondown> + <onright>30</onright> + <onleft>24</onleft> + </control> + <control> + <type>label</type> + <label>Start</label> + <posX>358</posX> + <posY>423</posY> + <align>center</align> + <label>2084</label> + </control> + <control> + <type>label</type> + <description>Label Start Position</description> + <id>37</id> + <posX>320</posX> + <posY>435</posY> + <onup>24</onup> + <label /> + </control> + <control> + <type>button</type> + <description>Ende</description> + <id>30</id> + <posX>415</posX> + <posY>410</posY> + <width>94</width> + <height>28</height> + <onup>31</onup> + <ondown>30</ondown> + <onright>28</onright> + <onleft>29</onleft> + <align>center</align> + <label /> + </control> + <control> + <type>label</type> + <label>End</label> + <posX>460</posX> + <posY>423</posY> + <align>center</align> + <label>2085</label> + </control> + <control> + <type>label</type> + <description>Label Ende Position</description> + <id>38</id> + <posX>410</posX> + <posY>435</posY> + <onup>24</onup> + <label /> + </control> + <control> + <type>button</type> + <description>forward</description> + <id>31</id> + <posX>567</posX> + <posY>380</posY> + <width>80</width> + <height>28</height> + <onup>100</onup> + <ondown>30</ondown> + <onleft>34</onleft> + </control> + <control> + <type>label</type> + <label>forward</label> + <posX>608</posX> + <posY>395</posY> + <align>center</align> + <label>2086</label> + </control> + <control> + <type>button</type> + <description>backward</description> + <id>34</id> + <posX>297</posX> + <posY>380</posY> + <width>95</width> + <height>28</height> + <onup>100</onup> + <ondown>29</ondown> + <onright>31</onright> + <onleft>24</onleft> + </control> + <control> + <label>backward</label> + <type>label</type> + <posX>346</posX> + <posY>395</posY> + <align>center</align> + <label>2087</label> + </control> + <control> + <type>slider</type> + <description>movie slider</description> + <id>100</id> + <posX>395</posX> + <posY>372</posY> + <onup>24</onup> + <ondown>34</ondown> + <textureSliderBar>osd_slider_bg.png</textureSliderBar> + <textureSliderNib>osd_slider_nibNF.png</textureSliderNib> + <label>2089</label> + <textureSliderNibFocus>osd_slider_nibFO.png</textureSliderNibFocus> + </control> + <control> + <description>Schneideliste</description> + <type>listcontrol</type> + <id>101</id> + <posX>50</posX> + <posY>330</posY> + <width>180</width> + <height>250</height> + <label>Schneideliste</label> + <onleft>31</onleft> + <onright>100</onright> + <onup>24</onup> + <ondown>24</ondown> + <font>font12</font> + </control> + <control> + <type>label</type> + <posX>58</posX> + <posY>310</posY> + <align>left</align> + <label>2088</label> + </control> + <control> + <description>TV background</description> + <type>image</type> + <id>1</id> + <posX>281</posX> + <posY>87</posY> + <width>396</width> + <height>335</height> + <colordiffuse>60ffffff</colordiffuse> + <texture>tv_background.png</texture> + </control> + <control> + <description>video window</description> + <type>videowindow</type> + <id>99</id> + <posX>300</posX> + <posY>107</posY> + <width>350</width> + <height>260</height> + <onleft>2</onleft> + <onright>2</onright> + <action>18</action> + <textureFocus>video_window_focus.png</textureFocus> + </control> + <control> + <type>label</type> + <id>102</id> + <posX>300</posX> + <posY>500</posY> + </control> + <control> + <type>statusbar</type> + <id>103</id> + <posX>300</posX> + <posY>520</posY> + <width>350</width> + <height>20</height> + <texturebg>statusbar_back.png</texturebg> + <midtexture>statusbar_mid.png</midtexture> + <lefttexture>statusbar_left.png</lefttexture> + <righttexture>statusbar_right.png</righttexture> + </control> + <control> + <type>progress</type> + <id>104</id> + <posX>300</posX> + <posY>520</posY> + <width>350</width> + </control> + <control> + <type>label</type> + <description>edit cutpoint</description> + <id>105</id> + <posX>300</posX> + <posY>500</posY> + <align>left</align> + <label>2075</label> + </control> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorStartScreen.xml =================================================================== --- trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorStartScreen.xml (rev 0) +++ trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorStartScreen.xml 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>2959</id> + <defaultcontrol>101</defaultcontrol> + <allowoverlay>no</allowoverlay> + <define>#header.label:2090</define> + <!-- <define>#header.text:music</define> --> + <define>#header.hover:-</define> + <controls> + <import>common.window.xml</import> + <control> + <type>label</type> + <id>23</id> + <posX>160</posX> + <posY>45</posY> + <align>left</align> + <font>font14</font> + <label>2092</label> + </control> + <control> + <type>button</type> + <id>24</id> + <posX>56</posX> + <posY>96</posY> + <onup>104</onup> + <ondown>102</ondown> + <label>712</label> + <posX>56</posX> + <posY>96</posY> + <align>center</align> + </control> + <control> + <description>Videoliste</description> + <type>listcontrol</type> + <id>101</id> + <posX>270</posX> + <width>400</width> + <height>400</height> + <label>2094</label> + <onleft>24</onleft> + <onright>2</onright> + </control> + <control> + <description>JoinSelect</description> + <type>spincontrol</type> + <id>102</id> + <posX>56</posX> + <posY>150</posY> + <onup>24</onup> + <ondown>104</ondown> + <onleft>101</onleft> + <onright>101</onright> + <textcolor>FFFFFFFF</textcolor> + <showrange>no</showrange> + <subitems> + <subitem>2077</subitem> + <subitem>2078</subitem> + <subitem>2071</subitem> + <subitem>2066</subitem> + </subitems> + </control> + <control> + <description>JoinList</description> + <type>listcontrol</type> + <id>103</id> + <posX>270</posX> + <posY>450</posY> + <width>300</width> + <height>100</height> + <label>JoinList</label> + <onleft>104</onleft> + <onright>104</onright> + <onup>101</onup> + <ondown>101</ondown> + <font>font12</font> + </control> + <control> + <type>button</type> + <id>104</id> + <posX>56</posX> + <posY>180</posY> + <onup>102</onup> + <ondown>24</ondown> + <onright>103</onright> + <label>2079</label> + <align>center</align> + </control> + <control> + <type>progress</type> + <id>105</id> + <posX>56</posX> + <posY>230</posY> + <width>180</width> + </control> + <control> + <type>label</type> + <id>106</id> + <posX>56</posX> + <posY>250</posY> + <align>left</align> + <font>font14</font> + <label></label> + </control> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/VideoEditor/Skin/Blue3wide/Media/hover_videoeditor.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/VideoEditor/Skin/Blue3wide/Media/hover_videoeditor.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCompressSettings.xml =================================================================== --- trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCompressSettings.xml (rev 0) +++ trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCompressSettings.xml 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>2960</id> + <defaultcontrol>104</defaultcontrol> + <allowoverlay>no</allowoverlay> + <controls> + <control> + <type>image</type> + <id>0</id> + <posX>280</posX> + <posY>125</posY> + <width>718</width> + <height>437</height> + <texture>context_background.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> + <animation effect="fade" time="150">WindowClose</animation> + </control> + <control> + <description>Header</description> + <type>label</type> + <id>23</id> + <posX>480</posX> + <posY>166</posY> + <align>left</align> + <font>font16</font> + <label>2055</label> + </control> + <control> + <type>label</type> + <id>34</id> + <posX>408</posX> + <posY>248</posY> + <align>left</align> + <font>font14</font> + <label>2056</label> + </control> + <control> + <description>VideoqualySelect</description> + <type>spincontrol</type> + <id>402</id> + <posX>632</posX> + <posY>251</posY> + <height>25</height> + <width>35</width> + <font>font14</font> + <reverse>yes</reverse> + <onup>302</onup> + <ondown>403</ondown> + <onleft>104</onleft> + <onright>101</onright> + <align>left</align> + <textcolor>FFFFFFFF</textcolor> + <showrange>no</showrange> + <spintype>text</spintype> + <subitems> + <subitem>2062</subitem> + <subitem>2063</subitem> + <subitem>2064</subitem> + </subitems> + </control> + <control> + <type>label</type> + <id>44</id> + <posX>408</posX> + <posY>295</posY> + <align>left</align> + <font>font14</font> + <label>2057</label> + </control> + <control> + <description>VideoqualySelect</description> + <type>spincontrol</type> + <id>403</id> + <posX>632</posX> + <posY>297</posY> + <height>25</height> + <width>35</width> + <font>font14</font> + <reverse>yes</reverse> + <onup>402</onup> + <ondown>100</ondown> + <onleft>104</onleft> + <onright>101</onright> + <align>left</align> + <textcolor>FFFFFFFF</textcolor> + <showrange>no</showrange> + <spintype>text</spintype> + <subitems> + <subitem>2062</subitem> + <subitem>2063</subitem> + <subitem>2064</subitem> + </subitems> + </control> + <control> + <type>label</type> + <id>55</id> + <posX>408</posX> + <posY>340</posY> + <align>left</align> + <font>font14</font> + <label>2058</label> + </control> + <control> + <type>slider</type> + <description>movie slider</description> + <id>100</id> + <posX>408</posX> + <posY>377</posY> + <onup>403</onup> + <ondown>104</ondown> + <textureSliderBar>osd_slider_bg.png</textureSliderBar> + <textureSliderNib>osd_slider_nibNF.png</textureSliderNib> + <label>2089</label> + <textureSliderNibFocus>osd_slider_nibFO.png</textureSliderNibFocus> + </control> + <control> + <type>label</type> + <id>102</id> + <posX>586</posX> + <posY>340</posY> + <font>font14</font> + <label>720x576</label> + </control> + <control> + <type>button</type> + <description>Abort</description> + <id>24</id> + <posX>373</posX> + <posY>475</posY> + <width>177</width> + <onup>100</onup> + <ondown>302</ondown> + <onright>104</onright> + <onleft>104</onleft> + <label>712</label> + <align>center</align> + </control> + <control> + <type>button</type> + <description>OK</description> + <id>104</id> + <posX>693</posX> + <posY>475</posY> + <width>177</width> + <onup>100</onup> + <ondown>302</ondown> + <onright>24</onright> + <onleft>24</onleft> + <label>OK</label> + <align>center</align> + </control> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCutScreen.xml =================================================================== --- trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCutScreen.xml (rev 0) +++ trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCutScreen.xml 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,326 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>170602</id> + <defaultcontrol>100</defaultcontrol> + <allowoverlay>no</allowoverlay> + <controls> + <control> + <description>BG</description> + <type>image</type> + <id>1</id> + <width>1280</width> + <height>720</height> + </control> + <control> + <type>button</type> + <description>cut</description> + <id>24</id> + <posX>99</posX> + <posY>133</posY> + <onup>25</onup> + <ondown>25</ondown> + <onright>100</onright> + <label>2095</label> + </control> + <control> + <type>button</type> + <id>25</id> + <posX>99</posX> + <posY>171</posY> + <onup>24</onup> + <ondown>101</ondown> + <onright>100</onright> + <label>510</label> + </control> + <control> + <type>label</type> + <description>Title</description> + <posX>284</posX> + <posY>68</posY> + <align>left</align> + <font>font14</font> + <label>178</label> + </control> + <control> + <description>scrolling info label</description> + <type>fadelabel</type> + <posX>355</posX> + <posY>68</posY> + <width>773</width> + <font>font14</font> + <label>#Play.Current.Title</label> + <id>0</id> + </control> + <control> + <type>label</type> + <description>old duration</description> + <id>26</id> + <posX>103</posX> + <posY>225</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>2097</label> + </control> + <control> + <type>label</type> + <id>35</id> + <description>Label Alte Länge</description> + <posX>103</posX> + <posY>247</posY> + <onup>24</onup> + <ondown>24</ondown> + </control> + <control> + <type>label</type> + <description>Neue Länge</description> + <id>27</id> + <posX>103</posX> + <posY>275</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>2098</label> + </control> + <control> + <type>label</type> + <description>Label Neue Länge</description> + <id>36</id> + <posX>103</posX> + <posY>297</posY> + <onup>24</onup> + <ondown>24</ondown> + </control> + <control> + <type>label</type> + <description>aktuelle Position</description> + <id>32</id> + <posX>103</posX> + <posY>325</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>2099</label> + </control> + <control> + <type>label</type> + <description>Label Aktuelle Position</description> + <id>33</id> + <posX>103</posX> + <posY>347</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>#currentplaytime</label> + </control> + <control> + <type>button</type> + <description>Hinzufügen</description> + <id>28</id> + <posX>915</posX> + <posY>512</posY> + <width>213</width> + <height>35</height> + <onup>31</onup> + <ondown>28</ondown> + <onleft>30</onleft> + </control> + <control> + <type>label</type> + <label>Hinzufügen</label> + <posX>1022</posX> + <posY>528</posY> + <align>center</align> + <label>2093</label> + </control> + <control> + <type>button</type> + <description>Start</description> + <id>29</id> + <posX>556</posX> + <posY>512</posY> + <width>167</width> + <height>35</height> + <onup>34</onup> + <ondown>29</ondown> + <onright>30</onright> + <onleft>24</onleft> + </control> + <control> + <type>label</type> + <label>Start</label> + <posX>636</posX> + <posY>528</posY> + <align>center</align> + <label>2084</label> + </control> + <control> + <type>label</type> + <description>Label Start Position</description> + <id>37</id> + <posX>568</posX> + <posY>543</posY> + <onup>24</onup> + </control> + <control> + <type>button</type> + <description>Ende</description> + <id>30</id> + <posX>737</posX> + <posY>512</posY> + <width>167</width> + <height>35</height> + <onup>31</onup> + <ondown>30</ondown> + <onright>28</onright> + <onleft>29</onleft> + <align>center</align> + </control> + <control> + <type>label</type> + <label>End</label> + <posX>817</posX> + <posY>528</posY> + <align>center</align> + <label>2085</label> + </control> + <control> + <type>label</type> + <description>Label Ende Position</description> + <id>38</id> + <posX>728</posX> + <posY>543</posY> + <onup>24</onup> + </control> + <control> + <type>button</type> + <description>forward</description> + <id>31</id> + <posX>1008</posX> + <posY>475</posY> + <width>142</width> + <height>35</height> + <onup>100</onup> + <ondown>30</ondown> + <onleft>34</onleft> + </control> + <control> + <type>label</type> + <label>forward</label> + <posX>1080</posX> + <posY>493</posY> + <align>center</align> + <label>2086</label> + </control> + <control> + <type>button</type> + <description>backward</description> + <id>34</id> + <posX>528</posX> + <posY>475</posY> + <width>168</width> + <height>35</height> + <onup>100</onup> + <ondown>29</ondown> + <onright>31</onright> + <onleft>24</onleft> + </control> + <control> + <label>backward</label> + <type>label</type> + <posX>615</posX> + <posY>493</posY> + <align>center</align> + <label>2087</label> + </control> + <control> + <type>slider</type> + <description>movie slider</description> + <id>100</id> + <posX>702</posX> + <posY>465</posY> + <onup>24</onup> + <ondown>34</ondown> + <textureSliderBar>osd_slider_bg.png</textureSliderBar> + <textureSliderNib>osd_slider_nibNF.png</textureSliderNib> + <label>2089</label> + <textureSliderNibFocus>osd_slider_nibFO.png</textureSliderNibFocus> + </control> + <control> + <description>Schneideliste</description> + <type>listcontrol</type> + <id>101</id> + <posX>88</posX> + <posY>412</posY> + <width>320</width> + <height>312</height> + <label>Schneideliste</label> + <onleft>31</onleft> + <onright>100</onright> + <onup>24</onup> + <ondown>24</ondown> + <font>font12</font> + </control> + <control> + <type>label</type> + <posX>103</posX> + <posY>387</posY> + <align>left</align> + <label>2088</label> + </control> + <control> + <description>TV background</description> + <type>image</type> + <id>1</id> + <posX>499</posX> + <posY>108</posY> + <width>704</width> + <height>418</height> + <colordiffuse>60ffffff</colordiffuse> + <texture>tv_background.png</texture> + </control> + <control> + <description>video window</description> + <type>videowindow</type> + <id>99</id> + <posX>533</posX> + <posY>133</posY> + <width>622</width> + <height>325</height> + <onleft>2</onleft> + <onright>2</onright> + <action>18</action> + <textureFocus>video_window_focus.png</textureFocus> + </control> + <control> + <type>label</type> + <id>102</id> + <posX>533</posX> + <posY>625</posY> + </control> + <control> + <type>statusbar</type> + <id>103</id> + <posX>533</posX> + <posY>650</posY> + <width>622</width> + <height>25</height> + <texturebg>statusbar_back.png</texturebg> + <midtexture>statusbar_mid.png</midtexture> + <lefttexture>statusbar_left.png</lefttexture> + <righttexture>statusbar_right.png</righttexture> + </control> + <control> + <type>progress</type> + <id>104</id> + <posX>533</posX> + <posY>650</posY> + <width>622</width> + </control> + <control> + <type>label</type> + <description>edit cutpoint</description> + <id>105</id> + <posX>533</posX> + <posY>625</posY> + <align>left</align> + <label>2075</label> + </control> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorStartScreen.xml =================================================================== --- trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorStartScreen.xml (rev 0) +++ trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorStartScreen.xml 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>2959</id> + <defaultcontrol>101</defaultcontrol> + <allowoverlay>no</allowoverlay> + <define>#header.label:2090</define> + <!-- <define>#header.text:music</define> --> + <define>#header.hover:-</define> + <controls> + <import>common.window.xml</import> + <control> + <type>label</type> + <id>23</id> + <posX>284</posX> + <posY>56</posY> + <align>left</align> + <font>font14</font> + <label>2092</label> + </control> + <control> + <type>button</type> + <id>24</id> + <posX>99</posX> + <posY>120</posY> + <onup>104</onup> + <ondown>102</ondown> + <label>712</label> + <posX>99</posX> + <posY>120</posY> + <align>center</align> + </control> + <control> + <description>Videoliste</description> + <type>listcontrol</type> + <id>101</id> + <posX>480</posX> + <width>711</width> + <height>500</height> + <label>2094</label> + <onleft>24</onleft> + <onright>2</onright> + </control> + <control> + <description>JoinSelect</description> + <type>spincontrol</type> + <id>102</id> + <posX>99</posX> + <posY>187</posY> + <onup>24</onup> + <ondown>104</ondown> + <onleft>101</onleft> + <onright>101</onright> + <textcolor>FFFFFFFF</textcolor> + <showrange>no</showrange> + <subitems> + <subitem>2077</subitem> + <subitem>2078</subitem> + <subitem>2071</subitem> + <subitem>2066</subitem> + </subitems> + </control> + <control> + <description>JoinList</description> + <type>listcontrol</type> + <id>103</id> + <posX>480</posX> + <posY>562</posY> + <width>533</width> + <height>125</height> + <label>JoinList</label> + <onleft>104</onleft> + <onright>104</onright> + <onup>101</onup> + <ondown>101</ondown> + <font>font12</font> + </control> + <control> + <type>button</type> + <id>104</id> + <posX>99</posX> + <posY>225</posY> + <onup>102</onup> + <ondown>24</ondown> + <onright>103</onright> + <label>2079</label> + <align>center</align> + </control> + <control> + <type>progress</type> + <id>105</id> + <posX>99</posX> + <posY>287</posY> + <width>320</width> + </control> + <control> + <type>label</type> + <id>106</id> + <posX>99</posX> + <posY>312</posY> + <align>left</align> + <font>font14</font> + </control> + </controls> +</window> \ No newline at end of file Property changes on: trunk/plugins/VideoEditor/VideoEditor ___________________________________________________________________ Added: svn:ignore + bin obj Added: trunk/plugins/VideoEditor/VideoEditor/BufferedTsFileReader.cs =================================================================== --- trunk/plugins/VideoEditor/VideoEditor/BufferedTsFileReader.cs (rev 0) +++ trunk/plugins/VideoEditor/VideoEditor/BufferedTsFileReader.cs 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,116 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using System.IO; + +namespace TsCutterPackage +{ + internal class BufferedTsFileReader + { + #region Consts + + private const int SYNC_BYTE = 0x47; + private const int TS_PACKET_SIZE = 188; + + #endregion + + #region Variables + + private BufferedStream _reader = null; + private long fileSize; + + #endregion + + #region Public members + + public bool Open(string tsFile, long packetsToBuffer) + { + if (_reader != null) + { + return true; + } + try + { + _reader = new BufferedStream(new FileStream(tsFile, FileMode.Open), (int)(packetsToBuffer * 188)); + } + catch (Exception) + { + return false; + } + fileSize = _reader.Length; + return true; + } + + public void Close() + { + if (_reader == null) + { + return; + } + _reader.Close(); + _reader.Dispose(); + _reader = null; + } + + public int GetPositionInPercent() + { + return (int)(_reader.Position * 100 / fileSize); + } + + public bool SeekToFirstPacket() + { + bool found = false; + while (!found) + { + int ch = _reader.ReadByte(); + if (ch == -1) + { + return false; + } + byte b = (byte)ch; + if (b == SYNC_BYTE) + { + _reader.Seek(-1, SeekOrigin.Current); + return true; + } + } + return false; + } + + public bool GetNextPacket(out byte[] tsPacket, out bool isValid) + { + isValid = false; + tsPacket = new byte[TS_PACKET_SIZE]; + if (_reader.Read(tsPacket, 0, TS_PACKET_SIZE) != TS_PACKET_SIZE) + { + return false; + } + //check for sync byte and transport error bit + if (tsPacket[0] == SYNC_BYTE && (tsPacket[1] & 0x80) == 0) + { + isValid = true; + } + return true; + } + + #endregion + } +} \ No newline at end of file Added: trunk/plugins/VideoEditor/VideoEditor/CompressSettings.cs =================================================================== --- trunk/plugins/VideoEditor/VideoEditor/CompressSettings.cs (rev 0) +++ trunk/plugins/VideoEditor/VideoEditor/CompressSettings.cs 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,275 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using MediaPortal.Configuration; +using MediaPortal.Dialogs; +using MediaPortal.GUI.Library; +using MediaPortal.Profile; +using Action = MediaPortal.GUI.Library.Action; + +namespace WindowPlugins.VideoEditor +{ + public class CompressionSettings + { + public int resolutionX = 720; + public int resolutionY = 576; + public int videoQuality = 2200; + public int audioQuality = 128; + } + + public class CompressSettings : GUIDialogWindow + { + private bool result; + + [SkinControl(302)] protected GUISpinControl profilSelect = null; + [SkinControl(402)] protected GUISpinControl videoQualitySelect = null; + [SkinControl(403)] protected GUISpinControl audioQualitySelect = null; + [SkinControl(100)] protected GUISliderControl resolution = null; + [SkinControl(102)] protected GUILabelControl resolutionLbl = null; + [SkinControl(104)] protected GUIButtonControl okBtn = null; + [SkinControl(24)] protected GUIButtonControl abbortBtn = null; + + private CompressionSettings settings; + + public CompressSettings() + { + settings = new CompressionSettings(); + settings.resolutionX = 720; + settings.resolutionY = 576; + settings.videoQuality = 2200; + settings.audioQuality = 192; + GetID = (int)Window.WINDOW_VIDEO_EDITOR_COMPRESSSETTINGS; + } + + public CompressionSettings Settings + { + get { return settings; } + set + { + settings = value; + //settings.resolutionX = 720; + //settings.resolutionY = 576; + //settings.videoQuality = 2200; + //settings.audioQuality = 192; + } + } + + public override bool Init() + { + try + { + bool result = Load(GUIGraphicsContext.Skin + @"\VideoEditorCompressSettings.xml"); + return result; + } + catch (Exception ex) + { + Log.Error(ex); + return false; + } + } + + protected override void OnPageLoad() + { + base.OnPageLoad(); + resolution.SetRange(1, 3); + //resolution.SetRange(1, 4); + resolution.SpinType = GUISpinControl.SpinType.Int; + resolution.IntValue = 1; + LoadSettings(); + } + + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + { + if (control == okBtn) + { + result = true; + SaveSettings(); + this.PageDestroy(); + return; + } + if (control == abbortBtn) + { + result = false; + this.PageDestroy(); + return; + } + if (control == videoQualitySelect) + { + if (videoQualitySelect.GetLabel() == GUILocalizeStrings.Get(2062)) + { + settings.videoQuality = 500; + } + else if (videoQualitySelect.GetLabel() == GUILocalizeStrings.Get(2063)) + { + settings.videoQuality = 1000; + } + else if (videoQualitySelect.GetLabel() == GUILocalizeStrings.Get(2064)) + { + settings.videoQuality = 2200; + } + } + else if (control == audioQualitySelect) + { + if (audioQualitySelect.GetLabel() == GUILocalizeStrings.Get(2062)) + { + settings.audioQuality = 128; + } + else if (audioQualitySelect.GetLabel() == GUILocalizeStrings.Get(2063)) + { + settings.audioQuality = 192; + } + else if (audioQualitySelect.GetLabel() == GUILocalizeStrings.Get(2064)) + { + settings.audioQuality = 256; + } + } + else if (control == resolution) + { + if (resolution.IntValue == 1) + { + settings.resolutionX = 320; + settings.resolutionY = 240; + resolutionLbl.Label = "320 x 240"; + } + else if (resolution.IntValue == 2) + { + settings.resolutionX = 640; + settings.resolutionY = 480; + resolutionLbl.Label = "640 x 480"; + } + else if (resolution.IntValue == 3) + { + settings.resolutionX = 720; + settings.resolutionY = 576; + resolutionLbl.Label = "720 x 576"; + } + else if (resolution.IntValue == 4) + { + settings.resolutionX = 1280; + settings.resolutionY = 720; + resolutionLbl.Label = "1280 x 720"; + } + } + base.OnClicked(controlId, control, actionType); + } + + private void LoadSettings() + { + using (Settings xmlreader = new MPSettings()) + { + settings.audioQuality = xmlreader.GetValueAsInt("VideoEditor", "audioQuality", 192); + settings.videoQuality = xmlreader.GetValueAsInt("VideoEditor", "videoQuality", 2200); + settings.resolutionX = xmlreader.GetValueAsInt("VideoEditor", "resolutionX", 720); + //settings.resolutionY = xmlreader.GetValueAsInt("VideoEditor", "resolutionY", 576); + } + + switch (settings.audioQuality) + { + case 128: + SelectItem(audioQualitySelect, GUILocalizeStrings.Get(2062)); + break; + case 192: + SelectItem(audioQualitySelect, GUILocalizeStrings.Get(2063)); + break; + case 256: + SelectItem(audioQualitySelect, GUILocalizeStrings.Get(2064)); + break; + } + + switch (settings.videoQuality) + { + case 500: + SelectItem(videoQualitySelect, GUILocalizeStrings.Get(2062)); + break; + case 1000: + SelectItem(videoQualitySelect, GUILocalizeStrings.Get(2063)); + break; + case 2200: + SelectItem(videoQualitySelect, GUILocalizeStrings.Get(2064)); + break; + } + + switch (settings.resolutionX) + { + case 320: + resolution.IntValue = 1; + resolutionLbl.Label = "320 x 240"; + settings.resolutionY = 240; + break; + case 640: + resolution.IntValue = 2; + resolutionLbl.Label = "640 x 480"; + settings.resolutionY = 480; + break; + case 720: + resolution.IntValue = 3; + resolutionLbl.Label = "720 x 576"; + settings.resolutionY = 576; + break; + } + resolution.SetRange(1, 3); + } + + private void SelectItem(GUISpinControl spinControl, string text) + { + if (spinControl == null || text == string.Empty) + { + return; + } + for (int i = 0; i < spinControl.SubItemCount; i++) + { + string subItem = (string)spinControl.GetSubItem(i); + if (subItem == text) + { + int j = 0; + while (spinControl.Value != i) + { + //spinControl.Value = i; + spinControl.MoveDown(); + // prevent for endless loop + if (j > (spinControl.SubItemCount * 2)) + { + break; + } + j++; + } + break; + } + } + } + + private void SaveSettings() + { + using (Settings xmlwriter = new MPSettings()) + { + xmlwriter.SetValue("VideoEditor", "audioQuality", settings.audioQuality); + xmlwriter.SetValue("VideoEditor", "videoQuality", settings.videoQuality); + xmlwriter.SetValue("VideoEditor", "resolutionX", settings.resolutionX); + xmlwriter.SetValue("VideoEditor", "resolutionY", settings.resolutionY); + } + } + + public bool Result + { + get { return result; } + } + } +} \ No newline at end of file Added: trunk/plugins/VideoEditor/VideoEditor/Converter.cs =================================================================== --- trunk/plugins/VideoEditor/VideoEditor/Converter.cs (rev 0) +++ trunk/plugins/VideoEditor/VideoEditor/Converter.cs 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,180 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using System.Diagnostics; +using System.IO; +using System.Threading; +using System.Windows.Forms; +using MediaPortal.Configuration; +using MediaPortal.Core.Transcoding; +using MediaPortal.Profile; + +namespace WindowPlugins.VideoEditor +{ + internal class Converter + { + private bool hasMencoder = false; + private string mencoderPath; + private EditSettings settings; + private ProcessStartInfo mencoderProcessInfo; + private Process mencoderProcess; + private StreamReader consoleReader; + + public delegate void Finished(); + + public event Finished OnFinished; + + public delegate void Progress(int percentage); + + public event Progress OnProgress; + + + public Converter(EditSettings settings) + { + this.settings = settings; + CheckHasMencoder(); + } + + public bool CheckHasMencoder() + { + using (Settings xmlreader = new MPSettings()) + { + mencoderPath = xmlreader.GetValueAsString("VideoEditor", "mencoder", ""); + } + hasMencoder = File.Exists(mencoderPath); + if (!hasMencoder) + { + hasMencoder = File.Exists(Application.StartupPath + @"\mencoder.exe"); + if (hasMencoder) + { + mencoderPath = Application.StartupPath + @"\mencoder.exe"; + } + } + return hasMencoder; + } + + public void Convert(VideoFormat format) + { + switch (format) + { + case VideoFormat.Divx: + Thread convert = new Thread(new ThreadStart(ConvertToDivx)); + convert.Priority = ThreadPriority.BelowNormal; + convert.Name = "DivxConverter"; + convert.Start(); + //ConvertToDivx(); + break; + case VideoFormat.Mpeg2: + break; + case VideoFormat.Wmv: + break; + case VideoFormat.MP4: + break; + default: + break; + } + } + + private void ConvertToDivx() + { + try + { + if (hasMencoder) + { + if (settings.Settings is CompressionSettings) + { + CompressionSettings compressSettings = settings.Settings as CompressionSettings; + mencoderProcessInfo = new ProcessStartInfo(mencoderPath); + mencoderProcessInfo.Arguments = "-ffourcc DX50 -oac lavc -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=" + + compressSettings.videoQuality.ToString() + ":acodec=mp3:abitrate=" + + compressSettings.audioQuality.ToString() + + " -vf scale=" + compressSettings.resolutionX.ToString() + ":" + + compressSettings.resolutionY.ToString() + " -o \"" + + settings.FileName.Replace(Path.GetExtension(settings.FileName), ".avi") + + "\" \"" + settings.FileName + "\""; + mencoderProcessInfo.CreateNoWindow = true; + mencoderProcessInfo.RedirectStandardOutput = true; + mencoderProcess = new Process(); + mencoderProcessInfo.UseShellExecute = false; + mencoderProcess.StartInfo = mencoderProcessInfo; + mencoderProcess.Start(); + mencoderProcess.PriorityClass = ProcessPriorityClass.BelowNormal; + consoleReader = mencoderProcess.StandardOutput; + + string line; + int wherePerc; + int lastPerc = 0; + while (!mencoderProcess.HasExited) + { + line = consoleReader.ReadLine(); + if (line != null) + { + wherePerc = line.IndexOf('%'); + if (wherePerc >= 0) + { + string percent = line.Substring(wherePerc - 3, 3); + for (int i = 0; i < percent.Length; i++) + { + if (percent[i] >= '\x39' || percent[i] <= '\x30') + { + percent = percent.Remove(i, 1); + } + } + percent.Trim(); + try + { + if (percent.Length > 0 && percent != " ") + { + if (System.Convert.ToInt32(percent) > lastPerc) + { + lastPerc = System.Convert.ToInt32(percent); + if (OnProgress != null) + { + OnProgress(lastPerc); + } + } + } + } + catch {} + Thread.Sleep(20); + } + } + } + } + } + if (OnFinished != null) + { + OnFinished(); + } + if (OnProgress != null) + { + OnProgress(100); + } + } + catch (Exception) {} + } + + public bool HasMencoder + { + get { return hasMencoder; } + } + } +} \ No newline at end of file Added: trunk/plugins/VideoEditor/VideoEditor/DvrMsModifier.cs =================================================================== --- trunk/plugins/VideoEditor/VideoEditor/DvrMsModifier.cs (rev 0) +++ trunk/plugins/VideoEditor/VideoEditor/DvrMsModifier.cs 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,468 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Threading; +using System.Timers; +using DirectShowLib.SBE; +using DShowNET.Helper; +using MediaPortal.Core.Transcoding; +using MediaPortal.GUI.Library; +using Timer = System.Timers.Timer; + +namespace WindowPlugins.VideoEditor +{ + internal class DvrMsModifier + { + private IStreamBufferRecComp recCompcut = null; + private Timer cutProgresstime; + private Timer joinProgresstime; + private Timer transcodeProgresstime; + private Timer convertProgresstime; + + public delegate void Finished(); + + public event Finished OnFinished; + + public delegate void Progress(int percentage); + + public event Progress OnProgress; + private int percent = 0; + private int joinedFiles = 0; + private double newDuration = 0; + private FileInfo inFilename; + private List<TimeDomain> cutPoints; + private List<FileInfo> fileList; + private Dvrms2Mpeg tompeg; + private Dvrms2Divx toDivx; + //string filetoConvert; + //bool inDatabase; + + public DvrMsModifier() + { + //cutProgresstime = new System.Timers.Timer(1000); + //cutProgresstime.Elapsed += new System.Timers.ElapsedEventHandler(CutProgresstime_Elapsed); + } + + public void CutDvr(FileInfo inFilename, List<TimeDomain> cutPoints) + { + this.inFilename = inFilename; + this.cutPoints = cutPoints; + Thread cutThread = new Thread(new ThreadStart(CutDvr)); + cutThread.Name = "CutDvr"; + cutThread.Start(); + } + + public void CutDvr() + { + try + { + cutProgresstime = new Timer(1000); + cutProgresstime.Elapsed += new ElapsedEventHandler(CutProgresstime_Elapsed); + recCompcut = (IStreamBufferRecComp)ClassId.CoCreateInstance(ClassId.RecComp); + if (recCompcut != null) + { + FileInfo outFilename; + percent = 0; + //CutProgressTime(); + cutProgresstime.Start(); + string outPath = inFilename.FullName; + //rename the source file ------------later this could be configurable to delete it + //TODO behavior if the renamed sourcefile (_original) exists + inFilename.MoveTo(inFilename.FullName.Replace(inFilename.Extension, "_original" + inFilename.Extension)); + //to not to change the database the outputfile has the same name + outFilename = new FileInfo(outPath); + if (outFilename.Exists) + { + outFilename.Delete(); + } + for (int i = 0; i < cutPoints.Count; i++) + { + newDuration += cutPoints[i].Duration; + } + recCompcut.Initialize(outFilename.FullName, inFilename.FullName); + for (int i = 0; i < cutPoints.Count; i++) + { + //string[] split = cutList[i].ToString().Split(new char[] { ':' }); + //startCut = cutPoints[i].StartTime; + //endCut = cutPoints[i].EndTime; + + recCompcut.AppendEx(inFilename.FullName, (long)(cutPoints[i].StartTime * 10000000), + (long)(cutPoints[i].EndTime * 10000000)); + } + cutProgresstime.Stop(); + recCompcut.Close(); + percent = 100; + /*recInfo = new MediaPortal.TV.Database.TVRecorded(); + if (TVDatabase.GetRecordedTVByFilename(outFilename.FullName, ref rec)) + { + TVDatabase.RemoveRecordedTV(recInfo); + recInfo.End = MediaPortal.Util.Utils.datetolong(recInfo.StartTime.AddSeconds(durationNew)); + TVDatabase.AddRecordedTV(recInfo); + }*/ + + if (OnFinished != null) + { + OnFinished(); + } + //cutFinished = true; + //progressLbl.Label = "100"; + //progressBar.Percentage = 100; + //MessageBox(GUILocalizeStrings.Get(2083), GUILocalizeStrings.Get(2111)); //Dvrms:Finished to cut the video file , Finished ! + //progressBar.IsVisible = false; + //progressLbl.IsVisible = false; + } + } + catch (Exception ex) + { + Log.Error(ex); + } + finally + { + DirectShowUtil.ReleaseComObject((object)recCompcut); + recCompcut = null; + cutPoints = null; + percent = 0; + newDuration = 0; + //cutProgresstime.Stop(); + } + } + + public void JoinDvr(FileInfo firstFile, FileInfo secondFile) + { + fileList = new List<FileInfo>(2); + fileList.Add(firstFile); + fileList.Add(secondFile); + Thread joinThread = new Thread(new ThreadStart(JoinDvr)); + joinThread.Start(); + /* + try + { + cutProgresstime = new System.Timers.Timer(1000); + cutProgresstime.Elapsed += new System.Timers.ElapsedEventHandler(progressTime_Elapsed); + recCompcut = (IStreamBufferRecComp)DShowNET.Helper.ClassId.CoCreateInstance(DShowNET.Helper.ClassId.RecComp); + if (recCompcut != null) + { + System.IO.FileInfo outFilename; + percent = 0; + //cutProgresstime.Start(); + string outPath = firstFile.FullName.Replace(firstFile.Extension, "_joined" + firstFile.Extension); + //rename the source file ------------later this could be configurable to delete it + //TODO behavior if the renamed sourcefile (_original) exists + ... [truncated message content] |