예제 #1
0
 public StartSongTask(
     ILoaderContext loaderContext, IPlayer player, ConfAudioVolume volumeConfig, object playManagerLock,
     QueueItem queueItem)
 {
     Id = Interlocked.Increment(ref _nextId);
     this.loaderContext   = loaderContext;
     this.player          = player;
     this.volumeConfig    = volumeConfig;
     this.playManagerLock = playManagerLock;
     QueueItem            = queueItem;
 }
예제 #2
0
        private static void TestSongAnalyzerExpectErrorMessage(QueueItem queueItem, ILoaderContext loaderContext, string message)
        {
            var volumeDetector = new VolumeDetectorMock();

            var task = new SongAnalyzerTask(queueItem, loaderContext, volumeDetector);

            var t   = Task.Run(() => task.Run(CancellationToken.None));
            var res = t.Result;

            Assert.IsFalse(res.Ok);
            Assert.AreSame(res.Error.Str, message);
        }
예제 #3
0
 /// <summary>
 /// 初始化一个<see cref="PdmLoader"/>类型的实例
 /// </summary>
 /// <param name="context">加载器上下文</param>
 public PdmLoader(ILoaderContext context)
 {
     _context = context;
 }
예제 #4
0
 public SongAnalyzerTask(QueueItem source, ILoaderContext loaderContext, IVolumeDetector volumeDetector)
 {
     Source         = source;
     VolumeDetector = volumeDetector;
     LoaderContext  = loaderContext;
 }