Exemple #1
0
 private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
 {
     listView1.BeginUpdate();
     foreach (string item in openFileDialog1.FileNames)
     {
         if (item.EndsWith(".m3u"))
         {
             CommonInterface.ReadPlayList(item);
         }
         else
         {
             CommonInterface.AddTrackOrURL(item);
         }
     }
     listView1.EndUpdate();
 }
Exemple #2
0
        static void StartupNextInstanceHandler(object sender, StartupNextInstanceEventArgs e)
        {
            switch (e.CommandLine.Count)
            {
            case 2:
                foreach (Form item in Application.OpenForms)
                {
                    if (item is Form1)
                    {
                        if (Directory.Exists(e.CommandLine[1]))
                        {
                            CommonInterface.GetFilesFromFolder(e.CommandLine[1]);
                        }
                        else if (File.Exists(e.CommandLine[1]))
                        {
                            CommonInterface.AddTrackOrURL(e.CommandLine[1]);
                        }
                        break;
                    }
                }
                break;

            case 3:
                if (e.CommandLine[1].ToLower().Equals("radio"))
                {
                    foreach (Form item in Application.OpenForms)
                    {
                        if (item is Form2)
                        {
                            if (Directory.Exists(e.CommandLine[2]))
                            {
                                CommonInterface.GetFilesFromFolder(e.CommandLine[2], true);
                            }
                            else if (File.Exists(e.CommandLine[2]))
                            {
                                CommonInterface.ReadPlayList(e.CommandLine[2], true);
                            }
                            break;
                        }
                    }
                }
                break;

            default:
                break;
            }
        }
Exemple #3
0
 public Form1(string path, bool isFile = false)
 {
     InitializeComponent();
     CommonInterface.Link1 = this;
     CommonInterface.SetFileFilter();
     Audio.InitAudio(Audio.HZ);
     comboBox1.SelectedIndex = Properties.Settings.Default.RepeatMode;
     checkBox1.Checked       = Properties.Settings.Default.RandomMode;
     colorSlider2.Value      = Properties.Settings.Default.Volume;
     checkBox2.Checked       = Properties.Settings.Default.SoundOff;
     CommonInterface.Volume  = Properties.Settings.Default.Volume2;
     Audio.Volume            = colorSlider2.Value;
     if (isFile)
     {
         CommonInterface.AddTrackOrURL(path);
     }
     else
     {
         CommonInterface.GetFilesFromFolder(path);
     }
 }