- Timestamp:
- 05/10/18 16:04:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/apollo/audio/structure/AudioStructureModel.java
r903 r1102 3 3 import java.io.FileNotFoundException; 4 4 import java.io.IOException; 5 import java.lang.reflect.InvocationTargetException;6 5 import java.util.HashMap; 7 6 import java.util.HashSet; … … 14 13 15 14 import javax.sound.sampled.UnsupportedAudioFileException; 16 import javax.swing.SwingUtilities;17 15 18 16 import org.apollo.audio.ApolloSubjectChangedEvent; … … 27 25 import org.apollo.widgets.SampledTrack; 28 26 import org.apollo.widgets.TrackWidgetCommons; 29 import org.expeditee.gui.DisplayIO; 27 import org.expeditee.core.BlockingRunnable; 28 import org.expeditee.gio.EcosystemManager; 29 import org.expeditee.gui.DisplayController; 30 30 import org.expeditee.gui.Frame; 31 import org.expeditee.gui.FrameGraphics;32 31 import org.expeditee.gui.FrameIO; 33 import org.expeditee.settings.UserSettings;34 32 import org.expeditee.io.Conversion; 35 33 import org.expeditee.items.ItemUtils; 36 import org.expeditee.items.widgets. InteractiveWidget;34 import org.expeditee.items.widgets.Widget; 37 35 import org.expeditee.settings.folders.FolderSettings; 38 36 39 37 /** 40 * A thread safe model of the h eirarchical structure of a track graph...38 * A thread safe model of the hierarchical structure of a track graph... 41 39 * abstracted from Expeditee frames and audio widgets. 42 40 * 43 * The track widgets notif ty this model for keeping the structure consistent with44 * expeditees data.41 * The track widgets notify this model for keeping the structure consistent with 42 * Expeditee's data. 45 43 * 46 44 * … … 199 197 NewGraphCommitor commit = new NewGraphCommitor(rootODFrame, newGraph); 200 198 try { 201 SwingUtilities.invokeAndWait(commit);202 } catch ( InvocationTargetException e) {199 EcosystemManager.getMiscManager().runOnGIOThread(commit); 200 } catch (Exception e) { 203 201 e.printStackTrace(); 204 202 assert(false); … … 264 262 265 263 try { 266 SwingUtilities.invokeAndWait(cacheFetch);267 } catch ( InvocationTargetException e) {264 EcosystemManager.getMiscManager().runOnGIOThread(cacheFetch); 265 } catch (Exception e) { 268 266 e.printStackTrace(); 269 267 assert(false); … … 562 560 * 563 561 */ 564 private class ExpediteeCachedTrackInfoFetcher implementsRunnable562 private class ExpediteeCachedTrackInfoFetcher extends BlockingRunnable 565 563 { 566 564 private String rootFrameName; … … 578 576 } 579 577 580 public void run()578 public void execute() 581 579 { 582 580 assert(rootFrameName != null); … … 584 582 // Check if the current frame 585 583 Frame rootFrame = null; 586 if (Display IO.getCurrentFrame() != null && DisplayIO.getCurrentFrame().getName() != null587 && Display IO.getCurrentFrame().getName().equals(rootFrameName)) {588 rootFrame = Display IO.getCurrentFrame();584 if (DisplayController.getCurrentFrame() != null && DisplayController.getCurrentFrame().getName() != null 585 && DisplayController.getCurrentFrame().getName().equals(rootFrameName)) { 586 rootFrame = DisplayController.getCurrentFrame(); 589 587 } else { 590 588 // Check if in cache … … 597 595 linkedTracks = new HashMap<String, LinkedTrackModelData>(); 598 596 599 for ( InteractiveWidget iw : rootFrame.getInteractiveWidgets()) {597 for (Widget iw : rootFrame.getInteractiveWidgets()) { 600 598 601 599 if (iw instanceof SampledTrack) { … … 668 666 * 669 667 */ 670 private class NewGraphCommitor implementsRunnable668 private class NewGraphCommitor extends BlockingRunnable 671 669 { 672 670 private final OverdubbedFrame rootODFrame; … … 687 685 } 688 686 689 public void run()687 public void execute() 690 688 { 691 689 … … 1083 1081 synchronized(sharedResourceLocker) { // IMPORTANT: Must wait for new graphs to be added to the shared resources 1084 1082 1085 if ( FrameGraphics.isXRayMode()) { // discard whole model1083 if (DisplayController.isXRayMode()) { // discard whole model 1086 1084 1087 1085 // Neccessary because if the user goes into xray then moves to a new frame … … 1422 1420 1423 1421 1424 if ( FrameGraphics.isXRayMode()) { // discard whole model1422 if (DisplayController.isXRayMode()) { // discard whole model 1425 1423 1426 1424 // Neccessary because if the user goes into xray then moves to a new frame … … 1610 1608 1611 1609 try { 1612 SwingUtilities.invokeAndWait(newRunnable() {1610 EcosystemManager.getMiscManager().runOnGIOThread(new BlockingRunnable() { 1613 1611 1614 public void run() { // on swing thread1612 public void execute() { // on swing thread 1615 1613 1616 1614 synchronized(sharedResourceLocker) { … … 1672 1670 } 1673 1671 }); 1674 } catch ( InvocationTargetException e) {1672 } catch (Exception e) { 1675 1673 e.printStackTrace(); 1676 1674 assert(false);
Note:
See TracChangeset
for help on using the changeset viewer.