© Copyright 1992-2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 27 - Phone Book Application Introducing Multimedia.

Slides:



Advertisements
Similar presentations
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 24.1 Test-Driving the Ticket Information Application.
Advertisements

The Web Warrior Guide to Web Design Technologies
XP Tutorial 4 New Perspectives on Microsoft Windows XP 1 Microsoft Windows XP Personalizing Your Windows Environment Tutorial 4.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 21 - “Cat and Mouse” Painter Application.
© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 8 - Interest Calculator Application: Introducing.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 7 – Class Average Application: Introducing.
Graphics and Multimedia In visual Studio. Net (C#)
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 9 Car Payment Calculator Application Introducing the Do While...Loop and Do Until...Loop.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Chapter 8: String Manipulation
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
CHAPTER 6 Loop Structures.
A First Program Using C#
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Web Application Introducing Visual Web Developer 2008 Express and the.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Flag Quiz Application Introducing One-Dimensional Arrays and ComboBox es.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 26 – CheckWriter Application Introducing Graphics.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Introducing Web Controls Outline 29.1 Analyzing the.
Using Visual Basic 6.0 to Create Web-Based Database Applications
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Interest Calculator Application Introducing the For...Next Repetition Statements.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Shipping Hub Application Introducing Generic Collections, LINQ, For Each...Next.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Introducing.
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.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 8 - Interest Calculator Application: Introducing.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 7.1 Test-Driving the Wage Calculator Application.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 5 – Dental Payment Application: Introducing.
Tutorial 8 Programming with ActionScript 3.0. XP Objectives Review the basics of ActionScript programming Compare ActionScript 2.0 and ActionScript 3.0.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved CheckWriter Application Introducing Graphics and Printing.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 17 – Flag Quiz Application Introducing One-Dimensional.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 3.1 Test-Driving the Welcome Application 3.2.
Tutorial 91 Databases A database is an organized collection of related information stored in a file on a disk A database allows companies to store information.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Screen Scraping Application Introducing String Processing.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Class Average Application Introducing the Do...Loop While and Do...Loop Until.
Chapter 2 – Introduction to the Visual Studio .NET IDE
® Microsoft Access 2010 Tutorial 10 Automating Tasks with Macros.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 21 - “Cat and Mouse” Painter Application.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 20.1 Test-Driving the Shipping Hub Application.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 2.1 Test-Driving the Welcome Application 2.2.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 25.1 Test-Driving the ATM Application 25.2.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 18 – Student Grades Application Introducing.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 3 – Inventory Application: Introducing Variables,
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Craps Game Application Introducing Random-Number Generation and Enum.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Enhanced Inventory Application.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 16 – Craps Game Application Introducing Random-Number.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 28.1 Java Speech API 28.2 Downloading and.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
XP New Perspectives on Creating Web Pages With Word Tutorial 1 1 Creating Web Pages With Word Tutorial 1.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Dive Into® Visual Basic 2010 Express
Chapter 2 – Introduction to the Visual Studio .NET IDE
Using Procedures and Exception Handling
WEB PROGRAMMING JavaScript.
Presentation transcript:

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 27 - Phone Book Application Introducing Multimedia Using Microsoft Agent Outline 27.1 Microsoft Agent 27.2 Downloading Microsoft Agent Components 27.3 Test-Driving the Phone Book Application 27.4 Constructing the Phone Book Application 27.5 Wrap-Up

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 2 Objectives In this tutorial, you will learn to: – Download components necessary to run Microsoft Agent. – Enhance Windows applications using multimedia. – Create applications that interact with users. – Use Microsoft Agent in a C# application.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Microsoft Agent

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Microsoft Agent Microsoft Agent features: – Speech recognition engine : translates vocal sound input into a language the computer understands – Text-to-speech engine : translates typed words into sounds

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Downloading Microsoft Agent Components You should download and install three files: 1) Peedy.exe from the Microsoft Agent character files link 2) tv_enua.exe from the Microsoft Agent Text-to- speech engines link 3) actcnc.exe from the Microsoft Agent Speech recognition engines link 4) spchapi.exe from the SAPI 4.0 Runtime Support link (required for Windows XP only)

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Downloading Microsoft Agent Components Figure 27.1 Microsoft Web page containing Agent-related downloads. Text-to-speech engines link Character files link Speech-recognition engines link

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Downloading Microsoft Agent Components Figure 27.2 Location for downloading the Microsoft Agent character. Select the Peedy character here

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Phone Book Application Figure 27.3 Phone Book application Form. Run the application – Debug > Start

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Phone Book Application Figure 27.4 Peedy appears after Call Peedy Button is clicked. ComboBox disabled until Peedy arrives

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Phone Book Application Figure 27.5 Peedy in a resting pose.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Phone Book Application Figure 27.6 Selecting a name from the ComboBox. Disabled Call Peedy Button Call Peedy Button is disabled after Peedy appears

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Phone Book Application Figure 27.7 Peedy thinking. Peedy thinks after Howard is selected from the ComboBox

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Phone Book Application Figure 27.8 Peedy communicates Howard’s phone number.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Phone Book Application Figure 27.9 Peedy smiles after speaking phone number.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Phone Book Application Figure Peedy listening for a voice command. Pressing Scroll Lock displays a status box under Peedy Status box

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Phone Book Application Figure Peedy heard voice command.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Phone Book Application Figure Peedy displays requested phone number. Peedy returning number that corresponds to name spoken

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Phone Book Application Figure Context menu window. Commands in pop-up window Right click Peedy to select one of the names shown – Peedy performs same action resulting from selecting a name from the ComboBox

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Figure ACE table for the Phone Book application.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Figure Tools menu. To make Microsoft Agent accessible – Windows Forms > Tools > Customize Toolbox… Select Microsoft Agent Control 2.0 from COM Components tab of Customize Toolbox…

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Select CheckBox Figure Customize Toolbox dialog.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Figure Agent Control in the Toolbox. Added Agent Control

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Figure Form format of Phone Book. Agent control added to Form

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Figure Phone Book Form with no functionality.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Figure Rearranging and commenting the new control declaration.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Figure Declaring and creating arrays in Phone Book. Create an Agent character variable List of names in phone book List of phone numbers

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Declaring a counter variable Adding names to the ComboBox Figure Adding items to the ComboBox.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Assigning Peedy to the Agent character variable Loading the Peedy character Figure Loading the Microsoft Agent character.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application The Add method takes five arguments: 1) Command name: enables access to the command from your program 2) string that appears in a context window when the user right clicks Peedy 3) string containing words for which Peedy listens when users speak a command 4) bool that specifies whether the command is enabled 5) bool that specifies whether the command is visible in the Commands context menu

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Figure Adding commands to Peedy’s context menu. Creating commands so that Peedy can recognize names when spoken

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application MoveTo takes three arguments : 1) x-coordinate (type short ) 2)y-coordinate (type short ) 3)Speed (type long, lower number is faster) Convert.ToInt16 converts a value to a short value short data type: like a long data type, but less accurate and uses less memory Cursor.Position stores the current position of the mouse pointer

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Make Peedy fly onto screen Move Peedy Figure Displaying the Microsoft Agent character. Create the Button ’s Click event handler

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Make Peedy waveMake Peedy speak instructions Make Peedy rest Figure Code that defines Microsoft Agent’s actions when Peedy first appears on the screen.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Enable the ComboBox and disable the Call Peedy Button Figure Disable btnCall after Peedy has appeared on the screen. Set the Call Peedy Button ’s Enabled property to false and cboName ’s Enabled property to true while the Agent character is shown.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Figure Event handler objMainAgent_Command defined Retrieve user input Cast operator converts e.userInput to an object of type AgentObjects.IAgentCtlUserInput so that its members can be accessed properly

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Figure Finding the spoken or selected name. Declaring a counter variable Peedy thinks and speaks telephone number, if found The for statement searches the array for the command name.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Figure Event handler cboName_SelectedIndexChanged defined. Declaring a counter variable Peedy thinks and speaks telephone number, if found Event handler executed when the user selects the name from the ComboBox.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Constructing the Phone Book Application Figure Microsoft Agent HideEvent event handler. Reset application controls When the user selects Hide from Peedy’s context menu – E nable the Call Peedy Button

Outline © Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 40 PhoneBook.cs (1 of 9)

Outline © Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 41 PhoneBook.cs (2 of 9) Variable to hold Microsoft Agent character

Outline © Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 42 PhoneBook.cs (3 of 9)

Outline © Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 43 PhoneBook.cs (4 of 9) Loading Peedy Assigning the Peedy character

Outline © Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 44 PhoneBook.cs (5 of 9) Adding commands Showing Peedy Moving Peedy

Outline © Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 45 PhoneBook.cs (6 of 9) Command event handler Convert user input to type AgentObjcets.IAgentCtlUserIn- put Peedy waves and speaks instructions

Outline © Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 46 PhoneBook.cs (7 of 9)

Outline © Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 47 PhoneBook.cs (8 of 9) HideEvent event handler

Outline © Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 48 PhoneBook.cs (9 of 9)