mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2026-01-12 07:35:55 +01:00
Implement "holdover events," noting those log events which are not listed in the currently loaded log but which are present because they were playing when this log was loaded.
This fixes problems arising when the duplicate IDs thus introduced cause confusion.
This commit is contained in:
@@ -626,20 +626,22 @@ void RDLogEvent::setLogLine(int line,RDLogLine *ll)
|
||||
}
|
||||
|
||||
|
||||
RDLogLine *RDLogEvent::loglineById(int id) const
|
||||
RDLogLine *RDLogEvent::loglineById(int id, bool ignore_holdovers) const
|
||||
{
|
||||
for(int i=0;i<size();i++) {
|
||||
if(log_line[i]->id()==id) {
|
||||
return log_line[i];
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
int line = lineById(id, ignore_holdovers);
|
||||
if(line == -1)
|
||||
return NULL;
|
||||
else
|
||||
return log_line[line];
|
||||
}
|
||||
|
||||
|
||||
int RDLogEvent::lineById(int id) const
|
||||
int RDLogEvent::lineById(int id, bool ignore_holdovers) const
|
||||
{
|
||||
for(int i=0;i<size();i++) {
|
||||
if(ignore_holdovers && log_line[i]->isHoldover()) {
|
||||
continue;
|
||||
}
|
||||
if(log_line[i]->id()==id) {
|
||||
return i;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user