source: trunk/src_apollo/org/apollo/io/SampledAudioFileImporter.java@ 318

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
Line 
1package org.apollo.io;
2
3import java.awt.Point;
4import java.io.File;
5import java.io.IOException;
6
7import org.apollo.widgets.SampledTrack;
8import org.expeditee.gui.DisplayIO;
9import org.expeditee.importer.FileImporter;
10import 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 */
18public 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
25 SampledTrack trackWidget = SampledTrack.createFromFile(
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.