[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
@@ -32,6 +32,15 @@ namespace JsonUtil
fn(*v[i], root[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> template<typename V, typename T>
static void SerializeArray(const V &v, void fn(const T &, Json::Value &), Json::Value &root) 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_SCROLL,
SEGMENT_FAKE, SEGMENT_FAKE,
NUM_TimingSegmentType, NUM_TimingSegmentType,
TimingSegmentType_Invalid,
}; };
const RString& TimingSegmentTypeToString( TimingSegmentType tst ); const RString& TimingSegmentTypeToString( TimingSegmentType tst );
@@ -76,7 +77,10 @@ struct TimingSegment
* @return the starting beat. */ * @return the starting beat. */
float GetBeat() const; 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. * @brief Compares two DrivedSegments to see if one is less than the other.