public RequestSongDialog(ISongChooser songChooser)
            : base(nameof(RequestSongDialog))
        {
            _songChooser = songChooser;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                ArtistStepAsync,
                TitleStepAsync,
                ConfirmStepAsync,
                FinalStepAsync,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #2
0
        // Dependency injection uses this constructor to instantiate MainDialog
        public MainDialog(UserCommandRecognizer luisCommandRecognizer, UserQuestionRecognizer luisQuestionRecognizer, RequestSongDialog requestSongDialog, ILogger <MainDialog> logger,
                          ISongChooser songChooser, IPlayer musicPlayer)
            : base(nameof(MainDialog))
        {
            _luisCommandRecognizer  = luisCommandRecognizer;
            _luisQuestionRecognizer = luisQuestionRecognizer;
            Logger       = logger;
            _songChooser = songChooser;
            _musicPlayer = musicPlayer;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(requestSongDialog);
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroStepAsync,
                ActStepAsync,
                FinalStepAsync,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VoiceMiddleware"/> class.
 /// </summary>
 public VoiceMiddleware(UserState userState, IPlayer player, ISongChooser songChooser)
 {
     _player      = player;
     _songChooser = songChooser;
 }
Exemple #4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IConfiguration configuration, DatabaseConnector databaseConnector, ISongChooser songChooser)
        {
            databaseConnector.Setup(configuration["SongDatabase:Server"], configuration["SongDatabase:Database"],
                                    configuration["SongDatabase:User"], configuration["SongDatabase:Password"]);
            songChooser.SetDatabaseConnection(databaseConnector);

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseDefaultFiles()
            .UseStaticFiles()
            .UseWebSockets()
            .UseRouting()
            .UseAuthorization()
            .UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            // app.UseHttpsRedirection();
        }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VoiceMiddleware"/> class.
 /// </summary>
 public Translator(UserState userState, ISongChooser songChooser)
 {
     _songChooser = songChooser;
 }