mirror of
https://github.com/jneug/zeichenmaschine.git
synced 2026-04-14 06:33:34 +02:00
Timing-Problem beim Aufruf des AudioListeners behoben
This commit is contained in:
@@ -235,8 +235,8 @@ public class Sound implements Audio {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lädt falls nötig den {@link Clip} für die
|
* Lädt, falls nötig, den {@link Clip} für die
|
||||||
* {@link #audioSource Audioquelle} und startet die Wiedergabe.
|
* {@link #audioSource Audioquelle}.
|
||||||
*
|
*
|
||||||
* @return {@code true}, wenn der Clip geöffnet werden konnte, {@code false}
|
* @return {@code true}, wenn der Clip geöffnet werden konnte, {@code false}
|
||||||
* sonst.
|
* sonst.
|
||||||
@@ -264,10 +264,6 @@ public class Sound implements Audio {
|
|||||||
}
|
}
|
||||||
} else if( event.getType() == LineEvent.Type.STOP ) {
|
} else if( event.getType() == LineEvent.Type.STOP ) {
|
||||||
playbackStopped();
|
playbackStopped();
|
||||||
|
|
||||||
if( eventDispatcher != null ) {
|
|
||||||
eventDispatcher.dispatchEvent("stop", Sound.this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -313,6 +309,10 @@ public class Sound implements Audio {
|
|||||||
private void playbackStopped() {
|
private void playbackStopped() {
|
||||||
playing = false;
|
playing = false;
|
||||||
|
|
||||||
|
if( eventDispatcher != null ) {
|
||||||
|
eventDispatcher.dispatchEvent("stop", Sound.this);
|
||||||
|
}
|
||||||
|
|
||||||
if( disposeAfterPlay ) {
|
if( disposeAfterPlay ) {
|
||||||
this.dispose();
|
this.dispose();
|
||||||
disposeAfterPlay = false;
|
disposeAfterPlay = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user