Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #243 from FernetMenta/vnsi5

Vnsi5
  • Loading branch information...
commit e2e6804d3f442c8e1996e78fdfc49066b9e6e114 2 parents 9ac2aaf + a38c3a6
Lars Op den Kamp authored
Showing with 2,293 additions and 354 deletions.
  1. +1 −0  addons/pvr.vdr.vnsi/Makefile.am
  2. +1 −1  addons/pvr.vdr.vnsi/addon/addon.xml.in
  3. +29 −1 addons/pvr.vdr.vnsi/addon/resources/language/English/strings.po
  4. +283 −80 addons/pvr.vdr.vnsi/addon/resources/skins/skin.aeon.nox/1080i/Admin.xml
  5. +388 −168 addons/pvr.vdr.vnsi/addon/resources/skins/skin.confluence/720p/Admin.xml
  6. +376 −3 addons/pvr.vdr.vnsi/src/VNSIAdmin.cpp
  7. +14 −0 addons/pvr.vdr.vnsi/src/VNSIAdmin.h
  8. +195 −0 addons/pvr.vdr.vnsi/src/VNSIChannels.cpp
  9. +73 −0 addons/pvr.vdr.vnsi/src/VNSIChannels.h
  10. +44 −3 addons/pvr.vdr.vnsi/src/VNSIData.cpp
  11. +1 −0  addons/pvr.vdr.vnsi/src/VNSIData.h
  12. +31 −0 addons/pvr.vdr.vnsi/src/VNSIDemux.cpp
  13. +8 −0 addons/pvr.vdr.vnsi/src/VNSIDemux.h
  14. +34 −4 addons/pvr.vdr.vnsi/src/client.cpp
  15. +8 −1 addons/pvr.vdr.vnsi/src/vnsicommand.h
  16. +9 −0 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/HISTORY
  17. +2 −2 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/Makefile
  18. +332 −0 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/channelfilter.c
  19. +55 −0 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/channelfilter.h
  20. +32 −6 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/demuxer.c
  21. +4 −2 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/demuxer.h
  22. +13 −8 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/parser.c
  23. +1 −0  addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/parser.h
  24. +11 −5 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/parser_MPEGVideo.c
  25. +1 −0  addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/parser_MPEGVideo.h
  26. +14 −5 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/parser_h264.c
  27. +30 −5 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/streamer.c
  28. +1 −0  addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/streamer.h
  29. +46 −10 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/videobuffer.c
  30. +5 −2 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/videobuffer.h
  31. +1 −1  addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/vnsi.h
  32. +223 −32 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/vnsiclient.c
  33. +6 −0 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/vnsiclient.h
  34. +8 −1 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/vnsicommand.h
  35. +13 −14 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/vnsiserver.c
