Last change
on this file since 1142 was 1142, checked in by bln4, 6 years ago |
Used Eclipse refactoring to encapsulate Point.X and Point.Y
|
File size:
1018 bytes
|
Rev | Line | |
---|
[315] | 1 | package org.apollo.io;
|
---|
| 2 |
|
---|
| 3 | import java.io.File;
|
---|
| 4 | import java.io.IOException;
|
---|
| 5 |
|
---|
[318] | 6 | import org.apollo.widgets.SampledTrack;
|
---|
[1102] | 7 | import org.expeditee.core.Point;
|
---|
| 8 | import org.expeditee.gui.DisplayController;
|
---|
[315] | 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 |
|
---|
[1102] | 20 | public Item importFile(File f, Point location) throws IOException
|
---|
| 21 | {
|
---|
| 22 | if (location == null || !AudioIO.canImportFile(f) || DisplayController.getCurrentFrame() == null) return null;
|
---|
[315] | 23 |
|
---|
[318] | 24 | SampledTrack trackWidget = SampledTrack.createFromFile(
|
---|
[315] | 25 | f,
|
---|
[1102] | 26 | DisplayController.getCurrentFrame(),
|
---|
[1142] | 27 | location.getX(),
|
---|
| 28 | location.getY());
|
---|
[315] | 29 |
|
---|
| 30 | // Add the sampled track widget to the current frame
|
---|
[1102] | 31 | DisplayController.getCurrentFrame().addAllItems(trackWidget.getItems());
|
---|
[315] | 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.