/// <summary>
 /// Initializes a new instance of the <see cref="UnmanagedBitmapRenderer" /> class.
 /// </summary>
 /// <param name="threadManager">The thread manager.</param>
 /// <param name="dispatcher">The dispatcher.</param>
 public UnmanagedBitmapRenderer(IThreadManager threadManager, IDispatcher dispatcher)
     : base(threadManager)
 {
     threadManager.Guard("threadManager");
     dispatcher.Guard("dispatcher");
     this.dispatcher = dispatcher;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UnmanagedBitmapRenderer" /> class.
 /// </summary>
 /// <param name="threadManager">The thread manager.</param>
 /// <param name="dispatcher">The dispatcher.</param>
 public UnmanagedBitmapRenderer(IThreadManager threadManager, IDispatcher dispatcher)
     : base(threadManager)
 {
     threadManager.Guard("threadManager");
     dispatcher.Guard("dispatcher");
     this.dispatcher = dispatcher;
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlayerService" /> class.
 /// </summary>
 /// <param name="playlistService">The playlist service.</param>
 /// <param name="player">The player.</param>
 /// <param name="threadManager">The thread manager service.</param>
 /// <param name="publicTransport">The public transport.</param>
 /// <param name="configurationManager">The configuration manager.</param>
 /// <param name="hotkeyService">The hotkey service.</param>
 public PlayerService(IPlaylistService playlistService,
                      IAudioPlayer player,
                      IThreadManager threadManager,
                      IPublicTransport publicTransport,
                      IConfigurationManager configurationManager,
                      IGlobalHotkeyService hotkeyService)
     : base(playlistService, player, publicTransport, configurationManager, hotkeyService)
 {
     threadManager.Guard("threadManagerService");
     managerThread = threadManager.StartNew(Manage);
     tokenSource   = new CancellationTokenSource();
     token         = tokenSource.Token;
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnmanagedBitmapRenderer" /> class.
 /// </summary>
 /// <param name="threadManager">The thread manager.</param>
 /// <param name="dispatcher">The dispatcher.</param>
 /// <param name="pixelWidth">Width of the pixel.</param>
 /// <param name="pixelHeight">Height of the pixel.</param>
 public UnmanagedBitmapRenderer(IThreadManager threadManager, IDispatcher dispatcher, int pixelWidth, int pixelHeight)
     : base(threadManager)
 {
     threadManager.Guard("threadManager");
     dispatcher.Guard("dispatcher");
     this.dispatcher = dispatcher;
     if (0 >= pixelWidth)
     {
         pixelWidth = 1;
     }
     if (0 >= pixelHeight)
     {
         pixelHeight = 1;
     }
     proxy = new RenderProxy(pixelHeight, pixelWidth, pixelWidth * 4);
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlaylistService" /> class.
 /// </summary>
 /// <param name="publicTransport">The public transport.</param>
 /// <param name="referenceAdapters">The reference adapters.</param>
 /// <param name="threadManager">The thread manager.</param>
 /// <param name="configurationManager">The configuration manager.</param>
 /// <param name="fileAdapter"></param>
 public PlaylistService(IPublicTransport publicTransport,
                        IReferenceAdapters referenceAdapters,
                        IThreadManager threadManager,
                        IConfigurationManager configurationManager,
                        IDataAdapter <StorableTaggedFile> fileAdapter)
 {
     publicTransport.Guard("publicTransport");
     referenceAdapters.Guard("referenceAdapters");
     threadManager.Guard("threadManager");
     this.publicTransport   = publicTransport;
     this.referenceAdapters = referenceAdapters;
     this.threadManager     = threadManager;
     this.fileAdapter       = fileAdapter;
     playList = configurationManager.GetValue("Playlist.LastPlaylist", new Guid[0], KnownConfigSections.Hidden);
     LoadPlaylist(playList.Value);
     shuffleValue = configurationManager.GetValue("Playlist.Shuffle", false, KnownConfigSections.Hidden);
     shuffleValue.ValueChanged += ShuffleValueOnValueChanged;
     publicTransport.ApplicationEventBus.Subscribe <ShutdownEvent>(OnShutdown);
     SubscribeCommands();
 }
Example #6
0
 /// <summary>
 /// calls <see cref="ThreadedResultWorker{TArgs,TCompletedArgs}" />
 /// </summary>
 /// <param name="infoBuilder">The info builder.</param>
 /// <param name="storageAdapter">The storage adapter.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="configurationManager">The configuration manager.</param>
 /// <param name="threadManager">The thread manager service.</param>
 /// <param name="publicTransport">The public transport.</param>
 public RecursiveAsyncFileScanner(IInfoBuilder <TInfo> infoBuilder,
                                  IDataPersister <TInfo> storageAdapter,
                                  IConfigurationManager configurationManager,
                                  IThreadManager threadManager,
                                  IPublicTransport publicTransport,
                                  ILogger logger)
     : base(logger)
 {
     infoBuilder.Guard("infoBuilder");
     storageAdapter.Guard("storageAdapter");
     configurationManager.Guard("configurationManager");
     threadManager.Guard("threadManagerService");
     publicTransport.Guard("publicTransport");
     this.infoBuilder     = infoBuilder;
     this.storageAdapter  = storageAdapter;
     this.threadManager   = threadManager;
     this.publicTransport = publicTransport;
     pageSize             = configurationManager.GetValue("PageSize", 2000, "File Scanner");
     scanPaged            = configurationManager.GetValue("ScanPaged", true, "File Scanner");
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlaylistService" /> class.
 /// </summary>
 /// <param name="publicTransport">The public transport.</param>
 /// <param name="referenceAdapters">The reference adapters.</param>
 /// <param name="threadManager">The thread manager.</param>
 /// <param name="configurationManager">The configuration manager.</param>
 /// <param name="serializerService">The serializer service.</param>
 /// <param name="logger">The logger.</param>
 public PlaylistService(IPublicTransport publicTransport,
                        IReferenceAdapters referenceAdapters,
                        IThreadManager threadManager,
                        IConfigurationManager configurationManager,
                        ISerializerService serializerService,
                        ILogger logger)
     : base(logger)
 {
     publicTransport.Guard("publicTransport");
     referenceAdapters.Guard("referenceAdapters");
     threadManager.Guard("threadManager");
     serializerService.Guard("serializerService");
     logger.Guard("logger");
     this.publicTransport   = publicTransport;
     this.referenceAdapters = referenceAdapters;
     this.threadManager     = threadManager;
     this.logger            = logger;
     this.serializerService = serializerService;
     playlistRelPath        = configurationManager.GetValue("Playlist Relative Path", ".\\Playlist.bin");
     LoadPlaylist(playlistRelPath.Value);
     publicTransport.ApplicationEventBus.Subscribe <ShutdownEvent>(OnShutdown);
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RendererBase" /> class.
 /// </summary>
 /// <param name="threadManager">The thread manager.</param>
 protected RendererBase(IThreadManager threadManager)
 {
     threadManager.Guard("threadManager");
     this.threadManager = threadManager;
     RenderInterval     = TimeSpan.FromSeconds(1d / 60d);
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RendererBase" /> class.
 /// </summary>
 /// <param name="threadManager">The thread manager.</param>
 protected RendererBase(IThreadManager threadManager)
 {
     threadManager.Guard("threadManager");
     this.threadManager = threadManager;
     RenderInterval = TimeSpan.FromSeconds(1d/60d);
 }