[Share] activemovie attribute description, user information (more comprehensive)
Source Address: http://bbs.bccn.net/thread-181672-1-1.html
It seems that many people are asking about this control. I found some information to share with you. Please add any omissions.
The previous sections mainly explain the functions. If you are in urgent need, you can directly reverse the process to view the Attribute Table.
Although the control is made by Microsoft, it still seems to be somewhat inadequate. Some interfaces are not friendly enough to establish functions by themselves, and some cannot be found in later versions of msdn, very troublesome.
Body:
Register the control
First put the file amovie. Copy ocx (file name may vary) to (Operating System Disk) D:/Windows/system32/
Click Start> RUN> regsvr32 D:/Windows/system32/amovie. ocx, and press Enter.
Register successfully. Go to VC project-> Add to project-> components and controls. Click to open the components and controls gallery file, select activemovie control object, and click Insert
You can see the control icon in the selection bar of the VC control!
Activemovie control is a control developed by Microsoft for multimedia programming. It provides excellent playback functions for audio and video media files and supports multiple file formats, you can play normally from the most common WAV and AVI files to VCD video files in the Mpeg Compression format. The control can automatically identify the device type based on the file suffix and complete corresponding control. Therefore, it is a good idea to use the activemovie control if the application being compiled needs to provide multimedia support. In fact, many excellent multimedia applications use the activemovie Control for internal multimedia playback. As long as you carefully design the user interface of the application, we can also develop a full-featured, beautiful-looking, and quite standard multimedia player. In addition, the activemovie control is provided as part of the operating system in the latest versions of Windows 95/98 and Windows NT, even if the activemovie control is not installed in the user system, microsoft's license agreement also allows you to publish activemovie runtime files in your application release package.
This article will first introduce some special properties, methods, and events of the activemovie control, and then use this control to develop a multimedia player with certain functions, finally, let's talk about several issues that need to be paid attention to when using the activemovie Control for multimedia development.
1. properties, methods, and events unique to the activemovie Control
The special properties and descriptions of the activemovie control are shown in table 1. Common attributes of other controls, such as borderstyle,
Displayforecolor, hwnd, and so on. This control is also supported.
Attribute Table 1 unique to the activemovie Control
Attribute description
Currentstate indicates the control status: stopped, paused, running
Displaymode: Time or frame
Filename specifies the full name of the source file to be operated by the control.
Rate indicates the playback rate of a media stream.
Readystate indicates the control status and whether the source file has been loaded.
Selectionend indicates the end position of the playback media stream.
Selectionstart indicates the start position of the playing media stream
Currentposition indicates the current position of the playing media stream
Volume sets the volume
The activemovie control has three common methods: Run, stop, and pause. The control controls the playback, stop, and pause of media streams respectively. You can call them directly during use. Other common methods such as drag, move, and setfocus are also supported by this control.
The special events and descriptions of the activemovie control are shown in table 2.
Activemovie control-specific event table 2
Event Description
Displaymodechange triggered when the displaymode attribute value changes
Opencomplete triggered when the source file is fully loaded
Positionchange is triggered when the current position of the media stream changes
Readystatechange is triggered when the value of the readystate attribute of the control changes.
Statechange is triggered when the player status changes.
Error handling control error events
1. Functions of active movie control object
As a powerful Multimedia Writing Tool, Authorware supports mainstream media formats and supports more media types by calling the activemovie control. The activemovie control supports MIDI files (*. mid ,*. RMI ,*. MIDI), QuickTime file (*. moV ,*. qt), winodws media (*. ASF ,*. WM ,*. WMA), movie files (mPEG )(*. MPEG ,*. mpg ,*. m1v ,*. MPE ,*. MPV), media playback list (*. ASX ,*. wax ,*. m3u), video files (*. avi ,*. WMV), audio files (*. wav ,*. and ,*. au ,*. AIF ,*. MP2 ,*. MP3 ,*. (The versions of Windows Media Player installed in the system are different, and the supported formats are different ).
2. Common attributes of active movie control object
"Allowchangedisplaysize" -- whether to change the display size during running. The default value is true.
"Currentposition" -- current playback position. The default value is-1.
"Displaymode" -- sets the display mode during playback. The optional value is "0-time" -- display time, "1-frames" -- display frame. The default value is "0-time ".
"Displaysize" -- set the display size during playback, optional values include "0-0-default size" -- default size, "1-1-half size" -- half of normal size, and "2-2-double size" -- normal size double, "3-3-fullscreen" -- full screen, "4-4-fit to size" -- proper size, "5-5-one sixteenth screen" -- 1/16 screen size, "6-6 -One fourth screen "-- 1/4 screen size," 7-7 one half screen "-- 1/2 screen size. The default value is "0-0-default size ".
"Enablecontextmenu" -- specifies whether a control menu can appear when you right-click the screen. The default value is true.
"Enabled" -- set whether the control is useful. The default value is true.
"FILENAME" -- sets the playback file name.
"Enablefullscreencontrols" -- sets whether full screen control is available. The default value is false.
"Playcount" -- set the number of playbacks. The default value is 1.
"Playstate" -- the playback status, whose value changes with the file playback status in the control, it may be "0-Playback is stopped" -- the playing is stopped, "1-Playback is paused" -- the playing is paused, "2-stream is playing" -- the data stream is playing, "3 -Wait for stream to begin "-- wait for the data stream to start," 4-stream is scanning forward "-- Searching forward," 5-stream is scanning in reverse "-- Searching backward ," 6-stream has not been opened "-- not enabled yet.
"Rate" -- set the playback speed. If it is set to 1, the playback speed is normal. If it is greater than 1, the playback speed is fast forward.
"Readystate" -- Preparation status, whose value changes with the file playback status in the control, it may be "0-0-uninitialized" -- not initialized, "1-1-loading" -- loading, "3-3-interactive" -- connecting, "4-4-complete" -- already complete.
"Selectionend" -- sets the end position of the playback. The default value is-1, indicating that the video is played to the end.
"Selectionstart" -- set the start position of the playback. The default value is-1.
"Showcontrols" -- whether to display the control panel. The default value is true.
"Showdisplay" -- whether to display the display panel. The default value is false.
"Showpositioncontrols" -- whether to display the position button in the control panel. The default value is true.
"Showtracker" -- whether to display the audio track bar in the control panel. The default value is false.
"Volume" -- set the volume. The default value is-320.
3. Common Methods of active movie control object
"Fastforward" -- fast forward
"Fastreverse" -- fast return
"Next" -- next
"Pause" -- Pause
"Play" -- play
"Previous" -- previous
"Stop" -- stop
4. Common active movie control object events
"Endofstream" -- this event is generated when the playback ends.
"Playstatechange" -- this event is generated when the playback status changes.
"Positionchange" -- this event is generated when the playing position changes
The activemovie control is used to play a video. Common attribute tables
Attribute: (name)
Description: name of the activemovie control.
Property: custom
Description: The property page is displayed.
Attribute: allowchangedisplaymode
Note: The display mode is allowed or not allowed to be changed during running. Value:
True
False
Attribute: allowhidecontrols
Note: the Control Panel can be hidden or not allowed during operation. Value:
True
False
Attribute: allowhidedisplay
Note: hidden display panels are allowed/not allowed during operation. Value:
True
False
Attribute: appearance
Note: whether to use three-dimensional effects for rendering. Value:
0 AMV (plane)
1 amv3d (stereo)
Attribute: autorewind
Indicates whether to enable custom replay after media playback. Value:
True
False
Property: autostart
Note: whether to enable custom playback after opening a media file. Value:
True
False
Property: Balance
Note: You can obtain or set a multimedia stereo balance.
Attribute: borderstyle
Note: Set the border style. Value:
0 amvnone (no boundary line)
1 amvfixedsingle (Fixed Single Box)
Attribute: causevalidation
Note: whether the validate event of the second control occurs when the control obtains focus. Value:
True
False
Attribute: displaybackcolor
Description: displays the background color of the Panel. You can select from the pop-up palette.
Attribute: displayforecolor
Description: foreground color of the display panel. You can select from the pop-up palette.
Attribute: displaymode
Description: gets or sets the display mode (time or structure ). Value:
0 amvtime (time)
1 amvframes (structure)
Attribute: dragicon
Note: The Mouse icon of this object during dragging
Attribute: dragmode
Description: Drag mode of the object. Value:
0 vbmanual (manual)
1 vbautomatic (automatic)
Attribute: enablecontextmenu
Note: Right-click to check whether the context menu is displayed. Value:
True
False
Property: Enabled
Description: Used to set whether to respond to events. Value:
True available
False is not available. When executing the program, the object is displayed in gray and does not respond to any events.
Attribute: enablepositioncontrols
Note: whether to display the position button on the control panel. Value:
True
False
Attribute: enableselectiontioncontrols
Note: whether the select button is displayed on the control panel. Value:
True
False
Attribute: enabletracker
Note: whether trace entries are displayed on the control panel. Value:
True
False
Property: Filename
Description: obtains or sets the current multimedia file.
Attribute: fullscreenmode
Description: whether the screen is displayed. Value:
True
False
Property: Height
Description: height of the activemoviel control.
Property: helpcontextid
Description: Specifies the default help file context identifier of an object.
Attribute: Index
Description: number in the object Array
Property: left
Distance from the Left Border of the container
Attribute: moviewindowsize
Description: obtains or sets the window size of a movie. Value:
0 amvoriginalsize
1 amvadaoubleaoariginasize
2 amvonesixteenthsreen
3 amvonefourthscreen
4 amvonehalfscreen
Property: playcount
Returns or sets the number of video playback times.
Property: Rate
Description: gets or sets the multimedia ratio.
Property: selectionend
Description: gets or sets where to stop playing.
Property: selectionstart
Description: gets or sets where to start playing.
Property: showcontrols
Description: Display/hide control panel. Value:
True
False
Property: showdisplay
Description: Display/hide the display panel. Value:
True
False
Property: showpositioncontrols
Note: The "show/hide" button on the control panel is displayed. Value:
True
False
Property: showselectiontioncontrols
Note: select the show/hide button on the control panel. Value:
True
False
Property: showtracker
Note: The trace entries are displayed/hidden in the control panel. Value:
True
False
Attribute: tabindex
Description: gets or sets the number of the object in the parent form (the order in which the object responds to the tab key in the parent form)
Attribute: tabstop
Note: You can use the "tab" key to select this object. Value:
True
False is not allowed.
Attribute: Tag
Note: additional data required by the storage Program
Attribute: tooltiptext
Sets the prompt line for this object.
Property: Top
Description: distance from the container's top boundary
Property: visible
Note: sets the visibility of this object. Value:
True: This object is visible.
False: This object is invisible.
Attribute: volume
Description: gets or sets the multimedia volume.
Property: whatsthishelpid
Description: gets or sets the context numbers associated with objects.
Property: width
Description: sets the width of the object.
Getcurrentposition () // playback position
And activemovie control object's common attributes
1. Functions of the playback file:
Void cactivemovie3: Run ()
{
Invokehelper (0x60020001, dispatch_method, vt_empty, null, null );
}
2. Function for Pausing playback:
Void cactivemovie3: Pause ()
{
Invokehelper (0x60020002, dispatch_method, vt_empty, null, null );
}
4. Function for stopping playback:
Void cactivemovie3: Stop ()
{
Invokehelper (0x60020003, dispatch_method, vt_empty, null, null );
}
5. Functions for getting files:
Cstring cactivemovie3: getfilename ()
{
Cstring result;
Invokehelper (0xb, dispatch_propertyget, vt_bstr, (void *) & result, null );
Return result;
}
6. Set file functions:
Void cactivemovie3: setfilename (lpctstr lpsznewvalue)
{
Static byte parms [] = vts_bstr;
Invokehelper (0xb, dispatch_propertyput, vt_empty, null, parms,
Lpsznewvalue );
}
7. Function for obtaining the playback position:
Double cactivemovie3: getcurrentposition ()
{
Double result;
Invokehelper (0xd, dispatch_propertyget, vt_r8, (void *) & result, null );
Return result;
}
8. Set the playing position function:
Void cactivemovie3: setcurrentposition (double newvalue)
{
Static byte parms [] = vts_r8;
Invokehelper (0xd, dispatch_propertyput, vt_empty, null, parms, newvalue );
}
9. Function for obtaining volume:
Long cactivemovie3: getvolume ()
{
Long result;
Invokehelper (0x13, dispatch_propertyget, vt_i4, (void *) & result, null );
Return result;
}
10. Set the volume function:
Void cactivemovie3: setvolume (long nnewvalue)
{
Static byte parms [] = vts_i4;
Invokehelper (0x13, dispatch_propertyput, vt_empty, null, parms, nnewvalue );
}
11. Set the function for automatic start playback:
Void cactivemovie3: setautostart (bool bnewvalue)
{
Static byte parms [] = vts_bool;
Invokehelper (0x28, dispatch_propertyput, vt_empty, null, parms, bnewvalue );
}