Kernel.cs 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. using MediaBrowser.Controller.Configuration;
  2. using MediaBrowser.Controller.Drawing;
  3. using MediaBrowser.Controller.Localization;
  4. using MediaBrowser.Controller.MediaInfo;
  5. using MediaBrowser.Controller.Providers;
  6. using MediaBrowser.Controller.Weather;
  7. using System.Collections.Generic;
  8. namespace MediaBrowser.Controller
  9. {
  10. /// <summary>
  11. /// Class Kernel
  12. /// </summary>
  13. public class Kernel
  14. {
  15. /// <summary>
  16. /// Gets the instance.
  17. /// </summary>
  18. /// <value>The instance.</value>
  19. public static Kernel Instance { get; private set; }
  20. /// <summary>
  21. /// Gets the image manager.
  22. /// </summary>
  23. /// <value>The image manager.</value>
  24. public ImageManager ImageManager { get; set; }
  25. /// <summary>
  26. /// Gets the FFMPEG controller.
  27. /// </summary>
  28. /// <value>The FFMPEG controller.</value>
  29. public FFMpegManager FFMpegManager { get; set; }
  30. /// <summary>
  31. /// Gets the name of the web application that can be used for url building.
  32. /// All api urls will be of the form {protocol}://{host}:{port}/{appname}/...
  33. /// </summary>
  34. /// <value>The name of the web application.</value>
  35. public string WebApplicationName
  36. {
  37. get { return "mediabrowser"; }
  38. }
  39. /// <summary>
  40. /// Gets the HTTP server URL prefix.
  41. /// </summary>
  42. /// <value>The HTTP server URL prefix.</value>
  43. public virtual string HttpServerUrlPrefix
  44. {
  45. get
  46. {
  47. return "http://+:" + _configurationManager.Configuration.HttpServerPortNumber + "/" + WebApplicationName + "/";
  48. }
  49. }
  50. /// <summary>
  51. /// Gets the list of Localized string files
  52. /// </summary>
  53. /// <value>The string files.</value>
  54. public IEnumerable<LocalizedStringData> StringFiles { get; set; }
  55. /// <summary>
  56. /// Gets the list of currently registered weather prvoiders
  57. /// </summary>
  58. /// <value>The weather providers.</value>
  59. public IEnumerable<IWeatherProvider> WeatherProviders { get; set; }
  60. /// <summary>
  61. /// Gets the list of currently registered image processors
  62. /// Image processors are specialized metadata providers that run after the normal ones
  63. /// </summary>
  64. /// <value>The image enhancers.</value>
  65. public IEnumerable<IImageEnhancer> ImageEnhancers { get; set; }
  66. private readonly IServerConfigurationManager _configurationManager;
  67. /// <summary>
  68. /// Creates a kernel based on a Data path, which is akin to our current programdata path
  69. /// </summary>
  70. /// <param name="configurationManager">The configuration manager.</param>
  71. public Kernel(IServerConfigurationManager configurationManager)
  72. {
  73. Instance = this;
  74. _configurationManager = configurationManager;
  75. }
  76. }
  77. }