git.haldean.org qb / main cue.cpp
main

Tree @main (Download .tar.gz)

cue.cpp @main

4bd6138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#include "cue.hpp"

namespace qb {
  cue_node::cue_node(const context *c, const std::string &path)
    : node(c, path, qb::node_type::cue), path(path) {}
  cue_node::~cue_node() = default;

  int cue_node::minframe() const {
    int min = 0;
    for (const auto &track : tracks) {
      if (!track.hits.empty()) {
        min = std::min(min, track.hits.front());
      }
    }
    return min;
  }

  int cue_node::maxframe() const {
    int max = 0;
    for (const auto &track : tracks) {
      if (!track.hits.empty()) {
        max = std::max(max, track.hits.back());
      }
    }
    return max;
  }
}