[timing] Loader compiles. Writer: not yet.

This commit is contained in:
Jason Felds
2011-07-15 19:12:19 -04:00
parent a785bcf905
commit 3ffafc4d2b
2 changed files with 14 additions and 1 deletions
+9
View File
@@ -31,6 +31,15 @@ namespace JsonUtil
for(unsigned i=0; i<v.size(); i++)
fn(*v[i], root[i]);
}
template<class T>
static void SerializeVectorPointers(const vector<const T*> &v, void fn(const T *, Json::Value &), Json::Value &root)
{
root = Json::Value(Json::arrayValue);
root.resize(v.size());
for(unsigned i=0; i<v.size(); i++)
fn(*v[i], root[i]);
}
template<typename V, typename T>
static void SerializeArray(const V &v, void fn(const T &, Json::Value &), Json::Value &root)
+5 -1
View File
@@ -19,6 +19,7 @@ enum TimingSegmentType
SEGMENT_SCROLL,
SEGMENT_FAKE,
NUM_TimingSegmentType,
TimingSegmentType_Invalid,
};
const RString& TimingSegmentTypeToString( TimingSegmentType tst );
@@ -76,7 +77,10 @@ struct TimingSegment
* @return the starting beat. */
float GetBeat() const;
virtual TimingSegmentType GetType() const = 0;
virtual TimingSegmentType GetType() const
{
return TimingSegmentType_Invalid;
}
/**
* @brief Compares two DrivedSegments to see if one is less than the other.