Public class Channel { Private String description; Private String imgPath; Private String audpath; Private MediaPlayer mediaPlayer;...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Public class Channel { Private String description; Private String imgPath; Private String audpath; Private MediaPlayer mediaPlayer; Public Channel (String Description, String imgPath, String audPath) { This.desc = description; This pathToImage = imgPath; This.audPath = audPath; mediaPlayer = new MediaPlayer(); } } Problem Solving 2 A channel is created with the following attributes: о A description like "VOLTRON: DEFENDER OF THE UNIVERSE". • ○ The path to an image file that is a still image from the show. о The path to an audio file like a .WAV or .mp3 Each channel should create its own Media Player that can be used to control playback of its media. Use the space to the left to define a Channel class. Include fields and a constructor. ○ You do not need to worry about any other methods at this time. Problem Solving 3 The Channel class should provide any methods necessary for controlling the playback of its audio clip, including: • A method to play the clip. • A method to stop the clip. • • A method to increase the volume by 0.1 up to a max of 1.0. A method to decrease the volume by 0.1 down to a min of 0.0. • A method to get the current volume (a value between 0.0-1.0 inclusive). Use the space to the right to implement the last two methods in your Channel class. The Media Player provides methods that you will find useful: • setVolume (double v) public void decreaseVolume() { double minVolume = 0.0; double volAfterDecrease = mediaPlayer.getVolume() - 0.1; double minOfBoth = Math.min (minVolume, volAfterDecrease); mediaPlayer.setVolume (minOfBoth); } public double getCurrentVolume() { return media Player.getVolume(); } • getVolume () You may want to review the online documentation for the MediaPlayer. } public void changeChannel (int channelNumber) { Problem Solving 4 Assume that you have the following fields: private Channel () channels; private Channel currentChannel; Write a method in your main GUI class that, given a channel number, changes to the specified channel. • If it's the same channel that is currently playing, don't change it! • Otherwise: ○ Stop any audio that is currently playing. о о о 00 о Play the audio for the new channel. Display the channel number and description somewhere in the GUI. Display the still image somewhere in the GUI. Challenge: Set the volume on the new channel to the same as the last channel. Public class Channel { Private String description; Private String imgPath; Private String audpath; Private MediaPlayer mediaPlayer; Public Channel (String Description, String imgPath, String audPath) { This.desc = description; This pathToImage = imgPath; This.audPath = audPath; mediaPlayer = new MediaPlayer(); } } Problem Solving 2 A channel is created with the following attributes: о A description like "VOLTRON: DEFENDER OF THE UNIVERSE". • ○ The path to an image file that is a still image from the show. о The path to an audio file like a .WAV or .mp3 Each channel should create its own Media Player that can be used to control playback of its media. Use the space to the left to define a Channel class. Include fields and a constructor. ○ You do not need to worry about any other methods at this time. Problem Solving 3 The Channel class should provide any methods necessary for controlling the playback of its audio clip, including: • A method to play the clip. • A method to stop the clip. • • A method to increase the volume by 0.1 up to a max of 1.0. A method to decrease the volume by 0.1 down to a min of 0.0. • A method to get the current volume (a value between 0.0-1.0 inclusive). Use the space to the right to implement the last two methods in your Channel class. The Media Player provides methods that you will find useful: • setVolume (double v) public void decreaseVolume() { double minVolume = 0.0; double volAfterDecrease = mediaPlayer.getVolume() - 0.1; double minOfBoth = Math.min (minVolume, volAfterDecrease); mediaPlayer.setVolume (minOfBoth); } public double getCurrentVolume() { return media Player.getVolume(); } • getVolume () You may want to review the online documentation for the MediaPlayer. } public void changeChannel (int channelNumber) { Problem Solving 4 Assume that you have the following fields: private Channel () channels; private Channel currentChannel; Write a method in your main GUI class that, given a channel number, changes to the specified channel. • If it's the same channel that is currently playing, don't change it! • Otherwise: ○ Stop any audio that is currently playing. о о о 00 о Play the audio for the new channel. Display the channel number and description somewhere in the GUI. Display the still image somewhere in the GUI. Challenge: Set the volume on the new channel to the same as the last channel.
Expert Answer:
Answer rating: 100% (QA)
Heres what the code defines so far A class named Channel with a... View the full answer
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
In this question assume that p and q are atomic formulae. (a) Compare and contrast path formulae and state formulae in temporal logic. [4 marks] (b) Describe and contrast the meanings of F(G p) and...
-
A small piece of zinc is dissolved in 50.00 mL of 1.035M HCl. At the conclusion of the reaction, the concentration of the 50.00 mL sample is redetermined and found to be 0.812 M HCl. What must have...
-
Avillion Corporation had a $45,000 debit balance in Accounts receivable and a $3,500 credit balance in Allowance for uncollectibles on December 31, 2017. The company prepared the following aging...
-
The data shown in Table 6E.4 are the deviations from nominal diameter for holes drilled din a carbon-fiber composite material used in aerospace manufacturing. The values reported are deviations from...
-
Identify the unknown isotope \(\mathrm{X}\) in the following decays. a. \(\mathrm{X} ightarrow{ }^{224} \mathrm{Ra}+\alpha\) b. \(\mathrm{X} ightarrow{ }^{207} \mathrm{~Pb}+\mathrm{e}^{-}\) c. \({...
-
Skyler Company was organized on November 1 of the previous year. After seven months of start-up losses, management had expected to earn a profit during June, the most recent month. Management was...
-
Suppose that increases because households have developed a greater preference for leisure relative to consumption. Construct a pair of well-labeled diagrams of equilibrium in the factor markets to...
-
Kate Jackson, a new staff accountant, is confused because of the complexities involving accounting standard setting. Specifically, she is confused by the number of bodies issuing financial reporting...
-
The treasurer of Simmons Corporation, a newly formed software company is trying to ascertain Simmons cash flows for the next three months. Expected sales are: April 300 May 360 and June 500 50% of...
-
Copra Ltd manufactures three products Q, R and S. Below are the output and cost data for the period just ended. Output No. of production runs Material cost per unit () Direct labour hours per unit...
-
Chase Company uses the perpetual inventory method. The inventory records for Chase reflected the following information: January 1 Beginning inventory January 12 Purchase January 18 Sales January 21...
-
Kate's soccer team is selling coupon books and recipe books to raise money for transportation to their games. Coupon books cost $12 each and recipe books cost $7.50 each. If Kate sold a total of 42...
-
Julie bought 3 fruits: an apple, a banana, and a guava at a cost of $0.25,$0.23 and $0.17 respectively. How much did she pay?
-
Calculate the overall on-prem cost for the e-commerce architecture. State all the assumptions. You can omit the costs related to the IT staff
-
The concentric loops of radii (r) and (2r) each carries the same current (I) when a current of intensity 12A passing through a long wire, as shown in the figure, the total magnetic flux density at...
-
Explain how two samples can have the same mean but different standard deviations. Draw a bar graph that shows the two samples, their means an standard deviations as error bars. T S
-
At least when our focus is on efficiency, the core problem with monopolies emanates from the monopolists strategic under-production of outputnot from the fact that monopolists make profits. But...
-
Subsistence Levels of Consumption: Suppose you are interested in modeling a policy issue involving poor households in an under-developed country. A: The households we are trying to model are...
-
Substitution Effects and Social Security Cost of Living Adjustments: In end-of chapter exercise 6.16, you investigated the governments practice for adjusting social security income for seniors by...
-
The Brian B. Sand & Zachary B. Sand Joint Trust (the Trust) sued the Biotechnology Value Fund (BVF) under Section 16(b) of the Securities Exchange Act of 1934. Mark Lampert controlled BVF as well as...
-
John Marshall and Alan Tucker began working together at Marshalls financial consulting firm in approximately 1995, and they renamed the firm Marshall, Tucker & Associates, LLC. In addition to working...
-
Ariad Pharmaceuticals, Inc. (Ariad), is a small Cambridge-based pharmaceutical company whose shares are traded on the Nasdaq exchange. Maureen Curran joined Ariad in 2006 and eventually became the...
Study smarter with the SolutionInn App