[timing] Still struggling. Issues below.

Loader: can't instantiate TimingSegment due to abstract nature.
Writer: thinks there is no definition with what is provided.

Anyone want a crack at it?
This commit is contained in:
Jason Felds
2011-07-15 18:39:41 -04:00
parent d9f301a85a
commit bcec471213
2 changed files with 10 additions and 10 deletions
+5 -5
View File
@@ -15,16 +15,16 @@ void NotesLoaderJson::GetApplicableFiles( const RString &sPath, vector<RString>
GetDirListing( sPath + RString("*.json"), out );
}
static void Deserialize(TimingSegment *seg, const Json::Value &root)
static void Deserialize(TimingSegment &seg, const Json::Value &root)
{
seg->SetBeat((float)(root["Beat"].asDouble()));
if (seg->GetType() == SEGMENT_BPM)
(&seg)->SetBeat((float)(root["Beat"].asDouble()));
if ((&seg)->GetType() == SEGMENT_BPM)
{
static_cast<BPMSegment *>(seg)->SetBPM((float)(root["BPM"].asDouble()));
static_cast<BPMSegment *>(&seg)->SetBPM((float)(root["BPM"].asDouble()));
}
else
{
static_cast<StopSegment *>(seg)->SetPause((float)(root["Seconds"].asDouble()));
static_cast<StopSegment *>(&seg)->SetPause((float)(root["Seconds"].asDouble()));
}
}