home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
sybase
/
starbuck
/
hpp.z
/
WMEDIA.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
7KB
|
226 lines
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 1994, by WATCOM International Inc. All rights %
% reserved. No part of this software may be reproduced or %
% used in any form or by any means - graphic, electronic or %
% mechanical, including photocopying, recording, taping or %
% information storage and retrieval systems - except with the %
% written permission of WATCOM International Inc. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WMediaPlayer -- Wrapper for the Windows 95 Media Player control.
*
*
* Events:
*
* MediaNotifyError --
*
* MediaNotifyMedia --
*
* MediaNotifyMode --
*
* MediaNotifyPos --
*
* MediaNotifySize --
*
*************************************************************************/
#ifndef _WMEDIA_HPP_INCLUDED
#define _WMEDIA_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WCONTROL_HPP_INCLUDED
# include "wcontrol.hpp"
#endif
#ifndef _WFILPATH_HPP_INCLUDED
# include "wfilpath.hpp"
#endif
#ifdef _UNICODE
#define WMPNotifyMedia WMPNotifyMediaUnicode
#else
#define WMPNotifyMedia WMPNotifyMediaAnsi
#endif
//
// MediaPlayer styles
//
#define WMPNoAutoSizeWindow ((WStyle)0x00000001) // MCIWNDF_NOAUTOSIZEWINDOW
#define WMPNoPlayBar ((WStyle)0x00000002) // MCIWNDF_NOPLAYBAR
#define WMPNoAutoSizeMovie ((WStyle)0x00000004) // MCIWNDF_NOAUTOSIZEMOVIE
#define WMPNoMenu ((WStyle)0x00000008) // MCIWNDF_NOMENU
#define WMPShowName ((WStyle)0x00000010) // MCIWNDF_SHOWNAME
#define WMPShowPos ((WStyle)0x00000020) // MCIWNDF_SHOWPOS
#define WMPShowMode ((WStyle)0x00000040) // MCIWNDF_SHOWMODE
#define WMPShowAll ((WStyle)0x00000070) // MCIWNDF_SHOWALL
#define WMPNotifyAnsi ((WStyle)0x00000080) // MCIWNDF_NOTIFYANSI
#define WMPNotifyMode ((WStyle)0x00000100) // MCIWNDF_NOTIFYMODE
#define WMPNotifyPos ((WStyle)0x00000200) // MCIWNDF_NOTIFYPOS
#define WMPNotifySize ((WStyle)0x00000400) // MCIWNDF_NOTIFYSIZE
#define WMPNotifyError ((WStyle)0x00001000) // MCIWNDF_NOTIFYERROR
#define WMPNotifyAll ((WStyle)0x00001F00) // MCIWNDF_NOTIFYALL
#define WMPNotifyMediaAnsi ((WStyle)0x00000880) // MCIWNDF_NOTIFYMEDIAA
#define WMPNotifyMediaUnicode ((WStyle)0x00000800) // MCIWNDF_NOTIFYMEDIAW
#define WMPRecord ((WStyle)0x00002000) // MCIWNDF_RECORD
#define WMPNoErrorDlg ((WStyle)0x00004000) // MCIWNDF_NOERRORDLG
#define WMPNoOpen ((WStyle)0x00008000) // MCIWNDF_NOOPEN
#ifdef _UNICODE
#define WMPDefault ((WStyle)0x50001F51L) // WS_VISIBLE|WS_CHILD|MCIWNDF_SHOWALL|MCIWNDF_NOAUTOSIZEWINDOW|MCIWNDF_NOTIFYALL|MCIWNDF_NOTIFYMEDIAW
#else
#define WMPDefault ((WStyle)0x50001FF1L) // WS_VISIBLE|WS_CHILD|MCIWNDF_SHOWALL|MCIWNDF_NOAUTOSIZEWINDOW|MCIWNDF_NOTIFYALL|MCIWNDF_NOTIFYMEDIAA
#endif
#define WMPDefaultOld (((WStyle)0x50001F71L)|WMPNotifyMedia) // WS_VISIBLE|WS_CHILD|MCIWNDF_SHOWALL|MCIWNDF_NOAUTOSIZEWINDOW|MCIWNDF_NOTIFYALL|MCIWNDF_NOTIFYMEDIA
struct WMediaNotifyEventData : WEventData {
WChar* fileName;
WLong lData;
};
class WCMCLASS WMediaPlayer : public WControl {
WDeclareSubclass( WMediaPlayer, WControl );
public:
WMediaPlayer();
~WMediaPlayer();
/*******************************************************************
* Properties
*******************************************************************/
// CanEject
WBool GetCanEject();
// CanPlay
WBool GetCanPlay();
// CanRecord
WBool GetCanRecord();
// CanSave
WBool GetCanSave();
// Position
#define WMEDIAPLAYER_SEEK_HOME -1
#define WMEDIAPLAYER_SEEK_START -1
#define WMEDIAPLAYER_SEEK_END -2
WBool SetPosition( WLong position );
WLong GetPosition();
// Repeat
WBool GetRepeat();
WBool SetRepeat( WBool repeat );
// Speed
WUInt GetSpeed();
WBool SetSpeed( WUInt speed=1000 );
// Volume
WUInt GetVolume();
WBool SetVolume( WUInt volume=1000 );
// Zoom
WUInt GetZoom();
WBool SetZoom( WUInt zoom=100 );
/*******************************************************************
* Methods
*******************************************************************/
// Close
WBool Close();
// Eject
WBool Eject();
// New
WBool New( const WFilePath & fileName );
// Open
//
// The parameterless version invokes an open dialog
WBool Open();
WBool Open( const WFilePath & fileName, WBool createIfDoesntExist=FALSE );
// Pause
WBool Pause();
// Play
WBool Play( WLong from=WMEDIAPLAYER_SEEK_START,
WLong to=WMEDIAPLAYER_SEEK_END );
// Record
WBool Record();
// Resume
WBool Resume();
// Save
//
// The parameterless version invokes a save dialog
WBool Save();
WBool Save( const WFilePath & fileName );
// Step
WBool Step( WLong increment );
// Stop
WBool Stop();
/*******************************************************************
* Overrides
*******************************************************************/
virtual WBool Destroy();
virtual WBool ProcessMessage( const WMessage & msg,
WLong & returns );
virtual const WChar * InitializeClass();
virtual WStyle GetDefaultStyle() const;
virtual WStyle GetDefaultExtendedStyle() const;
virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
void * data=NULL );
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WMEDIA_HPP_INCLUDED