-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split getVendorSpecificPTPClass from initPTPUSBCamera
- Loading branch information
Showing
2 changed files
with
32 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import {DeviceInfo} from '../DeviceInfo' | ||
import {TethrPanasonic} from './TethrPanasonic' | ||
import {TethrPTPUSB} from './TethrPTPUSB' | ||
import {TethrRicohTheta} from './TethrRicohTheta' | ||
import {TethrSigma} from './TethrSigma' | ||
|
||
/** | ||
* Return the vendor-specific PTPUSB subclass for the given device info. | ||
* @param info The device info to check | ||
* @returns The vendor-specific PTPUSB class or undefined if no vendor-specific class is found | ||
*/ | ||
export function getVendorSpecificPTPUSBClass( | ||
info: DeviceInfo | ||
): typeof TethrPTPUSB | undefined { | ||
switch (info.vendorExtensionID) { | ||
case 0x00000006: // Microsoft / Sigma / Ricoh | ||
if (info.vendorExtensionDesc === 'SIGMA') { | ||
return TethrSigma | ||
} else if (info.model.match(/theta/i)) { | ||
return TethrRicohTheta | ||
} | ||
break | ||
case 0x0000001c: // Panasnoic | ||
return TethrPanasonic | ||
break | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters