using FSI.Lib.Guis.WebRadio.Player;
using FSI.Lib.Guis.WebRadio.Player.SoundEngine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace FSI.Lib.Guis.WebRadio
{
    /// <summary>
    /// Interaktionslogik für frmMain.xaml
    /// </summary>
    public partial class FrmMain : Window
    {
        private RadioPlayer _radioPlayer;

        private ViewModel ViewModel { get; set; }
        public bool CloseAtLostFocus { get; set; }
        public IEnumerable<IInterface> InputData { get; set; }

       
        public FrmMain()
        {
            InitializeComponent();

            _radioPlayer = new RadioPlayer(new NAudioSoundEngine());
      
            
            Loaded += Main_Loaded;
            Deactivated += FrmMain_Deactivated;
        }

        private void FrmMain_Deactivated(object sender, System.EventArgs e)
        {
            if (CloseAtLostFocus)
                Visibility = Visibility.Hidden;
        }

        private void Main_Loaded(object sender, RoutedEventArgs e)
        {
            Title = "FSI Webradio Player";
            Title += " v" + Assembly.GetExecutingAssembly().GetName().Version; // Version in Titel eintragen

            _radioPlayer.Run();
            _radioPlayer.StationManager.Stations = InputData
        }
    }
}
