Esempio n. 1
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();
			}
		}
Esempio n. 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();
            }
        }
 /// <summary>
 /// Create service client
 /// </summary>
 /// <param name="httpClient"></param>
 /// <param name="client"></param>
 /// <param name="serviceUri"></param>
 /// <param name="serializer"></param>
 public PublisherServiceEvents(IHttpClient httpClient, ICallbackClient client,
                               string serviceUri, ISerializer serializer = null)
 {
     if (string.IsNullOrEmpty(serviceUri))
     {
         throw new ArgumentNullException(nameof(serviceUri),
                                         "Please configure the Url of the events micro service.");
     }
     _client     = client ?? throw new ArgumentNullException(nameof(client));
     _serviceUri = serviceUri;
     _serializer = serializer ?? new NewtonSoftJsonSerializer();
     _httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
 }
Esempio n. 4
0
 public MusicPlayer(
     ILogger logger, 
     IMusicProviderFactory musicProviderFactory, 
     IRickRollService rickRollService, 
     IDataService<QueuedTrack> queuedTrackDataService,
     IAlreadyQueuedHelper alreadyQueuedHelper, 
     ICallbackClient callbackClient,
     INowHelper nowHelper)
 {
     this.nowHelper = nowHelper;
     this.callbackClient = callbackClient;
     this.alreadyQueuedHelper = alreadyQueuedHelper;
     this.queuedTrackDataService = queuedTrackDataService;
     this.rickRollService = rickRollService;
     this.musicProviderFactory = musicProviderFactory;
     this.logger = logger;
     this.callbackClient = callbackClient;
 }
Esempio n. 5
0
 public MusicPlayer(
     ILogger logger,
     IMusicProviderFactory musicProviderFactory,
     IRickRollService rickRollService,
     IDataService <QueuedTrack> queuedTrackDataService,
     IAlreadyQueuedHelper alreadyQueuedHelper,
     ICallbackClient callbackClient,
     INowHelper nowHelper)
 {
     this.nowHelper              = nowHelper;
     this.callbackClient         = callbackClient;
     this.alreadyQueuedHelper    = alreadyQueuedHelper;
     this.queuedTrackDataService = queuedTrackDataService;
     this.rickRollService        = rickRollService;
     this.musicProviderFactory   = musicProviderFactory;
     this.logger         = logger;
     this.callbackClient = callbackClient;
 }
 /// <summary>
 /// Event client
 /// </summary>
 /// <param name="httpClient"></param>
 /// <param name="config"></param>
 /// <param name="serializer"></param>
 /// <param name="client"></param>
 public PublisherServiceEvents(IHttpClient httpClient, ICallbackClient client,
                               IEventsConfig config, ISerializer serializer) :
     this(httpClient, client, config?.OpcUaEventsServiceUrl, serializer)
 {
 }
Esempio n. 7
0
 /// <summary>
 /// Event client
 /// </summary>
 /// <param name="api"></param>
 /// <param name="client"></param>
 public PublisherServiceEvents(IPublisherServiceApi api, ICallbackClient client)
 {
     _api    = api ?? throw new ArgumentNullException(nameof(api));
     _client = client ?? throw new ArgumentNullException(nameof(client));
 }