Home > Back-end >  TMediaPlayer play songs pop-up warning No MCI device open (turn)
TMediaPlayer play songs pop-up warning No MCI device open (turn)

Time:10-19

As title, the following is a list the double-click songs after the ListBox code:
Void __fastcall TForm1: : ListBox1DblClick (TObject * Sender)/song/double file list a line
{

MediaPlayer1 - & gt; FileName=ListBox1 - & gt; The Items - & gt; Strings [ListBox1 - & gt; ItemIndex];
//send the selected songs file path to player TMediaPlayer
Label1 - & gt; Caption=MediaPlayer1 - & gt; The FileName.//Label1 show the path of the song files
MediaPlayer1 - & gt; DeviceType=dtAutoSelect;//TMediaPlayer automatically choose
MediaPlayer1 - & gt; The Open ();//open players
MediaPlayer1 - & gt; Play ();//play songs
N=ListBox1 - & gt; ItemIndex;//song number
Timer2 - & gt; Enabled=true;//open the control Label1 timer, lateral movement made the file path
}

Song path error:
F: \ \ music heaven and earth SogouMusic \
C? Be mua?? Ng - Th? Y Tien -?? Ng Kh? I.m p3

Many songs can normal play, it is to jump a few songs will appear after the above error, warning window kept
To play out, shut were shut out, according to the error of songs path can be seen, is probably the most songs filename TMediaPlayer
Can't identify? That song I convert into other name can be played normally,,, I am a novice, excuse me each
Is there a way to deal with this situation? I tried try/catch statements, seemingly no change,,,

CodePudding user response:

According to the code of what is this song name?

CodePudding user response:

Ha, ha, that's a song of Vietnam, the estimate is a player can't identify it, and some other file name is irregular who also can't let, I don't know what to do,,,

CodePudding user response:

Wrong picture:
http://b57.photo.store.qq.com/http_imgload.cgi?/rurl4_b=cdd2897156614242066916be335c62670636f87953c1404c1ab745fb8bee8219b81cc903f2250811120b24cc87f02cb730a5a23fa87f2824c75fc3bafc3e8b44b8aa59023f2041761a4f173a59e7ebdbccd40264

CodePudding user response:

ListBox inside I save all songs path, don't know how to select file name,

CodePudding user response:

Look, as if MediaPlayer does not support Unicode filename.

2009 could be supported in the later version.

CodePudding user response:

reference 4 floor sixrobberbob response:
ListBox inside I save all songs path, don't know how to select filename,


Simple method is to determine whether in the file contains a '? 'this character.
ListBox1 - & gt; The Items - & gt; Strings [ListBox1 - & gt; ItemIndex]. Pos ("?" ) & gt; 0

CodePudding user response:

Is there a way to let the player can't identify that song after automatically jump out to other places?

CodePudding user response:

Dizzy, jump the queue. See my reply the sixth floor.

CodePudding user response:

refer to the eighth floor ccrun response:
, jump the queue. See my reply 6th floor.

Thank you, now I wrote so many programs, I want to know the alert window is TMediaPlayer give? How ever?

CodePudding user response:

Warning is the MediaPlayer pop-up window. Kept playing, this reason is unknown.

CodePudding user response:

The
references to the tenth floor ccrun response:
warning is the MediaPlayer pop-up window. Kept playing, this reason is unknown.

Remember was a play only once before, now is the program written at the end of the scroll bar is affected by the timer too much ah, I block out all timer, or,,,

CodePudding user response:

May be related to your code.

But you block out the filename abnormal songs.

CodePudding user response:

The
references to the tenth floor ccrun response:
warning is the MediaPlayer pop-up window. Kept playing, this reason is unknown.

Void __fastcall TForm1: : Timer4Timer (TObject * Sender)
{
Int TheLength;
Int mMinutes;
Int mSeconds;
Int numbe.
Int time1, time2, time4 time5;
Numbe=ListBox1 - & gt; ItemIndex;
If (numbe==1)
{
Time1=0;
Time2=0;
Time4=0;
Time5=0;
Label4 - & gt; Caption=time1;
Label5 - & gt; Caption=time2;
Label6 - & gt; Caption=time4;
Label7 - & gt; Caption=time5;
}
The else
{
MediaPlayer1 - & gt; TimeFormat=tfMilliseconds;
TheLength=MediaPlayer1 - & gt; The Position/1000;
//mHours=TheLength/3600;
MMinutes=(TheLength % 3600)/60;
MSeconds=(3600) TheLength % % 60;
Time1=(mMinutes % 60)/10;
Time2=60) (mMinutes % % 10;
Time4=mSeconds/10;
Time5=mSeconds % 10;
Label4 - & gt; Caption=time1;
Label5 - & gt; Caption=time2;
Label6 - & gt; Caption=time4;
Label7 - & gt; Caption=time5;

MediaPlayer1 - & gt; TimeFormat=tfMilliseconds;
ImageTrack - & gt; Canvas - & gt; Brush - & gt; Color=clBlack;
ImageTrack - & gt; Canvas - & gt; A Rectangle (0, 0, ImageTrack - & gt; Width, ImageTrack - & gt; Height);
ImageTrack - & gt; Canvas - & gt; Brush - & gt; Color=clMaroon;
ImageTrack - & gt; Canvas - & gt; A Rectangle (0, 0, ImageTrack - & gt; Width * (float (MediaPlayer1 - & gt; The Position)/float (MediaPlayer1 - & gt; Length)), ImageTrack - & gt; Height);
}
}
I find out the reason, the progress bar should be the timer, because when read before song failed, but the timer TheLength=MediaPlayer1 - & gt; The Position/1000; Statement has been executed, and so would constantly pop-up warning, now play only a warning, is much better, ha ha, thank demon elder brother, later more business,

CodePudding user response:

It is good to solve the.

CodePudding user response:

Oh, I just want to see this warning No MCI device is how to eliminate the open,,,,,,, finally still didn't eliminate
  • Related