Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
the hurlers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Herman Andersen Dyrkorn
the hurlers
Commits
12de65fc
Commit
12de65fc
authored
4 years ago
by
Herman Andersen Dyrkorn
Browse files
Options
Downloads
Plain Diff
Merge branch '21-soundeffects' into 'master'
Resolve "soundeffects" Closes
#21
See merge request
!25
parents
718a2b16
0c4118af
No related branches found
Branches containing commit
No related tags found
1 merge request
!25
Resolve "soundeffects"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sample/Controller.java
+3
-0
3 additions, 0 deletions
src/sample/Controller.java
src/sample/SoundController.java
+30
-0
30 additions, 0 deletions
src/sample/SoundController.java
src/sample/woosh.mp3
+0
-0
0 additions, 0 deletions
src/sample/woosh.mp3
with
33 additions
and
0 deletions
src/sample/Controller.java
+
3
−
0
View file @
12de65fc
...
...
@@ -31,6 +31,9 @@ public class Controller {
public
void
handleHurlAll
()
{
//delete all thoughts and display the list
listView
.
getItems
().
clear
();
SoundController
sound
=
SoundController
.
getInstance
();
sound
.
playSound
();
}
public
void
handleHurlSelected
()
{
...
...
This diff is collapsed.
Click to expand it.
src/sample/SoundController.java
0 → 100644
+
30
−
0
View file @
12de65fc
package
sample
;
import
javafx.scene.media.MediaPlayer
;
import
javafx.scene.media.Media
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
SoundController
{
private
List
<
String
>
sounds
=
new
ArrayList
<>();
//Creating Singleton
private
static
final
SoundController
INSTANCE
=
new
SoundController
();
private
SoundController
(){
addSound
(
"./src/sample/woosh.mp3"
);
}
public
static
SoundController
getInstance
(){
return
INSTANCE
;
}
//End Singleton
public
void
addSound
(
String
file
){
this
.
sounds
.
add
(
file
);
}
public
void
playSound
(){
Media
sound
=
new
Media
(
new
File
(
sounds
.
get
(
0
)).
toURI
().
toString
());
MediaPlayer
mediaPlayer
=
new
MediaPlayer
(
sound
);
mediaPlayer
.
play
();
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/sample/woosh.mp3
0 → 100644
+
0
−
0
View file @
12de65fc
File added
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment