Last change
on this file since 318 was 318, checked in by bjn8, 16 years ago |
Refactored a class name and extended recorder widgets to have a perminant lifetime option (for optimum idea capturing!)
|
File size:
970 bytes
|
Rev | Line | |
---|
[315] | 1 | package org.apollo.io;
|
---|
| 2 |
|
---|
| 3 | import java.awt.Point;
|
---|
| 4 | import java.io.File;
|
---|
| 5 | import java.io.IOException;
|
---|
| 6 |
|
---|
[318] | 7 | import org.apollo.widgets.SampledTrack;
|
---|
[315] | 8 | import org.expeditee.gui.DisplayIO;
|
---|
| 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) ||
|
---|
| 23 | DisplayIO.getCurrentFrame() == null) return null;
|
---|
| 24 |
|
---|
[318] | 25 | SampledTrack trackWidget = SampledTrack.createFromFile(
|
---|
[315] | 26 | f,
|
---|
| 27 | DisplayIO.getCurrentFrame(),
|
---|
| 28 | location.x,
|
---|
| 29 | location.y);
|
---|
| 30 |
|
---|
| 31 | // Add the sampled track widget to the current frame
|
---|
| 32 | DisplayIO.getCurrentFrame().addAllItems(trackWidget.getItems());
|
---|
| 33 |
|
---|
| 34 | return trackWidget.getSource(); // Don't allow for other importers to deal with this file
|
---|
| 35 |
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.