Logo Search packages:      
Sourcecode: ecawave version File versions  Download package

qenonblockingevent.cpp

// ------------------------------------------------------------------------
// qenonblockingevent.cpp: Virtual base for nonblocking processing events
// Copyright (C) 1999-2001 Kai Vehmanen (kai.vehmanen@wakkanet.fi)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
// ------------------------------------------------------------------------

#include <iostream>

#include <qprogressdialog.h>
#include <eca-error.h>

#include "qenonblockingevent.h"

using std::cerr;
using std::endl;

00030 void QENonblockingEvent::stop(void) {
  // --------
  DBC_REQUIRE(ectrl->is_engine_started() == true);
  DBC_REQUIRE(is_triggered() == true);
  // --------
  try {
    ectrl->stop();
    ectrl->disconnect_chainsetup();
    toggle_triggered_state(false);
  }
  catch(ECA_ERROR& e) {
    cerr << "---\nlibecasound error while stopping event: [" << e.error_section() << "] : \"" << e.error_message() << "\"\n\n";
  }

  // --------
  DBC_ENSURE(ectrl->is_connected() == false);
  DBC_ENSURE(is_triggered() == false);
  // --------
}

00050 long int QENonblockingEvent::position_in_samples(void) const {
  if (ectrl->is_running() == true)
    return(ectrl->position_in_samples() - ectrl->chainsetup_buffersize());
  return(0);
}

Generated by  Doxygen 1.6.0   Back to index