Last change
on this file since 1102 was 1102, checked in by davidb, 6 years ago |
Reworking of the code-base to separate logic from graphics. This version of Expeditee now supports a JFX graphics as an alternative to SWING
|
File size:
1008 bytes
|
Line | |
---|
1 | package org.apollo.io;
|
---|
2 |
|
---|
3 | import java.io.File;
|
---|
4 | import java.io.IOException;
|
---|
5 |
|
---|
6 | import org.apollo.widgets.SampledTrack;
|
---|
7 | import org.expeditee.core.Point;
|
---|
8 | import org.expeditee.gui.DisplayController;
|
---|
9 | import org.expeditee.importer.FileImporter;
|
---|
10 | import org.expeditee.items.Item;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * Imports sampled audio files as track widgets into the current frame.
|
---|
14 | *
|
---|
15 | * @author Brook Novak
|
---|
16 | *
|
---|
17 | */
|
---|
18 | public class SampledAudioFileImporter implements FileImporter {
|
---|
19 |
|
---|
20 | public Item importFile(File f, Point location) throws IOException
|
---|
21 | {
|
---|
22 | if (location == null || !AudioIO.canImportFile(f) || DisplayController.getCurrentFrame() == null) return null;
|
---|
23 |
|
---|
24 | SampledTrack trackWidget = SampledTrack.createFromFile(
|
---|
25 | f,
|
---|
26 | DisplayController.getCurrentFrame(),
|
---|
27 | location.x,
|
---|
28 | location.y);
|
---|
29 |
|
---|
30 | // Add the sampled track widget to the current frame
|
---|
31 | DisplayController.getCurrentFrame().addAllItems(trackWidget.getItems());
|
---|
32 |
|
---|
33 | return trackWidget.getSource(); // Don't allow for other importers to deal with this file
|
---|
34 |
|
---|
35 | }
|
---|
36 |
|
---|
37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.