. NET Small Project MYKTV (song playback function implementation)

Source: Internet
Author: User

In the KTV song system we get to the singer's song information according to demand, click the singer's song to add it to a little song list of seemingly simple operation actually involves a lot of content, this is also the purpose of writing this blog-analyze the principle of the song play.

Principle Analysis

We should be clear that in the KTV songs will add the song to the list of points, a list of points, when the player will play the song according to the order of the points in the table. Specifically how to implement this function, we take a step-by-step analysis.

    1. First we should create a playlist class that stores the list of points and the method corresponding to the point list operation.

Create song class to save the songs object,

Enumeration class Songplaystate The playback state of a song,

Create a playlist class to save playlists and play list operations relative to the method

( Here we set the Songindex song subscript in the playlist class as well as the Songlist song list to static, the action of the playlist has added song Addsong (), Get play Song Getplaysong (), And get to the next song MoveNext ())

Here we use an array of objects, in fact, using a generic collection is better. Not too much of a tangle here.

We get to the point of the song, first create the object of this song, and then add it to the playlist, and in the point of the song is displayed

( Add a song to the point list and indicate the playback status of the song)

( Add song to play Class table)

2. We are in the list of songs, click on songs, songs play, do is to get to the song's file path and pass it to the player

We need to set properties in the Live interface form song for the current play, song list play, we need to use the timer space, every second to the player's status (using the timer tick event)

Then call Playlist's Getsong () method,

At the same time increase the judgment of the existence of the next song, and get the last song name and the next song title

Today this blog is a bit in a hurry, there may be many problems, I think basically has included the song playback function of the key.

Today only to KTV added song play function, after a few days will be a further improvement of KTV!

. NET Small Project MYKTV (song playback function implementation)

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.