Chris@320: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@320: Chris@320: /* Chris@320: Sonic Visualiser Chris@320: An audio file viewer and annotation editor. Chris@320: Centre for Digital Music, Queen Mary, University of London. Chris@320: This file copyright 2006 Chris Cannam. Chris@320: Chris@320: This program is free software; you can redistribute it and/or Chris@320: modify it under the terms of the GNU General Public License as Chris@320: published by the Free Software Foundation; either version 2 of the Chris@320: License, or (at your option) any later version. See the file Chris@320: COPYING included with this distribution for more information. Chris@320: */ Chris@320: Chris@331: #include "ModelTransformer.h" Chris@320: Chris@350: ModelTransformer::ModelTransformer(Input input, const Transform &transform) : Chris@350: m_input(input), Chris@849: m_detached(false), Chris@877: m_detachedAdd(false), Chris@849: m_abandoned(false) Chris@849: { Chris@849: m_transforms.push_back(transform); Chris@849: } Chris@849: Chris@849: ModelTransformer::ModelTransformer(Input input, const Transforms &transforms) : Chris@849: m_transforms(transforms), Chris@849: m_input(input), Chris@320: m_detached(false), Chris@877: m_detachedAdd(false), Chris@320: m_abandoned(false) Chris@320: { Chris@320: } Chris@320: Chris@331: ModelTransformer::~ModelTransformer() Chris@320: { Chris@320: m_abandoned = true; Chris@320: wait(); Chris@849: if (!m_detached) { Chris@877: Models mine = getOutputModels(); Chris@877: foreach (Model *m, mine) delete m; Chris@877: } Chris@877: if (!m_detachedAdd) { Chris@877: Models mine = getAdditionalOutputModels(); Chris@877: foreach (Model *m, mine) delete m; Chris@849: } Chris@320: } Chris@320: