コード例 #1
0
 public IEnumerable <MusicProviderDescriptor> GetActiveProviders()
 {
     return(musicProviderFactory.GetAllMusicProviders()
            .Where(p => p.IsEnabled)
            .OrderBy(p => p.Priority)
            .Select(p => p.Descriptor));
 }
コード例 #2
0
        public MusicService(ILogger logger,
                            IMusicProviderFactory musicProviderFactory,
                            IAutoPlay autoplayer,
                            IDataService <QueuedTrack> queuedTrackDataService,
                            IDataService <User> adminUserDataService,
                            ISearchSuggestionService searchSuggestionService,
                            IRickRollService rickRollService,
                            IBroadcastService broadcastService,
                            ISoundBoardService soundBoardService,
                            ISkipHelper skipHelper,
                            IVolume volume,
                            IQueueManager queueManager,
                            IAlreadyQueuedHelper alreadyQueuedHelper,
                            IMusicPlayer musicPlayer,
                            ICallbackClient callbackClient,
                            IUserService userService,
                            IVetoHelper vetoHelper,
                            IQueueRuleHelper queueRuleHelper,
                            ISettings settings,
                            ISearchRuleHelper searchRuleHelper
                            )
        {
            this.vetoHelper          = vetoHelper;
            this.callbackClient      = callbackClient;
            this.alreadyQueuedHelper = alreadyQueuedHelper;
            this.queueManager        = queueManager;
            this.broadcastService    = broadcastService;
            this.rickRollService     = rickRollService;
            this.logger = logger;
            this.musicProviderFactory    = musicProviderFactory;
            this.autoplayer              = autoplayer;
            this.queuedTrackDataService  = queuedTrackDataService;
            this.adminUserDataService    = adminUserDataService;
            this.searchSuggestionService = searchSuggestionService;
            this.soundBoardService       = soundBoardService;
            this.skipHelper              = skipHelper;
            this.volume          = volume;
            this.musicPlayer     = musicPlayer;
            this.callbackClient  = callbackClient;
            this.userService     = userService;
            this.queueRuleHelper = queueRuleHelper;
            this.settings        = settings;

            this.searchRuleHelper = searchRuleHelper;
            foreach (var provider in musicProviderFactory.GetAllMusicProviders())
            {
                provider.TrackEnded += musicProvider_TrackEnded;
            }

            if (settings.AutoStart)
            {
                PlayNextTrack();
            }
        }
コード例 #3
0
ファイル: MusicService.cs プロジェクト: Jc54/PlayMe
	    public MusicService(ILogger logger,
			IMusicProviderFactory musicProviderFactory,
			IAutoPlay autoplayer,
            IDataService<QueuedTrack> queuedTrackDataService,
			IDataService<User> adminUserDataService,
			ISearchSuggestionService searchSuggestionService,
			IRickRollService rickRollService,
			IBroadcastService broadcastService,
			ISoundBoardService soundBoardService,
            ISkipHelper skipHelper,
            IVolume volume,
            IQueueManager queueManager,
            IAlreadyQueuedHelper alreadyQueuedHelper,
            IMusicPlayer musicPlayer,
            ICallbackClient callbackClient,
            IUserService userService,
			IVetoHelper vetoHelper,
            IQueueRuleHelper queueRuleHelper,
            ISettings settings,
            ISearchRuleHelper searchRuleHelper
            )
		{
	        this.vetoHelper = vetoHelper;
	        this.callbackClient = callbackClient;
	        this.alreadyQueuedHelper = alreadyQueuedHelper;
	        this.queueManager = queueManager;
	        this.broadcastService = broadcastService;
			this.rickRollService = rickRollService;
			this.logger = logger;
			this.musicProviderFactory = musicProviderFactory;
			this.autoplayer = autoplayer;
			this.queuedTrackDataService = queuedTrackDataService;
			this.adminUserDataService = adminUserDataService;
			this.searchSuggestionService = searchSuggestionService;
			this.soundBoardService = soundBoardService;
			this.skipHelper = skipHelper;
            this.volume = volume;
            this.musicPlayer = musicPlayer;
	        this.callbackClient = callbackClient;
            this.userService = userService;            
            this.queueRuleHelper = queueRuleHelper;
	        this.settings = settings;

	        this.searchRuleHelper = searchRuleHelper;
	        foreach (var provider in musicProviderFactory.GetAllMusicProviders())
			{
				provider.TrackEnded += musicProvider_TrackEnded;        
			}

			if (settings.AutoStart)
			{
			    PlayNextTrack();
			}
		}