ActiveMovie attribute description, user information (more comprehensive)

Source: Internet
Author: User

Source: 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
In the latest versions of 95/98 and Windows NT, The activemovie control is provided as part of the operating system, 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 ,*. mpa) (Windows installed in the system
Different Versions of Media Player support different formats ).
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 Opened 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 );
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.