Example #1
0
        // load video from a folder
        public void loadVideoList()
        {
            string[] files = Directory.GetFiles(playFolder);
            gui.list_videos.Items.Clear();
            foreach (String file in files)
            {
                string ext = Path.GetExtension(file);
                if (!FolderCtrl.isValidFile(ext))
                {
                    continue;
                }
                videoUrls.Add(@file);

                string fn = Path.GetFileName(file);
                videoNames.Add(fn);
                gui.list_videos.Items.Add(fn);
            }
        }
Example #2
0
        public MainController(FormMain gui)
        {
            this.gui  = gui;
            this.auth = new Authentication(this);

            // Initialize variables
            videoUrls  = new List <string>();
            videoNames = new List <string>();
            dlt        = new List <Download>();

            // UI setting
            dlf        = new FormDownloadProgress(gui);
            dlf.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            dlcg       = new FormDownloadCG(dlf, this);


            // get default folder
            downloadFolder        = FolderCtrl.getDownloadDir();
            playFolder            = FolderCtrl.getVideoDir();
            gui.input_dwndir.Text = downloadFolder;

            // listing video
            loadVideoList();
        }