1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| function testPlayer
global GUI
GUI.fig = figure;
GUI.h = uicontrol('parent',GUI.fig,'style','edit','visible','on','enable','on','callback',@goto);
GUI.vidObj = VideoReader('D:\Matlab scripts\GeFACT\WORKING DIRECTORY\Input\Action Units susanne.avi');
GUI.player = mmplayer(GUI.vidObj);
addlistener(GUI.player,'paused',@updateInterface);
addlistener(GUI.player,'stopped',@updateInterface);
function updateInterface(src,event)
global GUI
disp(GUI.player.currentFrameIndex)
set(GUI.h,'string', num2str(GUI.player.currentFrameIndex));
drawnow
function goto(src,event)
global GUI
val = str2double(get(GUI.h,'string'))
disp(num2str(val))
disp(num2str(GUI.player.currentFrameIndex))
disp(num2str(GUI.player.numberOfFrames))
GUI.player.currentFrameIndex(val); |
Partager