I've got the following code that works fine (this example is extremely stripped down and all code that didn't matter was removed to debug the problem. I also reduced the code to only use 2 videos, but I'm using substantially more than that, with options of selecting what video to play.) When I run the below code, I get the expected two different videos with a pause between them:
func main()
while(!media_Init())
putstr("Drive not mounted...");
pause(400);
gfx_Cls();
pause(200);
wend
repeat
media_SetAdd(iVideo1H, iVideo1L) ;
media_Video(40, 35);
pause(1000);
gfx_RectangleFilled(41, 21, 159, 127, BLACK) ; //erase part of screen with old image
media_SetAdd(iVideo2H, iVideo2L) ;
media_Video(40, 35);
pause(1000);
gfx_RectangleFilled(41, 21, 159, 127, BLACK) ; //erase part of screen with old image
forever
endfunc
But when I combine those two using a switch/endswitch to save on programming space, I don't get two different videos, I only get the last one, or Video2. I added a print statement to show which model should be showing and it flips between 1 and 2, but I only ever see #2. Why?
func main()
var ModelNum ;
while(!media_Init())
putstr("Drive not mounted...");
pause(400);
gfx_Cls();
pause(200);
wend
repeat
for (ModelNum := 1; ModelNum <= 2; ModelNum++)
switch (ModelNum)
case 1:
media_SetAdd(iVideo1H, iVideo1L) ;
case 2:
media_SetAdd(iVideo2H, iVideo2L) ;
endswitch
gfx_MoveTo(10,10) ;
print(ModelNum) ;
media_Video(40, 35);
pause(1000);
gfx_RectangleFilled(41, 21, 159, 127, BLACK) ; //erase part of screen with old image
next
forever
endfunc
Rogi
func main()
while(!media_Init())
putstr("Drive not mounted...");
pause(400);
gfx_Cls();
pause(200);
wend
repeat
media_SetAdd(iVideo1H, iVideo1L) ;
media_Video(40, 35);
pause(1000);
gfx_RectangleFilled(41, 21, 159, 127, BLACK) ; //erase part of screen with old image
media_SetAdd(iVideo2H, iVideo2L) ;
media_Video(40, 35);
pause(1000);
gfx_RectangleFilled(41, 21, 159, 127, BLACK) ; //erase part of screen with old image
forever
endfunc
But when I combine those two using a switch/endswitch to save on programming space, I don't get two different videos, I only get the last one, or Video2. I added a print statement to show which model should be showing and it flips between 1 and 2, but I only ever see #2. Why?
func main()
var ModelNum ;
while(!media_Init())
putstr("Drive not mounted...");
pause(400);
gfx_Cls();
pause(200);
wend
repeat
for (ModelNum := 1; ModelNum <= 2; ModelNum++)
switch (ModelNum)
case 1:
media_SetAdd(iVideo1H, iVideo1L) ;
case 2:
media_SetAdd(iVideo2H, iVideo2L) ;
endswitch
gfx_MoveTo(10,10) ;
print(ModelNum) ;
media_Video(40, 35);
pause(1000);
gfx_RectangleFilled(41, 21, 159, 127, BLACK) ; //erase part of screen with old image
next
forever
endfunc
Rogi
Comment