| Zakhar | 
|  Отправлено: 12.11.2003, 07:22 |  | 
| 
 Ученик-кочегар
 
 Группа: Участник
 Сообщений: 10
 
 
 
  
 | Народ есть одна проблема. После открытия аудио файла нужно узнать время его звучания
 и отобразить информацию: минуты в Label1 а секунды в Label2.
 Может кто то знает как это сделать.
 помогите примером кода. Буду весьма признателен.
 
 Отредактировано Zakhar — 12/11/2003, 08:25
 | 
|  | 
| ЛЁха | 
|  Отправлено: 12.11.2003, 09:48 |  | 
| 
 Не зарегистрирован
 
 
 
 
 
 
 
  
 | MediaPlayer->Length продолжительность .... 
 
 | CODE |  | void __fastcall TForm1::Button1Click(TObject *Sender)
 {
 
 MediaPlayer1->TimeFormat = tfMilliseconds;
 int tm = MediaPlayer1->Length/1000; // в секундах
 
 Label1->Caption = tm; // всего секунд или
 
 // или разбить на минуты и секунды
 Label2->Caption = tm/60; // минут
 Label3->Caption = tm — (tm/60)*60;  // + секунд
 }
 
 | 
 
 в Help есть пример
 
 
 Description
 
 Length is specified using the current time format, which is specified by the TimeFormat property.
 
 
 | CODE |  | void __fastcall TForm1::Button1Click(TObject *Sender)
 {
 int TheLength;
 // Set time format — note that some devices don’t support tfHMS
 MediaPlayer1->TimeFormat = tfHMS;
 // Store length of currently loaded media
 TheLength = MediaPlayer1->Length;
 // display hours in label 1
 Label1->Caption = IntToStr(LOBYTE(LOWORD(TheLength)));
 // display minutes in label 2
 Label2->Caption = IntToStr(HIBYTE(LOWORD(TheLength)));
 // display the seconds in label 3
 Label3->Caption = IntToStr(LOBYTE(HIWORD(TheLength)));
 }
 //------------------
 
 | 
 
 
 Отредактировано Admin — 12/11/2003, 11:16
 | 
|  | 
| Zakhar | 
| Отправлено: 18.11.2003, 07:30 |  | 
| 
 Ученик-кочегар
 
 Группа: Участник
 Сообщений: 10
 
 
 
  
 | Спасибо за помощь | 
|  |