R. A. Yusupov C++ Builderda masalalar va topshiriqlar samarqand 2018 yil


int ms = MediaPlayer1->Length; AnsiString st = IntToStr(SECOND(ms)); if



Download 3,49 Mb.
bet73/147
Sana03.01.2022
Hajmi3,49 Mb.
#314841
1   ...   69   70   71   72   73   74   75   76   ...   147
Bog'liq
c asosiy

int ms = MediaPlayer1->Length;

AnsiString st = IntToStr(SECOND(ms));



if (st.Length() == 1)

st = "0" + st;

st = IntToStr(MINUTE(ms)) + ":" + st;

Label1->Caption = st;

Label3->Caption = "0:00";

// tiklash jarayonini faollashtirish

SpeedButton2->Glyph->Assign(bmPause);

SpeedButton2->Hint = "Pause";

SpeedButton2->Tag = 1;

SpeedButton1->Enabled=false;//Eject tugmasi murojatli

//emas

MediaPlayer1->Play();



Timer1->Enabled = true;

}

// Play/Stop tugmasini bosish (tiklash/to’xtash)



void __fastcall TForm1::SpeedButton2Click(TObject *Sender)

{

if (SpeedButton2->Tag == 0)

{

// Play tugmasini bosish



SpeedButton2->Glyph->Assign(bmPause);

SpeedButton2->Hint = "Pause";

SpeedButton2->Tag = 1;

SpeedButton1->Enabled = false; // Eject tugmasi

// murojaatli emas

MediaPlayer1->Play();

Timer1->Enabled = true;

}

else // Stop tugmasini bosish

{

MediaPlayer1->Stop();



SpeedButton2->Glyph->Assign(bmPlay);

SpeedButton2->Hint = "Play";

SpeedButton2->Tag = 0;

SpeedButton1->Enabled=true;//Eject tugmasi murojaatli

Timer1->Enabled = false;

}

}



// pleyerdan signal

void __fastcall TForm1::MediaPlayer1Notify(TObject *Sender)

{

if ((MediaPlayer1->Mode == mpStopped ) &&

(SpeedButton2->Tag == 1))

{

Timer1->Enabled = false;



SpeedButton2->Glyph->Assign(bmPlay);

SpeedButton2->Hint = "Play";

SpeedButton2->Tag = 0;

SpeedButton1->Enabled = true; // Eject tugmasini

// murojaatli qilish

}

}



/*Pain xodisani qayta ishlash funksiyasi oyna xosil bo’lganda birinchi kadrni tasvirlashni (qayta chizish) ta’minlaydi, masalan,

например, после того,как пользователь отодвинет другое окно, перекрывающее окон Video Player. */



void __fastcall TForm1::FormPaint(TObject *Sender)

{

if (MediaPlayer1->Mode == mpStopped )

{

MediaPlayer1->Position = 1;



MediaPlayer1->Position = 0;

}

}



// dastur ishining tugashi

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)

{

MediaPlayer1->Close();



}

void __fastcall TForm1::Timer1Timer(TObject *Sender)

{

// tiklash vaqti xaqida ma’lumotlarni chiqarish



// MediaPlayerl->TimeFormat = tfMilliseconds;

int ms = MediaPlayer1->Position;

AnsiString st = IntToStr(SECOND(ms));



if ( st.Length() == 1)

st = "0" + st;

st = IntToStr(MINUTE(ms)) + ":" + st;

Label3->Caption = st;

}

Animatsiya

Animatsiya dasturi, uning forma va oynasi 1.46-rasmda keltirlgan, Animate komponentasi yordamida AVI-animatsiyalarni tiklashni namoish etadi. Animatsiya dastur ishini boshlagan vaqtda fayldan yuklanadi.




Button1

Animate1



1.46-rasm. Dastur formasi va oynasi

bool loaded = false; // animatsiya yuklangan

// forma konstruktori



__fastcall TForm1::TForm1(TComponent* Owner)

: TForm(Owner)

{

/* agar animatsiya fayli murojaatli emas yoki animatsiya ovozli bo’lsa, istisni xosil bo’ladi */



try

{

Animate1->FileName = "cool.avi";



}

catch (Exception &e)

{ }


Form1->Caption = "Animatsiya - " + Animate1->FileName;

loaded = true;

Label1->Caption="Kadrlar: "+IntToStr(Animate1->

FrameCount)+" Kadrlar o'lchami: "+IntToStr(

Animate1->Width)+"x" + IntToStr(Animate1->Height);

}

// dastur ishining boshlanishi



void __fastcall TForm1::FormActivate(TObject *Sender)

{

if (loaded)

// birinchidan oxirgi kadr bo’yicha bir marta

//animatsiyani tiklanadi

Animate1->Play(1,Animate1->FrameCount,1);

}

// Play tugmasini bosish



void __fastcall TForm1::Button1Click(TObject *Sender)

{

if (loaded)

// birinchidan oxirgi kadr bo’yicha bir marta

//animatsiyani tiklanadi

Animate1->Play(1,Animate1->FrameCount,1);

}


Download 3,49 Mb.

Do'stlaringiz bilan baham:
1   ...   69   70   71   72   73   74   75   76   ...   147




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish