function varargout = gui(varargin)
% GUI MATLAB code for gui.fig
% GUI, by itself, creates a new GUI or raises the existing
% singleton*.
%
% H = GUI returns the handle to a new GUI or the handle to
% the existing singleton*.
%
% GUI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUI.M with the given input arguments.
%
% GUI('Property','Value',...) creates a new GUI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before gui_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to gui_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
% text the above text to modify the response to help gui
% Last Modified by GUIDE v2.5 13-Apr-2017 16:09:55
% Begin initialization code - DO NOT TEXT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @gui_OpeningFcn, ...
'gui_OutputFcn', @gui_OutputFcn, ...
'gui_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 TEXT
% --- Executes just before gui is made visible.
function gui_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 gui (see VARARGIN)
path='background1.jpg';
axes(handles.axes1);
imshow(imread(path));
path='达康.jpg';
axes(handles.axes2);
imshow(imread(path));
path='达康书记.jpg';
axes(handles.axes3);
imshow(imread(path));
picture1=imread('ok.jpg');
set(handles.pushbutton1,'cdata',picture1);
picture2=imread('display.jpg');
set(handles.pushbutton2,'cdata',picture2);
picture3=imread('暂停.jpg');
set(handles.pushbutton3,'cdata',picture3);
picture4=imread('stop.jpg');
set(handles.pushbutton5,'cdata',picture4);
set(handles.pushbutton12,'string',0);
handles.timer1= timer('Period',0.01,'ExecutionMode','FixedRate','TimerFcn',{@UpdatePlot,handles});
% handles.timer2= timer('ExecutionMode','singleShot','TimerFcn',{@Play,handles});
% Update handles structure
guidata(hObject, handles);
global n stp x y fs C Cul w fpath i m a b;
n=10;m=0;
stp=0;i=1;
C=zeros(1,6);
fs=11025;
[a,b]=ch_Filter();
set(handles.slider7,'value',20);
set(handles.edit7,'string',num2str(20));
% Choose default command line output for gui
handles.output = hObject;
set(handles.slider1,'visible','off');
set(handles.slider2,'visible','off');
set(handles.slider3,'visible','off');
set(handles.slider4,'visible','off');
set(handles.slider5,'visible','off');
set(handles.slider6,'visible','off');
set(handles.text29,'visible','off');
set(handles.text30,'visible','off');
set(handles.pushbutton12,'visible','off');
set(handles.text13,'visible','off');
set(handles.text17,'visible','off');
set(handles.text18,'visible','off');
set(handles.text19,'visible','off');
set(handles.text20,'visible','off');
set(handles.text21,'visible','off');
set(handles.edit1,'visible','off');
set(handles.edit2,'visible','off');
set(handles.edit3,'visible','off');
set(handles.edit4,'visible','off');
set(handles.edit5,'visible','off');
set(handles.edit6,'visible','off');
set(handles.edit1,'string','0');
set(handles.edit2,'string','0');
set(handles.edit3,'string','0');
set(handles.edit4,'string','0');
set(handles.edit5,'string','0');
set(handles.edit6,'string','0');
set(handles.edit1,'value',0);
set(handles.edit2,'value',0);
set(handles.edit3,'value',0);
set(handles.edit4,'value',0);
set(handles.edit5,'value',0);
set(handles.edit6,'value',0);
set(handles.uipanel11,'visible','on');
set(handles.togglebutton1,'value',0)
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes gui wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = gui_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 selection change in listbox3.
function listbox3_Callback(~, eventdata, handles)
% hObject handle to listbox3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns listbox3 contents as cell array
% contents{get(hObject,'Value')} returns selected item from listbox3
% --- Executes during object creation, after setting all properties.
function listbox3_CreateFcn(hObject, eventdata, handles)
% hObject handle to listbox3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox 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
% --- Executes on slider movement.
function slider1_Callback(hObject, eventdata, handles)
% hObject handle to slider1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
global y C w1 w w2 w3 w4 w5 w6 a b x fs stp;
C(1)=get(hObject,'value');
set(handles.edit1,'string',num2str(C(1)));
axes(handles.axes2);
Equalizer_plot();
w1=filter(10^(C(1)/20)*b{1},a{1},y);
w=w1+w2+w3+w4+w5+w6;
Cul_1=x.CurrentSample;
xx=x;
spmd
play(xx,Cul_1);
pause(0.12);
pause(xx);
end
Cul=xx.CurrentSample;
x=audioplayer(w,fs);
if(stp==0)
play(x,Cul);
end
% --- Executes during object creation, after setting all properties.
function slider1_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
% --- Executes on slider movement.
function slider2_Callback(hObject, eventdata, handles)
% hObject handle to slider2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
global C w1 w w2 w3 w4 w5 w6 a b y x fs stp;
C(2)=get(hObject,'value');
set(handles.edit2,'string',num2str(C(2)));
axes(handles.axes2);
Equalizer_plot();
w2=filter(10^(C(2)/20)*b{2},a{2},y);
w=w1+w2+w3+w4+w5+w6;
Cul_1=x.CurrentSample;
xx=x;
spmd
play(xx,Cul_1);
pause(0.12);
pause(xx);
end
Cul=xx.CurrentSample;
x=audioplayer(w,fs);
if(stp==0)
play(x,Cul);
end
% --- Executes during object creation, after s