예제 #1
0
 public void InitPlayListCollection()
 {
     collectionOfPlayLists           = new PlayListCollection();
     collectionOfPlayLists.playLists = new List <PlayList>();
     collectionOfPlayLists.playLists.Add(collectionOfPlayLists.currentPlayList);
     collectionOfPlayLists.currentPlayList = collectionOfPlayLists.currentPlayList;
     collectionOfPlayLists.currentPlayItem = collectionOfPlayLists.currentPlayItem;
 }
예제 #2
0
 public PlayListCollection(string path)
 {
     try
     {
         BinaryFormatter    bf  = new BinaryFormatter();
         PlayListCollection col = (PlayListCollection)bf.Deserialize(new System.IO.FileStream(path, System.IO.FileMode.Open, System.IO.FileAccess.Read));
         this.playLists       = col.playLists;
         this.currentPlayList = col.currentPlayList;
         this.currentPlayItem = col.currentPlayItem;
     }
     catch
     {
         playLists = new List <PlayList>();
         playLists.Add(new PlayList());
         currentPlayItem = new PlayItem();
         currentPlayList = playLists[0];
     }
 }
예제 #3
0
        public MainWindow()
        {
            InitializeComponent();

            Left = System.Windows.SystemParameters.PrimaryScreenWidth - this.Width;
            Top  = 0;

            collectionOfPlayLists = new PlayListCollection("playlists.bin");

            try
            {
                stream  = new AudioFileReader(collectionOfPlayLists.currentPlayItem.Path);
                waveOut = new WaveOut();
                waveOut.Init(stream);

                TextBlockInfo.Text = collectionOfPlayLists.currentPlayItem.ToString();
            }
            catch
            {
            }
        }