Exemplo n.º 1
0
 private void button_open_folder_Click(object sender, EventArgs e)
 {
     if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         CommonInterface.GetFilesFromFolder(folderBrowserDialog1.SelectedPath, true);
     }
 }
Exemplo n.º 2
0
 private void button_open_folder_Click(object sender, EventArgs e)
 {
     if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         listView1.BeginUpdate();
         CommonInterface.GetFilesFromFolder(folderBrowserDialog1.SelectedPath);
         listView1.EndUpdate();
     }
 }
Exemplo n.º 3
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;
            }
        }
Exemplo n.º 4
0
 public Form2(string path, bool isFile = false)
 {
     InitializeComponent();
     CommonInterface.Link2  = this;
     colorSlider1.Value     = Properties.Settings.Default.Volume;
     checkBox2.Checked      = Properties.Settings.Default.SoundOff;
     CommonInterface.Volume = Properties.Settings.Default.Volume2;
     Audio.Volume           = colorSlider1.Value;
     if (isFile)
     {
         CommonInterface.ReadPlayList(path, true);
     }
     else
     {
         CommonInterface.GetFilesFromFolder(path, true);
     }
 }
Exemplo n.º 5
0
 private void listView1_DragDrop(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent(DataFormats.FileDrop))
     {
         string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
         foreach (string filePath in files)
         {
             if (Directory.Exists(filePath))
             {
                 CommonInterface.GetFilesFromFolder(filePath, true);
             }
             else
             {
                 CommonInterface.CheckExtension(new FileInfo(filePath), true);
             }
         }
     }
 }
Exemplo n.º 6
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);
     }
 }
Exemplo n.º 7
0
 public static void GetDataFromClipboard(bool isRadio = false)
 {
     if (Clipboard.ContainsFileDropList())
     {
         StringCollection files = Clipboard.GetFileDropList();
         if (isRadio)
         {
             Link2.listBox1.BeginUpdate();
         }
         else
         {
             Link1.listView1.BeginUpdate();
         }
         foreach (string filePath in files)
         {
             if (Directory.Exists(filePath))
             {
                 CommonInterface.GetFilesFromFolder(filePath, isRadio);
             }
             else
             {
                 CommonInterface.CheckExtension(new FileInfo(filePath), isRadio);
             }
         }
         if (isRadio)
         {
             Link2.listBox1.EndUpdate();
         }
         else
         {
             Link1.listView1.EndUpdate();
         }
     }
     else if (isRadio && Clipboard.ContainsText())
     {
         AddTrackOrURL(Clipboard.GetText(), isRadio);
     }
 }