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 = "dreambox.theyosh.lan";
  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 = "root";
  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 = "dreambox";
  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.1 Beta";
  95.  
  96. /**
  97. * Set the location of the VLC server executable
  98. * @access private
  99. * @var string
  100. */
  101. private static $lVLCLocation = "/usr/bin/vlc";
  102.  
  103.  
  104. /**
  105. * Get the next program from the program guide.
  106. * @return string
  107. */
  108. static public function getVLCLocation() {
  109. return Settings::$lVLCLocation;
  110. }
  111.  
  112. /**
  113. * Get the next program from the program guide.
  114. * @return string
  115. */
  116. static public function getDreamboxName() {
  117. return Settings::$dreamboxName;
  118. }
  119.  
  120. /**
  121. * Get the IP number of the dreambox.
  122. * @return string
  123. */
  124. static public function getDreamboxIP() {
  125. return Settings::$dreamboxIP;
  126. }
  127.  
  128. /**
  129. * Get the username of the dreambox.
  130. * @return string
  131. */
  132. static public function getDreamboxUserName() {
  133. return Settings::$dreamboxUserName;
  134. }
  135.  
  136. /**
  137. * Get the password of the dreambox.
  138. * @return string
  139. */
  140. static public function getDreamboxPassword() {
  141. return Settings::$dreamboxPassword;
  142. }
  143.  
  144. /**
  145. * Get the enigma version of the dreambox.
  146. * @return string
  147. */
  148. static public function getEnigmaVersion() {
  149. return Settings::$dreamboxEnigmaVersion;
  150. }
  151.  
  152. /**
  153. * Get the streaming protocol of the dreambox.
  154. * @return string
  155. */
  156. static public function getStreamProtocol() {
  157. return Settings::$streamProtocol;
  158. }
  159.  
  160. /**
  161. * Get the VLC Server internal IP number.
  162. * @return string
  163. */
  164. static public function getVLCLanIP() {
  165. return Settings::$vlcLanIP;
  166. }
  167.  
  168. /**
  169. * Get the internal streaming port of the VLC Server.
  170. * @return string
  171. */
  172. static public function getVLCStreamPort() {
  173. return Settings::$vlcLanStreamPort;
  174. }
  175.  
  176. /**
  177. * Get the RTPS Control port of the VLC Server.
  178. * @return string
  179. */
  180. static public function getVLCControlPort() {
  181. return Settings::$vlcRTSPControlPort;
  182. }
  183.  
  184. /**
  185. * 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
  186. * @return string
  187. */
  188. static public function getVLCWanIP() {
  189. $lServerAddress = explode(".",Settings::getVLCLanIP());
  190. $lClientAddress = explode(".",$_SERVER["REMOTE_ADDR"]);
  191. if ($lServerAddress[0] == $lClientAddress[0] && $lServerAddress[1] == $lClientAddress[1] && $lServerAddress[2] == $lClientAddress[2]) { // Lan connection
  192. return Settings::$vlcLanIP;
  193. } else { // Internet connection
  194. return Settings::$vlcWanIP;
  195. }
  196. }
  197.  
  198. /**
  199. * Get the external streaming port of the VLC Server.
  200. * @return string
  201. */
  202. static public function getVLCWanStreamPort() {
  203. return Settings::$vlcWanStreamPort;
  204. }
  205.  
  206. /**
  207. * Get the program name.
  208. * @return string
  209. */
  210. static public function getProgramName() {
  211. return Settings::$lProgramName;
  212. }
  213.  
  214. /**
  215. * Get the program version number.
  216. * @return string
  217. */
  218. static public function getVersionNumber() {
  219. return Settings::$lVersion;
  220. }
  221.  
  222. }
  223. ?>

Documentation generated on Sat, 19 Jan 2008 12:56:19 +0100 by phpDocumentor 1.3.0RC3