Ejemplo n.º 1
0
 public override void Load(Track track, MusicTab tab = null)
 {
     if (track == null)
     {
         return;
     }
     //if (track.path == null) return;
     //if (track.path == "") return;
     try
     {
         reader = new MediaFoundationReader(track.path);
     }
     catch
     {
         return;
     }
     if (reader == null)
     {
         return;
     }
     totalMilliseconds = reader.TotalTime.TotalMilliseconds;
     player            = new WaveOut();
     player.Init(reader);
     CurrentTrack = track;
     CurrentTab   = tab;
 }
Ejemplo n.º 2
0
        private void addDirectoryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var folderBrowserDialog = new FolderBrowserDialog();

            folderBrowserDialog.RootFolder          = Environment.SpecialFolder.MyComputer;
            folderBrowserDialog.ShowNewFolderButton = false;
            var result = folderBrowserDialog.ShowDialog();

            if (result != DialogResult.OK)
            {
                return;
            }
            //{
            var CurrentTab = MainTab.MainTab.SelectedTab as MusicPage;

            string[] FileNames = { folderBrowserDialog.SelectedPath };

            //    Debug.WriteLine(folderBrowserDialog.SelectedPath);

            //    CurrentTab.musicTab.AddTrack(FileNames);
            //}
            //SavePlaylists();

            var trackList = MusicTab.MakeTracksList(FileNames);

            CurrentTab?.musicTab?.AddTrack(trackList);
            SavePlaylists();
        }
Ejemplo n.º 3
0
 public void Play(Track track, MusicTab tab)
 {
     if (track == null)
     {
         return;
     }
     Stop();
     CurrentTrack = track;
     CurrentTab   = tab;
     Load(track);
     Play();
 }
Ejemplo n.º 4
0
 public Options(string SelectedDirectory = "")
 {
     InitializeComponent();
     if (File.Exists(SelectedDirectory) && MusicTab.IsDirectory(SelectedDirectory))
     {
         DefaultDirectory = SelectedDirectory;
     }
     else
     {
         var path = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
         DefaultDirectory = path;
     }
     UpdateDir();
 }
Ejemplo n.º 5
0
 public Options(String SelectedDirectory = "")
 {
     InitializeComponent();
     if (System.IO.File.Exists(SelectedDirectory) && MusicTab.IsDirectory(SelectedDirectory))
     {
         this.SelectedDirectory = SelectedDirectory;
     }
     else
     {
         string path = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
         this.SelectedDirectory = path;
     }
     UpdateDir();
 }
Ejemplo n.º 6
0
 private void AcceptChange()
 {
     if (MainTabs != null && MainTabs.SelectedTab != null)
     {
         MainTabs.SelectedTab.Text = this.Text;
     }
     else if (subItem != null)
     {
         subItem.Text = this.Text;
         if (Item != null)
         {
             MusicTab tab = Item.ListView.Parent as MusicTab;
             tab?.AfterSubItemEdit(Item);
         }
     }
     KillTextBox();
     MainWindow.SavePlaylists();
 }
Ejemplo n.º 7
0
 public abstract void Load(Track track, MusicTab tab = null);
Ejemplo n.º 8
0
 public override void Load(Track track, MusicTab tab = null) => player.Open(new Uri(track.path));