【正文】
第一種方法是使用 ActiveX 控件, MFC 可以利用“ ActiveMovieControl Object”控件直接操作,實現(xiàn)起來非常簡單,但用到的是完全別人的東西,故而不是太好。 MCI 包含在系統(tǒng)的 文件中,參數(shù)較多,功能比較齊全,雖然使用起來比較煩瑣,但是更具有開發(fā)意義。以下的開發(fā)設計流程就是基于第二種方案的設計流程。 因為本軟件是以系統(tǒng)自帶的 MCI 命令接口為基礎,所以為豐富本軟件,將重點和難點放在了界面設計方面。各個控件的位置是由程序控制,所以原來擺在什么地方并不影響程序顯示出來的效果。 添加文件: CButtonST,IDC_ADD,m_add 播放控制 播放控制包括:播放(暫停),停止,上一首,下一首,循環(huán),播放進程控制。 1. 播放: CButtonST, IDC_PLAY, m_play 2. 暫停: CButtonST, IDC_PAUSE, m_pause 3. 停止: CButtonST, IDC_STOP, m_stop 4. 上一首: CButtonST, IDC_PREVIOUS, m_previous 5. 下一首: CButtonST, IDC_NEXT, m_next 圖 5- 1 對話框基本框架 6. 循環(huán): CButtonST, IDC_REPEAT, m_repeat 7. 播放進程控制 CMySliderControl, IDC_SLIDER, m_slider 對列表的控制 列表的控制包括:添加文件,刪除當前所選項,刪除全部,在列表中雙擊播放,列表的隱藏彈出。 1. 音量控制: IDC_ONVOICE, m_voice 2. 窗口總在最上: ID_W_TOP 程序設計的詳細說明 界面設置 各個自定義類的聲明: 1. CButtonST 類:詳細說明請見程序。 3. CMatrixStatic 類:詳細說明請見程序。//初始化界面 在主對話框的初始化程序里調(diào)用該函數(shù),具體定義請參照程序中函數(shù): void CMediaDlg::InitMPlayerFace() 在主界面設置好相應的位置后,就開始定義各個控件的具體功能。程序詳見 void CMediaDlg::OnAdd() 播放控制 1)播放: void CMediaDlg::OnPlay() 2)暫停: void CMediaDlg::OnPause() 3)停止: void CMediaDlg::OnStop() 4)上一首: void CMediaDlg::OnPrevious() 5)下一首: void CMediaDlg::OnNext() 6)循環(huán): void CMediaDlg::OnRepeat() 7)播放 進程控 制 void CMediaDlg::OnReleasedcaptureSlider(NMHDR* pNMHDR, LRESULT* pResult) 以上程序代碼詳見畢業(yè)設計。 2) 刪除當前所選項: void CMediaDlg::OnDel() 3) 刪除全部: void CMediaDlg::OnDelall() 4) 列 表中的 雙擊播 放: LIST BOX 本身 的 LBN_DBLCLK 消 息函數(shù)OnDblclkList() void CMediaDlg::OnDblclkList() 5) 列表的隱藏彈出: void CMediaDlg::OnHidlist() 菜單設置 1)菜單是從按紐出來,而不是原來意義的直接添加在對話框上。語句如下: void CMediaDlg::OnOnvoice() {//調(diào)用系統(tǒng)的 音量控制 ShellExecute(thism_hWnd, open, , NULL, NULL, SW_SHOWNORMAL)。除了支持 MICROSOFT MEDIA PLAYER 支持的一切格式外,還支持其他一些音視頻格式。 軟件的不足 因為只是試編的軟件,不夠?qū)I(yè),所以相比現(xiàn)已成熟的各種播放器來,更顯得過于單調(diào),而且功能方面還有待加強。本軟件實現(xiàn)在大多數(shù)的媒體格式的播放,基本上 Windows Media Player能播放的格式,本軟件都支持,還有其他一些格式。做畢業(yè)設計時讓我對 VC++的運用更是熟練了很多,而且有了系統(tǒng)地設計軟件的概念,這對我以后的軟件開發(fā)打下了很好的基礎。 “書到用時方恨少”,只是到要用的時候,才會覺得這句話的 有理。 很遺憾,當時選該課題時,有些想實現(xiàn)的功能,由于知識水平有限,最后都只是放了一個模塊而已,都沒有具體的擴展。總的說來,此次軟件設計,讓我深刻認識的不足,以后會更加努力。 [2](美) Steve Mack:《流媒體寶典》,電子工業(yè)出版社, 2020 年 1 月第 2 版。 [4] 楊競銳:《 Visual C++.NET 深入編程( 1CD) 》,北京希望電子出版社, 2020 年 1 月第 1版,第 88- 96 頁。 [6](美) Jeff Prosise(北京博彥科技發(fā)展有限公司譯):《 Programming Windows With MFC Second Edition》,清華大學出版社, 2020 年 9 月第 1 版,第 159- 190 頁。 [8]曾悠久瑪數(shù)位科技:《 Visual C++游戲設計入門 》,機械工業(yè)出版社, 2020 年 9 月第 1 版。 [10]揣錦華:《面向?qū)ο蟪绦蛟O計與 VC++實踐》,西安電子科技大學出版社, 2020 年 2 月第3 版。 Are you hungry now? No, I am tired and lazy now。 words, realizing that they were a signal, he turned and began to run, splashing through the shallow water. Ignacio ran after him, much helped by his longer legs, his hair flying beh ind his dark young face, his square teetheach white as a bone and as big as Nicholas39。t run, Nicholas, Dr. Island said with the voice of a wave. It only makes him angry that you run. Nicholas did not answer, but cut to his left, up the beach and among the trunks of the palms, sprinting all the way because he had no way of knowing Ignacio was not right behind him, about to grab him by the neck. When he stopped it was in the thick jungle, among the boles of the hardwoods, where he leaned,.。 . sound in an atmosphere silent and unwaked as Earth39。 there was none. He drew a deep breath then and said, Well, that39。 there was only the green hush. The light was still bright and strong and nearly, shadowless, but some interior sense told him the day, was nearly over, and he noticed that such faint shades as he could see stretched long, horizontal distortions of their objects. He felt no hunger, but he had fasted be39。 he was not as strong as he had been only a day past, and by this time next day he would probably be unable to outrun Ignacio. He should, h e now realized, have eaten the monkey he had killed。 he remembered his effort to open a coconuthe had failed, but it was surely not impossible. His mind was hazy as to what a coconut might contain, but there had to be an edible core, because they were eaten in books. He decided to make a wide sweep through the jungle that would bring him back to the beach well away from Ignacio。s head。 had Dr. Island used that sound to speak to him? He walked toward it and found a little rill that threaded a way among the trees, and followed it. In a hundred steps it grew broader, slowed, and ended in a long blind pool under a dome of leaves. . Diane was sitting on moss on the side opposite him。t mistaken after all, was I? I didn39。s Nicholas, and I called you. Then I thought I might be wrong, or that it might be Ignacio. Ignacio was chasing me. Maybe he still is, but h think he39。s a bit frightened of us. Have you ever talked to him, Nicholas? Today I did a little. He told me a story about a pet fish he used to have. Ignacio grew up all alone。s emptie than it used to be. Where Ignacio was, there would have been Red Indian hunters two or three hundred years ago。t anyone,` just the machines. Now he doesn39。t want anyone around him. Nicholas said slowly, Dr. Island said lots of people wouldn39。t other people around all the time. Remember that? a Only there. are other people around all the time。s how the world is. Not in Brazil, maybe, Nicholas said. He was trying to remember something about Brazil, but the only thing he could think of was a parrot singing in a straw hat from the view cartoons。t he stay there? Did I tell you about the bird, Nicholas? She had been not listening again. What bird? I have a bird. Inside. She patted the flat stomach below her small breasts, and for a mo ment, Nicholas thought she had really found food. She sits in here. She has tangled a nest in my entrails, where she sits and tears at my breath with her beak. I look healthy to you, don39。m hollow and rotten and turning brown, dirt and old feathers, oozing away. Her beak will break through soon. Okay.