private void addPlayableToPlaylist()
 {
     axVLC.playlistClear();
     foreach (object tmp in lstPlayable.Items)
     {
         playableData tmpPlayable = (playableData)tmp;
         var          uri         = new Uri(tmpPlayable.getFilePath());
         axVLC.addTarget(uri.AbsoluteUri, null, AXVLC.VLCPlaylistMode.VLCPlayListAppend, -1);
     }
 }
        //Öffne Datei
        private void button1_Click(object sender, EventArgs e)
        {
            string         mrl       = String.Empty;
            OpenFileDialog theDialog = new OpenFileDialog();

            if (theDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                playableData tmp = new playableData(theDialog.FileName);
                lstPlayable.Items.Add(tmp);
                lstPlayable.SelectedItem = tmp;
            }
        }
        private void archiveTrack()
        {
            //Stop vlc
            axVLC.stop();

            //Copy then delete directory or file from download dir to archive dir
            playableData tmpData = (playableData)lstPlayable.SelectedItem;

            if (tmpData != null)
            {
                tmpData.archiveFile();
            }
            updatePlayable();
        }
        public void updatePlayable()
        {
            //Save selected to set after refresh
            object tmpSelectedItem = null;

            if (lstPlayable.SelectedItem != null)
            {
                tmpSelectedItem = lstPlayable.SelectedItem;
            }

            //For multiDirectories show just one playable not all single files, for this save the added rootDirs
            LinkedList <string> addedRootDirs = new LinkedList <string>();

            //Read all playable files in download directory
            String[] mkvFiles = System.IO.Directory.GetFiles(Properties.Settings.Default.DownloadDir, "*.mkv", System.IO.SearchOption.AllDirectories);
            String[] aviFiles = System.IO.Directory.GetFiles(Properties.Settings.Default.DownloadDir, "*.avi", System.IO.SearchOption.AllDirectories);
            lstPlayable.Items.Clear();

            foreach (String tmp in mkvFiles)
            {
                playableData tmpPlayable = new playableData(tmp);
                //Kleinere Dateien als 100MB ignorieren, dies sind sehr wahrscheinlich nur samples
                if (tmpPlayable.getFileSizeMb() >= 100)
                {
                    //Root dir handling, nur ein root dir hinzufügen bei multiDirs
                    if (tmpPlayable.getMultiDir())
                    {
                        if (!addedRootDirs.Contains(tmpPlayable.getRootDir()))
                        {
                            tmpPlayable.setIsRootDir(true);
                            addedRootDirs.AddLast(tmpPlayable.getRootDir());
                            lstPlayable.Items.Add((object)tmpPlayable);
                        }
                    }
                    else
                    {
                        lstPlayable.Items.Add((object)tmpPlayable);
                    }
                }
            }
            foreach (String tmp in aviFiles)
            {
                playableData tmpPlayable = new playableData(tmp);
                //Kleinere Dateien als 100MB ignorieren, dies sind sehr wahrscheinlich nur samples
                if (tmpPlayable.getFileSizeMb() >= 100)
                {
                    //Root dir handling, nur ein root dir hinzufügen bei multiDirs
                    if (tmpPlayable.getMultiDir())
                    {
                        if (!addedRootDirs.Contains(tmpPlayable.getRootDir()))
                        {
                            tmpPlayable.setIsRootDir(true);
                            addedRootDirs.AddLast(tmpPlayable.getRootDir());
                            lstPlayable.Items.Add((object)tmpPlayable);
                        }
                    }
                    else
                    {
                        lstPlayable.Items.Add((object)tmpPlayable);
                    }
                }
            }

            //Zweiten optionalen Ordner mit abprüfen
            if (Directory.Exists(Properties.Settings.Default.OptDir))
            {
                //Read all playable files in download directory
                String[] mkvFiles2 = System.IO.Directory.GetFiles(Properties.Settings.Default.OptDir, "*.mkv", System.IO.SearchOption.AllDirectories);
                String[] aviFiles2 = System.IO.Directory.GetFiles(Properties.Settings.Default.OptDir, "*.avi", System.IO.SearchOption.AllDirectories);

                foreach (String tmp in mkvFiles2)
                {
                    playableData tmpPlayable = new playableData(tmp);
                    //Kleinere Dateien als 100MB ignorieren, dies sind sehr wahrscheinlich nur samples
                    if (tmpPlayable.getFileSizeMb() >= 100)
                    {
                        //Root dir handling, nur ein root dir hinzufügen bei multiDirs
                        if (tmpPlayable.getMultiDir())
                        {
                            if (!addedRootDirs.Contains(tmpPlayable.getRootDir()))
                            {
                                tmpPlayable.setIsRootDir(true);
                                addedRootDirs.AddLast(tmpPlayable.getRootDir());
                                lstPlayable.Items.Add((object)tmpPlayable);
                            }
                        }
                        else
                        {
                            lstPlayable.Items.Add((object)tmpPlayable);
                        }
                    }
                }
                foreach (String tmp in aviFiles2)
                {
                    playableData tmpPlayable = new playableData(tmp);
                    //Kleinere Dateien als 100MB ignorieren, dies sind sehr wahrscheinlich nur samples
                    if (tmpPlayable.getFileSizeMb() >= 100)
                    {
                        //Root dir handling, nur ein root dir hinzufügen bei multiDirs
                        if (tmpPlayable.getMultiDir())
                        {
                            if (!addedRootDirs.Contains(tmpPlayable.getRootDir()))
                            {
                                tmpPlayable.setIsRootDir(true);
                                addedRootDirs.AddLast(tmpPlayable.getRootDir());
                                lstPlayable.Items.Add((object)tmpPlayable);
                            }
                        }
                        else
                        {
                            lstPlayable.Items.Add((object)tmpPlayable);
                        }
                    }
                }
            }

            lstPlayable.Refresh();

            //Set to one item
            if (tmpSelectedItem != null)
            {
                lstPlayable.SelectedItem = tmpSelectedItem;
            }
            else if (lstPlayable.Items.Count >= 1)
            {
                lstPlayable.SelectedIndex = 0;
            }
        }
        public void updatePlayable()
        {
            //Save selected to set after refresh
            object tmpSelectedItem = null;
            if (lstPlayable.SelectedItem != null)
            {
                tmpSelectedItem = lstPlayable.SelectedItem;
            }

            //For multiDirectories show just one playable not all single files, for this save the added rootDirs
            LinkedList<string> addedRootDirs = new LinkedList<string>();

            //Read all playable files in download directory
            String[] mkvFiles = System.IO.Directory.GetFiles(Properties.Settings.Default.DownloadDir, "*.mkv", System.IO.SearchOption.AllDirectories);
            String[] aviFiles = System.IO.Directory.GetFiles(Properties.Settings.Default.DownloadDir, "*.avi", System.IO.SearchOption.AllDirectories);
            lstPlayable.Items.Clear();

            foreach (String tmp in mkvFiles)
            {
                playableData tmpPlayable = new playableData(tmp);
                //Kleinere Dateien als 100MB ignorieren, dies sind sehr wahrscheinlich nur samples
                if (tmpPlayable.getFileSizeMb() >= 100)
                {
                    //Root dir handling, nur ein root dir hinzufügen bei multiDirs
                    if(tmpPlayable.getMultiDir())
                    {
                        if (!addedRootDirs.Contains(tmpPlayable.getRootDir()))
                        {
                            tmpPlayable.setIsRootDir(true);
                            addedRootDirs.AddLast(tmpPlayable.getRootDir());
                            lstPlayable.Items.Add((object)tmpPlayable);
                        }
                    }
                    else
                        lstPlayable.Items.Add((object)tmpPlayable);
                }
            }
            foreach (String tmp in aviFiles)
            {
                playableData tmpPlayable = new playableData(tmp);
                //Kleinere Dateien als 100MB ignorieren, dies sind sehr wahrscheinlich nur samples
                if (tmpPlayable.getFileSizeMb() >= 100)
                {
                    //Root dir handling, nur ein root dir hinzufügen bei multiDirs
                    if (tmpPlayable.getMultiDir())
                    {
                        if (!addedRootDirs.Contains(tmpPlayable.getRootDir()))
                        {
                            tmpPlayable.setIsRootDir(true);
                            addedRootDirs.AddLast(tmpPlayable.getRootDir());
                            lstPlayable.Items.Add((object)tmpPlayable);
                        }
                    }
                    else
                        lstPlayable.Items.Add((object)tmpPlayable);
                }
            }

            //Zweiten optionalen Ordner mit abprüfen
            if (Directory.Exists(Properties.Settings.Default.OptDir))
            {
                //Read all playable files in download directory
                String[] mkvFiles2 = System.IO.Directory.GetFiles(Properties.Settings.Default.OptDir, "*.mkv", System.IO.SearchOption.AllDirectories);
                String[] aviFiles2 = System.IO.Directory.GetFiles(Properties.Settings.Default.OptDir, "*.avi", System.IO.SearchOption.AllDirectories);

                foreach (String tmp in mkvFiles2)
                {
                    playableData tmpPlayable = new playableData(tmp);
                    //Kleinere Dateien als 100MB ignorieren, dies sind sehr wahrscheinlich nur samples
                    if (tmpPlayable.getFileSizeMb() >= 100)
                    {
                        //Root dir handling, nur ein root dir hinzufügen bei multiDirs
                        if (tmpPlayable.getMultiDir())
                        {
                            if (!addedRootDirs.Contains(tmpPlayable.getRootDir()))
                            {
                                tmpPlayable.setIsRootDir(true);
                                addedRootDirs.AddLast(tmpPlayable.getRootDir());
                                lstPlayable.Items.Add((object)tmpPlayable);
                            }
                        }
                        else
                            lstPlayable.Items.Add((object)tmpPlayable);
                    }
                }
                foreach (String tmp in aviFiles2)
                {
                    playableData tmpPlayable = new playableData(tmp);
                    //Kleinere Dateien als 100MB ignorieren, dies sind sehr wahrscheinlich nur samples
                    if (tmpPlayable.getFileSizeMb() >= 100)
                    {
                        //Root dir handling, nur ein root dir hinzufügen bei multiDirs
                        if (tmpPlayable.getMultiDir())
                        {
                            if (!addedRootDirs.Contains(tmpPlayable.getRootDir()))
                            {
                                tmpPlayable.setIsRootDir(true);
                                addedRootDirs.AddLast(tmpPlayable.getRootDir());
                                lstPlayable.Items.Add((object)tmpPlayable);
                            }
                        }
                        else
                            lstPlayable.Items.Add((object)tmpPlayable);
                    }
                }
            }

            lstPlayable.Refresh();

            //Set to one item
            if (tmpSelectedItem != null)
                lstPlayable.SelectedItem = tmpSelectedItem;
            else if (lstPlayable.Items.Count >= 1)
            {
                lstPlayable.SelectedIndex = 0;
            }
        }
 //Öffne Datei
 private void button1_Click(object sender, EventArgs e)
 {
     string mrl = String.Empty;
     OpenFileDialog theDialog = new OpenFileDialog();
     if (theDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         playableData tmp = new playableData(theDialog.FileName);
         lstPlayable.Items.Add(tmp);
         lstPlayable.SelectedItem = tmp;
     }
 }