public class DeviceWorker extends MidicaWorker
This class is used to setup the MIDI devices in the background while a WaitView
is shown.
Setting up the MIDI devices may be time consuming because it includes loading a soundbank file and that file may be large.
The worker is executed in the background before the (blocking) setVisible() method of the (modal) waiting dialog is called. That causes the execution of doInBackground()
that sets up the devices.
After the work is finished, MidicaWorker.done()
is called and closes the waiting dialog.
Modifier and Type | Field and Description |
---|---|
private PlayerController |
playerController |
Constructor and Description |
---|
DeviceWorker(WaitView view,
PlayerController playerController)
Creates a worker that sets up MIDI devices in the background while a waiting dialog is shown.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Exception |
doInBackground()
Sets up the MIDI devices in the background.
|
done
private PlayerController playerController
public DeviceWorker(WaitView view, PlayerController playerController)
Creates a worker that sets up MIDI devices in the background while a waiting dialog is shown.
view
- The waiting dialog.playerController
- The controller class for the player.protected java.lang.Exception doInBackground()
Sets up the MIDI devices in the background. This method is executed after calling SwingWorker.execute()
.
doInBackground
in class MidicaWorker