~ubuntu-branches/ubuntu/lucid/ecasound2.2/lucid

« back to all changes in this revision

Viewing changes to libecasound/osc-gen.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Junichi Uekawa
  • Date: 2008-09-26 09:58:52 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080926095852-k3v9ewhmxpaltusw
Tags: 2.5.2-3
yodl 2.13.1 removed --unique-output option. Remove --unique-output
accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// ------------------------------------------------------------------------
2
2
// osc-gen.cpp: Generic oscillator
3
 
// Copyright (C) 1999-2002 Kai Vehmanen
 
3
// Copyright (C) 1999-2002,2008 Kai Vehmanen
4
4
//
5
5
// This program is fre software; you can redistribute it and/or modify
6
6
// it under the terms of the GNU General Public License as published by
23
23
 
24
24
#include <kvu_numtostr.h>
25
25
 
 
26
#include "eca-object-factory.h"
26
27
#include "osc-gen.h"
27
28
#include "oscillator.h"
28
29
#include "eca-logger.h"
29
30
 
30
 
CONTROLLER_SOURCE::parameter_t GENERIC_OSCILLATOR::value(void)
 
31
CONTROLLER_SOURCE::parameter_t GENERIC_OSCILLATOR::value(double pos)
31
32
{
32
33
  if (mode_rep == 0)
33
34
    update_current_static();
34
35
  else
35
36
    update_current_linear();
36
37
 
37
 
  loop_pos_rep += position_in_seconds_exact() - last_global_pos_rep;
38
 
  last_global_pos_rep = position_in_seconds_exact();
 
38
  /* FIXME: not really seeking-safe */
 
39
  loop_pos_rep += pos - last_global_pos_rep;
 
40
  last_global_pos_rep = pos;
39
41
 
40
42
  if (loop_pos_rep > loop_length_rep) {
41
43
    loop_pos_rep = 0.0f;
120
122
 
121
123
void GENERIC_OSCILLATOR::init(void)
122
124
{
123
 
  ECA_LOG_MSG(ECA_LOGGER::user_objects, "(osc-gen) Generic oscillator init.");
 
125
  ECA_LOG_MSG(ECA_LOGGER::user_objects,
 
126
              "Generic oscillator init with params: "
 
127
              + ECA_OBJECT_FACTORY::operator_parameters_to_eos(this));
124
128
}
125
129
 
126
130
GENERIC_OSCILLATOR::~GENERIC_OSCILLATOR (void)