1  addons/pvr.vdr.vnsi/Makefile.am
View
@@ -19,6 +19,7 @@ libvdrvnsi_addon_la_SOURCES = src/client.cpp \
src/VNSIRecording.cpp \
src/VNSISession.cpp \
src/VNSIAdmin.cpp \
+ src/VNSIChannels.cpp \
src/requestpacket.cpp \
src/responsepacket.cpp \
src/tools.cpp
2  addons/pvr.vdr.vnsi/addon/addon.xml.in
View
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.vdr.vnsi"
- version="1.9.4"
+ version="1.9.5"
name="VDR VNSI Client"
provider-name="FernetMenta, Team XBMC">
<requires>
30 addons/pvr.vdr.vnsi/addon/resources/language/English/strings.po
View
@@ -241,4 +241,32 @@ msgstr ""
msgctxt "#30107"
msgid "VDR Admin"
-msgstr ""
+msgstr ""
+
+msgctxt "#30108"
+msgid "Channels"
+msgstr ""
+
+msgctxt "#30109"
+msgid "Provider whitelist"
+msgstr ""
+
+msgctxt "#30110"
+msgid "Channel blacklist"
+msgstr ""
+
+msgctxt "#30111"
+msgid "Channel filters"
+msgstr ""
+
+msgctxt "#30112"
+msgid "Radio Channels"
+msgstr ""
+
+msgctxt "#30113"
+msgid "Save filters"
+msgstr ""
+
+msgctxt "#30114"
+msgid "Provider Unknown"
+msgstr ""
363 addons/pvr.vdr.vnsi/addon/resources/skins/skin.aeon.nox/1080i/Admin.xml
View
@@ -2,69 +2,80 @@
<defaultcontrol always="true">10</defaultcontrol>
<onload>SetProperty(menu,osd)</onload>
<allowoverlay>no</allowoverlay>
+ <views>36</views>
<include condition="!Skin.HasSetting(firstrun4.0)">AutoConfig</include>
- <animation type="WindowOpen" reversible="false" condition="![Window.Previous(settings) | Window.Previous(skinsettings)]">
- <effect type="zoom" start="150" end="100" center="960,540" time="900" tween="cubic" />
+ <animation type="WindowOpen" reversible="false"
+ condition="![Window.Previous(settings) | Window.Previous(skinsettings)]">
+ <effect type="zoom" start="150" end="100" center="960,540"
+ time="900" tween="cubic" />
<effect type="fade" end="100" time="900" />
</animation>
- <animation type="WindowClose" reversible="false" condition="![Window.Next(settings) | Window.Next(skinsettings)]">
+ <animation type="WindowClose" reversible="false"
+ condition="![Window.Next(settings) | Window.Next(skinsettings)]">
<effect type="fade" start="100" end="0" time="300" />
- <effect type="zoom" start="100" end="130" center="960,540" time="300" tween="cubic" easing="in" />
+ <effect type="zoom" start="100" end="130" center="960,540"
+ time="300" tween="cubic" easing="in" />
</animation>
<controls>
- <control type="group">
- <include>CommonSettingsBackground</include>
- <include>CommonMediaPlayingBackground</include>
- <include>Furniture_SettingsFloor</include>
- </control>
- <control type="group">
- <animation effect="zoom" end="91" center="960,360" time="400" tween="cubic" easing="inout" condition="true">Conditional</animation>
- <include>Furniture_SettingsBackPanel</include>
+ <control type="group">
+ <include>CommonSettingsBackground</include>
+ <include>CommonMediaPlayingBackground</include>
+ <include>Furniture_SettingsFloor</include>
+ </control>
+ <control type="group">
+ <animation effect="zoom" end="91" center="960,360" time="400"
+ tween="cubic" easing="inout" condition="true">Conditional</animation>
+ <include>Furniture_SettingsBackPanel</include>
<control type="list" id="10">
<defaultcontrol always="true">1</defaultcontrol>
- <posx>63</posx>
- <posy>180</posy>
- <width>326</width>
- <height>768</height>
- <onleft>10</onleft>
- <onright>11</onright>
- <onup>10</onup>
- <ondown>9000</ondown>
- <pagecontrol>-</pagecontrol>
- <scrolltime>300</scrolltime>
- <itemlayout height="74" width="334">
- <control type="label">
- <width>334</width>
- <height>74</height>
- <font>Font_Bold20</font>
+ <posx>63</posx>
+ <posy>180</posy>
+ <width>326</width>
+ <height>768</height>
+ <onleft>10</onleft>
+ <onright>11</onright>
+ <onup>10</onup>
+ <ondown>9000</ondown>
+ <pagecontrol>-</pagecontrol>
+ <scrolltime>300</scrolltime>
+ <itemlayout height="74" width="334">
+ <control type="label">
+ <width>334</width>
+ <height>74</height>
+ <font>Font_Bold20</font>
<textcolor>grey2</textcolor>
<label>$INFO[ListItem.Label]</label>
- </control>
- </itemlayout>
- <focusedlayout height="74" width="334">
- <control type="image">
+ </control>
+ </itemlayout>
+ <focusedlayout height="74" width="334">
+ <control type="image">
<width>334</width>
<height>74</height>
<texture>views/tripanel/listselect_fo.png</texture>
- <animation effect="fade" start="100" end="50" time="50" condition="!Control.HasFocus(9000)">Conditional</animation>
+ <animation effect="fade" start="100" end="50"
+ time="50" condition="!Control.HasFocus(9000)">Conditional</animation>
<colordiffuse>$VAR[FocusTextureColorVar]</colordiffuse>
- </control>
- <control type="label">
+ </control>
+ <control type="label">
<width>334</width>
<height>74</height>
<font>Font_Bold20</font>
<label>$INFO[ListItem.Label]</label>
- </control>
- </focusedlayout>
- <content>
- <item id="1">
- <label>$ADDON[pvr.vdr.vnsi 30100]</label>
- <onclick>SetProperty(menu,osd)</onclick>
- </item>
- <item id="2">
- <label>$ADDON[pvr.vdr.vnsi 30101]</label>
- <onclick>SetProperty(menu,setup)</onclick>
- </item>
+ </control>
+ </focusedlayout>
+ <content>
+ <item id="1">
+ <label>$ADDON[pvr.vdr.vnsi 30100]</label>
+ <onclick>SetProperty(menu,osd)</onclick>
+ </item>
+ <item id="2">
+ <label>$ADDON[pvr.vdr.vnsi 30101]</label>
+ <onclick>SetProperty(menu,setup)</onclick>
+ </item>
+ <item id="3">
+ <label>$ADDON[pvr.vdr.vnsi 30108]</label>
+ <onclick>SetProperty(menu,channels)</onclick>
+ </item>
</content>
</control>
<control type="group" id="11">
@@ -87,9 +98,9 @@
<aspectratio>stretch</aspectratio>
<texture>GlassTitleBar.png</texture>
</control>
- <control type="group" id="12">
- <visible>StringCompare(Window.Property(menu),osd)</visible>
- <control type="button" id="13">
+ <control type="group" id="12">
+ <visible>StringCompare(Window.Property(menu),osd)</visible>
+ <control type="button" id="13">
<description>osd control label</description>
<posx>25</posx>
<posy>10</posy>
@@ -102,33 +113,19 @@
<font>font16caps</font>
<textcolor>grey</textcolor>
<focusedcolor>white2</focusedcolor>
- <onleft>10</onleft>
- </control>
- <control type="label">
- <description>not focused label</description>
- <visible>Control.HasFocus(11)</visible>
- <posx>300</posx>
- <posy>20</posy>
- <width>1380</width>
- <height>30</height>
- <font>font16caps</font>
- <label>$ADDON[pvr.vdr.vnsi 30103]</label>
- <align>left</align>
- <aligny>center</aligny>
- <textcolor>white</textcolor>
- <shadowcolor>black</shadowcolor>
+ <onleft>10</onleft>
</control>
- <control type="renderaddon" id ="9">
+ <control type="renderaddon" id="9">
<posx>5</posx>
<posy>50</posy>
<width>1453</width>
<height>740</height>
</control>
- </control>
- <control type="group" id="20">
- <visible>StringCompare(Window.Property(menu),setup)</visible>
- <defaultcontrol always="true">21</defaultcontrol>
- <control type="spincontrolex" id="21">
+ </control>
+ <control type="group" id="20">
+ <visible>StringCompare(Window.Property(menu),setup)</visible>
+ <defaultcontrol always="true">21</defaultcontrol>
+ <control type="spincontrolex" id="21">
<description>Source Type</description>
<posx>10</posx>
<posy>50</posy>
@@ -143,9 +140,9 @@
<aligny>center</aligny>
<label>$ADDON[pvr.vdr.vnsi 30104]</label>
<onleft>10</onleft>
- <ondown>22</ondown>
- </control>
- <control type="spincontrolex" id="22">
+ <ondown>22</ondown>
+ </control>
+ <control type="spincontrolex" id="22">
<description>Source Type</description>
<posx>10</posx>
<posy>100</posy>
@@ -160,10 +157,10 @@
<aligny>center</aligny>
<label>$ADDON[pvr.vdr.vnsi 30105]</label>
<onleft>10</onleft>
- <onup>21</onup>
- <ondown>23</ondown>
- </control>
- <control type="spincontrolex" id="23">
+ <onup>21</onup>
+ <ondown>23</ondown>
+ </control>
+ <control type="spincontrolex" id="23">
<description>Source Type</description>
<posx>10</posx>
<posy>150</posy>
@@ -178,11 +175,217 @@
<aligny>center</aligny>
<label>$ADDON[pvr.vdr.vnsi 30106]</label>
<onleft>10</onleft>
- <onup>22</onup>
+ <onup>22</onup>
+ </control>
+ </control>
+ <control type="group" id="30">
+ <visible>StringCompare(Window.Property(menu),channels)</visible>
+ <defaultcontrol always="true">33</defaultcontrol>
+ <control type="label" id="31">
+ <description>Channels label</description>
+ <posx>25</posx>
+ <posy>10</posy>
+ <width>1000</width>
+ <height>30</height>
+ <font>font16caps</font>
+ <label>$ADDON[pvr.vdr.vnsi 30111]</label>
+ <align>posx</align>
+ <aligny>center</aligny>
+ <textcolor>white</textcolor>
+ <shadowcolor>black</shadowcolor>
+ </control>
+ <control type="image">
+ <posx>1090</posx>
+ <posy>30</posy>
+ <width>30</width>
+ <height>30</height>
+ <aspectratio>stretch</aspectratio>
+ <colordiffuse>FFCC0000</colordiffuse>
+ <texture>views/scrollbarnub-focus.png</texture>
+ <visible>StringCompare(Window.Property(IsDirty),1)</visible>
+ </control>
+ <control type="image">
+ <posx>1090</posx>
+ <posy>30</posy>
+ <width>30</width>
+ <height>30</height>
+ <aspectratio>stretch</aspectratio>
+ <colordiffuse>FF00FF00</colordiffuse>
+ <texture>views/scrollbarnub-focus.png</texture>
+ <visible>!StringCompare(Window.Property(IsDirty),1)</visible>
+ </control>
+ <control type="radiobutton" id="32">
+ <description>Is Radio</description>
+ <posx>75</posx>
+ <posy>150</posy>
+ <width>375</width>
+ <height>30</height>
+ <font>font16caps</font>
+ <textcolor>grey3</textcolor>
+ <focusedcolor>white</focusedcolor>
+ <texturefocus>views/tripanel/listselect_fo.png</texturefocus>
+ <colordiffuse>$VAR[FocusTextureColorVar]</colordiffuse>
+ <texturenofocus>settings/settings_radiobuttonoff.png</texturenofocus>
+ <label>$ADDON[pvr.vdr.vnsi 30112]</label>
+ <onleft>10</onleft>
+ <ondown>33</ondown>
+ <onright>36</onright>
+ </control>
+ <control type="button" id="33">
+ <description>providers</description>
+ <posx>75</posx>
+ <posy>250</posy>
+ <width>375</width>
+ <height>30</height>
+ <texturefocus>views/tripanel/listselect_fo.png</texturefocus>
+ <texturenofocus>settings/settings_radiobuttonoff.png</texturenofocus>
+ <label>$ADDON[pvr.vdr.vnsi 30109]</label>
+ <font>font16caps</font>
+ <textcolor>grey3</textcolor>
+ <onleft>10</onleft>
+ <onright>36</onright>
+ <onup>32</onup>
+ <ondown>34</ondown>
+ </control>
+ <control type="button" id="34">
+ <description>channels</description>
+ <posx>75</posx>
+ <posy>350</posy>
+ <width>375</width>
+ <height>30</height>
+ <texturefocus>views/tripanel/listselect_fo.png</texturefocus>
+ <texturenofocus>settings/settings_radiobuttonoff.png</texturenofocus>
+ <label>$ADDON[pvr.vdr.vnsi 30110]</label>
+ <font>font16caps</font>
+ <textcolor>grey3</textcolor>
+ <onleft>10</onleft>
+ <onright>36</onright>
+ <onup>33</onup>
+ <ondown>35</ondown>
+ </control>
+ <control type="button" id="35">
+ <description>save</description>
+ <posx>75</posx>
+ <posy>450</posy>
+ <width>375</width>
+ <height>30</height>
+ <texturefocus>views/tripanel/listselect_fo.png</texturefocus>
+ <texturenofocus>settings/settings_radiobuttonoff.png</texturenofocus>
+ <label>$ADDON[pvr.vdr.vnsi 30113]</label>
+ <font>font16caps</font>
+ <textcolor>grey3</textcolor>
+ <onleft>10</onleft>
+ <onright>36</onright>
+ <onup>34</onup>
+ </control>
+ <control type="image">
+ <description>background image</description>
+ <posx>700</posx>
+ <posy>75</posy>
+ <width>740</width>
+ <height>670</height>
+ <texture background="true">$INFO[Container(9000).ListItem.Icon]</texture>
+ </control>
+ <control type="list" id ="36">
+ <posx>720</posx>
+ <posy>95</posy>
+ <width>650</width>
+ <height>630</height>
+ <onleft>33</onleft>
+ <onright>37</onright>
+ <viewtype label="30106">list</viewtype>
+ <pagecontrol>37</pagecontrol>
+ <scrolltime>200</scrolltime>
+ <itemlayout height="20" width="650">
+ <control type="image">
+ <posx>2</posx>
+ <posy>2</posy>
+ <width>18</width>
+ <height>18</height>
+ <aspectratio>stretch</aspectratio>
+ <colordiffuse>7790EE90</colordiffuse>
+ <texture>arrowright.png</texture>
+ <visible>ListItem.Property(IsWhitelist)</visible>
+ </control>
+ <control type="image">
+ <posx>2</posx>
+ <posy>2</posy>
+ <width>18</width>
+ <height>18</height>
+ <aspectratio>stretch</aspectratio>
+ <colordiffuse>77FF0000</colordiffuse>
+ <texture>arrowright.png</texture>
+ <visible>ListItem.Property(IsBlacklist)</visible>
+ </control>
+ <control type="label">
+ <posx>40</posx>
+ <posy>0</posy>
+ <width>550</width>
+ <height>20</height>
+ <font>Font_Reg10</font>
+ <align>posx</align>
+ <aligny>center</aligny>
+ <textcolor>grey2</textcolor>
+ <selectedcolor>selected</selectedcolor>
+ <info>ListItem.Label</info>
+ </control>
+ </itemlayout>
+ <focusedlayout height="20" width="650">
+ <control type="image">
+ <posx>0</posx>
+ <posy>0</posy>
+ <width>650</width>
+ <height>20</height>
+ <aspectratio>stretch</aspectratio>
+ <texture>views/tripanel/listselect_fo.png</texture>
+ <colordiffuse>$VAR[FocusTextureColorVar]</colordiffuse>
+ <visible>Control.HasFocus(36)</visible>
+ </control>
+ <control type="image">
+ <posx>2</posx>
+ <posy>2</posy>
+ <width>18</width>
+ <height>18</height>
+ <aspectratio>stretch</aspectratio>
+ <colordiffuse>7790EE90</colordiffuse>
+ <texture>arrowright.png</texture>
+ <visible>ListItem.Property(IsWhitelist)</visible>
+ </control>
+ <control type="image">
+ <posx>2</posx>
+ <posy>2</posy>
+ <width>18</width>
+ <height>18</height>
+ <aspectratio>stretch</aspectratio>
+ <colordiffuse>77FF0000</colordiffuse>
+ <texture>arrowright.png</texture>
+ <visible>ListItem.Property(IsBlacklist)</visible>
+ </control>
+ <control type="label">
+ <posx>40</posx>
+ <posy>0</posy>
+ <width>550</width>
+ <height>20</height>
+ <font>Font_Reg10</font>
+ <align>posx</align>
+ <aligny>center</aligny>
+ <textcolor>grey2</textcolor>
+ <selectedcolor>selected</selectedcolor>
+ <info>ListItem.Label</info>
+ </control>
+ </focusedlayout>
+ </control>
+ <control type="scrollbar" id="37">
+ <posx>1400</posx>
+ <posy>75</posy>
+ <width>25</width>
+ <height>630</height>
+ <onleft>36</onleft>
+ <showonepage>false</showonepage>
+ <orientation>vertical</orientation>
+ </control>
</control>
- </control>
</control>
- </control>
- <include>Clock</include>
+ </control>
</controls>
</window>
556 addons/pvr.vdr.vnsi/addon/resources/skins/skin.confluence/720p/Admin.xml
View
@@ -2,157 +2,162 @@
<defaultcontrol always="true">10</defaultcontrol>
<onload>SetProperty(menu,osd)</onload>
<allowoverlay>no</allowoverlay>
+ <views>36</views>
<controls>
<include>CommonBackground</include>
- <control type="image">
- <posx>0</posx>
- <posy>100r</posy>
- <width>1280</width>
- <height>100</height>
- <texture>floor.png</texture>
- <include>VisibleFadeEffect</include>
- </control>
- <control type="group">
- <posx>90</posx>
- <posy>30</posy>
- <animation type="WindowOpen" reversible="false">
- <effect type="zoom" start="80" end="100" center="640,360" easing="out" tween="back" time="300" />
- <effect type="fade" start="0" end="100" time="300" />
- </animation>
- <animation type="WindowClose" reversible="false">
- <effect type="zoom" start="100" end="80" center="640,360" easing="in" tween="back" time="300" />
- <effect type="fade" start="100" end="0" time="300" />
- </animation>
- <control type="image">
- <posx>5</posx>
- <posy>5</posy>
- <width>1090</width>
- <height>630</height>
- <texture border="15">ContentPanel.png</texture>
- </control>
- <control type="image">
- <posx>5</posx>
- <posy>625</posy>
- <width>1090</width>
- <height>64</height>
- <texture border="15">ContentPanelMirror.png</texture>
- </control>
- <control type="button">
- <description>Close Window button</description>
- <posx>980</posx>
- <posy>11</posy>
- <width>64</width>
- <height>32</height>
- <label>-</label>
- <font>-</font>
- <onclick>PreviousMenu</onclick>
- <texturefocus>DialogCloseButton-focus.png</texturefocus>
- <texturenofocus>DialogCloseButton.png</texturenofocus>
- <onleft>1</onleft>
- <onright>1</onright>
- <onup>1</onup>
- <ondown>1</ondown>
- <visible>system.getbool(input.enablemouse)</visible>
- <include>VisibleFadeEffect</include>
- </control>
- <control type="image">
- <description>LOGO</description>
- <posx>30</posx>
- <posy>15</posy>
- <width>220</width>
- <height>80</height>
- <aspectratio>keep</aspectratio>
- <texture>Confluence_Logo.png</texture>
- </control>
+ <control type="image">
+ <left>0</left>
+ <top>100r</top>
+ <width>1280</width>
+ <height>100</height>
+ <texture>floor.png</texture>
+ <include>VisibleFadeEffect</include>
+ </control>
+ <control type="group">
+ <left>90</left>
+ <top>30</top>
+ <animation type="WindowOpen" reversible="false">
+ <effect type="zoom" start="80" end="100" center="640,360" easing="out" tween="back" time="300" />
+ <effect type="fade" start="0" end="100" time="300" />
+ </animation>
+ <animation type="WindowClose" reversible="false">
+ <effect type="zoom" start="100" end="80" center="640,360" easing="in" tween="back" time="300" />
+ <effect type="fade" start="100" end="0" time="300" />
+ </animation>
+ <control type="image">
+ <left>5</left>
+ <top>5</top>
+ <width>1090</width>
+ <height>630</height>
+ <texture border="15">ContentPanel.png</texture>
+ </control>
+ <control type="image">
+ <left>5</left>
+ <top>625</top>
+ <width>1090</width>
+ <height>64</height>
+ <texture border="15">ContentPanelMirror.png</texture>
+ </control>
+ <control type="button">
+ <description>Close Window button</description>
+ <left>980</left>
+ <top>11</top>
+ <width>64</width>
+ <height>32</height>
+ <label>-</label>
+ <font>-</font>
+ <onclick>PreviousMenu</onclick>
+ <texturefocus>DialogCloseButton-focus.png</texturefocus>
+ <texturenofocus>DialogCloseButton.png</texturenofocus>
+ <onleft>1</onleft>
+ <onright>1</onright>
+ <onup>1</onup>
+ <ondown>1</ondown>
+ <visible>system.getbool(input.enablemouse)</visible>
+ <include>VisibleFadeEffect</include>
+ </control>
+ <control type="image">
+ <description>LOGO</description>
+ <left>30</left>
+ <top>15</top>
+ <width>220</width>
+ <height>80</height>
+ <aspectratio>keep</aspectratio>
+ <texture>Confluence_Logo.png</texture>
+ </control>
<control type="list" id="10">
<defaultcontrol always="true">1</defaultcontrol>
- <posx>10</posx>
- <posy>90</posy>
- <width>260</width>
- <height>481</height>
- <onleft>10</onleft>
- <onright>11</onright>
- <onup>10</onup>
- <ondown>9000</ondown>
- <pagecontrol>-</pagecontrol>
- <scrolltime>300</scrolltime>
- <itemlayout height="54" width="260">
- <control type="image">
- <posx>0</posx>
- <posy>0</posy>
- <width>260</width>
- <height>55</height>
- <texture border="5">MenuItemNF.png</texture>
- </control>
- <control type="label">
- <posx>250</posx>
- <posy>0</posy>
- <width>380</width>
- <height>55</height>
- <font>font24_title</font>
- <textcolor>grey3</textcolor>
- <align>right</align>
- <aligny>center</aligny>
- <label>$INFO[ListItem.Label]</label>
- </control>
- </itemlayout>
- <focusedlayout height="54" width="260">
- <control type="image">
- <posx>0</posx>
- <posy>0</posy>
- <width>260</width>
- <height>55</height>
- <texture border="5">MenuItemFO.png</texture>
- </control>
- <control type="label">
- <posx>250</posx>
- <posy>0</posy>
- <width>380</width>
- <height>55</height>
- <font>font24_title</font>
- <textcolor>white</textcolor>
- <align>right</align>
- <aligny>center</aligny>
- <label>$INFO[ListItem.Label]</label>
- </control>
- </focusedlayout>
- <content>
- <item id="1">
- <label>$ADDON[pvr.vdr.vnsi 30100]</label>
- <onclick>SetProperty(menu,osd)</onclick>
- </item>
- <item id="2">
- <label>$ADDON[pvr.vdr.vnsi 30101]</label>
- <onclick>SetProperty(menu,setup)</onclick>
- </item>
+ <left>10</left>
+ <top>90</top>
+ <width>260</width>
+ <height>481</height>
+ <onleft>10</onleft>
+ <onright>11</onright>
+ <onup>10</onup>
+ <ondown>9000</ondown>
+ <pagecontrol>-</pagecontrol>
+ <scrolltime>300</scrolltime>
+ <itemlayout height="54" width="260">
+ <control type="image">
+ <left>0</left>
+ <top>0</top>
+ <width>260</width>
+ <height>55</height>
+ <texture border="5">MenuItemNF.png</texture>
+ </control>
+ <control type="label">
+ <left>250</left>
+ <top>0</top>
+ <width>380</width>
+ <height>55</height>
+ <font>font24_title</font>
+ <textcolor>grey3</textcolor>
+ <align>right</align>
+ <aligny>center</aligny>
+ <label>$INFO[ListItem.Label]</label>
+ </control>
+ </itemlayout>
+ <focusedlayout height="54" width="260">
+ <control type="image">
+ <left>0</left>
+ <top>0</top>
+ <width>260</width>
+ <height>55</height>
+ <texture border="5">MenuItemFO.png</texture>
+ </control>
+ <control type="label">
+ <left>250</left>
+ <top>0</top>
+ <width>380</width>
+ <height>55</height>
+ <font>font24_title</font>
+ <textcolor>white</textcolor>
+ <align>right</align>
+ <aligny>center</aligny>
+ <label>$INFO[ListItem.Label]</label>
+ </control>
+ </focusedlayout>
+ <content>
+ <item id="1">
+ <label>$ADDON[pvr.vdr.vnsi 30100]</label>
+ <onclick>SetProperty(menu,osd)</onclick>
+ </item>
+ <item id="2">
+ <label>$ADDON[pvr.vdr.vnsi 30101]</label>
+ <onclick>SetProperty(menu,setup)</onclick>
+ </item>
+ <item id="3">
+ <label>$ADDON[pvr.vdr.vnsi 30108]</label>
+ <onclick>SetProperty(menu,channels)</onclick>
+ </item>
</content>
</control>
<control type="group" id="11">
- <posx>268</posx>
- <posy>10</posy>
+ <left>268</left>
+ <top>10</top>
<control type="image">
<description>Background</description>
- <posx>0</posx>
- <posy>0</posy>
+ <left>0</left>
+ <top>0</top>
<width>790</width>
<height>620</height>
<texture border="5">black-back2.png</texture>
</control>
<control type="image">
<description>Background Title</description>
- <posx>0</posx>
- <posy>0</posy>
+ <left>0</left>
+ <top>0</top>
<width>790</width>
<height>50</height>
<aspectratio>stretch</aspectratio>
<texture>GlassTitleBar.png</texture>
</control>
- <control type="group" id="12">
- <visible>StringCompare(Window.Property(menu),osd)</visible>
- <control type="button" id="13">
+ <control type="group" id="12">
+ <visible>StringCompare(Window.Property(menu),osd)</visible>
+ <control type="button" id="13">
<description>osd control label</description>
- <posx>25</posx>
- <posy>20</posy>
+ <left>25</left>
+ <top>20</top>
<width>765</width>
<height>30</height>
<texturefocus border="5">MenuItemFO.png</texturefocus>
@@ -160,36 +165,22 @@
<label>$ADDON[pvr.vdr.vnsi 30103]</label>
<font>font16caps</font>
<textcolor>white</textcolor>
- <onleft>10</onleft>
- </control>
- <control type="label">
- <description>not focused label</description>
- <visible>Control.HasFocus(11)</visible>
- <posx>300</posx>
- <posy>30</posy>
- <width>740</width>
- <height>30</height>
- <font>font16caps</font>
- <label>$ADDON[pvr.vdr.vnsi 30103]</label>
- <align>left</align>
- <aligny>center</aligny>
- <textcolor>white</textcolor>
- <shadowcolor>black</shadowcolor>
+ <onleft>10</onleft>
</control>
<control type="renderaddon" id ="9">
- <posx>5</posx>
- <posy>50</posy>
+ <left>5</left>
+ <top>50</top>
<width>780</width>
<height>515</height>
</control>
- </control>
- <control type="group" id="20">
- <visible>StringCompare(Window.Property(menu),setup)</visible>
- <defaultcontrol always="true">21</defaultcontrol>
- <control type="spincontrolex" id="21">
+ </control>
+ <control type="group" id="20">
+ <visible>StringCompare(Window.Property(menu),setup)</visible>
+ <defaultcontrol always="true">21</defaultcontrol>
+ <control type="spincontrolex" id="21">
<description>Source Type</description>
- <posx>10</posx>
- <posy>50</posy>
+ <left>10</left>
+ <top>50</top>
<width>770</width>
<height>40</height>
<font>font13</font>
@@ -200,12 +191,12 @@
<aligny>center</aligny>
<label>$ADDON[pvr.vdr.vnsi 30104]</label>
<onleft>10</onleft>
- <ondown>22</ondown>
- </control>
- <control type="spincontrolex" id="22">
+ <ondown>22</ondown>
+ </control>
+ <control type="spincontrolex" id="22">
<description>Source Type</description>
- <posx>10</posx>
- <posy>100</posy>
+ <left>10</left>
+ <top>100</top>
<width>770</width>
<height>40</height>
<font>font13</font>
@@ -216,13 +207,13 @@
<aligny>center</aligny>
<label>$ADDON[pvr.vdr.vnsi 30105]</label>
<onleft>10</onleft>
- <onup>21</onup>
- <ondown>23</ondown>
- </control>
- <control type="spincontrolex" id="23">
+ <onup>21</onup>
+ <ondown>23</ondown>
+ </control>
+ <control type="spincontrolex" id="23">
<description>Source Type</description>
- <posx>10</posx>
- <posy>150</posy>
+ <left>10</left>
+ <top>150</top>
<width>770</width>
<height>40</height>
<font>font13</font>
@@ -233,11 +224,240 @@
<aligny>center</aligny>
<label>$ADDON[pvr.vdr.vnsi 30106]</label>
<onleft>10</onleft>
- <onup>22</onup>
+ <onup>22</onup>
+ </control>
+ </control>
+ <control type="group" id="30">
+ <visible>StringCompare(Window.Property(menu),channels)</visible>
+ <defaultcontrol always="true">33</defaultcontrol>
+ <control type="label" id="31">
+ <description>Channels label</description>
+ <left>30</left>
+ <top>20</top>
+ <width>500</width>
+ <height>30</height>
+ <font>font16caps</font>
+ <label>$ADDON[pvr.vdr.vnsi 30111]</label>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>white</textcolor>
+ <shadowcolor>black</shadowcolor>
+ </control>
+ <control type="image">
+ <left>730</left>
+ <top>20</top>
+ <width>30</width>
+ <height>30</height>
+ <aspectratio>stretch</aspectratio>
+ <colordiffuse>FFCC0000</colordiffuse>
+ <texture>radiobutton-nofocus.png</texture>
+ <visible>StringCompare(Window.Property(IsDirty),1)</visible>
+ </control>
+ <control type="image">
+ <left>730</left>
+ <top>20</top>
+ <width>30</width>
+ <height>30</height>
+ <aspectratio>stretch</aspectratio>
+ <colordiffuse>FF00FF00</colordiffuse>
+ <texture>radiobutton-nofocus.png</texture>
+ <visible>!StringCompare(Window.Property(IsDirty),1)</visible>
+ </control>
+ <control type="radiobutton" id="32">
+ <description>Is Radio</description>
+ <left>50</left>
+ <top>100</top>
+ <width>250</width>
+ <height>30</height>
+ <font>font16caps</font>
+ <textcolor>grey3</textcolor>
+ <focusedcolor>white</focusedcolor>
+ <texturefocus border="0,2,0,2">MenuItemFO.png</texturefocus>
+ <texturenofocus border="0,2,0,2">MenuItemNF.png</texturenofocus>
+ <label>$ADDON[pvr.vdr.vnsi 30112]</label>
+ <onleft>10</onleft>
+ <ondown>33</ondown>
+ <onright>36</onright>
+ </control>
+ <control type="button" id="33">
+ <description>providers</description>
+ <left>50</left>
+ <top>150</top>
+ <width>250</width>
+ <height>30</height>
+ <texturefocus border="5">MenuItemFO.png</texturefocus>
+ <texturenofocus border="5">MenuItemNF.png</texturenofocus>
+ <label>$ADDON[pvr.vdr.vnsi 30109]</label>
+ <font>font16caps</font>
+ <textcolor>grey3</textcolor>
+ <onleft>10</onleft>
+ <onright>36</onright>
+ <onup>32</onup>
+ <ondown>34</ondown>
+ </control>
+ <control type="button" id="34">
+ <description>channels</description>
+ <left>50</left>
+ <top>200</top>
+ <width>250</width>
+ <height>30</height>
+ <texturefocus border="5">MenuItemFO.png</texturefocus>
+ <texturenofocus border="5">MenuItemNF.png</texturenofocus>
+ <label>$ADDON[pvr.vdr.vnsi 30110]</label>
+ <font>font16caps</font>
+ <textcolor>grey3</textcolor>
+ <onleft>10</onleft>
+ <onright>36</onright>
+ <onup>33</onup>
+ <ondown>35</ondown>
+ </control>
+ <control type="button" id="35">
+ <description>save</description>
+ <left>50</left>
+ <top>250</top>
+ <width>250</width>
+ <height>30</height>
+ <texturefocus border="5">MenuItemFO.png</texturefocus>
+ <texturenofocus border="5">MenuItemNF.png</texturenofocus>
+ <label>$ADDON[pvr.vdr.vnsi 30113]</label>
+ <font>font16caps</font>
+ <textcolor>grey3</textcolor>
+ <onleft>10</onleft>
+ <onright>36</onright>
+ <onup>34</onup>
+ </control>
+ <control type="image">
+ <description>background image</description>
+ <left>320</left>
+ <top>50</top>
+ <width>440</width>
+ <height>540</height>
+ <texture border="20">DialogBack2.png</texture>
+ </control>
+ <control type="list" id ="36">
+ <left>340</left>
+ <top>70</top>
+ <width>400</width>
+ <height>500</height>
+ <onleft>33</onleft>
+ <onright>37</onright>
+ <viewtype label="30106">list</viewtype>
+ <pagecontrol>37</pagecontrol>
+ <scrolltime>200</scrolltime>
+ <itemlayout height="20" width="400">
+ <control type="image">
+ <left>0</left>
+ <top>0</top>
+ <width>400</width>
+ <height>20</height>
+ <aspectratio>stretch</aspectratio>
+ <texture border="5">MenuItemNF.png</texture>
+ </control>
+ <control type="image">
+ <left>2</left>
+ <top>2</top>
+ <width>18</width>
+ <height>18</height>
+ <aspectratio>stretch</aspectratio>
+ <colordiffuse>7790EE90</colordiffuse>
+ <texture>arrow-big-right.png</texture>
+ <visible>ListItem.Property(IsWhitelist)</visible>
+ </control>
+ <control type="image">
+ <left>2</left>
+ <top>2</top>
+ <width>18</width>
+ <height>18</height>
+ <aspectratio>stretch</aspectratio>
+ <colordiffuse>77FF0000</colordiffuse>
+ <texture>arrow-big-right.png</texture>
+ <visible>ListItem.Property(IsBlacklist)</visible>
+ </control>
+ <control type="label">
+ <left>40</left>
+ <top>0</top>
+ <width>340</width>
+ <height>20</height>
+ <font>font10</font>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>grey2</textcolor>
+ <selectedcolor>selected</selectedcolor>
+ <info>ListItem.Label</info>
+ </control>
+ </itemlayout>
+ <focusedlayout height="20" width="400">
+ <control type="image">
+ <left>0</left>
+ <top>0</top>
+ <width>400</width>
+ <height>20</height>
+ <aspectratio>stretch</aspectratio>
+ <texture border="5">MenuItemNF.png</texture>
+ <visible>!Control.HasFocus(36)</visible>
+ <include>VisibleFadeEffect</include>
+ </control>
+ <control type="image">
+ <left>0</left>
+ <top>0</top>
+ <width>400</width>
+ <height>20</height>
+ <aspectratio>stretch</aspectratio>
+ <texture border="5">MenuItemFO.png</texture>
+ <visible>Control.HasFocus(36)</visible>
+ <include>VisibleFadeEffect</include>
+ </control>
+ <control type="image">
+ <left>2</left>
+ <top>2</top>
+ <width>18</width>
+ <height>18</height>
+ <aspectratio>stretch</aspectratio>
+ <colordiffuse>7790EE90</colordiffuse>
+ <texture>arrow-big-right.png</texture>
+ <visible>ListItem.Property(IsWhitelist)</visible>
+ </control>
+ <control type="image">
+ <left>2</left>
+ <top>2</top>
+ <width>18</width>
+ <height>18</height>
+ <aspectratio>stretch</aspectratio>
+ <colordiffuse>77FF0000</colordiffuse>
+ <texture>arrow-big-right.png</texture>
+ <visible>ListItem.Property(IsBlacklist)</visible>
+ </control>
+ <control type="label">
+ <left>40</left>
+ <top>0</top>
+ <width>340</width>
+ <height>20</height>
+ <font>font10</font>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>grey2</textcolor>
+ <selectedcolor>selected</selectedcolor>
+ <info>ListItem.Label</info>
+ </control>
+ </focusedlayout>
+ </control>
+ <control type="scrollbar" id="37">
+ <left>760</left>
+ <top>50</top>
+ <width>25</width>
+ <height>540</height>
+ <texturesliderbackground border="0,14,0,14">ScrollBarV.png</texturesliderbackground>
+ <texturesliderbar border="0,14,0,14">ScrollBarV_bar.png</texturesliderbar>
+ <texturesliderbarfocus border="0,14,0,14">ScrollBarV_bar_focus.png</texturesliderbarfocus>
+ <textureslidernib>ScrollBarNib.png</textureslidernib>
+ <textureslidernibfocus>ScrollBarNib.png</textureslidernibfocus>
+ <onleft>36</onleft>
+ <showonepage>false</showonepage>
+ <orientation>vertical</orientation>
+ </control>
</control>
- </control>
</control>
- </control>
+ </control>
<include>Clock</include>
</controls>
</window>
379 addons/pvr.vdr.vnsi/src/VNSIAdmin.cpp
View
@@ -96,6 +96,12 @@ CVisGUIShader *vis_shader = NULL;
#define CONTROL_SPIN_TIMESHIFT_MODE 21
#define CONTROL_SPIN_TIMESHIFT_BUFFER_RAM 22
#define CONTROL_SPIN_TIMESHIFT_BUFFER_FILE 23
+#define CONTROL_LABEL_FILTERS 31
+#define CONTROL_RADIO_ISRADIO 32
+#define CONTROL_PROVIDERS_BUTTON 33
+#define CONTROL_CHANNELS_BUTTON 34
+#define CONTROL_FILTERSAVE_BUTTON 35
+#define CONTROL_ITEM_LIST 36
#define ACTION_NONE 0
#define ACTION_MOVE_LEFT 1
@@ -840,8 +846,12 @@ bool cVNSIAdmin::Open(const std::string& hostname, int port, const char* name)
m_window->CBOnFocus = OnFocusCB;
m_window->CBOnClick = OnClickCB;
m_window->CBOnAction= OnActionCB;
+
m_window->DoModal();
+ ClearListItems();
+ m_window->ClearProperties();
+
#if defined(XBMC_GUI_API_VERSION)
GUI->Control_releaseRendering(m_renderControl);
#endif
@@ -849,7 +859,9 @@ bool cVNSIAdmin::Open(const std::string& hostname, int port, const char* name)
GUI->Control_releaseSpin(m_spinTimeshiftMode);
GUI->Control_releaseSpin(m_spinTimeshiftBufferRam);
GUI->Control_releaseSpin(m_spinTimeshiftBufferFile);
+ GUI->Control_releaseRadioButton(m_ratioIsRadio);
GUI->Window_destroy(m_window);
+ StopThread();
Close();
if (m_osdRender)
@@ -901,6 +913,89 @@ bool cVNSIAdmin::OnClick(int controlId)
}
return true;
}
+ else if (controlId == CONTROL_PROVIDERS_BUTTON)
+ {
+ if(!m_channels.m_loaded || m_ratioIsRadio->IsSelected() != m_channels.m_radio)
+ {
+ ReadChannelList(m_ratioIsRadio->IsSelected());
+ ReadChannelWhitelist(m_ratioIsRadio->IsSelected());
+ ReadChannelBlacklist(m_ratioIsRadio->IsSelected());
+ m_channels.CreateProviders();
+ m_channels.LoadProviderWhitelist();
+ m_channels.LoadChannelBlacklist();
+ m_channels.m_loaded = true;
+ m_channels.m_radio = m_ratioIsRadio->IsSelected();
+ m_window->SetProperty("IsDirty", "0");
+ }
+ LoadListItemsProviders();
+ m_channels.m_mode = CVNSIChannels::PROVIDER;
+ }
+ else if (controlId == CONTROL_CHANNELS_BUTTON)
+ {
+ if(!m_channels.m_loaded || m_ratioIsRadio->IsSelected() != m_channels.m_radio)
+ {
+ ReadChannelList(m_ratioIsRadio->IsSelected());
+ ReadChannelWhitelist(m_ratioIsRadio->IsSelected());
+ ReadChannelBlacklist(m_ratioIsRadio->IsSelected());
+ m_channels.CreateProviders();
+ m_channels.LoadProviderWhitelist();
+ m_channels.LoadChannelBlacklist();
+ m_channels.m_loaded = true;
+ m_channels.m_radio = m_ratioIsRadio->IsSelected();
+ m_window->SetProperty("IsDirty", "0");
+ }
+ LoadListItemsChannels();
+ m_channels.m_mode = CVNSIChannels::CHANNEL;
+ }
+ else if (controlId == CONTROL_FILTERSAVE_BUTTON)
+ {
+ if(m_channels.m_loaded)
+ {
+ SaveChannelWhitelist(m_ratioIsRadio->IsSelected());
+ SaveChannelBlacklist(m_ratioIsRadio->IsSelected());
+ m_window->SetProperty("IsDirty", "0");
+ }
+ }
+ else if (controlId == CONTROL_ITEM_LIST)
+ {
+ if(m_channels.m_mode == CVNSIChannels::PROVIDER)
+ {
+ int pos = m_window->GetCurrentListPosition();
+ GUIHANDLE hdl = m_window->GetListItem(pos);
+ int idx = m_listItemsMap[hdl];
+ CAddonListItem *item = m_listItems[idx];
+ if (m_channels.m_providers[idx].m_whitelist)
+ {
+ item->SetProperty("IsWhitelist", "false");
+ m_channels.m_providers[idx].m_whitelist = false;
+ }
+ else
+ {
+ item->SetProperty("IsWhitelist", "true");
+ m_channels.m_providers[idx].m_whitelist = true;
+ }
+ m_window->SetProperty("IsDirty", "1");
+ }
+ else if(m_channels.m_mode == CVNSIChannels::CHANNEL)
+ {
+ int pos = m_window->GetCurrentListPosition();
+ GUIHANDLE hdl = m_window->GetListItem(pos);
+ int idx = m_listItemsMap[hdl];
+ CAddonListItem *item = m_listItems[idx];
+ int channelidx = m_listItemsChannelsMap[hdl];
+ if (m_channels.m_channels[channelidx].m_blacklist)
+ {
+ item->SetProperty("IsBlacklist", "false");
+ m_channels.m_channels[channelidx].m_blacklist = false;
+ }
+ else
+ {
+ item->SetProperty("IsBlacklist", "true");
+ m_channels.m_channels[channelidx].m_blacklist = true;
+ }
+ m_window->SetProperty("IsDirty", "1");
+ }
+ }
return false;
}
@@ -1022,6 +1117,10 @@ bool cVNSIAdmin::OnInit()
m_spinTimeshiftBufferFile->SetValue(mode);
delete resp;
}
+
+ // channel filters
+ m_ratioIsRadio = GUI->Control_getRadioButton(m_window, CONTROL_RADIO_ISRADIO);
+
return true;
}
@@ -1067,10 +1166,11 @@ bool cVNSIAdmin::OnAction(int actionId)
if (actionId == ACTION_SELECT_ITEM)
{
- int controlID = m_window->GetFocusId();
- if (controlID == CONTROL_MENU)
+ if (m_window->GetFocusId() == CONTROL_MENU)
{
- if (strncmp(m_window->GetProperty("menu"), "osd", 3) == 0)
+ const char *tmp = m_window->GetProperty("menu");
+ //if (strncmp(m_window->GetProperty("menu"), "osd", 3) == 0)
+ if (strncmp(tmp, "osd", 3) == 0)
{
#if defined(XBMC_GUI_API_VERSION)
m_window->MarkDirtyRegion();
@@ -1289,3 +1389,276 @@ bool cVNSIAdmin::ConnectOSD()
return true;
}
+
+bool cVNSIAdmin::ReadChannelList(bool radio)
+{
+ cRequestPacket vrp;
+ if (!vrp.init(VNSI_CHANNELS_GETCHANNELS))
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't init cRequestPacket", __FUNCTION__);
+ return false;
+ }
+ if (!vrp.add_U32(radio))
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't add parameter to cRequestPacket", __FUNCTION__);
+ return false;
+ }
+ if (!vrp.add_U8(0)) // apply no filter
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't add parameter to cRequestPacket", __FUNCTION__);
+ return false;
+ }
+
+ cResponsePacket* vresp = ReadResult(&vrp);
+ if (!vresp)
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't get response packed", __FUNCTION__);
+ return false;
+ }
+
+ m_channels.m_channels.clear();
+ m_channels.m_channelsMap.clear();
+ while (!vresp->end())
+ {
+ CChannel channel;
+ channel.m_blacklist = false;
+
+ channel.m_number = vresp->extract_U32();
+ char *strChannelName = vresp->extract_String();
+ channel.m_name = strChannelName;
+ char *strProviderName = vresp->extract_String();
+ channel.m_provider = strProviderName;
+ channel.m_id = vresp->extract_U32();
+ vresp->extract_U32(); // first caid
+ char *strCaids = vresp->extract_String();
+ channel.SetCaids(strCaids);
+ channel.m_radio = radio;
+
+ delete[] strChannelName;
+ delete[] strProviderName;
+ delete[] strCaids;
+ m_channels.m_channels.push_back(channel);
+ m_channels.m_channelsMap[channel.m_id] = m_channels.m_channels.size() - 1;
+ }
+ delete vresp;
+
+ return true;
+}
+
+bool cVNSIAdmin::ReadChannelWhitelist(bool radio)
+{
+ cRequestPacket vrp;
+ if (!vrp.init(VNSI_CHANNELS_GETWHITELIST))
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't init cRequestPacket", __FUNCTION__);
+ return false;
+ }
+ if (!vrp.add_U8(radio))
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't add parameter to cRequestPacket", __FUNCTION__);
+ return false;
+ }
+
+ cResponsePacket* vresp = ReadResult(&vrp);
+ if (!vresp)
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't get response packed", __FUNCTION__);
+ return false;
+ }
+
+ m_channels.m_providerWhitelist.clear();
+ CProvider provider;
+ while (!vresp->end())
+ {
+ char *strProviderName = vresp->extract_String();
+ provider.m_name = strProviderName;
+ provider.m_caid = vresp->extract_U32();
+ m_channels.m_providerWhitelist.push_back(provider);
+ delete [] strProviderName;
+ }
+ delete vresp;
+
+ return true;
+}
+
+bool cVNSIAdmin::SaveChannelWhitelist(bool radio)
+{
+ m_channels.ExtractProviderWhitelist();
+
+ cRequestPacket vrp;
+ if (!vrp.init(VNSI_CHANNELS_SETWHITELIST))
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't init cRequestPacket", __FUNCTION__);
+ return false;
+ }
+ if (!vrp.add_U8(radio))
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't add parameter to cRequestPacket", __FUNCTION__);
+ return false;
+ }
+
+ for(unsigned int i=0; i<m_channels.m_providerWhitelist.size(); i++)
+ {
+ vrp.add_String(m_channels.m_providerWhitelist[i].m_name.c_str());
+ vrp.add_S32(m_channels.m_providerWhitelist[i].m_caid);
+ }
+
+ cResponsePacket* vresp = ReadResult(&vrp);
+ if (!vresp)
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't get response packed", __FUNCTION__);
+ return false;
+ }
+
+ return true;
+}
+
+bool cVNSIAdmin::ReadChannelBlacklist(bool radio)
+{
+ cRequestPacket vrp;
+ if (!vrp.init(VNSI_CHANNELS_GETBLACKLIST))
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't init cRequestPacket", __FUNCTION__);
+ return false;
+ }
+ if (!vrp.add_U8(radio))
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't add parameter to cRequestPacket", __FUNCTION__);
+ return false;
+ }
+
+ cResponsePacket* vresp = ReadResult(&vrp);
+ if (!vresp)
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't get response packed", __FUNCTION__);
+ return false;
+ }
+
+ m_channels.m_channelBlacklist.clear();
+ while (!vresp->end())
+ {
+ int id = vresp->extract_U32();
+ m_channels.m_channelBlacklist.push_back(id);
+ }
+ delete vresp;
+
+ return true;
+}
+
+bool cVNSIAdmin::SaveChannelBlacklist(bool radio)
+{
+ m_channels.ExtractChannelBlacklist();
+
+ cRequestPacket vrp;
+ if (!vrp.init(VNSI_CHANNELS_SETBLACKLIST))
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't init cRequestPacket", __FUNCTION__);
+ return false;
+ }
+ if (!vrp.add_U8(radio))
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't add parameter to cRequestPacket", __FUNCTION__);
+ return false;
+ }
+
+ for(unsigned int i=0; i<m_channels.m_channelBlacklist.size(); i++)
+ {
+ vrp.add_S32(m_channels.m_channelBlacklist[i]);
+ }
+
+ cResponsePacket* vresp = ReadResult(&vrp);
+ if (!vresp)
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't get response packed", __FUNCTION__);
+ return false;
+ }
+
+ return true;
+}
+
+void cVNSIAdmin::ClearListItems()
+{
+ m_window->ClearList();
+ std::vector<CAddonListItem*>::iterator it;
+ for(it=m_listItems.begin(); it!=m_listItems.end(); ++it)
+ {
+ GUI->ListItem_destroy(*it);
+ }
+ m_listItems.clear();
+ m_listItemsMap.clear();
+ m_listItemsChannelsMap.clear();
+}
+
+void cVNSIAdmin::LoadListItemsProviders()
+{
+ ClearListItems();
+
+ std::vector<CProvider>::iterator it;
+ int count = 0;
+ for(it=m_channels.m_providers.begin(); it!=m_channels.m_providers.end(); ++it)
+ {
+ std::string tmp;
+ if(!it->m_name.empty())
+ tmp = it->m_name;
+ else
+ tmp = XBMC->GetLocalizedString(30114);
+ if (it->m_caid == 0)
+ {
+ tmp += " - FTA";
+ }
+ else
+ {
+ tmp += " - CAID: ";
+ char buf[16];
+ sprintf(buf, "%04x", it->m_caid);
+ tmp += buf;
+ }
+
+ CAddonListItem *item = GUI->ListItem_create(tmp.c_str(), NULL, NULL, NULL, NULL);
+ m_window->AddItem(item, count);
+ GUIHANDLE hdl = m_window->GetListItem(count);
+ m_listItems.push_back(item);
+ m_listItemsMap[hdl] = count;
+
+ if (it->m_whitelist)
+ item->SetProperty("IsWhitelist", "true");
+ else
+ item->SetProperty("IsWhitelist", "false");
+
+ count++;
+ }
+}
+
+void cVNSIAdmin::LoadListItemsChannels()
+{
+ ClearListItems();
+
+ int count = 0;
+ std::string tmp;
+ for(unsigned int i=0; i<m_channels.m_channels.size(); i++)
+ {
+ if(!m_channels.IsWhitelist(m_channels.m_channels[i]))
+ continue;
+
+ tmp = m_channels.m_channels[i].m_name;
+ tmp += " (";
+ if(!m_channels.m_channels[i].m_provider.empty())
+ tmp += m_channels.m_channels[i].m_provider;
+ else
+ tmp += XBMC->GetLocalizedString(30114);
+ tmp += ")";
+ CAddonListItem *item = GUI->ListItem_create(tmp.c_str(), NULL, NULL, NULL, NULL);
+ m_window->AddItem(item, count);
+ GUIHANDLE hdl = m_window->GetListItem(count);
+ m_listItems.push_back(item);
+ m_listItemsMap[hdl] = count;
+ m_listItemsChannelsMap[hdl] = i;
+
+ if (m_channels.m_channels[i].m_blacklist)
+ item->SetProperty("IsBlacklist", "true");
+ else
+ item->SetProperty("IsBlacklist", "false");
+
+ count++;
+ }
+}
14 addons/pvr.vdr.vnsi/src/VNSIAdmin.h
View
@@ -21,6 +21,7 @@
*/
#include "VNSIData.h"
+#include "VNSIChannels.h"
#include "client.h"
class cOSDRender;
@@ -60,6 +61,14 @@ class cVNSIAdmin : public cVNSIData
virtual void OnReconnect() {};
bool ConnectOSD();
bool IsVdrAction(int action);
+ bool ReadChannelList(bool radio);
+ bool ReadChannelWhitelist(bool radio);
+ bool ReadChannelBlacklist(bool radio);
+ bool SaveChannelWhitelist(bool radio);
+ bool SaveChannelBlacklist(bool radio);
+ void ClearListItems();
+ void LoadListItemsProviders();
+ void LoadListItemsChannels();
private:
@@ -70,6 +79,11 @@ class cVNSIAdmin : public cVNSIData
CAddonGUISpinControl *m_spinTimeshiftMode;
CAddonGUISpinControl *m_spinTimeshiftBufferRam;
CAddonGUISpinControl *m_spinTimeshiftBufferFile;
+ CAddonGUIRadioButton *m_ratioIsRadio;
+ std::vector<CAddonListItem*> m_listItems;
+ std::map<GUIHANDLE, int> m_listItemsMap;
+ std::map<GUIHANDLE, int> m_listItemsChannelsMap;
+ CVNSIChannels m_channels;
bool m_bIsOsdControl;
bool m_bIsOsdDirty;
int m_width, m_height;
195 addons/pvr.vdr.vnsi/src/VNSIChannels.cpp
View
@@ -0,0 +1,195 @@
+/*
+ * Copyright (C) 2005-2013 Team XBMC
+ * http://xbmc.org
+ *
+ * This Program 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, or (at your option)
+ * any later version.
+ *
+ * This Program 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 XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "VNSIChannels.h"
+#include <algorithm>
+
+CProvider::CProvider()
+ :m_name(""), m_caid(0), m_whitelist(false)
+{
+
+}
+
+CProvider::CProvider(std::string name, int caid)
+ :m_name(name), m_caid(caid), m_whitelist(false)
+{
+};
+
+bool CProvider::operator==(const CProvider &rhs)
+{
+ if (rhs.m_caid != m_caid)
+ return false;
+ if (rhs.m_name.compare(m_name) != 0)
+ return false;
+ return true;
+}
+
+void CChannel::SetCaids(char *caids)
+{
+ m_caids.clear();
+ std::string strCaids = caids;
+ size_t pos = strCaids.find("caids:");
+ if(pos == strCaids.npos)
+ return;
+
+ strCaids.erase(0,6);
+ std::string token;
+ int caid;
+ char *pend;
+ while ((pos = strCaids.find(";")) != strCaids.npos)
+ {
+ token = strCaids.substr(0, pos);
+ caid = strtol(token.c_str(), &pend, 10);
+ m_caids.push_back(caid);
+ strCaids.erase(0, pos+1);
+ }
+ if (strCaids.length() > 1)
+ {
+ caid = strtol(strCaids.c_str(), &pend, 10);
+ m_caids.push_back(caid);
+ }
+}
+
+CVNSIChannels::CVNSIChannels()
+{
+ m_loaded = false;
+ m_mode = NONE;
+ m_radio = false;
+}
+
+void CVNSIChannels::CreateProviders()
+{
+ std::vector<CChannel>::iterator c_it;
+ std::vector<CProvider>::iterator p_it;
+ CProvider provider;
+ m_providers.clear();
+ for (c_it=m_channels.begin(); c_it!=m_channels.end(); ++c_it)
+ {
+ provider.m_name = c_it->m_provider;
+ for(unsigned int i=0; i<c_it->m_caids.size(); i++)
+ {
+ provider.m_caid = c_it->m_caids[i];
+ p_it = std::find(m_providers.begin(), m_providers.end(), provider);
+ if (p_it == m_providers.end())
+ {
+ m_providers.push_back(provider);
+ }
+ }
+ if (c_it->m_caids.size() == 0)
+ {
+ provider.m_caid = 0;
+ p_it = std::find(m_providers.begin(), m_providers.end(), provider);
+ if (p_it == m_providers.end())
+ {
+ m_providers.push_back(provider);
+ }
+ }
+ }
+}
+
+void CVNSIChannels::LoadProviderWhitelist()
+{
+ std::vector<CProvider>::iterator p_it;
+
+ bool select = m_providerWhitelist.empty();
+ for(p_it=m_providers.begin(); p_it!=m_providers.end(); ++p_it)
+ {
+ p_it->m_whitelist = select;
+ }
+
+ std::vector<CProvider>::iterator w_it;
+ for(w_it=m_providerWhitelist.begin(); w_it!=m_providerWhitelist.end(); ++w_it)
+ {
+ p_it = std::find(m_providers.begin(), m_providers.end(), *w_it);
+ if(p_it != m_providers.end())
+ {
+ p_it->m_whitelist = true;
+ }
+ }
+}
+
+void CVNSIChannels::LoadChannelBlacklist()
+{
+ std::map<int, int>::iterator it;
+ for(unsigned int i=0; i<m_channelBlacklist.size(); i++)
+ {
+ it = m_channelsMap.find(m_channelBlacklist[i]);
+ if(it!=m_channelsMap.end())
+ {
+ int idx = it->second;
+ m_channels[idx].m_blacklist = true;
+ }
+ }
+}
+
+void CVNSIChannels::ExtractProviderWhitelist()
+{
+ std::vector<CProvider>::iterator it;
+ m_providerWhitelist.clear();
+ for(it=m_providers.begin(); it!=m_providers.end(); ++it)
+ {
+ if(it->m_whitelist)
+ m_providerWhitelist.push_back(*it);
+ }
+ if(m_providerWhitelist.size() == m_providers.size())
+ {
+ m_providerWhitelist.clear();
+ }
+ else if (m_providerWhitelist.size() == 0)
+ {
+ m_providerWhitelist.clear();
+ CProvider provider;
+ provider.m_name = "no whitelist";
+ provider.m_caid = 0;
+ m_providerWhitelist.push_back(provider);
+ }
+}
+
+void CVNSIChannels::ExtractChannelBlacklist()
+{
+ m_channelBlacklist.clear();
+ for(unsigned int i=0; i<m_channels.size(); i++)
+ {
+ if(m_channels[i].m_blacklist)
+ m_channelBlacklist.push_back(m_channels[i].m_id);
+ }
+}
+
+bool CVNSIChannels::IsWhitelist(CChannel &channel)
+{
+ CProvider provider;
+ std::vector<CProvider>::iterator p_it;
+ provider.m_name = channel.m_provider;
+ if (channel.m_caids.empty())
+ {
+ provider.m_caid = 0;
+ p_it = std::find(m_providers.begin(), m_providers.end(), provider);
+ if(p_it!=m_providers.end() && p_it->m_whitelist)
+ return true;
+ }
+ for(unsigned int i=0; i<channel.m_caids.size(); i++)
+ {
+ provider.m_caid = channel.m_caids[i];
+ p_it = std::find(m_providers.begin(), m_providers.end(), provider);
+ if(p_it!=m_providers.end() && p_it->m_whitelist)
+ return true;
+ }
+ return false;
+}
73 addons/pvr.vdr.vnsi/src/VNSIChannels.h
View
@@ -0,0 +1,73 @@
+#pragma once
+
+/*
+ * Copyright (C) 2005-2013 Team XBMC
+ * http://xbmc.org
+ *
+ * This Program 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, or (at your option)
+ * any later version.
+ *
+ * This Program 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 XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "VNSIData.h"
+
+class CProvider
+{
+public:
+ CProvider();
+ CProvider(std::string name, int caid);
+ bool operator==(const CProvider &rhs);
+ std::string m_name;
+ int m_caid;
+ bool m_whitelist;
+};
+
+class CChannel
+{
+public:
+ void SetCaids(char *caids);
+ unsigned int m_id;
+ unsigned int m_number;
+ std::string m_name;
+ std::string m_provider;
+ bool m_radio;
+ std::vector<int> m_caids;
+ bool m_blacklist;
+};
+
+class CVNSIChannels
+{
+public:
+ CVNSIChannels();
+ void CreateProviders();
+ void LoadProviderWhitelist();
+ void LoadChannelBlacklist();
+ void ExtractProviderWhitelist();
+ void ExtractChannelBlacklist();
+ bool IsWhitelist(CChannel &channel);
+ std::vector<CChannel> m_channels;
+ std::map<int, int> m_channelsMap;
+ std::vector<CProvider> m_providers;
+ std::vector<CProvider> m_providerWhitelist;
+ std::vector<int> m_channelBlacklist;
+ bool m_loaded;
+ bool m_radio;
+
+ enum
+ {
+ NONE,
+ PROVIDER,
+ CHANNEL
+ }m_mode;
+};
47 addons/pvr.vdr.vnsi/src/VNSIData.cpp
View
@@ -210,6 +210,11 @@ bool cVNSIData::GetChannelsList(ADDON_HANDLE handle, bool radio)
XBMC->Log(LOG_ERROR, "%s - Can't add parameter to cRequestPacket", __FUNCTION__);
return false;
}
+ if (!vrp.add_U8(1)) // apply filter
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't add parameter to cRequestPacket", __FUNCTION__);
+ return false;
+ }
cResponsePacket* vresp = ReadResult(&vrp);
if (!vresp)
@@ -224,16 +229,18 @@ bool cVNSIData::GetChannelsList(ADDON_HANDLE handle, bool radio)
memset(&tag, 0 , sizeof(tag));
tag.iChannelNumber = vresp->extract_U32();
- char *strChannelName = vresp->extract_String();
+ char *strChannelName = vresp->extract_String();
strncpy(tag.strChannelName, strChannelName, sizeof(tag.strChannelName) - 1);
+ char *strProviderName = vresp->extract_String();
tag.iUniqueId = vresp->extract_U32();
- vresp->extract_U32(); // still here for compatibility
tag.iEncryptionSystem = vresp->extract_U32();
- vresp->extract_U32(); // uint32_t vtype - currently unused
+ char *strCaids = vresp->extract_String();
tag.bIsRadio = radio;
PVR->TransferChannelEntry(handle, &tag);
delete[] strChannelName;
+ delete[] strProviderName;
+ delete[] strCaids;
}
delete vresp;
@@ -744,6 +751,39 @@ PVR_ERROR cVNSIData::DeleteRecording(const PVR_RECORDING& recinfo)
return PVR_ERROR_NO_ERROR;
}
+PVR_ERROR cVNSIData::GetRecordingEdl(const PVR_RECORDING& recinfo, PVR_EDL_ENTRY edl[], int *size)
+{
+ cRequestPacket vrp;
+ if (!vrp.init(VNSI_RECORDINGS_GETEDL))
+ {
+ XBMC->Log(LOG_ERROR, "%s - Can't init cRequestPacket", __FUNCTION__);
+ return PVR_ERROR_UNKNOWN;
+ }
+
+ if (!vrp.add_U32(atoi(recinfo.strRecordingId)))
+ return PVR_ERROR_UNKNOWN;
+
+ cResponsePacket* vresp = ReadResult(&vrp);
+ if (vresp == NULL || vresp->noResponse())
+ {
+ delete vresp;
+ return PVR_ERROR_UNKNOWN;
+ }
+
+ *size = 0;
+ while (!vresp->end() && *size < PVR_ADDON_EDL_LENGTH)
+ {
+ edl[*size].start = vresp->extract_S64();
+ edl[*size].end = vresp->extract_S64();
+ edl[*size].type = (PVR_EDL_TYPE)vresp->extract_S32();
+ (*size)++;
+ }
+
+ delete vresp;
+
+ return PVR_ERROR_NO_ERROR;
+}
+
bool cVNSIData::OnResponsePacket(cResponsePacket* pkt)
{
return false;
@@ -934,6 +974,7 @@ bool cVNSIData::GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GR
vrp.add_String(group.strGroupName);
vrp.add_U8(group.bIsRadio);
+ vrp.add_U8(1); // filter channels
cResponsePacket* vresp = ReadResult(&vrp);
if (vresp == NULL || vresp->noResponse())
1  addons/pvr.vdr.vnsi/src/VNSIData.h
View
@@ -63,6 +63,7 @@ class cVNSIData : public cVNSISession, public PLATFORM::CThread
PVR_ERROR GetRecordingsList(ADDON_HANDLE handle);
PVR_ERROR RenameRecording(const PVR_RECORDING& recinfo, const char* newname);
PVR_ERROR DeleteRecording(const PVR_RECORDING& recinfo);
+ PVR_ERROR GetRecordingEdl(const PVR_RECORDING& recinfo, PVR_EDL_ENTRY edl[], int *size);
cResponsePacket* ReadResult(cRequestPacket* vrp);
31 addons/pvr.vdr.vnsi/src/VNSIDemux.cpp
View
@@ -121,6 +121,10 @@ DemuxPacket* cVNSIDemux::Read()
p->iStreamId = iStreamId;
delete resp;
+ if (p->dts != DVD_NOPTS_VALUE)
+ m_CurrentDTS = p->dts;
+ else if (p->pts != DVD_NOPTS_VALUE)
+ m_CurrentDTS = p->pts;
return p;
}
else if (iStreamId != -1 && resp->getMuxSerial() != m_MuxPacketSerial)
@@ -136,6 +140,13 @@ DemuxPacket* cVNSIDemux::Read()
else if (resp->getOpCodeID() == VNSI_STREAM_BUFFERSTATS)
{
m_bTimeshift = resp->extract_U8();
+ m_BufferTimeStart = resp->extract_U32();
+ m_BufferTimeEnd = resp->extract_U32();
+ }
+ else if (resp->getOpCodeID() == VNSI_STREAM_REFTIME)
+ {
+ m_ReferenceTime = resp->extract_U32();
+ m_ReferenceDTS = (double)resp->extract_U64() * DVD_TIME_BASE / 1000000;
}
delete resp;
@@ -210,6 +221,9 @@ bool cVNSIDemux::SwitchChannel(const PVR_CHANNEL &channelinfo)
m_channelinfo = channelinfo;
m_streams.Clear();
m_MuxPacketSerial = 0;
+ m_ReferenceTime = 0;
+ m_BufferTimeStart = 0;
+ m_BufferTimeEnd = 0;
return true;
}
@@ -232,6 +246,23 @@ bool cVNSIDemux::GetSignalStatus(PVR_SIGNAL_STATUS &qualityinfo)
return true;
}
+time_t cVNSIDemux::GetPlayingTime()
+{
+ time_t ret;
+ ret = m_ReferenceTime + (m_CurrentDTS - m_ReferenceDTS) / DVD_TIME_BASE;
+ return ret;
+}
+
+time_t cVNSIDemux::GetBufferTimeStart()
+{
+ return m_BufferTimeStart;
+}
+
+time_t cVNSIDemux::GetBufferTimeEnd()
+{
+ return m_BufferTimeEnd;
+}
+
void cVNSIDemux::StreamChange(cResponsePacket *resp)
{
std::vector<PVR_STREAM_PROPERTIES::PVR_STREAM> newStreams;
8 addons/pvr.vdr.vnsi/src/VNSIDemux.h
View
@@ -54,6 +54,9 @@ class cVNSIDemux : public cVNSISession
bool GetSignalStatus(PVR_SIGNAL_STATUS &qualityinfo);
bool IsTimeshift() { return m_bTimeshift; }
bool SeekTime(int time, bool backwards, double *startpts);
+ time_t GetPlayingTime();
+ time_t GetBufferTimeStart();
+ time_t GetBufferTimeEnd();
protected:
@@ -69,4 +72,9 @@ class cVNSIDemux : public cVNSISession
SQuality m_Quality;
bool m_bTimeshift;
uint32_t m_MuxPacketSerial;
+ time_t m_ReferenceTime;
+ double m_ReferenceDTS;
+ double m_CurrentDTS;
+ time_t m_BufferTimeStart;
+ time_t m_BufferTimeEnd;
};
38 addons/pvr.vdr.vnsi/src/client.cpp
View
@@ -355,6 +355,7 @@ PVR_ERROR GetAddonCapabilities(PVR_ADDON_CAPABILITIES* pCapabilities)
{
pCapabilities->bSupportsEPG = true;
pCapabilities->bSupportsRecordings = true;
+ pCapabilities->bSupportsRecordingEdl = true;
pCapabilities->bSupportsTimers = true;
pCapabilities->bSupportsTV = true;
pCapabilities->bSupportsRadio = true;
@@ -647,6 +648,30 @@ bool SeekTime(int time, bool backwards, double *startpts)
return ret;
}
+time_t GetPlayingTime()
+{
+ time_t time = 0;
+ if (VNSIDemuxer)
+ time = VNSIDemuxer->GetPlayingTime();
+ return time;
+}
+
+time_t GetBufferTimeStart()
+{
+ time_t time = 0;
+ if (VNSIDemuxer)
+ time = VNSIDemuxer->GetBufferTimeStart();
+ return time;
+}
+
+time_t GetBufferTimeEnd()
+{
+ time_t time = 0;
+ if (VNSIDemuxer)
+ time = VNSIDemuxer->GetBufferTimeEnd();
+ return time;
+}
+
void SetSpeed(int) {};
void PauseStream(bool bPaused) {}
@@ -706,6 +731,15 @@ long long LengthRecordedStream(void)
return 0;
}
+PVR_ERROR GetRecordingEdl(const PVR_RECORDING& recinfo, PVR_EDL_ENTRY edl[], int *size)
+{
+ if(!VNSIData)
+ return PVR_ERROR_UNKNOWN;
+
+ return VNSIData->GetRecordingEdl(recinfo, edl, size);
+}
+
+
/*******************************************/
/** PVR Menu Hook Functions **/
@@ -735,9 +769,5 @@ const char * GetLiveStreamURL(const PVR_CHANNEL &channel) { return ""; }
PVR_ERROR SetRecordingPlayCount(const PVR_RECORDING &recording, int count) { return PVR_ERROR_NOT_IMPLEMENTED; }
PVR_ERROR SetRecordingLastPlayedPosition(const PVR_RECORDING &recording, int lastplayedposition) { return PVR_ERROR_NOT_IMPLEMENTED; }
int GetRecordingLastPlayedPosition(const PVR_RECORDING &recording) { return -1; }
-PVR_ERROR GetRecordingEdl(const PVR_RECORDING&, PVR_EDL_ENTRY[], int*) { return PVR_ERROR_NOT_IMPLEMENTED; };
unsigned int GetChannelSwitchDelay(void) { return 0; }
-time_t GetPlayingTime() { return 0; }
-time_t GetBufferTimeStart() { return 0; }
-time_t GetBufferTimeEnd() { return 0; }
}
9 addons/pvr.vdr.vnsi/src/vnsicommand.h
View
@@ -23,7 +23,7 @@
#define VNSI_COMMAND_H
/** Current VNSI Protocol Version number */
-#define VNSI_PROTOCOLVERSION 4
+#define VNSI_PROTOCOLVERSION 5
/** Packet types */
#define VNSI_CHANNEL_REQUEST_RESPONSE 1
@@ -68,6 +68,11 @@
#define VNSI_CHANNELGROUP_GETCOUNT 65
#define VNSI_CHANNELGROUP_LIST 66
#define VNSI_CHANNELGROUP_MEMBERS 67
+#define VNSI_CHANNELS_GETCAIDS 68
+#define VNSI_CHANNELS_GETWHITELIST 69
+#define VNSI_CHANNELS_GETBLACKLIST 70
+#define VNSI_CHANNELS_SETWHITELIST 71
+#define VNSI_CHANNELS_SETBLACKLIST 72
/* OPCODE 80 - 99: VNSI network functions for timer access */
#define VNSI_TIMER_GETCOUNT 80
@@ -83,6 +88,7 @@
#define VNSI_RECORDINGS_GETLIST 102
#define VNSI_RECORDINGS_RENAME 103
#define VNSI_RECORDINGS_DELETE 104
+#define VNSI_RECORDINGS_GETEDL 105
/* OPCODE 120 - 139: VNSI network functions for epg access and manipulating */
#define VNSI_EPG_GETFORCHANNEL 120
@@ -107,6 +113,7 @@
#define VNSI_STREAM_SIGNALINFO 5
#define VNSI_STREAM_CONTENTINFO 6
#define VNSI_STREAM_BUFFERSTATS 7
+#define VNSI_STREAM_REFTIME 8
/** Scan packet types (server -> client) */
#define VNSI_SCANNER_PERCENTAGE 1
9 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/HISTORY
View
@@ -12,3 +12,12 @@ VDR Plugin 'vnsiserver' Revision History
- proper handling of PMT changes
- suffix plugin with version of protocol: vnsiserver3
- this version is compatible with XBMC 12.0
+
+2013-12-04: Version 0.9.3
+
+- add support for EDL (marks)
+- add channel filter
+- send buffer times for timeshift
+- bump protocol to XBMC to 5
+- suffix plugin with version of protocol: vnsiserver5
+- this version is compatible with XBMC 13
4 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/Makefile
View
@@ -7,7 +7,7 @@
# This name will be used in the '-P...' option of VDR to load the plugin.
# By default the main source file also carries this name.
-PLUGIN = vnsiserver4
+PLUGIN = vnsiserver5
### The version number of this plugin (taken from the main source file):
@@ -90,7 +90,7 @@ OBJS = vnsi.o bitstream.o vnsiclient.o config.o cxsocket.o parser.o parser_AAC.o
parser_AC3.o parser_DTS.o parser_h264.o parser_MPEGAudio.o parser_MPEGVideo.o \
parser_Subtitle.o parser_Teletext.o streamer.o recplayer.o requestpacket.o responsepacket.o \
vnsiserver.o hash.o recordingscache.o setup.o vnsiosd.o demuxer.o videobuffer.o \
- videoinput.o
+ videoinput.o channelfilter.o
### The main target:
332 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/channelfilter.c
View
@@ -0,0 +1,332 @@
+/*
+ * Copyright (C) 2005-2013 Team XBMC
+ * http://xbmc.org
+ *
+ * This Program 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, or (at your option)
+ * any later version.
+ *
+ * This Program 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 XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "channelfilter.h"
+#include "config.h"
+#include "hash.h"
+#include <string>
+#include <algorithm>
+#include <iostream>
+#include <fstream>
+#include <vdr/tools.h>
+
+cVNSIProvider::cVNSIProvider()
+ :m_name(""), m_caid(0)
+{
+
+}
+
+cVNSIProvider::cVNSIProvider(std::string name, int caid)
+ :m_name(name), m_caid(caid)
+{
+};
+
+bool cVNSIProvider::operator==(const cVNSIProvider &rhs)
+{
+ if (rhs.m_caid != m_caid)
+ return false;
+ if (rhs.m_name.compare(m_name) != 0)
+ return false;
+ return true;
+}
+
+
+bool cVNSIChannelFilter::IsRadio(const cChannel* channel)
+{
+ bool isRadio = false;
+
+ // assume channels without VPID & APID are video channels
+ if (channel->Vpid() == 0 && channel->Apid(0) == 0)
+ isRadio = false;
+ // channels without VPID are radio channels (channels with VPID 1 are encrypted radio channels)
+ else if (channel->Vpid() == 0 || channel->Vpid() == 1)
+ isRadio = true;
+
+ return isRadio;
+}
+
+void cVNSIChannelFilter::Load()
+{
+ cMutexLock lock(&m_Mutex);
+
+ cString filename;
+ std::string line;
+ std::ifstream rfile;
+ cVNSIProvider provider;
+ std::vector<cVNSIProvider>::iterator p_it;
+
+ filename = cString::sprintf("%s/videowhitelist.vnsi", *VNSIServerConfig.ConfigDirectory);
+ m_providersVideo.clear();
+ rfile.open(filename);
+ if (rfile.is_open())
+ {
+ while(std::getline(rfile,line))
+ {
+ size_t pos = line.find("|");
+ if(pos == line.npos)
+ {
+ provider.m_name = line;
+ provider.m_caid = 0;
+ }
+ else
+ {
+ provider.m_name = line.substr(0, pos);
+ std::string tmp = line.substr(pos+1);
+ char *pend;
+ provider.m_caid = strtol(tmp.c_str(), &pend, 10);
+ }
+ p_it = std::find(m_providersVideo.begin(), m_providersVideo.end(), provider);
+ if(p_it == m_providersVideo.end())
+ {
+ m_providersVideo.push_back(provider);
+ }
+ }
+ rfile.close();
+ }
+
+ filename = cString::sprintf("%s/radiowhitelist.vnsi", *VNSIServerConfig.ConfigDirectory);
+ rfile.open(filename);
+ m_providersRadio.clear();
+ if (rfile.is_open())
+ {
+ while(std::getline(rfile,line))
+ {
+ unsigned int pos = line.find("|");
+ if(pos == line.npos)
+ {
+ provider.m_name = line;
+ provider.m_caid = 0;
+ }
+ else
+ {
+ provider.m_name = line.substr(0, pos);
+ std::string tmp = line.substr(pos+1);
+ char *pend;
+ provider.m_caid = strtol(tmp.c_str(), &pend, 10);
+ }
+ p_it = std::find(m_providersRadio.begin(), m_providersRadio.end(), provider);
+ if(p_it == m_providersRadio.end())
+ {
+ m_providersRadio.push_back(provider);
+ }
+ }
+ rfile.close();
+ }
+
+ filename = cString::sprintf("%s/videoblacklist.vnsi", *VNSIServerConfig.ConfigDirectory);
+ rfile.open(filename);
+ m_channelsVideo.clear();
+ if (rfile.is_open())
+ {
+ while(getline(rfile,line))
+ {
+ char *pend;
+ int id = strtol(line.c_str(), &pend, 10);
+ m_channelsVideo.push_back(id);
+ }
+ rfile.close();
+ }
+
+ filename = cString::sprintf("%s/radioblacklist.vnsi", *VNSIServerConfig.ConfigDirectory);
+ rfile.open(filename);
+ m_channelsRadio.clear();
+ if (rfile.is_open())
+ {
+ while(getline(rfile,line))
+ {
+ char *pend;
+ int id = strtol(line.c_str(), &pend, 10);
+ m_channelsRadio.push_back(id);
+ }
+ rfile.close();
+ }
+}
+
+void cVNSIChannelFilter::StoreWhitelist(bool radio)
+{
+ cMutexLock lock(&m_Mutex);