Source for file Settings.class.php

Documentation is available at Settings.class.php

  1. <?php
  2.  
  3. class Settings {
  4.  
  5. /**
  6. * Set the name of the dreambox
  7. * @access private
  8. * @var string
  9. */
  10. private static $dreamboxName = "Yoshie's Dreambox";
  11.  
  12. /**
  13. * Set the local IP address of your dreambox. Should be an internal IP number.
  14. * @access private
  15. * @var string
  16. */
  17. private static $dreamboxIP = "192.168.5.11";
  18.  
  19. /**
  20. * Set the username for the dreambox webinterface. Leave empty when no authentication is required.
  21. * @access private
  22. * @var string
  23. */
  24. private static $dreamboxUserName = "";
  25.  
  26. /**
  27. * Set the password for the dreambox webinterface. Leave empty when no authentication is required.
  28. * @access private
  29. * @var string
  30. */
  31. private static $dreamboxPassword = "";
  32.  
  33. /**
  34. * Set the enigma version of the dreambox. Valid values are enigma1 of enigma2
  35. * @access private
  36. * @var string
  37. */
  38. private static $dreamboxEnigmaVersion = "enigma2";
  39.  
  40. /**
  41. * Set the streaming protocol. This is the protocal between the VLC server and the dreambox
  42. * @access private
  43. * @var string
  44. */
  45. private static $streamProtocol = "http";
  46.  
  47. /**
  48. * Set the local IP address of the VLS Server. Should be internal
  49. * @access private
  50. * @var string
  51. */
  52. private static $vlcLanIP = "192.168.5.1";
  53.  
  54. /**
  55. * Set the the internal port number for streaming.
  56. * @access private
  57. * @var string
  58. */
  59. private static $vlcLanStreamPort = "8888";
  60.  
  61. /**
  62. * Set the RSTP port number.
  63. * @access private
  64. * @var string
  65. */
  66. private static $vlcRTSPControlPort = "8889";
  67.  
  68. /**
  69. * Set the external IP or hostname for external connections to the VLC Server
  70. * @access private
  71. * @var string
  72. */
  73. private static $vlcWanIP = "theyosh.nl";
  74.  
  75. /**
  76. * Set the the external port number for streaming.
  77. * @access private
  78. * @var string
  79. */
  80. private static $vlcWanStreamPort = "8888";
  81.  
  82. /**
  83. * Set the the program name. Should not be changed
  84. * @access private
  85. * @var string
  86. */
  87. private static $lProgramName = "Dreambox ReStream";
  88.  
  89. /**
  90. * Set the program version. Should not be changed
  91. * @access private
  92. * @var string
  93. */
  94. private static $lVersion = "1.4";
  95.  
  96. /**
  97. * Set the location of the VLC server executable on a Linux system
  98. * You can leave it empty if you use a Windows server
  99. * @access private
  100. * @var string
  101. */
  102. private static $lVLCLocationLinux = "/usr/bin/vlc";
  103.  
  104. /**
  105. * Set true to enable Flash H.264 streaming through a wowza server
  106. * @access private
  107. * @var boolean
  108. */
  109. private static $lWowza = true;
  110.  
  111. /**
  112. * Check if Wowza is supported. Returns true when Wowza is enabled, and therefore show a rtmp transport option that uses Wowza
  113. * @return boolean
  114. */
  115. static public function getWowzaEnabled() {
  116. return Settings::$lWowza;
  117. }
  118.  
  119. /**
  120. * Set the location of the VLC server settings file. The file will be placed on the www folder. So the webserver should have rights to write in its own webn folder
  121. * @access private
  122. * @var string
  123. */
  124. private static $lVLCSettingsFile = "settings.vlc.server";
  125.  
  126. /**
  127. * Returns the VLC server settings location.
  128. * @return string
  129. */
  130. public function getVLCSettingsFile() {
  131. return trim(Settings::$lVLCSettingsFile);
  132. }
  133. /**
  134. * Set the location of the VLC server executable on a Windows system
  135. * You can leave it empty if you use a Linux server
  136. * Pay atention on the / instead of windows normal \
  137. * @access private
  138. * @var string
  139. */
  140. private static $lVLCLocationWindows = "C:/Progra~1/VideoLAN/VLC/vlc.exe";
  141.  
  142. /**
  143. * Return the VLC executable based on OS type.
  144. * If param is 0, the system is Linux based
  145. * If param is 1, the system is Windows based
  146. * @return string
  147. */
  148. static public function getVLCLocation($pOSType = 0) {
  149. switch ($pOSType) {
  150. case 0:
  151. return Settings::$lVLCLocationLinux;
  152. break;
  153. case 1:
  154. return Settings::$lVLCLocationWindows;
  155. break;
  156. }
  157. }
  158.  
  159. /**
  160. * Set this value to enable the ggrab program. This is only available on windows.
  161. * Leave it blank to disable it.
  162. * @access private
  163. * @var string
  164. */
  165. private static $lGgrabLocationWindows = "";
  166. #private static $lGgrabLocationWindows = "C:/ggrab/ggrab.exe";
  167.  
  168.  
  169. /**
  170. * Returns the location of ggrab program. When empty, ggrab is disabled.
  171. * @return string
  172. */
  173. static public function getGgrabLocation() {
  174. return trim(Settings::$lGgrabLocationWindows);
  175. }
  176.  
  177. /**
  178. * Get the next program from the program guide.
  179. * @return string
  180. */
  181. static public function getDreamboxName() {
  182. return Settings::$dreamboxName;
  183. }
  184.  
  185. /**
  186. * Get the IP number of the dreambox.
  187. * @return string
  188. */
  189. static public function getDreamboxIP() {
  190. return Settings::$dreamboxIP;
  191. }
  192.  
  193. /**
  194. * Get the username of the dreambox.
  195. * @return string
  196. */
  197. static public function getDreamboxUserName() {
  198. return Settings::$dreamboxUserName;
  199. }
  200.  
  201. /**
  202. * Get the password of the dreambox.
  203. * @return string
  204. */
  205. static public function getDreamboxPassword() {
  206. return Settings::$dreamboxPassword;
  207. }
  208.  
  209. /**
  210. * Get the enigma version of the dreambox.
  211. * @return string
  212. */
  213. static public function getEnigmaVersion() {
  214. return Settings::$dreamboxEnigmaVersion;
  215. }
  216.  
  217. /**
  218. * Get the streaming protocol of the dreambox.
  219. * @return string
  220. */
  221. static public function getStreamProtocol() {
  222. return Settings::$streamProtocol;
  223. }
  224.  
  225. /**
  226. * Get the VLC Server internal IP number.
  227. * @return string
  228. */
  229. static public function getVLCLanIP() {
  230. return Settings::$vlcLanIP;
  231. }
  232.  
  233. /**
  234. * Get the internal streaming port of the VLC Server.
  235. * @return string
  236. */
  237. static public function getVLCStreamPort() {
  238. return Settings::$vlcLanStreamPort;
  239. }
  240.  
  241. /**
  242. * Get the RTPS Control port of the VLC Server.
  243. * @return string
  244. */
  245. static public function getVLCControlPort() {
  246. return Settings::$vlcRTSPControlPort;
  247. }
  248.  
  249. /**
  250. * Get the external IP number of the VLC Server. When you connect from internal, you should get the internal IP number of the VLC Server
  251. * @return string
  252. */
  253. static public function getVLCWanIP() {
  254. $lServerAddress = explode(".",Settings::getVLCLanIP());
  255. $lClientAddress = explode(".",$_SERVER["REMOTE_ADDR"]);
  256. if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1" || ($lServerAddress[0] == $lClientAddress[0] && $lServerAddress[1] == $lClientAddress[1] && $lServerAddress[2] == $lClientAddress[2])) { // Lan connection
  257. return Settings::$vlcLanIP;
  258. } else { // Internet connection
  259. return Settings::$vlcWanIP;
  260. }
  261. }
  262.  
  263. /**
  264. * Get the external streaming port of the VLC Server.
  265. * @return string
  266. */
  267. static public function getVLCWanStreamPort() {
  268. return Settings::$vlcWanStreamPort;
  269. }
  270.  
  271. /**
  272. * Get the program name.
  273. * @return string
  274. */
  275. static public function getProgramName() {
  276. return Settings::$lProgramName;
  277. }
  278.  
  279. /**
  280. * Get the program version number.
  281. * @return string
  282. */
  283. static public function getVersionNumber() {
  284. return Settings::$lVersion;
  285. }
  286. }
  287. ?>

Documentation generated on Tue, 24 Jun 2008 18:59:37 +0200 by phpDocumentor 1.3.0RC3