private void setPlayer() { playlistMain = player.newPlaylist("Main playlist", ""); playlistMain.appendItem(player.newMedia("bgMusic.mp3")); player.currentMedia = playlistMain.get_Item(0); player.controls.play(); player.settings.setMode("loop", true); playlistTeams = player.newPlaylist("Team playlist", ""); playlistTeams.appendItem(player.newMedia("liverpoolSong.mp3")); playlistTeams.appendItem(player.newMedia("chelseaSong.mp3")); playlistTeams.appendItem(player.newMedia("manchesterCitySong.mp3")); playlistTeams.appendItem(player.newMedia("arsenalSong.mp3")); playlistTeams.appendItem(player.newMedia("evertonSong.mp3")); playlistTeams.appendItem(player.newMedia("tottenhamHotspurSong.mp3")); playlistTeams.appendItem(player.newMedia("manchesterUnitedSong.mp3")); playlistTeams.appendItem(player.newMedia("lsouthamptonSong.mp3")); playlistTeams.appendItem(player.newMedia("newcastleUnitedSong.mp3")); playlistTeams.appendItem(player.newMedia("stokeCitySong.mp3")); playlistTeams.appendItem(player.newMedia("westHamUnitedSong.mp3")); playlistTeams.appendItem(player.newMedia("astonVillaSong.mp3")); playlistTeams.appendItem(player.newMedia("swanseaCitySong.mp3")); playlistTeams.appendItem(player.newMedia("hullCitySong.mp3")); playlistTeams.appendItem(player.newMedia("norwichCitySong.mp3")); playlistTeams.appendItem(player.newMedia("crystalPalaceSong.mp3")); playlistTeams.appendItem(player.newMedia("westBromwichSong.mp3")); playlistTeams.appendItem(player.newMedia("cardiffCitySong.mp3")); playlistTeams.appendItem(player.newMedia("sunderlandSong.mp3")); playlistTeams.appendItem(player.newMedia("fulhamSong.mp3")); }
public bool setNowPlaying() { if (Player != null) { if (Player.currentPlaylist == null) { Player.currentPlaylist = Player.newPlaylist(m_playlist.name, ""); } if (!m_appendToQueue) { Player.currentPlaylist.clear(); } } if (m_indexes != null) { for (int j = 0; j < m_indexes.Count; j++) { setMediaItem(m_playlist.get_Item((int)m_indexes[j]), j); System.Threading.Thread.Sleep(100); } } else { for (int j = 0; j < m_playlist.count; j++) { setMediaItem(m_playlist.get_Item(j), j); System.Threading.Thread.Sleep(100); //Helps with stopped responding errors? } } return(true); }
// 각종 변수들의 초기화와 매트릭스 초기화를 담당. private void Form1_Load(object sender, EventArgs e) { centerX = this.Width / 2; centerY = this.Height / 2; Size screenSize = new Size(this.Width * 2, this.Height * 2); screenPoint = new Point[1]; screenPoint[0].X = -this.Width / 2; screenPoint[0].Y = -this.Height / 2; fullScreen = new Rectangle(screenPoint[0], screenSize); matrix_rotate.RotateAt(turn, new PointF(centerX, centerY)); matrix_player_right.RotateAt(turn * 5f, new PointF(centerX, centerY)); matrix_player_left.RotateAt(-turn * 5f, new PointF(centerX, centerY)); matrix_big.Scale(3, 3); matrix_small.Scale(-3, -3); // 배경음 초기화 string filePath = Application.StartupPath + @"\\bgm.mp3"; wmp = new WindowsMediaPlayer(); IWMPMedia bgm = wmp.newMedia(filePath); IWMPPlaylist playlist = wmp.newPlaylist("MusicPlayer", ""); playlist.appendItem(bgm); wmp.currentPlaylist = playlist; wmp.controls.stop(); DateTime dtmcurrent = DateTime.Now; generator = new Random(dtmcurrent.Millisecond); }
private void Client_Load(object sender, EventArgs e) { progressBar.Minimum = 0; progressBar.Step = 1; WMP = new WindowsMediaPlayer(); MusicPlayList = WMP.newPlaylist("MusicPlayer", ""); WMP.currentPlaylist = MusicPlayList; comboBox1.SelectedIndex = 0; }
//Initalizesthe board components and begins playing the music in the background public Mancala() { InitializeComponent(); var playlist = playlistPlayer.newPlaylist("mancalaPlaylist", ""); playlist.appendItem(playlistPlayer.newMedia("Dragonborn.mp3")); playlist.appendItem(playlistPlayer.newMedia("Steel-on-Steel.mp3")); playlistPlayer.currentPlaylist = playlist; //player.URL = "Dragonborn.mp3"; }
//폼이 로드될 때 private void mainForm_Load(object sender, EventArgs e) { playerInstance = new WindowsMediaPlayer(); playList = playerInstance.newPlaylist("MusicPlayer", ""); playerInstance.currentPlaylist = playList; playListManager = new List <IWMPMedia>(); progressThread = new Thread(new ThreadStart(Progress)); progressThread.Start(); playerInstance.PlayStateChange += PlayerInstance_PlayStateChange; }
private void playlist_set(int index) { wplayer.currentPlaylist = wplayer.newPlaylist("playlist", ""); //foreach (ListViewItem itemRow in listView1.Items) for (int k = index; k < listView1.Items.Count; k++) { ListViewItem itemRow = listView1.Items[k]; for (int i = 0; i < itemRow.SubItems.Count; i++) { string song_path = itemRow.SubItems[i].Text; Console.WriteLine("sorok: " + itemRow.SubItems[i].Text); wplayer.currentPlaylist.appendItem(wplayer.newMedia(song_path)); } } }
private void Form1_Load(object sender, EventArgs e) { this.serverMusicList.View = View.Details; this.serverMusicList.Columns.Add("Music Name", 150, HorizontalAlignment.Left); this.serverMusicList.Columns.Add("Artist", 60, HorizontalAlignment.Center); this.serverMusicList.Columns.Add("Play Time", 100, HorizontalAlignment.Center); this.serverMusicList.Columns.Add("Bit Rate", 100, HorizontalAlignment.Left); this.playMusicList.View = View.Details; this.playMusicList.Columns.Add("Music Name", 150, HorizontalAlignment.Left); this.playMusicList.Columns.Add("Artist", 60, HorizontalAlignment.Center); this.playMusicList.Columns.Add("Play Time", 100, HorizontalAlignment.Center); this.playMusicList.Columns.Add("Bit Rate", 100, HorizontalAlignment.Left); WMP = new WindowsMediaPlayer(); PlayList = WMP.newPlaylist("MusicPlayer", ""); WMP.currentPlaylist = PlayList; }
private void Form1_Load(object sender, EventArgs e) { this.serverMusicList.View = View.Details; this.serverMusicList.Columns.Add("Music Name", 150, HorizontalAlignment.Left); this.serverMusicList.Columns.Add("Artist", 60, HorizontalAlignment.Center); this.serverMusicList.Columns.Add("Play Time", 100, HorizontalAlignment.Center); this.serverMusicList.Columns.Add("Bit Rate", 100, HorizontalAlignment.Left); this.playMusicList.View = View.Details; this.playMusicList.Columns.Add("Music Name", 150, HorizontalAlignment.Left); this.playMusicList.Columns.Add("Artist", 60, HorizontalAlignment.Center); this.playMusicList.Columns.Add("Play Time", 100, HorizontalAlignment.Center); this.playMusicList.Columns.Add("Bit Rate", 100, HorizontalAlignment.Left); WMP = new WindowsMediaPlayer(); PlayList = WMP.newPlaylist("MusicPlayer", ""); WMP.currentPlaylist = PlayList; MediaSaver = Array.CreateInstance(typeof(IWMPMedia), 128); comboBox1.SelectedIndex = 0; musicPlayType = 1; }
public ClientForm() { Dispatcher = new MyDispatcher(); AppDomain.CurrentDomain.UnhandledException += CommonBehavior.OnUnhandledException; InitializeComponent(); BtnBrowse.Click += (s, e) => RefreshLocalTracks(); TbIp.Text = CommonBehavior.GetLocalIPAddress().ToString(); Playlist = new PlayListViewItemCollection(LvLocalList, Wmp); CbRepeat.SelectedIndex = 0; InitializeRepeatTypeCombobox(); Wmp.currentPlaylist = Wmp.newPlaylist("no title", ""); Wmp.CurrentItemChange += OnWmpMediaChange; Wmp.PlayStateChange += OnWmpPlayStateChange; Wmp.MediaError += OnWmpMediaError; TrackBarTimer.Tick += TrackBarUpdateTick; }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { string FileDownPath = null; //한 곡 경로 if (comboBox1.SelectedItem.Equals("한곡 재생")) { if (playList.SelectedIndices.Count == 0) { //곡선택이 안되어 있을 때 MessageBox.Show("반복 할 음악을 선택하세요"); comboBox1.SelectedIndex = 0; return; } newPlayList = WMP.newPlaylist("MusicPlayer", ""); int index; index = playList.FocusedItem.Index; oneSongIndex = index; string musicName = playList.Items[index].SubItems[0].Text; DirectoryInfo d = new DirectoryInfo(downPath); //디렉토리 경로 FileInfo[] fArray = d.GetFiles(); //디렉토리 해당 mp3 파일 배열 folder = shell.NameSpace(downPath); //디렉토리 해당 파일 속성 가져오기 foreach (FileInfo fInfo in fArray) //파일 정보 ListView에 저장 { FolderItem mp3file = folder.ParseName(fInfo.Name); //파일 이름 if (folder.GetDetailsOf(mp3file, 21).ToString() == musicName) { FileDownPath = fInfo.FullName; } } IWMPMedia Media; Media = WMP.newMedia(@FileDownPath); //새로운 음악파일 객체 생성 newPlayList.appendItem(Media); //플레이리스트에 추가 randomCheck = 1; //구별할 수 있도록 1저장 } else { randomCheck = 0; //설정 안할 때 } }
private void pathBtn_Click(object sender, EventArgs e) { folderBrowserDialog1.ShowDialog(); string path = folderBrowserDialog1.SelectedPath; pathText.Text = path; pathText.Enabled = false; musicList.Items.Clear(); wmp = new WindowsMediaPlayer(); IWMPMedia mp3File; playList = wmp.newPlaylist("MusicPlayer", ""); DirectoryInfo di = new DirectoryInfo(path); fi = di.GetFiles("*.mp3"); foreach (var item in fi) { mp3File = wmp.newMedia(@"" + path + "\\" + item.Name); string[] file_info = new string[4]; double duration; string bitrates; file_info[0] = mp3File.getItemInfo("Title"); file_info[1] = mp3File.getItemInfo("Author"); duration = mp3File.duration; file_info[2] = ((int)duration / 60) + "분" + ((int)duration % 60) + "초"; bitrates = mp3File.getItemInfo("Bitrate"); file_info[3] = bitrates.Remove(3, 3) + "kbps"; ListViewItem list_item = new ListViewItem(file_info); musicList.Items.Add(list_item); playList.appendItem(mp3File); isPathSelected = true; } }
private IWMPPlaylist CreatePlaylist() { return(_windowsMediaPlayer.newPlaylist(Constants.Constants.PlaylistName, Constants.Constants.PlaylistPath)); }
private void Form1_Load(object sender, EventArgs e) { wmp = new WindowsMediaPlayer(); playerList = wmp.newPlaylist("MusicPlayer", ""); wmp.currentPlaylist = playerList; }