Changeset 345
- Timestamp:
- 10/05/08 20:13:15 (16 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/Browser.java
r321 r345 239 239 MessageBay.warningMessage(message); 240 240 241 FrameKeyboardActions keyboardListner = new FrameKeyboardActions(); 242 this.getContentPane().addKeyListener(keyboardListner); 243 this.addKeyListener(keyboardListner); 241 this.getContentPane().addKeyListener(FrameKeyboardActions.getInstance()); 242 this.addKeyListener(FrameKeyboardActions.getInstance()); 244 243 245 244 _mouseEventRouter.addExpediteeMouseListener(FrameMouseActions.getInstance()); -
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r333 r345 38 38 39 39 public class FrameKeyboardActions implements KeyListener { 40 41 private static FrameKeyboardActions _instance = new FrameKeyboardActions(); 42 private FrameKeyboardActions() { 43 } 44 45 public static FrameKeyboardActions getInstance() { 46 return _instance; 47 } 48 40 49 41 50 private static Text _toRemove = null; -
trunk/src_apollo/org/apollo/ApolloSystem.java
r344 r345 27 27 import org.expeditee.actions.Actions; 28 28 import org.expeditee.gui.Browser; 29 import org.expeditee.gui.FrameKeyboardActions; 29 30 import org.expeditee.gui.FrameMouseActions; 30 31 import org.expeditee.importer.FrameDNDTransferHandler; … … 108 109 }); 109 110 111 Browser._theBrowser.getContentPane().removeKeyListener(FrameKeyboardActions.getInstance()); 112 Browser._theBrowser.removeKeyListener(FrameKeyboardActions.getInstance()); 113 110 114 Browser._theBrowser.getContentPane().addKeyListener(new AudioFrameKeyboardActions()); 111 115 Browser._theBrowser.addKeyListener(new AudioFrameKeyboardActions()); 116 112 117 // Filter out some special mouse move cases 113 118 Browser._theBrowser.getMouseEventRouter().removeExpediteeMouseMotionListener( -
trunk/src_apollo/org/apollo/AudioFrameKeyboardActions.java
r344 r345 4 4 import java.awt.event.KeyListener; 5 5 6 import org.apollo.widgets.LinkedTrack; 7 import org.apollo.widgets.SampledTrack; 6 8 import org.expeditee.gui.FrameGraphics; 9 import org.expeditee.gui.FrameKeyboardActions; 10 import org.expeditee.gui.FrameMouseActions; 11 import org.expeditee.items.widgets.InteractiveWidget; 12 import org.expeditee.items.widgets.WidgetCorner; 13 import org.expeditee.items.widgets.WidgetEdge; 7 14 8 15 /** … … 16 23 static boolean isControlDown = false; 17 24 static boolean isShiftDown = false; 25 26 private static final long TRACK_WIDGET_TIMELINE_ADJUSTMENT = 50; // In audio-frames 18 27 19 28 public void keyPressed(KeyEvent e) { … … 22 31 isShiftDown = e.isShiftDown(); 23 32 24 if (e.getKeyCode() == KeyEvent.VK_CONTROL) { 25 FrameGraphics.refresh(false); // For special post effects 33 boolean forwardToExpeditee = true; 34 35 switch(e.getKeyCode()) { 36 37 case KeyEvent.VK_CONTROL: 38 FrameGraphics.refresh(false); // For special post effects 39 break; 40 41 // Ultra-fine timeline placement of audio tracks 42 case KeyEvent.VK_RIGHT: 43 case KeyEvent.VK_LEFT: 44 45 if (isControlDown) { 46 InteractiveWidget selectedIW = null; 47 48 if (FrameMouseActions.getlastHighlightedItem() != null && 49 FrameMouseActions.getlastHighlightedItem() instanceof WidgetEdge) { 50 selectedIW = ((WidgetEdge)FrameMouseActions.getlastHighlightedItem()).getWidgetSource(); 51 } else if (FrameMouseActions.getlastHighlightedItem() != null && 52 FrameMouseActions.getlastHighlightedItem() instanceof WidgetCorner) { 53 selectedIW = ((WidgetCorner)FrameMouseActions.getlastHighlightedItem()).getWidgetSource(); 54 } 55 56 long frameAjdustment = TRACK_WIDGET_TIMELINE_ADJUSTMENT; 57 if (e.getKeyCode() == KeyEvent.VK_LEFT) frameAjdustment *= -1; 58 59 if (selectedIW != null && selectedIW instanceof SampledTrack) { 60 SampledTrack stwidget = (SampledTrack)selectedIW; 61 stwidget.setInitiationTime(stwidget.getInitiationTimeFromMeta() + frameAjdustment); 62 forwardToExpeditee = false; 63 } else if (selectedIW != null && selectedIW instanceof LinkedTrack) { 64 LinkedTrack ltwidget = (LinkedTrack)selectedIW; 65 ltwidget.setInitiationTime(ltwidget.getInitiationTimeFromMeta() + frameAjdustment); 66 forwardToExpeditee = false; 67 } 68 69 } 70 71 break; 26 72 } 27 73 74 if (forwardToExpeditee) { 75 FrameKeyboardActions.getInstance().keyPressed(e); 76 } 77 28 78 } 29 79 … … 32 82 isControlDown = e.isControlDown(); 33 83 isShiftDown = e.isShiftDown(); 34 84 35 85 switch(e.getKeyCode()) { 36 86 case KeyEvent.VK_CONTROL: … … 42 92 } 43 93 break; 94 44 95 } 96 97 FrameKeyboardActions.getInstance().keyReleased(e); 45 98 } 46 99 47 100 public void keyTyped(KeyEvent e) { 101 FrameKeyboardActions.getInstance().keyTyped(e); 48 102 } 49 103 -
trunk/src_apollo/org/apollo/widgets/LinkedTrack.java
r344 r345 43 43 import org.apollo.audio.util.PlaybackClock; 44 44 import org.apollo.audio.util.SoundDesk; 45 import org.apollo.audio.util.Timeline; 45 46 import org.apollo.audio.util.TrackMixSubject; 46 47 import org.apollo.audio.util.MultiTrackPlaybackController.MultitrackLoadListener; … … 853 854 } 854 855 856 857 /** 858 * Adjusts the initiation time for this track - to the exact millisecond. 859 * 860 * The x-position is updated (which will be eventually done with possibly better 861 * accuracy if the layout daemon is on) 862 * 863 * @param specificInitTime 864 * The new initiation time for this track in milliseconds 865 */ 866 public void setInitiationTime(long specificInitTime) { 867 868 Frame parent = getParentFrame(); 869 870 // Update x position if it can 871 if (parent != null) { 872 Timeline tl = FrameLayoutDaemon.getInstance().getTimeline(parent); 873 if (tl != null) { 874 this.setPosition(tl.getXAtMSTime(specificInitTime), getY()); 875 } 876 } 877 878 updateData(TrackWidgetCommons.META_INITIATIONTIME_TAG, TrackWidgetCommons.META_INITIATIONTIME_TAG + specificInitTime); 879 880 String absLink = getAbsoluteLink(); 881 882 // If this track is in the audio model ... 883 if (AudioStructureModel.getInstance().getLinkedTrackGraphInfo(virtualFilename, (parent != null) ? parent.getName() : null) != null && 884 absLink != null) { 885 886 FrameLayoutDaemon.getInstance().suspendLayout(DisplayIO.getCurrentFrame(), null); 887 888 try { 889 890 // Add and remove it 891 AudioStructureModel.getInstance().onLinkedTrackWidgetRemoved(virtualFilename, (parent != null) ? parent.getName() : null); 892 893 AudioStructureModel.getInstance().onLinkedTrackWidgetAnchored( 894 virtualFilename, 895 (parent != null) ? parent.getName() : null, 896 specificInitTime, 897 absLink, 898 getName()); 899 900 } finally { 901 FrameLayoutDaemon.getInstance().resumeLayout(null); 902 } 903 904 } 905 } 906 855 907 /** 856 908 * @return
Note:
See TracChangeset
for help on using the changeset viewer.