Ignore:
Timestamp:
09/26/08 10:04:49 (16 years ago)
Author:
bjn8
Message:

Improved recording interactions for faster idea capturing.
Various fixes for interactive widgets

Location:
trunk/src_apollo/org/apollo/widgets
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src_apollo/org/apollo/widgets/FramePlayer.java

    r315 r333  
    193193                updateButtonGUI();
    194194                updateBorderColor();
     195                setWidgetEdgeThickness(TrackWidgetCommons.PLAYING_TRACK_EDGE_THICKNESS); // TODO: Fix this work around
     196                setWidgetEdgeThickness(TrackWidgetCommons.STOPPED_TRACK_EDGE_THICKNESS);
    195197
    196198        }
  • trunk/src_apollo/org/apollo/widgets/LinkedTrack.java

    r319 r333  
    228228                updateBorderColor();
    229229               
     230                setWidgetEdgeThickness(TrackWidgetCommons.PLAYING_TRACK_EDGE_THICKNESS); // TODO: Fix this work around
     231                setWidgetEdgeThickness(TrackWidgetCommons.STOPPED_TRACK_EDGE_THICKNESS);
     232               
    230233               
    231234        }
     
    18711874        }
    18721875       
     1876        @Override
     1877        public boolean isWidgetEdgeThicknessAdjustable() {
     1878                return false;
     1879        }
     1880       
     1881       
    18731882
    18741883}
  • trunk/src_apollo/org/apollo/widgets/MetronomePlayer.java

    r332 r333  
    119119                _swingComponent.add(enabledCheckbox);
    120120               
     121                setWidgetEdgeThickness(TrackWidgetCommons.PLAYING_TRACK_EDGE_THICKNESS); // TODO: Fix this work around
     122                setWidgetEdgeThickness(TrackWidgetCommons.STOPPED_TRACK_EDGE_THICKNESS);
     123               
    121124        }
    122125       
  • trunk/src_apollo/org/apollo/widgets/SampleRecorder.java

    r332 r333  
    4242import org.apollo.gui.WaveFormRenderer;
    4343import org.apollo.io.IconRepository;
     44import org.apollo.items.RecordOverdubLauncher;
    4445import org.apollo.mvc.Observer;
    4546import org.apollo.mvc.Subject;
     
    9495        private boolean hasExplicityStopped = false;
    9596       
    96         private boolean isSelfDestructable = false;
     97        private boolean isTemporary = false;
    9798       
    9899        private final static int BUTTON_HEIGHT = 50;
     
    109110        private final static int RENDER_POINTS_PER_SECOND = 20; // how many points to render each second
    110111       
    111         private final static String SELF_DESTRUCT_OFF_META = "permanent";
    112112        private final static String COUNTDOWN_META = "countdown=";
    113113       
    114        
    115114        public SampleRecorder(Text source, String[] args) {
     115                this(source, args, false);
     116        }
     117       
     118        public SampleRecorder(Text source, String[] args, boolean isTemporary) {
    116119                super(source, new JPanel(new GridBagLayout()),
    117120                                AnimatedSampleGraph.GRAPH_WIDTH + (2 * HORO_SPACING),
     
    120123                                COUNTDOWN_SETTINGS_HEIGHT + BUTTON_HEIGHT + LABEL_HEIGHT + AnimatedSampleGraph.GRAPH_HEIGHT + (4 * VERT_SPACING));
    121124               
    122                 isSelfDestructable = !containsDataTrimmedIgnoreCase(SELF_DESTRUCT_OFF_META);
     125                this.isTemporary = isTemporary;
     126               
    123127                int countdown = getStrippedDataInt(COUNTDOWN_META, 0);
    124128                if (countdown < 0) countdown = 0;
     
    200204                buttonPane.add(stopButton, c);
    201205
    202                
    203206                // Assemble
    204207               
     
    230233
    231234                setState(WidgetState.Ready, "Ready");
     235        }
     236       
     237        /**
     238         * Starts recording with playback... counts down if one is set
     239         *
     240         */
     241        public void commenceOverdubRecording() {
     242                shouldPlayback = true;
     243                setState(WidgetState.CountingDown, "Counting down...");
     244        }
     245       
     246        /**
     247         *
     248         * @param countdown
     249         *              The countdown in seconds
     250         *
     251         * @throws IllegalArgumentException
     252         *                      if countdown isn't allowed (due to restraints, i.e. can't be negative)
     253         */
     254        public void setCountdown(int countdown) {
     255                this.countDownSpinner.setValue(countdown);
    232256        }
    233257       
     
    250274                if (newState == WidgetState.Ready) {
    251275
     276                        // Self destructable recorders are only temporary.. is returned back to a ready state then
     277                        // get rid of them completely
     278                        if (oldState != null && isTemporary) {
     279                                removeSelf();
     280                        }
     281                       
    252282                        recordButton.setVisible(true);
    253283                        recordSynchedButton.setVisible(true);
     
    330360                        } else {
    331361                               
    332                                 if (isSelfDestructable) {
     362                                if (isTemporary) {
    333363                                        // Remove this temporary widget
    334364                                        removeSelf();
     
    360390                                                         null);
    361391                                         
    362                                          if (isSelfDestructable) {
     392                                         if (isTemporary) {
    363393                                                 
    364394                                                 targetFrame.addAllItems(trackWidget.getItems());
     
    420450                List<String> data = new LinkedList<String>();
    421451               
    422                 if (isSelfDestructable)
    423                         data.add(SELF_DESTRUCT_OFF_META);
    424                
    425452                data.add(COUNTDOWN_META + countDownSpinner.getValue());
    426453
     
    566593                        }
    567594                       
    568                 } else if (e.getSource() == recordButton || e.getSource() == recordSynchedButton) {
     595                } else if (e.getSource() == recordButton) {
    569596                        assert (state == WidgetState.Ready);
    570                         shouldPlayback = (e.getSource() == recordSynchedButton);
     597                        shouldPlayback = false;
    571598                        setState(WidgetState.CountingDown, "Counting down...");
     599                } else if (e.getSource() == recordSynchedButton) {
     600                        assert (state == WidgetState.Ready);
     601                       
     602                        Frame target = DisplayIO.getCurrentFrame();
     603                        if (target  == null) return;
     604
     605                        // Create the launcher
     606                       
     607                        RecordOverdubLauncher launcher = new RecordOverdubLauncher((Integer)countDownSpinner.getValue());
     608                        launcher.setPosition(FrameMouseActions.MouseX, FrameMouseActions.MouseY);
     609
     610                        // Pick it up
     611                        FrameMouseActions.pickup(launcher);
     612                       
    572613                }
    573614
     
    9621003        }
    9631004       
     1005        @Override
     1006        public boolean isWidgetEdgeThicknessAdjustable() {
     1007                return false;
     1008        }
     1009       
    9641010}
  • trunk/src_apollo/org/apollo/widgets/SampledTrack.java

    r331 r333  
    444444                // Make sure border color is correct
    445445                updateBorderColor();
     446                setWidgetEdgeThickness(TrackWidgetCommons.PLAYING_TRACK_EDGE_THICKNESS); // TODO: Fix this work around
    446447                setWidgetEdgeThickness(TrackWidgetCommons.STOPPED_TRACK_EDGE_THICKNESS);
    447448
     
    18701871                                        );
    18711872                }
    1872 
    1873         }
     1873               
     1874        }
     1875
     1876        @Override
     1877        public boolean isWidgetEdgeThicknessAdjustable() {
     1878                return false;
     1879        }
     1880       
     1881       
    18741882       
    18751883}
Note: See TracChangeset for help on using the changeset viewer.