2
2
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
3
3
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
5
* Inspired by tonegenerator of
5
* Inspired by tonegenerator of
6
6
* Laurielle Lea <laurielle.lea@savoirfairelinux.com> (2004)
8
8
* This program is free software; you can redistribute it and/or modify
9
9
* it under the terms of the GNU General Public License as published by
10
10
* the Free Software Foundation; either version 3 of the License, or
41
41
* @brief Loop on a sound file
57
* Get the next fragment of the tone
58
* the function change the intern position, and will loop
59
* @param output The data buffer
60
* @param nb of int16 to send
61
* @param volume The volume
62
* @return the number of int16 sent (nb*2)
64
int getNext(SFLDataFormat* output, int nb, short volume=100);
67
* Reset the pointer position
69
void reset() { _pos = 0; }
72
* Accessor to the size of the buffer
73
* @return unsigned int The size
75
unsigned int getSize() { return _size; }
79
/** The data buffer */
80
SFLDataFormat* _buffer;
82
/** Number of int16 inside the buffer, not the delay */
85
/** current position, set to 0, when initialize */
94
AudioLoop(const AudioLoop& rh);
96
// Assignment Operator
97
AudioLoop& operator=( const AudioLoop& rh);
58
* Get the next fragment of the tone
59
* the function change the intern position, and will loop
60
* @param output The data buffer
61
* @param nb of int16 to send
62
* @param volume The volume
63
* @return the number of int16 sent (nb*2)
65
int getNext (SFLDataFormat* output, int nb, short volume=100);
68
* Reset the pointer position
75
* Accessor to the size of the buffer
76
* @return unsigned int The size
78
unsigned int getSize() {
84
/** The data buffer */
85
SFLDataFormat* _buffer;
87
/** Number of int16 inside the buffer, not the delay */
90
/** current position, set to 0, when initialize */
99
AudioLoop (const AudioLoop& rh);
101
// Assignment Operator
102
AudioLoop& operator= (const AudioLoop& rh);
100
105
#endif // __AUDIOLOOP_H__