Podstrony
- Strona startowa
- Bruce Morris Adventure Guide Florida Keys & Everglades National Park (2005)
- The Career Survival Guide Dealing with Office Politics Brian OÂ’Connell
- (Ross Enamait) The Underground Guide To Warrior Fitness
- Novell Netware 5 Advanced Admin Instructor guide
- Cisco Press CCDA Study Guide
- Linux Network Admistrator's Guide
- Linux Network Administrators' Guide
- User Guide
- Chmielewska Joanna Jeden kierunek ruchu (2)
- Gloria Victis Orzeszkowa
- zanotowane.pl
- doc.pisz.pl
- pdf.pisz.pl
- alpha1982.htw.pl
[ Pobierz całość w formacie PDF ]
.The device can also becontrolled by the methods that correspond to the buttons (Play, Pause, Stop, Next,Previous, and so on).12-32 Dev el oper s Gui deWo r k i n g wi t h mu l t i me d i a7 Position the media player control bar on the form by either clicking and draggingit to the appropriate place on the form or by selecting the Align property andchoosing the appropriate align position from the drop down list.If you want the media player to be invisible at runtime, set the Visible property toFalse and control the device by calling the appropriate methods (Play, Pause, Stop,Next, Previous, Step, Back, Start Recording, Eject).8 Make any other changes to the media player control settings.For example, if themedia requires a display window, set the Display property to the control thatdisplays the media.If the device uses multiple tracks, set the Tracks property to thedesired track.Table 12.7 Multimedia device types and their functionsUses aUses DisplayDevice Type Software/Hardware used Plays Tracks WindowdtAVIVideo AVI Video Player for AVI Video files No YesWindowsdtCDAudio CD Audio Player for CD Audio Disks Yes NoWindows or a CD AudioPlayerdtDAT Digital Audio Tape Player Digital Audio Tapes Yes NodtDigitalVideo Digital Video Player for AVI, MPG, MOV files No YesWindowsdtMMMovie MM Movie Player MM film No YesdtOverlay Overlay device Analog Video No YesdtScanner Image Scanner N/A for Play (scans No Noimages on Record)dtSequencer MIDI Sequencer for MIDI files Yes NoWindowsdtVCR Video Cassette Recorder Video Cassettes No YesdtWaveAudio Wave Audio Player for WAV files No NoWindowsExample of adding audio and/or video clips (VCL only)This example runs an AVI video clip of a multimedia advertisement.To run thisexample, create a new project and save the Unit1.pas file to FrmAd.pas and save theProject1.dpr file to DelphiAd.dpr.Then:1 Double-click the media player icon on the System page of the Component palette.2 Using the Object Inspector, set the Name property of the media player toVideoPlayer1.3 Select its DeviceType property and choose dtAVIVideo from the drop-down list.4 Select its FileName property, click the ellipsis (& ) button, choose the speedis.avifile from your.\Demos\Coolstuf directory.Click Open in the Open dialog.5 Set its AutoOpen property to True and its Visible property to False.Wor k i ng wi t h gr aphi c s and mul t i medi a 12-33Wo r k i n g wi t h mu l t i me d i a6 Double-click the Animate icon from the Win32 page of the Component palette.Setits AutoSize property to False, its Height property to 175 and Width property to200.Click and drag the animation control to the top left corner of the form.7 Click the media player to bring back focus to it.Select its Display property andchoose Animate1 from the drop down list.8 Click the form to bring focus to it and select its Name property and enterDelphi_Ad.Now resize the form to the size of the animation control.9 Double-click the form s OnActivate event and write the following code to run theAVI video when the form is in focus:VideoPlayer1.Play;10 Choose Run|Run to execute the AVI video.12-34 Dev el oper s Gui deCh a p t e r13Chapter13Writing multi-threaded applicationsSeveral objects make writing multi-threaded applications easier.Multi-threadedapplications are applications that include several simultaneous paths of execution.While using multiple threads requires careful thought, it can enhance your programsby:" Avoiding bottlenecks.With only one thread, a program must stop all executionwhen waiting for slow processes such as accessing files on disk, communicatingwith other machines, or displaying multimedia content.The CPU sits idle until theprocess completes.With multiple threads, your application can continue executionin separate threads while one thread waits for the results of a slow process." Organizing program behavior.Often, a program s behavior can be organized intoseveral parallel processes that function independently.Use threads to launch asingle section of code simultaneously for each of these parallel cases.Use threadsto assign priorities to various program tasks so that you can give more CPU timeto more critical tasks." Multiprocessing
[ Pobierz całość w formacie PDF ]