public MainWindow()
        {
            InitializeComponent();
            AppPaths.ConfigureFFmpegPaths(this);

            playManager.StartPlaying += PlayManager_StartPlaying;
            FilesList.DataContext     = files;

            config = ConfigFile.Load();
            if (config.Width > 0)
            {
                this.Width = config.Width;
            }
            if (config.Height > 0)
            {
                this.Height = config.Height;
            }
            PlaylistsList.DataContext = config.Playlists;
            if (config.Playlists.Count == 0)
            {
                AddPlaylistButton_Click(null, null);
            }

            Player.MediaPlayerInitialized += (s, e) => {
                Player.Host.Player.MediaUnloaded += Player_MediaUnloaded;
                Player.Host.Player.MediaFinished += Player_MediaFinished;
                if (config.Volume > 0 && config.Volume <= 100)
                {
                    Player.Host.Volume = config.Volume;
                }
            };
        }
Esempio n. 2
0
        public void Start(Window main, System.Drawing.Bitmap splashImage)
        {
            // Make sure to initialize Settings static constructor to initialize database path.
            var a = Settings.SavedFile;

            // Configure C# FFmpeg library.
            AppPaths.ConfigureFFmpegPaths(main);

            NaturalGroundingPlayer.MainWindow NgMain = main as NaturalGroundingPlayer.MainWindow;
            if (NgMain != null)
            {
                Menu         = (MenuControl)NgMain.MainMenuContainer.Content;
                Layers       = (LayersControl)NgMain.LayersContainer.Content;
                RatingViewer = (RatingViewerControl)NgMain.RatingViewerContainer.Content;
                Business     = new PlayerBusiness(GetNewPlayer());
            }
            Icon        = main.Icon;
            Main        = main;
            SplashImage = splashImage;

            main.Loaded  += Main_Loaded;
            main.Closing += Main_Closing;

            AppDomain.CurrentDomain.UnhandledException       += CurrentDomain_UnhandledException;
            main.Dispatcher.UnhandledException               += Dispatcher_UnhandledException;
            System.Windows.Forms.Application.ThreadException += Application_ThreadException; // MPC-HC API calls are done through WinForms.

            Windows = new WindowManager(main);
        }
Esempio n. 3
0
        public MainWindow()
        {
            Instance = this;
            // Don't let Yin Media Encoder run if there are FFmpeg processes running.
            if (MediaProcesses.GetFFmpegProcesses().Any())
            {
                if (MessageBox.Show("There are FFmpeg processes running. Would you like to stop them?\r\n\r\nTo avoid conflicts, please wait until these processes are finished before running Yin Media Encoder.", "FFmpeg Processes Running", MessageBoxButton.YesNo, MessageBoxImage.Exclamation, MessageBoxResult.No) == MessageBoxResult.Yes)
                {
                    foreach (Process item in MediaProcesses.GetFFmpegProcesses())
                    {
                        MediaProcesses.SoftKill(item);
                    }
                }
                if (MediaProcesses.GetFFmpegProcesses().Any())
                {
                    Application.Current.Shutdown();
                    return;
                }
            }

            InitializeComponent();
            // SessionCore.Instance.Start(this, Properties.Resources.AppIcon);
            helper = new WindowHelper(this);
            AppPaths.ConfigureFFmpegPaths(this);
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            AppPaths.ConfigureFFmpegPaths(this);

            GridInfo.Visibility      = Visibility.Hidden;
            DownloadsView.Visibility = Visibility.Hidden;
            DownloadUrl.Focus();
            DownloadsView.ItemsSource = Manager.DownloadsList;

            List <ListItem <int> > DownloadQualityList = new List <ListItem <int> >();

            DownloadQualityList.Add(new ListItem <int>("Max", 0));
            DownloadQualityList.Add(new ListItem <int>("1080p", 1080));
            DownloadQualityList.Add(new ListItem <int>("720p", 720));
            DownloadQualityList.Add(new ListItem <int>("480p", 480));
            DownloadQualityList.Add(new ListItem <int>("360p", 360));
            DownloadQualityList.Add(new ListItem <int>("240p", 240));
            MaxDownloadQualityCombo.ItemsSource   = DownloadQualityList;
            MaxDownloadQualityCombo.SelectedIndex = 0;

            SplashWindow F = SplashWindow.Instance(this, Properties.Resources.AppIcon);

            F.CanClose();
            F.ShowDialog();
        }
Esempio n. 5
0
        public MainWindow()
        {
            InitializeComponent();
            // helper = new WindowHelper(this);

            AppPaths.ConfigureFFmpegPaths(this);
        }
Esempio n. 6
0
        public MainWindow()
        {
            InitializeComponent();

            AppPaths.ConfigureFFmpegPaths(this);
            config = ConfigFile.Load();
            RefreshFiles();
            this.DataContext           = config;
            FoldersList.DataContext    = config.Folders;
            FilesList.DataContext      = config.Files;
            NowPlayingList.DataContext = config.Current.Files;
            VolumeSlider.DataContext   = config.Current;

            if (config.Width > 0)
            {
                this.Width = config.Width;
            }
            if (config.Height > 0)
            {
                this.Height = config.Height;
            }
            FoldersExpander_Collapsed(null, null);
        }