예제 #1
0
 public MediaInfo(YoutubeDLJSON JSON)
 {
     MainLog = Logger.Instance;
     JSONProvider = JSON;
     _HLSOutput = new Dictionary<string, string>();
     if (JSON != null)
     {
         QualityOptions = ListOfQualities(JSON.output);
     }
     else { QualityOptions.Add("Source"); }
     if(QualityOptions.Count == 0) { QualityOptions.Add("Source"); }
 }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();

            Logger MainLog = Logger.Instance;

            YoutubeDLJSON JSON = new YoutubeDLJSON();
            MediaInfo MediaI = new MediaInfo(JSON);
            MediaSetup MediaS = new MediaSetup();

            MediaOutput MediaOut = MediaOutput.Instance;
            MediaOut.MediaI = MediaI;
            MediaOut.MediaS = MediaS;

            DataContext = new
            {
                MainLog,
                MediaOut.MediaS,
                MediaOut.MediaI
            };

            CommandBinding SavePlayListCommand = new CommandBinding(
                ApplicationCommands.SaveAs,
                MediaOut.SavePlayList,
                MediaOut.CanSavePlaylist);
            CommandBindings.Add(SavePlayListCommand);

            CommandBinding LaunchMediaPlayerCommand = new CommandBinding(
                CustomCommands.LaunchMediaPlayerRoutedCommand,
                MediaOut.LaunchPlayer,
                MediaOut.CanLaunchPlayer);
            CommandBindings.Add(LaunchMediaPlayerCommand);

            CommandBinding RetrieveJSONFileCommand = new CommandBinding(
                CustomCommands.RetrieveJSONFileRoutedCommand,
                MediaOut.RetrieveJSONFile,
                MediaOut.CanRetrieveJSONFile);
            CommandBindings.Add(RetrieveJSONFileCommand);

            CommandBinding SetMediaPlayerLocationCommand = new CommandBinding(
                CustomCommands.SetMediaPlayerLocationRoutedCommand,
                MediaOut.SetMediaPlayerLocation,
                MediaOut.CanSetMediaPlayerLocation);
            CommandBindings.Add(SetMediaPlayerLocationCommand);

            buttonRetrieveURL.Command = CustomCommands.RetrieveJSONFileRoutedCommand;
            buttonRetrieveURL.IsEnabled = true;
            buttonMediaPlayerLoc.Command = CustomCommands.SetMediaPlayerLocationRoutedCommand;
            buttonInstanceLaunchPlayer.Command = CustomCommands.LaunchMediaPlayerRoutedCommand;
        }