Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

MemoryCardDriver.h

Go to the documentation of this file.
00001 #ifndef MEMORY_CARD_DRIVER_H 00002 #define MEMORY_CARD_DRIVER_H 1 00003 00004 struct UsbStorageDevice 00005 { 00006 UsbStorageDevice() { MakeBlank(); } 00007 00008 void MakeBlank() 00009 { 00010 // -1 means "don't know" 00011 iBus = -1; 00012 iPort = -1; 00013 iLevel = -1; 00014 iScsiIndex = -1; 00015 sScsiDevice = ""; 00016 sSerial = ""; 00017 sOsMountDir = ""; 00018 bNeedsWriteTest = true; 00019 bWriteTestSucceeded = false; 00020 bIsNameAvailable = false; 00021 sName = ""; 00022 idVendor = 0; 00023 idProduct = 0; 00024 sVendor = ""; 00025 sProduct = ""; 00026 }; 00027 int iBus; 00028 int iPort; 00029 int iLevel; 00030 CString sSerial; 00031 int iScsiIndex; 00032 CString sScsiDevice; 00033 CString sOsMountDir; // WITHOUT trailing slash 00034 bool bNeedsWriteTest; 00035 bool bWriteTestSucceeded; // only valid if bNeedsWriteTest == false 00036 bool bIsNameAvailable; // Name in the profile on the memory card. 00037 CString sName; // Name in the profile on the memory card. 00038 int idVendor; 00039 int idProduct; 00040 CString sVendor; 00041 CString sProduct; 00042 00043 bool IsBlank() const { return sOsMountDir.empty(); } 00044 void SetOsMountDir( const CString &s ); 00045 00046 bool operator==(const UsbStorageDevice& other) const; 00047 }; 00048 00049 class MemoryCardDriver 00050 { 00051 public: 00052 MemoryCardDriver() {}; 00053 virtual ~MemoryCardDriver() {}; 00054 virtual bool StorageDevicesChanged() = 0; 00055 virtual void GetStorageDevices( vector<UsbStorageDevice>& vStorageDevicesOut ) = 0; 00056 virtual bool MountAndTestWrite( UsbStorageDevice* pDevice, CString sMountPoint ) = 0; // return false if mount or write fails 00057 virtual void Unmount( UsbStorageDevice* pDevice, CString sMountPoint ) = 0; 00058 virtual void Flush( UsbStorageDevice* pDevice ) = 0; 00059 virtual void ResetUsbStorage() = 0; 00060 enum MountThreadState 00061 { 00062 detect_and_mount, 00063 detect_and_dont_mount, 00064 paused 00065 }; 00066 virtual void SetMountThreadState( MountThreadState mts ) = 0; 00067 }; 00068 00069 MemoryCardDriver *MakeMemoryCardDriver(); 00070 00071 #endif 00072 00073 /* 00074 * (c) 2003-2004 Chris Danford 00075 * All rights reserved. 00076 * 00077 * Permission is hereby granted, free of charge, to any person obtaining a 00078 * copy of this software and associated documentation files (the 00079 * "Software"), to deal in the Software without restriction, including 00080 * without limitation the rights to use, copy, modify, merge, publish, 00081 * distribute, and/or sell copies of the Software, and to permit persons to 00082 * whom the Software is furnished to do so, provided that the above 00083 * copyright notice(s) and this permission notice appear in all copies of 00084 * the Software and that both the above copyright notice(s) and this 00085 * permission notice appear in supporting documentation. 00086 * 00087 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00088 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00089 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00090 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00091 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00092 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00093 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00094 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00095 * PERFORMANCE OF THIS SOFTWARE. 00096 */ 00097

Generated on Thu Jan 27 20:57:24 2005 for StepMania by doxygen 1.3.7