Software Engineering's spring music playback Interface C # writing details

Source: Internet
Author: User

As the team members have completed the detailed design of the software, here only to specify the details of the software program written, so as not to repeat.

The song is played using the VS AxWindowsMediaPlayer plugin, so the program involves many of the plugins used. The Ctlcontrols property is an important property of AxWindowsMediaPlayer, and there are many common members in this control. Here are a few common, except 4 and 5 in the music player does not need to use, several other methods are required.

(1) method Play

Used to play a multimedia file in the form name. Name of the control. Ctlcontrols.play ()

such as: AxWindowsMediaPlayer1.Ctlcontrols.play ()

(2) method Pause

Used to pause a multimedia file that is being played in the form name. The name of the control. Ctlcontrols.pause ()

such as: AxWindowsMediaPlayer1.Ctlcontrols.pause ()

(3) method Stop

Used to stop a multimedia file that is being played in the form name. The name of the control. Ctlcontrols.stop ()

such as: AxWindowsMediaPlayer1.Ctlcontrols.stop ()

(4) method Fastforward

Used to fast forward the multimedia file being played, in the format: Form name. The name of the control. Ctlcontrols.fastforward ()

such as: AxWindowsMediaPlayer1.Ctlcontrols.forward ()

(5) method fastreverse

Used to rewind a multimedia file that is playing, in the format: Form name. Control name. Ctlcontrols.fastreverse ()

such as: AxWindowsMediaPlayer1.Ctlcontrols.fastreverse ()

(6) attribute currentposition

Used to get the current playback progress of a multimedia file whose value is a numeric type, using the format: Form name. The name of the control. Ctlcontrols.currentposition

such as D1=axwindowsmediaplayer1.ctlcontrols.currentposition where D1 is an integer variable.

(7) attribute Duration

Used to get the total time of playback for the current multimedia file, whose value is a numeric type, which is used in the format: Form name. The name of the control. Currentmedia.duration

such as: D2=axwindowsmediaplayer1.currentmedia.duration (where D2 is an integer variable).

controls.currentPositionString:string; Current progress, string format. such as "00:23"

Basic properties

url:string; Specify media location, native or network address

uimode:string; Player interface mode, available for full, Mini,none, Invisible

Playstate:integer; Playback status, 1 = stop, 2 = pause, 3= play, 6 = buffering, 9 = connecting, 10 = Ready

********************************************************************

According to the feasibility analysis and requirement analysis of spring Music player, it is necessary to make sure that the software play interface needs to realize the following functions:

1. Add songs and play them;

Write the function, use the URL to specify the media location, where the media location is the native D-Drive, play songs according to the path, display the song name in the title label, insert the song name in the ListBox, and use an array to store the file information for each song.

This.axWindowsMediaPlayer1.URL = Namepath;

2. Pause, stop playing;

Use the method play,pause,stop to control the pause and stop playback, when the playback operation, the control timer.

3. Play the previous song, next song;

Store music as an array, play by the array name plus minus play (play the previous song, the next song specific code implementation is still imperfect).

4. Scroll to display the song name;

Musicname. Text = this.axwindowsmediaplayer1.currentmedia.name;//Musicname is the name of the label to display the song name; Change the name of the song according to the time label display position (location).

5. Generate a list of songs and sort them automatically;

Use This.listBox1.Items.Insert (0, Musicname. Text);//Insert a song name in the ListBox; Set the ListBox property to sort to automatically sort.

6. Songs can be played from the list of songs;

Add a button or label to each first corresponding position in the ListBox, and when you click a different song in the ListBox, it is equivalent to clicking on the corresponding button, programming the button _click, and playing the corresponding location song each time you click on it. The location of the song name is determined by the sort location in the listbox (the implementation still needs to be implemented).

Software Engineering's spring music playback Interface C # writing details

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.