Exemple #1
0
        private void btnNuevaListaVideos_Click(object sender, EventArgs e)
        {
            ControlBotonAñadorVideos();
            OpenFileDialog objOpenFileDialog = new OpenFileDialog();

            objOpenFileDialog.Multiselect = true;
            objOpenFileDialog.Filter      = "Seleccione videos|*.mp4";
            if (objOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                ListaVideos.Clear();
                for (int i = 0; i < objOpenFileDialog.FileNames.Length; i++)
                {
                    clVideos video = new clVideos();
                    metadatosVideo = TagLib.File.Create(objOpenFileDialog.FileNames[i]);
                    if (metadatosVideo.Tag.Title == null)
                    {
                        video.Nombre = "Sin nombre";
                    }
                    else
                    {
                        video.Nombre = metadatosVideo.Tag.Title;
                    }
                    if (metadatosVideo.Tag.FirstPerformer == null)
                    {
                        video.Artista = "Sin autor";
                    }
                    else
                    {
                        video.Artista = metadatosVideo.Tag.FirstPerformer;
                    }
                    video.Direcion = objOpenFileDialog.FileNames[i];
                    video.Duracion = metadatosVideo.Properties.Duration.ToString(@"hh\:mm\:ss");
                    ListaVideos.Add(video);
                }

                lbListadoVideos.Items.Clear();
                foreach (clVideos elemento in ListaVideos)
                {
                    lbListadoVideos.Items.Add(elemento.Nombre + " - " + elemento.Artista + " - " + elemento.Duracion);
                }
                btnPausar.Visible          = true;
                btnIniciarReanudar.Visible = false;
                wmpPantalla.URL            = ListaVideos[0].Direcion;
                if (lbListadoVideos.Items.Count > 0)
                {
                    btnBusca.Enabled = true;
                }
                lbListadoVideos.SelectedIndex = 0;
            }
        }
Exemple #2
0
        private void btnAñadorVideos_Click(object sender, EventArgs e)
        {
            OpenFileDialog objOpenFileDialog = new OpenFileDialog();

            objOpenFileDialog.Multiselect = true;
            objOpenFileDialog.Filter      = "Seleccione videos|*.mp4";
            if (objOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                indice = (objOpenFileDialog.FileNames.Length + lbListadoVideos.Items.Count);
                for (int i = lbListadoVideos.Items.Count; i < indice; i++)
                {
                    clVideos video = new clVideos();
                    metadatosVideo = TagLib.File.Create(objOpenFileDialog.FileNames[i - lbListadoVideos.Items.Count]);
                    if (metadatosVideo.Tag.Title == null)
                    {
                        video.Nombre = "Sin nombre";
                    }
                    else
                    {
                        video.Nombre = metadatosVideo.Tag.Title;
                    }
                    if (metadatosVideo.Tag.FirstPerformer == null)
                    {
                        video.Artista = "Sin autor";
                    }
                    else
                    {
                        video.Artista = metadatosVideo.Tag.FirstPerformer;
                    }
                    video.Direcion = objOpenFileDialog.FileNames[i - lbListadoVideos.Items.Count];
                    video.Duracion = metadatosVideo.Properties.Duration.ToString(@"hh\:mm\:ss");
                    ListaVideos.Add(video);
                }

                for (int i = lbListadoVideos.Items.Count; i < indice; i++)
                {
                    lbListadoVideos.Items.Add(ListaVideos[i].Nombre + " - " + ListaVideos[i].Artista + " - " + ListaVideos[i].Duracion);
                }
                btnPausar.Visible          = true;
                btnIniciarReanudar.Visible = false;
            }
        }