Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function varargout = sum(varargin)
- % SUM MATLAB code for sum.fig
- % SUM, by itself, creates a new SUM or raises the existing
- % singleton*.
- %
- % H = SUM returns the handle to a new SUM or the handle to
- % the existing singleton*.
- %
- % SUM('CALLBACK',hObject,eventData,handles,...) calls the local
- % function named CALLBACK in SUM.M with the given input arguments.
- %
- % SUM('Property','Value',...) creates a new SUM or raises the
- % existing singleton*. Starting from the left, property value pairs are
- % applied to the GUI before sum_OpeningFcn gets called. An
- % unrecognized property name or invalid value makes property application
- % stop. All inputs are passed to sum_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 sum
- % Last Modified by GUIDE v2.5 06-Dec-2016 16:47:01
- % Begin initialization code - DO NOT EDIT
- gui_Singleton = 1;
- gui_State = struct('gui_Name', mfilename, ...
- 'gui_Singleton', gui_Singleton, ...
- 'gui_OpeningFcn', @sum_OpeningFcn, ...
- 'gui_OutputFcn', @sum_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 EDIT
- % --- Executes just before sum is made visible.
- function sum_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 sum (see VARARGIN)
- % Choose default command line output for sum
- handles.output = hObject;
- % Update handles structure
- guidata(hObject, handles);
- % UIWAIT makes sum wait for user response (see UIRESUME)
- % uiwait(handles.figure1);
- % --- Outputs from this function are returned to the command line.
- function varargout = sum_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 slider movement.
- function slider1_Callback(hObject, eventdata, handles)
- val = get(hObject, 'Value');
- set_param('Ecv/dB Gain5','db',int2str(val));
- s = strcat(int2str(val),' dB');
- set(handles.text6, 'String', s);
- %x=round(get(hObject,'Value'));
- %set(handles.sliderValue_editText, 'String', [int2str(x) ' dB']);
- %set_param('Ecv/dB Gain1','db',int2str(x));
- % 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
- % --- 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 button press in pushbutton1.
- function pushbutton1_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton1 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- x=get(hObject,'String');
- if strcmp(x,'Play')
- set_param('Ecv', 'SimulationCommand', 'start');
- set(hObject,'String', 'Pause');
- set(handles.slider1, 'Value', 0);
- set(handles.slider2, 'Value', 0);
- set(handles.slider3, 'Value', 0);
- set(handles.slider4, 'Value', 0);
- set(handles.slider5, 'Value', 0);
- set(handles.slider7, 'Value', 0);
- set(handles.text11, 'String', '0 dB');
- set(handles.text10, 'String', '0 dB');
- set(handles.text9, 'String', '0 dB');
- set(handles.text8, 'String', '0 dB');
- set(handles.text7, 'String', '0 dB');
- set(handles.text6, 'String', '0 dB');
- set_param('Ecv/dB Gain7','db','0');
- set_param('Ecv/dB Gain5','db','0');
- set_param('Ecv/dB Gain1','db','0');
- set_param('Ecv/dB Gain2','db','0');
- set_param('Ecv/dB Gain3','db','0');
- set_param('Ecv/dB Gain4','db','0');
- else if strcmp(x,'Pause')
- set_param('Ecv', 'SimulationCommand', 'pause');
- set(hObject,'String', 'Continue');
- else if strcmp(x,'Continue')
- set_param('Ecv', 'SimulationCommand', 'continue');
- set(hObject,'String', 'Pause');
- end
- end
- 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)
- val = get(hObject, 'Value');
- set_param('Ecv/dB Gain1','db',int2str(val));
- s = strcat(int2str(val),' dB');
- set(handles.text7, 'String', s);
- % Hints: get(hObject,'Value') returns position of slider
- % get(hObject,'Min') and get(hObject,'Max') to determine range of slider
- % --- Executes during object creation, after setting all properties.
- function slider2_CreateFcn(hObject, eventdata, handles)
- % hObject handle to slider2 (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 slider3_Callback(hObject, eventdata, handles)
- % hObject handle to slider3 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- val = get(hObject, 'Value');
- set_param('Ecv/dB Gain2','db',int2str(val));
- s = strcat(int2str(val),' dB');
- set(handles.text8, 'String', s);
- % Hints: get(hObject,'Value') returns position of slider
- % get(hObject,'Min') and get(hObject,'Max') to determine range of slider
- % --- Executes during object creation, after setting all properties.
- function slider3_CreateFcn(hObject, eventdata, handles)
- % hObject handle to slider3 (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 slider4_Callback(hObject, eventdata, handles)
- % hObject handle to slider4 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- val = get(hObject, 'Value');
- set_param('Ecv/dB Gain3','db',int2str(val));
- s = strcat(int2str(val),' dB');
- set(handles.text9, 'String', s);
- % Hints: get(hObject,'Value') returns position of slider
- % get(hObject,'Min') and get(hObject,'Max') to determine range of slider
- % --- Executes during object creation, after setting all properties.
- function slider4_CreateFcn(hObject, eventdata, handles)
- % hObject handle to slider4 (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 slider5_Callback(hObject, eventdata, handles)
- % hObject handle to slider5 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- val = get(hObject, 'Value');
- set_param('Ecv/dB Gain4','db',int2str(val));
- s = strcat(int2str(val),' dB');
- set(handles.text10, 'String', s);
- % Hints: get(hObject,'Value') returns position of slider
- % get(hObject,'Min') and get(hObject,'Max') to determine range of slider
- % --- Executes during object creation, after setting all properties.
- function slider5_CreateFcn(hObject, eventdata, handles)
- % hObject handle to slider5 (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 button press in checkbox1.
- function checkbox1_Callback(hObject, eventdata, handles)
- % hObject handle to checkbox1 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- val = get(hObject, 'Value');
- set_param('Ecv/Manual Switch','sw',int2str(val));
- % Hint: get(hObject,'Value') returns toggle state of checkbox1
- % --- Executes on slider movement.
- function slider7_Callback(hObject, eventdata, handles)
- % hObject handle to slider7 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- val = get(hObject, 'Value');
- set_param('Ecv/Pure','db',int2str(val));
- s = strcat(int2str(val),' dB');
- set(handles.text11, 'String', s);
- % Hints: get(hObject,'Value') returns position of slider
- % get(hObject,'Min') and get(hObject,'Max') to determine range of slider
- % --- Executes during object creation, after setting all properties.
- function slider7_CreateFcn(hObject, eventdata, handles)
- % hObject handle to slider7 (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
- function edit1_Callback(hObject, eventdata, handles)
- % hObject handle to edit1 (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,'String') returns contents of edit1 as text
- % str2double(get(hObject,'String')) returns contents of edit1 as a double
- % --- Executes during object creation, after setting all properties.
- function edit1_CreateFcn(hObject, eventdata, handles)
- % hObject handle to edit1 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint: edit 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 during object creation, after setting all properties.
- function text6_CreateFcn(hObject, eventdata, handles)
- % hObject handle to text6 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % --- Executes on button press in pushbutton2.
- function pushbutton2_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton2 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- set(handles.slider1, 'Value', 0);
- set(handles.slider2, 'Value', 0);
- set(handles.slider3, 'Value', 0);
- set(handles.slider4, 'Value', 0);
- set(handles.slider5, 'Value', 0);
- set(handles.slider7, 'Value', 0);
- set(handles.text11, 'String', '0 dB');
- set(handles.text10, 'String', '0 dB');
- set(handles.text9, 'String', '0 dB');
- set(handles.text8, 'String', '0 dB');
- set(handles.text7, 'String', '0 dB');
- set(handles.text6, 'String', '0 dB');
- set_param('Ecv/dB Gain7','db','0');
- set_param('Ecv/dB Gain5','db','0');
- set_param('Ecv/dB Gain1','db','0');
- set_param('Ecv/dB Gain2','db','0');
- set_param('Ecv/dB Gain3','db','0');
- set_param('Ecv/dB Gain4','db','0');
- % --- Executes on button press in pushbutton3.
- function pushbutton3_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton3 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- [chosendirectory chosenfile] = uigetfile('*.mp3','Select the Music');
- fullchosenfile = [chosenfile chosendirectory];
- %filename = imread(fullchosenfile);
- s = strcat(chosenfile,chosendirectory);
- set(handles.text13, 'String', s);
- set_param('Ecv', 'SimulationCommand', 'stop');
- set_param('Ecv/From Multimedia File','inputFilename',s);
- %sim('Ecv');
- set_param('Ecv', 'SimulationCommand', 'pause');
- set(handles.pushbutton1,'String', 'Play');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement