Skip to content

Commit

Permalink
SampleBundle.at() reversing order of input parameters. issue #70
Browse files Browse the repository at this point in the history
  • Loading branch information
nwolek committed Jan 3, 2016
1 parent bc29f15 commit a1ccde6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/core/JamomaSample.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ namespace Jamoma {
@warning This function is experimental while work on issue #70 continues
*/
template <class InterpolatorType = Jamoma::Interpolator::Linear<Sample>>
Sample at(size_t channel, double interpolatedFrameIndex) {
Sample at(double interpolatedFrameIndex, size_t channel = 0) {
Sample output = 0.0;
Sample sampleAtIndex0 = 0.0;
Sample sampleAtIndex1 = 0.0;
Expand Down
10 changes: 5 additions & 5 deletions test/SampleBundle/SampleBundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,19 @@ namespace Jamoma {
{
double d = 3.0 * i / 4.0;

temp = test_bundle.at<Jamoma::Interpolator::None<Sample>>(0,d);
temp = test_bundle.at<Jamoma::Interpolator::None<Sample>>(d);
std::cout << "none ( " << d << " ) = " << temp << std::endl;

temp = test_bundle.at<Jamoma::Interpolator::Nearest<Sample>>(0,d);
temp = test_bundle.at<Jamoma::Interpolator::Nearest<Sample>>(d);
std::cout << "nearest ( " << d << " ) = " << temp << std::endl;

temp = test_bundle.at<Jamoma::Interpolator::Cosine<Sample>>(0,d);
temp = test_bundle.at<Jamoma::Interpolator::Cosine<Sample>>(d);
std::cout << "cosine ( " << d << " ) = " << temp << std::endl;

temp = test_bundle.at<Jamoma::Interpolator::Linear<Sample>>(0,d);
temp = test_bundle.at<Jamoma::Interpolator::Linear<Sample>>(d);
std::cout << "linear ( " << d << " ) = " << temp << std::endl;

temp = test_bundle.at<Jamoma::Interpolator::Cubic<Sample>>(0,d);
temp = test_bundle.at<Jamoma::Interpolator::Cubic<Sample>>(d);
std::cout << "cubic ( " << d << " ) = " << temp << std::endl;

if (i % 4 == 0) { // every 4th item should be a whole number we can compare with regular access
Expand Down

0 comments on commit a1ccde6

Please sign in to comment.