function varargout = Kviz_Player_V1(varargin)
% KVIZ_PLAYER_V1 MATLAB code for Kviz_Player_V1.fig
% KVIZ_PLAYER_V1, by itself, creates a new KVIZ_PLAYER_V1 or raises the existing
% singleton*.
%
% H = KVIZ_PLAYER_V1 returns the handle to a new KVIZ_PLAYER_V1 or the handle to
% the existing singleton*.
%
% KVIZ_PLAYER_V1('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in KVIZ_PLAYER_V1.M with the given input arguments.
%
% KVIZ_PLAYER_V1('Property','Value',...) creates a new KVIZ_PLAYER_V1 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Kviz_Player_V1_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Kviz_Player_V1_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help Kviz_Player_V1
% Last Modified by GUIDE v2.5 14-Feb-2013 21:50:36
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Kviz_Player_V1_OpeningFcn, ...
'gui_OutputFcn', @Kviz_Player_V1_OutputFcn, ...
'gui_LayoutFcn', @Kviz_Player_V1_LayoutFcn, ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before Kviz_Player_V1 is made visible.
function Kviz_Player_V1_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Kviz_Player_V1 (see VARARGIN)
% Choose default command line output for Kviz_Player_V1
handles.output = hObject;
axis off;
set(handles.control,'Visible','off');
set(handles.vizo,'Enable','off');
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Kviz_Player_V1 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Kviz_Player_V1_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in exit.
function exit_Callback(hObject, eventdata, handles)
% hObject handle to exit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
beep
close(VIZplay);
% --- Executes on button press in load.
function load_Callback(hObject, eventdata, handles)
% hObject handle to load (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
beep
[name,path]=uigetfile('.wav','Select wave file');
[p n exts]=fileparts(name);
chk=sum(double(exts));
if chk~=(sum(double('.wav')))
errordlg('Please choose .wav file','File Format Error')
elseif chk==(sum(double('.wav')))
set(handles.control,'Visible','on');
set(handles.vizo,'Enable','on');
end
set(handles.song,'String',name);
set(handles.path,'String',path);
h = waitbar(0,'Please wait...');
handles.song=[path name];
steps = 100;
for step = 1:steps
% computations take place here
waitbar(step / steps)
end
close(h)
guidata(hObject,handles)
% --- Executes on button press in play.
function play_Callback(hObject, eventdata, handles)
% hObject handle to play (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
beep
song=handles.song;
[x,fs,nbits,opts]=wavread(song);
player=audioplayer(x,fs);
play(player)
handles.player=player;
handles.status=sum(double(player.running));
guidata(hObject,handles)
% --- Executes on button press in stop.
function stop_Callback(hObject, eventdata, handles)
% hObject handle to stop (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
beep
player=handles.player;
stop(player)
handles.status=sum(double(player.running));
guidata(hObject,handles)
% --- Executes on button press in pause.
function pause_Callback(hObject, eventdata, handles)
% hObject handle to pause (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
player=handles.player;
pause(player)
cla
handles.status=sum(double(player.running));
guidata(hObject,handles)
% --- Executes on button press in resume.
function resume_Callback(hObject, eventdata, handles)
% hObject handle to resume (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
player=handles.player;
resume(player)
handles.status=sum(double(player.running));
player=handles.player;
song=handles.song;
handles.vis=get(hObject,'Value');
vis=handles.vis;
[x,fs,nbits,opts]=wavread(song);
x=x(:,1);
[m,n]=size(x);
j=1;
chk=handles.status;
chk=sum(double(player.running));
switch vis
case 1
cla
set(handles.viz,'String','STEM');
for i=1:floor(fs/2):m
chk=sum(double(player.running));
if chk~=315
p=x(i:i+(20000));
if j==1
stem(p,'b','marker','none'); hold on; j=2; axis off;
else
stem(p,'r','marker','none');j=1;
hold off;
end
pause(0.10)
elseif chk==315
cla
end
end
case 2
cla
set(handles.viz,'String','BAR');
for i=1:floor(fs/2):m
chk=sum(double(player.running));
if chk~=315
p=x(i:(i+30));
bar(p); axis off;
pause(0.6)
cla
elseif chk==315
cla
end
end
case 3
cla
axis off;
set(handles.viz,'String','Comet');
for i=1:floor(fs/2):m
chk=sum(double(player.running));
if chk~=315
p=x(i:i+(1500));
comet(p);
pause(0.10)
elseif chk==315
cla
end
end
case 4
cla
set(handles.viz,'String','Colorful');
for i=1:floor(fs/2):m
chk=sum(double(player.running));
if chk~=315
p=x(i:(20000));
spectrogram(p); axis off;
pause(0.5)
elseif chk==315
cla
end
end
case 5
cla
set(handles.viz,'String','H-BAR');
for i=1:floor(fs/2):m
chk=sum(double(player.running));
if chk~=315
p=x(i:(i+30));
barh(p); axis off;
pause(0.6)
cla
elseif chk==315
cla
end
end
case 6
cla
set(handles.viz,'String','MESH');
mt=zeros(100,100);
ct=zeros(100,100);
for i=1:100:m
chk=sum(double(player.running));
if chk~=315
for j=1:(100)
mt(j)=x(i); i=i+1;
%mit=[mt];
mit=[mt,ct,ct,ct,ct,mt,ct,ct,ct,ct,mt];
%mit=[mt,mt,mt,mt,mt,mt,mt,mt,mt,mt,mt];
%mit=cat(2,mit,mit);
end
mesh(mit);axis off
pause(0.5)
end
end
case 7
cla
set(handles.viz,'String','CONTOUR');
mt=zeros(100,100);
ct=zeros(100,100);
for i=1:100:m
chk=sum(double(player.running));
if chk~=315
for j=1:(100)
mt(j)=x(i); i=i+1;
%mit=[mt];
mit=[mt,ct,ct,ct,ct,mt,ct,ct,ct,ct,mt];
%mit=[mt,mt,mt,mt,mt,mt,mt,mt,mt,mt,mt];
%mit=cat(2,mit,mit);
end
contour(mit);axis off
pause(0.5)
end
end
case 8
cla
set(handles.viz,'String','SURF');
mt=zeros(100,100);
ct=zeros(100,100);
for i=1:100:m
chk=sum(double(player.running));
if chk~=315
for j=1:(100)
mt(j)=x(i); i=i+1;
%mit=[mt];
%mit=[mt,ct,ct,ct,ct,mt,ct,ct,ct,ct,mt];
mit=[mt,mt,mt,mt,mt,mt,mt,mt,mt,mt,mt];
%mit=cat(2,mit,mit);
end
surf(mit);axis off
pause(0.5)
end
end
case 9
cla
set(handles.viz,'String','IMAGE');
mt=zeros(100,100);
ct=zeros(100,100);
for i=1:100:m
chk=sum(double(player.running));
if chk~=315
for j=1:(100)
mt(j)=x(i); i=i+1;
mit=[mt];
%mit=[mt,ct,ct,ct,ct,mt,ct,ct,ct,ct,mt];
%mit=[mt,mt,mt,mt,mt,mt,mt,mt,mt,mt,mt];
%mit=cat(2,mit,mit);
end
imagesc(mit);axis off
pause(0.5)
end
end
otherwise
cla
end
guidata(hObject,handles)
% --- Executes on selection change in vizo.
function vizo_Callback(hObject, eventdata, handles)
% hObject handle to vizo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles.vis=get(hObject,'Value');
vis=handles.vis;
nn=(get(hObject,'String'));
n=nn{vis};
player=handles.player;
song=handles.song;
[x,fs,nbits,opts]=wavread(song);
x=x(:,1);
[m,n]=size(x);
j=1;
chk=handles.status;
chk=sum(double(player.running));
switch vis
case 1
cla
set(handles.viz,'String','STEM');
for i=1:floor(fs/2):m
chk=sum(double(player.running));
if chk~=315
p=x(i:i+(20000));
if j==1
stem(p,'b','marker','none'); hold on; j=2; axis off;
else
stem(p,'r','marker','none');j=1;
hold off;
end
pause(0.10)
elseif chk==315
cla
end
end
case 2
cla
set(handles.viz,'String','BAR');
for i=1:floor(fs/2):m
chk=sum(double(player.running));
if chk~=315
p=x(i:(i+30));
bar(p); axis off;
pause(0.6)
cla
elseif chk==315
cla
end
end
case 3
cla
axis off;
set(handles.viz,'String','Comet');
for i=1:floor(fs/2):m
chk=sum(double(player.running));
if chk~=315
p=x(i:i+(1500));
comet(p);
pause(0.10)
elseif chk==315
cla
end
end
case 4
cla
set(handles.viz,'String','Colorful');
for i=1:floor(fs/2):m
chk=sum(double(player.running));
if chk~=315
p=x(i:(20000));
spectrogram(p); axis off;
pause(0.5)
elseif chk==315
cla
end
end
case 5
cla
set(handles.viz,'String','H-BAR');
for i=1:floor(fs/2):m
chk=sum(double(player.running));
if chk~=315
p=x(i:(i+30));
barh(p); axis off;
pause(0.6)
cla
elseif chk==315
cla
end
end
case 6
cla
set(handles.viz,'String','MESH');
mt=zeros(100,100);
ct=zeros(100,100);
for i=1:100:m
chk=sum(double(player.running));
if chk~=315
for j=1:(100)
mt(j)=x(i); i=i+1;
%mit=[mt];
mit=[mt,ct,ct,ct,ct,mt,ct,ct,ct,ct,mt];
%mit=[mt,mt,mt,mt,mt,mt,mt,mt,mt,mt,mt];
%mit=cat(2,mit,mit);
end
mesh(mit);axis off
pause(0.5)
end
end
case 7
cla
set(handles.viz,'String','CONTOUR');
mt=zeros(100,100);
ct=zeros(100,100);
for i=1:100:m
chk=sum(double(player.running));
if chk~=315
for j=1:(100)
mt(j)=x(i); i=i+1;
%mit=[mt];
%mit=[mt,ct,ct,ct,ct,mt,ct,ct,ct,ct,mt];
mit=[mt,mt,mt,mt,mt,mt,mt,mt,mt,mt,mt];
%mit=cat(2,mit,mit);
end
contour(mit);axis off
pause(0.2)
end
end
case 8
cla
set(handles.viz,'String','SURF');
mt=zeros(100,100);
ct=zeros(100,100);
for i=1:100:m
chk=sum(double(player.running));
if chk~=315
for j=1:(100)
mt(j)=x(i); i=i+1;
%mit=[mt];
mit=[mt,ct,ct,ct,ct,mt,ct,ct,ct,ct,mt];
%mit=[mt,mt,mt,mt,mt,mt,mt,mt,mt,mt,mt];
%mit=cat(2,mit,mit);
end
surf(mit);axis off
pause(0.5)
end
end
case 9
cla
set(handles.viz,'String','IMAGE');
mt=zeros(100,100);
ct=zeros(100,100);
for i=1:100:m
chk=sum(double(player.running));
if chk~=315
for j=1:(100)
mt(j)=x(i); i=i+1;
mit=[mt];
%mit=[mt,ct,ct,ct,ct,mt,ct,ct,ct,ct,mt];
%mit=[mt,mt,mt,mt,mt,mt,mt,mt,mt,mt,mt];
%mit=cat(2,mit,mit);
end
imagesc(mit);axis off
pause(0.5)
end
end
otherwise
cla
end
% Hints: contents = cellstr(get(hObject,'String')) returns vizo contents as cell array
% contents{get(hObject,'Value')} returns selected item from vizo
guidata(hObject,handles);
% --- Executes during object creation, after setting all properties.
function vizo_CreateFcn(hObject, eventdata, handles)
% hObject handle to vizo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Creates and returns a handle to the GUI figure.
function h1 = Kviz_Player_V1_LayoutFcn(policy)
% policy - create a new figure or use a singleton. 'new' or 'reuse'.
persistent hsingleton;
if strcmpi(policy, 'reuse') & ishandle(hsingleton)
h1 = hsingleton;
return;
end
load Kviz_Player_V1.mat
appdata = [];
appdata.GUIDEOptions = mat{1};
appdata.lastValidTag = 'figure1';
appdata.GUIDELayoutEditor = [];
appdata.initTags = struct(...
'handle', [], ...
'tag', 'figure1');
h1 = figure(...
'Units','characters',...
'Color',[0 0 0],...
'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],...
'IntegerHandle','off',...
'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),...
'MenuBar','none',...
'Name','VIZplay',...
'NumberTitle','off',...
'PaperPosition',get(0,'defaultfigurePaperPosition'),...
'Position',[103.8 18.9230769230769 134 42.6153846153846],...
'HandleVisibility','callback',...
'UserData',[],...
'Tag','figure1',...
'Visible','on',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'vis';
h2 = axes(...
'Parent',h1,...
'Position',[0.0283582089552239 0.418772563176895 0.976119402985075 0.57942238267148],...
'AmbientLightColor',[0 0 0],...
'CameraPosition',[0.5 0.5 9.16025403784439],...
'CameraPositionMode',get(0,'defaultaxesCameraPositionMode'),...
'Color',[0 0 0],...
'ColorOrder',get(0,'defaultaxesColorOrder'),...
'LooseInset',[0.108683229813665 0.115804020100503 0.0794223602484472 0.0789572864321608],...
'XColor',get(0,'defaultaxesXColor'),...
'YColor',get(0,'defaultaxesYColor'),...
'ZColor',get(0,'defaultaxesZColor'),...
'Tag','vis',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
h3 = get(h2,'title');
set(h3,...
'Parent',h2,...
'Units','data',...
'FontUnits','points',...
'BackgroundColor','none',...
'Color',[0 0 0],...
'DisplayName',blanks(0),...
'EdgeColor','none',...
'EraseMode','normal',...
'DVIMode','auto',...
'FontAngle','normal',...
'FontName','Helvetica',...
'FontSize',10,...
'FontWeight','normal',...
'HorizontalAlignment','center',...
'LineStyle','-',...
'LineWidth',0.5,...
'Margin',2,...
'Position',[0.499235474006116 1.0202492211838 1.00005459937205],...
'Rotation',0,...
'String',blanks(0),...
'Interpreter','tex',...
'VerticalAlignment','bottom',...
'ButtonDownFcn',[],...
'CreateFcn', {@local_CreateFcn, [], ''} ,...
'DeleteFcn',[],...
'BusyAction','queue',...
'HandleVisibility','off',...
'HelpTopicKey',blanks(0),...
'HitTest','on',...
'Interruptible','on',...
'SelectionHighlight','on',...
'Serializable','on',...
'Tag',blanks(0),...
'UserData',[],...
'Visible','on',...
'XLimInclude','on',...
'YLimInclude','on',...
'ZLimInclude','on',...
'CLimInclude','on',...
'ALimInclude','on',...
'IncludeRenderer','on',...
'Clipping','off');
h4 = get(h2,'xlabel');
set(h4,...
'Parent',h2,...
'Units','data',...
'FontUnits','points',...
'BackgroundColor','none',...
'Color',[0 0 0],...
'DisplayName',blanks(0),...
'EdgeColor','none',...
'EraseMode','normal',...
'DVIMode','auto',...
'FontAngle','normal',...
'FontName','Helvetica',...
'FontSize',10,...
'FontWeight','normal',...
'HorizontalAlignment','center',...
'LineStyle','-',...
'LineWidth',0.5,...
'Margin',2,...
'Position',[0.499235474006116 -0.0732087227414329 1.00005459937205],...
'Rotation',0,...
'String',blanks(0),...
'Interpreter','tex',...
'VerticalAlignment','cap',...
'ButtonDownFcn',[],...
'CreateFcn', {@local_CreateFcn, [], ''} ,...
'DeleteFcn',[],...
'BusyAction','queue',...
'HandleVisibility','off',...
'HelpTopicKey',blanks(0),...
'HitTest','on',...
'Interruptible','on',...
'SelectionHighlight','on',...
'Serializable','on',...
'Tag',blanks(0),...
'UserData',[],...
'Visible','on',...
'XLimInclude','on',...
'YLimInclude','on',...
'ZLimInclude','on',...
'CLimInclude','on',...
'ALimInclude','on',...
'IncludeRenderer','on',...
'Clipping','off');
h5 = get(h2,'ylabel');
set(h5,...
'Parent',h2,...
'Units','data',...
'FontUnits','points',...
'BackgroundColor','none',...
'Color',[0 0 0],...
'DisplayName',blanks(0),...
'EdgeColor','none',...
'EraseMode','normal',...
'DVIMode','auto',...
'FontAngle','normal',...
'FontName','Helvetica',...
'FontSize',10,...
'FontWeight','normal',...
'HorizontalAlignment','center',...
'LineStyle','-',...
'LineWidth',0.5,...
'Margin',2,...
'Position',[-0.0435779816513761 0.496884735202492 1.00005459937205],...
'Rotation',90,...
'String',blanks(0),...
'Interpreter','tex',...
'VerticalAlignment','bottom',...
'ButtonDownFcn',[],...
'CreateFcn', {@local_CreateFcn, [], ''} ,...
'DeleteFcn',[],...
'BusyAction','queue',...
'HandleVisibility','off',...
'HelpTopicKey',blanks(0),...
'HitTest','on',...
'Interruptible','on',...
'SelectionHighlight','on',...
'Serializable','on',...
'Tag',blanks(0),...
'UserData',[],...
'Visible','on',...
'XLimInclude','on',...
'YLimInclude','on',...
'ZLimInclude','on',...
'CLimInclude','on',...
'ALimInclude','on',...
'IncludeRenderer','on',...
'Clipping','off');
h6 = get(h2,'zlabel');
set(h6,...
'Parent',h2,...
'Units','data',...
'FontUnits','points',...
'BackgroundColor','none',...
'Color',[0 0 0],...
'DisplayName',blanks(0),...
'EdgeColor','none',...
'EraseMode','normal',...
'DVIMode','auto',...
'FontAngle','normal',...
'FontName','Helvetica',...
'FontSize',10,...
'FontWeight','normal',...
'HorizontalAlignment','right',...
'LineStyle','-',...
'LineWidth',0.5,...
'Margin',2,...
'Position',[-0.0298165137614679 0.998442367601246 1.00005459937205],...
'Rotation',0,...
'String',blanks(0),...
'Interpreter','tex',...
'VerticalAlignment','middle',...
'ButtonDownFcn',[],...
'CreateFcn', {@local_CreateFcn, [], ''} ,...
'DeleteFcn',[],...
'BusyAction','queue',...
'HandleVisibility','off',...
'HelpTopicKey',blanks(0),...
'HitTest','on',...
'Interruptible','on',...
'SelectionHighlight','on',...
'Serializable','on',...
'Tag',blanks(0),...
'UserData',[],...
'Visible','off',...
'XLimInclude','on',...
'YLimInclude','on',...
'ZLimInclude','on',...
'CLimInclude','on',...
'ALimInclude','on',...
'IncludeRenderer','on',...
'Clipping','off');
appdata = [];
appdata.lastValidTag = 'exit';
h7 = uicontrol(...
'Parent',h1,...
'Units','normalized',...
'BackgroundColor',[1 1 1],...
'Callback',@(hObject,eventdata)Kviz_Player_V1('exit_Callback',hObject,eventdata,guidata(hObject)),...
'FontSize',10,...
'FontWeight','bold',...
'ForegroundColor',[1 0 0],...
'Position',[0.0238805970149254 0.140794223826715 0.114925373134328 0.0397111913357401],...
'String','EXIT',...
'Tag','exit',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'path';
h8 = uicontrol(...
'Parent',h1,...
'Units','normalized',...
'FontName','Times New Roman',...
'FontSize',10,...
'FontWeight','bold',...
'Position',[0.286567164179104 0.348375451263538 0.413432835820896 0.0379061371841155],...
'String','Path',...
'Style','text',...
'Tag','path',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'viz';
h9 = uicontrol(...
'Parent',h1,...
'Units','normalized',...
'FontSize',12,...
'FontWeight','bold',...
'Position',[0.156716417910448 0.146209386281588 0.553731343283582 0.0379061371841155],...
'String','Visualization',...
'Style','text',...
'Tag','viz',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'song';
h10 = uicontrol(...
'Parent',h1,...
'Units','normalized',...
'FontName','Times New Roman',...
'FontSize',10,...
'FontWeight','bold',...
'Position',[0.017910447761194 0.350180505415163 0.240298507462687 0.0379061371841155],...
'String','Song',...
'Style','text',...
'Tag','song',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'control';
h11 = uipanel(...
'Parent',h1,...
'Title','Control Menu',...
'Tag','control',...
'Clipping','on',...
'Position',[0.164179104477612 0.203971119133574 0.540298507462687 0.110108303249097],...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'play';
h12 = uicontrol(...
'Parent',h11,...
'Units','normalized',...
'BackgroundColor',[0 1 0],...
'Callback',@(hObject,eventdata)Kviz_Player_V1('play_Callback',hObject,eventdata,guidata(hObject)),...
'FontWeight','bold',...
'Position',[0.0223463687150838 0.363636363636364 0.226256983240223 0.5],...
'String','Play',...
'Tag','play',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'stop';
h13 = uicontrol(...
'Parent',h11,...
'Units','normalized',...
'BackgroundColor',[1 0 0],...
'Callback',@(hObject,eventdata)Kviz_Player_V1('stop_Callback',hObject,eventdata,guidata(hObject)),...
'FontWeight','bold',...
'Position',[0.748603351955307 0.386363636363636 0.226256983240223 0.5],...
'String','Stop',...
'Tag','stop',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'pause';
h14 = uicontrol(...
'Parent',h11,...
'Units','normalized',...
'BackgroundColor',[0 1 1],...
'Callback',@(hObject,eventdata)Kviz_Player_V1('pause_Callback',hObject,eventdata,guidata(hObject)),...
'FontWeight','bold',...
'Position',[0.301675977653631 0.386363636363636 0.170391061452514 0.5],...
'String','Pause',...
'Tag','pause',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'resume';
h15 = uicontrol(...
'Parent',h11,...
'Units','normalized',...
'BackgroundColor',[0 1 1],...
'Callback',@(hObject,eventdata)Kviz_Player_V1('resume_Callback',hObject,eventdata,guidata(hObject)),...
'FontWeight','bold',...
'Position',[0.522346368715084 0.386363636363636 0.170391061452514 0.5],...
'String','Resume',...
'Tag','resume',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'load';
h16 = uicontrol(...
'Parent',h1,...
'Units','normalized',...
'BackgroundColor',[1 1 0],...
'Callback',@(hObject,eventdata)Kviz_Player_V1('load_Callback',hObject,eventdata,guidata(hObject)),...
'FontName','Times New Roman',...
'FontSize',12,...
'FontWeight','bold',...
'Max',2,...
'Position',[0.0194029850746269 0.20216606498195 0.12089552238806 0.110108303249097],...
'String','Load Song',...
'Tag','load',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'vizo';
h17 = uicontrol(...
'Parent',h1,...
'Units','normalized',...
'BackgroundColor',[1 1 1],...
'Callback',@(hObject,eventdata)Kviz_Player_V1('vizo_Callback',hObject,eventdata,guidata(hObject)),...
'Position',[0.743283582089552 0.348375451263538 0.240298507462687 0.0379061371841155],...
'String',{ 'STEM'; 'BAR'; 'COMET'; 'COLORFUL'; 'H-BAR'; 'MESH'; 'CONTOUR'; 'SURF'; 'IMAGE' },...
'Style','popupmenu',...
'Value',1,...
'CreateFcn', {@local_CreateFcn, @(hObject,eventdata)Kviz_Player_V1('vizo_CreateFcn',hObject,eventdata,guidata(hObject)), appdata} ,...
'Tag','vizo');
appdata = [];
appdata.lastValidTag = 'text4';
h18 = uicontrol(...
'Parent',h1,...
'Units','normalized',...
'BackgroundColor',[0.870588235294118 0.92156862745098 0.980392156862745],...
'FontName','Georgia',...
'FontSize',9,...
'FontWeight','bold',...
'Max',2,...
'Position',[0.026865671641791 0.0234657039711191 0.958208955223881 0.0938628158844765],...
'String',{ blanks(0); 'Suraj Kamya '; 'kamyasuraj@yahoo.com' },...
'Style','text',...
'Tag','text4',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
hsingleton = h1;
% --- Set application data first then calling the CreateFcn.
function local_CreateFcn(hObject, eventdata, createfcn, appdata)
if ~isempty(appdata)
names = fieldnames(appdata);
for i=1:length(names)
name = char(names(i));
setappdata(hObject, name, getfield(appdata,name));
end
end
if ~isempty(createfcn)
if isa(createfcn,'function_handle')
createfcn(hObject, eventdata);
else
eval(createfcn);
end
end
% --- Handles default GUIDE GUI creation and callback dispatch
function varargout = gui_mainfcn(gui_State, varargin)
gui_StateFields = {'gui_Name'
'gui_Singleton'
'gui_OpeningFcn'
'gui_OutputFcn'
'gui_LayoutFcn'
'gui_Callback'};
gui_Mfile = '';
for i=1:length(gui_StateFields)
if ~isfield(gui_State, gui_StateFields{i})
error('MATLAB:gui_mainfcn:FieldNotFound', 'Could not find field %s in the gui_State struct in GUI M-file %s', gui_StateFields{i}, gui_Mfile);
elseif isequal(gui_StateFields{i}, 'gui_Name')
gui_Mfile = [gui_State.(gui_StateFields{i}), '.m'];
end
end
numargin = length(varargin);
if numargin == 0
% KVIZ_PLAYER_V1
% create the GUI only if we are not in the process of loading it
% already
gui_Create = true;
elseif local_isInvokeActiveXCallback(gui_State, varargin{:})
% KVIZ_PLAYER_V1(ACTIVEX,...)
vin{1} = gui_State.gui_Name;
vin{2} = [get(varargin{1}.Peer, 'Tag'), '_', varargin{end}];
vin{3} = varargin{1};
vin{4} = varargin{end-1};
vin{5} = guidata(varargin{1}.Peer);
feval(vin{:});
return;
elseif local_isInvokeHGCallback(gui_State, varargin{:})
% KVIZ_PLAYER_V1('CALLBACK',hObject,eventData,handles,...)
gui_Create = false;
else
% KVIZ_PLAYER_V1(...)
% create the GUI and hand varargin to the openingfcn
gui_Create = true;
end
if ~gui_Create
% In design time, we need to mark all components possibly created in
% the coming callback evaluation as non-serializable. This way, they
% will not be brought into GUIDE and not be saved in the figure file
% when running/saving the GUI from GUIDE.
designEval = false;
if (numargin>1 && ishghandle(varargin{2}))
fig = varargin{2};
while ~isempty(fig) && ~isa(handle(fig),'figure')
fig = get(fig,'parent');
end
designEval = isappdata(0,'CreatingGUIDEFigure') || isprop(fig,'__GUIDEFigure');
end
if designEval
beforeChildren = findall(fig);
end
% evaluate the callback now
varargin{1} = gui_State.gui_Callback;
if nargout
[varargout{1:nargout}] = feval(varargin{:});
else
feval(varargin{:});
end
% Set serializable of objects created in the above callback to off in
% design time. Need to check whether figure handle is still valid in
% case the figure is deleted during the callback dispatching.
if designEval && ishandle(fig)
set(setdiff(findall(fig),beforeChildren), 'Serializable','off');
end
else
if gui_State.gui_Singleton
gui_SingletonOpt = 'reuse';
else
gui_SingletonOpt = 'new';
end
% Check user passing 'visible' P/V pair first so that its value can be
% used by oepnfig to prevent flickering
gui_Visible = 'auto';
gui_VisibleInput = '';
for index=1:2:length(varargin)
if length(varargin) == index || ~ischar(varargin{index})
break;
end
% Recognize 'visible' P/V pair
len1 = min(length('visible'),length(varargin{index}));
len2 = min(length('off'),length(varargin{index+1}));
if ischar(varargin{index+1}) && strncmpi(varargin{index},'visible',len1) && len2 > 1
if strncmpi(varargin{index+1},'off',len2)
gui_Visible = 'invisible';
gui_VisibleInput = 'off';
elseif strncmpi(varargin{index+1},'on',len2)
gui_Visible = 'visible';
gui_VisibleInput = 'on';
end
end
end
% Open fig file with stored settings. Note: This executes all component
% specific CreateFunctions with an empty HANDLES structure.
% Do feval on layout code in m-file if it exists
gui_Exported = ~isempty(gui_State.gui_LayoutFcn);
% this application data is used to indicate the running mode of a GUIDE
% GUI to distinguish it from the design mode of the GUI in GUIDE. it is
% only used by actxproxy at this time.
setappdata(0,genvarname(['OpenGuiWhenRunning_', gui_State.gui_Name]),1);
if gui_Exported
gui_hFigure = feval(gui_State.gui_LayoutFcn, gui_SingletonOpt);
% make figure invisible here so that the visibility of figure is
% consistent in OpeningFcn in the exported GUI case
if isempty(gui_VisibleInput)
gui_VisibleInput = get(gui_hFigure,'Visible');
end
set(gui_hFigure,'Visible','off')
% openfig (called by local_openfig below) does this for guis without
% the LayoutFcn. Be sure to do it here so guis show up on screen.
movegui(gui_hFigure,'onscreen');
else
gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt, gui_Visible);
% If the figure has InGUIInitialization it was not completely created
% on the last pass. Delete this handle and try again.
if isappdata(gui_hFigure, 'InGUIInitialization')
delete(gui_hFigure);
gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt, gui_Visible);
end
end
if isappdata(0, genvarname(['OpenGuiWhenRunning_', gui_State.gui_Name]))
rmappdata(0,genvarname(['OpenGuiWhenRunning_', gui_State.gui_Name]));
end
% Set flag to indicate starting GUI initialization
setappdata(gui_hFigure,'InGUIInitialization',1);
% Fetch GUIDE Application options
gui_Options = getappdata(gui_hFigure,'GUIDEOptions');
% Singleton setting in the GUI M-file takes priority if different
gui_Options.singleton = gui_State.gui_Singleton;
if ~isappdata(gui_hFigure,'GUIOnScreen')
% Adjust background color
if gui_Options.syscolorfig
set(gui_hFigure,'Color', get(0,'DefaultUicontrolBackgroundColor'));
end
% Generate HANDLES structure and store with GUIDATA. If there is
% user set GUI data already, keep that also.
data = guidata(gui_hFigure);
handles = guihandles(gui_hFigure);
if ~isempty(handles)
if isempty(data)
data = handles;
else
names = fieldnames(handles);
for k=1:length(names)
data.(char(names(k)))=handles.(char(names(k)));
end
end
end
guidata(gui_hFigure, data);
end
% Apply input P/V pairs other than 'visible'
for index=1:2:length(varargin)
if length(varargin) == index || ~ischar(varargin{index})
break;
end
len1 = min(length('visible'),length(varargin{index}));
if ~strncmpi(varargin{index},'visible',len1)
try set(gui_hFigure, varargin{index}, varargin{index+1}), catch break, end
end
end
% If handle visibility is set to 'callback', turn it on until finished
% with OpeningFcn
gui_HandleVisibility = get(gui_hFigure,'HandleVisibility');
if strcmp(gui_HandleVisibility, 'callback')
set(gui_hFigure,'HandleVisibility', 'on');
end
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
if isscalar(gui_hFigure) && ishandle(gui_hFigure)
% Handle the default callbacks of predefined toolbar tools in this
% GUI, if any
guidemfile('restoreToolbarToolPredefinedCallback',gui_hFigure);
% Update handle visibility
set(gui_hFigure,'HandleVisibility', gui_HandleVisibility);
% Call openfig again to pick up the saved visibility or apply the
% one passed in from the P/V pairs
if ~gui_Exported
gui_hFigure = local_openfig(gui_State.gui_Name, 'reuse',gui_Visible);
elseif ~isempty(gui_VisibleInput)
set(gui_hFigure,'Visible',gui_VisibleInput);
end
if strcmpi(get(gui_hFigure, 'Visible'), 'on')
figure(gui_hFigure);
if gui_Options.singleton
setappdata(gui_hFigure,'GUIOnScreen', 1);
end
end
% Done with GUI initialization
if isappdata(gui_hFigure,'InGUIInitialization')
rmappdata(gui_hFigure,'InGUIInitialization');
end
% If handle visibility is set to 'callback', turn it on until
% finished with OutputFcn
gui_HandleVisibility = get(gui_hFigure,'HandleVisibility');
if strcmp(gui_HandleVisibility, 'callback')
set(gui_hFigure,'HandleVisibility', 'on');
end
gui_Handles = guidata(gui_hFigure);
else
gui_Handles = [];
end
if nargout
[varargout{1:nargout}] = feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles);
else
feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles);
end
if isscalar(gui_hFigure) && ishandle(gui_hFigure)
set(gui_hFigure,'HandleVisibility', gui_HandleVisibility);
end
end
function gui_hFigure = local_openfig(name, singleton, visible)
% openfig with three arguments was new from R13. Try to call that first, if
% failed, try the old openfig.
if nargin('openfig') == 2
% OPENFIG did not accept 3rd input argument until R13,
% toggle default figure visible to prevent the figure
% from showing up too soon.
gui_OldDefaultVisible = get(0,'defaultFigureVisible');
set(0,'defaultFigureVisible','off');
gui_hFigure = openfig(name, singleton);
set(0,'defaultFigureVisible',gui_OldDefaultVisible);
else
gui_hFigure = openfig(name, singleton, visible);
end
function result = local_isInvokeActiveXCallback(gui_State, varargin)
try
result = ispc && iscom(varargin{1}) ...
&& isequal(varargin{1},gcbo);
catch
result = false;
end
function result = local_isInvokeHGCallback(gui_State, varargin)
try
fhandle = functions(gui_State.gui_Callback);
result = ~isempty(findstr(gui_State.gui_Name,fhandle.file)) || ...
(ischar(varargin{1}) ...
&& isequal(ishandle(varargin{2}), 1) ...
&& (~isempty(strfind(varargin{1},[get(varargin{2}, 'Tag'), '_'])) || ...
~isempty(strfind(varargin{1}, '_CreateFcn'))) );
catch
result = false;
end