Skip to content

Commit be164c9

Browse files
committed
FileLoop comments
1 parent a637307 commit be164c9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/AudioLibs/FileLoop.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,16 @@ template <class FileType> class FileLoopT : public AudioStream {
5050
/// defines the start position after the rewind. E.g. for wav files this should be 44
5151
void setStartPos(int pos) { start_pos = pos; }
5252

53-
/// defines the requested playing size in bytes
53+
/// optionally defines the requested playing size in bytes
5454
void setSize(size_t len) {
5555
total_size = len;
5656
}
5757

58+
/// Returns the (requested) file size
59+
size_t size() {
60+
return total_size == -1 ? current_file.size() : total_size;
61+
}
62+
5863
/// You can be notified about a rewind
5964
void setCallback(void (*cb)(FileLoopT &loop)){
6065
callback = cb;
@@ -107,15 +112,11 @@ template <class FileType> class FileLoopT : public AudioStream {
107112
return result;
108113
}
109114

115+
// Returns the bool of the current file
110116
operator bool() {
111117
return current_file;
112118
}
113119

114-
/// Returns the (requested) file size
115-
size_t size() {
116-
return total_size == -1 ? current_file.size() : total_size;
117-
}
118-
119120
/// @return true as long as we are looping
120121
bool isLoopActive() { return loop_count > 0 || loop_count == -1; }
121122

0 commit comments

Comments
 (0)