changeset 2491:6c834c281fa2

Some VGM player changes I forgot to commit
author Michael Pavone <pavone@retrodev.com>
date Wed, 17 Apr 2024 21:55:30 -0700
parents a0837ea61fda
children 88210caedc53
files mediaplayer.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mediaplayer.c	Wed Apr 17 21:54:44 2024 -0700
+++ b/mediaplayer.c	Wed Apr 17 21:55:30 2024 -0700
@@ -169,6 +169,15 @@
 				stream->next_sample_cycle += stream->cycles_per_sample;
 				//TODO: deal with cycle adjustments
 				keep_going = 1;
+				if (stream->length_mode == 1) {
+					//unclear how this is supposed to work
+				} else {
+					stream->remaining--;
+					if (!stream->remaining) {
+						//TODO: looping support
+						player->streams[i]->flags &= ~STREAM_FLAG_PLAY;
+					}
+				}
 			}
 		}
 	} while (keep_going);
@@ -615,6 +624,8 @@
 						cur_block = cur_block->next;
 					}
 					if (stream->cur_block) {
+						stream->remaining = 0xFFFFFFFF;
+						stream->length_mode = 3;
 						stream->flags |= STREAM_FLAG_PLAY;
 						stream->next_sample_cycle = samples_to_cycles(stream->chip->clock, stream->chip->samples);
 					}