OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
segment.cpp
Go to the documentation of this file.
1#include "segment.h"
2
3#include <stdexcept>
4#include <iostream>
5
6using namespace Dx8;
7
9 if(!input.is("RIFF"))
10 throw std::runtime_error("not a riff");
11
12 char listId[5]={};
13 input.read(&listId,4);
14 input.read([this](Riff& ch){
15 if(ch.is("LIST")){
16 implReadList(ch);
17 }
18 });
19 }
20
21void Segment::implReadList(Riff& input) {
22 if(input.isListId("trkl")){
23 input.read([&](Riff& ch){
24 track.emplace_back(ch);
25 });
26 }
27 }
bool is(const char *idx) const
Definition riff.h:19
void read(std::u16string &str)
Definition riff.cpp:29
bool isListId(const char *id)
Definition riff.cpp:24
Segment()=default
std::vector< Track > track
Definition segment.h:14
Definition band.h:10