ChunkStream add(int, Chunk)

Graphic save() and load() version 2


git-svn-id: svn://db.shs.com.ru/libs@346 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
2018-01-18 11:37:50 +00:00
parent e53bcb1733
commit 7a3f3a928e
5 changed files with 106 additions and 27 deletions

View File

@@ -558,3 +558,9 @@ PIVariantTypes::Enum CDSection::enumValues() const {
return ret;
}
XType::XType(const CDType & cdt) {
}

View File

@@ -65,6 +65,23 @@ protected:
};
class XType : public CDType {
friend class XSection;
public:
enum XMode {X_Current, X_All_Avg};
XType(const CDType & cdt = CDType());
void setXMode(XMode mode) {mode_ = mode;}
void setAvg(int avg) {avg_size = avg;}
double currentValue() const {if (history.isEmpty()) return 0; return history.back();}
private:
PIVector<double> history;
int avg_size;
XMode mode_;
};
class CDSection {
friend class CDCore;
friend class ::CD_Pult;
@@ -134,4 +151,16 @@ inline PICout operator <<(PICout s, const CDUtils::CDType & v) {
return s;
}
inline PICout operator <<(PICout s, const CDUtils::XType & v) {
s.space();
s.setControl(0, true);
switch (v.cd_type()) {
case CDUtils::CDType::cdX : s << "X["; break;
default : s << "Null["; break;
}
s << v.name() << "(" << v.index() << ")] = " << v.currentValue();
s.restoreControl();
return s;
}
#endif // CDUTILS_TYPES_H