File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments