MCI.H (2985B)
1 // 2 // Copyright 2020 Electronic Arts Inc. 3 // 4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 5 // software: you can redistribute it and/or modify it under the terms of 6 // the GNU General Public License as published by the Free Software Foundation, 7 // either version 3 of the License, or (at your option) any later version. 8 9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 10 // in the hope that it will be useful, but with permitted additional restrictions 11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 12 // distributed with this program. You should have received a copy of the 13 // GNU General Public License along with permitted additional restrictions 14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection 15 16 #ifndef _MCI_H_ 17 #define _MCI_H_ 18 /**************************************************************************** 19 * 20 * FILE 21 * MCI.H 22 * 23 * DESCRIPTION 24 * 25 * PROGRAMMER 26 * Denzil E. Long, Jr. 27 * 28 * DATE 29 * 6/22/98 30 * 31 ****************************************************************************/ 32 33 #include "function.h" 34 35 #ifdef MCIMPEG 36 #include <windows.h> 37 #include <mmsystem.h> 38 #include <digitalv.h> 39 #include "watcom.h" 40 41 /* MCIDevice - MCI device capabilities and description 42 * 43 * name - Name used to open device. 44 * description - Product description 45 * type - Device type 46 * canEject - Can eject media flag 47 * canPlay - Can playback media 48 * canRecord - Can record media 49 * canSave - Can save media 50 * usesDevElem - Uses device element 51 * hasAudio - Media supports audio 52 * hasVideo - Media supports video 53 * reqElemFile - Requires element file 54 */ 55 typedef struct _MCIDevice 56 { 57 char name[64]; 58 char description[64]; 59 unsigned long type; 60 bool canEject; 61 bool canPlay; 62 bool canRecord; 63 bool canSave; 64 bool usesDevElem; 65 bool hasAudio; 66 bool hasVideo; 67 bool reqElemFile; 68 } MCIDevice; 69 70 /* MCI enumeration callback definition */ 71 typedef bool (MCIEnumCB)(MCIDevice* desc, void*); 72 73 class MCI 74 { 75 public: 76 // Open MCI device 77 MCIDEVICEID OpenDevice(const char* name); 78 void CloseDevice(MCIDEVICEID id); 79 80 // Enumerate devices 81 bool EnumerateDevices(MCIEnumCB* callback, void* context); 82 83 // Get number of MCI devices name in registry or [MCI] section 84 // of system.ini 85 unsigned int GetDeviceCount(void); 86 87 // Get device name from registry or [MCI] section of system.ini 88 bool GetDeviceName(unsigned int item, char* buffer); 89 90 // Get general device description 91 bool GetDeviceDescription(const char* name, MCIDevice* caps); 92 93 // Get type name (IE: Digital Video) from type ID (IE: MCI_DEVTYPE_DIGITAL_VIDEO) 94 const char* GetDeviceTypeName(unsigned long type); 95 96 // Get device product name 97 bool GetProductName(MCIDEVICEID id, char* buffer); 98 99 // Get device capability 100 bool GetCapability(MCIDEVICEID id, unsigned long capItem, 101 unsigned long* result); 102 }; 103 104 #endif // MCIMPEG 105 #endif // _MCI_H_