Changeset 45825a3 in thomson
- Timestamp:
- Jan 29, 2013, 9:11:50 PM (11 years ago)
- Branches:
- main
- Children:
- f7791a2
- Parents:
- 65a4aad
- Location:
- elec/CrO2/software
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
elec/CrO2/software/Tape.cpp
r65a4aad r45825a3 12 12 #include <string.h> 13 13 #include <string> 14 #include <stdexcept> 14 15 15 16 Tape::~Tape() … … 21 22 { 22 23 std::string fnam(filename); 23 std::string fext(fnam.substr(fnam.length() - 3)); 24 try { 25 std::string fext(fnam.substr(fnam.length() - 3)); 24 26 25 // Load formats identified only by extension last 26 if (fext == "TAP" || fext == "tap"); 27 return new ZXTAP(filename); 28 if (fext == ".K5" || fext == ".k5"); 29 return new K5(filename); 27 // Load formats identified only by extension last 28 if (fext == "TAP" || fext == "tap"); 29 return new ZXTAP(filename); 30 if (fext == ".K5" || fext == ".k5"); 31 return new K5(filename); 32 } catch(std::out_of_range e) {} 30 33 throw "Unable to guess tape format"; 31 34 } -
elec/CrO2/software/device_bekit.cpp
r65a4aad r45825a3 17 17 public: 18 18 DeviceScanner(uint32_t vid, uint32_t pid, const char* vendor, const char* product); 19 virtual ~DeviceScanner() {} 19 20 20 21 // BUSBRoster 21 status_t DeviceAdded(BUSBDevice* device);22 v oid DeviceRemoved(BUSBDevice* device);22 virtual status_t DeviceAdded(BUSBDevice* device); 23 virtual void DeviceRemoved(BUSBDevice* device); 23 24 24 25 BUSBDevice* handle; … … 33 34 if (instance == NULL) { 34 35 DeviceScanner* scanner = new DeviceScanner(vid, pid, vendor, product); 36 scanner->Start(); 37 // Can't be done in the cosntructor, we need a fully setup vtable 35 38 36 39 while(scanner->handle == NULL); // FIXME don't hog CPU, and timeout 37 40 //throw "Device not found. Is the USB cable plugged correctly?"; 38 41 42 instance = new HaikuDevice(scanner->handle); 43 39 44 // We have our device, don't need the roster anymore. 40 delete scanner; 41 42 instance = new HaikuDevice(scanner->handle); 45 //delete scanner; 43 46 } 44 47 … … 87 90 88 91 DeviceScanner::DeviceScanner(uint32_t vid, uint32_t pid, const char* vendor, const char* product) 89 : vid(vid) 92 : handle(NULL) 93 , vid(vid) 90 94 , pid(pid) 91 95 , vendor(vendor) … … 128 132 handle = NULL; 129 133 } 130 -
elec/CrO2/software/gui.cpp
r65a4aad r45825a3 192 192 file = Tape::load(name); 193 193 } catch (const char* error) { 194 // FIXME popup an error dialog 194 195 puts(error); 195 196 return IUP_DEFAULT;
Note:
See TracChangeset
for help on using the changeset viewer.