|
@@ -123,7 +123,7 @@ int main(int argc, const char** argv) try
|
|
|
auto autorestart_count_display_size = int2{8,15};
|
|
|
auto& autorestart_count_display = ui.make<digit_display<1>>(autorestart_count_display_size, int2{1,0}, fg_color);
|
|
|
autorestart_count_display.set(autorestart_count);
|
|
|
- auto player = [&music_playing, &music_done, &music, i = loop(music->buffer()), play_count = unsigned(0),
|
|
|
+ auto player = [&music_playing, &music_done, i = loop(music->buffer()),
|
|
|
max_play_count = argc > 9 ? ston<unsigned>(argv[9]) : unsigned(5)]
|
|
|
(auto& device, auto buffer) mutable
|
|
|
{
|
|
@@ -134,9 +134,10 @@ int main(int argc, const char** argv) try
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- std::copy_n(i, buffer.size, buffer.begin());
|
|
|
+ auto buffer_size = buffer.end() - buffer.begin();
|
|
|
+ std::copy_n(i, buffer_size, buffer.begin());
|
|
|
|
|
|
- i += buffer.size;
|
|
|
+ i += buffer_size;
|
|
|
if(max_play_count != 0 && unsigned(i.count()) == max_play_count)
|
|
|
music_done = true;
|
|
|
};
|