UsbCamera: Scale some properties to make them constently percentages.

The "raw" version of these properties are still available, just prefixed
with "raw_".
This commit is contained in:
Peter Johnson
2016-12-22 20:51:04 -08:00
parent 10b13da3da
commit ce69783871
8 changed files with 489 additions and 158 deletions

View File

@@ -48,16 +48,24 @@ class CvSourceImpl : public SourceImpl {
class PropertyData : public PropertyBase {
public:
PropertyData() = default;
PropertyData(llvm::StringRef name_) : PropertyBase{name_} {}
PropertyData(llvm::StringRef name_, CS_PropertyKind kind_, int minimum_,
int maximum_, int step_, int defaultValue_, int value_)
: PropertyBase{name_, kind_, minimum_, maximum_,
step_, defaultValue_, value_} {}
: PropertyBase{name_, kind_, step_, defaultValue_, value_} {
hasMinimum = true;
minimum = minimum_;
hasMaximum = true;
maximum = maximum_;
}
~PropertyData() override = default;
std::function<void(CS_Property property)> onChange;
};
protected:
std::unique_ptr<PropertyBase> CreateEmptyProperty(
llvm::StringRef name) const override;
bool CacheProperties(CS_Status* status) const override;
private: