function varargout = MovieJoiner(varargin) % MOVIEJOINER M-file for MovieJoiner.fig % MOVIEJOINER, by itself, creates a new MOVIEJOINER or raises the.

Slides:



Advertisements
Similar presentations
CS112 Scientific Computation Department of Computer Science Wellesley College Geese honk, but they don’t wave Sinusoidal waves.
Advertisements

Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent.
CS112 Scientific Computation Department of Computer Science Wellesley College Interactive Programs Graphical User Interfaces.
Digital Image Processing Lecture3: Introduction to MATLAB.
EPSII 59:006 Spring Topics Using TextPad If Statements Relational Operators Nested If Statements Else and Elseif Clauses Logical Functions For Loops.
M-files While commands can be entered directly to the command window, MATLAB also allows you to put commands in text files called M- files. M-files are.
Programming a GUI Hanan sedaghat pisheh. For calling GUI, we need a function with no inputs or outputs First We create a m.file m file has the same name.
The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
A short intermission about function handles and cell arrays A MATLAB function may be referenced by a handle. >> sphere(100)
Introduction to the Graphical User Interface (GUI) in MATLAB
Matlab GUIs GUIDE.
CS 170 – INTRO TO SCIENTIFIC AND ENGINEERING PROGRAMMING.
Introduction to Matlab & Data Analysis
GUI Input and Output Greg Reese, Ph.D Research Computing Support Group Academic Technology Services Miami University.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Typing Application Introducing Keyboard Events, Menus, Dialogs and the Dictionary.
GUI development with Matlab: GUI Front Panel Components 1 GUI front panel components In this section, we will look at -GUI front panel components -Programming.
© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures for Java William H. Ford William R. Topp Appendix E The EZJava.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Introduction to MATLAB Session 3 Simopekka Vänskä, THL Department of Mathematics and Statistics University of Helsinki 2011.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 6”
Functions CS 103 March 3, Review A function is a set of code we can execute on command to perform a specific task A function is a set of code we.
Functions CS 103. Review A function is a set of code we can execute on command to perform a specific task When we call a function, we can pass arguments.
Digital Image Processing Lecture10: MATLAB Example – Utility M-functions for Intensity Transformations.
Introduction to Matlab’s Graphical User Interface (GUI) Type “guide” “Guide” creates interface on a Figure window and code in an M-file. Some hidden code.
Graphical User Interfaces I The central station is the bubble gum planet with 280 pounds of clay and three head phone lines that come out and orbit the.
Introduction to MATLAB Damon Tomlin February 22, 2008 Lecture 3: Data Visualization & User Interfaces.
Flow Control and Functions ● Script files ● If's and For's ● Basics of writing functions ● Checking input arguments ● Variable input arguments ● Output.
Computer Science 112 Fundamentals of Programming II Command Buttons and Responding to Events.
Advanced Topics- Functions Introduction to MATLAB 7 Engineering 161.
Chapter Two Creating a First Project in Visual Basic.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Graphic User Interfaces (GUI) GUI provides a way to interact friendly with possibly complex programs. There are two types of GUI: - MDI: multiple document.
Introduction to Matlab & Data Analysis 2015 In this tutorial we will: Build a practical application using GUIDE Learn more about graphical user interface.
Illustration of a Visual Basic Program Running an Ada Program 1 by Richard Conn 11 September 1999.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
GUI development with Matlab: GUI Front Panel Components GUI development with Matlab: Other GUI Components 1 Other GUI components In this section, we will.
Select (drop-down list) Inputs. Insert/Form/List Menu.
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
CS112 Scientific Computation Department of Computer Science Wellesley College Interactive Programs Graphical User Interfaces.
EGR 115 Introduction to Computing for Engineers
EGR 115 Introduction to Computing for Engineers Graphical User Interface Design in MATLAB - Part 2 Monday 24 Nov 2014 EGR 115 Introduction to Computing.
Introduction to Matlab Module #10 Page 1 Introduction to Matlab Module #10 – Creating Graphical User Interfaces Topics 1.Overview of GUI Development using.
CS112 Scientific Computation Department of Computer Science Wellesley College Blind to change More on GUIs.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Graphical User Interfaces I The central station is the bubble gum planet with 280 pounds of clay and three head phone lines that come out and orbit the.
Lecture (7) Introduction to GUI Eng. Osama Talaat 1.
Data Analysis GUI Documentation guide. Terminology GUI – Graphical User Interface Log-File – File containing data of interest which is generated by user’s.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
PATTERN RECOGNITION LAB 8 TA : Nouf Al-Harbi::
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
軟體實作與計算實驗 1  SUDOKU  New  Play  Check Lecture 8II SUDOKU PUZZLE.
Dive Into® Visual Basic 2010 Express
Graphical User Interfaces I
Graphical User Interface in MATLAB
Console and GUI Programs
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
Scripts & Functions Scripts and functions are contained in .m-files
More on Graphical User Interfaces
MATLAB GUI with GUIDE 報告人:張捷勝.
E177, Graphics Objects in Matlab February 26, me
Functions In Matlab.
Digital Image Processing
Fundamentals of Programming I Windows, Labels, and Command Buttons
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Electrical and Computer Engineering Department SUNY – New Paltz
Presentation transcript:

function varargout = MovieJoiner(varargin) % MOVIEJOINER M-file for MovieJoiner.fig % MOVIEJOINER, by itself, creates a new MOVIEJOINER or raises the existing % singleton*. % % H = MOVIEJOINER returns the handle to a new MOVIEJOINER or the handle to % the existing singleton*. % % MOVIEJOINER('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in MOVIEJOINER.M with the given input arguments. % % MOVIEJOINER('Property','Value',...) creates a new MOVIEJOINER or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before MovieJoiner_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to MovieJoiner_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 MovieJoiner % Last Modified by GUIDE v Feb :00:25 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename,... 'gui_Singleton', gui_Singleton,... '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 MovieJoiner is made visible. function MovieJoiner_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 MovieJoiner (see VARARGIN) % Choose default command line output for MovieJoiner handles.output = hObject; handles.aviFiles={}; handles.FileNumber=0; % Update handles structure guidata(hObject, handles); % UIWAIT makes MovieJoiner wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = MovieJoiner_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 FileList. function FileList_Callback(hObject, eventdata, handles) % hObject handle to FileList (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns FileList contents as cell array % contents{get(hObject,'Value')} returns selected item from FileList % --- Executes during object creation, after setting all properties. function FileList_CreateFcn(hObject, eventdata, handles) % hObject handle to FileList (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 button press in addFiles. function addFiles_Callback(hObject, eventdata, handles) % hObject handle to addFiles (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) [FileName, PathName] = uigetfile({'*.avi'},'Select avi files','MultiSelect','on'); if isa(FileName, 'cell')==0 FileName = {FileName}; end n=length(FileName); for k=1:n handles.aviFiles{handles.FileNumber+k}=[PathName FileName{k}]; end handles.FileNumber=handles.FileNumber+n; set(handles.FileList,'String',handles.aviFiles(1,1:handles.Fi leNumber), 'Value', handles.FileNumber); guidata(hObject, handles); % --- Executes on button press in removeFiles. function removeFiles_Callback(hObject, eventdata, handles) % hObject handle to removeFiles (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) removeIdx=get(handles.FileList,'Value'); idx=true(1,handles.FileNumber); idx(removeIdx)=false; handles.aviFiles=handles.aviFiles(1,idx); handles.FileNumber=length(handles.aviFiles); set(handles.FileList,'String',handles.aviFiles(1,1:handles.Fi leNumber),'Value', 1); guidata(hObject, handles); % --- Executes on button press in moveUpFiles. function moveUpFiles_Callback(hObject, eventdata, handles) % hObject handle to moveUpFiles (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) idx=get(handles.FileList,'Value'); for k=idx if k>1 tmp=handles.aviFiles(1,k-1); handles.aviFiles(1,k-1)=handles.aviFiles(1,k); handles.aviFiles(1,k)=tmp; else idx(1)=2; end set(handles.FileList,'String',handles.aviFiles(1,1:handles.Fi leNumber),'Value', idx-1); guidata(hObject, handles); % --- Executes on button press in moveDownFiles. function moveDownFiles_Callback(hObject, eventdata, handles) % hObject handle to moveDownFiles (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) idx=get(handles.FileList,'Value'); for k=idx if k<handles.FileNumber tmp=handles.aviFiles(1,k+1); handles.aviFiles(1,k+1)=handles.aviFiles(1,k); handles.aviFiles(1,k)=tmp; else idx(end)=handles.FileNumber-1; end set(handles.FileList,'String',handles.aviFiles(1,1:handles.Fi leNumber),'Value', idx+1); guidata(hObject, handles); % --- Executes on selection change in compMethod. function compMethod_Callback(hObject, eventdata, handles) % hObject handle to compMethod (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns compMethod contents as cell array % contents{get(hObject,'Value')} returns selected item from compMethod % --- Executes during object creation, after setting all properties. function compMethod_CreateFcn(hObject, eventdata, handles) % hObject handle to compMethod (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 % --- Executes on selection change in compQuality. function compQuality_Callback(hObject, eventdata, handles) % hObject handle to compQuality (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns compQuality contents as cell array % contents{get(hObject,'Value')} returns selected item from compQuality % --- Executes during object creation, after setting all properties. function compQuality_CreateFcn(hObject, eventdata, handles) % hObject handle to compQuality (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 % --- Executes on selection change in FPS. function FPS_Callback(hObject, eventdata, handles) % hObject handle to FPS (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns FPS contents as cell array % contents{get(hObject,'Value')} returns selected item from FPS % --- Executes during object creation, after setting all properties. function FPS_CreateFcn(hObject, eventdata, handles) % hObject handle to FPS (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 % --- Executes on button press in joinFiles. function joinFiles_Callback(hObject, eventdata, handles) % hObject handle to joinFiles (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) [FileName, PathName] = uiputfile({'binder.avi'},'Binding avi file'); vfname=[PathName FileName]; items=get(handles.compMethod, 'String'); idx=get(handles.compMethod, 'Value'); cfg.compression=items{idx}; items=get(handles.FPS, 'String'); idx=get(handles.FPS, 'Value'); cfg.fps=str2double(items{idx}); items=get(handles.compQuality, 'String'); idx=get(handles.compQuality, 'Value'); cfg.quality=str2double(items{idx}); handles.bindingFile=aviJoiner(handles.aviFiles,vfname,'config uration', cfg); guidata(hObject, handles);